@mekari/pixel3-rich-text-editor 0.0.7-dev.4 → 0.0.8-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-IYCO25GF.mjs +152 -0
- package/dist/chunk-JAKI6TU2.mjs +104 -0
- package/dist/chunk-JHFPEZ7I.mjs +74 -0
- package/dist/chunk-P5KVIGAP.mjs +204 -0
- package/dist/{chunk-HB4A6A3W.mjs → chunk-PLASPZGG.mjs} +28 -20
- package/dist/chunk-RNQQ7LGC.mjs +342 -0
- package/dist/chunk-V52XUOVW.mjs +64 -0
- package/dist/{chunk-Y2B3Z5EO.mjs → chunk-WBMECFO3.mjs} +31 -23
- package/dist/editor-toolbar.d.mts +16 -4
- package/dist/editor-toolbar.d.ts +16 -4
- package/dist/editor-toolbar.js +522 -166
- package/dist/editor-toolbar.mjs +8 -6
- package/dist/extensions/align-extension.d.mts +14 -4
- package/dist/extensions/align-extension.d.ts +14 -4
- package/dist/extensions/align-extension.js +138 -103
- package/dist/extensions/align-extension.mjs +2 -2
- package/dist/extensions/color-extension.d.mts +28 -0
- package/dist/extensions/color-extension.d.ts +28 -0
- package/dist/extensions/color-extension.js +415 -0
- package/dist/extensions/color-extension.mjs +8 -0
- package/dist/extensions/heading-extension.d.mts +14 -4
- package/dist/extensions/heading-extension.d.ts +14 -4
- package/dist/extensions/heading-extension.js +139 -74
- package/dist/extensions/heading-extension.mjs +2 -2
- package/dist/extensions/icons.d.mts +4 -1
- package/dist/extensions/icons.d.ts +4 -1
- package/dist/extensions/icons.js +114 -51
- package/dist/extensions/icons.mjs +7 -1
- package/dist/extensions/index.d.mts +3 -0
- package/dist/extensions/index.d.ts +3 -0
- package/dist/extensions/index.js +454 -130
- package/dist/extensions/index.mjs +13 -5
- package/dist/extensions/link-extension.d.mts +22 -0
- package/dist/extensions/link-extension.d.ts +22 -0
- package/dist/extensions/link-extension.js +546 -0
- package/dist/extensions/link-extension.mjs +8 -0
- package/dist/extensions/single-extension.d.mts +29 -10
- package/dist/extensions/single-extension.d.ts +29 -10
- package/dist/extensions/single-extension.js +134 -57
- package/dist/extensions/single-extension.mjs +2 -2
- package/dist/index.js +562 -201
- package/dist/index.mjs +9 -7
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/modules/rich-text-editor.props.d.mts +3 -5
- package/dist/modules/rich-text-editor.props.d.ts +3 -5
- package/dist/modules/rich-text-editor.types.d.mts +4 -3
- package/dist/modules/rich-text-editor.types.d.ts +4 -3
- package/dist/rich-text-editor.d.mts +4 -5
- package/dist/rich-text-editor.d.ts +4 -5
- package/dist/rich-text-editor.js +562 -201
- package/dist/rich-text-editor.mjs +9 -7
- package/package.json +14 -6
- package/dist/chunk-J5QZDLNA.mjs +0 -282
- package/dist/chunk-MMFX326I.mjs +0 -44
- package/dist/chunk-O5NDSZL6.mjs +0 -124
- package/dist/chunk-SUI7NBPF.mjs +0 -107
- /package/dist/{chunk-CE52CW3F.mjs → chunk-VYCDVS5I.mjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -37,8 +37,8 @@ __export(src_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(src_exports);
|
|
38
38
|
|
|
39
39
|
// src/rich-text-editor.tsx
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var import_vue18 = require("vue");
|
|
41
|
+
var import_vue19 = require("vue");
|
|
42
42
|
|
|
43
43
|
// src/modules/rich-text-editor.props.ts
|
|
44
44
|
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
@@ -149,14 +149,27 @@ var useRTEStyleProvider = /* @__PURE__ */ __name((props) => {
|
|
|
149
149
|
|
|
150
150
|
// src/rich-text-editor.tsx
|
|
151
151
|
var import_vue_3 = require("@tiptap/vue-3");
|
|
152
|
+
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
153
|
+
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
154
|
+
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
155
|
+
var import_extension_text_style = __toESM(require("@tiptap/extension-text-style"));
|
|
156
|
+
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
157
|
+
var import_extension_color = require("@tiptap/extension-color");
|
|
158
|
+
var import_extension_link = __toESM(require("@tiptap/extension-link"));
|
|
159
|
+
var import_extension_highlight = __toESM(require("@tiptap/extension-highlight"));
|
|
160
|
+
var import_tokens = require("@mekari/pixel3-styled-system/tokens");
|
|
161
|
+
var import_pixel3_form_control = require("@mekari/pixel3-form-control");
|
|
152
162
|
|
|
153
163
|
// src/editor-toolbar.tsx
|
|
154
|
-
var
|
|
155
|
-
var
|
|
164
|
+
var import_vue14 = require("vue");
|
|
165
|
+
var import_vue15 = require("vue");
|
|
156
166
|
|
|
157
167
|
// src/extensions/heading-extension.tsx
|
|
158
168
|
var import_vue4 = require("vue");
|
|
159
169
|
var import_vue5 = require("vue");
|
|
170
|
+
var import_css = require("@mekari/pixel3-styled-system/css");
|
|
171
|
+
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
172
|
+
var import_pixel3_popover = require("@mekari/pixel3-popover");
|
|
160
173
|
|
|
161
174
|
// src/extensions/icons.tsx
|
|
162
175
|
var import_vue2 = require("vue");
|
|
@@ -165,17 +178,16 @@ var BoldIcon = (0, import_vue3.defineComponent)({
|
|
|
165
178
|
name: "BoldIcon",
|
|
166
179
|
setup() {
|
|
167
180
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
168
|
-
"width": "
|
|
169
|
-
"height": "
|
|
170
|
-
"viewBox": "0 0
|
|
181
|
+
"width": "20",
|
|
182
|
+
"height": "20",
|
|
183
|
+
"viewBox": "0 0 20 20",
|
|
171
184
|
"fill": "none",
|
|
172
185
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
173
186
|
}, [(0, import_vue2.createVNode)("path", {
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"stroke-linejoin": "round"
|
|
187
|
+
"fill-rule": "evenodd",
|
|
188
|
+
"clip-rule": "evenodd",
|
|
189
|
+
"d": "M3.25 3.11111C3.25 2.08325 4.08325 1.25 5.11111 1.25H10C12.6233 1.25 14.75 3.37665 14.75 6C14.75 7.34675 14.1895 8.5626 13.2891 9.42701C15.2861 9.9888 16.75 11.8234 16.75 14C16.75 16.6234 14.6234 18.75 12 18.75H5.33333C4.18274 18.75 3.25 17.8173 3.25 16.6667L3.25 3.11111ZM10.0053 10.75C10.0035 10.75 10.0018 10.75 10 10.75H4.75V16.6667C4.75 16.9888 5.01117 17.25 5.33333 17.25H12C13.7949 17.25 15.25 15.7949 15.25 14C15.25 12.2051 13.7949 10.75 12 10.75L10.0053 10.75ZM4.75 9.25H10C10.0014 9.25 10.0027 9.25 10.0041 9.25C11.7971 9.2478 13.25 7.79357 13.25 6C13.25 4.20507 11.7949 2.75 10 2.75H5.11111C4.91167 2.75 4.75 2.91167 4.75 3.11111V9.25Z",
|
|
190
|
+
"fill": "currentColor"
|
|
179
191
|
}, null)]);
|
|
180
192
|
}
|
|
181
193
|
});
|
|
@@ -183,17 +195,16 @@ var ItalicIcon = (0, import_vue3.defineComponent)({
|
|
|
183
195
|
name: "ItalicIcon",
|
|
184
196
|
setup() {
|
|
185
197
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
186
|
-
"width": "
|
|
187
|
-
"height": "
|
|
188
|
-
"viewBox": "0 0
|
|
198
|
+
"width": "20",
|
|
199
|
+
"height": "20",
|
|
200
|
+
"viewBox": "0 0 20 20",
|
|
189
201
|
"fill": "none",
|
|
190
202
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
191
203
|
}, [(0, import_vue2.createVNode)("path", {
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"stroke-linejoin": "round"
|
|
204
|
+
"fill-rule": "evenodd",
|
|
205
|
+
"clip-rule": "evenodd",
|
|
206
|
+
"d": "M11.9833 1.24999H6.99993C6.58571 1.24999 6.24993 1.58578 6.24993 1.99999C6.24993 2.41421 6.58571 2.74999 6.99993 2.74999H11.0395L7.41456 17.25H3C2.58579 17.25 2.25 17.5858 2.25 18C2.25 18.4142 2.58579 18.75 3 18.75H7.98445C7.99532 18.7502 8.00616 18.7502 8.01697 18.75H12.9999C13.4141 18.75 13.7499 18.4142 13.7499 18C13.7499 17.5858 13.4141 17.25 12.9999 17.25H8.96073L12.5857 2.74999H16.9998C17.414 2.74999 17.7498 2.41421 17.7498 1.99999C17.7498 1.58578 17.414 1.24999 16.9998 1.24999H12.0158C12.0049 1.24976 11.9941 1.24976 11.9833 1.24999Z",
|
|
207
|
+
"fill": "currentColor"
|
|
197
208
|
}, null)]);
|
|
198
209
|
}
|
|
199
210
|
});
|
|
@@ -201,13 +212,15 @@ var UnderlineIcon = (0, import_vue3.defineComponent)({
|
|
|
201
212
|
name: "UnderlineIcon",
|
|
202
213
|
setup() {
|
|
203
214
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
204
|
-
"width": "
|
|
205
|
-
"height": "
|
|
206
|
-
"viewBox": "0 0
|
|
215
|
+
"width": "20",
|
|
216
|
+
"height": "20",
|
|
217
|
+
"viewBox": "0 0 20 20",
|
|
207
218
|
"fill": "none",
|
|
208
219
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
209
220
|
}, [(0, import_vue2.createVNode)("path", {
|
|
210
|
-
"
|
|
221
|
+
"fill-rule": "evenodd",
|
|
222
|
+
"clip-rule": "evenodd",
|
|
223
|
+
"d": "M4.28571 1.25C4.69993 1.25 5.03571 1.58579 5.03571 2V8.85714C5.03571 11.5988 7.2583 13.8214 10 13.8214C12.7417 13.8214 14.9643 11.5988 14.9643 8.85714V2C14.9643 1.58579 15.3001 1.25 15.7143 1.25C16.1285 1.25 16.4643 1.58579 16.4643 2V8.85714C16.4643 12.4273 13.5701 15.3214 10 15.3214C6.42987 15.3214 3.53571 12.4273 3.53571 8.85714V2C3.53571 1.58579 3.8715 1.25 4.28571 1.25ZM1.25 18C1.25 17.5858 1.58579 17.25 2 17.25L18 17.25C18.4142 17.25 18.75 17.5858 18.75 18C18.75 18.4142 18.4142 18.75 18 18.75H2C1.58579 18.75 1.25 18.4142 1.25 18Z",
|
|
211
224
|
"fill": "currentColor"
|
|
212
225
|
}, null)]);
|
|
213
226
|
}
|
|
@@ -216,13 +229,15 @@ var StrikeIcon = (0, import_vue3.defineComponent)({
|
|
|
216
229
|
name: "StrikeIcon",
|
|
217
230
|
setup() {
|
|
218
231
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
219
|
-
"width": "
|
|
220
|
-
"height": "
|
|
221
|
-
"viewBox": "0 0
|
|
232
|
+
"width": "20",
|
|
233
|
+
"height": "20",
|
|
234
|
+
"viewBox": "0 0 20 20",
|
|
222
235
|
"fill": "none",
|
|
223
236
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
224
237
|
}, [(0, import_vue2.createVNode)("path", {
|
|
225
|
-
"
|
|
238
|
+
"fill-rule": "evenodd",
|
|
239
|
+
"clip-rule": "evenodd",
|
|
240
|
+
"d": "M4.71219 5.55556C4.71219 3.94153 6.27283 1.25 10.3025 1.25C12.2938 1.25 13.6819 1.90502 14.58 2.69664C15.0235 3.08756 15.3416 3.50668 15.5523 3.88509C15.7477 4.236 15.8929 4.62821 15.8929 4.96296C15.8929 5.37718 15.5571 5.71296 15.1429 5.71296C14.7286 5.71296 14.3929 5.37718 14.3929 4.96296C14.3929 4.97338 14.3924 4.97171 14.3889 4.95856C14.3794 4.92317 14.3475 4.80463 14.2418 4.61491C14.1122 4.38221 13.9009 4.09763 13.5881 3.82188C12.9735 3.28017 11.9415 2.75 10.3025 2.75C7.07171 2.75 6.21218 4.79921 6.21218 5.55556C6.21218 5.91104 6.28076 6.31532 6.55103 6.74055C6.77322 7.09013 6.66994 7.55364 6.32036 7.77583C5.97078 7.99801 5.50728 7.89474 5.28509 7.54516C4.82778 6.82564 4.71219 6.1248 4.71219 5.55556ZM14.3507 10.75H18C18.4142 10.75 18.75 10.4142 18.75 10C18.75 9.58579 18.4142 9.25 18 9.25H11.1602C11.1485 9.24973 11.1369 9.24973 11.1253 9.25L2 9.25C1.58579 9.25 1.25 9.58579 1.25 10C1.25 10.4142 1.58579 10.75 2 10.75L11.0212 10.75C12.4142 11.2197 13.2514 11.7136 13.7395 12.2109C14.2104 12.6906 14.3929 13.2098 14.3929 13.8519C14.3929 15.2406 13.2518 17.25 10.3025 17.25C8.74757 17.25 7.68819 16.8447 6.96095 16.3449C6.22712 15.8405 5.78688 15.2087 5.52513 14.696C5.3368 14.3271 4.88505 14.1807 4.51613 14.369C4.14721 14.5574 4.00082 15.0091 4.18915 15.378C4.53245 16.0505 5.12078 16.9002 6.11132 17.581C7.10845 18.2664 8.46924 18.75 10.3025 18.75C14.1297 18.75 15.8929 16.0187 15.8929 13.8519C15.8929 12.8593 15.5846 11.9493 14.81 11.1602C14.6706 11.0181 14.5176 10.8815 14.3507 10.75Z",
|
|
226
241
|
"fill": "currentColor"
|
|
227
242
|
}, null)]);
|
|
228
243
|
}
|
|
@@ -249,17 +264,16 @@ var BulletListIcon = (0, import_vue3.defineComponent)({
|
|
|
249
264
|
name: "BulletListIcon",
|
|
250
265
|
setup() {
|
|
251
266
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
252
|
-
"width": "
|
|
253
|
-
"height": "
|
|
254
|
-
"viewBox": "0 0
|
|
267
|
+
"width": "20",
|
|
268
|
+
"height": "20",
|
|
269
|
+
"viewBox": "0 0 20 20",
|
|
255
270
|
"fill": "none",
|
|
256
271
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
257
272
|
}, [(0, import_vue2.createVNode)("path", {
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"stroke-linejoin": "round"
|
|
273
|
+
"fill-rule": "evenodd",
|
|
274
|
+
"clip-rule": "evenodd",
|
|
275
|
+
"d": "M3.75 2.75C3.19772 2.75 2.75 3.19772 2.75 3.75C2.75 4.30228 3.19772 4.75 3.75 4.75C4.30228 4.75 4.75 4.30228 4.75 3.75C4.75 3.19772 4.30228 2.75 3.75 2.75ZM1.25 3.75C1.25 2.36929 2.36929 1.25 3.75 1.25C5.13071 1.25 6.25 2.36929 6.25 3.75C6.25 5.13071 5.13071 6.25 3.75 6.25C2.36929 6.25 1.25 5.13071 1.25 3.75ZM8.25 3.5C8.25 3.08579 8.58579 2.75 9 2.75H18C18.4142 2.75 18.75 3.08579 18.75 3.5C18.75 3.91421 18.4142 4.25 18 4.25H9C8.58579 4.25 8.25 3.91421 8.25 3.5ZM3.75 9C3.19772 9 2.75 9.44772 2.75 10C2.75 10.5523 3.19772 11 3.75 11C4.30228 11 4.75 10.5523 4.75 10C4.75 9.44772 4.30228 9 3.75 9ZM1.25 10C1.25 8.61929 2.36929 7.5 3.75 7.5C5.13071 7.5 6.25 8.61929 6.25 10C6.25 11.3807 5.13071 12.5 3.75 12.5C2.36929 12.5 1.25 11.3807 1.25 10ZM8.25 10C8.25 9.58579 8.58579 9.25 9 9.25L18 9.25C18.4142 9.25 18.75 9.58579 18.75 10C18.75 10.4142 18.4142 10.75 18 10.75L9 10.75C8.58579 10.75 8.25 10.4142 8.25 10ZM3.75 15.25C3.19772 15.25 2.75 15.6977 2.75 16.25C2.75 16.8023 3.19772 17.25 3.75 17.25C4.30228 17.25 4.75 16.8023 4.75 16.25C4.75 15.6977 4.30228 15.25 3.75 15.25ZM1.25 16.25C1.25 14.8693 2.36929 13.75 3.75 13.75C5.13071 13.75 6.25 14.8693 6.25 16.25C6.25 17.6307 5.13071 18.75 3.75 18.75C2.36929 18.75 1.25 17.6307 1.25 16.25ZM8.25 16.25C8.25 15.8358 8.58579 15.5 9 15.5L18 15.5C18.4142 15.5 18.75 15.8358 18.75 16.25C18.75 16.6642 18.4142 17 18 17L9 17C8.58579 17 8.25 16.6642 8.25 16.25Z",
|
|
276
|
+
"fill": "currentColor"
|
|
263
277
|
}, null)]);
|
|
264
278
|
}
|
|
265
279
|
});
|
|
@@ -267,13 +281,15 @@ var OrderedListIcon = (0, import_vue3.defineComponent)({
|
|
|
267
281
|
name: "OrderedListIcon",
|
|
268
282
|
setup() {
|
|
269
283
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
270
|
-
"width": "
|
|
271
|
-
"height": "
|
|
272
|
-
"viewBox": "0 0
|
|
284
|
+
"width": "20",
|
|
285
|
+
"height": "20",
|
|
286
|
+
"viewBox": "0 0 20 20",
|
|
273
287
|
"fill": "none",
|
|
274
288
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
275
289
|
}, [(0, import_vue2.createVNode)("path", {
|
|
276
|
-
"
|
|
290
|
+
"fill-rule": "evenodd",
|
|
291
|
+
"clip-rule": "evenodd",
|
|
292
|
+
"d": "M3.36762 1.34621C3.60388 1.47902 3.75011 1.72897 3.75011 2V5.5C3.75011 5.91421 3.41432 6.25 3.00011 6.25C2.5859 6.25 2.25011 5.91421 2.25011 5.5V3.3157C1.92245 3.43189 1.54724 3.30702 1.35938 2.99827C1.14408 2.6444 1.25641 2.183 1.61027 1.9677L2.61027 1.35928C2.84182 1.2184 3.13135 1.2134 3.36762 1.34621ZM7.25011 3.5C7.25011 3.08579 7.5859 2.75 8.00011 2.75H18.0001C18.4143 2.75 18.7501 3.08579 18.7501 3.5C18.7501 3.91421 18.4143 4.25 18.0001 4.25H8.00011C7.5859 4.25 7.25011 3.91421 7.25011 3.5ZM2.88491 9.0004C2.86752 8.99901 2.85002 9.00127 2.83356 9.00705C2.81709 9.01282 2.80201 9.02198 2.78929 9.03392C2.77657 9.04587 2.76649 9.06034 2.7597 9.07642C2.59844 9.45795 2.15842 9.63652 1.77688 9.47526C1.39535 9.314 1.21678 8.87398 1.37804 8.49245C1.46627 8.2837 1.59719 8.09571 1.76238 7.94056C1.92757 7.7854 2.12339 7.66652 2.33726 7.59153C2.55112 7.51655 2.77831 7.48712 3.00422 7.50515C3.23013 7.52317 3.44978 7.58825 3.64904 7.6962C3.84831 7.80415 4.0228 7.95258 4.1613 8.13197C4.2998 8.31135 4.39925 8.51772 4.45327 8.73782C4.50728 8.95792 4.51466 9.18688 4.47493 9.41C4.43521 9.63313 4.34925 9.84547 4.22259 10.0334C4.21559 10.0438 4.20834 10.054 4.20083 10.064L3.49953 10.9998L3.75001 10.9998C4.16422 10.9997 4.50005 11.3355 4.5001 11.7497C4.50015 12.1639 4.1644 12.4997 3.75019 12.4998L2.0002 12.5C1.71615 12.5 1.45646 12.3396 1.32937 12.0856C1.20228 11.8316 1.2296 11.5275 1.39994 11.3002L2.98413 9.18629C2.99095 9.17411 2.9957 9.16086 2.99816 9.14707C3.00122 9.12989 3.00065 9.11226 2.99649 9.09531C2.99233 9.07836 2.98467 9.06247 2.97401 9.04866C2.96334 9.03485 2.94991 9.02342 2.93456 9.01511C2.91922 9.0068 2.90231 9.00178 2.88491 9.0004ZM7.25011 10C7.25011 9.58579 7.5859 9.25 8.00011 9.25L18.0001 9.25C18.4143 9.25 18.7501 9.58579 18.7501 10C18.7501 10.4142 18.4143 10.75 18.0001 10.75L8.00011 10.75C7.5859 10.75 7.25011 10.4142 7.25011 10ZM1.25011 14.5C1.25011 14.0858 1.5859 13.75 2.00011 13.75H3.74997C4.0296 13.75 4.286 13.9056 4.41517 14.1536C4.54433 14.4016 4.52479 14.7009 4.36447 14.93L3.87524 15.6292C4.0001 15.7351 4.11012 15.8583 4.20177 15.9955C4.36355 16.2376 4.46313 16.5159 4.49167 16.8057C4.52021 17.0955 4.47684 17.3879 4.36541 17.6569C4.25397 17.9259 4.0779 18.1633 3.8528 18.3481C3.6277 18.5328 3.36051 18.6592 3.0749 18.716C2.78929 18.7728 2.49408 18.7583 2.21543 18.6738C1.93676 18.5892 1.68325 18.4373 1.47734 18.2314C1.18444 17.9385 1.18444 17.4636 1.47734 17.1707C1.77023 16.8778 2.2451 16.8778 2.538 17.1707C2.56948 17.2022 2.60824 17.2254 2.65085 17.2383C2.69346 17.2513 2.7386 17.2535 2.78227 17.2448C2.82593 17.2361 2.86679 17.2168 2.90121 17.1885C2.93563 17.1603 2.96255 17.124 2.97959 17.0829C2.99663 17.0417 3.00326 16.997 2.99889 16.9527C2.99453 16.9084 2.9793 16.8659 2.95457 16.8288C2.92983 16.7918 2.89634 16.7615 2.85708 16.7405C2.81781 16.7195 2.77397 16.7085 2.72945 16.7085C2.44982 16.7085 2.19341 16.5529 2.06425 16.3049C1.93509 16.0569 1.95463 15.7576 2.11494 15.5285L2.30982 15.25H2.00011C1.5859 15.25 1.25011 14.9142 1.25011 14.5ZM7.25011 16.25C7.25011 15.8358 7.5859 15.5 8.00011 15.5L18.0001 15.5C18.4143 15.5 18.7501 15.8358 18.7501 16.25C18.7501 16.6642 18.4143 17 18.0001 17L8.00011 17C7.5859 17 7.25011 16.6642 7.25011 16.25Z",
|
|
277
293
|
"fill": "currentColor"
|
|
278
294
|
}, null)]);
|
|
279
295
|
}
|
|
@@ -282,17 +298,16 @@ var AlignLeftIcon = (0, import_vue3.defineComponent)({
|
|
|
282
298
|
name: "AlignLeftIcon",
|
|
283
299
|
setup() {
|
|
284
300
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
285
|
-
"width": "
|
|
286
|
-
"height": "
|
|
301
|
+
"width": "20",
|
|
302
|
+
"height": "20",
|
|
287
303
|
"viewBox": "0 0 20 20",
|
|
288
304
|
"fill": "none",
|
|
289
305
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
290
306
|
}, [(0, import_vue2.createVNode)("path", {
|
|
291
|
-
"
|
|
292
|
-
"
|
|
293
|
-
"
|
|
294
|
-
"
|
|
295
|
-
"stroke-linejoin": "round"
|
|
307
|
+
"fill-rule": "evenodd",
|
|
308
|
+
"clip-rule": "evenodd",
|
|
309
|
+
"d": "M1.25 2.75C1.25 2.33579 1.58579 2 2 2H18C18.4142 2 18.75 2.33579 18.75 2.75C18.75 3.16421 18.4142 3.5 18 3.5H2C1.58579 3.5 1.25 3.16421 1.25 2.75ZM1.25 7.5C1.25 7.08579 1.58579 6.75 2 6.75H13C13.4142 6.75 13.75 7.08579 13.75 7.5C13.75 7.91421 13.4142 8.25 13 8.25H2C1.58579 8.25 1.25 7.91421 1.25 7.5ZM1.25 12.5C1.25 12.0858 1.58579 11.75 2 11.75H14C14.4142 11.75 14.75 12.0858 14.75 12.5C14.75 12.9142 14.4142 13.25 14 13.25H2C1.58579 13.25 1.25 12.9142 1.25 12.5ZM1.25 17.25C1.25 16.8358 1.58579 16.5 2 16.5H9C9.41421 16.5 9.75 16.8358 9.75 17.25C9.75 17.6642 9.41421 18 9 18H2C1.58579 18 1.25 17.6642 1.25 17.25Z",
|
|
310
|
+
"fill": "currentColor"
|
|
296
311
|
}, null)]);
|
|
297
312
|
}
|
|
298
313
|
});
|
|
@@ -350,6 +365,62 @@ var AlignJustifyIcon = (0, import_vue3.defineComponent)({
|
|
|
350
365
|
}, null)]);
|
|
351
366
|
}
|
|
352
367
|
});
|
|
368
|
+
var ColorTextIcon = (0, import_vue3.defineComponent)({
|
|
369
|
+
name: "ColorTextIcon",
|
|
370
|
+
setup() {
|
|
371
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
372
|
+
"width": "20",
|
|
373
|
+
"height": "20",
|
|
374
|
+
"viewBox": "0 0 20 20",
|
|
375
|
+
"fill": "none",
|
|
376
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
377
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
378
|
+
"fill-rule": "evenodd",
|
|
379
|
+
"clip-rule": "evenodd",
|
|
380
|
+
"d": "M8.66375 2.75C8.65635 2.75 8.65104 2.75456 8.64925 2.75941L5.28435 11.9167H12.0432L8.67826 2.75942C8.67647 2.75456 8.67115 2.75 8.66375 2.75ZM13.6412 11.9167L10.0862 2.24205C9.86695 1.64536 9.29844 1.25 8.66375 1.25C8.02906 1.25 7.46055 1.64536 7.24129 2.24205L3.68629 11.9167H2.24996C1.83575 11.9167 1.49996 12.2525 1.49996 12.6667C1.49996 13.0809 1.83575 13.4167 2.24996 13.4167H3.13511L1.54598 17.7413C1.40312 18.1301 1.60248 18.5611 1.99128 18.704C2.38007 18.8468 2.81107 18.6475 2.95394 18.2587L4.73317 13.4167H12.5943L14.3736 18.2587C14.5164 18.6475 14.9474 18.8468 15.3362 18.704C15.725 18.5611 15.9244 18.1301 15.7815 17.7413L14.1924 13.4167H15.0775C15.4918 13.4167 15.8275 13.0809 15.8275 12.6667C15.8275 12.2525 15.4918 11.9167 15.0775 11.9167H13.6412Z",
|
|
381
|
+
"fill": "currentColor"
|
|
382
|
+
}, null), (0, import_vue2.createVNode)("path", {
|
|
383
|
+
"fill-rule": "evenodd",
|
|
384
|
+
"clip-rule": "evenodd",
|
|
385
|
+
"d": "M18.236 5.85908C18.6863 5.06151 18.5284 4.10075 18.0148 3.24065L17.3982 2.21746C17.0688 1.67034 16.5392 1.25 15.8758 1.25C15.2116 1.25 14.6841 1.67072 14.359 2.21977L13.7453 3.23806L13.7438 3.24065C13.2302 4.10075 13.0722 5.06151 13.5225 5.85908C13.9733 6.65767 14.8779 7.01667 15.8793 7.01667C16.8806 7.01667 17.7852 6.65767 18.236 5.85908ZM15.8297 2.77208C15.7896 2.79926 15.7224 2.8607 15.6489 2.98538L15.6454 2.9913L15.0316 4.00969C15.0314 4.01014 15.0311 4.01058 15.0308 4.01103C14.6783 4.60202 14.7383 4.96158 14.8287 5.12167C14.9186 5.28086 15.1933 5.51667 15.8793 5.51667C16.5652 5.51667 16.84 5.28086 16.9298 5.12167C17.0202 4.96157 17.0802 4.60198 16.7277 4.01092C16.7274 4.01051 16.7272 4.0101 16.7269 4.00969L16.1132 2.99128C16.0374 2.8654 15.9681 2.80201 15.9258 2.7736C15.9051 2.7597 15.891 2.75409 15.8842 2.7519C15.8807 2.75077 15.8785 2.75034 15.8774 2.75017L15.8758 2.75L15.8745 2.75013C15.8736 2.75027 15.8717 2.75064 15.8685 2.75165C15.8625 2.75359 15.8493 2.75879 15.8297 2.77208Z",
|
|
386
|
+
"fill": "currentColor"
|
|
387
|
+
}, null)]);
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
var FillTextIcon = (0, import_vue3.defineComponent)({
|
|
391
|
+
name: "FillTextIcon",
|
|
392
|
+
setup() {
|
|
393
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
394
|
+
"width": "20",
|
|
395
|
+
"height": "20",
|
|
396
|
+
"viewBox": "0 0 20 20",
|
|
397
|
+
"fill": "none",
|
|
398
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
399
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
400
|
+
"fill-rule": "evenodd",
|
|
401
|
+
"clip-rule": "evenodd",
|
|
402
|
+
"d": "M9.85054 2.01035C10.8883 1.91023 11.8433 2.53267 12.8842 3.58165L15.6188 6.3375C16.4029 7.12778 16.9285 7.87656 17.0862 8.66106C17.2546 9.49858 16.9767 10.2195 16.5202 10.8637C16.273 11.2125 15.9624 11.5558 15.6187 11.9022L11.2166 16.3386L11.2155 16.3397C10.7347 16.8222 10.2954 17.2249 9.87312 17.5083C9.44434 17.7961 8.98095 17.9967 8.46117 18C7.94043 18.0032 7.4735 17.8077 7.03901 17.5197C6.61159 17.2363 6.16667 16.8305 5.67861 16.3386L2.94407 13.5827C2.34101 12.975 1.86551 12.4395 1.5784 11.9277C1.27004 11.378 1.1551 10.8114 1.3357 10.2028C1.45205 9.81075 1.67641 9.45442 1.94159 9.11724C2.20805 8.77843 2.55027 8.41662 2.94297 8.0192L2.94407 8.01809L7.3462 3.58165C7.73335 3.19148 8.11559 2.82907 8.50434 2.55498C8.89821 2.27728 9.34093 2.05952 9.85054 2.01035ZM9.36868 3.78092C9.09479 3.97402 8.79043 4.25577 8.41097 4.63819L4.00994 9.07351C4.00972 9.07373 4.01017 9.07328 4.00994 9.07351C3.95938 9.12468 3.90979 9.17515 3.86249 9.22362C7.7286 8.47303 11.7202 8.57605 15.5538 9.54302C15.6416 9.32321 15.6521 9.13815 15.6156 8.95666C15.546 8.61027 15.2752 8.12087 14.554 7.39403L11.8194 4.63819C10.8134 3.62427 10.2984 3.47411 9.99459 3.50342C9.83341 3.51897 9.63745 3.59142 9.36868 3.78092ZM14.5533 10.8463C10.6783 9.97453 6.65031 10.0285 2.79358 10.9976C2.81491 11.0553 2.84515 11.1199 2.88659 11.1938C3.06542 11.5125 3.41126 11.924 4.00884 12.5262L6.74337 15.282C7.21556 15.7579 7.57282 16.0739 7.8678 16.2694C8.15572 16.4603 8.33143 16.5007 8.45185 16.5C8.57322 16.4992 8.7495 16.4559 9.0372 16.2628C9.3313 16.0654 9.68515 15.7504 10.1525 15.2814C10.1524 15.2815 10.1527 15.2812 10.1525 15.2814L14.5533 10.8463ZM17.8 13.6483C17.8 13.6482 17.8001 13.6485 17.8 13.6483L18.323 14.5187C18.7703 15.27 18.9201 16.1311 18.5119 16.8562C18.1027 17.5833 17.2879 17.8985 16.414 17.8985C15.5401 17.8985 14.7253 17.5833 14.3161 16.8562C13.9079 16.1311 14.0577 15.27 14.505 14.5187L14.5066 14.5161L15.0266 13.6506C15.3151 13.1622 15.7942 12.7705 16.411 12.7705C17.0271 12.7705 17.5081 13.1619 17.8 13.6483ZM16.4123 14.2895C16.3892 14.3113 16.3556 14.3498 16.3175 14.4146L16.314 14.4205L15.7939 15.286C15.7937 15.2865 15.7934 15.2869 15.7932 15.2873C15.5063 15.7697 15.5731 16.0313 15.6233 16.1205C15.6724 16.2079 15.8574 16.3985 16.414 16.3985C16.9706 16.3985 17.1556 16.2079 17.2047 16.1205C17.2549 16.0313 17.3217 15.7697 17.0349 15.2873C17.0346 15.2869 17.0343 15.2865 17.0341 15.286L16.514 14.4205C16.473 14.3521 16.4367 14.3117 16.4123 14.2895Z",
|
|
403
|
+
"fill": "currentColor"
|
|
404
|
+
}, null)]);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
var LinkIcon = (0, import_vue3.defineComponent)({
|
|
408
|
+
name: "LinkIcon",
|
|
409
|
+
setup() {
|
|
410
|
+
return () => (0, import_vue2.createVNode)("svg", {
|
|
411
|
+
"width": "20",
|
|
412
|
+
"height": "20",
|
|
413
|
+
"viewBox": "0 0 20 20",
|
|
414
|
+
"fill": "none",
|
|
415
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
416
|
+
}, [(0, import_vue2.createVNode)("path", {
|
|
417
|
+
"fill-rule": "evenodd",
|
|
418
|
+
"clip-rule": "evenodd",
|
|
419
|
+
"d": "M9.46974 2.84224C11.5927 0.719252 15.0348 0.719253 17.1578 2.84224C19.2807 4.96523 19.2807 8.40728 17.1578 10.5303L15.5774 12.1106C13.5952 14.0928 10.3814 14.0928 8.39916 12.1106L8.14427 11.8557C7.85137 11.5628 7.85137 11.088 8.14427 10.7951C8.43716 10.5022 8.91203 10.5022 9.20493 10.7951L9.45982 11.05C10.8562 12.4464 13.1203 12.4464 14.5167 11.05L16.0971 9.4696C17.6343 7.9324 17.6343 5.4401 16.0971 3.9029C14.5599 2.3657 12.0676 2.3657 10.5304 3.9029L9.86766 4.56564C9.57477 4.85853 9.09989 4.85853 8.807 4.56564C8.51411 4.27274 8.51411 3.79787 8.807 3.50498L9.46974 2.84224ZM10.5402 8.9499C9.14375 7.55348 6.8797 7.55348 5.48327 8.9499L3.9029 10.5303C2.3657 12.0675 2.3657 14.5598 3.9029 16.097C5.4401 17.6342 7.9324 17.6342 9.46961 16.097L10.1323 15.4342C10.4252 15.1413 10.9001 15.1413 11.193 15.4342C11.4859 15.7271 11.4859 16.202 11.193 16.4949L10.5303 17.1576C8.40728 19.2806 4.96523 19.2806 2.84224 17.1576C0.719253 15.0346 0.719252 11.5926 2.84224 9.46961L4.42261 7.88924C6.40482 5.90703 9.61862 5.90703 11.6008 7.88924L11.8557 8.14414C12.1486 8.43704 12.1486 8.91191 11.8557 9.2048C11.5628 9.49769 11.088 9.49769 10.7951 9.2048L10.5402 8.9499Z",
|
|
420
|
+
"fill": "currentColor"
|
|
421
|
+
}, null)]);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
353
424
|
var UndoIcon = (0, import_vue3.defineComponent)({
|
|
354
425
|
name: "UndoIcon",
|
|
355
426
|
setup() {
|
|
@@ -390,17 +461,16 @@ var ClearIcon = (0, import_vue3.defineComponent)({
|
|
|
390
461
|
name: "ClearIcon",
|
|
391
462
|
setup() {
|
|
392
463
|
return () => (0, import_vue2.createVNode)("svg", {
|
|
393
|
-
"width": "
|
|
394
|
-
"height": "
|
|
395
|
-
"viewBox": "0 0
|
|
464
|
+
"width": "20",
|
|
465
|
+
"height": "20",
|
|
466
|
+
"viewBox": "0 0 20 20",
|
|
396
467
|
"fill": "none",
|
|
397
468
|
"xmlns": "http://www.w3.org/2000/svg"
|
|
398
469
|
}, [(0, import_vue2.createVNode)("path", {
|
|
399
|
-
"
|
|
400
|
-
"
|
|
401
|
-
"
|
|
402
|
-
"
|
|
403
|
-
"stroke-linejoin": "round"
|
|
470
|
+
"fill-rule": "evenodd",
|
|
471
|
+
"clip-rule": "evenodd",
|
|
472
|
+
"d": "M10.5639 3.25001L8.69489 7.55868C8.53005 7.93868 8.70447 8.38037 9.08447 8.5452C9.46447 8.71004 9.90615 8.53562 10.071 8.15562L12.199 3.25001H18C18.4142 3.25001 18.75 2.91422 18.75 2.50001C18.75 2.08579 18.4142 1.75001 18 1.75001H11.724C11.7128 1.74975 11.7015 1.74975 11.6903 1.75001H4.13335C3.71913 1.75001 3.38335 2.08579 3.38335 2.50001C3.38335 2.91422 3.71913 3.25001 4.13335 3.25001H10.5639ZM1.42854 5.22858C1.69679 4.91296 2.17011 4.87457 2.48573 5.14282L16.3524 16.9285C16.668 17.1968 16.7064 17.6701 16.4382 17.9857C16.1699 18.3013 15.6966 18.3397 15.381 18.0715L8.35867 12.103L5.88807 17.7985C5.72323 18.1785 5.28155 18.3529 4.90155 18.1881C4.52155 18.0232 4.34712 17.5815 4.51196 17.2015L7.16406 11.0877L1.5143 6.28577C1.19869 6.01752 1.16029 5.5442 1.42854 5.22858Z",
|
|
473
|
+
"fill": "currentColor"
|
|
404
474
|
}, null)]);
|
|
405
475
|
}
|
|
406
476
|
});
|
|
@@ -424,14 +494,15 @@ var CaretIcon = (0, import_vue3.defineComponent)({
|
|
|
424
494
|
});
|
|
425
495
|
|
|
426
496
|
// src/extensions/heading-extension.tsx
|
|
427
|
-
var import_pixel3_popover = require("@mekari/pixel3-popover");
|
|
428
|
-
var import_pixel3_text = require("@mekari/pixel3-text");
|
|
429
|
-
var import_css = require("@mekari/pixel3-styled-system/css");
|
|
430
497
|
var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
431
498
|
name: "HeadingExtention",
|
|
432
499
|
props: {
|
|
433
|
-
tooltipLabel:
|
|
434
|
-
|
|
500
|
+
tooltipLabel: {
|
|
501
|
+
type: String
|
|
502
|
+
},
|
|
503
|
+
editor: {
|
|
504
|
+
type: Object
|
|
505
|
+
}
|
|
435
506
|
},
|
|
436
507
|
setup({
|
|
437
508
|
tooltipLabel,
|
|
@@ -456,7 +527,8 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
456
527
|
level: 1
|
|
457
528
|
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
458
529
|
"class": (0, import_css.css)({
|
|
459
|
-
color: "currentColor"
|
|
530
|
+
color: "currentColor",
|
|
531
|
+
whiteSpace: "nowrap"
|
|
460
532
|
})
|
|
461
533
|
}, {
|
|
462
534
|
default: () => [(0, import_vue4.createTextVNode)("Heading 1")]
|
|
@@ -464,7 +536,8 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
464
536
|
level: 2
|
|
465
537
|
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
466
538
|
"class": (0, import_css.css)({
|
|
467
|
-
color: "currentColor"
|
|
539
|
+
color: "currentColor",
|
|
540
|
+
whiteSpace: "nowrap"
|
|
468
541
|
})
|
|
469
542
|
}, {
|
|
470
543
|
default: () => [(0, import_vue4.createTextVNode)("Heading 2")]
|
|
@@ -472,13 +545,15 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
472
545
|
level: 3
|
|
473
546
|
})) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
474
547
|
"class": (0, import_css.css)({
|
|
475
|
-
color: "currentColor"
|
|
548
|
+
color: "currentColor",
|
|
549
|
+
whiteSpace: "nowrap"
|
|
476
550
|
})
|
|
477
551
|
}, {
|
|
478
552
|
default: () => [(0, import_vue4.createTextVNode)("Heading 3")]
|
|
479
553
|
}), (editor == null ? void 0 : editor.isActive("paragraph")) && (0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
480
554
|
"class": (0, import_css.css)({
|
|
481
|
-
color: "currentColor"
|
|
555
|
+
color: "currentColor",
|
|
556
|
+
whiteSpace: "nowrap"
|
|
482
557
|
})
|
|
483
558
|
}, {
|
|
484
559
|
default: () => [(0, import_vue4.createTextVNode)("Normal text")]
|
|
@@ -512,15 +587,15 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
512
587
|
})
|
|
513
588
|
}, {
|
|
514
589
|
default: () => [(0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
515
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
516
|
-
level: 1
|
|
517
|
-
}).run(),
|
|
518
590
|
"class": {
|
|
519
591
|
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
520
592
|
level: 1
|
|
521
593
|
}),
|
|
522
594
|
"text-sizing": true
|
|
523
|
-
}
|
|
595
|
+
},
|
|
596
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
597
|
+
level: 1
|
|
598
|
+
}).run()
|
|
524
599
|
}, {
|
|
525
600
|
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
526
601
|
"as": "h1",
|
|
@@ -532,15 +607,15 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
532
607
|
default: () => [(0, import_vue4.createTextVNode)("Heading 1")]
|
|
533
608
|
})]
|
|
534
609
|
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
535
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
536
|
-
level: 2
|
|
537
|
-
}).run(),
|
|
538
610
|
"class": {
|
|
539
611
|
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
540
612
|
level: 2
|
|
541
613
|
}),
|
|
542
614
|
"text-sizing": true
|
|
543
|
-
}
|
|
615
|
+
},
|
|
616
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
617
|
+
level: 2
|
|
618
|
+
}).run()
|
|
544
619
|
}, {
|
|
545
620
|
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
546
621
|
"as": "h2",
|
|
@@ -552,15 +627,15 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
552
627
|
default: () => [(0, import_vue4.createTextVNode)("Heading 2")]
|
|
553
628
|
})]
|
|
554
629
|
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
555
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().toggleHeading({
|
|
556
|
-
level: 3
|
|
557
|
-
}).run(),
|
|
558
630
|
"class": {
|
|
559
631
|
"is-active": editor == null ? void 0 : editor.isActive("heading", {
|
|
560
632
|
level: 3
|
|
561
633
|
}),
|
|
562
634
|
"text-sizing": true
|
|
563
|
-
}
|
|
635
|
+
},
|
|
636
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().toggleHeading({
|
|
637
|
+
level: 3
|
|
638
|
+
}).run()
|
|
564
639
|
}, {
|
|
565
640
|
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
566
641
|
"as": "h3",
|
|
@@ -572,11 +647,11 @@ var HeadingExtention = (0, import_vue5.defineComponent)({
|
|
|
572
647
|
default: () => [(0, import_vue4.createTextVNode)("Heading 3")]
|
|
573
648
|
})]
|
|
574
649
|
}), (0, import_vue4.createVNode)(import_pixel3_popover.MpPopoverListItem, {
|
|
575
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().setParagraph().run(),
|
|
576
650
|
"class": {
|
|
577
651
|
"is-active": editor == null ? void 0 : editor.isActive("paragraph"),
|
|
578
652
|
"text-sizing": true
|
|
579
|
-
}
|
|
653
|
+
},
|
|
654
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setParagraph().run()
|
|
580
655
|
}, {
|
|
581
656
|
default: () => [(0, import_vue4.createVNode)(import_pixel3_text.MpText, {
|
|
582
657
|
"class": (0, import_css.css)({
|
|
@@ -600,50 +675,35 @@ var import_css2 = require("@mekari/pixel3-styled-system/css");
|
|
|
600
675
|
var AlignExtention = (0, import_vue7.defineComponent)({
|
|
601
676
|
name: "AlignExtention",
|
|
602
677
|
props: {
|
|
603
|
-
tooltipLabel:
|
|
604
|
-
|
|
678
|
+
tooltipLabel: {
|
|
679
|
+
type: String
|
|
680
|
+
},
|
|
681
|
+
editor: {
|
|
682
|
+
type: Object
|
|
683
|
+
}
|
|
605
684
|
},
|
|
606
685
|
setup({
|
|
607
686
|
tooltipLabel,
|
|
608
687
|
editor
|
|
609
688
|
}) {
|
|
689
|
+
const isActiveAlignment = /* @__PURE__ */ __name((alignment) => {
|
|
690
|
+
return editor == null ? void 0 : editor.isActive({
|
|
691
|
+
textAlign: alignment
|
|
692
|
+
});
|
|
693
|
+
}, "isActiveAlignment");
|
|
610
694
|
return () => (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopover, {
|
|
611
695
|
"id": "popover-align-extention"
|
|
612
696
|
}, {
|
|
613
697
|
default: () => [(0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverTrigger, null, {
|
|
614
698
|
default: () => [(0, import_vue6.withDirectives)((0, import_vue6.createVNode)("button", {
|
|
615
699
|
"class": {
|
|
616
|
-
"is-active": (
|
|
617
|
-
textAlign: "left"
|
|
618
|
-
})) || (editor == null ? void 0 : editor.isActive({
|
|
619
|
-
textAlign: "right"
|
|
620
|
-
})) || (editor == null ? void 0 : editor.isActive({
|
|
621
|
-
textAlign: "center"
|
|
622
|
-
})) || (editor == null ? void 0 : editor.isActive({
|
|
623
|
-
textAlign: "justify"
|
|
624
|
-
})),
|
|
700
|
+
"is-active": isActiveAlignment("left") || isActiveAlignment("right") || isActiveAlignment("center") || isActiveAlignment("justify"),
|
|
625
701
|
"text-sizing": true
|
|
626
702
|
},
|
|
627
703
|
"style": {
|
|
628
|
-
padding: "
|
|
704
|
+
padding: "4px"
|
|
629
705
|
}
|
|
630
|
-
}, [(
|
|
631
|
-
textAlign: "left"
|
|
632
|
-
})) && (0, import_vue6.createVNode)(AlignLeftIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
633
|
-
textAlign: "center"
|
|
634
|
-
})) && (0, import_vue6.createVNode)(AlignCenterIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
635
|
-
textAlign: "right"
|
|
636
|
-
})) && (0, import_vue6.createVNode)(AlignRightIcon, null, null), (editor == null ? void 0 : editor.isActive({
|
|
637
|
-
textAlign: "justify"
|
|
638
|
-
})) && (0, import_vue6.createVNode)(AlignJustifyIcon, null, null), !(editor == null ? void 0 : editor.isActive({
|
|
639
|
-
textAlign: "left"
|
|
640
|
-
})) && !(editor == null ? void 0 : editor.isActive({
|
|
641
|
-
textAlign: "right"
|
|
642
|
-
})) && !(editor == null ? void 0 : editor.isActive({
|
|
643
|
-
textAlign: "center"
|
|
644
|
-
})) && !(editor == null ? void 0 : editor.isActive({
|
|
645
|
-
textAlign: "justify"
|
|
646
|
-
})) && (0, import_vue6.createVNode)(AlignLeftIcon, null, null)]), [[(0, import_vue6.resolveDirective)("tooltip"), {
|
|
706
|
+
}, [isActiveAlignment("left") && (0, import_vue6.createVNode)(AlignLeftIcon, null, null), isActiveAlignment("center") && (0, import_vue6.createVNode)(AlignCenterIcon, null, null), isActiveAlignment("right") && (0, import_vue6.createVNode)(AlignRightIcon, null, null), isActiveAlignment("justify") && (0, import_vue6.createVNode)(AlignJustifyIcon, null, null), !isActiveAlignment("left") && !isActiveAlignment("right") && !isActiveAlignment("center") && !isActiveAlignment("justify") && (0, import_vue6.createVNode)(AlignLeftIcon, null, null)]), [[(0, import_vue6.resolveDirective)("tooltip"), {
|
|
647
707
|
label: tooltipLabel
|
|
648
708
|
}]])]
|
|
649
709
|
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverContent, {
|
|
@@ -660,45 +720,37 @@ var AlignExtention = (0, import_vue7.defineComponent)({
|
|
|
660
720
|
})
|
|
661
721
|
}, {
|
|
662
722
|
default: () => [(0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
663
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("left").run(),
|
|
664
723
|
"class": {
|
|
665
|
-
"is-active":
|
|
666
|
-
textAlign: "left"
|
|
667
|
-
}),
|
|
724
|
+
"is-active": isActiveAlignment("left"),
|
|
668
725
|
"text-sizing": true
|
|
669
|
-
}
|
|
726
|
+
},
|
|
727
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("left").run()
|
|
670
728
|
}, {
|
|
671
729
|
default: () => [(0, import_vue6.createVNode)(AlignLeftIcon, null, null)]
|
|
672
730
|
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
673
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("center").run(),
|
|
674
731
|
"class": {
|
|
675
|
-
"is-active":
|
|
676
|
-
textAlign: "center"
|
|
677
|
-
}),
|
|
732
|
+
"is-active": isActiveAlignment("center"),
|
|
678
733
|
"text-sizing": true
|
|
679
|
-
}
|
|
734
|
+
},
|
|
735
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("center").run()
|
|
680
736
|
}, {
|
|
681
737
|
default: () => [(0, import_vue6.createVNode)(AlignCenterIcon, null, null)]
|
|
682
738
|
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
683
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("right").run(),
|
|
684
739
|
"class": {
|
|
685
|
-
"is-active":
|
|
686
|
-
textAlign: "right"
|
|
687
|
-
}),
|
|
740
|
+
"is-active": isActiveAlignment("right"),
|
|
688
741
|
"text-sizing": true
|
|
689
|
-
}
|
|
742
|
+
},
|
|
743
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("right").run()
|
|
690
744
|
}, {
|
|
691
745
|
default: () => [(0, import_vue6.createVNode)(AlignRightIcon, null, null)]
|
|
692
746
|
}), (0, import_vue6.createVNode)(import_pixel3_popover2.MpPopoverListItem, {
|
|
693
|
-
"onClick": () => editor == null ? void 0 : editor.chain().focus().setTextAlign("justify").run(),
|
|
694
747
|
"class": {
|
|
695
|
-
"is-active":
|
|
696
|
-
textAlign: "justify"
|
|
697
|
-
}),
|
|
748
|
+
"is-active": isActiveAlignment("justify"),
|
|
698
749
|
"text-sizing": true
|
|
699
|
-
}
|
|
750
|
+
},
|
|
751
|
+
"onClick": () => (editor == null ? void 0 : editor.chain()).focus().setTextAlign("justify").run()
|
|
700
752
|
}, {
|
|
701
|
-
default: () => [(0, import_vue6.createVNode)(
|
|
753
|
+
default: () => [(0, import_vue6.createVNode)(AlignJustifyIcon, null, null)]
|
|
702
754
|
})]
|
|
703
755
|
})]
|
|
704
756
|
})]
|
|
@@ -712,10 +764,18 @@ var import_vue9 = require("vue");
|
|
|
712
764
|
var SingleExtention = (0, import_vue9.defineComponent)({
|
|
713
765
|
name: "SingleExtention",
|
|
714
766
|
props: {
|
|
715
|
-
name:
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
767
|
+
name: {
|
|
768
|
+
type: String
|
|
769
|
+
},
|
|
770
|
+
tooltipLabel: {
|
|
771
|
+
type: String
|
|
772
|
+
},
|
|
773
|
+
onClick: {
|
|
774
|
+
type: Function
|
|
775
|
+
},
|
|
776
|
+
editor: {
|
|
777
|
+
type: Object
|
|
778
|
+
}
|
|
719
779
|
},
|
|
720
780
|
setup({
|
|
721
781
|
name,
|
|
@@ -723,121 +783,418 @@ var SingleExtention = (0, import_vue9.defineComponent)({
|
|
|
723
783
|
onClick,
|
|
724
784
|
editor
|
|
725
785
|
}) {
|
|
786
|
+
const iconMap = {
|
|
787
|
+
bold: (0, import_vue8.createVNode)(BoldIcon, null, null),
|
|
788
|
+
italic: (0, import_vue8.createVNode)(ItalicIcon, null, null),
|
|
789
|
+
underline: (0, import_vue8.createVNode)(UnderlineIcon, null, null),
|
|
790
|
+
strike: (0, import_vue8.createVNode)(StrikeIcon, null, null),
|
|
791
|
+
blockquote: (0, import_vue8.createVNode)(BlockquoteIcon, null, null),
|
|
792
|
+
bulletList: (0, import_vue8.createVNode)(BulletListIcon, null, null),
|
|
793
|
+
orderedList: (0, import_vue8.createVNode)(OrderedListIcon, null, null),
|
|
794
|
+
undo: (0, import_vue8.createVNode)(UndoIcon, null, null),
|
|
795
|
+
redo: (0, import_vue8.createVNode)(RedoIcon, null, null),
|
|
796
|
+
clear: (0, import_vue8.createVNode)(ClearIcon, null, null)
|
|
797
|
+
};
|
|
726
798
|
return () => (0, import_vue8.withDirectives)((0, import_vue8.createVNode)("button", {
|
|
727
799
|
"class": {
|
|
728
|
-
"is-active": editor == null ? void 0 : editor.isActive(name)
|
|
800
|
+
"is-active": name && (editor == null ? void 0 : editor.isActive(name))
|
|
729
801
|
},
|
|
730
802
|
"onClick": onClick
|
|
731
|
-
}, [name
|
|
803
|
+
}, [name && iconMap[name]]), [[(0, import_vue8.resolveDirective)("tooltip"), {
|
|
732
804
|
label: tooltipLabel
|
|
733
805
|
}]]);
|
|
734
806
|
}
|
|
735
807
|
});
|
|
736
808
|
|
|
809
|
+
// src/extensions/color-extension.tsx
|
|
810
|
+
var import_vue10 = require("vue");
|
|
811
|
+
var import_vue11 = require("vue");
|
|
812
|
+
var import_pixel3_color_picker = require("@mekari/pixel3-color-picker");
|
|
813
|
+
var import_css3 = require("@mekari/pixel3-styled-system/css");
|
|
814
|
+
var colorPreset = ["#3B82F6", "#14B8A6", "#8B5CF6", "#F59E0B", "#EF4444", "#71717A", "#84CC16", "#EC4899", "#232933", "#FFFFFF"];
|
|
815
|
+
var ColorExtension = (0, import_vue11.defineComponent)({
|
|
816
|
+
name: "ColorExtension",
|
|
817
|
+
props: {
|
|
818
|
+
tooltipLabel: {
|
|
819
|
+
type: String
|
|
820
|
+
},
|
|
821
|
+
editor: {
|
|
822
|
+
type: Object
|
|
823
|
+
},
|
|
824
|
+
type: {
|
|
825
|
+
type: String
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
setup({
|
|
829
|
+
tooltipLabel,
|
|
830
|
+
type,
|
|
831
|
+
editor
|
|
832
|
+
}) {
|
|
833
|
+
const color = (0, import_vue11.ref)("");
|
|
834
|
+
const onColorChange = /* @__PURE__ */ __name((value) => {
|
|
835
|
+
color.value = value.hex;
|
|
836
|
+
if (type === "fill") {
|
|
837
|
+
(editor == null ? void 0 : editor.chain()).focus().toggleHighlight({
|
|
838
|
+
color: value.hex
|
|
839
|
+
}).run();
|
|
840
|
+
} else {
|
|
841
|
+
(editor == null ? void 0 : editor.chain()).focus().setColor(value.hex).run();
|
|
842
|
+
}
|
|
843
|
+
}, "onColorChange");
|
|
844
|
+
return () => (0, import_vue10.createVNode)("button", {
|
|
845
|
+
"class": [{
|
|
846
|
+
"is-active": type === "fill" ? editor == null ? void 0 : editor.isActive("highlight", {
|
|
847
|
+
color: editor.getAttributes("highlight").color
|
|
848
|
+
}) : editor == null ? void 0 : editor.isActive("textStyle", {
|
|
849
|
+
color: editor.getAttributes("textStyle").color
|
|
850
|
+
})
|
|
851
|
+
}, (0, import_css3.css)({
|
|
852
|
+
textAlign: "left"
|
|
853
|
+
})]
|
|
854
|
+
}, [(0, import_vue10.createVNode)(import_pixel3_color_picker.MpColorPicker, {
|
|
855
|
+
"preset": colorPreset,
|
|
856
|
+
"variant": "basic",
|
|
857
|
+
"placement": "bottom-start",
|
|
858
|
+
"isShowPreset": true,
|
|
859
|
+
"isShowInput": false,
|
|
860
|
+
"class": (0, import_css3.css)({
|
|
861
|
+
width: "auto!"
|
|
862
|
+
}),
|
|
863
|
+
"onChange": onColorChange
|
|
864
|
+
}, {
|
|
865
|
+
default: () => [(0, import_vue10.withDirectives)((0, import_vue10.createVNode)("div", null, [type === "fill" ? (0, import_vue10.createVNode)(FillTextIcon, null, null) : (0, import_vue10.createVNode)(ColorTextIcon, null, null)]), [[(0, import_vue10.resolveDirective)("tooltip"), {
|
|
866
|
+
label: tooltipLabel
|
|
867
|
+
}]])]
|
|
868
|
+
})]);
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// src/extensions/link-extension.tsx
|
|
873
|
+
var import_vue12 = require("vue");
|
|
874
|
+
var import_vue13 = require("vue");
|
|
875
|
+
var import_core = require("@popperjs/core");
|
|
876
|
+
var import_css4 = require("@mekari/pixel3-styled-system/css");
|
|
877
|
+
var import_pixel3_input = require("@mekari/pixel3-input");
|
|
878
|
+
var import_pixel3_button = require("@mekari/pixel3-button");
|
|
879
|
+
var LinkExtension = (0, import_vue13.defineComponent)({
|
|
880
|
+
name: "LinkExtension",
|
|
881
|
+
props: {
|
|
882
|
+
tooltipLabel: {
|
|
883
|
+
type: String
|
|
884
|
+
},
|
|
885
|
+
editor: {
|
|
886
|
+
type: Object
|
|
887
|
+
}
|
|
888
|
+
},
|
|
889
|
+
setup({
|
|
890
|
+
tooltipLabel,
|
|
891
|
+
editor
|
|
892
|
+
}) {
|
|
893
|
+
const isShowPopover = (0, import_vue13.ref)(false);
|
|
894
|
+
const isEditLink = (0, import_vue13.ref)(false);
|
|
895
|
+
const popoverRef = (0, import_vue13.ref)(null);
|
|
896
|
+
const inputRef = (0, import_vue13.ref)(null);
|
|
897
|
+
const url = (0, import_vue13.ref)("");
|
|
898
|
+
let popperInstance = null;
|
|
899
|
+
let linkElement = null;
|
|
900
|
+
let lastClickedElement = null;
|
|
901
|
+
const onClickOutside = /* @__PURE__ */ __name((event) => {
|
|
902
|
+
if (popoverRef.value && !popoverRef.value.contains(event.target) && event.target !== lastClickedElement) {
|
|
903
|
+
onClosePopover();
|
|
904
|
+
}
|
|
905
|
+
}, "onClickOutside");
|
|
906
|
+
const onOpenPopover = /* @__PURE__ */ __name((target) => {
|
|
907
|
+
isShowPopover.value = true;
|
|
908
|
+
isEditLink.value = target.tagName === "A";
|
|
909
|
+
if (target)
|
|
910
|
+
lastClickedElement = target;
|
|
911
|
+
(0, import_vue13.nextTick)(() => {
|
|
912
|
+
var _a;
|
|
913
|
+
if (popoverRef.value) {
|
|
914
|
+
if (popperInstance) {
|
|
915
|
+
popperInstance.destroy();
|
|
916
|
+
}
|
|
917
|
+
popperInstance = (0, import_core.createPopper)(target, popoverRef.value, {
|
|
918
|
+
onFirstUpdate: () => {
|
|
919
|
+
if (popperInstance) {
|
|
920
|
+
popperInstance.setOptions({
|
|
921
|
+
modifiers: [{
|
|
922
|
+
name: "eventListeners",
|
|
923
|
+
enabled: false
|
|
924
|
+
}, {
|
|
925
|
+
name: "offset",
|
|
926
|
+
options: {
|
|
927
|
+
offset: [0, 8]
|
|
928
|
+
}
|
|
929
|
+
}]
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
placement: "bottom"
|
|
934
|
+
});
|
|
935
|
+
}
|
|
936
|
+
const inputElement = (_a = popoverRef.value) == null ? void 0 : _a.querySelector("input");
|
|
937
|
+
if (inputElement)
|
|
938
|
+
inputElement.focus();
|
|
939
|
+
document.addEventListener("mousedown", onClickOutside);
|
|
940
|
+
});
|
|
941
|
+
}, "onOpenPopover");
|
|
942
|
+
const onCreateLink = /* @__PURE__ */ __name(() => {
|
|
943
|
+
const selection = editor == null ? void 0 : editor.view.state.selection;
|
|
944
|
+
if (selection && selection.from !== selection.to) {
|
|
945
|
+
const coords = editor.view.coordsAtPos(selection.from);
|
|
946
|
+
url.value = "";
|
|
947
|
+
onOpenPopover({
|
|
948
|
+
getBoundingClientRect: () => ({
|
|
949
|
+
top: coords.top,
|
|
950
|
+
left: coords.left,
|
|
951
|
+
bottom: coords.bottom,
|
|
952
|
+
right: coords.right,
|
|
953
|
+
width: coords.right - coords.left,
|
|
954
|
+
height: coords.bottom - coords.top
|
|
955
|
+
})
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}, "onCreateLink");
|
|
959
|
+
const onEditLink = /* @__PURE__ */ __name(() => {
|
|
960
|
+
isEditLink.value = false;
|
|
961
|
+
}, "onEditLink");
|
|
962
|
+
const onUnlink = /* @__PURE__ */ __name(() => {
|
|
963
|
+
(editor == null ? void 0 : editor.chain()).focus().unsetLink().run();
|
|
964
|
+
onClosePopover();
|
|
965
|
+
}, "onUnlink");
|
|
966
|
+
const onSetLink = /* @__PURE__ */ __name(() => {
|
|
967
|
+
if (url.value && editor) {
|
|
968
|
+
editor.chain().focus().extendMarkRange("link").setLink({
|
|
969
|
+
href: url.value
|
|
970
|
+
}).run();
|
|
971
|
+
}
|
|
972
|
+
onClosePopover();
|
|
973
|
+
}, "onSetLink");
|
|
974
|
+
const onClosePopover = /* @__PURE__ */ __name(() => {
|
|
975
|
+
isShowPopover.value = false;
|
|
976
|
+
editor == null ? void 0 : editor.commands.setTextSelection({
|
|
977
|
+
from: 0,
|
|
978
|
+
to: 0
|
|
979
|
+
});
|
|
980
|
+
if (popperInstance) {
|
|
981
|
+
popperInstance.destroy();
|
|
982
|
+
popperInstance = null;
|
|
983
|
+
}
|
|
984
|
+
document.removeEventListener("mousedown", onClickOutside);
|
|
985
|
+
}, "onClosePopover");
|
|
986
|
+
(0, import_vue13.onMounted)(() => {
|
|
987
|
+
editor == null ? void 0 : editor.view.dom.addEventListener("click", (event) => {
|
|
988
|
+
const link = event.target.closest("a");
|
|
989
|
+
if (link) {
|
|
990
|
+
event.preventDefault();
|
|
991
|
+
linkElement = link;
|
|
992
|
+
url.value = linkElement.href;
|
|
993
|
+
onOpenPopover(linkElement);
|
|
994
|
+
}
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
(0, import_vue13.onBeforeUnmount)(() => {
|
|
998
|
+
if (popperInstance) {
|
|
999
|
+
popperInstance.destroy();
|
|
1000
|
+
}
|
|
1001
|
+
document.removeEventListener("mousedown", onClickOutside);
|
|
1002
|
+
});
|
|
1003
|
+
return () => (0, import_vue12.createVNode)(import_vue12.Fragment, null, [(0, import_vue12.withDirectives)((0, import_vue12.createVNode)("button", {
|
|
1004
|
+
"class": {
|
|
1005
|
+
"is-active": editor == null ? void 0 : editor.isActive("link")
|
|
1006
|
+
},
|
|
1007
|
+
"disabled": isShowPopover.value,
|
|
1008
|
+
"onClick": onCreateLink
|
|
1009
|
+
}, [(0, import_vue12.createVNode)(LinkIcon, null, null)]), [[(0, import_vue12.resolveDirective)("tooltip"), {
|
|
1010
|
+
label: tooltipLabel
|
|
1011
|
+
}]]), isShowPopover.value && (0, import_vue12.createVNode)(import_vue13.Teleport, {
|
|
1012
|
+
"to": "body"
|
|
1013
|
+
}, {
|
|
1014
|
+
default: () => [(0, import_vue12.createVNode)("div", {
|
|
1015
|
+
"ref": popoverRef,
|
|
1016
|
+
"data-pixel-rte": true,
|
|
1017
|
+
"style": {
|
|
1018
|
+
position: "absolute",
|
|
1019
|
+
zIndex: "var(--mp-z-index-popover)"
|
|
1020
|
+
}
|
|
1021
|
+
}, [(0, import_vue12.createVNode)("div", {
|
|
1022
|
+
"class": (0, import_css4.css)({
|
|
1023
|
+
display: "flex",
|
|
1024
|
+
gap: "2",
|
|
1025
|
+
backgroundColor: "white",
|
|
1026
|
+
border: "1px solid",
|
|
1027
|
+
borderColor: "gray.400",
|
|
1028
|
+
borderRadius: "md",
|
|
1029
|
+
boxShadow: "lg",
|
|
1030
|
+
padding: "2"
|
|
1031
|
+
})
|
|
1032
|
+
}, [(0, import_vue12.createVNode)(import_pixel3_input.MpInput, {
|
|
1033
|
+
"ref": inputRef,
|
|
1034
|
+
"class": (0, import_css4.css)({
|
|
1035
|
+
width: "212px",
|
|
1036
|
+
marginRight: "1"
|
|
1037
|
+
}),
|
|
1038
|
+
"modelValue": url.value,
|
|
1039
|
+
"onUpdate:modelValue": ($event) => url.value = $event,
|
|
1040
|
+
"placeholder": "Insert URL here",
|
|
1041
|
+
"isDisabled": isEditLink.value,
|
|
1042
|
+
"onKeyup": (event) => {
|
|
1043
|
+
if (event.key === "Enter")
|
|
1044
|
+
onSetLink();
|
|
1045
|
+
}
|
|
1046
|
+
}, null), isEditLink.value ? (0, import_vue12.createVNode)(import_pixel3_button.MpButton, {
|
|
1047
|
+
"leftIcon": "edit",
|
|
1048
|
+
"variant": "ghost",
|
|
1049
|
+
"onClick": onEditLink
|
|
1050
|
+
}, null) : (0, import_vue12.createVNode)(import_pixel3_button.MpButton, {
|
|
1051
|
+
"leftIcon": "check",
|
|
1052
|
+
"onClick": onSetLink
|
|
1053
|
+
}, null), isEditLink.value ? (0, import_vue12.createVNode)(import_pixel3_button.MpButton, {
|
|
1054
|
+
"leftIcon": "delete",
|
|
1055
|
+
"variant": "ghost",
|
|
1056
|
+
"onClick": onUnlink
|
|
1057
|
+
}, null) : (0, import_vue12.createVNode)(import_pixel3_button.MpButton, {
|
|
1058
|
+
"leftIcon": "close",
|
|
1059
|
+
"variant": "ghost",
|
|
1060
|
+
"onClick": onClosePopover
|
|
1061
|
+
}, null)])])]
|
|
1062
|
+
})]);
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
|
|
737
1066
|
// src/editor-toolbar.tsx
|
|
738
1067
|
var import_pixel3_divider = require("@mekari/pixel3-divider");
|
|
739
|
-
var EditorToolbar = (0,
|
|
1068
|
+
var EditorToolbar = (0, import_vue15.defineComponent)({
|
|
740
1069
|
name: "EditorToolbar",
|
|
741
1070
|
props: {
|
|
742
|
-
editor:
|
|
743
|
-
|
|
1071
|
+
editor: {
|
|
1072
|
+
type: Object
|
|
1073
|
+
},
|
|
1074
|
+
options: {
|
|
1075
|
+
type: Array
|
|
1076
|
+
}
|
|
744
1077
|
},
|
|
745
1078
|
setup({
|
|
746
1079
|
editor,
|
|
747
1080
|
options
|
|
748
1081
|
}) {
|
|
749
|
-
const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "align", "undo", "redo", "clear"];
|
|
1082
|
+
const items = ["heading", "bold", "italic", "underline", "strike", "blockquote", "bulletList", "orderedList", "textColor", "fillColor", "textLink", "align", "undo", "redo", "clear"];
|
|
750
1083
|
const itemOptions = {
|
|
751
1084
|
heading: {
|
|
752
|
-
tooltipLabel: "Text
|
|
1085
|
+
tooltipLabel: "Text style",
|
|
753
1086
|
editor
|
|
754
1087
|
},
|
|
755
1088
|
bold: {
|
|
756
1089
|
tooltipLabel: "Bold",
|
|
757
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run()
|
|
1090
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBold().run()
|
|
758
1091
|
},
|
|
759
1092
|
italic: {
|
|
760
1093
|
tooltipLabel: "Italic",
|
|
761
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run()
|
|
1094
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleItalic().run()
|
|
762
1095
|
},
|
|
763
1096
|
underline: {
|
|
764
1097
|
tooltipLabel: "Underline",
|
|
765
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run()
|
|
1098
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleUnderline().run()
|
|
766
1099
|
},
|
|
767
1100
|
strike: {
|
|
768
|
-
tooltipLabel: "
|
|
769
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run()
|
|
1101
|
+
tooltipLabel: "Strike",
|
|
1102
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleStrike().run()
|
|
770
1103
|
},
|
|
771
1104
|
blockquote: {
|
|
772
1105
|
tooltipLabel: "Blockquote",
|
|
773
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBlockquote().run()
|
|
1106
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBlockquote().run()
|
|
774
1107
|
},
|
|
775
1108
|
bulletList: {
|
|
776
1109
|
tooltipLabel: "Bullet list",
|
|
777
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleBulletList().run()
|
|
1110
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleBulletList().run()
|
|
778
1111
|
},
|
|
779
1112
|
orderedList: {
|
|
780
|
-
tooltipLabel: "
|
|
781
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().toggleOrderedList().run()
|
|
1113
|
+
tooltipLabel: "Number list",
|
|
1114
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().toggleOrderedList().run()
|
|
1115
|
+
},
|
|
1116
|
+
textColor: {
|
|
1117
|
+
tooltipLabel: "Text color",
|
|
1118
|
+
editor,
|
|
1119
|
+
type: "text"
|
|
1120
|
+
},
|
|
1121
|
+
fillColor: {
|
|
1122
|
+
tooltipLabel: "Fill color",
|
|
1123
|
+
editor,
|
|
1124
|
+
type: "fill"
|
|
1125
|
+
},
|
|
1126
|
+
textLink: {
|
|
1127
|
+
tooltipLabel: "Insert link",
|
|
1128
|
+
editor
|
|
782
1129
|
},
|
|
783
1130
|
align: {
|
|
784
|
-
tooltipLabel: "Text
|
|
1131
|
+
tooltipLabel: "Text alignment",
|
|
785
1132
|
editor
|
|
786
1133
|
},
|
|
787
1134
|
undo: {
|
|
788
1135
|
tooltipLabel: "Undo",
|
|
789
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().undo().run()
|
|
1136
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().undo().run()
|
|
790
1137
|
},
|
|
791
1138
|
redo: {
|
|
792
1139
|
tooltipLabel: "Redo",
|
|
793
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().redo().run()
|
|
1140
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().redo().run()
|
|
794
1141
|
},
|
|
795
1142
|
clear: {
|
|
796
|
-
tooltipLabel: "
|
|
797
|
-
onClick: () => editor == null ? void 0 : editor.chain().focus().unsetAllMarks().run()
|
|
1143
|
+
tooltipLabel: "Reset format",
|
|
1144
|
+
onClick: () => (editor == null ? void 0 : editor.chain()).focus().unsetAllMarks().run()
|
|
798
1145
|
}
|
|
799
1146
|
};
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
1147
|
+
const renderExtension = /* @__PURE__ */ __name((item) => {
|
|
1148
|
+
const options2 = itemOptions[item];
|
|
1149
|
+
if (!options2)
|
|
1150
|
+
return null;
|
|
1151
|
+
switch (item) {
|
|
1152
|
+
case "heading":
|
|
1153
|
+
return (0, import_vue14.createVNode)(HeadingExtention, {
|
|
1154
|
+
"tooltipLabel": options2.tooltipLabel,
|
|
1155
|
+
"editor": editor
|
|
1156
|
+
}, null);
|
|
1157
|
+
case "align":
|
|
1158
|
+
return (0, import_vue14.createVNode)(AlignExtention, {
|
|
1159
|
+
"tooltipLabel": options2.tooltipLabel,
|
|
806
1160
|
"editor": editor
|
|
807
1161
|
}, null);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1162
|
+
case "textColor":
|
|
1163
|
+
case "fillColor":
|
|
1164
|
+
return (0, import_vue14.createVNode)(ColorExtension, {
|
|
1165
|
+
"tooltipLabel": options2.tooltipLabel,
|
|
1166
|
+
"editor": editor,
|
|
1167
|
+
"type": options2.type
|
|
1168
|
+
}, null);
|
|
1169
|
+
case "textLink":
|
|
1170
|
+
return (0, import_vue14.createVNode)(LinkExtension, {
|
|
1171
|
+
"tooltipLabel": options2.tooltipLabel,
|
|
811
1172
|
"editor": editor
|
|
812
1173
|
}, null);
|
|
813
|
-
|
|
814
|
-
return (0,
|
|
1174
|
+
default:
|
|
1175
|
+
return (0, import_vue14.createVNode)(SingleExtention, {
|
|
815
1176
|
"name": item,
|
|
816
|
-
"tooltipLabel":
|
|
817
|
-
"onClick":
|
|
1177
|
+
"tooltipLabel": options2.tooltipLabel,
|
|
1178
|
+
"onClick": options2.onClick,
|
|
818
1179
|
"editor": editor
|
|
819
1180
|
}, null);
|
|
820
|
-
}
|
|
821
1181
|
}
|
|
822
|
-
}
|
|
1182
|
+
}, "renderExtension");
|
|
1183
|
+
return () => (0, import_vue14.createVNode)("div", null, [options == null ? void 0 : options.map((option, index) => (0, import_vue14.createVNode)(import_vue14.Fragment, null, [option.map((item) => {
|
|
1184
|
+
if (items.includes(item)) {
|
|
1185
|
+
return renderExtension(item);
|
|
1186
|
+
}
|
|
1187
|
+
}), index !== (options == null ? void 0 : options.length) - 1 && (0, import_vue14.createVNode)(import_pixel3_divider.MpDivider, {
|
|
823
1188
|
"id": "divider-toolbar",
|
|
824
1189
|
"orientation": "vertical"
|
|
825
1190
|
}, null)]))]);
|
|
826
1191
|
}
|
|
827
1192
|
});
|
|
828
1193
|
|
|
829
|
-
// src/rich-text-editor.tsx
|
|
830
|
-
var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
|
|
831
|
-
var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
|
|
832
|
-
var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
|
|
833
|
-
var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
|
|
834
|
-
var import_tokens = require("@mekari/pixel3-styled-system/tokens");
|
|
835
|
-
var import_pixel3_form_control = require("@mekari/pixel3-form-control");
|
|
836
|
-
|
|
837
1194
|
// src/rte-style-provider.tsx
|
|
838
|
-
var
|
|
839
|
-
var
|
|
840
|
-
var MpRTEStyleProvider = (0,
|
|
1195
|
+
var import_vue16 = require("vue");
|
|
1196
|
+
var import_vue17 = require("vue");
|
|
1197
|
+
var MpRTEStyleProvider = (0, import_vue17.defineComponent)({
|
|
841
1198
|
name: "MpRTEStyleProvider",
|
|
842
1199
|
props: RTEStyleProviderProps,
|
|
843
1200
|
setup(props, {
|
|
@@ -846,13 +1203,13 @@ var MpRTEStyleProvider = (0, import_vue13.defineComponent)({
|
|
|
846
1203
|
const api = useRTEStyleProvider(props);
|
|
847
1204
|
return () => {
|
|
848
1205
|
var _a;
|
|
849
|
-
return (0,
|
|
1206
|
+
return (0, import_vue16.createVNode)("div", api.value.rootProps, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
850
1207
|
};
|
|
851
1208
|
}
|
|
852
1209
|
});
|
|
853
1210
|
|
|
854
1211
|
// src/rich-text-editor.tsx
|
|
855
|
-
var MpRichTextEditor = (0,
|
|
1212
|
+
var MpRichTextEditor = (0, import_vue19.defineComponent)({
|
|
856
1213
|
name: "MpRichTextEditor",
|
|
857
1214
|
props: richTextEditorProps,
|
|
858
1215
|
emits: richTextEditorEmits,
|
|
@@ -861,7 +1218,7 @@ var MpRichTextEditor = (0, import_vue15.defineComponent)({
|
|
|
861
1218
|
}) {
|
|
862
1219
|
const formControlProp = (0, import_pixel3_form_control.useFormControlContext)();
|
|
863
1220
|
const api = useRichTextEditor(props);
|
|
864
|
-
const isFocused = (0,
|
|
1221
|
+
const isFocused = (0, import_vue19.ref)(false);
|
|
865
1222
|
const editor = new import_vue_3.Editor({
|
|
866
1223
|
content: api.value.value,
|
|
867
1224
|
editable: (formControlProp == null ? void 0 : formControlProp.value.isDisabled) === void 0 ? !api.value.isDisabled : !(formControlProp == null ? void 0 : formControlProp.value.isDisabled),
|
|
@@ -871,6 +1228,12 @@ var MpRichTextEditor = (0, import_vue15.defineComponent)({
|
|
|
871
1228
|
}
|
|
872
1229
|
}), import_extension_underline.default, import_extension_text_align.default.configure({
|
|
873
1230
|
types: ["heading", "paragraph"]
|
|
1231
|
+
}), import_extension_text_style.default, import_extension_color.Color.configure({
|
|
1232
|
+
types: ["textStyle"]
|
|
1233
|
+
}), import_extension_highlight.default.configure({
|
|
1234
|
+
multicolor: true
|
|
1235
|
+
}), import_extension_link.default.configure({
|
|
1236
|
+
openOnClick: false
|
|
874
1237
|
}), import_extension_placeholder.default.configure({
|
|
875
1238
|
placeholder: api.value.placeholder || ""
|
|
876
1239
|
})],
|
|
@@ -894,25 +1257,23 @@ var MpRichTextEditor = (0, import_vue15.defineComponent)({
|
|
|
894
1257
|
emit("change", editor2.getHTML(), editor2);
|
|
895
1258
|
}
|
|
896
1259
|
});
|
|
897
|
-
return () => {
|
|
898
|
-
|
|
899
|
-
"
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
})]);
|
|
915
|
-
};
|
|
1260
|
+
return () => (0, import_vue18.createVNode)("div", (0, import_vue18.mergeProps)(api.value.rootProps, {
|
|
1261
|
+
"style": {
|
|
1262
|
+
"--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"),
|
|
1263
|
+
"--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"),
|
|
1264
|
+
"--mp-rich-text-editor--box-shadow": isFocused.value ? import_tokens.token.var("shadows.outer") : void 0,
|
|
1265
|
+
"--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")
|
|
1266
|
+
}
|
|
1267
|
+
}), [(0, import_vue18.createVNode)(EditorToolbar, (0, import_vue18.mergeProps)({
|
|
1268
|
+
"editor": editor,
|
|
1269
|
+
"options": api.value.options
|
|
1270
|
+
}, api.value.toolbarProps), null), (0, import_vue18.createVNode)(MpRTEStyleProvider, {
|
|
1271
|
+
"id": api.value.id
|
|
1272
|
+
}, {
|
|
1273
|
+
default: () => [(0, import_vue18.createVNode)(import_vue_3.EditorContent, (0, import_vue18.mergeProps)({
|
|
1274
|
+
"editor": editor
|
|
1275
|
+
}, api.value.areaProps), null)]
|
|
1276
|
+
})]);
|
|
916
1277
|
}
|
|
917
1278
|
});
|
|
918
1279
|
// Annotate the CommonJS export names for ESM import in node:
|