@threadlabs/looma 0.15.5 → 0.15.7
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/components/ui-tree/ui-tree.html +2 -2
- package/components/ui-tree-item/ui-tree-item.html +11 -10
- package/components/ui-tree-item/ui-tree-item.js +54 -9
- package/dist/index.js +1 -1
- package/editor/chunks/extensions.js +8 -2
- package/editor/extensions/preset.d.ts +7 -0
- package/package.json +1 -1
- package/styles/ui-tree-item.css +12 -12
- package/vue/UiTreeItem.vue +8 -8
- package/vue/chunks/UiTreeItem.js +1 -1
- package/vue/components.css +88 -88
- package/vue/editor/LoomaEditor.d.ts +17 -0
- package/vue/editor/index.js +12 -2
|
@@ -94,6 +94,14 @@ export declare const LoomaEditor: import("vue").DefineComponent<import("vue").Ex
|
|
|
94
94
|
type: PropType<LoomaEditorToolbarMode>;
|
|
95
95
|
default: string;
|
|
96
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* Authors can't highlight: no toolbar button, shortcut, `==text==` rule, or `<mark>` paste.
|
|
99
|
+
* Highlights already in the document still show. Read once, when the editor is created.
|
|
100
|
+
*/
|
|
101
|
+
disableHighlight: {
|
|
102
|
+
type: BooleanConstructor;
|
|
103
|
+
default: boolean;
|
|
104
|
+
};
|
|
97
105
|
}>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
98
106
|
[key: string]: any;
|
|
99
107
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -160,6 +168,14 @@ export declare const LoomaEditor: import("vue").DefineComponent<import("vue").Ex
|
|
|
160
168
|
type: PropType<LoomaEditorToolbarMode>;
|
|
161
169
|
default: string;
|
|
162
170
|
};
|
|
171
|
+
/**
|
|
172
|
+
* Authors can't highlight: no toolbar button, shortcut, `==text==` rule, or `<mark>` paste.
|
|
173
|
+
* Highlights already in the document still show. Read once, when the editor is created.
|
|
174
|
+
*/
|
|
175
|
+
disableHighlight: {
|
|
176
|
+
type: BooleanConstructor;
|
|
177
|
+
default: boolean;
|
|
178
|
+
};
|
|
163
179
|
}>> & Readonly<{
|
|
164
180
|
"onUpdate:modelValue"?: ((_value: JSONContent) => any) | undefined;
|
|
165
181
|
onUpdate?: ((_value: JSONContent) => any) | undefined;
|
|
@@ -170,6 +186,7 @@ export declare const LoomaEditor: import("vue").DefineComponent<import("vue").Ex
|
|
|
170
186
|
}>, {
|
|
171
187
|
label: string;
|
|
172
188
|
placeholder: string;
|
|
189
|
+
disableHighlight: boolean;
|
|
173
190
|
modelValue: JSONContent;
|
|
174
191
|
editable: boolean;
|
|
175
192
|
extensions: AnyExtension[];
|
package/vue/editor/index.js
CHANGED
|
@@ -322,6 +322,14 @@ var LoomaEditor = defineComponent({
|
|
|
322
322
|
toolbarMode: {
|
|
323
323
|
type: String,
|
|
324
324
|
default: "bubble"
|
|
325
|
+
},
|
|
326
|
+
/**
|
|
327
|
+
* Authors can't highlight: no toolbar button, shortcut, `==text==` rule, or `<mark>` paste.
|
|
328
|
+
* Highlights already in the document still show. Read once, when the editor is created.
|
|
329
|
+
*/
|
|
330
|
+
disableHighlight: {
|
|
331
|
+
type: Boolean,
|
|
332
|
+
default: false
|
|
325
333
|
}
|
|
326
334
|
},
|
|
327
335
|
emits: {
|
|
@@ -457,11 +465,13 @@ var LoomaEditor = defineComponent({
|
|
|
457
465
|
text: selection instanceof TextSelection
|
|
458
466
|
};
|
|
459
467
|
};
|
|
468
|
+
const authorHighlight = !props.disableHighlight;
|
|
460
469
|
const editor = useEditor({
|
|
461
470
|
extensions: [
|
|
462
471
|
...getDefaultEditorExtensions({
|
|
463
472
|
placeholder: props.placeholder,
|
|
464
|
-
mention: mentionExtension ?? false
|
|
473
|
+
mention: mentionExtension ?? false,
|
|
474
|
+
disableHighlight: props.disableHighlight
|
|
465
475
|
}),
|
|
466
476
|
imageDelivery.extension,
|
|
467
477
|
slashExtension,
|
|
@@ -997,7 +1007,7 @@ var LoomaEditor = defineComponent({
|
|
|
997
1007
|
commandButton("Italic", "italic", instance.isActive("italic"), !instance.can().toggleItalic(), () => instance.chain().focus().toggleItalic().run()),
|
|
998
1008
|
commandButton("Underline", "underline", instance.isActive("underline"), !instance.can().toggleUnderline(), () => instance.chain().focus().toggleUnderline().run()),
|
|
999
1009
|
commandButton("Strike", "strikethrough", instance.isActive("strike"), !instance.can().toggleStrike(), () => instance.chain().focus().toggleStrike().run()),
|
|
1000
|
-
commandButton("Highlight", "highlighter", instance.isActive("highlight"), !instance.can().toggleHighlight(), () => instance.chain().focus().toggleHighlight().run()),
|
|
1010
|
+
...authorHighlight ? [commandButton("Highlight", "highlighter", instance.isActive("highlight"), !instance.can().toggleHighlight(), () => instance.chain().focus().toggleHighlight().run())] : [],
|
|
1001
1011
|
commandButton("Inline code", "code-xml", instance.isActive("code"), !instance.can().toggleCode(), () => instance.chain().focus().toggleCode().run()),
|
|
1002
1012
|
h(IconButton, {
|
|
1003
1013
|
id: linkAnchorId,
|