@mantine-vue/tiptap 3.0.0 → 3.2.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.
Files changed (40) hide show
  1. package/cjs/index.cjs +725 -588
  2. package/cjs/index.cjs.map +1 -1
  3. package/esm/index.mjs +725 -614
  4. package/esm/index.mjs.map +1 -1
  5. package/lib/RichTextEditor.d.ts +63 -2674
  6. package/lib/RichTextEditor.types.d.ts +83 -0
  7. package/lib/RichTextEditor.vue.d.ts +25 -0
  8. package/lib/RichTextEditorContent/RichTextEditorContent.d.ts +8 -42
  9. package/lib/RichTextEditorContent/RichTextEditorContent.types.d.ts +18 -0
  10. package/lib/RichTextEditorContent/RichTextEditorContent.vue.d.ts +4 -0
  11. package/lib/RichTextEditorControl/RichTextEditorColorControl.d.ts +8 -17
  12. package/lib/RichTextEditorControl/RichTextEditorColorControl.types.d.ts +15 -0
  13. package/lib/RichTextEditorControl/RichTextEditorColorControl.vue.d.ts +4 -0
  14. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.d.ts +8 -39
  15. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.types.d.ts +19 -0
  16. package/lib/RichTextEditorControl/RichTextEditorColorPickerControl.vue.d.ts +4 -0
  17. package/lib/RichTextEditorControl/RichTextEditorControl.d.ts +18 -240
  18. package/lib/RichTextEditorControl/RichTextEditorControl.types.d.ts +91 -0
  19. package/lib/RichTextEditorControl/RichTextEditorControl.vue.d.ts +11 -0
  20. package/lib/RichTextEditorControl/RichTextEditorControlBase.vue.d.ts +11 -0
  21. package/lib/RichTextEditorControl/RichTextEditorGeneratedControl.vue.d.ts +11 -0
  22. package/lib/RichTextEditorControl/RichTextEditorLinkControl.d.ts +9 -81
  23. package/lib/RichTextEditorControl/RichTextEditorLinkControl.types.d.ts +34 -0
  24. package/lib/RichTextEditorControl/RichTextEditorLinkControl.vue.d.ts +11 -0
  25. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.d.ts +8 -6
  26. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.types.d.ts +10 -0
  27. package/lib/RichTextEditorControl/RichTextEditorSourceCodeControl.vue.d.ts +3 -0
  28. package/lib/RichTextEditorControl/controls.d.ts +248 -2139
  29. package/lib/RichTextEditorControl/use-editor-selector.d.ts +3 -0
  30. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.d.ts +9 -50
  31. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.types.d.ts +24 -0
  32. package/lib/RichTextEditorControlsGroup/RichTextEditorControlsGroup.vue.d.ts +11 -0
  33. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.d.ts +9 -81
  34. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.types.d.ts +32 -0
  35. package/lib/RichTextEditorToolbar/RichTextEditorToolbar.vue.d.ts +11 -0
  36. package/lib/icons/Icons.d.ts +40 -113
  37. package/lib/icons/RichTextEditorIcon.d.ts +5 -0
  38. package/lib/icons/RichTextEditorIcon.types.d.ts +10 -0
  39. package/lib/icons/RichTextEditorIcon.vue.d.ts +4 -0
  40. package/package.json +3 -3
package/cjs/index.cjs CHANGED
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- let vue = require("vue");
25
24
  let _mantine_vue_core = require("@mantine-vue/core");
25
+ let vue = require("vue");
26
26
  let _tiptap_vue_3 = require("@tiptap/vue-3");
27
27
  let _mantine_vue_hooks = require("@mantine-vue/hooks");
28
28
  let _tiptap_extension_link = require("@tiptap/extension-link");
@@ -95,158 +95,271 @@ var RichTextEditor_module_default = {
95
95
  taskList: "_taskList_1ljoi_345"
96
96
  };
97
97
  //#endregion
98
- //#region src/RichTextEditorContent/RichTextEditorContent.ts
99
- var RichTextEditorContent = (0, vue.defineComponent)({
100
- name: "RichTextEditorContent",
98
+ //#region src/RichTextEditor.vue
99
+ var RichTextEditor_default = /* @__PURE__ */ (0, vue.defineComponent)({
100
+ name: "RichTextEditor",
101
101
  inheritAttrs: false,
102
+ __name: "RichTextEditor",
102
103
  props: {
103
- classNames: {
104
- type: [Object, Function],
105
- default: void 0
104
+ editor: { default: null },
105
+ withCodeHighlightStyles: {
106
+ type: Boolean,
107
+ default: true
108
+ },
109
+ withTypographyStyles: {
110
+ type: Boolean,
111
+ default: true
106
112
  },
107
- styles: {
108
- type: [Object, Function],
113
+ onSourceCodeTextSwitch: {
114
+ type: Function,
109
115
  default: void 0
110
116
  },
111
- vars: {
112
- type: [Object, Function],
117
+ labels: { default: void 0 },
118
+ variant: { default: "default" },
119
+ classNames: { default: void 0 },
120
+ styles: { default: void 0 },
121
+ vars: { default: void 0 },
122
+ unstyled: {
123
+ type: Boolean,
124
+ default: void 0
125
+ }
126
+ },
127
+ setup(__props) {
128
+ const rawProps = __props;
129
+ const attrs = (0, vue.useAttrs)();
130
+ const props = (0, _mantine_vue_core.useProps)("RichTextEditor", null, rawProps);
131
+ const getStyles = (0, _mantine_vue_core.useStyles)({
132
+ name: "RichTextEditor",
133
+ classes: RichTextEditor_module_default,
134
+ props,
135
+ className: attrs.class,
136
+ style: attrs.style,
137
+ classNames: props.classNames,
138
+ styles: props.styles,
139
+ vars: props.vars,
140
+ unstyled: props.unstyled
141
+ });
142
+ const mergedLabels = (0, vue.computed)(() => ({
143
+ ...DEFAULT_LABELS,
144
+ ...props.labels
145
+ }));
146
+ const rootProps = (0, vue.computed)(() => {
147
+ const forwarded = { ...attrs };
148
+ delete forwarded.class;
149
+ delete forwarded.style;
150
+ return {
151
+ ...getStyles("root"),
152
+ ...forwarded
153
+ };
154
+ });
155
+ provideRichTextEditorContext({
156
+ get editor() {
157
+ return props.editor;
158
+ },
159
+ getStyles,
160
+ get labels() {
161
+ return mergedLabels.value;
162
+ },
163
+ get withCodeHighlightStyles() {
164
+ return props.withCodeHighlightStyles;
165
+ },
166
+ get withTypographyStyles() {
167
+ return props.withTypographyStyles;
168
+ },
169
+ get onSourceCodeTextSwitch() {
170
+ return props.onSourceCodeTextSwitch;
171
+ },
172
+ get unstyled() {
173
+ return props.unstyled;
174
+ },
175
+ get variant() {
176
+ return props.variant;
177
+ }
178
+ });
179
+ return (_ctx, _cache) => {
180
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(rootProps.value)), {
181
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
182
+ _: 3
183
+ }, 16);
184
+ };
185
+ }
186
+ });
187
+ //#endregion
188
+ //#region src/RichTextEditorContent/RichTextEditorContent.vue
189
+ var RichTextEditorContent_default = /* @__PURE__ */ (0, vue.defineComponent)({
190
+ name: "RichTextEditorContent",
191
+ inheritAttrs: false,
192
+ __name: "RichTextEditorContent",
193
+ props: {
194
+ classNames: { default: void 0 },
195
+ styles: { default: void 0 },
196
+ vars: { default: void 0 },
197
+ unstyled: {
198
+ type: Boolean,
113
199
  default: void 0
114
200
  }
115
201
  },
116
- setup(rawProps, { attrs }) {
202
+ setup(__props) {
203
+ const rawProps = __props;
204
+ const attrs = (0, vue.useAttrs)();
117
205
  const props = (0, _mantine_vue_core.useProps)("RichTextEditorContent", null, rawProps);
118
206
  const ctx = useRichTextEditorContext();
119
- return () => {
120
- const editorContent = (0, vue.h)(_mantine_vue_core.Box, {
121
- component: _tiptap_vue_3.EditorContent,
122
- editor: ctx.editor,
207
+ const contentProps = (0, vue.computed)(() => {
208
+ const forwarded = { ...attrs };
209
+ delete forwarded.class;
210
+ delete forwarded.style;
211
+ return {
123
212
  ...ctx.getStyles("content", {
124
213
  classNames: props.classNames,
125
214
  styles: props.styles,
126
215
  className: ctx.withTypographyStyles ? void 0 : attrs.class,
127
216
  style: ctx.withTypographyStyles ? void 0 : attrs.style
128
217
  }),
129
- ...attrs
130
- });
131
- return ctx.withTypographyStyles ? (0, vue.h)(_mantine_vue_core.Typography, {
132
- ...ctx.getStyles("Typography", {
133
- className: attrs.class,
134
- style: attrs.style,
135
- styles: props.styles,
136
- classNames: props.classNames
137
- }),
138
- unstyled: ctx.unstyled
139
- }, () => editorContent) : editorContent;
218
+ ...forwarded
219
+ };
220
+ });
221
+ const typographyProps = (0, vue.computed)(() => ctx.getStyles("Typography", {
222
+ className: attrs.class,
223
+ style: attrs.style,
224
+ styles: props.styles,
225
+ classNames: props.classNames
226
+ }));
227
+ return (_ctx, _cache) => {
228
+ return (0, vue.unref)(ctx).withTypographyStyles ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Typography), (0, vue.mergeProps)({ key: 0 }, typographyProps.value, { unstyled: (0, vue.unref)(ctx).unstyled }), {
229
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
230
+ component: (0, vue.unref)(_tiptap_vue_3.EditorContent),
231
+ editor: (0, vue.unref)(ctx).editor
232
+ }, contentProps.value), null, 16, ["component", "editor"])]),
233
+ _: 1
234
+ }, 16, ["unstyled"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.mergeProps)({
235
+ key: 1,
236
+ component: (0, vue.unref)(_tiptap_vue_3.EditorContent),
237
+ editor: (0, vue.unref)(ctx).editor
238
+ }, contentProps.value), null, 16, ["component", "editor"]));
140
239
  };
141
240
  }
142
241
  });
143
- Object.assign(RichTextEditorContent, { classes: RichTextEditor_module_default });
144
242
  //#endregion
145
- //#region src/RichTextEditorControl/RichTextEditorControl.ts
146
- var defaultProps$1 = { interactive: true };
147
- var RichTextEditorControl = (0, vue.defineComponent)({
243
+ //#region src/RichTextEditorContent/RichTextEditorContent.ts
244
+ var RichTextEditorContent = (0, _mantine_vue_core.factory)(RichTextEditorContent_default, { classes: RichTextEditor_module_default });
245
+ //#endregion
246
+ //#region src/RichTextEditorControl/RichTextEditorControl.vue
247
+ var RichTextEditorControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
148
248
  name: "RichTextEditorControl",
149
249
  inheritAttrs: false,
250
+ __name: "RichTextEditorControl",
150
251
  props: {
252
+ classNames: { default: void 0 },
253
+ styles: { default: void 0 },
254
+ vars: { default: void 0 },
255
+ unstyled: {
256
+ type: Boolean,
257
+ default: void 0
258
+ },
151
259
  active: {
152
260
  type: Boolean,
153
261
  default: void 0
154
262
  },
155
263
  interactive: {
156
264
  type: Boolean,
157
- default: void 0
265
+ default: true
158
266
  },
159
267
  disabled: {
160
268
  type: Boolean,
161
269
  default: void 0
162
270
  },
163
- variant: {
164
- type: String,
165
- default: void 0
166
- },
167
- classNames: {
168
- type: [Object, Function],
169
- default: void 0
170
- },
171
- styles: {
172
- type: [Object, Function],
173
- default: void 0
174
- },
175
- vars: {
176
- type: [Object, Function],
177
- default: void 0
178
- }
271
+ variant: { default: void 0 }
179
272
  },
180
- setup(rawProps, { attrs, slots }) {
181
- const props = (0, _mantine_vue_core.useProps)("RichTextEditorControl", defaultProps$1, rawProps);
273
+ setup(__props) {
274
+ const rawProps = __props;
275
+ const attrs = (0, vue.useAttrs)();
276
+ const props = (0, _mantine_vue_core.useProps)("RichTextEditorControl", null, rawProps);
182
277
  const ctx = useRichTextEditorContext();
183
- return () => (0, vue.h)(_mantine_vue_core.UnstyledButton, {
184
- ...attrs,
278
+ const forwardedAttrs = (0, vue.computed)(() => {
279
+ const result = { ...attrs };
280
+ delete result.onMousedown;
281
+ return result;
282
+ });
283
+ const controlProps = (0, vue.computed)(() => ({
284
+ ...forwardedAttrs.value,
185
285
  ...ctx.getStyles("control", {
186
286
  className: attrs.class,
187
287
  style: attrs.style,
188
288
  classNames: props.classNames,
189
289
  styles: props.styles
190
- }),
191
- disabled: props.disabled,
192
- "data-rich-text-editor-control": "",
193
- tabindex: props.interactive ? 0 : -1,
194
- "data-interactive": props.interactive || void 0,
195
- "data-disabled": props.disabled || void 0,
196
- "data-active": props.active || void 0,
197
- "aria-pressed": props.active && props.interactive ? true : void 0,
198
- "aria-hidden": !props.interactive || void 0,
199
- unstyled: ctx.unstyled,
200
- variant: props.variant || ctx.variant || "default",
201
- onMousedown: (event) => {
202
- event.preventDefault();
203
- attrs.onMousedown?.(event);
204
- }
205
- }, slots);
290
+ })
291
+ }));
292
+ function onMousedown(event) {
293
+ event.preventDefault();
294
+ const handler = attrs.onMousedown;
295
+ if (typeof handler === "function") handler(event);
296
+ }
297
+ return (_ctx, _cache) => {
298
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.UnstyledButton), (0, vue.mergeProps)(controlProps.value, {
299
+ disabled: (0, vue.unref)(props).disabled,
300
+ "data-rich-text-editor-control": "",
301
+ tabindex: (0, vue.unref)(props).interactive ? 0 : -1,
302
+ "data-interactive": (0, vue.unref)(props).interactive || void 0,
303
+ "data-disabled": (0, vue.unref)(props).disabled || void 0,
304
+ "data-active": (0, vue.unref)(props).active || void 0,
305
+ "aria-pressed": (0, vue.unref)(props).active && (0, vue.unref)(props).interactive ? true : void 0,
306
+ "aria-hidden": !(0, vue.unref)(props).interactive || void 0,
307
+ unstyled: (0, vue.unref)(ctx).unstyled,
308
+ variant: (0, vue.unref)(props).variant || (0, vue.unref)(ctx).variant || "default",
309
+ onMousedown
310
+ }), {
311
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
312
+ _: 3
313
+ }, 16, [
314
+ "disabled",
315
+ "tabindex",
316
+ "data-interactive",
317
+ "data-disabled",
318
+ "data-active",
319
+ "aria-pressed",
320
+ "aria-hidden",
321
+ "unstyled",
322
+ "variant"
323
+ ]);
324
+ };
206
325
  }
207
326
  });
208
- Object.assign(RichTextEditorControl, { classes: RichTextEditor_module_default });
209
- var RichTextEditorControlBase = (0, vue.defineComponent)({
327
+ //#endregion
328
+ //#region src/RichTextEditorControl/RichTextEditorControlBase.vue
329
+ var RichTextEditorControlBase_default = /* @__PURE__ */ (0, vue.defineComponent)({
210
330
  name: "RichTextEditorControlBase",
211
331
  inheritAttrs: false,
332
+ __name: "RichTextEditorControlBase",
212
333
  props: {
213
- icon: {
214
- type: [Object, Function],
215
- required: true
216
- },
217
- active: {
218
- type: Boolean,
219
- default: void 0
220
- },
221
- interactive: {
222
- type: Boolean,
223
- default: void 0
224
- },
225
- disabled: {
226
- type: Boolean,
227
- default: void 0
228
- },
229
- variant: {
230
- type: String,
231
- default: void 0
232
- },
233
- classNames: {
234
- type: [Object, Function],
235
- default: void 0
236
- },
237
- styles: {
238
- type: [Object, Function],
239
- default: void 0
240
- }
334
+ icon: {},
335
+ classNames: {},
336
+ styles: {},
337
+ vars: {},
338
+ unstyled: { type: Boolean },
339
+ active: { type: Boolean },
340
+ interactive: { type: Boolean },
341
+ disabled: { type: Boolean },
342
+ variant: {}
241
343
  },
242
- setup(props, { attrs }) {
344
+ setup(__props) {
345
+ const props = __props;
346
+ const attrs = (0, vue.useAttrs)();
243
347
  const ctx = useRichTextEditorContext();
244
- return () => (0, vue.h)(RichTextEditorControl, {
245
- ...attrs,
246
- ...props
247
- }, () => (0, vue.h)(props.icon, ctx.getStyles("controlIcon")));
348
+ const controlProps = (0, vue.computed)(() => ({
349
+ ...props,
350
+ ...attrs
351
+ }));
352
+ const iconProps = (0, vue.computed)(() => ctx.getStyles("controlIcon"));
353
+ return (_ctx, _cache) => {
354
+ return (0, vue.openBlock)(), (0, vue.createBlock)(RichTextEditorControl_default, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(controlProps.value)), {
355
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "icon", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps.value)), () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.icon), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps.value)), null, 16))])]),
356
+ _: 3
357
+ }, 16);
358
+ };
248
359
  }
249
360
  });
361
+ //#endregion
362
+ //#region src/RichTextEditorControl/use-editor-selector.ts
250
363
  function isSafeEditor(editor) {
251
364
  return !!editor && !editor.isDestroyed;
252
365
  }
@@ -279,128 +392,177 @@ function useEditorSelector(editor, selector) {
279
392
  return selector(editor());
280
393
  });
281
394
  }
282
- function createControl({ label, isActive, operation, icon, isDisabled }) {
283
- return (0, vue.defineComponent)({
284
- name: `RichTextEditor${String(label)}`,
285
- inheritAttrs: false,
286
- props: {
287
- icon: {
288
- type: [Object, Function],
289
- default: void 0
290
- },
291
- active: {
292
- type: Boolean,
293
- default: void 0
294
- },
295
- interactive: {
296
- type: Boolean,
297
- default: void 0
298
- },
299
- disabled: {
300
- type: Boolean,
301
- default: void 0
302
- },
303
- variant: {
304
- type: String,
305
- default: void 0
306
- },
307
- classNames: {
308
- type: [Object, Function],
309
- default: void 0
310
- },
311
- styles: {
312
- type: [Object, Function],
313
- default: void 0
314
- }
395
+ //#endregion
396
+ //#region src/RichTextEditorControl/RichTextEditorGeneratedControl.vue
397
+ var RichTextEditorGeneratedControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
398
+ name: "RichTextEditorGeneratedControl",
399
+ inheritAttrs: false,
400
+ __name: "RichTextEditorGeneratedControl",
401
+ props: {
402
+ classNames: { default: void 0 },
403
+ styles: { default: void 0 },
404
+ vars: { default: void 0 },
405
+ unstyled: {
406
+ type: Boolean,
407
+ default: void 0
315
408
  },
316
- setup(props, { attrs }) {
317
- const ctx = useRichTextEditorContext();
318
- const editorState = useEditorSelector(() => ctx.editor, (editor) => {
319
- const safeEditor = isSafeEditor(editor) ? editor : null;
320
- return {
321
- active: safeEditor && isActive?.name ? safeEditor.isActive(isActive.name, isActive.attributes) : false,
322
- disabled: safeEditor ? isDisabled?.(safeEditor) ?? false : true
323
- };
324
- });
325
- return () => {
326
- const controlLabel = ctx.labels[label];
327
- return (0, vue.h)(RichTextEditorControlBase, {
328
- ...attrs,
329
- ...props,
330
- "aria-label": controlLabel,
331
- title: controlLabel,
332
- active: props.active ?? editorState.value.active,
333
- icon: props.icon || icon,
334
- disabled: props.disabled ?? editorState.value.disabled,
335
- onClick: () => {
336
- if (!isSafeEditor(ctx.editor)) return;
337
- ctx.editor.chain().focus()[operation.name](operation.attributes).run();
338
- }
339
- });
409
+ active: {
410
+ type: Boolean,
411
+ default: void 0
412
+ },
413
+ interactive: {
414
+ type: Boolean,
415
+ default: true
416
+ },
417
+ disabled: {
418
+ type: Boolean,
419
+ default: void 0
420
+ },
421
+ variant: { default: void 0 },
422
+ label: {},
423
+ icon: {},
424
+ isActive: { default: void 0 },
425
+ isDisabled: {
426
+ type: Function,
427
+ default: void 0
428
+ },
429
+ operation: {}
430
+ },
431
+ setup(__props) {
432
+ const props = __props;
433
+ const attrs = (0, vue.useAttrs)();
434
+ const ctx = useRichTextEditorContext();
435
+ const label = (0, vue.computed)(() => ctx.labels[props.label]);
436
+ const editorState = useEditorSelector(() => ctx.editor, (editor) => {
437
+ const safeEditor = isSafeEditor(editor) ? editor : null;
438
+ return {
439
+ active: safeEditor && props.isActive?.name ? safeEditor.isActive(props.isActive.name, props.isActive.attributes) : false,
440
+ disabled: safeEditor ? props.isDisabled?.(safeEditor) ?? false : true
340
441
  };
442
+ });
443
+ function runOperation() {
444
+ if (!isSafeEditor(ctx.editor)) return;
445
+ ctx.editor.chain().focus()[props.operation.name](props.operation.attributes).run();
341
446
  }
342
- });
343
- }
344
- function renderControlIcon(Icon) {
345
- return (0, vue.h)(_mantine_vue_core.Box, {
346
- component: Icon,
347
- class: RichTextEditor_module_default.controlIcon
348
- });
447
+ return (_ctx, _cache) => {
448
+ return (0, vue.openBlock)(), (0, vue.createBlock)(RichTextEditorControlBase_default, (0, vue.mergeProps)((0, vue.unref)(attrs), {
449
+ active: props.active ?? (0, vue.unref)(editorState).active,
450
+ interactive: props.interactive,
451
+ disabled: props.disabled ?? (0, vue.unref)(editorState).disabled,
452
+ variant: props.variant,
453
+ "class-names": props.classNames,
454
+ styles: props.styles,
455
+ "aria-label": label.value,
456
+ title: label.value,
457
+ onClick: runOperation
458
+ }), {
459
+ icon: (0, vue.withCtx)((iconProps) => [(0, vue.renderSlot)(_ctx.$slots, "icon", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps)), () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.icon), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps)), null, 16))])]),
460
+ _: 3
461
+ }, 16, [
462
+ "active",
463
+ "interactive",
464
+ "disabled",
465
+ "variant",
466
+ "class-names",
467
+ "styles",
468
+ "aria-label",
469
+ "title"
470
+ ]);
471
+ };
472
+ }
473
+ });
474
+ //#endregion
475
+ //#region src/RichTextEditorControl/RichTextEditorControl.ts
476
+ var RichTextEditorControl = (0, _mantine_vue_core.factory)(RichTextEditorControl_default, { classes: RichTextEditor_module_default });
477
+ var RichTextEditorControlBase = (0, _mantine_vue_core.factory)(RichTextEditorControlBase_default, { classes: RichTextEditor_module_default });
478
+ var RichTextEditorGeneratedControl = (0, _mantine_vue_core.factory)(RichTextEditorGeneratedControl_default, { classes: RichTextEditor_module_default });
479
+ function createControl(config) {
480
+ return RichTextEditorGeneratedControl.withProps(config);
349
481
  }
350
482
  //#endregion
351
- //#region src/RichTextEditorControl/RichTextEditorColorControl.ts
352
- var RichTextEditorColorControl = (0, vue.defineComponent)({
483
+ //#region src/RichTextEditorControl/RichTextEditorColorControl.vue
484
+ var RichTextEditorColorControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
353
485
  name: "RichTextEditorColorControl",
354
486
  inheritAttrs: false,
355
- props: { color: {
356
- type: String,
357
- required: true
358
- } },
359
- setup(rawProps, { attrs }) {
360
- const props = (0, _mantine_vue_core.useProps)("RichTextEditorColorControl", null, rawProps);
487
+ __name: "RichTextEditorColorControl",
488
+ props: { color: {} },
489
+ setup(__props) {
490
+ const props = __props;
491
+ const attrs = (0, vue.useAttrs)();
361
492
  const ctx = useRichTextEditorContext();
362
- return () => {
363
- const currentColor = ctx.editor?.getAttributes("textStyle").color || null;
364
- const label = ctx.labels.colorControlLabel(props.color);
365
- return (0, vue.h)(RichTextEditorControl, {
366
- ...attrs,
367
- variant: ctx.variant,
368
- active: currentColor === props.color,
369
- "aria-label": label,
370
- title: label,
371
- onClick: () => (ctx.editor?.chain())?.focus().setColor(props.color).run()
372
- }, () => (0, vue.h)(_mantine_vue_core.ColorSwatch, {
373
- color: props.color,
374
- size: 14
375
- }));
493
+ const currentColor = useEditorSelector(() => ctx.editor, (editor) => String(editor?.getAttributes("textStyle").color || ""));
494
+ const label = (0, vue.computed)(() => ctx.labels.colorControlLabel(props.color));
495
+ function setColor() {
496
+ (ctx.editor?.chain())?.focus().setColor(props.color).run();
497
+ }
498
+ return (_ctx, _cache) => {
499
+ return (0, vue.openBlock)(), (0, vue.createBlock)(RichTextEditorControl_default, (0, vue.mergeProps)((0, vue.unref)(attrs), {
500
+ variant: (0, vue.unref)(ctx).variant,
501
+ active: (0, vue.unref)(currentColor) === props.color,
502
+ "aria-label": label.value,
503
+ title: label.value,
504
+ onClick: setColor
505
+ }), {
506
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.ColorSwatch), {
507
+ color: props.color,
508
+ size: 14
509
+ }, null, 8, ["color"])]),
510
+ _: 1
511
+ }, 16, [
512
+ "variant",
513
+ "active",
514
+ "aria-label",
515
+ "title"
516
+ ]);
376
517
  };
377
518
  }
378
519
  });
379
520
  //#endregion
380
- //#region src/icons/Icons.ts
381
- function createIcon(name, children) {
382
- return (0, vue.defineComponent)({
383
- name,
384
- inheritAttrs: false,
385
- setup(_, { attrs }) {
386
- return () => (0, vue.h)("svg", {
387
- ...attrs,
521
+ //#region src/RichTextEditorControl/RichTextEditorColorControl.ts
522
+ var RichTextEditorColorControl = (0, _mantine_vue_core.factory)(RichTextEditorColorControl_default, { classes: RichTextEditor_module_default });
523
+ //#endregion
524
+ //#region src/icons/RichTextEditorIcon.vue?vue&type=script&setup=true&lang.ts
525
+ var _hoisted_1 = ["d"];
526
+ //#endregion
527
+ //#region src/icons/RichTextEditorIcon.vue
528
+ var RichTextEditorIcon_default = /* @__PURE__ */ (0, vue.defineComponent)({
529
+ name: "RichTextEditorIcon",
530
+ inheritAttrs: false,
531
+ __name: "RichTextEditorIcon",
532
+ props: { paths: {} },
533
+ setup(__props) {
534
+ const attrs = (0, vue.useAttrs)();
535
+ return (_ctx, _cache) => {
536
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("svg", (0, vue.mergeProps)((0, vue.unref)(attrs), {
388
537
  xmlns: "http://www.w3.org/2000/svg",
389
538
  viewBox: "0 0 24 24",
390
- strokeWidth: "1.5",
539
+ "stroke-width": "1.5",
391
540
  stroke: "currentColor",
392
541
  fill: "none",
393
- strokeLinecap: "round",
394
- strokeLinejoin: "round"
395
- }, [(0, vue.h)("path", {
542
+ "stroke-linecap": "round",
543
+ "stroke-linejoin": "round"
544
+ }), [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("path", {
396
545
  stroke: "none",
397
546
  d: "M0 0h24v24H0z",
398
547
  fill: "none"
399
- }), ...children]);
400
- }
401
- });
548
+ }, null, -1)), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.paths, (path) => {
549
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("path", {
550
+ key: path,
551
+ d: path
552
+ }, null, 8, _hoisted_1);
553
+ }), 128))], 16);
554
+ };
555
+ }
556
+ });
557
+ //#endregion
558
+ //#region src/icons/RichTextEditorIcon.ts
559
+ var RichTextEditorIcon = (0, _mantine_vue_core.factory)(RichTextEditorIcon_default);
560
+ //#endregion
561
+ //#region src/icons/Icons.ts
562
+ function createIcon(_name, paths) {
563
+ return RichTextEditorIcon.withProps({ paths });
402
564
  }
403
- var path = (d) => (0, vue.h)("path", { d });
565
+ var path = (d) => d;
404
566
  var IconBold = createIcon("IconBold", [path("M7 5h6a3.5 3.5 0 0 1 0 7h-6z"), path("M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7")]);
405
567
  var IconItalic = createIcon("IconItalic", [
406
568
  path("M11 5l6 0"),
@@ -595,142 +757,188 @@ var IconBraces = createIcon("IconBraces", [
595
757
  path("M14 11l2 2-2 2")
596
758
  ]);
597
759
  //#endregion
598
- //#region src/RichTextEditorControl/RichTextEditorColorPickerControl.ts
599
- var RichTextEditorColorPickerControl = (0, vue.defineComponent)({
760
+ //#region src/RichTextEditorControl/RichTextEditorColorPickerControl.vue
761
+ var RichTextEditorColorPickerControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
600
762
  name: "RichTextEditorColorPickerControl",
601
763
  inheritAttrs: false,
764
+ __name: "RichTextEditorColorPickerControl",
602
765
  props: {
603
- popoverProps: {
604
- type: Object,
605
- default: void 0
606
- },
607
- colorPickerProps: {
608
- type: Object,
609
- default: void 0
610
- },
611
- colors: {
612
- type: Array,
613
- required: true
614
- }
766
+ popoverProps: {},
767
+ colorPickerProps: {},
768
+ colors: {}
615
769
  },
616
- setup(rawProps, { attrs }) {
617
- const props = (0, _mantine_vue_core.useProps)("RichTextEditorColorPickerControl", null, rawProps);
770
+ setup(__props) {
771
+ const props = __props;
772
+ const attrs = (0, vue.useAttrs)();
618
773
  const ctx = useRichTextEditorContext();
619
774
  const [opened, handlers] = (0, _mantine_vue_hooks.useDisclosure)(false);
620
775
  const state = (0, vue.ref)("palette");
621
- const handleChange = (value, shouldClose = true) => {
776
+ const currentColor = useEditorSelector(() => ctx.editor, (editor) => String(editor?.getAttributes("textStyle").color || "var(--mantine-color-text)"));
777
+ function handleChange(value, shouldClose = true) {
622
778
  (ctx.editor?.chain())?.focus().setColor(value).run();
623
779
  if (shouldClose) handlers.close();
624
- };
625
- const handleClear = () => {
780
+ }
781
+ function handleClear() {
626
782
  (ctx.editor?.chain())?.focus().unsetColor().run();
627
783
  handlers.close();
628
- };
629
- return () => {
630
- const currentColor = ctx.editor?.getAttributes("textStyle").color || "var(--mantine-color-text)";
631
- return (0, vue.h)(_mantine_vue_core.Popover, {
632
- opened: opened.value,
633
- withinPortal: true,
634
- trapFocus: true,
635
- onChange: (nextOpened) => !nextOpened && handlers.close(),
636
- ...props.popoverProps
637
- }, { default: () => [(0, vue.h)(_mantine_vue_core.Popover.Target, null, () => (0, vue.h)(RichTextEditorControl, {
638
- ...attrs,
639
- variant: ctx.variant,
640
- "aria-label": ctx.labels.colorPickerControlLabel,
641
- title: ctx.labels.colorPickerControlLabel,
642
- onClick: handlers.toggle
643
- }, () => (0, vue.h)(_mantine_vue_core.ColorSwatch, {
644
- color: currentColor,
645
- size: 14
646
- }))), (0, vue.h)(_mantine_vue_core.Popover.Dropdown, ctx.getStyles("linkEditorDropdown"), () => [
647
- state.value === "palette" ? (0, vue.h)(_mantine_vue_core.SimpleGrid, {
648
- cols: 7,
649
- spacing: 2
650
- }, () => props.colors.map((color, index) => (0, vue.h)(_mantine_vue_core.ColorSwatch, {
651
- key: index,
652
- component: "button",
653
- color,
654
- onClick: () => handleChange(color),
655
- size: 26,
656
- radius: "xs",
657
- style: { cursor: "pointer" },
658
- title: ctx.labels.colorPickerColorLabel(color),
659
- "aria-label": ctx.labels.colorPickerColorLabel(color)
660
- }))) : null,
661
- state.value === "colorPicker" ? (0, vue.h)(_mantine_vue_core.ColorPicker, {
662
- defaultValue: currentColor,
663
- onChange: (value) => handleChange(value, false),
664
- ...props.colorPickerProps
665
- }) : null,
666
- (0, vue.h)(_mantine_vue_core.Group, {
667
- justify: "flex-end",
668
- gap: "xs",
669
- mt: "sm"
670
- }, () => [
671
- state.value === "palette" ? (0, vue.h)(_mantine_vue_core.ActionIcon, {
672
- variant: "default",
673
- onClick: handlers.close,
674
- title: ctx.labels.colorPickerCancel,
675
- "aria-label": ctx.labels.colorPickerCancel
676
- }, () => (0, vue.h)(IconX, { style: {
677
- width: (0, _mantine_vue_core.rem)(16),
678
- height: (0, _mantine_vue_core.rem)(16)
679
- } })) : null,
680
- (0, vue.h)(_mantine_vue_core.ActionIcon, {
681
- variant: "default",
682
- onClick: handleClear,
683
- title: ctx.labels.colorPickerClear,
684
- "aria-label": ctx.labels.colorPickerClear
685
- }, () => (0, vue.h)(IconCircleOff, { style: {
686
- width: (0, _mantine_vue_core.rem)(16),
687
- height: (0, _mantine_vue_core.rem)(16)
688
- } })),
689
- state.value === "palette" ? (0, vue.h)(_mantine_vue_core.ActionIcon, {
690
- variant: "default",
691
- onClick: () => {
692
- state.value = "colorPicker";
693
- },
694
- title: ctx.labels.colorPickerColorPicker,
695
- "aria-label": ctx.labels.colorPickerColorPicker
696
- }, () => (0, vue.h)(IconColorPicker, { style: {
697
- width: (0, _mantine_vue_core.rem)(16),
698
- height: (0, _mantine_vue_core.rem)(16)
699
- } })) : (0, vue.h)(_mantine_vue_core.ActionIcon, {
700
- variant: "default",
701
- onClick: () => {
702
- state.value = "palette";
703
- },
704
- title: ctx.labels.colorPickerPalette,
705
- "aria-label": ctx.labels.colorPickerPalette
706
- }, () => (0, vue.h)(IconPalette, { style: {
707
- width: (0, _mantine_vue_core.rem)(16),
708
- height: (0, _mantine_vue_core.rem)(16)
709
- } })),
710
- state.value === "colorPicker" ? (0, vue.h)(_mantine_vue_core.ActionIcon, {
711
- variant: "default",
712
- onClick: handlers.close,
713
- title: ctx.labels.colorPickerSave,
714
- "aria-label": ctx.labels.colorPickerSave
715
- }, () => (0, vue.h)(IconCheck, { style: {
716
- width: (0, _mantine_vue_core.rem)(16),
717
- height: (0, _mantine_vue_core.rem)(16)
718
- } })) : null
719
- ])
720
- ])] });
784
+ }
785
+ return (_ctx, _cache) => {
786
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Popover), (0, vue.mergeProps)({
787
+ opened: (0, vue.unref)(opened),
788
+ "within-portal": true,
789
+ "trap-focus": true
790
+ }, props.popoverProps, { onChange: _cache[2] || (_cache[2] = (value) => !value && (0, vue.unref)(handlers).close()) }), {
791
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Popover).Target, null, {
792
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)(RichTextEditorControl_default, (0, vue.mergeProps)((0, vue.unref)(attrs), {
793
+ variant: (0, vue.unref)(ctx).variant,
794
+ "aria-label": (0, vue.unref)(ctx).labels.colorPickerControlLabel,
795
+ title: (0, vue.unref)(ctx).labels.colorPickerControlLabel,
796
+ onClick: (0, vue.unref)(handlers).toggle
797
+ }), {
798
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.ColorSwatch), {
799
+ color: (0, vue.unref)(currentColor),
800
+ size: 14
801
+ }, null, 8, ["color"])]),
802
+ _: 1
803
+ }, 16, [
804
+ "variant",
805
+ "aria-label",
806
+ "title",
807
+ "onClick"
808
+ ])]),
809
+ _: 1
810
+ }), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Popover).Dropdown, (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(ctx).getStyles("linkEditorDropdown"))), {
811
+ default: (0, vue.withCtx)(() => [state.value === "palette" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.SimpleGrid), {
812
+ key: 0,
813
+ cols: 7,
814
+ spacing: 2
815
+ }, {
816
+ default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(props.colors, (color) => {
817
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.ColorSwatch), {
818
+ key: color,
819
+ component: "button",
820
+ color,
821
+ size: 26,
822
+ radius: "xs",
823
+ style: { cursor: "pointer" },
824
+ title: (0, vue.unref)(ctx).labels.colorPickerColorLabel(color),
825
+ "aria-label": (0, vue.unref)(ctx).labels.colorPickerColorLabel(color),
826
+ onClick: ($event) => handleChange(color)
827
+ }, null, 8, [
828
+ "color",
829
+ "title",
830
+ "aria-label",
831
+ "onClick"
832
+ ]);
833
+ }), 128))]),
834
+ _: 1
835
+ })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.ColorPicker), (0, vue.mergeProps)({
836
+ key: 1,
837
+ "model-value": (0, vue.unref)(currentColor)
838
+ }, props.colorPickerProps, { "onUpdate:modelValue": _cache[0] || (_cache[0] = (value) => handleChange(value, false)) }), null, 16, ["model-value"])), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Tooltip).Group, { "close-delay": 200 }, {
839
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Group), {
840
+ justify: "flex-end",
841
+ gap: "xs",
842
+ mt: "sm"
843
+ }, {
844
+ default: (0, vue.withCtx)(() => [
845
+ state.value === "palette" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.ActionIcon), {
846
+ key: 0,
847
+ variant: "default",
848
+ title: (0, vue.unref)(ctx).labels.colorPickerCancel,
849
+ "aria-label": (0, vue.unref)(ctx).labels.colorPickerCancel,
850
+ onClick: (0, vue.unref)(handlers).close
851
+ }, {
852
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(IconX), { style: (0, vue.normalizeStyle)({
853
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
854
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
855
+ }) }, null, 8, ["style"])]),
856
+ _: 1
857
+ }, 8, [
858
+ "title",
859
+ "aria-label",
860
+ "onClick"
861
+ ])) : (0, vue.createCommentVNode)("", true),
862
+ (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.ActionIcon), {
863
+ variant: "default",
864
+ title: (0, vue.unref)(ctx).labels.colorPickerClear,
865
+ "aria-label": (0, vue.unref)(ctx).labels.colorPickerClear,
866
+ onClick: handleClear
867
+ }, {
868
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(IconCircleOff), { style: (0, vue.normalizeStyle)({
869
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
870
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
871
+ }) }, null, 8, ["style"])]),
872
+ _: 1
873
+ }, 8, ["title", "aria-label"]),
874
+ (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.ActionIcon), {
875
+ variant: "default",
876
+ title: state.value === "palette" ? (0, vue.unref)(ctx).labels.colorPickerColorPicker : (0, vue.unref)(ctx).labels.colorPickerPalette,
877
+ "aria-label": state.value === "palette" ? (0, vue.unref)(ctx).labels.colorPickerColorPicker : (0, vue.unref)(ctx).labels.colorPickerPalette,
878
+ onClick: _cache[1] || (_cache[1] = ($event) => state.value = state.value === "palette" ? "colorPicker" : "palette")
879
+ }, {
880
+ default: (0, vue.withCtx)(() => [state.value === "palette" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(IconColorPicker), {
881
+ key: 0,
882
+ style: (0, vue.normalizeStyle)({
883
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
884
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
885
+ })
886
+ }, null, 8, ["style"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(IconPalette), {
887
+ key: 1,
888
+ style: (0, vue.normalizeStyle)({
889
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
890
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
891
+ })
892
+ }, null, 8, ["style"]))]),
893
+ _: 1
894
+ }, 8, ["title", "aria-label"]),
895
+ state.value === "colorPicker" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.ActionIcon), {
896
+ key: 1,
897
+ variant: "default",
898
+ title: (0, vue.unref)(ctx).labels.colorPickerSave,
899
+ "aria-label": (0, vue.unref)(ctx).labels.colorPickerSave,
900
+ onClick: (0, vue.unref)(handlers).close
901
+ }, {
902
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(IconCheck), { style: (0, vue.normalizeStyle)({
903
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
904
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
905
+ }) }, null, 8, ["style"])]),
906
+ _: 1
907
+ }, 8, [
908
+ "title",
909
+ "aria-label",
910
+ "onClick"
911
+ ])) : (0, vue.createCommentVNode)("", true)
912
+ ]),
913
+ _: 1
914
+ })]),
915
+ _: 1
916
+ })]),
917
+ _: 1
918
+ }, 16)]),
919
+ _: 1
920
+ }, 16, ["opened"]);
721
921
  };
722
922
  }
723
923
  });
724
924
  //#endregion
725
- //#region src/RichTextEditorControl/RichTextEditorLinkControl.ts
726
- var RichTextEditorLinkControl = (0, vue.defineComponent)({
925
+ //#region src/RichTextEditorControl/RichTextEditorColorPickerControl.ts
926
+ var RichTextEditorColorPickerControl = (0, _mantine_vue_core.factory)(RichTextEditorColorPickerControl_default, { classes: RichTextEditor_module_default });
927
+ //#endregion
928
+ //#region src/RichTextEditorControl/RichTextEditorLinkControl.vue
929
+ var RichTextEditorLinkControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
727
930
  name: "RichTextEditorLinkControl",
728
931
  inheritAttrs: false,
932
+ __name: "RichTextEditorLinkControl",
729
933
  props: {
730
- popoverProps: {
731
- type: Object,
934
+ classNames: { default: void 0 },
935
+ styles: { default: void 0 },
936
+ vars: { default: void 0 },
937
+ unstyled: {
938
+ type: Boolean,
732
939
  default: void 0
733
940
  },
941
+ popoverProps: { default: void 0 },
734
942
  disableTooltips: {
735
943
  type: Boolean,
736
944
  default: false
@@ -739,148 +947,175 @@ var RichTextEditorLinkControl = (0, vue.defineComponent)({
739
947
  type: Boolean,
740
948
  default: false
741
949
  },
742
- icon: {
743
- type: [Object, Function],
744
- default: void 0
745
- },
746
- classNames: {
747
- type: [Object, Function],
748
- default: void 0
749
- },
750
- styles: {
751
- type: [Object, Function],
752
- default: void 0
753
- },
754
- vars: {
755
- type: [Object, Function],
756
- default: void 0
757
- }
950
+ icon: { default: void 0 }
758
951
  },
759
- setup(rawProps, { attrs }) {
760
- const props = (0, _mantine_vue_core.useProps)("RichTextEditorLinkControl", null, rawProps);
952
+ setup(__props) {
953
+ const props = __props;
954
+ const attrs = (0, vue.useAttrs)();
761
955
  const ctx = useRichTextEditorContext();
762
956
  const url = (0, vue.ref)("");
763
957
  const external = (0, vue.ref)(props.initialExternal);
764
958
  const [opened, handlers] = (0, _mantine_vue_hooks.useDisclosure)(false);
765
- const handleOpen = () => {
959
+ const stylesApiProps = (0, vue.computed)(() => ({
960
+ classNames: props.classNames,
961
+ styles: props.styles
962
+ }));
963
+ const active = useEditorSelector(() => ctx.editor, (editor) => isSafeEditor(editor) ? editor.isActive("link") : false);
964
+ function open() {
766
965
  handlers.open();
767
- const linkData = ctx.editor?.getAttributes("link");
768
- url.value = linkData?.href || "";
769
- external.value = linkData?.href ? linkData?.target === "_blank" : !!props.initialExternal;
770
- };
771
- const handleClose = () => {
966
+ const link = isSafeEditor(ctx.editor) ? ctx.editor.getAttributes("link") : void 0;
967
+ url.value = link?.href || "";
968
+ external.value = link?.href ? link.target === "_blank" : props.initialExternal;
969
+ }
970
+ function close() {
772
971
  handlers.close();
773
972
  url.value = "";
774
- external.value = !!props.initialExternal;
775
- };
776
- const setLink = () => {
777
- handleClose();
778
- if (url.value === "") ctx.editor?.chain().focus().extendMarkRange("link").unsetLink().run();
779
- else ctx.editor?.chain().focus().extendMarkRange("link").setLink({
973
+ external.value = props.initialExternal;
974
+ }
975
+ function setLink() {
976
+ close();
977
+ if (!isSafeEditor(ctx.editor)) return;
978
+ if (url.value === "") ctx.editor.chain().focus().extendMarkRange("link").unsetLink().run();
979
+ else ctx.editor.chain().focus().extendMarkRange("link").setLink({
780
980
  href: url.value,
781
981
  target: external.value ? "_blank" : null
782
982
  }).run();
783
- };
784
- (0, _mantine_vue_hooks.useWindowEvent)("edit-link", handleOpen);
785
- return () => {
786
- const stylesApiProps = {
787
- classNames: props.classNames,
788
- styles: props.styles
789
- };
790
- const active = ctx.editor && !ctx.editor.isDestroyed ? ctx.editor.isActive("link") : false;
791
- return (0, vue.h)(_mantine_vue_core.Popover, {
792
- trapFocus: true,
983
+ }
984
+ function onKeydown(event) {
985
+ if (event.key === "Enter") {
986
+ event.preventDefault();
987
+ setLink();
988
+ }
989
+ }
990
+ function onPopoverChange(nextOpened) {
991
+ if (!nextOpened) close();
992
+ }
993
+ (0, vue.onMounted)(() => window.addEventListener("edit-link", open));
994
+ (0, vue.onBeforeUnmount)(() => window.removeEventListener("edit-link", open));
995
+ return (_ctx, _cache) => {
996
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Popover), (0, vue.mergeProps)({
997
+ "trap-focus": true,
793
998
  shadow: "md",
794
- withinPortal: true,
795
- opened: opened.value,
796
- onChange: (nextOpened) => !nextOpened && handleClose(),
999
+ "within-portal": true,
1000
+ opened: (0, vue.unref)(opened),
797
1001
  offset: -44,
798
- zIndex: 1e4,
799
- ...props.popoverProps
800
- }, { default: () => [(0, vue.h)(_mantine_vue_core.Popover.Target, null, () => (0, vue.h)(RichTextEditorControlBase, {
801
- ...attrs,
802
- icon: props.icon || IconLink,
803
- "aria-label": ctx.labels.linkControlLabel,
804
- title: ctx.labels.linkControlLabel,
805
- onClick: handleOpen,
806
- active,
807
- classNames: props.classNames,
808
- styles: props.styles,
809
- variant: ctx.variant
810
- })), (0, vue.h)(_mantine_vue_core.Popover.Dropdown, ctx.getStyles("linkEditorDropdown", stylesApiProps), () => (0, vue.h)("div", ctx.getStyles("linkEditor", stylesApiProps), [(0, vue.h)(_mantine_vue_core.TextInput, {
811
- placeholder: ctx.labels.linkEditorInputPlaceholder,
812
- "aria-label": ctx.labels.linkEditorInputLabel,
813
- type: "url",
814
- value: url.value,
815
- onInput: (event) => {
816
- url.value = event.currentTarget.value;
817
- },
818
- classNames: { input: ctx.getStyles("linkEditorInput", stylesApiProps).class },
819
- onKeydown: (event) => {
820
- if (event.key === "Enter") {
821
- event.preventDefault();
822
- setLink();
823
- }
824
- },
825
- rightSection: () => (0, vue.h)(_mantine_vue_core.Tooltip, {
826
- label: external.value ? ctx.labels.linkEditorExternalLink : ctx.labels.linkEditorInternalLink,
827
- events: {
828
- hover: true,
829
- focus: true,
830
- touch: true
831
- },
832
- withinPortal: true,
833
- withArrow: true,
834
- disabled: props.disableTooltips,
835
- zIndex: 1e4
836
- }, () => (0, vue.h)(_mantine_vue_core.UnstyledButton, {
837
- onClick: () => {
838
- external.value = !external.value;
839
- },
840
- "data-active": external.value || void 0,
841
- ...ctx.getStyles("linkEditorExternalControl", stylesApiProps)
842
- }, () => (0, vue.h)(IconExternalLink, { style: {
843
- width: (0, _mantine_vue_core.rem)(14),
844
- height: (0, _mantine_vue_core.rem)(14)
845
- } })))
846
- }), (0, vue.h)(_mantine_vue_core.Button, {
847
- variant: "default",
848
- onClick: setLink,
849
- ...ctx.getStyles("linkEditorSave", stylesApiProps)
850
- }, () => ctx.labels.linkEditorSave)]))] });
1002
+ "z-index": 1e4
1003
+ }, props.popoverProps, { onChange: onPopoverChange }), {
1004
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Popover).Target, null, {
1005
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)(RichTextEditorControlBase_default, (0, vue.mergeProps)((0, vue.unref)(attrs), {
1006
+ "aria-label": (0, vue.unref)(ctx).labels.linkControlLabel,
1007
+ title: (0, vue.unref)(ctx).labels.linkControlLabel,
1008
+ active: (0, vue.unref)(active),
1009
+ "class-names": props.classNames,
1010
+ styles: props.styles,
1011
+ variant: (0, vue.unref)(ctx).variant,
1012
+ onClick: open
1013
+ }), {
1014
+ icon: (0, vue.withCtx)((iconProps) => [(0, vue.renderSlot)(_ctx.$slots, "icon", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps)), () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(props.icon || (0, vue.unref)(IconLink)), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(iconProps)), null, 16))])]),
1015
+ _: 3
1016
+ }, 16, [
1017
+ "aria-label",
1018
+ "title",
1019
+ "active",
1020
+ "class-names",
1021
+ "styles",
1022
+ "variant"
1023
+ ])]),
1024
+ _: 3
1025
+ }), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Popover).Dropdown, (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(ctx).getStyles("linkEditorDropdown", stylesApiProps.value))), {
1026
+ default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", (0, vue.normalizeProps)((0, vue.guardReactiveProps)((0, vue.unref)(ctx).getStyles("linkEditor", stylesApiProps.value))), [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.TextInput), {
1027
+ modelValue: url.value,
1028
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => url.value = $event),
1029
+ placeholder: (0, vue.unref)(ctx).labels.linkEditorInputPlaceholder,
1030
+ "aria-label": (0, vue.unref)(ctx).labels.linkEditorInputLabel,
1031
+ type: "url",
1032
+ "class-names": { input: (0, vue.unref)(ctx).getStyles("linkEditorInput", stylesApiProps.value).class },
1033
+ onKeydown
1034
+ }, {
1035
+ rightSection: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Tooltip), {
1036
+ label: external.value ? (0, vue.unref)(ctx).labels.linkEditorExternalLink : (0, vue.unref)(ctx).labels.linkEditorInternalLink,
1037
+ events: {
1038
+ hover: true,
1039
+ focus: true,
1040
+ touch: true
1041
+ },
1042
+ "within-portal": true,
1043
+ "with-arrow": true,
1044
+ disabled: props.disableTooltips,
1045
+ "z-index": 1e4
1046
+ }, {
1047
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.UnstyledButton), (0, vue.mergeProps)({ "data-active": external.value || void 0 }, (0, vue.unref)(ctx).getStyles("linkEditorExternalControl", stylesApiProps.value), { onClick: _cache[0] || (_cache[0] = ($event) => external.value = !external.value) }), {
1048
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(IconExternalLink), { style: (0, vue.normalizeStyle)({
1049
+ width: (0, vue.unref)(_mantine_vue_core.rem)(14),
1050
+ height: (0, vue.unref)(_mantine_vue_core.rem)(14)
1051
+ }) }, null, 8, ["style"])]),
1052
+ _: 1
1053
+ }, 16, ["data-active"])]),
1054
+ _: 1
1055
+ }, 8, ["label", "disabled"])]),
1056
+ _: 1
1057
+ }, 8, [
1058
+ "modelValue",
1059
+ "placeholder",
1060
+ "aria-label",
1061
+ "class-names"
1062
+ ]), (0, vue.createVNode)((0, vue.unref)(_mantine_vue_core.Button), (0, vue.mergeProps)({ variant: "default" }, (0, vue.unref)(ctx).getStyles("linkEditorSave", stylesApiProps.value), { onClick: setLink }), {
1063
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(ctx).labels.linkEditorSave), 1)]),
1064
+ _: 1
1065
+ }, 16)], 16)]),
1066
+ _: 1
1067
+ }, 16)]),
1068
+ _: 3
1069
+ }, 16, ["opened"]);
851
1070
  };
852
1071
  }
853
1072
  });
854
- Object.assign(RichTextEditorLinkControl, { classes: RichTextEditor_module_default });
855
1073
  //#endregion
856
- //#region src/RichTextEditorControl/RichTextEditorSourceCodeControl.ts
857
- var RichTextEditorSourceCodeControl = (0, vue.defineComponent)({
1074
+ //#region src/RichTextEditorControl/RichTextEditorLinkControl.ts
1075
+ var RichTextEditorLinkControl = (0, _mantine_vue_core.factory)(RichTextEditorLinkControl_default, { classes: RichTextEditor_module_default });
1076
+ //#endregion
1077
+ //#region src/RichTextEditorControl/RichTextEditorSourceCodeControl.vue
1078
+ var RichTextEditorSourceCodeControl_default = /* @__PURE__ */ (0, vue.defineComponent)({
858
1079
  name: "RichTextEditorSourceCodeControl",
859
1080
  inheritAttrs: false,
860
- setup(rawProps, { attrs }) {
861
- (0, _mantine_vue_core.useProps)("RichTextEditorSourceCodeControl", {}, rawProps);
1081
+ __name: "RichTextEditorSourceCodeControl",
1082
+ setup(__props) {
1083
+ const attrs = (0, vue.useAttrs)();
862
1084
  const ctx = useRichTextEditorContext();
863
- const isSourceCodeModeActive = (0, vue.ref)(false);
864
- const handleStateChange = () => {
865
- if (isSourceCodeModeActive.value) ctx.editor?.commands.setContent(ctx.editor.getText(), { emitUpdate: true });
866
- else ctx.editor?.commands.setContent(`<textarea>${ctx.editor.getHTML()}</textarea>`);
867
- isSourceCodeModeActive.value = !isSourceCodeModeActive.value;
868
- ctx.onSourceCodeTextSwitch?.(isSourceCodeModeActive.value);
1085
+ const active = (0, vue.ref)(false);
1086
+ function toggleSourceCode() {
1087
+ if (!isSafeEditor(ctx.editor)) return;
1088
+ if (active.value) ctx.editor.commands.setContent(ctx.editor.getText(), { emitUpdate: true });
1089
+ else ctx.editor.commands.setContent(`<textarea>${ctx.editor.getHTML()}</textarea>`);
1090
+ active.value = !active.value;
1091
+ ctx.onSourceCodeTextSwitch?.(active.value);
1092
+ }
1093
+ return (_ctx, _cache) => {
1094
+ return (0, vue.openBlock)(), (0, vue.createBlock)(RichTextEditorControl_default, (0, vue.mergeProps)((0, vue.unref)(attrs), {
1095
+ variant: (0, vue.unref)(ctx).variant,
1096
+ active: active.value,
1097
+ "aria-label": (0, vue.unref)(ctx).labels.sourceCodeControlLabel,
1098
+ title: (0, vue.unref)(ctx).labels.sourceCodeControlLabel,
1099
+ onClick: toggleSourceCode
1100
+ }), {
1101
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(IconBraces), { style: (0, vue.normalizeStyle)({
1102
+ width: (0, vue.unref)(_mantine_vue_core.rem)(16),
1103
+ height: (0, vue.unref)(_mantine_vue_core.rem)(16)
1104
+ }) }, null, 8, ["style"])]),
1105
+ _: 1
1106
+ }, 16, [
1107
+ "variant",
1108
+ "active",
1109
+ "aria-label",
1110
+ "title"
1111
+ ]);
869
1112
  };
870
- return () => (0, vue.h)(RichTextEditorControl, {
871
- ...attrs,
872
- variant: ctx.variant,
873
- active: isSourceCodeModeActive.value,
874
- "aria-label": ctx.labels.sourceCodeControlLabel,
875
- title: ctx.labels.sourceCodeControlLabel,
876
- onClick: handleStateChange
877
- }, () => (0, vue.h)(IconBraces, { style: {
878
- width: (0, _mantine_vue_core.rem)(16),
879
- height: (0, _mantine_vue_core.rem)(16)
880
- } }));
881
1113
  }
882
1114
  });
883
1115
  //#endregion
1116
+ //#region src/RichTextEditorControl/RichTextEditorSourceCodeControl.ts
1117
+ var RichTextEditorSourceCodeControl = (0, _mantine_vue_core.factory)(RichTextEditorSourceCodeControl_default, { classes: RichTextEditor_module_default });
1118
+ //#endregion
884
1119
  //#region src/RichTextEditorControl/controls.ts
885
1120
  var BoldControl = createControl({
886
1121
  label: "boldControlLabel",
@@ -1115,32 +1350,27 @@ var TaskListLiftControl = createControl({
1115
1350
  isDisabled: (editor) => !editor?.can().liftListItem("taskItem")
1116
1351
  });
1117
1352
  //#endregion
1118
- //#region src/RichTextEditorControlsGroup/RichTextEditorControlsGroup.ts
1119
- var RichTextEditorControlsGroup = (0, vue.defineComponent)({
1353
+ //#region src/RichTextEditorControlsGroup/RichTextEditorControlsGroup.vue
1354
+ var RichTextEditorControlsGroup_default = /* @__PURE__ */ (0, vue.defineComponent)({
1120
1355
  name: "RichTextEditorControlsGroup",
1121
1356
  inheritAttrs: false,
1357
+ __name: "RichTextEditorControlsGroup",
1122
1358
  props: {
1123
- variant: {
1124
- type: String,
1125
- default: void 0
1126
- },
1127
- classNames: {
1128
- type: [Object, Function],
1129
- default: void 0
1130
- },
1131
- styles: {
1132
- type: [Object, Function],
1359
+ classNames: { default: void 0 },
1360
+ styles: { default: void 0 },
1361
+ vars: { default: void 0 },
1362
+ unstyled: {
1363
+ type: Boolean,
1133
1364
  default: void 0
1134
1365
  },
1135
- vars: {
1136
- type: [Object, Function],
1137
- default: void 0
1138
- }
1366
+ variant: { default: void 0 }
1139
1367
  },
1140
- setup(rawProps, { attrs, slots }) {
1368
+ setup(__props) {
1369
+ const rawProps = __props;
1370
+ const attrs = (0, vue.useAttrs)();
1141
1371
  const props = (0, _mantine_vue_core.useProps)("RichTextEditorControlsGroup", null, rawProps);
1142
1372
  const ctx = useRichTextEditorContext();
1143
- return () => (0, vue.h)(_mantine_vue_core.Box, {
1373
+ const rootProps = (0, vue.computed)(() => ({
1144
1374
  ...attrs,
1145
1375
  variant: props.variant || ctx.variant,
1146
1376
  ...ctx.getStyles("controlsGroup", {
@@ -1149,49 +1379,46 @@ var RichTextEditorControlsGroup = (0, vue.defineComponent)({
1149
1379
  styles: props.styles,
1150
1380
  classNames: props.classNames
1151
1381
  })
1152
- }, slots);
1382
+ }));
1383
+ return (_ctx, _cache) => {
1384
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(rootProps.value)), {
1385
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
1386
+ _: 3
1387
+ }, 16);
1388
+ };
1153
1389
  }
1154
1390
  });
1155
- Object.assign(RichTextEditorControlsGroup, { classes: RichTextEditor_module_default });
1156
1391
  //#endregion
1157
- //#region src/RichTextEditorToolbar/RichTextEditorToolbar.ts
1158
- var RichTextEditorToolbar = (0, vue.defineComponent)({
1392
+ //#region src/RichTextEditorControlsGroup/RichTextEditorControlsGroup.ts
1393
+ var RichTextEditorControlsGroup = (0, _mantine_vue_core.factory)(RichTextEditorControlsGroup_default, { classes: RichTextEditor_module_default });
1394
+ //#endregion
1395
+ //#region src/RichTextEditorToolbar/RichTextEditorToolbar.vue
1396
+ var RichTextEditorToolbar_default = /* @__PURE__ */ (0, vue.defineComponent)({
1159
1397
  name: "RichTextEditorToolbar",
1160
1398
  inheritAttrs: false,
1399
+ __name: "RichTextEditorToolbar",
1161
1400
  props: {
1162
- sticky: {
1401
+ classNames: { default: void 0 },
1402
+ styles: { default: void 0 },
1403
+ vars: { default: void 0 },
1404
+ unstyled: {
1163
1405
  type: Boolean,
1164
- default: false
1165
- },
1166
- stickyOffset: {
1167
- type: [String, Number],
1168
- default: void 0
1169
- },
1170
- variant: {
1171
- type: String,
1172
1406
  default: void 0
1173
1407
  },
1174
- classNames: {
1175
- type: [Object, Function],
1176
- default: void 0
1177
- },
1178
- styles: {
1179
- type: [Object, Function],
1180
- default: void 0
1181
- },
1182
- vars: {
1183
- type: [Object, Function],
1184
- default: void 0
1408
+ sticky: {
1409
+ type: Boolean,
1410
+ default: false
1185
1411
  },
1186
- mod: {
1187
- type: [Object, Array],
1188
- default: void 0
1189
- }
1412
+ stickyOffset: { default: void 0 },
1413
+ mod: { default: void 0 },
1414
+ variant: { default: void 0 }
1190
1415
  },
1191
- setup(rawProps, { attrs, slots }) {
1416
+ setup(__props) {
1417
+ const rawProps = __props;
1418
+ const attrs = (0, vue.useAttrs)();
1192
1419
  const props = (0, _mantine_vue_core.useProps)("RichTextEditorToolbar", null, rawProps);
1193
1420
  const ctx = useRichTextEditorContext();
1194
- return () => (0, vue.h)(_mantine_vue_core.Box, {
1421
+ const rootProps = (0, vue.computed)(() => ({
1195
1422
  ...attrs,
1196
1423
  mod: [{ sticky: props.sticky }, props.mod],
1197
1424
  variant: props.variant || ctx.variant,
@@ -1201,110 +1428,21 @@ var RichTextEditorToolbar = (0, vue.defineComponent)({
1201
1428
  styles: props.styles,
1202
1429
  classNames: props.classNames
1203
1430
  })
1204
- }, slots);
1431
+ }));
1432
+ return (_ctx, _cache) => {
1433
+ return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_mantine_vue_core.Box), (0, vue.normalizeProps)((0, vue.guardReactiveProps)(rootProps.value)), {
1434
+ default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
1435
+ _: 3
1436
+ }, 16);
1437
+ };
1205
1438
  }
1206
1439
  });
1207
- Object.assign(RichTextEditorToolbar, { classes: RichTextEditor_module_default });
1440
+ //#endregion
1441
+ //#region src/RichTextEditorToolbar/RichTextEditorToolbar.ts
1442
+ var RichTextEditorToolbar = (0, _mantine_vue_core.factory)(RichTextEditorToolbar_default, { classes: RichTextEditor_module_default });
1208
1443
  //#endregion
1209
1444
  //#region src/RichTextEditor.ts
1210
- var defaultProps = {
1211
- withCodeHighlightStyles: true,
1212
- withTypographyStyles: true,
1213
- variant: "default"
1214
- };
1215
- var RichTextEditorBase = (0, vue.defineComponent)({
1216
- name: "RichTextEditor",
1217
- inheritAttrs: false,
1218
- props: {
1219
- editor: {
1220
- type: Object,
1221
- default: null
1222
- },
1223
- withCodeHighlightStyles: {
1224
- type: Boolean,
1225
- default: void 0
1226
- },
1227
- withTypographyStyles: {
1228
- type: Boolean,
1229
- default: void 0
1230
- },
1231
- onSourceCodeTextSwitch: {
1232
- type: Function,
1233
- default: void 0
1234
- },
1235
- labels: {
1236
- type: Object,
1237
- default: void 0
1238
- },
1239
- variant: {
1240
- type: String,
1241
- default: void 0
1242
- },
1243
- classNames: {
1244
- type: [Object, Function],
1245
- default: void 0
1246
- },
1247
- styles: {
1248
- type: [Object, Function],
1249
- default: void 0
1250
- },
1251
- vars: {
1252
- type: [Object, Function],
1253
- default: void 0
1254
- },
1255
- unstyled: {
1256
- type: Boolean,
1257
- default: false
1258
- }
1259
- },
1260
- setup(rawProps, { attrs, slots }) {
1261
- const props = (0, _mantine_vue_core.useProps)("RichTextEditor", defaultProps, rawProps);
1262
- const getStyles = (0, _mantine_vue_core.useStyles)({
1263
- name: "RichTextEditor",
1264
- classes: RichTextEditor_module_default,
1265
- props,
1266
- className: attrs.class,
1267
- style: attrs.style,
1268
- classNames: props.classNames,
1269
- styles: props.styles,
1270
- vars: props.vars,
1271
- unstyled: props.unstyled
1272
- });
1273
- const mergedLabels = (0, vue.computed)(() => ({
1274
- ...DEFAULT_LABELS,
1275
- ...props.labels
1276
- }));
1277
- provideRichTextEditorContext({
1278
- get editor() {
1279
- return props.editor;
1280
- },
1281
- getStyles,
1282
- get labels() {
1283
- return mergedLabels.value;
1284
- },
1285
- get withCodeHighlightStyles() {
1286
- return props.withCodeHighlightStyles;
1287
- },
1288
- get withTypographyStyles() {
1289
- return props.withTypographyStyles;
1290
- },
1291
- get onSourceCodeTextSwitch() {
1292
- return props.onSourceCodeTextSwitch;
1293
- },
1294
- get unstyled() {
1295
- return props.unstyled;
1296
- },
1297
- get variant() {
1298
- return props.variant;
1299
- }
1300
- });
1301
- return () => (0, vue.h)(_mantine_vue_core.Box, {
1302
- ...attrs,
1303
- ...getStyles("root")
1304
- }, slots);
1305
- }
1306
- });
1307
- var RichTextEditor = Object.assign(RichTextEditorBase, {
1445
+ var RichTextEditor = (0, _mantine_vue_core.factory)(RichTextEditor_default, {
1308
1446
  classes: RichTextEditor_module_default,
1309
1447
  Content: RichTextEditorContent,
1310
1448
  Control: RichTextEditorControl,
@@ -1407,7 +1545,6 @@ exports.UnlinkControl = UnlinkControl;
1407
1545
  exports.UnsetColorControl = UnsetColorControl;
1408
1546
  exports.createControl = createControl;
1409
1547
  exports.getTaskListExtension = getTaskListExtension;
1410
- exports.renderControlIcon = renderControlIcon;
1411
1548
  exports.useRichTextEditorContext = useRichTextEditorContext;
1412
1549
 
1413
1550
  //# sourceMappingURL=index.cjs.map