@flexiui/svelte-rich-text 0.0.60 → 0.0.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/README.md +388 -185
- package/dist/RichText.svelte +382 -2070
- package/dist/RichText.svelte.d.ts +28 -0
- package/dist/Toolbar/RenderToolbarButton.svelte +147 -0
- package/dist/Toolbar/RenderToolbarButton.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/ClearFormatting.svelte +31 -0
- package/dist/Toolbar/action-buttons/ClearFormatting.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/ClearNodes.svelte +15 -0
- package/dist/Toolbar/action-buttons/ClearNodes.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/MergeCellsBtn.svelte +31 -0
- package/dist/Toolbar/action-buttons/MergeCellsBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/Redo.svelte +26 -0
- package/dist/Toolbar/action-buttons/Redo.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/SplitCellBtn.svelte +31 -0
- package/dist/Toolbar/action-buttons/SplitCellBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/Undo.svelte +30 -0
- package/dist/Toolbar/action-buttons/Undo.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Bold.svelte +29 -0
- package/dist/Toolbar/action-buttons/marks/Bold.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/CodeMarkBtn.svelte +33 -0
- package/dist/Toolbar/action-buttons/marks/CodeMarkBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/FontSize.svelte +99 -0
- package/dist/Toolbar/action-buttons/marks/FontSize.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Italic.svelte +27 -0
- package/dist/Toolbar/action-buttons/marks/Italic.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/LinkBtn.svelte +64 -0
- package/dist/Toolbar/action-buttons/marks/LinkBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/SpecialBox.svelte +21 -0
- package/dist/Toolbar/action-buttons/marks/SpecialBox.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Strike.svelte +30 -0
- package/dist/Toolbar/action-buttons/marks/Strike.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/TextAlign.svelte +66 -0
- package/dist/Toolbar/action-buttons/marks/TextAlign.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/marks/Underline.svelte +29 -0
- package/dist/Toolbar/action-buttons/marks/Underline.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Audio.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Audio.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Blockquote.svelte +25 -0
- package/dist/Toolbar/action-buttons/nodes/Blockquote.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/CodeBlock.svelte +37 -0
- package/dist/Toolbar/action-buttons/nodes/CodeBlock.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HardBreakBtn.svelte +26 -0
- package/dist/Toolbar/action-buttons/nodes/HardBreakBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HeadingBtn.svelte +78 -0
- package/dist/Toolbar/action-buttons/nodes/HeadingBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/HorizontalRule.svelte +24 -0
- package/dist/Toolbar/action-buttons/nodes/HorizontalRule.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Image.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Image.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/InlineMath.svelte +50 -0
- package/dist/Toolbar/action-buttons/nodes/InlineMath.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/ListBtn.svelte +43 -0
- package/dist/Toolbar/action-buttons/nodes/ListBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/MediaGridBtn.svelte +58 -0
- package/dist/Toolbar/action-buttons/nodes/MediaGridBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/action-buttons/nodes/Table.svelte +60 -0
- package/dist/Toolbar/action-buttons/nodes/Table.svelte.d.ts +14 -0
- package/dist/Toolbar/bubble-menus/BubbleMenuImage.svelte +139 -0
- package/dist/Toolbar/bubble-menus/BubbleMenuImage.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/HeadingsDropdownBtn.svelte +64 -0
- package/dist/Toolbar/dropdown-buttons/HeadingsDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/HighlightDropdownBtn.svelte +45 -0
- package/dist/Toolbar/dropdown-buttons/HighlightDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/LineHeightDropdownBtn.svelte +18 -0
- package/dist/Toolbar/dropdown-buttons/LineHeightDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/ListsDropdownBtn.svelte +188 -0
- package/dist/Toolbar/dropdown-buttons/ListsDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdown-buttons/TextColorDropdownBtn.svelte +37 -0
- package/dist/Toolbar/dropdown-buttons/TextColorDropdownBtn.svelte.d.ts +14 -0
- package/dist/Toolbar/dropdowns/LineHeightDropdown.svelte +26 -0
- package/dist/Toolbar/dropdowns/LineHeightDropdown.svelte.d.ts +14 -0
- package/dist/Toolbar/toolbar-utils.d.ts +1 -0
- package/dist/Toolbar/toolbar-utils.js +15 -0
- package/dist/extensions/NodeFontSize.d.ts +10 -0
- package/dist/extensions/NodeFontSize.js +53 -0
- package/dist/extensions/SemanticHeadings.d.ts +10 -0
- package/dist/extensions/SemanticHeadings.js +124 -0
- package/dist/extensions/Table/TableCellNodeView.svelte +0 -4
- package/dist/getExtensions.d.ts +7 -0
- package/dist/getExtensions.js +13 -2
- package/dist/styles.css +53 -10
- package/package.json +1 -1
package/dist/getExtensions.js
CHANGED
|
@@ -9,15 +9,23 @@ import { Mathematics } from "@tiptap/extension-mathematics";
|
|
|
9
9
|
import { TableKit } from "@tiptap/extension-table";
|
|
10
10
|
import { Audio } from "./extensions/Audio";
|
|
11
11
|
import { NodeLineHeight } from "./extensions/NodeLineHeight";
|
|
12
|
+
import { NodeFontSize } from "./extensions/NodeFontSize";
|
|
12
13
|
import { MediaGridExtension } from "./extensions/MediaGrid/MediaGrid";
|
|
13
14
|
import { MediaGridItemExtension } from "./extensions/MediaGrid/MediaGridItem";
|
|
14
15
|
import { CustomTableCell } from "./extensions/Table/CustomTableCell";
|
|
15
16
|
import { CustomTableHeader } from "./extensions/Table/CustomTableHeader";
|
|
16
17
|
import { EnhancedLink } from "./extensions/EnhancedLink";
|
|
18
|
+
import { SemanticHeadings } from "./extensions/SemanticHeadings";
|
|
17
19
|
import { Heading } from "@tiptap/extension-heading";
|
|
18
20
|
const DocHeading = Heading.extend({
|
|
19
21
|
name: "h1",
|
|
20
|
-
|
|
22
|
+
addCommands() {
|
|
23
|
+
return {
|
|
24
|
+
toggleH1: () => ({ commands }) => {
|
|
25
|
+
return commands.toggleNode('h1', 'paragraph');
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
},
|
|
21
29
|
}).configure({ levels: [1] });
|
|
22
30
|
export function getRichTextExtensions(options) {
|
|
23
31
|
const { editable = false, customExtensions = [] } = options ?? {};
|
|
@@ -25,7 +33,9 @@ export function getRichTextExtensions(options) {
|
|
|
25
33
|
DocHeading,
|
|
26
34
|
Heading.configure({ levels: [2, 3, 4, 5, 6] }),
|
|
27
35
|
Highlight.configure({ multicolor: true }),
|
|
28
|
-
TextStyleKit
|
|
36
|
+
TextStyleKit.configure({
|
|
37
|
+
// fontSize: false
|
|
38
|
+
}),
|
|
29
39
|
StarterKit.configure({
|
|
30
40
|
trailingNode: false,
|
|
31
41
|
link: false,
|
|
@@ -52,6 +62,7 @@ export function getRichTextExtensions(options) {
|
|
|
52
62
|
],
|
|
53
63
|
}),
|
|
54
64
|
NodeLineHeight,
|
|
65
|
+
NodeFontSize,
|
|
55
66
|
MediaGridExtension,
|
|
56
67
|
MediaGridItemExtension,
|
|
57
68
|
TableKit.configure({
|
package/dist/styles.css
CHANGED
|
@@ -12,10 +12,16 @@
|
|
|
12
12
|
--fl-toolbar-sticky-position: 0;
|
|
13
13
|
--fl-toolbar-z-index: 10;
|
|
14
14
|
--fl-toolbar-padding: 6px;
|
|
15
|
+
--fl-toolbar-justify-content: center;
|
|
15
16
|
--fl-toolbar-gap: 5px;
|
|
16
17
|
--fl-toolbar-bg: #242424;
|
|
17
18
|
--fl-toolbar-text-color: currentColor;
|
|
18
19
|
|
|
20
|
+
--fl-toolbar-btn-padding: 0 9px;
|
|
21
|
+
--fl-toolbar-btn-radius: 9px;
|
|
22
|
+
--fl-toolbar-btn-min-height: 34px;
|
|
23
|
+
--fl-toolbar-btn-min-width: var(--fl-toolbar-btn-min-height);
|
|
24
|
+
|
|
19
25
|
--fl-doc-max-width: 1032px;
|
|
20
26
|
--fl-doc-padding: 2rem;
|
|
21
27
|
--fl-doc-bg: transparent;
|
|
@@ -39,6 +45,12 @@
|
|
|
39
45
|
width: 100%;
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
.fl-rich-text-content {
|
|
49
|
+
img {
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
42
54
|
.fl-rich-text-doc {
|
|
43
55
|
padding: var(--fl-doc-padding, 2rem);
|
|
44
56
|
background: var(--fl-doc-bg, transparent);
|
|
@@ -113,11 +125,11 @@
|
|
|
113
125
|
backdrop-filter: blur(16px);
|
|
114
126
|
border-radius: 14px;
|
|
115
127
|
display: flex;
|
|
116
|
-
gap:
|
|
128
|
+
gap: 5px;
|
|
117
129
|
position: relative;
|
|
118
130
|
z-index: 9;
|
|
119
131
|
|
|
120
|
-
button {
|
|
132
|
+
.fl-bubble-menu-mark-button {
|
|
121
133
|
border-radius: 9px;
|
|
122
134
|
border: none;
|
|
123
135
|
display: flex;
|
|
@@ -175,7 +187,7 @@
|
|
|
175
187
|
flex-wrap: nowrap;
|
|
176
188
|
overflow: auto;
|
|
177
189
|
align-items: center;
|
|
178
|
-
justify-content:
|
|
190
|
+
justify-content: var(--fl-toolbar-justify-content);
|
|
179
191
|
gap: var(--fl-toolbar-gap);
|
|
180
192
|
padding: var(--fl-toolbar-padding);
|
|
181
193
|
position: sticky;
|
|
@@ -184,6 +196,7 @@
|
|
|
184
196
|
background: var(--fl-toolbar-bg, #242424);
|
|
185
197
|
color: var(--fl-toolbar-text-color);
|
|
186
198
|
border-radius: var(--fl-editor-radius);
|
|
199
|
+
margin-bottom: calc(var(--fl-toolbar-padding) * -1);
|
|
187
200
|
}
|
|
188
201
|
|
|
189
202
|
.fl-rich-text-toolbar-container {
|
|
@@ -198,11 +211,11 @@
|
|
|
198
211
|
gap: var(--fl-toolbar-gap);
|
|
199
212
|
|
|
200
213
|
button {
|
|
201
|
-
padding:
|
|
214
|
+
padding: var(--fl-toolbar-btn-padding, 0 9px);
|
|
202
215
|
flex: auto;
|
|
203
216
|
border: none;
|
|
204
217
|
background: rgba(255, 255, 255, 0.1);
|
|
205
|
-
border-radius:
|
|
218
|
+
border-radius: var(--fl-toolbar-btn-radius, 9px);
|
|
206
219
|
color: currentColor;
|
|
207
220
|
font-size: 14px;
|
|
208
221
|
display: flex;
|
|
@@ -212,7 +225,8 @@
|
|
|
212
225
|
gap: 2px;
|
|
213
226
|
cursor: pointer;
|
|
214
227
|
line-height: 1;
|
|
215
|
-
min-height:
|
|
228
|
+
min-height: var(--fl-toolbar-btn-min-height, 34px);
|
|
229
|
+
min-width: var(--fl-toolbar-btn-min-width, var(--fl-toolbar-btn-min-height, 34px));
|
|
216
230
|
|
|
217
231
|
&.fl-font-size-button {
|
|
218
232
|
font-size: 14px;
|
|
@@ -361,14 +375,23 @@ button {
|
|
|
361
375
|
}
|
|
362
376
|
}
|
|
363
377
|
|
|
378
|
+
.fl-bubble-menu {
|
|
379
|
+
.fl-font-size-editor {
|
|
380
|
+
min-width: 30px;
|
|
381
|
+
min-height: 30px;
|
|
382
|
+
padding-inline: 6px;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
364
386
|
.fl-font-size-editor {
|
|
365
387
|
display: flex;
|
|
366
388
|
align-items: center;
|
|
367
389
|
gap: 4px;
|
|
368
|
-
padding: 0 6px;
|
|
369
|
-
border-radius:
|
|
390
|
+
padding: var(--fl-toolbar-btn-padding, 0 6px);
|
|
391
|
+
border-radius: var(--fl-toolbar-btn-radius, 9px);
|
|
370
392
|
background: rgba(255, 255, 255, 0.1);
|
|
371
|
-
min-height:
|
|
393
|
+
min-height: var(--fl-toolbar-btn-min-height, 34px);
|
|
394
|
+
min-width: var(--fl-toolbar-btn-min-width, var(--fl-toolbar-btn-min-height, 34px));
|
|
372
395
|
|
|
373
396
|
& button {
|
|
374
397
|
border: none;
|
|
@@ -520,12 +543,32 @@ button {
|
|
|
520
543
|
.fl-node-count-bar {
|
|
521
544
|
background: var(--fl-toolbar-bg, #242424);
|
|
522
545
|
border-top: 1px solid #333;
|
|
523
|
-
padding:
|
|
546
|
+
padding: 9px 12px;
|
|
524
547
|
display: flex;
|
|
525
548
|
align-items: center;
|
|
526
549
|
gap: 12px;
|
|
527
550
|
font-size: 12px;
|
|
528
551
|
color: var(--fl-toolbar-text-color, currentColor);
|
|
552
|
+
border-bottom-left-radius: inherit;
|
|
553
|
+
border-bottom-right-radius: inherit;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.fl-character-count {
|
|
557
|
+
display: flex;
|
|
558
|
+
align-items: center;
|
|
559
|
+
gap: 8px;
|
|
560
|
+
|
|
561
|
+
svg {
|
|
562
|
+
color: var(--fl-editor-accent-color);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
&.fl-character-count--warning {
|
|
566
|
+
color: #ff5c33;
|
|
567
|
+
|
|
568
|
+
svg {
|
|
569
|
+
color: currentColor;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
529
572
|
}
|
|
530
573
|
|
|
531
574
|
.fl-node-count-text {
|