@tailor-cms/ce-html-edit 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ type __VLS_Props = {
2
+ editor: any;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: (import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-subscript").SubscriptExtensionOptions, any>)[];
1
+ declare const _default: (import("@tiptap/core").Mark<any, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>)[];
2
2
  export default _default;
@@ -0,0 +1,14 @@
1
+ import { Mark } from '@tiptap/vue-3';
2
+ declare module '@tiptap/vue-3' {
3
+ interface Commands<ReturnType> {
4
+ tooltip: {
5
+ setTooltip: (attributes: {
6
+ tooltip?: string;
7
+ text?: string;
8
+ }) => ReturnType;
9
+ unsetTooltip: () => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ declare const _default: Mark<any, any>;
14
+ export default _default;
package/dist/index.cjs CHANGED
@@ -26198,12 +26198,50 @@ const Paragraph = Paragraph$1.extend({
26198
26198
  ];
26199
26199
  }
26200
26200
  });
26201
+ const Tooltip = Mark2.create({
26202
+ name: "tooltip",
26203
+ addAttributes() {
26204
+ return {
26205
+ "data-tooltip": {
26206
+ default: null,
26207
+ parseHTML: (element) => element.getAttribute("data-tooltip"),
26208
+ renderHTML: (attributes) => ({
26209
+ "data-tooltip": attributes["data-tooltip"]
26210
+ })
26211
+ }
26212
+ };
26213
+ },
26214
+ parseHTML() {
26215
+ return [{ tag: "span[data-tooltip]" }];
26216
+ },
26217
+ renderHTML({ HTMLAttributes }) {
26218
+ return [
26219
+ "span",
26220
+ mergeAttributes({ class: "has-tooltip" }, HTMLAttributes),
26221
+ 0
26222
+ ];
26223
+ },
26224
+ addCommands() {
26225
+ return {
26226
+ setTooltip: ({ tooltip, text } = {}) => ({ chain }) => {
26227
+ return chain().setMark(this.name, { "data-tooltip": tooltip }).command(({ tr: tr2 }) => {
26228
+ tr2.insertText(text);
26229
+ return true;
26230
+ }).run();
26231
+ },
26232
+ unsetTooltip: () => ({ chain }) => {
26233
+ return chain().unsetMark(this.name).run();
26234
+ }
26235
+ };
26236
+ }
26237
+ });
26201
26238
  const extensions = [
26202
26239
  Color,
26203
26240
  FontFamily$1,
26204
26241
  FontSize$1,
26205
26242
  Image,
26206
26243
  Link.configure({ openOnClick: false }),
26244
+ Tooltip,
26207
26245
  StarterKit.configure({ paragraph: false }),
26208
26246
  Subscript,
26209
26247
  Superscript,
@@ -26223,7 +26261,7 @@ const extensions = [
26223
26261
  placeholder: "Enter your text..."
26224
26262
  })
26225
26263
  ];
26226
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
26264
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
26227
26265
  __name: "IconButton",
26228
26266
  props: {
26229
26267
  active: { type: Boolean },
@@ -26268,8 +26306,8 @@ const _export_sfc = (sfc, props) => {
26268
26306
  }
26269
26307
  return target;
26270
26308
  };
26271
- const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5f000959"]]);
26272
- const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
26309
+ const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5f000959"]]);
26310
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
26273
26311
  __name: "ImageMenu",
26274
26312
  props: {
26275
26313
  editor: {}
@@ -26324,8 +26362,8 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
26324
26362
  };
26325
26363
  }
26326
26364
  });
26327
- const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-cb530515"]]);
26328
- const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
26365
+ const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cb530515"]]);
26366
+ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
26329
26367
  __name: "TableMenu",
26330
26368
  props: {
26331
26369
  editor: {}
@@ -26424,10 +26462,10 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
26424
26462
  };
26425
26463
  }
26426
26464
  });
26427
- const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-e73020ec"]]);
26428
- const _hoisted_1$3 = { class: "tce-container" };
26465
+ const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-e73020ec"]]);
26466
+ const _hoisted_1$4 = { class: "tce-container" };
26429
26467
  const SAVE_DEBOUNCE = 3e3;
26430
- const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
26468
+ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
26431
26469
  __name: "Edit",
26432
26470
  props: {
26433
26471
  element: {},
@@ -26471,7 +26509,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
26471
26509
  }
26472
26510
  );
26473
26511
  return (_ctx, _cache) => {
26474
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
26512
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
26475
26513
  vue.unref(editor) ? (vue.openBlock(), vue.createBlock(ImageMenu, {
26476
26514
  key: 0,
26477
26515
  editor: vue.unref(editor)
@@ -26488,7 +26526,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
26488
26526
  };
26489
26527
  }
26490
26528
  });
26491
- const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e677fca4"]]);
26529
+ const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-c46e1fb5"]]);
26492
26530
  function getDefaultExportFromCjs(x) {
26493
26531
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
26494
26532
  }
@@ -26888,8 +26926,8 @@ function requireIsURL() {
26888
26926
  }
26889
26927
  var isURLExports = /* @__PURE__ */ requireIsURL();
26890
26928
  const isURL = /* @__PURE__ */ getDefaultExportFromCjs(isURLExports);
26891
- const _hoisted_1$2 = { class: "actions d-flex justify-end" };
26892
- const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
26929
+ const _hoisted_1$3 = { class: "actions d-flex justify-end" };
26930
+ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
26893
26931
  __name: "AddImage",
26894
26932
  props: {
26895
26933
  editor: {}
@@ -26996,7 +27034,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
26996
27034
  label: "Url",
26997
27035
  variant: "outlined"
26998
27036
  }, null, 8, ["modelValue", "rules"]),
26999
- vue.createElementVNode("div", _hoisted_1$2, [
27037
+ vue.createElementVNode("div", _hoisted_1$3, [
27000
27038
  vue.createVNode(_component_VBtn, {
27001
27039
  color: "primary",
27002
27040
  type: "submit",
@@ -27021,9 +27059,9 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
27021
27059
  };
27022
27060
  }
27023
27061
  });
27024
- const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8e6263e8"]]);
27025
- const _hoisted_1$1 = { class: "actions d-flex justify-end" };
27026
- const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27062
+ const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-8e6263e8"]]);
27063
+ const _hoisted_1$2 = { class: "actions d-flex justify-end" };
27064
+ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
27027
27065
  __name: "AddLink",
27028
27066
  props: {
27029
27067
  editor: {}
@@ -27095,7 +27133,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27095
27133
  default: vue.withCtx(() => [
27096
27134
  vue.createVNode(_component_VIcon, { size: "24" }, {
27097
27135
  default: vue.withCtx(() => _cache[3] || (_cache[3] = [
27098
- vue.createTextVNode("mdi-link")
27136
+ vue.createTextVNode("mdi-link-variant-plus")
27099
27137
  ])),
27100
27138
  _: 1,
27101
27139
  __: [3]
@@ -27143,11 +27181,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27143
27181
  label: "Url",
27144
27182
  variant: "outlined"
27145
27183
  }, null, 8, ["modelValue", "rules"]),
27146
- vue.createElementVNode("div", _hoisted_1$1, [
27184
+ vue.createElementVNode("div", _hoisted_1$2, [
27147
27185
  _ctx.editor.isActive("link") ? (vue.openBlock(), vue.createBlock(_component_VBtn, {
27148
27186
  key: 0,
27149
27187
  class: "mr-2",
27150
- variant: "plain",
27188
+ color: "primary-darken-3",
27189
+ variant: "text",
27151
27190
  onClick: unlink
27152
27191
  }, {
27153
27192
  default: vue.withCtx(() => _cache[5] || (_cache[5] = [
@@ -27157,12 +27196,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27157
27196
  __: [5]
27158
27197
  })) : vue.createCommentVNode("", true),
27159
27198
  vue.createVNode(_component_VBtn, {
27160
- color: "primary",
27199
+ color: "primary-darken-3",
27161
27200
  type: "submit",
27162
27201
  variant: "tonal"
27163
27202
  }, {
27164
27203
  default: vue.withCtx(() => _cache[6] || (_cache[6] = [
27165
- vue.createTextVNode("Confirm")
27204
+ vue.createTextVNode(" Confirm ")
27166
27205
  ])),
27167
27206
  _: 1,
27168
27207
  __: [6]
@@ -27180,11 +27219,11 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27180
27219
  };
27181
27220
  }
27182
27221
  });
27183
- const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-148650fc"]]);
27184
- const _hoisted_1 = { class: "text-body-2" };
27222
+ const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8c3b7b32"]]);
27223
+ const _hoisted_1$1 = { class: "text-body-2" };
27185
27224
  const INIT_SIZE = 5;
27186
27225
  const MAX_SIZE = 10;
27187
- const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
27226
+ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
27188
27227
  __name: "AddTable",
27189
27228
  props: {
27190
27229
  editor: {}
@@ -27294,7 +27333,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
27294
27333
  }), 128))
27295
27334
  ]);
27296
27335
  }), 128)),
27297
- vue.createElementVNode("span", _hoisted_1, vue.toDisplayString(selectedSize.rows) + "x" + vue.toDisplayString(selectedSize.cols), 1)
27336
+ vue.createElementVNode("span", _hoisted_1$1, vue.toDisplayString(selectedSize.rows) + "x" + vue.toDisplayString(selectedSize.cols), 1)
27298
27337
  ]),
27299
27338
  _: 1
27300
27339
  })
@@ -27304,7 +27343,161 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
27304
27343
  };
27305
27344
  }
27306
27345
  });
27307
- const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-86386e2b"]]);
27346
+ const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-86386e2b"]]);
27347
+ const _hoisted_1 = { class: "actions d-flex justify-end" };
27348
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
27349
+ __name: "AddTooltip",
27350
+ props: {
27351
+ editor: {}
27352
+ },
27353
+ setup(__props) {
27354
+ const rules = {
27355
+ required: (val) => !!val || "The field is required"
27356
+ };
27357
+ const props = __props;
27358
+ const form = vue.ref();
27359
+ const getText2 = () => {
27360
+ const { view, state } = props.editor;
27361
+ const { from: from2, to } = view.state.selection;
27362
+ return state.doc.textBetween(from2, to, " ");
27363
+ };
27364
+ const tooltip = vue.ref("");
27365
+ const text = vue.ref("");
27366
+ const show = vue.ref(false);
27367
+ function unset() {
27368
+ props.editor.chain().focus().unsetTooltip().run();
27369
+ tooltip.value = "";
27370
+ show.value = false;
27371
+ }
27372
+ async function setTooltip() {
27373
+ const { valid } = await form.value.validate();
27374
+ if (!valid) return;
27375
+ if (tooltip.value) {
27376
+ const attributes = { tooltip: tooltip.value, text: text.value };
27377
+ console.log("Setting tooltip with attributes:", attributes);
27378
+ props.editor.chain().focus().setTooltip(attributes).run();
27379
+ } else props.editor.chain().focus().unsetTooltip().run();
27380
+ show.value = false;
27381
+ form.value.resetValidation();
27382
+ }
27383
+ vue.watch(show, (val) => {
27384
+ if (!val) return;
27385
+ tooltip.value = props.editor.getAttributes("tooltip")["data-tooltip"] ?? "";
27386
+ text.value = getText2() ?? "";
27387
+ form.value?.resetValidation();
27388
+ });
27389
+ return (_ctx, _cache) => {
27390
+ const _component_VIcon = vue.resolveComponent("VIcon");
27391
+ const _component_VBtn = vue.resolveComponent("VBtn");
27392
+ const _component_VTooltip = vue.resolveComponent("VTooltip");
27393
+ const _component_VTextField = vue.resolveComponent("VTextField");
27394
+ const _component_VSheet = vue.resolveComponent("VSheet");
27395
+ const _component_VForm = vue.resolveComponent("VForm");
27396
+ const _component_VMenu = vue.resolveComponent("VMenu");
27397
+ return vue.openBlock(), vue.createBlock(_component_VMenu, {
27398
+ modelValue: show.value,
27399
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => show.value = $event),
27400
+ "close-on-content-click": false
27401
+ }, {
27402
+ activator: vue.withCtx(({ props: menu }) => [
27403
+ vue.createVNode(_component_VTooltip, { location: "bottom" }, {
27404
+ activator: vue.withCtx(({ props: tooltipProps }) => [
27405
+ vue.createVNode(_component_VBtn, vue.mergeProps({
27406
+ active: _ctx.editor.isActive("tooltip"),
27407
+ disabled: !_ctx.editor.can().chain().focus().setTooltip().run(),
27408
+ "aria-label": "Add tooltip",
27409
+ rounded: "lg",
27410
+ size: "32"
27411
+ }, vue.mergeProps(menu, tooltipProps)), {
27412
+ default: vue.withCtx(() => [
27413
+ vue.createVNode(_component_VIcon, { size: "24" }, {
27414
+ default: vue.withCtx(() => _cache[3] || (_cache[3] = [
27415
+ vue.createTextVNode("mdi-tooltip-text")
27416
+ ])),
27417
+ _: 1,
27418
+ __: [3]
27419
+ })
27420
+ ]),
27421
+ _: 2
27422
+ }, 1040, ["active", "disabled"])
27423
+ ]),
27424
+ default: vue.withCtx(() => [
27425
+ _cache[4] || (_cache[4] = vue.createTextVNode(" Add tooltip "))
27426
+ ]),
27427
+ _: 2,
27428
+ __: [4]
27429
+ }, 1024)
27430
+ ]),
27431
+ default: vue.withCtx(() => [
27432
+ vue.createVNode(_component_VForm, {
27433
+ ref_key: "form",
27434
+ ref: form,
27435
+ onSubmit: vue.withModifiers(setTooltip, ["prevent"])
27436
+ }, {
27437
+ default: vue.withCtx(() => [
27438
+ vue.createVNode(_component_VSheet, {
27439
+ class: "pa-3",
27440
+ elevation: "8",
27441
+ width: "240",
27442
+ rounded: ""
27443
+ }, {
27444
+ default: vue.withCtx(() => [
27445
+ vue.createVNode(_component_VTextField, {
27446
+ modelValue: text.value,
27447
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
27448
+ rules: [rules.required],
27449
+ density: "compact",
27450
+ "hide-details": "auto",
27451
+ label: "Text",
27452
+ variant: "outlined"
27453
+ }, null, 8, ["modelValue", "rules"]),
27454
+ vue.createVNode(_component_VTextField, {
27455
+ modelValue: tooltip.value,
27456
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tooltip.value = $event),
27457
+ rules: [rules.required],
27458
+ density: "compact",
27459
+ "hide-details": "auto",
27460
+ label: "Tooltip",
27461
+ variant: "outlined"
27462
+ }, null, 8, ["modelValue", "rules"]),
27463
+ vue.createElementVNode("div", _hoisted_1, [
27464
+ _ctx.editor.isActive("tooltip") ? (vue.openBlock(), vue.createBlock(_component_VBtn, {
27465
+ key: 0,
27466
+ class: "mr-2",
27467
+ variant: "plain",
27468
+ onClick: unset
27469
+ }, {
27470
+ default: vue.withCtx(() => _cache[5] || (_cache[5] = [
27471
+ vue.createTextVNode(" Remove ")
27472
+ ])),
27473
+ _: 1,
27474
+ __: [5]
27475
+ })) : vue.createCommentVNode("", true),
27476
+ vue.createVNode(_component_VBtn, {
27477
+ color: "primary",
27478
+ type: "submit",
27479
+ variant: "tonal"
27480
+ }, {
27481
+ default: vue.withCtx(() => _cache[6] || (_cache[6] = [
27482
+ vue.createTextVNode("Confirm")
27483
+ ])),
27484
+ _: 1,
27485
+ __: [6]
27486
+ })
27487
+ ])
27488
+ ]),
27489
+ _: 1
27490
+ })
27491
+ ]),
27492
+ _: 1
27493
+ }, 512)
27494
+ ]),
27495
+ _: 1
27496
+ }, 8, ["modelValue"]);
27497
+ };
27498
+ }
27499
+ });
27500
+ const AddTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-9f5b7855"]]);
27308
27501
  const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
27309
27502
  __name: "FontFamily",
27310
27503
  props: {
@@ -27999,6 +28192,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
27999
28192
  { component: AddLink },
28000
28193
  { component: AddTable },
28001
28194
  { component: AddImage },
28195
+ { component: AddTooltip },
28002
28196
  {
28003
28197
  label: "Horizontal line",
28004
28198
  action: ["setHorizontalRule"],
@@ -28112,7 +28306,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
28112
28306
  };
28113
28307
  }
28114
28308
  });
28115
- const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b4ffaa29"]]);
28309
+ const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-62e3d651"]]);
28116
28310
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28117
28311
  __name: "TopToolbar",
28118
28312
  props: {
package/dist/index.css CHANGED
@@ -11,93 +11,93 @@
11
11
  }
12
12
  [data-v-e73020ec] .v-btn.v-btn--active {
13
13
  color: rgba(var(--v-theme-primary));
14
- }.tce-container[data-v-e677fca4] {
14
+ }.tce-container[data-v-c46e1fb5] {
15
15
  text-align: left;
16
16
  }
17
- [data-v-e677fca4] .ProseMirror {
17
+ [data-v-c46e1fb5] .ProseMirror {
18
18
  min-height: 5rem;
19
19
  padding: 0.5rem;
20
20
  font-family: Arial, Helvetica, sans-serif;
21
21
  font-size: 1rem;
22
22
  outline: none;
23
23
  }
24
- [data-v-e677fca4] .ProseMirror p.is-editor-empty:first-child::before {
24
+ [data-v-c46e1fb5] .ProseMirror p.is-editor-empty:first-child::before {
25
25
  content: attr(data-placeholder);
26
26
  height: 0;
27
27
  opacity: 0.5;
28
28
  float: left;
29
29
  pointer-events: none;
30
30
  }
31
- [data-v-e677fca4] .ProseMirror > * + * {
31
+ [data-v-c46e1fb5] .ProseMirror > * + * {
32
32
  margin-top: 0.75em;
33
33
  }
34
- [data-v-e677fca4] .ProseMirror h1,[data-v-e677fca4] .ProseMirror h2,[data-v-e677fca4] .ProseMirror h3,[data-v-e677fca4] .ProseMirror h4,[data-v-e677fca4] .ProseMirror h5,[data-v-e677fca4] .ProseMirror h6 {
34
+ [data-v-c46e1fb5] .ProseMirror h1,[data-v-c46e1fb5] .ProseMirror h2,[data-v-c46e1fb5] .ProseMirror h3,[data-v-c46e1fb5] .ProseMirror h4,[data-v-c46e1fb5] .ProseMirror h5,[data-v-c46e1fb5] .ProseMirror h6 {
35
35
  line-height: 1.1;
36
36
  }
37
- [data-v-e677fca4] .ProseMirror h1 {
37
+ [data-v-c46e1fb5] .ProseMirror h1 {
38
38
  font-size: 2.5rem;
39
39
  }
40
- [data-v-e677fca4] .ProseMirror h2 {
40
+ [data-v-c46e1fb5] .ProseMirror h2 {
41
41
  font-size: 2.25rem;
42
42
  }
43
- [data-v-e677fca4] .ProseMirror h3 {
43
+ [data-v-c46e1fb5] .ProseMirror h3 {
44
44
  font-size: 2rem;
45
45
  }
46
- [data-v-e677fca4] .ProseMirror h4 {
46
+ [data-v-c46e1fb5] .ProseMirror h4 {
47
47
  font-size: 1.75rem;
48
48
  }
49
- [data-v-e677fca4] .ProseMirror h5 {
49
+ [data-v-c46e1fb5] .ProseMirror h5 {
50
50
  font-size: 1.5rem;
51
51
  }
52
- [data-v-e677fca4] .ProseMirror h6 {
52
+ [data-v-c46e1fb5] .ProseMirror h6 {
53
53
  font-size: 1.25rem;
54
54
  }
55
- [data-v-e677fca4] .ProseMirror blockquote {
55
+ [data-v-c46e1fb5] .ProseMirror blockquote {
56
56
  padding: 0.25rem 1rem;
57
57
  border-left: 2px solid rgba(13, 13, 13, 0.1);
58
58
  font-family: Georgia, "Times New Roman", Times, serif;
59
59
  font-style: italic;
60
60
  }
61
- [data-v-e677fca4] .ProseMirror ul,[data-v-e677fca4] .ProseMirror ol {
61
+ [data-v-c46e1fb5] .ProseMirror ul,[data-v-c46e1fb5] .ProseMirror ol {
62
62
  padding: 0 1.25rem;
63
63
  }
64
- [data-v-e677fca4] .ProseMirror code {
64
+ [data-v-c46e1fb5] .ProseMirror code {
65
65
  font-family: "Source Code Pro", monospace !important;
66
66
  background: #eee;
67
67
  padding: 0.125rem 0.5rem;
68
68
  border-radius: 8px;
69
69
  }
70
- [data-v-e677fca4] .ProseMirror pre {
70
+ [data-v-c46e1fb5] .ProseMirror pre {
71
71
  padding: 0.5rem 1rem;
72
72
  border-radius: 8px;
73
73
  background: #eee;
74
74
  white-space: pre-wrap;
75
75
  }
76
- [data-v-e677fca4] .ProseMirror pre code {
76
+ [data-v-c46e1fb5] .ProseMirror pre code {
77
77
  padding: 0;
78
78
  font-size: 0.875rem;
79
79
  background: none;
80
80
  }
81
- [data-v-e677fca4] .ProseMirror img {
81
+ [data-v-c46e1fb5] .ProseMirror img {
82
82
  max-width: 100%;
83
83
  height: auto;
84
84
  }
85
- [data-v-e677fca4] .ProseMirror img.ProseMirror-selectednode {
85
+ [data-v-c46e1fb5] .ProseMirror img.ProseMirror-selectednode {
86
86
  outline: 2px solid #68cef8;
87
87
  }
88
- [data-v-e677fca4] .ProseMirror hr {
88
+ [data-v-c46e1fb5] .ProseMirror hr {
89
89
  border: none;
90
90
  border-top: 2px solid rgba(13, 13, 13, 0.1);
91
91
  margin: 2rem 0;
92
92
  }
93
- [data-v-e677fca4] .ProseMirror table {
93
+ [data-v-c46e1fb5] .ProseMirror table {
94
94
  border-collapse: collapse;
95
95
  table-layout: fixed;
96
96
  width: 100%;
97
97
  margin: 0;
98
98
  overflow: hidden;
99
99
  }
100
- [data-v-e677fca4] .ProseMirror table td,[data-v-e677fca4] .ProseMirror table th {
100
+ [data-v-c46e1fb5] .ProseMirror table td,[data-v-c46e1fb5] .ProseMirror table th {
101
101
  min-width: 1em;
102
102
  border: 2px solid #ced4da;
103
103
  padding: 3px 5px;
@@ -105,15 +105,15 @@
105
105
  box-sizing: border-box;
106
106
  position: relative;
107
107
  }
108
- [data-v-e677fca4] .ProseMirror table td > *,[data-v-e677fca4] .ProseMirror table th > * {
108
+ [data-v-c46e1fb5] .ProseMirror table td > *,[data-v-c46e1fb5] .ProseMirror table th > * {
109
109
  margin-bottom: 0;
110
110
  }
111
- [data-v-e677fca4] .ProseMirror table th {
111
+ [data-v-c46e1fb5] .ProseMirror table th {
112
112
  font-weight: bold;
113
113
  text-align: left;
114
114
  background-color: #f1f3f5;
115
115
  }
116
- [data-v-e677fca4] .ProseMirror table .selectedCell:after {
116
+ [data-v-c46e1fb5] .ProseMirror table .selectedCell:after {
117
117
  z-index: 2;
118
118
  position: absolute;
119
119
  content: "";
@@ -124,7 +124,7 @@
124
124
  background: rgba(200, 200, 255, 0.4);
125
125
  pointer-events: none;
126
126
  }
127
- [data-v-e677fca4] .ProseMirror table .column-resize-handle {
127
+ [data-v-c46e1fb5] .ProseMirror table .column-resize-handle {
128
128
  position: absolute;
129
129
  right: -2px;
130
130
  top: 0;
@@ -133,13 +133,53 @@
133
133
  background-color: #adf;
134
134
  pointer-events: none;
135
135
  }
136
- [data-v-e677fca4] .ProseMirror table p {
136
+ [data-v-c46e1fb5] .ProseMirror table p {
137
137
  margin: 0;
138
+ }
139
+ [data-v-c46e1fb5] .has-tooltip {
140
+ position: relative;
141
+ display: inline-block;
142
+ background: rgba(205, 215, 220, 0.7);
143
+ text-decoration: underline dashed rgba(33, 33, 33, 0.8);
144
+ cursor: help;
145
+ }
146
+ [data-v-c46e1fb5] .has-tooltip::before {
147
+ content: "";
148
+ position: absolute;
149
+ bottom: 100%;
150
+ border-left: 6px solid transparent;
151
+ border-right: 6px solid transparent;
152
+ border-top: 6px solid rgba(33, 33, 33, 0.8);
153
+ }
154
+ [data-v-c46e1fb5] .has-tooltip::after {
155
+ content: attr(data-tooltip);
156
+ position: absolute;
157
+ bottom: calc(100% + 6px);
158
+ left: -0.625rem;
159
+ border-radius: 4px;
160
+ max-width: 14rem;
161
+ padding: 0.375rem 0.675rem;
162
+ background: rgba(33, 33, 33, 0.8);
163
+ font-size: 0.875rem;
164
+ color: #fff;
165
+ font-weight: normal;
166
+ width: max-content;
167
+ }
168
+ [data-v-c46e1fb5] .has-tooltip::before,[data-v-c46e1fb5] .has-tooltip::after {
169
+ text-decoration: none;
170
+ visibility: hidden;
171
+ opacity: 0;
172
+ transition: all 0.3s ease-out;
173
+ }
174
+ [data-v-c46e1fb5] .has-tooltip:hover::after,[data-v-c46e1fb5] .has-tooltip:hover::before {
175
+ visibility: visible;
176
+ opacity: 1;
177
+ margin-bottom: 0.25rem;
138
178
  }.v-sheet[data-v-8e6263e8] {
139
179
  display: flex;
140
180
  flex-direction: column;
141
181
  gap: 0.75rem;
142
- }.v-sheet[data-v-148650fc] {
182
+ }.v-sheet[data-v-8c3b7b32] {
143
183
  display: flex;
144
184
  flex-direction: column;
145
185
  gap: 0.75rem;
@@ -148,6 +188,10 @@
148
188
  }
149
189
  .v-input--density-compact[data-v-86386e2b] {
150
190
  --v-input-control-height: unset;
191
+ }.v-sheet[data-v-9f5b7855] {
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: 0.75rem;
151
195
  }.v-list-item + .v-list-item[data-v-13c3b0cc] {
152
196
  margin-top: 0.125rem;
153
197
  }.v-list-item + .v-list-item[data-v-70882e8a] {
@@ -181,14 +225,14 @@
181
225
  border: 1px solid #dadce0;
182
226
  }.v-list-item + .v-list-item[data-v-eb5927ce] {
183
227
  margin-top: 0.125rem;
184
- }.v-btn-group[data-v-b4ffaa29] {
228
+ }.v-btn-group[data-v-62e3d651] {
185
229
  display: flex;
186
230
  flex-wrap: wrap;
187
231
  height: unset;
188
232
  }
189
- [data-v-b4ffaa29] .v-btn + .v-btn {
233
+ [data-v-62e3d651] .v-btn + .v-btn {
190
234
  margin-left: 0.125rem;
191
235
  }
192
- [data-v-b4ffaa29] .v-btn.v-btn--active {
236
+ [data-v-62e3d651] .v-btn.v-btn--active {
193
237
  color: rgba(var(--v-theme-primary));
194
238
  }
package/dist/index.js CHANGED
@@ -26196,12 +26196,50 @@ const Paragraph = Paragraph$1.extend({
26196
26196
  ];
26197
26197
  }
26198
26198
  });
26199
+ const Tooltip = Mark2.create({
26200
+ name: "tooltip",
26201
+ addAttributes() {
26202
+ return {
26203
+ "data-tooltip": {
26204
+ default: null,
26205
+ parseHTML: (element) => element.getAttribute("data-tooltip"),
26206
+ renderHTML: (attributes) => ({
26207
+ "data-tooltip": attributes["data-tooltip"]
26208
+ })
26209
+ }
26210
+ };
26211
+ },
26212
+ parseHTML() {
26213
+ return [{ tag: "span[data-tooltip]" }];
26214
+ },
26215
+ renderHTML({ HTMLAttributes }) {
26216
+ return [
26217
+ "span",
26218
+ mergeAttributes({ class: "has-tooltip" }, HTMLAttributes),
26219
+ 0
26220
+ ];
26221
+ },
26222
+ addCommands() {
26223
+ return {
26224
+ setTooltip: ({ tooltip, text } = {}) => ({ chain }) => {
26225
+ return chain().setMark(this.name, { "data-tooltip": tooltip }).command(({ tr: tr2 }) => {
26226
+ tr2.insertText(text);
26227
+ return true;
26228
+ }).run();
26229
+ },
26230
+ unsetTooltip: () => ({ chain }) => {
26231
+ return chain().unsetMark(this.name).run();
26232
+ }
26233
+ };
26234
+ }
26235
+ });
26199
26236
  const extensions = [
26200
26237
  Color,
26201
26238
  FontFamily$1,
26202
26239
  FontSize$1,
26203
26240
  Image,
26204
26241
  Link.configure({ openOnClick: false }),
26242
+ Tooltip,
26205
26243
  StarterKit.configure({ paragraph: false }),
26206
26244
  Subscript,
26207
26245
  Superscript,
@@ -26221,7 +26259,7 @@ const extensions = [
26221
26259
  placeholder: "Enter your text..."
26222
26260
  })
26223
26261
  ];
26224
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
26262
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
26225
26263
  __name: "IconButton",
26226
26264
  props: {
26227
26265
  active: { type: Boolean },
@@ -26266,8 +26304,8 @@ const _export_sfc = (sfc, props) => {
26266
26304
  }
26267
26305
  return target;
26268
26306
  };
26269
- const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5f000959"]]);
26270
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
26307
+ const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5f000959"]]);
26308
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
26271
26309
  __name: "ImageMenu",
26272
26310
  props: {
26273
26311
  editor: {}
@@ -26322,8 +26360,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
26322
26360
  };
26323
26361
  }
26324
26362
  });
26325
- const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-cb530515"]]);
26326
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
26363
+ const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cb530515"]]);
26364
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
26327
26365
  __name: "TableMenu",
26328
26366
  props: {
26329
26367
  editor: {}
@@ -26422,10 +26460,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
26422
26460
  };
26423
26461
  }
26424
26462
  });
26425
- const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-e73020ec"]]);
26426
- const _hoisted_1$3 = { class: "tce-container" };
26463
+ const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-e73020ec"]]);
26464
+ const _hoisted_1$4 = { class: "tce-container" };
26427
26465
  const SAVE_DEBOUNCE = 3e3;
26428
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
26466
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
26429
26467
  __name: "Edit",
26430
26468
  props: {
26431
26469
  element: {},
@@ -26469,7 +26507,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
26469
26507
  }
26470
26508
  );
26471
26509
  return (_ctx, _cache) => {
26472
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
26510
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
26473
26511
  unref(editor) ? (openBlock(), createBlock(ImageMenu, {
26474
26512
  key: 0,
26475
26513
  editor: unref(editor)
@@ -26486,7 +26524,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
26486
26524
  };
26487
26525
  }
26488
26526
  });
26489
- const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-e677fca4"]]);
26527
+ const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-c46e1fb5"]]);
26490
26528
  function getDefaultExportFromCjs(x) {
26491
26529
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
26492
26530
  }
@@ -26886,8 +26924,8 @@ function requireIsURL() {
26886
26924
  }
26887
26925
  var isURLExports = /* @__PURE__ */ requireIsURL();
26888
26926
  const isURL = /* @__PURE__ */ getDefaultExportFromCjs(isURLExports);
26889
- const _hoisted_1$2 = { class: "actions d-flex justify-end" };
26890
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
26927
+ const _hoisted_1$3 = { class: "actions d-flex justify-end" };
26928
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
26891
26929
  __name: "AddImage",
26892
26930
  props: {
26893
26931
  editor: {}
@@ -26994,7 +27032,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
26994
27032
  label: "Url",
26995
27033
  variant: "outlined"
26996
27034
  }, null, 8, ["modelValue", "rules"]),
26997
- createElementVNode("div", _hoisted_1$2, [
27035
+ createElementVNode("div", _hoisted_1$3, [
26998
27036
  createVNode(_component_VBtn, {
26999
27037
  color: "primary",
27000
27038
  type: "submit",
@@ -27019,9 +27057,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
27019
27057
  };
27020
27058
  }
27021
27059
  });
27022
- const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8e6263e8"]]);
27023
- const _hoisted_1$1 = { class: "actions d-flex justify-end" };
27024
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
27060
+ const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-8e6263e8"]]);
27061
+ const _hoisted_1$2 = { class: "actions d-flex justify-end" };
27062
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
27025
27063
  __name: "AddLink",
27026
27064
  props: {
27027
27065
  editor: {}
@@ -27093,7 +27131,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
27093
27131
  default: withCtx(() => [
27094
27132
  createVNode(_component_VIcon, { size: "24" }, {
27095
27133
  default: withCtx(() => _cache[3] || (_cache[3] = [
27096
- createTextVNode("mdi-link")
27134
+ createTextVNode("mdi-link-variant-plus")
27097
27135
  ])),
27098
27136
  _: 1,
27099
27137
  __: [3]
@@ -27141,11 +27179,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
27141
27179
  label: "Url",
27142
27180
  variant: "outlined"
27143
27181
  }, null, 8, ["modelValue", "rules"]),
27144
- createElementVNode("div", _hoisted_1$1, [
27182
+ createElementVNode("div", _hoisted_1$2, [
27145
27183
  _ctx.editor.isActive("link") ? (openBlock(), createBlock(_component_VBtn, {
27146
27184
  key: 0,
27147
27185
  class: "mr-2",
27148
- variant: "plain",
27186
+ color: "primary-darken-3",
27187
+ variant: "text",
27149
27188
  onClick: unlink
27150
27189
  }, {
27151
27190
  default: withCtx(() => _cache[5] || (_cache[5] = [
@@ -27155,12 +27194,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
27155
27194
  __: [5]
27156
27195
  })) : createCommentVNode("", true),
27157
27196
  createVNode(_component_VBtn, {
27158
- color: "primary",
27197
+ color: "primary-darken-3",
27159
27198
  type: "submit",
27160
27199
  variant: "tonal"
27161
27200
  }, {
27162
27201
  default: withCtx(() => _cache[6] || (_cache[6] = [
27163
- createTextVNode("Confirm")
27202
+ createTextVNode(" Confirm ")
27164
27203
  ])),
27165
27204
  _: 1,
27166
27205
  __: [6]
@@ -27178,11 +27217,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
27178
27217
  };
27179
27218
  }
27180
27219
  });
27181
- const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-148650fc"]]);
27182
- const _hoisted_1 = { class: "text-body-2" };
27220
+ const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8c3b7b32"]]);
27221
+ const _hoisted_1$1 = { class: "text-body-2" };
27183
27222
  const INIT_SIZE = 5;
27184
27223
  const MAX_SIZE = 10;
27185
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
27224
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
27186
27225
  __name: "AddTable",
27187
27226
  props: {
27188
27227
  editor: {}
@@ -27292,7 +27331,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
27292
27331
  }), 128))
27293
27332
  ]);
27294
27333
  }), 128)),
27295
- createElementVNode("span", _hoisted_1, toDisplayString(selectedSize.rows) + "x" + toDisplayString(selectedSize.cols), 1)
27334
+ createElementVNode("span", _hoisted_1$1, toDisplayString(selectedSize.rows) + "x" + toDisplayString(selectedSize.cols), 1)
27296
27335
  ]),
27297
27336
  _: 1
27298
27337
  })
@@ -27302,7 +27341,161 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
27302
27341
  };
27303
27342
  }
27304
27343
  });
27305
- const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-86386e2b"]]);
27344
+ const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-86386e2b"]]);
27345
+ const _hoisted_1 = { class: "actions d-flex justify-end" };
27346
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
27347
+ __name: "AddTooltip",
27348
+ props: {
27349
+ editor: {}
27350
+ },
27351
+ setup(__props) {
27352
+ const rules = {
27353
+ required: (val) => !!val || "The field is required"
27354
+ };
27355
+ const props = __props;
27356
+ const form = ref();
27357
+ const getText2 = () => {
27358
+ const { view, state } = props.editor;
27359
+ const { from: from2, to } = view.state.selection;
27360
+ return state.doc.textBetween(from2, to, " ");
27361
+ };
27362
+ const tooltip = ref("");
27363
+ const text = ref("");
27364
+ const show = ref(false);
27365
+ function unset() {
27366
+ props.editor.chain().focus().unsetTooltip().run();
27367
+ tooltip.value = "";
27368
+ show.value = false;
27369
+ }
27370
+ async function setTooltip() {
27371
+ const { valid } = await form.value.validate();
27372
+ if (!valid) return;
27373
+ if (tooltip.value) {
27374
+ const attributes = { tooltip: tooltip.value, text: text.value };
27375
+ console.log("Setting tooltip with attributes:", attributes);
27376
+ props.editor.chain().focus().setTooltip(attributes).run();
27377
+ } else props.editor.chain().focus().unsetTooltip().run();
27378
+ show.value = false;
27379
+ form.value.resetValidation();
27380
+ }
27381
+ watch(show, (val) => {
27382
+ if (!val) return;
27383
+ tooltip.value = props.editor.getAttributes("tooltip")["data-tooltip"] ?? "";
27384
+ text.value = getText2() ?? "";
27385
+ form.value?.resetValidation();
27386
+ });
27387
+ return (_ctx, _cache) => {
27388
+ const _component_VIcon = resolveComponent("VIcon");
27389
+ const _component_VBtn = resolveComponent("VBtn");
27390
+ const _component_VTooltip = resolveComponent("VTooltip");
27391
+ const _component_VTextField = resolveComponent("VTextField");
27392
+ const _component_VSheet = resolveComponent("VSheet");
27393
+ const _component_VForm = resolveComponent("VForm");
27394
+ const _component_VMenu = resolveComponent("VMenu");
27395
+ return openBlock(), createBlock(_component_VMenu, {
27396
+ modelValue: show.value,
27397
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => show.value = $event),
27398
+ "close-on-content-click": false
27399
+ }, {
27400
+ activator: withCtx(({ props: menu }) => [
27401
+ createVNode(_component_VTooltip, { location: "bottom" }, {
27402
+ activator: withCtx(({ props: tooltipProps }) => [
27403
+ createVNode(_component_VBtn, mergeProps({
27404
+ active: _ctx.editor.isActive("tooltip"),
27405
+ disabled: !_ctx.editor.can().chain().focus().setTooltip().run(),
27406
+ "aria-label": "Add tooltip",
27407
+ rounded: "lg",
27408
+ size: "32"
27409
+ }, mergeProps(menu, tooltipProps)), {
27410
+ default: withCtx(() => [
27411
+ createVNode(_component_VIcon, { size: "24" }, {
27412
+ default: withCtx(() => _cache[3] || (_cache[3] = [
27413
+ createTextVNode("mdi-tooltip-text")
27414
+ ])),
27415
+ _: 1,
27416
+ __: [3]
27417
+ })
27418
+ ]),
27419
+ _: 2
27420
+ }, 1040, ["active", "disabled"])
27421
+ ]),
27422
+ default: withCtx(() => [
27423
+ _cache[4] || (_cache[4] = createTextVNode(" Add tooltip "))
27424
+ ]),
27425
+ _: 2,
27426
+ __: [4]
27427
+ }, 1024)
27428
+ ]),
27429
+ default: withCtx(() => [
27430
+ createVNode(_component_VForm, {
27431
+ ref_key: "form",
27432
+ ref: form,
27433
+ onSubmit: withModifiers(setTooltip, ["prevent"])
27434
+ }, {
27435
+ default: withCtx(() => [
27436
+ createVNode(_component_VSheet, {
27437
+ class: "pa-3",
27438
+ elevation: "8",
27439
+ width: "240",
27440
+ rounded: ""
27441
+ }, {
27442
+ default: withCtx(() => [
27443
+ createVNode(_component_VTextField, {
27444
+ modelValue: text.value,
27445
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => text.value = $event),
27446
+ rules: [rules.required],
27447
+ density: "compact",
27448
+ "hide-details": "auto",
27449
+ label: "Text",
27450
+ variant: "outlined"
27451
+ }, null, 8, ["modelValue", "rules"]),
27452
+ createVNode(_component_VTextField, {
27453
+ modelValue: tooltip.value,
27454
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tooltip.value = $event),
27455
+ rules: [rules.required],
27456
+ density: "compact",
27457
+ "hide-details": "auto",
27458
+ label: "Tooltip",
27459
+ variant: "outlined"
27460
+ }, null, 8, ["modelValue", "rules"]),
27461
+ createElementVNode("div", _hoisted_1, [
27462
+ _ctx.editor.isActive("tooltip") ? (openBlock(), createBlock(_component_VBtn, {
27463
+ key: 0,
27464
+ class: "mr-2",
27465
+ variant: "plain",
27466
+ onClick: unset
27467
+ }, {
27468
+ default: withCtx(() => _cache[5] || (_cache[5] = [
27469
+ createTextVNode(" Remove ")
27470
+ ])),
27471
+ _: 1,
27472
+ __: [5]
27473
+ })) : createCommentVNode("", true),
27474
+ createVNode(_component_VBtn, {
27475
+ color: "primary",
27476
+ type: "submit",
27477
+ variant: "tonal"
27478
+ }, {
27479
+ default: withCtx(() => _cache[6] || (_cache[6] = [
27480
+ createTextVNode("Confirm")
27481
+ ])),
27482
+ _: 1,
27483
+ __: [6]
27484
+ })
27485
+ ])
27486
+ ]),
27487
+ _: 1
27488
+ })
27489
+ ]),
27490
+ _: 1
27491
+ }, 512)
27492
+ ]),
27493
+ _: 1
27494
+ }, 8, ["modelValue"]);
27495
+ };
27496
+ }
27497
+ });
27498
+ const AddTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-9f5b7855"]]);
27306
27499
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
27307
27500
  __name: "FontFamily",
27308
27501
  props: {
@@ -27997,6 +28190,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
27997
28190
  { component: AddLink },
27998
28191
  { component: AddTable },
27999
28192
  { component: AddImage },
28193
+ { component: AddTooltip },
28000
28194
  {
28001
28195
  label: "Horizontal line",
28002
28196
  action: ["setHorizontalRule"],
@@ -28110,7 +28304,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28110
28304
  };
28111
28305
  }
28112
28306
  });
28113
- const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-b4ffaa29"]]);
28307
+ const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-62e3d651"]]);
28114
28308
  const _sfc_main = /* @__PURE__ */ defineComponent({
28115
28309
  __name: "TopToolbar",
28116
28310
  props: {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Tailor CMS HTML editor authoring component",
4
4
  "author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
5
5
  "type": "module",
6
- "version": "0.1.1",
6
+ "version": "0.1.2",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "typescript": "^5.8.3",
27
27
  "vite": "^7.0.3",
28
28
  "vue-tsc": "^3.0.1",
29
- "@tailor-cms/ce-html-manifest": "0.1.1"
29
+ "@tailor-cms/ce-html-manifest": "0.1.2"
30
30
  },
31
31
  "dependencies": {
32
32
  "@tiptap/extension-color": "^2.25.0",