@flexiui/svelte-rich-text 0.0.62 → 0.0.63
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/RichText.svelte +13 -10
- package/dist/getExtensions.d.ts +1 -0
- package/dist/getExtensions.js +2 -2
- package/dist/styles.css +2 -1
- package/package.json +1 -1
package/dist/RichText.svelte
CHANGED
|
@@ -91,9 +91,10 @@
|
|
|
91
91
|
docTextColor?: string;
|
|
92
92
|
buttonStyle?: "accent-soft" | "accent-solid";
|
|
93
93
|
};
|
|
94
|
-
contentWrapperAs?: T;
|
|
95
|
-
inlineNodeMode?: boolean;
|
|
96
|
-
|
|
94
|
+
contentWrapperAs?: T;
|
|
95
|
+
inlineNodeMode?: boolean;
|
|
96
|
+
trailingNode?: boolean;
|
|
97
|
+
}
|
|
97
98
|
|
|
98
99
|
type ToolbarButton =
|
|
99
100
|
| string
|
|
@@ -147,9 +148,10 @@
|
|
|
147
148
|
onPaste: () => {},
|
|
148
149
|
},
|
|
149
150
|
config,
|
|
150
|
-
contentWrapperAs = "div" as T,
|
|
151
|
-
inlineNodeMode = false,
|
|
152
|
-
|
|
151
|
+
contentWrapperAs = "div" as T,
|
|
152
|
+
inlineNodeMode = false,
|
|
153
|
+
trailingNode = true,
|
|
154
|
+
}: Props = $props();
|
|
153
155
|
|
|
154
156
|
let editor = $state() as Readable<Editor>;
|
|
155
157
|
|
|
@@ -276,9 +278,10 @@
|
|
|
276
278
|
"rgb(255, 102, 142)",
|
|
277
279
|
];
|
|
278
280
|
|
|
279
|
-
const extensions = getRichTextExtensions({
|
|
280
|
-
editable: true,
|
|
281
|
-
|
|
281
|
+
const extensions = getRichTextExtensions({
|
|
282
|
+
editable: true,
|
|
283
|
+
trailingNode,
|
|
284
|
+
customExtensions: [
|
|
282
285
|
Mathematics.configure({
|
|
283
286
|
inlineOptions: {
|
|
284
287
|
onClick: (node, pos) => {
|
|
@@ -712,7 +715,7 @@
|
|
|
712
715
|
</header>
|
|
713
716
|
{/if}
|
|
714
717
|
|
|
715
|
-
<EditorContent as={contentWrapperAs} editor={$editor} class="fl-rich-text-content
|
|
718
|
+
<EditorContent as={contentWrapperAs} editor={$editor} class="fl-rich-text-content" data-fl-editable="true" />
|
|
716
719
|
|
|
717
720
|
<!-- Warning message for node limit -->
|
|
718
721
|
{#if showLimitWarning && nodesLimit}
|
package/dist/getExtensions.d.ts
CHANGED
package/dist/getExtensions.js
CHANGED
|
@@ -28,7 +28,7 @@ const DocHeading = Heading.extend({
|
|
|
28
28
|
},
|
|
29
29
|
}).configure({ levels: [1] });
|
|
30
30
|
export function getRichTextExtensions(options) {
|
|
31
|
-
const { editable = false, customExtensions = [] } = options ?? {};
|
|
31
|
+
const { editable = false, trailingNode = true, customExtensions = [] } = options ?? {};
|
|
32
32
|
return [
|
|
33
33
|
DocHeading,
|
|
34
34
|
Heading.configure({ levels: [2, 3, 4, 5, 6] }),
|
|
@@ -37,7 +37,7 @@ export function getRichTextExtensions(options) {
|
|
|
37
37
|
// fontSize: false
|
|
38
38
|
}),
|
|
39
39
|
StarterKit.configure({
|
|
40
|
-
trailingNode: false,
|
|
40
|
+
trailingNode: trailingNode ? undefined : false,
|
|
41
41
|
link: false,
|
|
42
42
|
bulletList: false,
|
|
43
43
|
listItem: false,
|
package/dist/styles.css
CHANGED