Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(projects): optimize yuque project #219

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/fluent-editor/src/config/editor.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ export function isInside(position, dom) {
} = areaPosition
const inside
= left > areaLeft
&& left < areaLeft + areaWidth
&& top > areaTop
&& top < areaTop + areaHeight
&& left < areaLeft + areaWidth
&& top > areaTop
&& top < areaTop + areaHeight
return inside
}

Expand Down
6 changes: 3 additions & 3 deletions packages/fluent-editor/src/modules/custom-clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ class CustomClipboard extends Clipboard {
const hexImage = hexImages.length && hexImages.shift()
const newImage
= hexImage
&& `data:${hexImage.type};base64,${this.convertHexToBase64(
hexImage.hex,
)}`
&& `data:${hexImage.type};base64,${this.convertHexToBase64(
hexImage.hex,
)}`
imageIndex = index
file = await imageUrlToFile(newImage || image.src || image)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export default class CustomResizeAction extends Action {
rootStyle = getElementStyle(root)
}
this.maxWidth = root.clientWidth
- Number.parseFloat(rootStyle.paddingRight)
- Number.parseFloat(rootStyle.paddingLeft)
- Number.parseFloat(rootStyle.paddingRight)
- Number.parseFloat(rootStyle.paddingLeft)

document.addEventListener('mousemove', this.onDrag)
document.addEventListener('mouseup', this.onMouseUp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ export default class TableSelection {
const { x, y, width, height } = getRelativeRect(tableCell.domNode.getBoundingClientRect(), this.quill.root.parentNode)
const isCellIncluded
= x + ERROR_LIMIT >= this.boundary.x
&& x - ERROR_LIMIT + width <= this.boundary.x1
&& y + ERROR_LIMIT >= this.boundary.y
&& y - ERROR_LIMIT + height <= this.boundary.y1
&& x - ERROR_LIMIT + width <= this.boundary.x1
&& y + ERROR_LIMIT >= this.boundary.y
&& y - ERROR_LIMIT + height <= this.boundary.y1

if (isCellIncluded) {
selectedCells.push(tableCell)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class Picker {
}
const isActive
= !isNullOrUndefined(option)
&& option !== this.select.querySelector('option[selected]')
&& option !== this.select.querySelector('option[selected]')

if (isActive) {
this.label.classList.add('ql-active')
Expand Down
8 changes: 4 additions & 4 deletions packages/fluent-editor/src/modules/toolbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class BetterToolbar extends Toolbar {
// '1' should match with 1 (headers)
let isActive
= formats[format] === input.getAttribute('value')
|| (!isNullOrUndefined(formats[format])
&& (formats[format].value === input.getAttribute('value')
|| formats[format].toString() === input.getAttribute('value')))
|| (isNullOrUndefined(formats[format]) && !input.getAttribute('value'))
|| (!isNullOrUndefined(formats[format])
&& (formats[format].value === input.getAttribute('value')
|| formats[format].toString() === input.getAttribute('value')))
|| (isNullOrUndefined(formats[format]) && !input.getAttribute('value'))

if (!isActive) {
const checkFormat = formats[format]
Expand Down
12 changes: 6 additions & 6 deletions packages/fluent-editor/src/utils/method.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/** Detect free variable `global` from Node.js. */
const freeGlobal
= typeof global === 'object'
&& global !== null
&& global.Object === Object
&& global
&& global !== null
&& global.Object === Object
&& global

/** Detect free variable `globalThis` */
const freeGlobalThis
= typeof globalThis === 'object'
&& globalThis !== null
&& globalThis.Object == Object
&& globalThis
&& globalThis !== null
&& globalThis.Object == Object
&& globalThis

/** Detect free variable `self`. */
const freeSelf
Expand Down
2 changes: 1 addition & 1 deletion packages/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<title>使用 TinyEditor 搭建的项目</title>
</head>
<body>
<div id="app"></div>
Expand Down
1 change: 1 addition & 0 deletions packages/projects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dependencies": {
"@opentiny/fluent-editor": "3.25.0",
"@tailwindcss/vite": "^4.0.0",
"quill-header-list": "0.0.2",
"sass": "^1.47.0",
"tailwindcss": "^4.0.0",
"vue": "^3.5.13",
Expand Down
1 change: 1 addition & 0 deletions packages/projects/src/style.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import 'tailwindcss';
@import '@opentiny/fluent-editor/style.css';
@import 'quill-header-list/dist/index.css';
Loading
Loading