vlite3 1.3.11 → 1.4.2
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/Accordion/Accordion.vue.d.ts +2 -2
- package/components/Accordion/AccordionItem.vue.d.ts +1 -1
- package/components/Accordion/AccordionItem.vue.js +11 -7
- package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
- package/components/AppShell/AppShell.vue.d.ts +1 -0
- package/components/AppShell/AppShell.vue.js +33 -26
- package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +54 -0
- package/components/AppShell/AppShellLayoutStorefront.vue.js +222 -0
- package/components/AppShell/AppShellLayoutStorefront.vue2.js +4 -0
- package/components/AsyncSelect/createAsyncSelect.js +3 -2
- package/components/CategoryManager/CategoryManager.vue2.js +36 -31
- package/components/CategoryMenu/CategoryMenu.vue.d.ts +22 -0
- package/components/CategoryMenu/CategoryMenu.vue.js +106 -0
- package/components/CategoryMenu/CategoryMenu.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +17 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue.js +146 -0
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +4 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +18 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue.js +162 -0
- package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +4 -0
- package/components/CategoryMenu/index.d.ts +2 -0
- package/components/CategoryMenu/types.d.ts +32 -0
- package/components/CategoryMenu/utils.d.ts +16 -0
- package/components/CategoryMenu/utils.js +45 -0
- package/components/ColorPicker/ColorPicker.vue.d.ts +7 -3
- package/components/ColorPicker/ColorPicker.vue.js +59 -45
- package/components/DatePicker.vue.js +5 -4
- package/components/DateRangePicker.vue.js +3 -2
- package/components/Dropdown/Dropdown.vue.d.ts +4 -1
- package/components/Dropdown/Dropdown.vue.js +8 -7
- package/components/Dropdown/DropdownGroupedLayout.vue2.js +5 -2
- package/components/Dropdown/DropdownGroupedLayout.vue3.js +111 -0
- package/components/Dropdown/DropdownItem.vue.d.ts +2 -2
- package/components/Dropdown/DropdownItem.vue.js +66 -49
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/{DropdownMenu.vue2.js → DropdownMenu.vue3.js} +40 -40
- package/components/Dropdown/composables/useDropdownHydration.d.ts +4 -0
- package/components/Dropdown/composables/useDropdownNavigation.js +30 -18
- package/components/Form/Form.vue.d.ts +13 -1
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +313 -275
- package/components/Form/FormField.vue.js +103 -74
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +7 -6
- package/components/Form/composables/useForm.js +71 -67
- package/components/Form/types.d.ts +21 -1
- package/components/IconPicker.vue.js +3 -2
- package/components/ImportData/ImportStep2.vue.js +3 -2
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +4 -0
- package/components/NavbarCommandPalette.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionTopBar.vue.js +3 -2
- package/components/RichTextEditor/RichTextEditor.vue.js +43 -48
- package/components/RichTextEditor/RichTextLinkPopover.vue3.js +2 -2
- package/components/RichTextEditor/RichTextToolbar.vue.d.ts +12 -3
- package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar.vue2.js} +157 -121
- package/components/RichTextEditor/RichTextToolbar.vue3.js +2 -2
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/RichTextEditor/types.d.ts +38 -0
- package/components/RichTextEditor/types.js +52 -0
- package/components/Screen/ScreenFilter.vue.js +26 -21
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +2 -2
- package/components/SidebarMenu/SidebarMenuItem.vue.js +3 -2
- package/components/Switch.vue.js +8 -8
- package/components/Tooltip.vue.js +1 -0
- package/components/Workbook/Sheet.vue.d.ts +1 -1
- package/components/Workbook/Sheet.vue.js +14 -13
- package/components/index.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +306 -301
- package/package.json +2 -2
- package/style.css +2 -2
- package/types/appshell.type.d.ts +2 -1
- package/types/styles.d.ts +2 -0
- package/components/Dropdown/DropdownGroupedLayout.vue.js +0 -75
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover.vue2.js} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RichTextTools } from './types';
|
|
1
2
|
interface Props {
|
|
2
3
|
toolbarState: Record<string, boolean>;
|
|
3
4
|
activeBlock: string;
|
|
@@ -5,20 +6,28 @@ interface Props {
|
|
|
5
6
|
readonly?: boolean;
|
|
6
7
|
isUploadingImage: boolean;
|
|
7
8
|
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Toolbar contents. Pass an array of tool IDs to show only those buttons,
|
|
11
|
+
* a preset ('minimal' | 'basic' | 'standard' | 'all'), or omit to show
|
|
12
|
+
* the full default toolbar.
|
|
13
|
+
*/
|
|
14
|
+
tools?: RichTextTools;
|
|
8
15
|
}
|
|
9
16
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
clearFormat: () => any;
|
|
10
18
|
command: (cmd: string, val?: string) => any;
|
|
11
19
|
setBlock: (tag: string) => any;
|
|
12
20
|
insertCode: () => any;
|
|
13
21
|
triggerImageUpload: () => any;
|
|
14
22
|
openLinkPopover: () => any;
|
|
15
|
-
clearFormat: () => any;
|
|
16
23
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
24
|
+
onClearFormat?: () => any;
|
|
17
25
|
onCommand?: (cmd: string, val?: string) => any;
|
|
18
26
|
onSetBlock?: (tag: string) => any;
|
|
19
27
|
onInsertCode?: () => any;
|
|
20
28
|
onTriggerImageUpload?: () => any;
|
|
21
29
|
onOpenLinkPopover?: () => any;
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
}>, {
|
|
31
|
+
tools: RichTextTools;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
33
|
export default _default;
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as B, computed as m, openBlock as i, createElementBlock as a, withModifiers as l, createVNode as b, createCommentVNode as n, normalizeClass as u, createBlock as k } from "vue";
|
|
2
|
+
import s from "../Icon.vue.js";
|
|
3
|
+
import { resolveRichTextTools as S, RICH_TEXT_TOOL_GROUPS as w } from "./types.js";
|
|
4
|
+
const M = ["aria-label", "aria-disabled"], $ = ["disabled"], C = ["disabled"], L = {
|
|
5
|
+
key: 2,
|
|
6
|
+
class: "rte-sep",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, I = ["aria-pressed", "disabled"], R = ["aria-pressed", "disabled"], U = ["aria-pressed", "disabled"], T = {
|
|
9
|
+
key: 6,
|
|
10
|
+
class: "rte-sep",
|
|
11
|
+
"aria-hidden": "true"
|
|
12
|
+
}, H = ["aria-pressed", "disabled"], j = ["aria-pressed", "disabled"], x = ["aria-pressed", "disabled"], q = ["aria-pressed", "disabled"], A = ["disabled"], O = {
|
|
13
|
+
key: 12,
|
|
14
|
+
class: "rte-sep",
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
}, P = ["aria-pressed", "disabled"], z = ["aria-pressed", "disabled"], F = ["aria-pressed", "disabled"], N = ["disabled"], E = ["disabled"], V = {
|
|
17
|
+
key: 18,
|
|
18
|
+
class: "rte-sep",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, G = ["aria-pressed", "disabled"], K = ["aria-pressed", "disabled"], X = ["aria-pressed", "disabled"], Y = {
|
|
21
|
+
key: 22,
|
|
22
|
+
class: "rte-sep",
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
}, Z = ["disabled"], D = ["disabled"], p = /* @__PURE__ */ B({
|
|
4
25
|
__name: "RichTextToolbar",
|
|
5
26
|
props: {
|
|
6
27
|
toolbarState: {},
|
|
@@ -8,323 +29,338 @@ const y = ["aria-label", "aria-disabled"], g = ["disabled"], k = ["disabled"], B
|
|
|
8
29
|
disabled: { type: Boolean },
|
|
9
30
|
readonly: { type: Boolean },
|
|
10
31
|
isUploadingImage: { type: Boolean },
|
|
11
|
-
label: {}
|
|
32
|
+
label: {},
|
|
33
|
+
tools: { default: void 0 }
|
|
12
34
|
},
|
|
13
35
|
emits: ["command", "setBlock", "insertCode", "triggerImageUpload", "openLinkPopover", "clearFormat"],
|
|
14
|
-
setup(e, { emit:
|
|
15
|
-
const
|
|
16
|
-
|
|
36
|
+
setup(e, { emit: g }) {
|
|
37
|
+
const h = e, o = g, f = m(
|
|
38
|
+
() => new Set(S(h.tools))
|
|
39
|
+
), d = (c) => f.value.has(c), y = m(
|
|
40
|
+
() => w.map((c) => c.some(d))
|
|
41
|
+
), v = m(() => {
|
|
42
|
+
const c = [];
|
|
43
|
+
for (let t = 0; t < y.value.length - 1; t++)
|
|
44
|
+
c.push(y.value[t] && y.value[t + 1]);
|
|
45
|
+
return c;
|
|
46
|
+
});
|
|
47
|
+
return (c, t) => (i(), a("div", {
|
|
17
48
|
class: "rte-toolbar",
|
|
18
49
|
role: "toolbar",
|
|
19
50
|
"aria-label": e.label ? `${e.label} formatting toolbar` : "Rich text editor toolbar",
|
|
20
51
|
"aria-disabled": e.disabled || e.readonly || void 0,
|
|
21
|
-
onMousedown: t[
|
|
52
|
+
onMousedown: t[20] || (t[20] = l(() => {
|
|
22
53
|
}, ["prevent"]))
|
|
23
54
|
}, [
|
|
24
|
-
i("button", {
|
|
55
|
+
d("undo") ? (i(), a("button", {
|
|
56
|
+
key: 0,
|
|
25
57
|
type: "button",
|
|
26
58
|
class: "rte-btn",
|
|
27
59
|
title: "Undo (Ctrl+Z)",
|
|
28
60
|
"aria-label": "Undo",
|
|
29
61
|
disabled: e.disabled || e.readonly,
|
|
30
|
-
onMousedown: t[0] || (t[0] =
|
|
62
|
+
onMousedown: t[0] || (t[0] = l((r) => o("command", "undo"), ["prevent"]))
|
|
31
63
|
}, [
|
|
32
|
-
|
|
64
|
+
b(s, {
|
|
33
65
|
icon: "lucide:undo-2",
|
|
34
66
|
class: "rte-icon",
|
|
35
67
|
"aria-hidden": "true"
|
|
36
68
|
})
|
|
37
|
-
], 40,
|
|
38
|
-
i("button", {
|
|
69
|
+
], 40, $)) : n("", !0),
|
|
70
|
+
d("redo") ? (i(), a("button", {
|
|
71
|
+
key: 1,
|
|
39
72
|
type: "button",
|
|
40
73
|
class: "rte-btn",
|
|
41
74
|
title: "Redo (Ctrl+Y)",
|
|
42
75
|
"aria-label": "Redo",
|
|
43
76
|
disabled: e.disabled || e.readonly,
|
|
44
|
-
onMousedown: t[1] || (t[1] =
|
|
77
|
+
onMousedown: t[1] || (t[1] = l((r) => o("command", "redo"), ["prevent"]))
|
|
45
78
|
}, [
|
|
46
|
-
|
|
79
|
+
b(s, {
|
|
47
80
|
icon: "lucide:redo-2",
|
|
48
81
|
class: "rte-icon",
|
|
49
82
|
"aria-hidden": "true"
|
|
50
83
|
})
|
|
51
|
-
], 40,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})).cacheIndex = 2, s(1), t[2]),
|
|
56
|
-
i("button", {
|
|
84
|
+
], 40, C)) : n("", !0),
|
|
85
|
+
v.value[0] ? (i(), a("div", L)) : n("", !0),
|
|
86
|
+
d("h1") ? (i(), a("button", {
|
|
87
|
+
key: 3,
|
|
57
88
|
type: "button",
|
|
58
|
-
class:
|
|
89
|
+
class: u(["rte-btn rte-btn--text", { "rte-btn--active": e.activeBlock === "h1" }]),
|
|
59
90
|
title: "Heading 1",
|
|
60
91
|
"aria-label": "Heading 1",
|
|
61
92
|
"aria-pressed": e.activeBlock === "h1",
|
|
62
93
|
disabled: e.disabled || e.readonly,
|
|
63
|
-
onMousedown: t[
|
|
64
|
-
}, "H1", 42,
|
|
65
|
-
i("button", {
|
|
94
|
+
onMousedown: t[2] || (t[2] = l((r) => o("setBlock", "h1"), ["prevent"]))
|
|
95
|
+
}, "H1", 42, I)) : n("", !0),
|
|
96
|
+
d("h2") ? (i(), a("button", {
|
|
97
|
+
key: 4,
|
|
66
98
|
type: "button",
|
|
67
|
-
class:
|
|
99
|
+
class: u(["rte-btn rte-btn--text", { "rte-btn--active": e.activeBlock === "h2" }]),
|
|
68
100
|
title: "Heading 2",
|
|
69
101
|
"aria-label": "Heading 2",
|
|
70
102
|
"aria-pressed": e.activeBlock === "h2",
|
|
71
103
|
disabled: e.disabled || e.readonly,
|
|
72
|
-
onMousedown: t[
|
|
73
|
-
}, "H2", 42,
|
|
74
|
-
i("button", {
|
|
104
|
+
onMousedown: t[3] || (t[3] = l((r) => o("setBlock", "h2"), ["prevent"]))
|
|
105
|
+
}, "H2", 42, R)) : n("", !0),
|
|
106
|
+
d("p") ? (i(), a("button", {
|
|
107
|
+
key: 5,
|
|
75
108
|
type: "button",
|
|
76
|
-
class:
|
|
109
|
+
class: u(["rte-btn rte-btn--text", { "rte-btn--active": e.activeBlock === "p" || e.activeBlock === "div" }]),
|
|
77
110
|
title: "Paragraph",
|
|
78
111
|
"aria-label": "Paragraph",
|
|
79
112
|
"aria-pressed": e.activeBlock === "p" || e.activeBlock === "div",
|
|
80
113
|
disabled: e.disabled || e.readonly,
|
|
81
|
-
onMousedown: t[
|
|
82
|
-
}, "P", 42,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})).cacheIndex = 6, s(1), t[6]),
|
|
87
|
-
i("button", {
|
|
114
|
+
onMousedown: t[4] || (t[4] = l((r) => o("setBlock", "p"), ["prevent"]))
|
|
115
|
+
}, "P", 42, U)) : n("", !0),
|
|
116
|
+
v.value[1] ? (i(), a("div", T)) : n("", !0),
|
|
117
|
+
d("bold") ? (i(), a("button", {
|
|
118
|
+
key: 7,
|
|
88
119
|
type: "button",
|
|
89
|
-
class:
|
|
120
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.bold }]),
|
|
90
121
|
title: "Bold (Ctrl+B)",
|
|
91
122
|
"aria-label": "Bold",
|
|
92
123
|
"aria-pressed": e.toolbarState.bold,
|
|
93
124
|
disabled: e.disabled || e.readonly,
|
|
94
|
-
onMousedown: t[
|
|
125
|
+
onMousedown: t[5] || (t[5] = l((r) => o("command", "bold"), ["prevent"]))
|
|
95
126
|
}, [
|
|
96
|
-
|
|
127
|
+
b(s, {
|
|
97
128
|
icon: "lucide:bold",
|
|
98
129
|
class: "rte-icon",
|
|
99
130
|
"aria-hidden": "true"
|
|
100
131
|
})
|
|
101
|
-
], 42,
|
|
102
|
-
i("button", {
|
|
132
|
+
], 42, H)) : n("", !0),
|
|
133
|
+
d("italic") ? (i(), a("button", {
|
|
134
|
+
key: 8,
|
|
103
135
|
type: "button",
|
|
104
|
-
class:
|
|
136
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.italic }]),
|
|
105
137
|
title: "Italic (Ctrl+I)",
|
|
106
138
|
"aria-label": "Italic",
|
|
107
139
|
"aria-pressed": e.toolbarState.italic,
|
|
108
140
|
disabled: e.disabled || e.readonly,
|
|
109
|
-
onMousedown: t[
|
|
141
|
+
onMousedown: t[6] || (t[6] = l((r) => o("command", "italic"), ["prevent"]))
|
|
110
142
|
}, [
|
|
111
|
-
|
|
143
|
+
b(s, {
|
|
112
144
|
icon: "lucide:italic",
|
|
113
145
|
class: "rte-icon",
|
|
114
146
|
"aria-hidden": "true"
|
|
115
147
|
})
|
|
116
|
-
], 42,
|
|
117
|
-
i("button", {
|
|
148
|
+
], 42, j)) : n("", !0),
|
|
149
|
+
d("underline") ? (i(), a("button", {
|
|
150
|
+
key: 9,
|
|
118
151
|
type: "button",
|
|
119
|
-
class:
|
|
152
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.underline }]),
|
|
120
153
|
title: "Underline (Ctrl+U)",
|
|
121
154
|
"aria-label": "Underline",
|
|
122
155
|
"aria-pressed": e.toolbarState.underline,
|
|
123
156
|
disabled: e.disabled || e.readonly,
|
|
124
|
-
onMousedown: t[
|
|
157
|
+
onMousedown: t[7] || (t[7] = l((r) => o("command", "underline"), ["prevent"]))
|
|
125
158
|
}, [
|
|
126
|
-
|
|
159
|
+
b(s, {
|
|
127
160
|
icon: "lucide:underline",
|
|
128
161
|
class: "rte-icon",
|
|
129
162
|
"aria-hidden": "true"
|
|
130
163
|
})
|
|
131
|
-
], 42,
|
|
132
|
-
i("button", {
|
|
164
|
+
], 42, x)) : n("", !0),
|
|
165
|
+
d("strikethrough") ? (i(), a("button", {
|
|
166
|
+
key: 10,
|
|
133
167
|
type: "button",
|
|
134
|
-
class:
|
|
168
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.strikeThrough }]),
|
|
135
169
|
title: "Strikethrough",
|
|
136
170
|
"aria-label": "Strikethrough",
|
|
137
171
|
"aria-pressed": e.toolbarState.strikeThrough,
|
|
138
172
|
disabled: e.disabled || e.readonly,
|
|
139
|
-
onMousedown: t[
|
|
173
|
+
onMousedown: t[8] || (t[8] = l((r) => o("command", "strikeThrough"), ["prevent"]))
|
|
140
174
|
}, [
|
|
141
|
-
|
|
175
|
+
b(s, {
|
|
142
176
|
icon: "lucide:strikethrough",
|
|
143
177
|
class: "rte-icon",
|
|
144
178
|
"aria-hidden": "true"
|
|
145
179
|
})
|
|
146
|
-
], 42,
|
|
147
|
-
i("button", {
|
|
180
|
+
], 42, q)) : n("", !0),
|
|
181
|
+
d("code") ? (i(), a("button", {
|
|
182
|
+
key: 11,
|
|
148
183
|
type: "button",
|
|
149
184
|
class: "rte-btn",
|
|
150
185
|
title: "Inline Code",
|
|
151
186
|
"aria-label": "Inline Code",
|
|
152
187
|
disabled: e.disabled || e.readonly,
|
|
153
|
-
onMousedown: t[
|
|
188
|
+
onMousedown: t[9] || (t[9] = l((r) => o("insertCode"), ["prevent"]))
|
|
154
189
|
}, [
|
|
155
|
-
|
|
190
|
+
b(s, {
|
|
156
191
|
icon: "lucide:code",
|
|
157
192
|
class: "rte-icon",
|
|
158
193
|
"aria-hidden": "true"
|
|
159
194
|
})
|
|
160
|
-
], 40,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
})).cacheIndex = 12, s(1), t[12]),
|
|
165
|
-
i("button", {
|
|
195
|
+
], 40, A)) : n("", !0),
|
|
196
|
+
v.value[2] ? (i(), a("div", O)) : n("", !0),
|
|
197
|
+
d("bulletList") ? (i(), a("button", {
|
|
198
|
+
key: 13,
|
|
166
199
|
type: "button",
|
|
167
|
-
class:
|
|
200
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.insertUnorderedList }]),
|
|
168
201
|
title: "Bullet List",
|
|
169
202
|
"aria-label": "Bullet list",
|
|
170
203
|
"aria-pressed": e.toolbarState.insertUnorderedList,
|
|
171
204
|
disabled: e.disabled || e.readonly,
|
|
172
|
-
onMousedown: t[
|
|
205
|
+
onMousedown: t[10] || (t[10] = l((r) => o("command", "insertUnorderedList"), ["prevent"]))
|
|
173
206
|
}, [
|
|
174
|
-
|
|
207
|
+
b(s, {
|
|
175
208
|
icon: "lucide:list",
|
|
176
209
|
class: "rte-icon",
|
|
177
210
|
"aria-hidden": "true"
|
|
178
211
|
})
|
|
179
|
-
], 42,
|
|
180
|
-
i("button", {
|
|
212
|
+
], 42, P)) : n("", !0),
|
|
213
|
+
d("orderedList") ? (i(), a("button", {
|
|
214
|
+
key: 14,
|
|
181
215
|
type: "button",
|
|
182
|
-
class:
|
|
216
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.insertOrderedList }]),
|
|
183
217
|
title: "Numbered List",
|
|
184
218
|
"aria-label": "Numbered list",
|
|
185
219
|
"aria-pressed": e.toolbarState.insertOrderedList,
|
|
186
220
|
disabled: e.disabled || e.readonly,
|
|
187
|
-
onMousedown: t[
|
|
221
|
+
onMousedown: t[11] || (t[11] = l((r) => o("command", "insertOrderedList"), ["prevent"]))
|
|
188
222
|
}, [
|
|
189
|
-
|
|
223
|
+
b(s, {
|
|
190
224
|
icon: "lucide:list-ordered",
|
|
191
225
|
class: "rte-icon",
|
|
192
226
|
"aria-hidden": "true"
|
|
193
227
|
})
|
|
194
|
-
], 42,
|
|
195
|
-
i("button", {
|
|
228
|
+
], 42, z)) : n("", !0),
|
|
229
|
+
d("blockquote") ? (i(), a("button", {
|
|
230
|
+
key: 15,
|
|
196
231
|
type: "button",
|
|
197
|
-
class:
|
|
232
|
+
class: u(["rte-btn", { "rte-btn--active": e.activeBlock === "blockquote" }]),
|
|
198
233
|
title: "Blockquote",
|
|
199
234
|
"aria-label": "Blockquote",
|
|
200
235
|
"aria-pressed": e.activeBlock === "blockquote",
|
|
201
236
|
disabled: e.disabled || e.readonly,
|
|
202
|
-
onMousedown: t[
|
|
237
|
+
onMousedown: t[12] || (t[12] = l((r) => o("setBlock", "blockquote"), ["prevent"]))
|
|
203
238
|
}, [
|
|
204
|
-
|
|
239
|
+
b(s, {
|
|
205
240
|
icon: "lucide:quote",
|
|
206
241
|
class: "rte-icon",
|
|
207
242
|
"aria-hidden": "true"
|
|
208
243
|
})
|
|
209
|
-
], 42,
|
|
210
|
-
i("button", {
|
|
244
|
+
], 42, F)) : n("", !0),
|
|
245
|
+
d("hr") ? (i(), a("button", {
|
|
246
|
+
key: 16,
|
|
211
247
|
type: "button",
|
|
212
248
|
class: "rte-btn",
|
|
213
249
|
title: "Horizontal Rule",
|
|
214
250
|
"aria-label": "Insert horizontal rule",
|
|
215
251
|
disabled: e.disabled || e.readonly,
|
|
216
|
-
onMousedown: t[
|
|
252
|
+
onMousedown: t[13] || (t[13] = l((r) => o("command", "insertHorizontalRule"), ["prevent"]))
|
|
217
253
|
}, [
|
|
218
|
-
|
|
254
|
+
b(s, {
|
|
219
255
|
icon: "lucide:minus",
|
|
220
256
|
class: "rte-icon",
|
|
221
257
|
"aria-hidden": "true"
|
|
222
258
|
})
|
|
223
|
-
], 40,
|
|
224
|
-
i("button", {
|
|
259
|
+
], 40, N)) : n("", !0),
|
|
260
|
+
d("image") ? (i(), a("button", {
|
|
261
|
+
key: 17,
|
|
225
262
|
type: "button",
|
|
226
263
|
class: "rte-btn",
|
|
227
264
|
title: "Insert Image",
|
|
228
265
|
"aria-label": "Insert image",
|
|
229
266
|
disabled: e.disabled || e.readonly || e.isUploadingImage,
|
|
230
|
-
onMousedown: t[
|
|
267
|
+
onMousedown: t[14] || (t[14] = l((r) => o("triggerImageUpload"), ["prevent"]))
|
|
231
268
|
}, [
|
|
232
|
-
e.isUploadingImage ? (
|
|
269
|
+
e.isUploadingImage ? (i(), k(s, {
|
|
233
270
|
key: 0,
|
|
234
271
|
icon: "lucide:loader-2",
|
|
235
272
|
class: "rte-icon animate-spin",
|
|
236
273
|
"aria-hidden": "true"
|
|
237
|
-
})) : (
|
|
274
|
+
})) : (i(), k(s, {
|
|
238
275
|
key: 1,
|
|
239
276
|
icon: "lucide:image",
|
|
240
277
|
class: "rte-icon",
|
|
241
278
|
"aria-hidden": "true"
|
|
242
279
|
}))
|
|
243
|
-
], 40,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
})).cacheIndex = 18, s(1), t[18]),
|
|
248
|
-
i("button", {
|
|
280
|
+
], 40, E)) : n("", !0),
|
|
281
|
+
v.value[3] ? (i(), a("div", V)) : n("", !0),
|
|
282
|
+
d("alignLeft") ? (i(), a("button", {
|
|
283
|
+
key: 19,
|
|
249
284
|
type: "button",
|
|
250
|
-
class:
|
|
285
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.justifyLeft }]),
|
|
251
286
|
title: "Align Left",
|
|
252
287
|
"aria-label": "Align left",
|
|
253
288
|
"aria-pressed": e.toolbarState.justifyLeft,
|
|
254
289
|
disabled: e.disabled || e.readonly,
|
|
255
|
-
onMousedown: t[
|
|
290
|
+
onMousedown: t[15] || (t[15] = l((r) => o("command", "justifyLeft"), ["prevent"]))
|
|
256
291
|
}, [
|
|
257
|
-
|
|
292
|
+
b(s, {
|
|
258
293
|
icon: "lucide:align-left",
|
|
259
294
|
class: "rte-icon",
|
|
260
295
|
"aria-hidden": "true"
|
|
261
296
|
})
|
|
262
|
-
], 42,
|
|
263
|
-
i("button", {
|
|
297
|
+
], 42, G)) : n("", !0),
|
|
298
|
+
d("alignCenter") ? (i(), a("button", {
|
|
299
|
+
key: 20,
|
|
264
300
|
type: "button",
|
|
265
|
-
class:
|
|
301
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.justifyCenter }]),
|
|
266
302
|
title: "Align Center",
|
|
267
303
|
"aria-label": "Align center",
|
|
268
304
|
"aria-pressed": e.toolbarState.justifyCenter,
|
|
269
305
|
disabled: e.disabled || e.readonly,
|
|
270
|
-
onMousedown: t[
|
|
306
|
+
onMousedown: t[16] || (t[16] = l((r) => o("command", "justifyCenter"), ["prevent"]))
|
|
271
307
|
}, [
|
|
272
|
-
|
|
308
|
+
b(s, {
|
|
273
309
|
icon: "lucide:align-center",
|
|
274
310
|
class: "rte-icon",
|
|
275
311
|
"aria-hidden": "true"
|
|
276
312
|
})
|
|
277
|
-
], 42,
|
|
278
|
-
i("button", {
|
|
313
|
+
], 42, K)) : n("", !0),
|
|
314
|
+
d("alignRight") ? (i(), a("button", {
|
|
315
|
+
key: 21,
|
|
279
316
|
type: "button",
|
|
280
|
-
class:
|
|
317
|
+
class: u(["rte-btn", { "rte-btn--active": e.toolbarState.justifyRight }]),
|
|
281
318
|
title: "Align Right",
|
|
282
319
|
"aria-label": "Align right",
|
|
283
320
|
"aria-pressed": e.toolbarState.justifyRight,
|
|
284
321
|
disabled: e.disabled || e.readonly,
|
|
285
|
-
onMousedown: t[
|
|
322
|
+
onMousedown: t[17] || (t[17] = l((r) => o("command", "justifyRight"), ["prevent"]))
|
|
286
323
|
}, [
|
|
287
|
-
|
|
324
|
+
b(s, {
|
|
288
325
|
icon: "lucide:align-right",
|
|
289
326
|
class: "rte-icon",
|
|
290
327
|
"aria-hidden": "true"
|
|
291
328
|
})
|
|
292
|
-
], 42,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
})).cacheIndex = 22, s(1), t[22]),
|
|
297
|
-
i("button", {
|
|
329
|
+
], 42, X)) : n("", !0),
|
|
330
|
+
v.value[4] ? (i(), a("div", Y)) : n("", !0),
|
|
331
|
+
d("link") ? (i(), a("button", {
|
|
332
|
+
key: 23,
|
|
298
333
|
type: "button",
|
|
299
334
|
class: "rte-btn",
|
|
300
335
|
title: "Insert / Edit Link (Ctrl+K)",
|
|
301
336
|
"aria-label": "Insert or edit link",
|
|
302
337
|
disabled: e.disabled || e.readonly,
|
|
303
|
-
onMousedown: t[
|
|
338
|
+
onMousedown: t[18] || (t[18] = l((r) => o("openLinkPopover"), ["prevent"]))
|
|
304
339
|
}, [
|
|
305
|
-
|
|
340
|
+
b(s, {
|
|
306
341
|
icon: "lucide:link",
|
|
307
342
|
class: "rte-icon",
|
|
308
343
|
"aria-hidden": "true"
|
|
309
344
|
})
|
|
310
|
-
], 40,
|
|
311
|
-
i("button", {
|
|
345
|
+
], 40, Z)) : n("", !0),
|
|
346
|
+
d("clearFormat") ? (i(), a("button", {
|
|
347
|
+
key: 24,
|
|
312
348
|
type: "button",
|
|
313
349
|
class: "rte-btn",
|
|
314
350
|
title: "Clear Formatting",
|
|
315
351
|
"aria-label": "Clear formatting",
|
|
316
352
|
disabled: e.disabled || e.readonly,
|
|
317
|
-
onMousedown: t[
|
|
353
|
+
onMousedown: t[19] || (t[19] = l((r) => o("clearFormat"), ["prevent"]))
|
|
318
354
|
}, [
|
|
319
|
-
|
|
355
|
+
b(s, {
|
|
320
356
|
icon: "lucide:remove-formatting",
|
|
321
357
|
class: "rte-icon",
|
|
322
358
|
"aria-hidden": "true"
|
|
323
359
|
})
|
|
324
|
-
], 40,
|
|
325
|
-
], 40,
|
|
360
|
+
], 40, D)) : n("", !0)
|
|
361
|
+
], 40, M));
|
|
326
362
|
}
|
|
327
363
|
});
|
|
328
364
|
export {
|
|
329
|
-
|
|
365
|
+
p as default
|
|
330
366
|
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default as RichTextEditor } from './RichTextEditor.vue';
|
|
2
2
|
export { default as RichTextReader } from './RichTextReader.vue';
|
|
3
|
+
export type { RichTextToolId, RichTextToolsPreset, RichTextTools } from './types';
|
|
4
|
+
export { resolveRichTextTools, RICH_TEXT_TOOL_GROUPS } from './types';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifier for a single toolbar button in the RichTextEditor.
|
|
3
|
+
*
|
|
4
|
+
* Pass any subset of these via the `tools` prop to control which buttons
|
|
5
|
+
* are visible. The editor also accepts a `RichTextToolsPreset` shortcut
|
|
6
|
+
* (`'all' | 'standard' | 'basic' | 'minimal'`) for the most common shapes.
|
|
7
|
+
*/
|
|
8
|
+
export type RichTextToolId = 'undo' | 'redo' | 'h1' | 'h2' | 'p' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | 'bulletList' | 'orderedList' | 'blockquote' | 'hr' | 'image' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'link' | 'clearFormat';
|
|
9
|
+
/**
|
|
10
|
+
* Curated toolbar presets. Equivalent to hand-picked subsets of `RichTextToolId`.
|
|
11
|
+
*
|
|
12
|
+
* - 'all' — every tool (default when `tools` is not provided)
|
|
13
|
+
* - 'standard' — everything except the 3 alignment buttons
|
|
14
|
+
* - 'basic' — headings, inline formatting, lists, link, image
|
|
15
|
+
* - 'minimal' — bold, italic, bullet list, link
|
|
16
|
+
*/
|
|
17
|
+
export type RichTextToolsPreset = 'all' | 'standard' | 'basic' | 'minimal';
|
|
18
|
+
/**
|
|
19
|
+
* Tools accepted by the editor's `tools` prop.
|
|
20
|
+
*
|
|
21
|
+
* - `undefined` — render the full toolbar (current default).
|
|
22
|
+
* - `RichTextToolId[]` — render only these tools, in the order given (within groups).
|
|
23
|
+
* - `RichTextToolsPreset` — apply a curated preset.
|
|
24
|
+
*/
|
|
25
|
+
export type RichTextTools = RichTextToolId[] | RichTextToolsPreset;
|
|
26
|
+
/**
|
|
27
|
+
* Logical toolbar groups, in the order they appear in the rendered toolbar.
|
|
28
|
+
* Used internally to decide which separator to render between groups.
|
|
29
|
+
*/
|
|
30
|
+
export declare const RICH_TEXT_TOOL_GROUPS: RichTextToolId[][];
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a `RichTextTools` value to the concrete list of tool IDs that
|
|
33
|
+
* should be rendered, preserving the canonical group order.
|
|
34
|
+
*
|
|
35
|
+
* Unknown preset strings fall back to 'all'. Unknown tool IDs are silently
|
|
36
|
+
* dropped so that consumers can pass hand-written subsets without errors.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveRichTextTools(tools: RichTextTools | undefined): RichTextToolId[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const t = [
|
|
2
|
+
["undo", "redo"],
|
|
3
|
+
["h1", "h2", "p"],
|
|
4
|
+
["bold", "italic", "underline", "strikethrough", "code"],
|
|
5
|
+
["bulletList", "orderedList", "blockquote", "hr", "image"],
|
|
6
|
+
["alignLeft", "alignCenter", "alignRight"],
|
|
7
|
+
["link", "clearFormat"]
|
|
8
|
+
];
|
|
9
|
+
function n(i) {
|
|
10
|
+
const r = /* @__PURE__ */ new Set();
|
|
11
|
+
for (const l of t) for (const a of l) r.add(a);
|
|
12
|
+
let e;
|
|
13
|
+
if (i === void 0)
|
|
14
|
+
e = t.flat();
|
|
15
|
+
else if (typeof i == "string")
|
|
16
|
+
switch (i) {
|
|
17
|
+
case "minimal":
|
|
18
|
+
e = ["bold", "italic", "bulletList", "link"];
|
|
19
|
+
break;
|
|
20
|
+
case "basic":
|
|
21
|
+
e = [
|
|
22
|
+
"h1",
|
|
23
|
+
"h2",
|
|
24
|
+
"p",
|
|
25
|
+
"bold",
|
|
26
|
+
"italic",
|
|
27
|
+
"underline",
|
|
28
|
+
"bulletList",
|
|
29
|
+
"orderedList",
|
|
30
|
+
"blockquote",
|
|
31
|
+
"image",
|
|
32
|
+
"link",
|
|
33
|
+
"clearFormat"
|
|
34
|
+
];
|
|
35
|
+
break;
|
|
36
|
+
case "standard":
|
|
37
|
+
e = t.flat().filter((l) => !l.startsWith("align"));
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
e = t.flat();
|
|
41
|
+
}
|
|
42
|
+
else if (Array.isArray(i)) {
|
|
43
|
+
const l = new Set(i.filter((a) => r.has(a)));
|
|
44
|
+
e = t.flat().filter((a) => l.has(a));
|
|
45
|
+
} else
|
|
46
|
+
e = t.flat();
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
t as RICH_TEXT_TOOL_GROUPS,
|
|
51
|
+
n as resolveRichTextTools
|
|
52
|
+
};
|