@mekari/pixel3-rich-text-editor 0.0.18 → 0.1.0-dev.1
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/chunk-4KJOYLJI.mjs +168 -0
- package/dist/{chunk-JAKI6TU2.mjs → chunk-4SN6MBXS.mjs} +8 -22
- package/dist/chunk-4TUA5VF4.mjs +173 -0
- package/dist/{chunk-2OCRJNTJ.mjs → chunk-7RMCTPMN.mjs} +2 -2
- package/dist/{chunk-RNQQ7LGC.mjs → chunk-C7IUW3FX.mjs} +73 -1
- package/dist/{chunk-ES3FCTTF.mjs → chunk-JE7IG7UU.mjs} +27 -6
- package/dist/{chunk-73N5SLQ5.mjs → chunk-MGNW6NK2.mjs} +82 -25
- package/dist/{chunk-FZPMIQTC.mjs → chunk-OZGNQAK5.mjs} +2 -1
- package/dist/{chunk-VK7QDWXR.mjs → chunk-PTKS3BYW.mjs} +18 -5
- package/dist/{chunk-V52XUOVW.mjs → chunk-SBD2AUDA.mjs} +10 -2
- package/dist/{chunk-GVMGRBDI.mjs → chunk-TNDDXUVW.mjs} +5 -1
- package/dist/{chunk-WBMECFO3.mjs → chunk-X25J3BAC.mjs} +18 -46
- package/dist/{chunk-HF36L4GZ.mjs → chunk-ZAXJ3BEP.mjs} +2 -0
- package/dist/{chunk-5IPS4HT7.mjs → chunk-ZRAXSVO5.mjs} +1 -1
- package/dist/editor-toolbar.d.mts +9 -5
- package/dist/editor-toolbar.d.ts +9 -5
- package/dist/editor-toolbar.js +193 -92
- package/dist/editor-toolbar.mjs +7 -7
- package/dist/extensions/align-extension.js +75 -21
- package/dist/extensions/align-extension.mjs +2 -2
- package/dist/extensions/color-extension.js +69 -0
- package/dist/extensions/color-extension.mjs +2 -2
- package/dist/extensions/heading-extension.js +85 -45
- package/dist/extensions/heading-extension.mjs +2 -2
- package/dist/extensions/icons.d.mts +5 -1
- package/dist/extensions/icons.d.ts +5 -1
- package/dist/extensions/icons.js +76 -0
- package/dist/extensions/icons.mjs +9 -1
- package/dist/extensions/index.js +115 -71
- package/dist/extensions/index.mjs +6 -6
- package/dist/extensions/link-extension.js +85 -4
- package/dist/extensions/link-extension.mjs +2 -2
- package/dist/extensions/mention-list-extension.d.mts +33 -0
- package/dist/extensions/mention-list-extension.d.ts +33 -0
- package/dist/extensions/mention-list-extension.js +194 -0
- package/dist/extensions/mention-list-extension.mjs +7 -0
- package/dist/extensions/single-extension.d.mts +1 -1
- package/dist/extensions/single-extension.d.ts +1 -1
- package/dist/extensions/single-extension.js +73 -1
- package/dist/extensions/single-extension.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +552 -104
- package/dist/index.mjs +14 -12
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/modules/rich-text-editor.connects.js +2 -0
- package/dist/modules/rich-text-editor.connects.mjs +1 -1
- package/dist/modules/rich-text-editor.hooks.js +2 -0
- package/dist/modules/rich-text-editor.hooks.mjs +2 -2
- package/dist/modules/rich-text-editor.props.d.mts +7 -3
- package/dist/modules/rich-text-editor.props.d.ts +7 -3
- package/dist/modules/rich-text-editor.props.js +5 -1
- package/dist/modules/rich-text-editor.props.mjs +1 -1
- package/dist/modules/rich-text-editor.types.d.mts +18 -4
- package/dist/modules/rich-text-editor.types.d.ts +18 -4
- package/dist/rich-text-editor.d.mts +15 -4
- package/dist/rich-text-editor.d.ts +15 -4
- package/dist/rich-text-editor.js +552 -104
- package/dist/rich-text-editor.mjs +14 -12
- package/dist/rte-style-provider.js +1 -1
- package/dist/rte-style-provider.mjs +4 -4
- package/dist/rte-suggestion.d.mts +7 -0
- package/dist/rte-suggestion.d.ts +7 -0
- package/dist/rte-suggestion.js +354 -0
- package/dist/rte-suggestion.mjs +8 -0
- package/package.json +15 -11
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LinkExtension
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PTKS3BYW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
SingleExtention
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SBD2AUDA.mjs";
|
|
7
7
|
import {
|
|
8
8
|
AlignExtention
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4SN6MBXS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
ColorExtension
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OZGNQAK5.mjs";
|
|
13
13
|
import {
|
|
14
14
|
HeadingExtention
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X25J3BAC.mjs";
|
|
16
16
|
import {
|
|
17
17
|
__name
|
|
18
18
|
} from "./chunk-QZ7VFGWC.mjs";
|
|
@@ -20,9 +20,12 @@ import {
|
|
|
20
20
|
// src/editor-toolbar.tsx
|
|
21
21
|
import { Fragment as _Fragment, createVNode as _createVNode } from "vue";
|
|
22
22
|
import { defineComponent } from "vue";
|
|
23
|
+
import { css } from "@mekari/pixel3-styled-system/css";
|
|
23
24
|
import { MpDivider } from "@mekari/pixel3-divider";
|
|
25
|
+
import { MpScrollbar } from "@mekari/pixel3-scrollbar";
|
|
24
26
|
var EditorToolbar = defineComponent({
|
|
25
27
|
name: "EditorToolbar",
|
|
28
|
+
emits: ["clickImage", "clickFile", "clickAudio"],
|
|
26
29
|
props: {
|
|
27
30
|
editor: {
|
|
28
31
|
type: Object
|
|
@@ -34,8 +37,10 @@ var EditorToolbar = defineComponent({
|
|
|
34
37
|
setup({
|
|
35
38
|
editor,
|
|
36
39
|
options
|
|
40
|
+
}, {
|
|
41
|
+
emit
|
|
37
42
|
}) {
|
|
38
|
-
const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "textColor", "fillColor", "textLink", "align", "undo", "redo", "clear"];
|
|
43
|
+
const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "textColor", "fillColor", "textLink", "align", "undo", "redo", "clear", "image", "file", "audio", "mention"];
|
|
39
44
|
const itemOptions = {
|
|
40
45
|
heading: {
|
|
41
46
|
tooltipLabel: "Text style",
|
|
@@ -98,52 +103,104 @@ var EditorToolbar = defineComponent({
|
|
|
98
103
|
clear: {
|
|
99
104
|
tooltipLabel: "Reset format",
|
|
100
105
|
onClick: () => (editor == null ? void 0 : editor.chain()).focus().unsetAllMarks().run()
|
|
106
|
+
},
|
|
107
|
+
image: {
|
|
108
|
+
tooltipLabel: "Add image",
|
|
109
|
+
onClick: () => emit("clickImage")
|
|
110
|
+
},
|
|
111
|
+
file: {
|
|
112
|
+
tooltipLabel: "Add file",
|
|
113
|
+
onClick: () => emit("clickFile")
|
|
114
|
+
},
|
|
115
|
+
audio: {
|
|
116
|
+
tooltipLabel: "Add audio",
|
|
117
|
+
onClick: () => emit("clickAudio")
|
|
118
|
+
},
|
|
119
|
+
mention: {
|
|
120
|
+
tooltipLabel: "Mention",
|
|
121
|
+
editor,
|
|
122
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().insertContent("@").run()
|
|
101
123
|
}
|
|
102
124
|
};
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
125
|
+
const getResolvedItem = /* @__PURE__ */ __name((option) => {
|
|
126
|
+
if (typeof option === "string") {
|
|
127
|
+
return {
|
|
128
|
+
item: option
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
item: option.value,
|
|
133
|
+
tooltip: option.tooltip
|
|
134
|
+
};
|
|
135
|
+
}, "getResolvedItem");
|
|
136
|
+
const renderExtension = /* @__PURE__ */ __name((option) => {
|
|
137
|
+
const {
|
|
138
|
+
item,
|
|
139
|
+
tooltip
|
|
140
|
+
} = getResolvedItem(option);
|
|
141
|
+
if (!items.includes(item))
|
|
142
|
+
return null;
|
|
143
|
+
const resolvedItem = item;
|
|
144
|
+
const resolvedOptions = itemOptions[resolvedItem];
|
|
145
|
+
if (!resolvedOptions)
|
|
106
146
|
return null;
|
|
107
|
-
|
|
147
|
+
const tooltipLabel = tooltip || resolvedOptions.tooltipLabel;
|
|
148
|
+
switch (resolvedItem) {
|
|
108
149
|
case "heading":
|
|
109
150
|
return _createVNode(HeadingExtention, {
|
|
110
|
-
"tooltipLabel":
|
|
151
|
+
"tooltipLabel": tooltipLabel,
|
|
111
152
|
"editor": editor
|
|
112
153
|
}, null);
|
|
113
154
|
case "align":
|
|
114
155
|
return _createVNode(AlignExtention, {
|
|
115
|
-
"tooltipLabel":
|
|
156
|
+
"tooltipLabel": tooltipLabel,
|
|
116
157
|
"editor": editor
|
|
117
158
|
}, null);
|
|
118
159
|
case "textColor":
|
|
119
160
|
case "fillColor":
|
|
120
161
|
return _createVNode(ColorExtension, {
|
|
121
|
-
"tooltipLabel":
|
|
162
|
+
"tooltipLabel": tooltipLabel,
|
|
122
163
|
"editor": editor,
|
|
123
|
-
"type":
|
|
164
|
+
"type": resolvedOptions.type
|
|
124
165
|
}, null);
|
|
125
166
|
case "textLink":
|
|
126
167
|
return _createVNode(LinkExtension, {
|
|
127
|
-
"tooltipLabel":
|
|
168
|
+
"tooltipLabel": tooltipLabel,
|
|
128
169
|
"editor": editor
|
|
129
170
|
}, null);
|
|
130
171
|
default:
|
|
131
172
|
return _createVNode(SingleExtention, {
|
|
132
|
-
"name":
|
|
133
|
-
"tooltipLabel":
|
|
134
|
-
"onClick":
|
|
173
|
+
"name": resolvedItem,
|
|
174
|
+
"tooltipLabel": tooltipLabel,
|
|
175
|
+
"onClick": resolvedOptions.onClick,
|
|
135
176
|
"editor": editor
|
|
136
177
|
}, null);
|
|
137
178
|
}
|
|
138
179
|
}, "renderExtension");
|
|
139
|
-
return () => _createVNode(
|
|
140
|
-
|
|
141
|
-
|
|
180
|
+
return () => _createVNode(MpScrollbar, {
|
|
181
|
+
"options": {
|
|
182
|
+
overflow: {
|
|
183
|
+
y: "hide",
|
|
184
|
+
x: "scroll"
|
|
185
|
+
}
|
|
142
186
|
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
187
|
+
}, {
|
|
188
|
+
default: () => [_createVNode("div", {
|
|
189
|
+
"class": css({
|
|
190
|
+
display: "flex",
|
|
191
|
+
alignItems: "stretch",
|
|
192
|
+
gap: "1"
|
|
193
|
+
})
|
|
194
|
+
}, [options == null ? void 0 : options.map((option, index) => _createVNode(_Fragment, null, [option.map((item) => {
|
|
195
|
+
const resolvedItem = typeof item === "string" ? item : item.value;
|
|
196
|
+
if (items.includes(resolvedItem)) {
|
|
197
|
+
return renderExtension(item);
|
|
198
|
+
}
|
|
199
|
+
}), index !== (options == null ? void 0 : options.length) - 1 && _createVNode(MpDivider, {
|
|
200
|
+
"id": "divider-toolbar",
|
|
201
|
+
"orientation": "vertical"
|
|
202
|
+
}, null)]))])]
|
|
203
|
+
});
|
|
147
204
|
}
|
|
148
205
|
});
|
|
149
206
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ColorTextIcon,
|
|
3
3
|
FillTextIcon
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-C7IUW3FX.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__name
|
|
7
7
|
} from "./chunk-QZ7VFGWC.mjs";
|
|
@@ -57,6 +57,7 @@ var ColorExtension = defineComponent({
|
|
|
57
57
|
"preset": colorPreset,
|
|
58
58
|
"variant": "basic",
|
|
59
59
|
"placement": "bottom-start",
|
|
60
|
+
"usePortal": true,
|
|
60
61
|
"isShowPreset": true,
|
|
61
62
|
"isShowInput": false,
|
|
62
63
|
"class": css({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LinkIcon
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C7IUW3FX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-QZ7VFGWC.mjs";
|
|
@@ -55,6 +55,7 @@ var LinkExtension = defineComponent({
|
|
|
55
55
|
popperInstance.destroy();
|
|
56
56
|
}
|
|
57
57
|
popperInstance = createPopper(target, popoverRef.value, {
|
|
58
|
+
strategy: "fixed",
|
|
58
59
|
onFirstUpdate: () => {
|
|
59
60
|
if (popperInstance) {
|
|
60
61
|
popperInstance.setOptions({
|
|
@@ -113,6 +114,14 @@ var LinkExtension = defineComponent({
|
|
|
113
114
|
}
|
|
114
115
|
onClosePopover();
|
|
115
116
|
}, "onSetLink");
|
|
117
|
+
const onOpenInNewTab = /* @__PURE__ */ __name(() => {
|
|
118
|
+
const trimmedUrl = url.value.trim();
|
|
119
|
+
if (!trimmedUrl) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const normalizedUrl = /^(https?:)?\/\//i.test(trimmedUrl) ? trimmedUrl : `https://${trimmedUrl}`;
|
|
123
|
+
window.open(normalizedUrl, "_blank", "noopener,noreferrer");
|
|
124
|
+
}, "onOpenInNewTab");
|
|
116
125
|
const onClosePopover = /* @__PURE__ */ __name(() => {
|
|
117
126
|
isShowPopover.value = false;
|
|
118
127
|
editor == null ? void 0 : editor.commands.setTextSelection({
|
|
@@ -156,10 +165,9 @@ var LinkExtension = defineComponent({
|
|
|
156
165
|
default: () => [_createVNode("div", {
|
|
157
166
|
"ref": popoverRef,
|
|
158
167
|
"data-pixel-rte": true,
|
|
159
|
-
"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
168
|
+
"class": css({
|
|
169
|
+
zIndex: "popover"
|
|
170
|
+
})
|
|
163
171
|
}, [_createVNode("div", {
|
|
164
172
|
"class": css({
|
|
165
173
|
display: "flex",
|
|
@@ -192,6 +200,11 @@ var LinkExtension = defineComponent({
|
|
|
192
200
|
}, null) : _createVNode(MpButton, {
|
|
193
201
|
"leftIcon": "check",
|
|
194
202
|
"onClick": onSetLink
|
|
203
|
+
}, null), isEditLink.value && _createVNode(MpButton, {
|
|
204
|
+
"leftIcon": "newtab",
|
|
205
|
+
"variant": "ghost",
|
|
206
|
+
"isDisabled": !url.value.trim(),
|
|
207
|
+
"onClick": onOpenInNewTab
|
|
195
208
|
}, null), isEditLink.value ? _createVNode(MpButton, {
|
|
196
209
|
"leftIcon": "delete",
|
|
197
210
|
"variant": "ghost",
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AudioIcon,
|
|
2
3
|
BlockquoteIcon,
|
|
3
4
|
BoldIcon,
|
|
4
5
|
BulletListIcon,
|
|
5
6
|
ClearIcon,
|
|
7
|
+
FileIcon,
|
|
8
|
+
ImageIcon,
|
|
6
9
|
ItalicIcon,
|
|
10
|
+
MentionIcon,
|
|
7
11
|
OrderedListIcon,
|
|
8
12
|
RedoIcon,
|
|
9
13
|
StrikeIcon,
|
|
10
14
|
UnderlineIcon,
|
|
11
15
|
UndoIcon
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-C7IUW3FX.mjs";
|
|
13
17
|
|
|
14
18
|
// src/extensions/single-extension.tsx
|
|
15
19
|
import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, createVNode as _createVNode } from "vue";
|
|
@@ -46,7 +50,11 @@ var SingleExtention = defineComponent({
|
|
|
46
50
|
orderedList: _createVNode(OrderedListIcon, null, null),
|
|
47
51
|
undo: _createVNode(UndoIcon, null, null),
|
|
48
52
|
redo: _createVNode(RedoIcon, null, null),
|
|
49
|
-
clear: _createVNode(ClearIcon, null, null)
|
|
53
|
+
clear: _createVNode(ClearIcon, null, null),
|
|
54
|
+
image: _createVNode(ImageIcon, null, null),
|
|
55
|
+
file: _createVNode(FileIcon, null, null),
|
|
56
|
+
audio: _createVNode(AudioIcon, null, null),
|
|
57
|
+
mention: _createVNode(MentionIcon, null, null)
|
|
50
58
|
};
|
|
51
59
|
return () => _withDirectives(_createVNode("button", {
|
|
52
60
|
"class": {
|
|
@@ -27,6 +27,10 @@ var richTextEditorProps = {
|
|
|
27
27
|
hasBorder: {
|
|
28
28
|
type: Boolean,
|
|
29
29
|
default: true
|
|
30
|
+
},
|
|
31
|
+
suggestions: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => []
|
|
30
34
|
}
|
|
31
35
|
};
|
|
32
36
|
var RTEStyleProviderProps = {
|
|
@@ -34,7 +38,7 @@ var RTEStyleProviderProps = {
|
|
|
34
38
|
type: String
|
|
35
39
|
}
|
|
36
40
|
};
|
|
37
|
-
var richTextEditorEmits = declareEmit(["change", "blur", "focus"]);
|
|
41
|
+
var richTextEditorEmits = declareEmit(["change", "blur", "focus", "action", "paste"]);
|
|
38
42
|
|
|
39
43
|
export {
|
|
40
44
|
richTextEditorProps,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CaretIcon
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C7IUW3FX.mjs";
|
|
4
4
|
|
|
5
5
|
// src/extensions/heading-extension.tsx
|
|
6
6
|
import { withDirectives as _withDirectives, resolveDirective as _resolveDirective, createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
|
|
@@ -23,7 +23,8 @@ var HeadingExtention = defineComponent({
|
|
|
23
23
|
editor
|
|
24
24
|
}) {
|
|
25
25
|
return () => _createVNode(MpPopover, {
|
|
26
|
-
"id": "popover-heading-extention"
|
|
26
|
+
"id": "popover-heading-extention",
|
|
27
|
+
"usePortal": true
|
|
27
28
|
}, {
|
|
28
29
|
default: () => [_createVNode(MpPopoverTrigger, null, {
|
|
29
30
|
default: () => [_withDirectives(_createVNode("button", {
|
|
@@ -94,84 +95,55 @@ var HeadingExtention = defineComponent({
|
|
|
94
95
|
})
|
|
95
96
|
}, {
|
|
96
97
|
default: () => [_createVNode(MpPopoverList, {
|
|
97
|
-
"
|
|
98
|
-
gap: "2",
|
|
99
|
-
alignItems: "flex-start",
|
|
100
|
-
paddingLeft: "3"
|
|
101
|
-
})
|
|
98
|
+
"data-pixel-rte": true
|
|
102
99
|
}, {
|
|
103
100
|
default: () => [_createVNode(MpPopoverListItem, {
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}),
|
|
108
|
-
"text-sizing": true
|
|
109
|
-
},
|
|
101
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
102
|
+
level: 1
|
|
103
|
+
}),
|
|
110
104
|
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
111
105
|
level: 1
|
|
112
106
|
}).run()
|
|
113
107
|
}, {
|
|
114
108
|
default: () => [_createVNode(MpText, {
|
|
115
109
|
"as": "h1",
|
|
116
|
-
"size": "h1"
|
|
117
|
-
"class": css({
|
|
118
|
-
color: "currentColor"
|
|
119
|
-
})
|
|
110
|
+
"size": "h1"
|
|
120
111
|
}, {
|
|
121
112
|
default: () => [_createTextVNode("Heading 1")]
|
|
122
113
|
})]
|
|
123
114
|
}), _createVNode(MpPopoverListItem, {
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}),
|
|
128
|
-
"text-sizing": true
|
|
129
|
-
},
|
|
115
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
116
|
+
level: 2
|
|
117
|
+
}),
|
|
130
118
|
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
131
119
|
level: 2
|
|
132
120
|
}).run()
|
|
133
121
|
}, {
|
|
134
122
|
default: () => [_createVNode(MpText, {
|
|
135
123
|
"as": "h2",
|
|
136
|
-
"size": "h2"
|
|
137
|
-
"class": css({
|
|
138
|
-
color: "currentColor"
|
|
139
|
-
})
|
|
124
|
+
"size": "h2"
|
|
140
125
|
}, {
|
|
141
126
|
default: () => [_createTextVNode("Heading 2")]
|
|
142
127
|
})]
|
|
143
128
|
}), _createVNode(MpPopoverListItem, {
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}),
|
|
148
|
-
"text-sizing": true
|
|
149
|
-
},
|
|
129
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
130
|
+
level: 3
|
|
131
|
+
}),
|
|
150
132
|
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
151
133
|
level: 3
|
|
152
134
|
}).run()
|
|
153
135
|
}, {
|
|
154
136
|
default: () => [_createVNode(MpText, {
|
|
155
137
|
"as": "h3",
|
|
156
|
-
"size": "h3"
|
|
157
|
-
"class": css({
|
|
158
|
-
color: "currentColor"
|
|
159
|
-
})
|
|
138
|
+
"size": "h3"
|
|
160
139
|
}, {
|
|
161
140
|
default: () => [_createTextVNode("Heading 3")]
|
|
162
141
|
})]
|
|
163
142
|
}), _createVNode(MpPopoverListItem, {
|
|
164
|
-
"
|
|
165
|
-
"is-active": editor == null ? void 0 : editor.isActive("paragraph"),
|
|
166
|
-
"text-sizing": true
|
|
167
|
-
},
|
|
143
|
+
"is-active": editor == null ? void 0 : editor.isActive("paragraph"),
|
|
168
144
|
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setParagraph().run()
|
|
169
145
|
}, {
|
|
170
|
-
default: () => [_createVNode(MpText, {
|
|
171
|
-
"class": css({
|
|
172
|
-
color: "currentColor"
|
|
173
|
-
})
|
|
174
|
-
}, {
|
|
146
|
+
default: () => [_createVNode(MpText, null, {
|
|
175
147
|
default: () => [_createTextVNode("Normal text")]
|
|
176
148
|
})]
|
|
177
149
|
})]
|
|
@@ -11,6 +11,7 @@ function richTextEditorConnect(state, classes) {
|
|
|
11
11
|
placeholder,
|
|
12
12
|
maxlength,
|
|
13
13
|
options,
|
|
14
|
+
suggestions,
|
|
14
15
|
hasBorder,
|
|
15
16
|
isInvalid,
|
|
16
17
|
isDisabled
|
|
@@ -22,6 +23,7 @@ function richTextEditorConnect(state, classes) {
|
|
|
22
23
|
placeholder,
|
|
23
24
|
maxlength,
|
|
24
25
|
options,
|
|
26
|
+
suggestions,
|
|
25
27
|
isInvalid,
|
|
26
28
|
isDisabled,
|
|
27
29
|
rootProps: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import { ToolbarOption } from './modules/rich-text-editor.types.mjs';
|
|
5
5
|
import { Editor } from '@tiptap/vue-3';
|
|
6
6
|
import '@mekari/pixel3-utils';
|
|
7
7
|
|
|
@@ -10,15 +10,19 @@ declare const EditorToolbar: vue.DefineComponent<{
|
|
|
10
10
|
type: PropType<Editor>;
|
|
11
11
|
};
|
|
12
12
|
options: {
|
|
13
|
-
type: PropType<
|
|
13
|
+
type: PropType<ToolbarOption[][]>;
|
|
14
14
|
};
|
|
15
|
-
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin,
|
|
15
|
+
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("clickImage" | "clickFile" | "clickAudio")[], "clickImage" | "clickFile" | "clickAudio", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
16
16
|
editor: {
|
|
17
17
|
type: PropType<Editor>;
|
|
18
18
|
};
|
|
19
19
|
options: {
|
|
20
|
-
type: PropType<
|
|
20
|
+
type: PropType<ToolbarOption[][]>;
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
}>> & {
|
|
23
|
+
onClickImage?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
onClickFile?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
onClickAudio?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
}, {}, {}>;
|
|
23
27
|
|
|
24
28
|
export { EditorToolbar };
|
package/dist/editor-toolbar.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { PropType } from 'vue';
|
|
3
3
|
import * as vue_jsx_runtime from 'vue/jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import { ToolbarOption } from './modules/rich-text-editor.types.js';
|
|
5
5
|
import { Editor } from '@tiptap/vue-3';
|
|
6
6
|
import '@mekari/pixel3-utils';
|
|
7
7
|
|
|
@@ -10,15 +10,19 @@ declare const EditorToolbar: vue.DefineComponent<{
|
|
|
10
10
|
type: PropType<Editor>;
|
|
11
11
|
};
|
|
12
12
|
options: {
|
|
13
|
-
type: PropType<
|
|
13
|
+
type: PropType<ToolbarOption[][]>;
|
|
14
14
|
};
|
|
15
|
-
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin,
|
|
15
|
+
}, () => vue_jsx_runtime.JSX.Element, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("clickImage" | "clickFile" | "clickAudio")[], "clickImage" | "clickFile" | "clickAudio", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
16
16
|
editor: {
|
|
17
17
|
type: PropType<Editor>;
|
|
18
18
|
};
|
|
19
19
|
options: {
|
|
20
|
-
type: PropType<
|
|
20
|
+
type: PropType<ToolbarOption[][]>;
|
|
21
21
|
};
|
|
22
|
-
}
|
|
22
|
+
}>> & {
|
|
23
|
+
onClickImage?: ((...args: any[]) => any) | undefined;
|
|
24
|
+
onClickFile?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
onClickAudio?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
}, {}, {}>;
|
|
23
27
|
|
|
24
28
|
export { EditorToolbar };
|