@rufous/ui 0.2.60 → 0.2.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs +11 -2
- package/dist/main.css +14 -4
- package/dist/main.js +11 -2
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -9661,6 +9661,9 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
9661
9661
|
}
|
|
9662
9662
|
return false;
|
|
9663
9663
|
}
|
|
9664
|
+
if (this.editor.storage.taskTodoEnabled === false) {
|
|
9665
|
+
return false;
|
|
9666
|
+
}
|
|
9664
9667
|
const taskNode = $from.node(taskDepth);
|
|
9665
9668
|
const status = taskNode.attrs.status || "todo";
|
|
9666
9669
|
const schema = state.schema;
|
|
@@ -9763,7 +9766,7 @@ var CustomTaskItem = import_extension_task_item.default.extend({
|
|
|
9763
9766
|
addNodeView() {
|
|
9764
9767
|
return ({ node, HTMLAttributes, getPos, editor }) => {
|
|
9765
9768
|
const li = document.createElement("li");
|
|
9766
|
-
li.style.cssText = "display: flex; align-items: flex-start; gap: 6px; margin: 0; list-style: none; ";
|
|
9769
|
+
li.style.cssText = "display: flex; align-items: flex-start; gap: 6px; margin: 0; list-style: none; line-height: 1.7; ";
|
|
9767
9770
|
Object.entries(HTMLAttributes || {}).forEach(([key, val]) => {
|
|
9768
9771
|
if (val != null && val !== false) {
|
|
9769
9772
|
li.setAttribute(key, String(val));
|
|
@@ -11752,14 +11755,20 @@ var RufousTextEditor = ({
|
|
|
11752
11755
|
const wrapperRef = (0, import_react58.useRef)(null);
|
|
11753
11756
|
(0, import_react58.useEffect)(() => {
|
|
11754
11757
|
if (!editor) return;
|
|
11758
|
+
let blurTimer = null;
|
|
11755
11759
|
const handler = ({ event }) => {
|
|
11756
11760
|
const relatedTarget = event?.relatedTarget;
|
|
11757
11761
|
if (relatedTarget && wrapperRef.current?.contains(relatedTarget)) return;
|
|
11758
|
-
|
|
11762
|
+
if (relatedTarget?.closest?.(".rf-rte-mention-dropdown, .tippy-box, .link-modal-overlay, .ai-modal-overlay, .modal-overlay, .rf-spell-tooltip")) return;
|
|
11763
|
+
if (blurTimer) clearTimeout(blurTimer);
|
|
11764
|
+
blurTimer = setTimeout(() => {
|
|
11765
|
+
onBlurRef.current?.(editor.getHTML(), editor.getJSON());
|
|
11766
|
+
}, 100);
|
|
11759
11767
|
};
|
|
11760
11768
|
editor.on("blur", handler);
|
|
11761
11769
|
return () => {
|
|
11762
11770
|
editor.off("blur", handler);
|
|
11771
|
+
if (blurTimer) clearTimeout(blurTimer);
|
|
11763
11772
|
};
|
|
11764
11773
|
}, [editor]);
|
|
11765
11774
|
const setLinkRef = (0, import_react58.useRef)(null);
|
package/dist/main.css
CHANGED
|
@@ -7293,6 +7293,12 @@ pre {
|
|
|
7293
7293
|
flex-shrink: 0;
|
|
7294
7294
|
margin-top: 3px;
|
|
7295
7295
|
}
|
|
7296
|
+
.rf-rte-wrapper .tiptap ul[data-type=taskList] li {
|
|
7297
|
+
line-height: 1.7 !important;
|
|
7298
|
+
}
|
|
7299
|
+
.rf-rte-wrapper .tiptap ul[data-type=taskList] li p[style*=line-height] {
|
|
7300
|
+
line-height: inherit !important;
|
|
7301
|
+
}
|
|
7296
7302
|
.rf-rte-wrapper .task-checkbox {
|
|
7297
7303
|
display: inline-flex;
|
|
7298
7304
|
align-items: center;
|
|
@@ -9106,14 +9112,18 @@ pre {
|
|
|
9106
9112
|
}
|
|
9107
9113
|
.rf-rte-content ul[data-type=taskList] {
|
|
9108
9114
|
list-style: none;
|
|
9109
|
-
padding-left:
|
|
9115
|
+
padding-left: 24px;
|
|
9110
9116
|
}
|
|
9111
9117
|
.rf-rte-content ul[data-type=taskList] li {
|
|
9112
9118
|
display: flex;
|
|
9113
9119
|
align-items: flex-start;
|
|
9114
|
-
gap:
|
|
9115
|
-
margin:
|
|
9120
|
+
gap: 6px;
|
|
9121
|
+
margin: 0;
|
|
9116
9122
|
list-style: none;
|
|
9123
|
+
line-height: 1.7;
|
|
9124
|
+
}
|
|
9125
|
+
.rf-rte-content ul[data-type=taskList] li p {
|
|
9126
|
+
margin: 0;
|
|
9117
9127
|
}
|
|
9118
9128
|
.rf-rte-content ul[data-type=taskList] li::before {
|
|
9119
9129
|
content: "";
|
|
@@ -9121,7 +9131,7 @@ pre {
|
|
|
9121
9131
|
display: inline-block;
|
|
9122
9132
|
width: 18px;
|
|
9123
9133
|
height: 18px;
|
|
9124
|
-
margin-top:
|
|
9134
|
+
margin-top: 3px;
|
|
9125
9135
|
border-radius: 3px;
|
|
9126
9136
|
border: 2px solid #dc2626;
|
|
9127
9137
|
background-repeat: no-repeat;
|
package/dist/main.js
CHANGED
|
@@ -9595,6 +9595,9 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
9595
9595
|
}
|
|
9596
9596
|
return false;
|
|
9597
9597
|
}
|
|
9598
|
+
if (this.editor.storage.taskTodoEnabled === false) {
|
|
9599
|
+
return false;
|
|
9600
|
+
}
|
|
9598
9601
|
const taskNode = $from.node(taskDepth);
|
|
9599
9602
|
const status = taskNode.attrs.status || "todo";
|
|
9600
9603
|
const schema = state.schema;
|
|
@@ -9697,7 +9700,7 @@ var CustomTaskItem = TaskItem.extend({
|
|
|
9697
9700
|
addNodeView() {
|
|
9698
9701
|
return ({ node, HTMLAttributes, getPos, editor }) => {
|
|
9699
9702
|
const li = document.createElement("li");
|
|
9700
|
-
li.style.cssText = "display: flex; align-items: flex-start; gap: 6px; margin: 0; list-style: none; ";
|
|
9703
|
+
li.style.cssText = "display: flex; align-items: flex-start; gap: 6px; margin: 0; list-style: none; line-height: 1.7; ";
|
|
9701
9704
|
Object.entries(HTMLAttributes || {}).forEach(([key, val]) => {
|
|
9702
9705
|
if (val != null && val !== false) {
|
|
9703
9706
|
li.setAttribute(key, String(val));
|
|
@@ -11686,14 +11689,20 @@ var RufousTextEditor = ({
|
|
|
11686
11689
|
const wrapperRef = useRef29(null);
|
|
11687
11690
|
useEffect26(() => {
|
|
11688
11691
|
if (!editor) return;
|
|
11692
|
+
let blurTimer = null;
|
|
11689
11693
|
const handler = ({ event }) => {
|
|
11690
11694
|
const relatedTarget = event?.relatedTarget;
|
|
11691
11695
|
if (relatedTarget && wrapperRef.current?.contains(relatedTarget)) return;
|
|
11692
|
-
|
|
11696
|
+
if (relatedTarget?.closest?.(".rf-rte-mention-dropdown, .tippy-box, .link-modal-overlay, .ai-modal-overlay, .modal-overlay, .rf-spell-tooltip")) return;
|
|
11697
|
+
if (blurTimer) clearTimeout(blurTimer);
|
|
11698
|
+
blurTimer = setTimeout(() => {
|
|
11699
|
+
onBlurRef.current?.(editor.getHTML(), editor.getJSON());
|
|
11700
|
+
}, 100);
|
|
11693
11701
|
};
|
|
11694
11702
|
editor.on("blur", handler);
|
|
11695
11703
|
return () => {
|
|
11696
11704
|
editor.off("blur", handler);
|
|
11705
|
+
if (blurTimer) clearTimeout(blurTimer);
|
|
11697
11706
|
};
|
|
11698
11707
|
}, [editor]);
|
|
11699
11708
|
const setLinkRef = useRef29(null);
|