Skip to content

Commit c35c02d

Browse files
docs(projects): optimize yuque project (#219)
* docs(projects): optimize yuque project * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 5d953e6 commit c35c02d

File tree

12 files changed

+335
-57
lines changed

12 files changed

+335
-57
lines changed

packages/fluent-editor/src/config/editor.utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ export function isInside(position, dom) {
196196
} = areaPosition
197197
const inside
198198
= left > areaLeft
199-
&& left < areaLeft + areaWidth
200-
&& top > areaTop
201-
&& top < areaTop + areaHeight
199+
&& left < areaLeft + areaWidth
200+
&& top > areaTop
201+
&& top < areaTop + areaHeight
202202
return inside
203203
}
204204

packages/fluent-editor/src/modules/custom-clipboard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,9 +446,9 @@ class CustomClipboard extends Clipboard {
446446
const hexImage = hexImages.length && hexImages.shift()
447447
const newImage
448448
= hexImage
449-
&& `data:${hexImage.type};base64,${this.convertHexToBase64(
450-
hexImage.hex,
451-
)}`
449+
&& `data:${hexImage.type};base64,${this.convertHexToBase64(
450+
hexImage.hex,
451+
)}`
452452
imageIndex = index
453453
file = await imageUrlToFile(newImage || image.src || image)
454454
}

packages/fluent-editor/src/modules/custom-image/actions/CustomResizeAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export default class CustomResizeAction extends Action {
131131
rootStyle = getElementStyle(root)
132132
}
133133
this.maxWidth = root.clientWidth
134-
- Number.parseFloat(rootStyle.paddingRight)
135-
- Number.parseFloat(rootStyle.paddingLeft)
134+
- Number.parseFloat(rootStyle.paddingRight)
135+
- Number.parseFloat(rootStyle.paddingLeft)
136136

137137
document.addEventListener('mousemove', this.onDrag)
138138
document.addEventListener('mouseup', this.onMouseUp)

packages/fluent-editor/src/modules/table/modules/table-selection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ export default class TableSelection {
251251
const { x, y, width, height } = getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode)
252252
const isCellIncluded
253253
= x + ERROR_LIMIT >= this.boundary.x
254-
&& x - ERROR_LIMIT + width <= this.boundary.x1
255-
&& y + ERROR_LIMIT >= this.boundary.y
256-
&& y - ERROR_LIMIT + height <= this.boundary.y1
254+
&& x - ERROR_LIMIT + width <= this.boundary.x1
255+
&& y + ERROR_LIMIT >= this.boundary.y
256+
&& y - ERROR_LIMIT + height <= this.boundary.y1
257257

258258
if (isCellIncluded) {
259259
selectedCells.push(tableCell)

packages/fluent-editor/src/modules/toolbar/better-picker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class Picker {
196196
}
197197
const isActive
198198
= !isNullOrUndefined(option)
199-
&& option !== this.select.querySelector('option[selected]')
199+
&& option !== this.select.querySelector('option[selected]')
200200

201201
if (isActive) {
202202
this.label.classList.add('ql-active')

packages/fluent-editor/src/modules/toolbar/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ class BetterToolbar extends Toolbar {
6767
// '1' should match with 1 (headers)
6868
let isActive
6969
= formats[format] === input.getAttribute('value')
70-
|| (!isNullOrUndefined(formats[format])
71-
&& (formats[format].value === input.getAttribute('value')
72-
|| formats[format].toString() === input.getAttribute('value')))
73-
|| (isNullOrUndefined(formats[format]) && !input.getAttribute('value'))
70+
|| (!isNullOrUndefined(formats[format])
71+
&& (formats[format].value === input.getAttribute('value')
72+
|| formats[format].toString() === input.getAttribute('value')))
73+
|| (isNullOrUndefined(formats[format]) && !input.getAttribute('value'))
7474

7575
if (!isActive) {
7676
const checkFormat = formats[format]

packages/fluent-editor/src/utils/method.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/** Detect free variable `global` from Node.js. */
22
const freeGlobal
33
= typeof global === 'object'
4-
&& global !== null
5-
&& global.Object === Object
6-
&& global
4+
&& global !== null
5+
&& global.Object === Object
6+
&& global
77

88
/** Detect free variable `globalThis` */
99
const freeGlobalThis
1010
= typeof globalThis === 'object'
11-
&& globalThis !== null
12-
&& globalThis.Object == Object
13-
&& globalThis
11+
&& globalThis !== null
12+
&& globalThis.Object == Object
13+
&& globalThis
1414

1515
/** Detect free variable `self`. */
1616
const freeSelf

packages/projects/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + Vue + TS</title>
7+
<title>使用 TinyEditor 搭建的项目</title>
88
</head>
99
<body>
1010
<div id="app"></div>

packages/projects/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dependencies": {
1212
"@opentiny/fluent-editor": "3.25.0",
1313
"@tailwindcss/vite": "^4.0.0",
14+
"quill-header-list": "0.0.2",
1415
"sass": "^1.47.0",
1516
"tailwindcss": "^4.0.0",
1617
"vue": "^3.5.13",

packages/projects/src/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
@import 'tailwindcss';
22
@import '@opentiny/fluent-editor/style.css';
3+
@import 'quill-header-list/dist/index.css';

0 commit comments

Comments
 (0)