@mekari/pixel3-rich-text-editor 0.0.1-dev.0
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-2SSVSEKG.mjs +28 -0
- package/dist/chunk-3RJGWHBG.mjs +122 -0
- package/dist/chunk-CE52CW3F.mjs +0 -0
- package/dist/chunk-CENCRLRC.mjs +40 -0
- package/dist/chunk-IE2ITPBX.mjs +106 -0
- package/dist/chunk-J5QZDLNA.mjs +282 -0
- package/dist/chunk-JURYRRU5.mjs +61 -0
- package/dist/chunk-MMFX326I.mjs +44 -0
- package/dist/chunk-N5YFARYC.mjs +89 -0
- package/dist/chunk-OFJH5BEQ.mjs +176 -0
- package/dist/chunk-QZ7VFGWC.mjs +6 -0
- package/dist/chunk-VQOMXS6M.mjs +27 -0
- package/dist/editor-toolbar.d.mts +12 -0
- package/dist/editor-toolbar.d.ts +12 -0
- package/dist/editor-toolbar.js +698 -0
- package/dist/editor-toolbar.mjs +12 -0
- package/dist/extensions/align-extension.d.mts +12 -0
- package/dist/extensions/align-extension.d.ts +12 -0
- package/dist/extensions/align-extension.js +406 -0
- package/dist/extensions/align-extension.mjs +8 -0
- package/dist/extensions/heading-extension.d.mts +12 -0
- package/dist/extensions/heading-extension.d.ts +12 -0
- package/dist/extensions/heading-extension.js +463 -0
- package/dist/extensions/heading-extension.mjs +8 -0
- package/dist/extensions/icons.d.mts +20 -0
- package/dist/extensions/icons.d.ts +20 -0
- package/dist/extensions/icons.js +320 -0
- package/dist/extensions/icons.mjs +35 -0
- package/dist/extensions/index.d.mts +5 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/index.js +609 -0
- package/dist/extensions/index.mjs +17 -0
- package/dist/extensions/single-extension.d.mts +16 -0
- package/dist/extensions/single-extension.d.ts +16 -0
- package/dist/extensions/single-extension.js +322 -0
- package/dist/extensions/single-extension.mjs +8 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +914 -0
- package/dist/index.mjs +20 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/modules/rich-text-editor.connects.d.mts +11 -0
- package/dist/modules/rich-text-editor.connects.d.ts +11 -0
- package/dist/modules/rich-text-editor.connects.js +83 -0
- package/dist/modules/rich-text-editor.connects.mjs +9 -0
- package/dist/modules/rich-text-editor.hooks.d.mts +8 -0
- package/dist/modules/rich-text-editor.hooks.d.ts +8 -0
- package/dist/modules/rich-text-editor.hooks.js +101 -0
- package/dist/modules/rich-text-editor.hooks.mjs +10 -0
- package/dist/modules/rich-text-editor.props.d.mts +40 -0
- package/dist/modules/rich-text-editor.props.d.ts +40 -0
- package/dist/modules/rich-text-editor.props.js +66 -0
- package/dist/modules/rich-text-editor.props.mjs +11 -0
- package/dist/modules/rich-text-editor.types.d.mts +54 -0
- package/dist/modules/rich-text-editor.types.d.ts +54 -0
- package/dist/modules/rich-text-editor.types.js +18 -0
- package/dist/modules/rich-text-editor.types.mjs +0 -0
- package/dist/rich-text-editor.d.mts +67 -0
- package/dist/rich-text-editor.d.ts +67 -0
- package/dist/rich-text-editor.js +910 -0
- package/dist/rich-text-editor.mjs +17 -0
- package/dist/rte-style-provider.d.mts +17 -0
- package/dist/rte-style-provider.d.ts +17 -0
- package/dist/rte-style-provider.js +85 -0
- package/dist/rte-style-provider.mjs +10 -0
- package/package.json +55 -0
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/rich-text-editor.tsx
|
|
32
|
+
var rich_text_editor_exports = {};
|
|
33
|
+
__export(rich_text_editor_exports, {
|
|
34
|
+
MpRichTextEditor: () => MpRichTextEditor
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(rich_text_editor_exports);
|
|
37
|
+
var import_vue14 = require("vue");
|
|
38
|
+
var import_vue15 = require("vue");
|
|
39
|
+
|
|
40
|
+
// src/modules/rich-text-editor.props.ts
|
|
41
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
42
|
+
var richTextEditorProps = {
|
|
43
|
+
id: {
|
|
44
|
+
type: String
|
|
45
|
+
},
|
|
46
|
+
value: {
|
|
47
|
+
type: String
|
|
48
|
+
},
|
|
49
|
+
placeholder: {
|
|
50
|
+
type: String
|
|
51
|
+
},
|
|
52
|
+
options: {
|
|
53
|
+
type: Array
|
|
54
|
+
},
|
|
55
|
+
isInvalid: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false
|
|
58
|
+
},
|
|
59
|
+
isDisabled: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
hasBorder: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var RTEStyleProviderProps = {
|
|
69
|
+
id: {
|
|
70
|
+
type: String
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var richTextEditorEmits = (0, import_pixel3_utils.declareEmit)(["change", "blur", "focus"]);
|
|
74
|
+
|
|
75
|
+
// src/modules/rich-text-editor.hooks.ts
|
|
76
|
+
var import_vue = require("vue");
|
|
77
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
78
|
+
|
|
79
|
+
// src/modules/rich-text-editor.connects.ts
|
|
80
|
+
var import_pixel3_utils2 = require("@mekari/pixel3-utils");
|
|
81
|
+
function richTextEditorConnect(state, classes) {
|
|
82
|
+
const {
|
|
83
|
+
id,
|
|
84
|
+
value,
|
|
85
|
+
placeholder,
|
|
86
|
+
options,
|
|
87
|
+
hasBorder,
|
|
88
|
+
isInvalid,
|
|
89
|
+
isDisabled
|
|
90
|
+
} = state;
|
|
91
|
+
const idx = id != null ? id : `mp-rich-text-editor-${(0, import_pixel3_utils2.useId)()}`;
|
|
92
|
+
return {
|
|
93
|
+
value,
|
|
94
|
+
placeholder,
|
|
95
|
+
options,
|
|
96
|
+
isInvalid,
|
|
97
|
+
isDisabled,
|
|
98
|
+
rootProps: {
|
|
99
|
+
id: idx,
|
|
100
|
+
class: classes.root,
|
|
101
|
+
"data-has-border": hasBorder,
|
|
102
|
+
"data-pixel-component": "MpRichTextEditor"
|
|
103
|
+
},
|
|
104
|
+
toolbarProps: {
|
|
105
|
+
id: `${idx}-toolbar`,
|
|
106
|
+
class: classes.toolbar,
|
|
107
|
+
"data-pixel-component": "MpRichTextEditorToolbar"
|
|
108
|
+
},
|
|
109
|
+
areaProps: {
|
|
110
|
+
id: `${idx}-area`,
|
|
111
|
+
class: classes.area,
|
|
112
|
+
"data-pixel-component": "MpRichTextEditorArea"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
__name(richTextEditorConnect, "richTextEditorConnect");
|
|
117
|
+
function RTEStyleProviderConnect(state, classes) {
|
|
118
|
+
const {
|
|
119
|
+
id
|
|
120
|
+
} = state;
|
|
121
|
+
const idx = id != null ? id : `mp-rte-style-provider-${(0, import_pixel3_utils2.useId)()}`;
|
|
122
|
+
return {
|
|
123
|
+
rootProps: {
|
|
124
|
+
id: idx,
|
|
125
|
+
class: classes,
|
|
126
|
+
"data-pixel-component": "MpRTEStyleProvider"
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
__name(RTEStyleProviderConnect, "RTEStyleProviderConnect");
|
|
131
|
+
|
|
132
|
+
// src/modules/rich-text-editor.hooks.ts
|
|
133
|
+
var useRichTextEditor = /* @__PURE__ */ __name((props) => {
|
|
134
|
+
const context = (0, import_vue.ref)(props);
|
|
135
|
+
const [value] = import_recipes.richTextEditorSlotRecipe.splitVariantProps(context.value);
|
|
136
|
+
const classes = (0, import_recipes.richTextEditorSlotRecipe)(value);
|
|
137
|
+
return (0, import_vue.computed)(() => richTextEditorConnect(context.value, classes));
|
|
138
|
+
}, "useRichTextEditor");
|
|
139
|
+
var useRTEStyleProvider = /* @__PURE__ */ __name((props) => {
|
|
140
|
+
const context = (0, import_vue.ref)(props);
|
|
141
|
+
const [value] = import_recipes.RTEStyleProviderRecipe.splitVariantProps(context.value);
|
|
142
|
+
const classes = (0, import_recipes.RTEStyleProviderRecipe)(value);
|
|
143
|
+
return (0, import_vue.computed)(() => RTEStyleProviderConnect(context.value, classes));
|
|
144
|
+
}, "useRTEStyleProvider");
|
|
145
|
+
|
|
146
|
+
// src/rich-text-editor.tsx
|
|
147
|
+
var import_vue_3 = require("@tiptap/vue-3");
|
|
148
|
+
|
|
149
|
+
// src/editor-toolbar.tsx
|
|
150
|
+
var import_vue10 = require("vue");
|
|
151
|
+
var import_vue11 = require("vue");
|
|
152
|
+
|
|
153
|
+
// src/extensions/heading-extension.tsx
|
|
154
|
+
var import_vue4 = require("vue");
|
|
155
|
+
var import_vue5 = require("vue");
|
|
156
|
+
|
|
157
|
+
// src/extensions/icons.tsx
|
|
158
|
+
var import_vue2 = require("vue");
|
|
159
|
+
var import_vue3 = require("vue");
|
|
160
|
+
var BoldIcon = (0, import_vue3.defineComponent)({
|
|
161
|
+
name: "BoldIcon",
|
|
162
|
+
setup() {
|
|
163
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
164
|
+
"width": "12",
|
|
165
|
+
"height": "16",
|
|
166
|
+
"viewBox": "0 0 12 16",
|
|
167
|
+
"fill": "none",
|
|
168
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
169
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
170
|
+
"d": "M1 8.00016H6C7.84095 8.00016 9.33333 6.50778 9.33333 4.66683C9.33333 2.82588 7.84095 1.3335 6 1.3335L1.92593 1.3335C1.41455 1.3335 1 1.74805 1 2.25942L1 8.00016ZM1 8.00016L7.66667 8.00016C9.50762 8.00016 11 9.49255 11 11.3335C11 13.1744 9.50761 14.6668 7.66666 14.6668H2.11111C1.49746 14.6668 1 14.1694 1 13.5557L1 8.00016Z",
|
|
171
|
+
"stroke": "currentColor",
|
|
172
|
+
"stroke-width": "1.5",
|
|
173
|
+
"stroke-linecap": "round",
|
|
174
|
+
"stroke-linejoin": "round"
|
|
175
|
+
}, null)]);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
var ItalicIcon = (0, import_vue3.defineComponent)({
|
|
179
|
+
name: "ItalicIcon",
|
|
180
|
+
setup() {
|
|
181
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
182
|
+
"width": "14",
|
|
183
|
+
"height": "16",
|
|
184
|
+
"viewBox": "0 0 14 16",
|
|
185
|
+
"fill": "none",
|
|
186
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
187
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
188
|
+
"d": "M4.50002 1.3335H12.8333M1.16675 14.6668H9.49998M8.66683 1.3335L5.33354 14.6668",
|
|
189
|
+
"stroke": "currentColor",
|
|
190
|
+
"stroke-width": "1.5",
|
|
191
|
+
"stroke-linecap": "round",
|
|
192
|
+
"stroke-linejoin": "round"
|
|
193
|
+
}, null)]);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
var UnderlineIcon = (0, import_vue3.defineComponent)({
|
|
197
|
+
name: "UnderlineIcon",
|
|
198
|
+
setup() {
|
|
199
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
200
|
+
"width": "16",
|
|
201
|
+
"height": "16",
|
|
202
|
+
"viewBox": "0 0 16 16",
|
|
203
|
+
"fill": "none",
|
|
204
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
205
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
206
|
+
"d": "M1 14.25C0.585786 14.25 0.25 14.5858 0.25 15C0.25 15.4142 0.585786 15.75 1 15.75L1 14.25ZM15 15.75C15.4142 15.75 15.75 15.4142 15.75 15C15.75 14.5858 15.4142 14.25 15 14.25V15.75ZM13.75 1C13.75 0.585786 13.4142 0.25 13 0.25C12.5858 0.25 12.25 0.585786 12.25 1H13.75ZM3.75 1C3.75 0.585786 3.41421 0.25 3 0.25C2.58579 0.25 2.25 0.585786 2.25 1H3.75ZM1 15.75L15 15.75V14.25L1 14.25L1 15.75ZM12.25 1V7H13.75V1H12.25ZM3.75 7V1H2.25V7H3.75ZM8 11.25C5.65279 11.25 3.75 9.34721 3.75 7H2.25C2.25 10.1756 4.82436 12.75 8 12.75V11.25ZM12.25 7C12.25 9.34721 10.3472 11.25 8 11.25V12.75C11.1756 12.75 13.75 10.1756 13.75 7H12.25Z",
|
|
207
|
+
"fill": "currentColor"
|
|
208
|
+
}, null)]);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
var StrikeIcon = (0, import_vue3.defineComponent)({
|
|
212
|
+
name: "StrikeIcon",
|
|
213
|
+
setup() {
|
|
214
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
215
|
+
"width": "16",
|
|
216
|
+
"height": "16",
|
|
217
|
+
"viewBox": "0 0 16 16",
|
|
218
|
+
"fill": "none",
|
|
219
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
220
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
221
|
+
"d": "M1 7.25C0.585787 7.25 0.25 7.58579 0.25 8C0.25 8.41421 0.585786 8.75 1 8.75L1 7.25ZM15 8.75C15.4142 8.75 15.75 8.41422 15.75 8C15.75 7.58579 15.4142 7.25 15 7.25V8.75ZM11.75 3.59259C11.75 4.00681 12.0858 4.34259 12.5 4.34259C12.9142 4.34259 13.25 4.00681 13.25 3.59259H11.75ZM4.16799 12.0664C3.97965 11.6975 3.52791 11.5511 3.15899 11.7394C2.79007 11.9278 2.64367 12.3795 2.83201 12.7484L4.16799 12.0664ZM3.79533 5.9023C4.01752 6.25188 4.48103 6.35516 4.83061 6.13297C5.18019 5.91079 5.28346 5.44728 5.06127 5.0977L3.79533 5.9023ZM9.23449 7.2876C8.84104 7.15809 8.41711 7.37206 8.2876 7.76551C8.15809 8.15896 8.37206 8.58289 8.76551 8.7124L9.23449 7.2876ZM1 8.75L15 8.75V7.25L1 7.25L1 8.75ZM13.25 3.59259C13.25 3.27636 13.1143 2.91655 12.9402 2.60384C12.7507 2.26362 12.4657 1.88848 12.0695 1.53923C11.266 0.830943 10.0291 0.25 8.26471 0.25V1.75C9.67678 1.75 10.5576 2.20609 11.0776 2.66447C11.3431 2.89855 11.5214 3.13915 11.6297 3.33366C11.7533 3.55567 11.75 3.64957 11.75 3.59259H13.25ZM8.26471 0.25C4.6888 0.25 3.27941 2.64524 3.27941 4.11111H4.77941C4.77941 3.50291 5.48767 1.75 8.26471 1.75V0.25ZM11.75 11.3704C11.75 12.5369 10.7905 14.25 8.26471 14.25V15.75C11.6684 15.75 13.25 13.315 13.25 11.3704H11.75ZM8.26471 14.25C6.92152 14.25 6.0134 13.9003 5.39394 13.4745C4.76788 13.0442 4.39192 12.505 4.16799 12.0664L2.83201 12.7484C3.13749 13.3468 3.66154 14.1039 4.5443 14.7107C5.43366 15.3219 6.64319 15.75 8.26471 15.75V14.25ZM3.27941 4.11111C3.27941 4.62256 3.38349 5.25433 3.79533 5.9023L5.06127 5.0977C4.83648 4.74401 4.77941 4.4088 4.77941 4.11111H3.27941ZM8.76551 8.7124C10.0377 9.13116 10.7819 9.5689 11.2052 10.0002C11.5982 10.4006 11.75 10.8304 11.75 11.3704H13.25C13.25 10.48 12.9724 9.65929 12.2757 8.94946C11.6093 8.27047 10.6034 7.73819 9.23449 7.2876L8.76551 8.7124Z",
|
|
222
|
+
"fill": "currentColor"
|
|
223
|
+
}, null)]);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
var BlockquoteIcon = (0, import_vue3.defineComponent)({
|
|
227
|
+
name: "BlockquoteIcon",
|
|
228
|
+
setup() {
|
|
229
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
230
|
+
"width": "20",
|
|
231
|
+
"height": "18",
|
|
232
|
+
"viewBox": "0 0 20 18",
|
|
233
|
+
"fill": "none",
|
|
234
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
235
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
236
|
+
"d": "M1.66675 9.29169H6.50007C7.77507 9.29169 8.65009 10.2584 8.65009 11.4417V14.1251C8.65009 15.3084 7.77507 16.275 6.50007 16.275H3.81676C2.63343 16.275 1.66675 15.3084 1.66675 14.1251V9.29169ZM1.66675 9.29169C1.66675 4.25002 2.60844 3.41673 5.44177 1.7334M11.3584 9.29169H16.1917C17.4667 9.29169 18.3418 10.2584 18.3418 11.4417V14.1251C18.3418 15.3084 17.4667 16.275 16.1917 16.275H13.5084C12.3251 16.275 11.3584 15.3084 11.3584 14.1251V9.29169ZM11.3584 9.29169C11.3584 4.25002 12.3001 3.41673 15.1334 1.7334",
|
|
237
|
+
"stroke": "currentColor",
|
|
238
|
+
"stroke-width": "1.5",
|
|
239
|
+
"stroke-linecap": "round",
|
|
240
|
+
"stroke-linejoin": "round"
|
|
241
|
+
}, null)]);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
var BulletListIcon = (0, import_vue3.defineComponent)({
|
|
245
|
+
name: "BulletListIcon",
|
|
246
|
+
setup() {
|
|
247
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
248
|
+
"width": "18",
|
|
249
|
+
"height": "18",
|
|
250
|
+
"viewBox": "0 0 16 16",
|
|
251
|
+
"fill": "none",
|
|
252
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
253
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
254
|
+
"d": "M7.16658 13.2085L14.6666 13.2085M7.16658 8.00016L14.6666 8.00016M7.16658 2.5835H14.6666M4.24992 2.79183C4.24992 3.59724 3.597 4.25016 2.79159 4.25016C1.98617 4.25016 1.33325 3.59724 1.33325 2.79183C1.33325 1.98641 1.98617 1.3335 2.79159 1.3335C3.597 1.3335 4.24992 1.98641 4.24992 2.79183ZM4.24992 8.00016C4.24992 8.80558 3.597 9.4585 2.79159 9.4585C1.98617 9.4585 1.33325 8.80558 1.33325 8.00016C1.33325 7.19475 1.98617 6.54183 2.79159 6.54183C3.597 6.54183 4.24992 7.19475 4.24992 8.00016ZM4.24992 13.2085C4.24992 14.0139 3.597 14.6668 2.79159 14.6668C1.98617 14.6668 1.33325 14.0139 1.33325 13.2085C1.33325 12.4031 1.98617 11.7502 2.79159 11.7502C3.597 11.7502 4.24992 12.4031 4.24992 13.2085Z",
|
|
255
|
+
"stroke": "currentColor",
|
|
256
|
+
"stroke-width": "1.5",
|
|
257
|
+
"stroke-linecap": "round",
|
|
258
|
+
"stroke-linejoin": "round"
|
|
259
|
+
}, null)]);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
var OrderedListIcon = (0, import_vue3.defineComponent)({
|
|
263
|
+
name: "OrderedListIcon",
|
|
264
|
+
setup() {
|
|
265
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
266
|
+
"width": "18",
|
|
267
|
+
"height": "18",
|
|
268
|
+
"viewBox": "0 0 16 16",
|
|
269
|
+
"fill": "none",
|
|
270
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
271
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
272
|
+
"d": "M6.33337 12.4585C5.91916 12.4585 5.58337 12.7943 5.58337 13.2085C5.58337 13.6227 5.91916 13.9585 6.33337 13.9585V12.4585ZM14.6667 13.9585C15.0809 13.9585 15.4167 13.6227 15.4167 13.2085C15.4167 12.7943 15.0809 12.4585 14.6667 12.4585V13.9585ZM6.33337 7.25016C5.91916 7.25016 5.58337 7.58595 5.58337 8.00016C5.58337 8.41438 5.91916 8.75016 6.33337 8.75016V7.25016ZM14.6667 8.75016C15.0809 8.75016 15.4167 8.41438 15.4167 8.00016C15.4167 7.58595 15.0809 7.25016 14.6667 7.25016V8.75016ZM6.33337 1.8335C5.91916 1.8335 5.58337 2.16928 5.58337 2.5835C5.58337 2.99771 5.91916 3.3335 6.33337 3.3335V1.8335ZM14.6667 3.3335C15.0809 3.3335 15.4167 2.99771 15.4167 2.5835C15.4167 2.16928 15.0809 1.8335 14.6667 1.8335V3.3335ZM0.943538 1.1998C0.589676 1.4151 0.477349 1.87649 0.692649 2.23036C0.90795 2.58422 1.36935 2.69655 1.72321 2.48125L0.943538 1.1998ZM2.16671 1.3335H2.91671C2.91671 1.06246 2.77048 0.812517 2.53421 0.679708C2.29795 0.5469 2.00841 0.551894 1.77687 0.692771L2.16671 1.3335ZM1.41671 4.25016C1.41671 4.66438 1.75249 5.00016 2.16671 5.00016C2.58092 5.00016 2.91671 4.66438 2.91671 4.25016H1.41671ZM0.699845 6.6952C0.538586 7.07674 0.717155 7.51676 1.09869 7.67802C1.48022 7.83928 1.92024 7.66071 2.0815 7.27917L0.699845 6.6952ZM2.66717 7.67869L3.26734 8.12846C3.27485 8.11845 3.2821 8.10824 3.2891 8.09786L2.66717 7.67869ZM1.33337 9.4585L0.733203 9.00872C0.562863 9.23602 0.535546 9.54005 0.662638 9.79407C0.789729 10.0481 1.04942 10.2085 1.33346 10.2085L1.33337 9.4585ZM2.79179 10.2083C3.206 10.2083 3.54175 9.87245 3.5417 9.45823C3.54165 9.04402 3.20582 8.70827 2.79161 8.70832L2.79179 10.2083ZM1.33337 11.0002C0.91916 11.0002 0.583374 11.3359 0.583374 11.7502C0.583374 12.1644 0.91916 12.5002 1.33337 12.5002V11.0002ZM2.79159 11.7502L3.4061 12.1801C3.56641 11.951 3.58595 11.6518 3.45679 11.4037C3.32763 11.1557 3.07122 11.0002 2.79159 11.0002V11.7502ZM1.94116 12.9656L1.32665 12.5356C1.16633 12.7647 1.1468 13.064 1.27596 13.312C1.40512 13.56 1.66153 13.7156 1.94116 13.7156L1.94116 12.9656ZM1.87 13.8874C1.57711 13.5945 1.10224 13.5945 0.809343 13.8874C0.516449 14.1802 0.51645 14.6551 0.809343 14.948L1.87 13.8874ZM6.33337 13.9585L14.6667 13.9585V12.4585L6.33337 12.4585V13.9585ZM6.33337 8.75016L14.6667 8.75016V7.25016L6.33337 7.25016V8.75016ZM6.33337 3.3335H14.6667V1.8335H6.33337V3.3335ZM1.72321 2.48125L2.55654 1.97422L1.77687 0.692771L0.943538 1.1998L1.72321 2.48125ZM1.41671 1.3335V4.25016H2.91671V1.3335H1.41671ZM2.0815 7.27917C2.08038 7.28184 2.07871 7.28423 2.0766 7.28621L1.04969 6.19285C0.899323 6.33407 0.780157 6.50519 0.699845 6.6952L2.0815 7.27917ZM2.0766 7.28621C2.0745 7.28819 2.072 7.28971 2.06927 7.29066L1.57297 5.87515C1.3783 5.9434 1.20006 6.05162 1.04969 6.19285L2.0766 7.28621ZM2.06927 7.29066C2.06655 7.29162 2.06365 7.29199 2.06077 7.29176L2.18007 5.79652C1.97444 5.78011 1.76764 5.80689 1.57297 5.87515L2.06927 7.29066ZM2.06077 7.29176C2.05789 7.29153 2.05509 7.2907 2.05255 7.28933L2.76703 5.97042C2.58564 5.87216 2.38571 5.81292 2.18007 5.79652L2.06077 7.29176ZM2.05255 7.28933C2.05001 7.28795 2.04778 7.28606 2.04602 7.28377L3.23331 6.36708C3.10724 6.20379 2.94841 6.06868 2.76703 5.97042L2.05255 7.28933ZM2.04602 7.28377C2.04425 7.28148 2.04298 7.27885 2.04229 7.27605L3.49907 6.91855C3.44991 6.71821 3.35938 6.53036 3.23331 6.36708L2.04602 7.28377ZM2.04229 7.27605C2.0416 7.27324 2.04151 7.27032 2.04202 7.26748L3.51879 7.53041C3.55495 7.32731 3.54823 7.1189 3.49907 6.91855L2.04229 7.27605ZM2.04202 7.26748C2.04252 7.26463 2.04362 7.26192 2.04523 7.25953L3.2891 8.09786C3.40439 7.92679 3.48263 7.73351 3.51879 7.53041L2.04202 7.26748ZM2.06699 7.22892L0.733203 9.00872L1.93355 9.90827L3.26734 8.12846L2.06699 7.22892ZM1.33346 10.2085L2.79179 10.2083L2.79161 8.70832L1.33328 8.7085L1.33346 10.2085ZM1.33337 12.5002H2.79159V11.0002H1.33337V12.5002ZM2.17708 11.3202L1.32665 12.5356L2.55566 13.3956L3.4061 12.1801L2.17708 11.3202ZM1.94116 13.7156C1.9577 13.7156 1.97399 13.7197 1.98859 13.7275L2.69569 12.4046C2.46354 12.2805 2.20438 12.2156 1.94116 12.2156L1.94116 13.7156ZM1.98859 13.7275C2.00318 13.7353 2.01563 13.7465 2.02482 13.7603L3.27203 12.9269C3.12579 12.7081 2.92783 12.5287 2.69569 12.4046L1.98859 13.7275ZM2.02482 13.7603C2.03401 13.7741 2.03967 13.7899 2.0413 13.8063L3.53407 13.6593C3.50827 13.3974 3.41827 13.1458 3.27203 12.9269L2.02482 13.7603ZM2.0413 13.8063C2.04292 13.8228 2.04045 13.8394 2.03412 13.8547L3.41994 14.4287C3.52067 14.1855 3.55987 13.9213 3.53407 13.6593L2.0413 13.8063ZM2.03412 13.8547C2.02779 13.87 2.01778 13.8835 2.00499 13.894L2.95658 15.0535C3.16006 14.8865 3.31921 14.6719 3.41994 14.4287L2.03412 13.8547ZM2.00499 13.894C1.9922 13.9045 1.97701 13.9117 1.96079 13.9149L2.25342 15.3861C2.51159 15.3347 2.75311 15.2205 2.95658 15.0535L2.00499 13.894ZM1.96079 13.9149C1.94456 13.9181 1.92778 13.9173 1.91195 13.9125L1.47652 15.3479C1.72841 15.4243 1.99525 15.4374 2.25342 15.3861L1.96079 13.9149ZM1.91195 13.9125C1.89611 13.9077 1.8817 13.8991 1.87 13.8874L0.809343 14.948C0.995471 15.1341 1.22463 15.2715 1.47652 15.3479L1.91195 13.9125Z",
|
|
273
|
+
"fill": "currentColor"
|
|
274
|
+
}, null)]);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
var AlignLeftIcon = (0, import_vue3.defineComponent)({
|
|
278
|
+
name: "AlignLeftIcon",
|
|
279
|
+
setup() {
|
|
280
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
281
|
+
"width": "22",
|
|
282
|
+
"height": "22",
|
|
283
|
+
"viewBox": "0 0 20 20",
|
|
284
|
+
"fill": "none",
|
|
285
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
286
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
287
|
+
"d": "M3 4L17 4 M3 12L17 12 M3 8L11 8 M3 16L11 16",
|
|
288
|
+
"stroke": "currentColor",
|
|
289
|
+
"stroke-width": "1.5",
|
|
290
|
+
"stroke-linecap": "round",
|
|
291
|
+
"stroke-linejoin": "round"
|
|
292
|
+
}, null)]);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
var AlignCenterIcon = (0, import_vue3.defineComponent)({
|
|
296
|
+
name: "AlignCenterIcon",
|
|
297
|
+
setup() {
|
|
298
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
299
|
+
"width": "22",
|
|
300
|
+
"height": "22",
|
|
301
|
+
"viewBox": "0 0 20 20",
|
|
302
|
+
"fill": "none",
|
|
303
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
304
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
305
|
+
"d": "M3 4L17 4 M3 12L17 12 M6 8L14 8 M6 16L14 16",
|
|
306
|
+
"stroke": "currentColor",
|
|
307
|
+
"stroke-width": "1.5",
|
|
308
|
+
"stroke-linecap": "round",
|
|
309
|
+
"stroke-linejoin": "round"
|
|
310
|
+
}, null)]);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
var AlignRightIcon = (0, import_vue3.defineComponent)({
|
|
314
|
+
name: "AlignRightIcon",
|
|
315
|
+
setup() {
|
|
316
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
317
|
+
"width": "22",
|
|
318
|
+
"height": "22",
|
|
319
|
+
"viewBox": "0 0 20 20",
|
|
320
|
+
"fill": "none",
|
|
321
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
322
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
323
|
+
"d": "M3 4L17 4 M3 12L17 12 M9 8L17 8 M9 16L17 16",
|
|
324
|
+
"stroke": "currentColor",
|
|
325
|
+
"stroke-width": "1.5",
|
|
326
|
+
"stroke-linecap": "round",
|
|
327
|
+
"stroke-linejoin": "round"
|
|
328
|
+
}, null)]);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
var AlignJustifyIcon = (0, import_vue3.defineComponent)({
|
|
332
|
+
name: "AlignJustifyIcon",
|
|
333
|
+
setup() {
|
|
334
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
335
|
+
"width": "22",
|
|
336
|
+
"height": "22",
|
|
337
|
+
"viewBox": "0 0 20 20",
|
|
338
|
+
"fill": "none",
|
|
339
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
340
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
341
|
+
"d": "M3 4L17 4 M3 12L17 12 M3 8L17 8 M3 16L17 16",
|
|
342
|
+
"stroke": "currentColor",
|
|
343
|
+
"stroke-width": "1.5",
|
|
344
|
+
"stroke-linecap": "round",
|
|
345
|
+
"stroke-linejoin": "round"
|
|
346
|
+
}, null)]);
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
var UndoIcon = (0, import_vue3.defineComponent)({
|
|
350
|
+
name: "UndoIcon",
|
|
351
|
+
setup() {
|
|
352
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
353
|
+
"width": "24",
|
|
354
|
+
"height": "24",
|
|
355
|
+
"viewBox": "0 0 24 24",
|
|
356
|
+
"fill": "none",
|
|
357
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
358
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
359
|
+
"d": "M4.06317 8.15033C4.49451 7.3513 5.05312 6.55227 5.80265 5.80273C9.18969 2.41569 14.6768 2.41569 18.0639 5.80273C21.4509 9.18977 21.4509 14.6769 18.0639 18.064C14.6768 21.451 9.18969 21.451 5.80265 18.064C4.544 16.8053 3.75204 15.2497 3.42677 13.6233M3.052 4.8057L3.35606 9.19684L7.47855 8.55343",
|
|
360
|
+
"stroke": "currentColor",
|
|
361
|
+
"stroke-width": "1.5",
|
|
362
|
+
"stroke-linecap": "round",
|
|
363
|
+
"stroke-linejoin": "round"
|
|
364
|
+
}, null)]);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
var RedoIcon = (0, import_vue3.defineComponent)({
|
|
368
|
+
name: "RedoIcon",
|
|
369
|
+
setup() {
|
|
370
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
371
|
+
"width": "24",
|
|
372
|
+
"height": "24",
|
|
373
|
+
"viewBox": "0 0 24 24",
|
|
374
|
+
"fill": "none",
|
|
375
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
376
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
377
|
+
"d": "M19.593 8.15033C19.1617 7.3513 18.603 6.55227 17.8535 5.80273C14.4665 2.41569 8.97932 2.41569 5.59228 5.80273C2.20524 9.18977 2.20524 14.6769 5.59228 18.064C8.97932 21.451 14.4665 21.451 17.8535 18.064C19.1122 16.8053 19.9041 15.2497 20.2294 13.6233M20.6042 4.8057L20.3001 9.19684L16.1776 8.55343",
|
|
378
|
+
"stroke": "currentColor",
|
|
379
|
+
"stroke-width": "1.5",
|
|
380
|
+
"stroke-linecap": "round",
|
|
381
|
+
"stroke-linejoin": "round"
|
|
382
|
+
}, null)]);
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
var ClearIcon = (0, import_vue3.defineComponent)({
|
|
386
|
+
name: "ClearIcon",
|
|
387
|
+
setup() {
|
|
388
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
389
|
+
"width": "18",
|
|
390
|
+
"height": "16",
|
|
391
|
+
"viewBox": "0 0 18 16",
|
|
392
|
+
"fill": "none",
|
|
393
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
394
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
395
|
+
"d": "M3.5 1H16.5M8.42149 6L10.6001 1M4.5 15L7.13903 8.9433M1.5 4L14.5 15",
|
|
396
|
+
"stroke": "currentColor",
|
|
397
|
+
"stroke-width": "1.5",
|
|
398
|
+
"stroke-linecap": "round",
|
|
399
|
+
"stroke-linejoin": "round"
|
|
400
|
+
}, null)]);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
var CaretIcon = (0, import_vue3.defineComponent)({
|
|
404
|
+
name: "CaretIcon",
|
|
405
|
+
setup() {
|
|
406
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
407
|
+
"width": "10",
|
|
408
|
+
"height": "6",
|
|
409
|
+
"viewBox": "0 0 10 6",
|
|
410
|
+
"fill": "none",
|
|
411
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
412
|
+
"style": {
|
|
413
|
+
marginLeft: "8px"
|
|
414
|
+
}
|
|
415
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
416
|
+
"d": "M0 0.5L5 5.5L10 0.5L0 0.5Z",
|
|
417
|
+
"fill": "currentColor"
|
|
418
|
+
}, null)]);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// src/extensions/heading-extension.tsx
|
|
423
|
+
var import_pixel3_popover = require("@mekari/pixel3-popover");
|
|
424
|
+
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
425
|
+
var import_css = require("@mekari/pixel3-styled-system/css");
|
|
426
|
+
var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
427
|
+
name: "HeadingExtention",
|
|
428
|
+
props: {
|
|
429
|
+
tooltipLabel: String,
|
|
430
|
+
editor: Object
|
|
431
|
+
},
|
|
432
|
+
setup({
|
|
433
|
+
tooltipLabel,
|
|
434
|
+
editor
|
|
435
|
+
}) {
|
|
436
|
+
return () => (0, import_vue4.createVNode)(import_pixel3_popover.MpPopover, null, {
|
|
437
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverTrigger, null, {
|
|
438
|
+
default: () => [(0, import_vue4.withDirectives)((0, import_vue4.createVNode)("button", {
|
|
439
|
+
"class": {
|
|
440
|
+
"is-active": (editor == null ? void 0 : editor.isActive("heading", {
|
|
441
|
+
level: 1
|
|
442
|
+
})) || (editor == null ? void 0 : editor.isActive("heading", {
|
|
443
|
+
level: 2
|
|
444
|
+
})) || (editor == null ? void 0 : editor.isActive("heading", {
|
|
445
|
+
level: 3
|
|
446
|
+
})) || (editor == null ? void 0 : editor.isActive("paragraph")),
|
|
447
|
+
"text-sizing": true
|
|
448
|
+
}
|
|
449
|
+
}, [(editor == null ? void 0 : editor.isActive("heading", {
|
|
450
|
+
level: 1
|
|
451
|
+
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
452
|
+
"class": (0, import_css.css)({
|
|
453
|
+
color: "currentColor"
|
|
454
|
+
})
|
|
455
|
+
}, {
|
|
456
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 1")]
|
|
457
|
+
}), (editor == null ? void 0 : editor.isActive("heading", {
|
|
458
|
+
level: 2
|
|
459
|
+
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
460
|
+
"class": (0, import_css.css)({
|
|
461
|
+
color: "currentColor"
|
|
462
|
+
})
|
|
463
|
+
}, {
|
|
464
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 2")]
|
|
465
|
+
}), (editor == null ? void 0 : editor.isActive("heading", {
|
|
466
|
+
level: 3
|
|
467
|
+
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
468
|
+
"class": (0, import_css.css)({
|
|
469
|
+
color: "currentColor"
|
|
470
|
+
})
|
|
471
|
+
}, {
|
|
472
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 3")]
|
|
473
|
+
}), (editor == null ? void 0 : editor.isActive("paragraph")) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
474
|
+
"class": (0, import_css.css)({
|
|
475
|
+
color: "currentColor"
|
|
476
|
+
})
|
|
477
|
+
}, {
|
|
478
|
+
default: () => [(0, import_vue4.createTextVNode)("Normal text")]
|
|
479
|
+
}), !(editor == null ? void 0 : editor.isActive("heading", {
|
|
480
|
+
level: 1
|
|
481
|
+
})) && !(editor == null ? void 0 : editor.isActive("heading", {
|
|
482
|
+
level: 2
|
|
483
|
+
})) && !(editor == null ? void 0 : editor.isActive("heading", {
|
|
484
|
+
level: 3
|
|
485
|
+
})) && !(editor == null ? void 0 : editor.isActive("paragraph")) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
486
|
+
"class": (0, import_css.css)({
|
|
487
|
+
color: "currentColor"
|
|
488
|
+
})
|
|
489
|
+
}, {
|
|
490
|
+
default: () => [(0, import_vue4.createTextVNode)("Normal text")]
|
|
491
|
+
}), (0, import_vue4.createVNode)(CaretIcon, null, null)]), [[(0, import_vue4.resolveDirective)("tooltip"), {
|
|
492
|
+
label: tooltipLabel
|
|
493
|
+
}]])]
|
|
494
|
+
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverContent, {
|
|
495
|
+
"class": (0, import_css.css)({
|
|
496
|
+
width: "200px",
|
|
497
|
+
maxWidth: "200px",
|
|
498
|
+
maxHeight: "300px"
|
|
499
|
+
})
|
|
500
|
+
}, {
|
|
501
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverList, {
|
|
502
|
+
"class": (0, import_css.css)({
|
|
503
|
+
gap: "2",
|
|
504
|
+
alignItems: "flex-start",
|
|
505
|
+
paddingLeft: "3"
|
|
506
|
+
})
|
|
507
|
+
}, {
|
|
508
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
509
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
510
|
+
level: 1
|
|
511
|
+
}).run(),
|
|
512
|
+
"class": {
|
|
513
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
514
|
+
level: 1
|
|
515
|
+
}),
|
|
516
|
+
"text-sizing": true
|
|
517
|
+
}
|
|
518
|
+
}, {
|
|
519
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
520
|
+
"as": "h1",
|
|
521
|
+
"size": "h1",
|
|
522
|
+
"class": (0, import_css.css)({
|
|
523
|
+
color: "currentColor"
|
|
524
|
+
})
|
|
525
|
+
}, {
|
|
526
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 1")]
|
|
527
|
+
})]
|
|
528
|
+
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
529
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
530
|
+
level: 2
|
|
531
|
+
}).run(),
|
|
532
|
+
"class": {
|
|
533
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
534
|
+
level: 2
|
|
535
|
+
}),
|
|
536
|
+
"text-sizing": true
|
|
537
|
+
}
|
|
538
|
+
}, {
|
|
539
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
540
|
+
"as": "h2",
|
|
541
|
+
"size": "h2",
|
|
542
|
+
"class": (0, import_css.css)({
|
|
543
|
+
color: "currentColor"
|
|
544
|
+
})
|
|
545
|
+
}, {
|
|
546
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 2")]
|
|
547
|
+
})]
|
|
548
|
+
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
549
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
550
|
+
level: 3
|
|
551
|
+
}).run(),
|
|
552
|
+
"class": {
|
|
553
|
+
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
554
|
+
level: 3
|
|
555
|
+
}),
|
|
556
|
+
"text-sizing": true
|
|
557
|
+
}
|
|
558
|
+
}, {
|
|
559
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
560
|
+
"as": "h3",
|
|
561
|
+
"size": "h3",
|
|
562
|
+
"class": (0, import_css.css)({
|
|
563
|
+
color: "currentColor"
|
|
564
|
+
})
|
|
565
|
+
}, {
|
|
566
|
+
default: () => [(0, import_vue4.createTextVNode)("Heading 3")]
|
|
567
|
+
})]
|
|
568
|
+
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
569
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().setParagraph().run(),
|
|
570
|
+
"class": {
|
|
571
|
+
"is-active": editor == null ? void 0 : editor.isActive("paragraph"),
|
|
572
|
+
"text-sizing": true
|
|
573
|
+
}
|
|
574
|
+
}, {
|
|
575
|
+
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
576
|
+
"class": (0, import_css.css)({
|
|
577
|
+
color: "currentColor"
|
|
578
|
+
})
|
|
579
|
+
}, {
|
|
580
|
+
default: () => [(0, import_vue4.createTextVNode)("Normal text")]
|
|
581
|
+
})]
|
|
582
|
+
})]
|
|
583
|
+
})]
|
|
584
|
+
})]
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
// src/extensions/align-extension.tsx
|
|
590
|
+
var import_vue6 = require("vue");
|
|
591
|
+
var import_vue7 = require("vue");
|
|
592
|
+
var import_pixel3_popover2 = require("@mekari/pixel3-popover");
|
|
593
|
+
var import_css2 = require("@mekari/pixel3-styled-system/css");
|
|
594
|
+
var AlignExtention = (0, import_vue7.defineComponent)({
|
|
595
|
+
name: "AlignExtention",
|
|
596
|
+
props: {
|
|
597
|
+
tooltipLabel: String,
|
|
598
|
+
editor: Object
|
|
599
|
+
},
|
|
600
|
+
setup({
|
|
601
|
+
tooltipLabel,
|
|
602
|
+
editor
|
|
603
|
+
}) {
|
|
604
|
+
return () => (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopover, null, {
|
|
605
|
+
default: () => [(0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverTrigger, null, {
|
|
606
|
+
default: () => [(0, import_vue6.withDirectives)((0, import_vue6.createVNode)("button", {
|
|
607
|
+
"class": {
|
|
608
|
+
"is-active": (editor == null ? void 0 : editor.isActive({
|
|
609
|
+
textAlign: "left"
|
|
610
|
+
})) || (editor == null ? void 0 : editor.isActive({
|
|
611
|
+
textAlign: "right"
|
|
612
|
+
})) || (editor == null ? void 0 : editor.isActive({
|
|
613
|
+
textAlign: "center"
|
|
614
|
+
})) || (editor == null ? void 0 : editor.isActive({
|
|
615
|
+
textAlign: "justify"
|
|
616
|
+
})),
|
|
617
|
+
"text-sizing": true
|
|
618
|
+
},
|
|
619
|
+
"style": {
|
|
620
|
+
padding: "0 4px"
|
|
621
|
+
}
|
|
622
|
+
}, [(editor == null ? void 0 : editor.isActive({
|
|
623
|
+
textAlign: "left"
|
|
624
|
+
})) && (0, import_vue6.createVNode)(AlignLeftIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
625
|
+
textAlign: "center"
|
|
626
|
+
})) && (0, import_vue6.createVNode)(AlignCenterIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
627
|
+
textAlign: "right"
|
|
628
|
+
})) && (0, import_vue6.createVNode)(AlignRightIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
629
|
+
textAlign: "justify"
|
|
630
|
+
})) && (0, import_vue6.createVNode)(AlignJustifyIcon, null, null), !(editor == null ? void 0 : editor.isActive({
|
|
631
|
+
textAlign: "left"
|
|
632
|
+
})) && !(editor == null ? void 0 : editor.isActive({
|
|
633
|
+
textAlign: "right"
|
|
634
|
+
})) && !(editor == null ? void 0 : editor.isActive({
|
|
635
|
+
textAlign: "center"
|
|
636
|
+
})) && !(editor == null ? void 0 : editor.isActive({
|
|
637
|
+
textAlign: "justify"
|
|
638
|
+
})) && (0, import_vue6.createVNode)(AlignLeftIcon, null, null)]), [[(0, import_vue6.resolveDirective)("tooltip"), {
|
|
639
|
+
label: tooltipLabel
|
|
640
|
+
}]])]
|
|
641
|
+
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverContent, {
|
|
642
|
+
"class": (0, import_css2.css)({
|
|
643
|
+
width: "46px",
|
|
644
|
+
maxWidth: "46px",
|
|
645
|
+
maxHeight: "300px"
|
|
646
|
+
})
|
|
647
|
+
}, {
|
|
648
|
+
default: () => [(0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverList, {
|
|
649
|
+
"class": (0, import_css2.css)({
|
|
650
|
+
gap: "2",
|
|
651
|
+
alignItems: "center"
|
|
652
|
+
})
|
|
653
|
+
}, {
|
|
654
|
+
default: () => [(0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
655
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("left").run(),
|
|
656
|
+
"class": {
|
|
657
|
+
"is-active": editor == null ? void 0 : editor.isActive({
|
|
658
|
+
textAlign: "left"
|
|
659
|
+
}),
|
|
660
|
+
"text-sizing": true
|
|
661
|
+
}
|
|
662
|
+
}, {
|
|
663
|
+
default: () => [(0, import_vue6.createVNode)(AlignLeftIcon, null, null)]
|
|
664
|
+
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
665
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("center").run(),
|
|
666
|
+
"class": {
|
|
667
|
+
"is-active": editor == null ? void 0 : editor.isActive({
|
|
668
|
+
textAlign: "center"
|
|
669
|
+
}),
|
|
670
|
+
"text-sizing": true
|
|
671
|
+
}
|
|
672
|
+
}, {
|
|
673
|
+
default: () => [(0, import_vue6.createVNode)(AlignCenterIcon, null, null)]
|
|
674
|
+
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
675
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("right").run(),
|
|
676
|
+
"class": {
|
|
677
|
+
"is-active": editor == null ? void 0 : editor.isActive({
|
|
678
|
+
textAlign: "right"
|
|
679
|
+
}),
|
|
680
|
+
"text-sizing": true
|
|
681
|
+
}
|
|
682
|
+
}, {
|
|
683
|
+
default: () => [(0, import_vue6.createVNode)(AlignRightIcon, null, null)]
|
|
684
|
+
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
685
|
+
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("justify").run(),
|
|
686
|
+
"class": {
|
|
687
|
+
"is-active": editor == null ? void 0 : editor.isActive({
|
|
688
|
+
textAlign: "justify"
|
|
689
|
+
}),
|
|
690
|
+
"text-sizing": true
|
|
691
|
+
}
|
|
692
|
+
}, {
|
|
693
|
+
default: () => [(0, import_vue6.createVNode)(AlignLeftIcon, null, null)]
|
|
694
|
+
})]
|
|
695
|
+
})]
|
|
696
|
+
})]
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
// src/extensions/single-extension.tsx
|
|
702
|
+
var import_vue8 = require("vue");
|
|
703
|
+
var import_vue9 = require("vue");
|
|
704
|
+
var SingleExtention = (0, import_vue9.defineComponent)({
|
|
705
|
+
name: "SingleExtention",
|
|
706
|
+
props: {
|
|
707
|
+
name: String,
|
|
708
|
+
tooltipLabel: String,
|
|
709
|
+
onClick: Function,
|
|
710
|
+
editor: Object
|
|
711
|
+
},
|
|
712
|
+
setup({
|
|
713
|
+
name,
|
|
714
|
+
tooltipLabel,
|
|
715
|
+
onClick,
|
|
716
|
+
editor
|
|
717
|
+
}) {
|
|
718
|
+
return () => (0, import_vue8.withDirectives)((0, import_vue8.createVNode)("button", {
|
|
719
|
+
"class": {
|
|
720
|
+
"is-active": editor == null ? void 0 : editor.isActive(name)
|
|
721
|
+
},
|
|
722
|
+
"onClick": onClick
|
|
723
|
+
}, [name === "bold" && (0, import_vue8.createVNode)(BoldIcon, null, null), name === "italic" && (0, import_vue8.createVNode)(ItalicIcon, null, null), name === "underline" && (0, import_vue8.createVNode)(UnderlineIcon, null, null), name === "strike" && (0, import_vue8.createVNode)(StrikeIcon, null, null), name === "blockquote" && (0, import_vue8.createVNode)(BlockquoteIcon, null, null), name === "bulletList" && (0, import_vue8.createVNode)(BulletListIcon, null, null), name === "orderedList" && (0, import_vue8.createVNode)(OrderedListIcon, null, null), name === "undo" && (0, import_vue8.createVNode)(UndoIcon, null, null), name === "redo" && (0, import_vue8.createVNode)(RedoIcon, null, null), name === "clear" && (0, import_vue8.createVNode)(ClearIcon, null, null)]), [[(0, import_vue8.resolveDirective)("tooltip"), {
|
|
724
|
+
label: tooltipLabel
|
|
725
|
+
}]]);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
// src/editor-toolbar.tsx
|
|
730
|
+
var import_pixel3_divider = require("@mekari/pixel3-divider");
|
|
731
|
+
var EditorToolbar = (0, import_vue11.defineComponent)({
|
|
732
|
+
name: "EditorToolbar",
|
|
733
|
+
props: {
|
|
734
|
+
editor: Object,
|
|
735
|
+
options: Object
|
|
736
|
+
},
|
|
737
|
+
setup({
|
|
738
|
+
editor,
|
|
739
|
+
options
|
|
740
|
+
}) {
|
|
741
|
+
const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "align", "undo", "redo", "clear"];
|
|
742
|
+
const itemOptions = {
|
|
743
|
+
heading: {
|
|
744
|
+
tooltipLabel: "Text sizing",
|
|
745
|
+
editor
|
|
746
|
+
},
|
|
747
|
+
bold: {
|
|
748
|
+
tooltipLabel: "Bold",
|
|
749
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
750
|
+
},
|
|
751
|
+
italic: {
|
|
752
|
+
tooltipLabel: "Italic",
|
|
753
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
754
|
+
},
|
|
755
|
+
underline: {
|
|
756
|
+
tooltipLabel: "Underline",
|
|
757
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
758
|
+
},
|
|
759
|
+
strike: {
|
|
760
|
+
tooltipLabel: "Strikethrough",
|
|
761
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run()
|
|
762
|
+
},
|
|
763
|
+
blockquote: {
|
|
764
|
+
tooltipLabel: "Blockquote",
|
|
765
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBlockquote().run()
|
|
766
|
+
},
|
|
767
|
+
bulletList: {
|
|
768
|
+
tooltipLabel: "Bullet list",
|
|
769
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBulletList().run()
|
|
770
|
+
},
|
|
771
|
+
orderedList: {
|
|
772
|
+
tooltipLabel: "Ordered list",
|
|
773
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleOrderedList().run()
|
|
774
|
+
},
|
|
775
|
+
align: {
|
|
776
|
+
tooltipLabel: "Text align",
|
|
777
|
+
editor
|
|
778
|
+
},
|
|
779
|
+
undo: {
|
|
780
|
+
tooltipLabel: "Undo",
|
|
781
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().undo().run()
|
|
782
|
+
},
|
|
783
|
+
redo: {
|
|
784
|
+
tooltipLabel: "Redo",
|
|
785
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().redo().run()
|
|
786
|
+
},
|
|
787
|
+
clear: {
|
|
788
|
+
tooltipLabel: "Clear formatting",
|
|
789
|
+
onClick: () => editor == null ? void 0 : editor.chain().focus().unsetAllMarks().run()
|
|
790
|
+
}
|
|
791
|
+
};
|
|
792
|
+
return () => (0, import_vue10.createVNode)("div", null, [options == null ? void 0 : options.map((option, idx) => (0, import_vue10.createVNode)(import_vue10.Fragment, null, [option == null ? void 0 : option.map((item) => {
|
|
793
|
+
var _a, _b, _c, _d;
|
|
794
|
+
if (items.includes(item)) {
|
|
795
|
+
if (item === "heading") {
|
|
796
|
+
return (0, import_vue10.createVNode)(HeadingExtention, {
|
|
797
|
+
"tooltipLabel": (_a = itemOptions[item]) == null ? void 0 : _a.tooltipLabel,
|
|
798
|
+
"editor": editor
|
|
799
|
+
}, null);
|
|
800
|
+
} else if (item === "align") {
|
|
801
|
+
return (0, import_vue10.createVNode)(AlignExtention, {
|
|
802
|
+
"tooltipLabel": (_b = itemOptions[item]) == null ? void 0 : _b.tooltipLabel,
|
|
803
|
+
"editor": editor
|
|
804
|
+
}, null);
|
|
805
|
+
} else {
|
|
806
|
+
return (0, import_vue10.createVNode)(SingleExtention, {
|
|
807
|
+
"name": item,
|
|
808
|
+
"tooltipLabel": (_c = itemOptions[item]) == null ? void 0 : _c.tooltipLabel,
|
|
809
|
+
"onClick": (_d = itemOptions[item]) == null ? void 0 : _d.onClick,
|
|
810
|
+
"editor": editor
|
|
811
|
+
}, null);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}), idx !== options.length - 1 && (0, import_vue10.createVNode)(import_pixel3_divider.MpDivider, {
|
|
815
|
+
"orientation": "vertical"
|
|
816
|
+
}, null)]))]);
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
|
|
820
|
+
// src/rich-text-editor.tsx
|
|
821
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
822
|
+
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
823
|
+
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
824
|
+
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
825
|
+
var import_tokens = require("@mekari/pixel3-styled-system/tokens");
|
|
826
|
+
var import_pixel3_form_control = require("@mekari/pixel3-form-control");
|
|
827
|
+
|
|
828
|
+
// src/rte-style-provider.tsx
|
|
829
|
+
var import_vue12 = require("vue");
|
|
830
|
+
var import_vue13 = require("vue");
|
|
831
|
+
var MpRTEStyleProvider = (0, import_vue13.defineComponent)({
|
|
832
|
+
name: "MpRTEStyleProvider",
|
|
833
|
+
props: RTEStyleProviderProps,
|
|
834
|
+
setup(props, {
|
|
835
|
+
slots
|
|
836
|
+
}) {
|
|
837
|
+
const api = useRTEStyleProvider(props);
|
|
838
|
+
return () => {
|
|
839
|
+
var _a;
|
|
840
|
+
return (0, import_vue12.createVNode)("div", api.value.rootProps, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
// src/rich-text-editor.tsx
|
|
846
|
+
var MpRichTextEditor = (0, import_vue15.defineComponent)({
|
|
847
|
+
name: "MpRichTextEditor",
|
|
848
|
+
props: richTextEditorProps,
|
|
849
|
+
emits: richTextEditorEmits,
|
|
850
|
+
setup(props, {
|
|
851
|
+
emit
|
|
852
|
+
}) {
|
|
853
|
+
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
854
|
+
const api = useRichTextEditor(props);
|
|
855
|
+
const isFocused = (0, import_vue15.ref)(false);
|
|
856
|
+
const editor = new import_vue_3.Editor({
|
|
857
|
+
content: api.value.value,
|
|
858
|
+
editable: (formControlProp == null ? void 0 : formControlProp.value.isDisabled) === void 0 ? !api.value.isDisabled : !(formControlProp == null ? void 0 : formControlProp.value.isDisabled),
|
|
859
|
+
extensions: [import_starter_kit.default.configure({
|
|
860
|
+
heading: {
|
|
861
|
+
levels: [1, 2, 3]
|
|
862
|
+
}
|
|
863
|
+
}), import_extension_underline.default, import_extension_text_align.default.configure({
|
|
864
|
+
types: ["heading", "paragraph"]
|
|
865
|
+
}), import_extension_placeholder.default.configure({
|
|
866
|
+
placeholder: api.value.placeholder || ""
|
|
867
|
+
})],
|
|
868
|
+
onFocus({
|
|
869
|
+
editor: editor2,
|
|
870
|
+
event
|
|
871
|
+
}) {
|
|
872
|
+
isFocused.value = true;
|
|
873
|
+
emit("focus", editor2, event);
|
|
874
|
+
},
|
|
875
|
+
onBlur({
|
|
876
|
+
editor: editor2,
|
|
877
|
+
event
|
|
878
|
+
}) {
|
|
879
|
+
isFocused.value = false;
|
|
880
|
+
emit("blur", editor2, event);
|
|
881
|
+
},
|
|
882
|
+
onUpdate({
|
|
883
|
+
editor: editor2
|
|
884
|
+
}) {
|
|
885
|
+
emit("change", editor2.getHTML(), editor2);
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
return () => {
|
|
889
|
+
return (0, import_vue14.createVNode)("div", (0, import_vue14.mergeProps)(api.value.rootProps, {
|
|
890
|
+
"style": {
|
|
891
|
+
"--mp-rich-text-editor--border-color-hover": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? import_tokens.token.var("colors.red.400") : isFocused.value ? import_tokens.token.var("colors.blue.400") : import_tokens.token.var("colors.gray.400"),
|
|
892
|
+
"--mp-rich-text-editor--border-color": (formControlProp == null ? void 0 : formControlProp.value.isInvalid) || api.value.isInvalid ? import_tokens.token.var("colors.red.400") : isFocused.value ? import_tokens.token.var("colors.blue.400") : import_tokens.token.var("colors.gray.100"),
|
|
893
|
+
"--mp-rich-text-editor--box-shadow": isFocused.value ? import_tokens.token.var("shadows.outer") : void 0,
|
|
894
|
+
"--mp-rich-text-editor--background-color": (formControlProp == null ? void 0 : formControlProp.value.isDisabled) || api.value.isDisabled ? import_tokens.token.var("colors.gray.50") : import_tokens.token.var("colors.white")
|
|
895
|
+
}
|
|
896
|
+
}), [(0, import_vue14.createVNode)(EditorToolbar, (0, import_vue14.mergeProps)({
|
|
897
|
+
"editor": editor,
|
|
898
|
+
"options": api.value.options
|
|
899
|
+
}, api.value.toolbarProps), null), (0, import_vue14.createVNode)(MpRTEStyleProvider, null, {
|
|
900
|
+
default: () => [(0, import_vue14.createVNode)(import_vue_3.EditorContent, (0, import_vue14.mergeProps)({
|
|
901
|
+
"editor": editor
|
|
902
|
+
}, api.value.areaProps), null)]
|
|
903
|
+
})]);
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
908
|
+
0 && (module.exports = {
|
|
909
|
+
MpRichTextEditor
|
|
910
|
+
});
|