@tailor-cms/ce-html-edit 0.1.0 → 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.
- package/dist/components/actions/AddTooltip.vue.d.ts +5 -0
- package/dist/components/extensions/index.d.ts +1 -1
- package/dist/components/extensions/tooltip.d.ts +14 -0
- package/dist/index.cjs +223 -28
- package/dist/index.css +74 -30
- package/dist/index.js +223 -28
- package/package.json +2 -2
|
@@ -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").
|
|
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
|
@@ -30,7 +30,8 @@ var ai = {
|
|
|
30
30
|
Generate rich text for a page as an object with the following
|
|
31
31
|
properties: { "content": "" }
|
|
32
32
|
where:
|
|
33
|
-
- 'content' is the text of the page in HTML format.
|
|
33
|
+
- 'content' is the text of the page in HTML format. Include only the text
|
|
34
|
+
content, without the full HTML page structure.
|
|
34
35
|
`,
|
|
35
36
|
processResponse: (val) => val
|
|
36
37
|
};
|
|
@@ -26197,12 +26198,50 @@ const Paragraph = Paragraph$1.extend({
|
|
|
26197
26198
|
];
|
|
26198
26199
|
}
|
|
26199
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
|
+
});
|
|
26200
26238
|
const extensions = [
|
|
26201
26239
|
Color,
|
|
26202
26240
|
FontFamily$1,
|
|
26203
26241
|
FontSize$1,
|
|
26204
26242
|
Image,
|
|
26205
26243
|
Link.configure({ openOnClick: false }),
|
|
26244
|
+
Tooltip,
|
|
26206
26245
|
StarterKit.configure({ paragraph: false }),
|
|
26207
26246
|
Subscript,
|
|
26208
26247
|
Superscript,
|
|
@@ -26222,7 +26261,7 @@ const extensions = [
|
|
|
26222
26261
|
placeholder: "Enter your text..."
|
|
26223
26262
|
})
|
|
26224
26263
|
];
|
|
26225
|
-
const _sfc_main$
|
|
26264
|
+
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
26226
26265
|
__name: "IconButton",
|
|
26227
26266
|
props: {
|
|
26228
26267
|
active: { type: Boolean },
|
|
@@ -26267,8 +26306,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
26267
26306
|
}
|
|
26268
26307
|
return target;
|
|
26269
26308
|
};
|
|
26270
|
-
const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26271
|
-
const _sfc_main$
|
|
26309
|
+
const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5f000959"]]);
|
|
26310
|
+
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
26272
26311
|
__name: "ImageMenu",
|
|
26273
26312
|
props: {
|
|
26274
26313
|
editor: {}
|
|
@@ -26323,8 +26362,8 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
26323
26362
|
};
|
|
26324
26363
|
}
|
|
26325
26364
|
});
|
|
26326
|
-
const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26327
|
-
const _sfc_main$
|
|
26365
|
+
const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cb530515"]]);
|
|
26366
|
+
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
26328
26367
|
__name: "TableMenu",
|
|
26329
26368
|
props: {
|
|
26330
26369
|
editor: {}
|
|
@@ -26423,10 +26462,10 @@ const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
|
26423
26462
|
};
|
|
26424
26463
|
}
|
|
26425
26464
|
});
|
|
26426
|
-
const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26427
|
-
const _hoisted_1$
|
|
26465
|
+
const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-e73020ec"]]);
|
|
26466
|
+
const _hoisted_1$4 = { class: "tce-container" };
|
|
26428
26467
|
const SAVE_DEBOUNCE = 3e3;
|
|
26429
|
-
const _sfc_main$
|
|
26468
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
26430
26469
|
__name: "Edit",
|
|
26431
26470
|
props: {
|
|
26432
26471
|
element: {},
|
|
@@ -26470,7 +26509,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
26470
26509
|
}
|
|
26471
26510
|
);
|
|
26472
26511
|
return (_ctx, _cache) => {
|
|
26473
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
26512
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
26474
26513
|
vue.unref(editor) ? (vue.openBlock(), vue.createBlock(ImageMenu, {
|
|
26475
26514
|
key: 0,
|
|
26476
26515
|
editor: vue.unref(editor)
|
|
@@ -26487,7 +26526,7 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
26487
26526
|
};
|
|
26488
26527
|
}
|
|
26489
26528
|
});
|
|
26490
|
-
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26529
|
+
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-c46e1fb5"]]);
|
|
26491
26530
|
function getDefaultExportFromCjs(x) {
|
|
26492
26531
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
26493
26532
|
}
|
|
@@ -26887,8 +26926,8 @@ function requireIsURL() {
|
|
|
26887
26926
|
}
|
|
26888
26927
|
var isURLExports = /* @__PURE__ */ requireIsURL();
|
|
26889
26928
|
const isURL = /* @__PURE__ */ getDefaultExportFromCjs(isURLExports);
|
|
26890
|
-
const _hoisted_1$
|
|
26891
|
-
const _sfc_main$
|
|
26929
|
+
const _hoisted_1$3 = { class: "actions d-flex justify-end" };
|
|
26930
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
26892
26931
|
__name: "AddImage",
|
|
26893
26932
|
props: {
|
|
26894
26933
|
editor: {}
|
|
@@ -26995,7 +27034,7 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
26995
27034
|
label: "Url",
|
|
26996
27035
|
variant: "outlined"
|
|
26997
27036
|
}, null, 8, ["modelValue", "rules"]),
|
|
26998
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
27037
|
+
vue.createElementVNode("div", _hoisted_1$3, [
|
|
26999
27038
|
vue.createVNode(_component_VBtn, {
|
|
27000
27039
|
color: "primary",
|
|
27001
27040
|
type: "submit",
|
|
@@ -27020,9 +27059,9 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
|
27020
27059
|
};
|
|
27021
27060
|
}
|
|
27022
27061
|
});
|
|
27023
|
-
const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
27024
|
-
const _hoisted_1$
|
|
27025
|
-
const _sfc_main$
|
|
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({
|
|
27026
27065
|
__name: "AddLink",
|
|
27027
27066
|
props: {
|
|
27028
27067
|
editor: {}
|
|
@@ -27094,7 +27133,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
27094
27133
|
default: vue.withCtx(() => [
|
|
27095
27134
|
vue.createVNode(_component_VIcon, { size: "24" }, {
|
|
27096
27135
|
default: vue.withCtx(() => _cache[3] || (_cache[3] = [
|
|
27097
|
-
vue.createTextVNode("mdi-link")
|
|
27136
|
+
vue.createTextVNode("mdi-link-variant-plus")
|
|
27098
27137
|
])),
|
|
27099
27138
|
_: 1,
|
|
27100
27139
|
__: [3]
|
|
@@ -27142,11 +27181,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
27142
27181
|
label: "Url",
|
|
27143
27182
|
variant: "outlined"
|
|
27144
27183
|
}, null, 8, ["modelValue", "rules"]),
|
|
27145
|
-
vue.createElementVNode("div", _hoisted_1$
|
|
27184
|
+
vue.createElementVNode("div", _hoisted_1$2, [
|
|
27146
27185
|
_ctx.editor.isActive("link") ? (vue.openBlock(), vue.createBlock(_component_VBtn, {
|
|
27147
27186
|
key: 0,
|
|
27148
27187
|
class: "mr-2",
|
|
27149
|
-
|
|
27188
|
+
color: "primary-darken-3",
|
|
27189
|
+
variant: "text",
|
|
27150
27190
|
onClick: unlink
|
|
27151
27191
|
}, {
|
|
27152
27192
|
default: vue.withCtx(() => _cache[5] || (_cache[5] = [
|
|
@@ -27156,12 +27196,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
27156
27196
|
__: [5]
|
|
27157
27197
|
})) : vue.createCommentVNode("", true),
|
|
27158
27198
|
vue.createVNode(_component_VBtn, {
|
|
27159
|
-
color: "primary",
|
|
27199
|
+
color: "primary-darken-3",
|
|
27160
27200
|
type: "submit",
|
|
27161
27201
|
variant: "tonal"
|
|
27162
27202
|
}, {
|
|
27163
27203
|
default: vue.withCtx(() => _cache[6] || (_cache[6] = [
|
|
27164
|
-
vue.createTextVNode("Confirm")
|
|
27204
|
+
vue.createTextVNode(" Confirm ")
|
|
27165
27205
|
])),
|
|
27166
27206
|
_: 1,
|
|
27167
27207
|
__: [6]
|
|
@@ -27179,11 +27219,11 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
27179
27219
|
};
|
|
27180
27220
|
}
|
|
27181
27221
|
});
|
|
27182
|
-
const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
27183
|
-
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" };
|
|
27184
27224
|
const INIT_SIZE = 5;
|
|
27185
27225
|
const MAX_SIZE = 10;
|
|
27186
|
-
const _sfc_main$
|
|
27226
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
27187
27227
|
__name: "AddTable",
|
|
27188
27228
|
props: {
|
|
27189
27229
|
editor: {}
|
|
@@ -27293,7 +27333,7 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
27293
27333
|
}), 128))
|
|
27294
27334
|
]);
|
|
27295
27335
|
}), 128)),
|
|
27296
|
-
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)
|
|
27297
27337
|
]),
|
|
27298
27338
|
_: 1
|
|
27299
27339
|
})
|
|
@@ -27303,7 +27343,161 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
27303
27343
|
};
|
|
27304
27344
|
}
|
|
27305
27345
|
});
|
|
27306
|
-
const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
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"]]);
|
|
27307
27501
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
27308
27502
|
__name: "FontFamily",
|
|
27309
27503
|
props: {
|
|
@@ -27998,6 +28192,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
27998
28192
|
{ component: AddLink },
|
|
27999
28193
|
{ component: AddTable },
|
|
28000
28194
|
{ component: AddImage },
|
|
28195
|
+
{ component: AddTooltip },
|
|
28001
28196
|
{
|
|
28002
28197
|
label: "Horizontal line",
|
|
28003
28198
|
action: ["setHorizontalRule"],
|
|
@@ -28111,7 +28306,7 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
28111
28306
|
};
|
|
28112
28307
|
}
|
|
28113
28308
|
});
|
|
28114
|
-
const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
28309
|
+
const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-62e3d651"]]);
|
|
28115
28310
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
28116
28311
|
__name: "TopToolbar",
|
|
28117
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-
|
|
14
|
+
}.tce-container[data-v-c46e1fb5] {
|
|
15
15
|
text-align: left;
|
|
16
16
|
}
|
|
17
|
-
[data-v-
|
|
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-
|
|
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-
|
|
31
|
+
[data-v-c46e1fb5] .ProseMirror > * + * {
|
|
32
32
|
margin-top: 0.75em;
|
|
33
33
|
}
|
|
34
|
-
[data-v-
|
|
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-
|
|
37
|
+
[data-v-c46e1fb5] .ProseMirror h1 {
|
|
38
38
|
font-size: 2.5rem;
|
|
39
39
|
}
|
|
40
|
-
[data-v-
|
|
40
|
+
[data-v-c46e1fb5] .ProseMirror h2 {
|
|
41
41
|
font-size: 2.25rem;
|
|
42
42
|
}
|
|
43
|
-
[data-v-
|
|
43
|
+
[data-v-c46e1fb5] .ProseMirror h3 {
|
|
44
44
|
font-size: 2rem;
|
|
45
45
|
}
|
|
46
|
-
[data-v-
|
|
46
|
+
[data-v-c46e1fb5] .ProseMirror h4 {
|
|
47
47
|
font-size: 1.75rem;
|
|
48
48
|
}
|
|
49
|
-
[data-v-
|
|
49
|
+
[data-v-c46e1fb5] .ProseMirror h5 {
|
|
50
50
|
font-size: 1.5rem;
|
|
51
51
|
}
|
|
52
|
-
[data-v-
|
|
52
|
+
[data-v-c46e1fb5] .ProseMirror h6 {
|
|
53
53
|
font-size: 1.25rem;
|
|
54
54
|
}
|
|
55
|
-
[data-v-
|
|
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-
|
|
61
|
+
[data-v-c46e1fb5] .ProseMirror ul,[data-v-c46e1fb5] .ProseMirror ol {
|
|
62
62
|
padding: 0 1.25rem;
|
|
63
63
|
}
|
|
64
|
-
[data-v-
|
|
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-
|
|
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-
|
|
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-
|
|
81
|
+
[data-v-c46e1fb5] .ProseMirror img {
|
|
82
82
|
max-width: 100%;
|
|
83
83
|
height: auto;
|
|
84
84
|
}
|
|
85
|
-
[data-v-
|
|
85
|
+
[data-v-c46e1fb5] .ProseMirror img.ProseMirror-selectednode {
|
|
86
86
|
outline: 2px solid #68cef8;
|
|
87
87
|
}
|
|
88
|
-
[data-v-
|
|
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-
|
|
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-
|
|
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-
|
|
108
|
+
[data-v-c46e1fb5] .ProseMirror table td > *,[data-v-c46e1fb5] .ProseMirror table th > * {
|
|
109
109
|
margin-bottom: 0;
|
|
110
110
|
}
|
|
111
|
-
[data-v-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
233
|
+
[data-v-62e3d651] .v-btn + .v-btn {
|
|
190
234
|
margin-left: 0.125rem;
|
|
191
235
|
}
|
|
192
|
-
[data-v-
|
|
236
|
+
[data-v-62e3d651] .v-btn.v-btn--active {
|
|
193
237
|
color: rgba(var(--v-theme-primary));
|
|
194
238
|
}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,8 @@ var ai = {
|
|
|
28
28
|
Generate rich text for a page as an object with the following
|
|
29
29
|
properties: { "content": "" }
|
|
30
30
|
where:
|
|
31
|
-
- 'content' is the text of the page in HTML format.
|
|
31
|
+
- 'content' is the text of the page in HTML format. Include only the text
|
|
32
|
+
content, without the full HTML page structure.
|
|
32
33
|
`,
|
|
33
34
|
processResponse: (val) => val
|
|
34
35
|
};
|
|
@@ -26195,12 +26196,50 @@ const Paragraph = Paragraph$1.extend({
|
|
|
26195
26196
|
];
|
|
26196
26197
|
}
|
|
26197
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
|
+
});
|
|
26198
26236
|
const extensions = [
|
|
26199
26237
|
Color,
|
|
26200
26238
|
FontFamily$1,
|
|
26201
26239
|
FontSize$1,
|
|
26202
26240
|
Image,
|
|
26203
26241
|
Link.configure({ openOnClick: false }),
|
|
26242
|
+
Tooltip,
|
|
26204
26243
|
StarterKit.configure({ paragraph: false }),
|
|
26205
26244
|
Subscript,
|
|
26206
26245
|
Superscript,
|
|
@@ -26220,7 +26259,7 @@ const extensions = [
|
|
|
26220
26259
|
placeholder: "Enter your text..."
|
|
26221
26260
|
})
|
|
26222
26261
|
];
|
|
26223
|
-
const _sfc_main$
|
|
26262
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
26224
26263
|
__name: "IconButton",
|
|
26225
26264
|
props: {
|
|
26226
26265
|
active: { type: Boolean },
|
|
@@ -26265,8 +26304,8 @@ const _export_sfc = (sfc, props) => {
|
|
|
26265
26304
|
}
|
|
26266
26305
|
return target;
|
|
26267
26306
|
};
|
|
26268
|
-
const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26269
|
-
const _sfc_main$
|
|
26307
|
+
const IconButton = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-5f000959"]]);
|
|
26308
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
26270
26309
|
__name: "ImageMenu",
|
|
26271
26310
|
props: {
|
|
26272
26311
|
editor: {}
|
|
@@ -26321,8 +26360,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
26321
26360
|
};
|
|
26322
26361
|
}
|
|
26323
26362
|
});
|
|
26324
|
-
const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26325
|
-
const _sfc_main$
|
|
26363
|
+
const ImageMenu = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cb530515"]]);
|
|
26364
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
26326
26365
|
__name: "TableMenu",
|
|
26327
26366
|
props: {
|
|
26328
26367
|
editor: {}
|
|
@@ -26421,10 +26460,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
26421
26460
|
};
|
|
26422
26461
|
}
|
|
26423
26462
|
});
|
|
26424
|
-
const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26425
|
-
const _hoisted_1$
|
|
26463
|
+
const TableMenu = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-e73020ec"]]);
|
|
26464
|
+
const _hoisted_1$4 = { class: "tce-container" };
|
|
26426
26465
|
const SAVE_DEBOUNCE = 3e3;
|
|
26427
|
-
const _sfc_main$
|
|
26466
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
26428
26467
|
__name: "Edit",
|
|
26429
26468
|
props: {
|
|
26430
26469
|
element: {},
|
|
@@ -26468,7 +26507,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
26468
26507
|
}
|
|
26469
26508
|
);
|
|
26470
26509
|
return (_ctx, _cache) => {
|
|
26471
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
26510
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
26472
26511
|
unref(editor) ? (openBlock(), createBlock(ImageMenu, {
|
|
26473
26512
|
key: 0,
|
|
26474
26513
|
editor: unref(editor)
|
|
@@ -26485,7 +26524,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
26485
26524
|
};
|
|
26486
26525
|
}
|
|
26487
26526
|
});
|
|
26488
|
-
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
26527
|
+
const Edit = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-c46e1fb5"]]);
|
|
26489
26528
|
function getDefaultExportFromCjs(x) {
|
|
26490
26529
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
26491
26530
|
}
|
|
@@ -26885,8 +26924,8 @@ function requireIsURL() {
|
|
|
26885
26924
|
}
|
|
26886
26925
|
var isURLExports = /* @__PURE__ */ requireIsURL();
|
|
26887
26926
|
const isURL = /* @__PURE__ */ getDefaultExportFromCjs(isURLExports);
|
|
26888
|
-
const _hoisted_1$
|
|
26889
|
-
const _sfc_main$
|
|
26927
|
+
const _hoisted_1$3 = { class: "actions d-flex justify-end" };
|
|
26928
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
26890
26929
|
__name: "AddImage",
|
|
26891
26930
|
props: {
|
|
26892
26931
|
editor: {}
|
|
@@ -26993,7 +27032,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
26993
27032
|
label: "Url",
|
|
26994
27033
|
variant: "outlined"
|
|
26995
27034
|
}, null, 8, ["modelValue", "rules"]),
|
|
26996
|
-
createElementVNode("div", _hoisted_1$
|
|
27035
|
+
createElementVNode("div", _hoisted_1$3, [
|
|
26997
27036
|
createVNode(_component_VBtn, {
|
|
26998
27037
|
color: "primary",
|
|
26999
27038
|
type: "submit",
|
|
@@ -27018,9 +27057,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
27018
27057
|
};
|
|
27019
27058
|
}
|
|
27020
27059
|
});
|
|
27021
|
-
const AddImage = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
27022
|
-
const _hoisted_1$
|
|
27023
|
-
const _sfc_main$
|
|
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({
|
|
27024
27063
|
__name: "AddLink",
|
|
27025
27064
|
props: {
|
|
27026
27065
|
editor: {}
|
|
@@ -27092,7 +27131,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
27092
27131
|
default: withCtx(() => [
|
|
27093
27132
|
createVNode(_component_VIcon, { size: "24" }, {
|
|
27094
27133
|
default: withCtx(() => _cache[3] || (_cache[3] = [
|
|
27095
|
-
createTextVNode("mdi-link")
|
|
27134
|
+
createTextVNode("mdi-link-variant-plus")
|
|
27096
27135
|
])),
|
|
27097
27136
|
_: 1,
|
|
27098
27137
|
__: [3]
|
|
@@ -27140,11 +27179,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
27140
27179
|
label: "Url",
|
|
27141
27180
|
variant: "outlined"
|
|
27142
27181
|
}, null, 8, ["modelValue", "rules"]),
|
|
27143
|
-
createElementVNode("div", _hoisted_1$
|
|
27182
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
27144
27183
|
_ctx.editor.isActive("link") ? (openBlock(), createBlock(_component_VBtn, {
|
|
27145
27184
|
key: 0,
|
|
27146
27185
|
class: "mr-2",
|
|
27147
|
-
|
|
27186
|
+
color: "primary-darken-3",
|
|
27187
|
+
variant: "text",
|
|
27148
27188
|
onClick: unlink
|
|
27149
27189
|
}, {
|
|
27150
27190
|
default: withCtx(() => _cache[5] || (_cache[5] = [
|
|
@@ -27154,12 +27194,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
27154
27194
|
__: [5]
|
|
27155
27195
|
})) : createCommentVNode("", true),
|
|
27156
27196
|
createVNode(_component_VBtn, {
|
|
27157
|
-
color: "primary",
|
|
27197
|
+
color: "primary-darken-3",
|
|
27158
27198
|
type: "submit",
|
|
27159
27199
|
variant: "tonal"
|
|
27160
27200
|
}, {
|
|
27161
27201
|
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
27162
|
-
createTextVNode("Confirm")
|
|
27202
|
+
createTextVNode(" Confirm ")
|
|
27163
27203
|
])),
|
|
27164
27204
|
_: 1,
|
|
27165
27205
|
__: [6]
|
|
@@ -27177,11 +27217,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
27177
27217
|
};
|
|
27178
27218
|
}
|
|
27179
27219
|
});
|
|
27180
|
-
const AddLink = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
27181
|
-
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" };
|
|
27182
27222
|
const INIT_SIZE = 5;
|
|
27183
27223
|
const MAX_SIZE = 10;
|
|
27184
|
-
const _sfc_main$
|
|
27224
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
27185
27225
|
__name: "AddTable",
|
|
27186
27226
|
props: {
|
|
27187
27227
|
editor: {}
|
|
@@ -27291,7 +27331,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
27291
27331
|
}), 128))
|
|
27292
27332
|
]);
|
|
27293
27333
|
}), 128)),
|
|
27294
|
-
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)
|
|
27295
27335
|
]),
|
|
27296
27336
|
_: 1
|
|
27297
27337
|
})
|
|
@@ -27301,7 +27341,161 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
27301
27341
|
};
|
|
27302
27342
|
}
|
|
27303
27343
|
});
|
|
27304
|
-
const AddTable = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
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"]]);
|
|
27305
27499
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
27306
27500
|
__name: "FontFamily",
|
|
27307
27501
|
props: {
|
|
@@ -27996,6 +28190,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
27996
28190
|
{ component: AddLink },
|
|
27997
28191
|
{ component: AddTable },
|
|
27998
28192
|
{ component: AddImage },
|
|
28193
|
+
{ component: AddTooltip },
|
|
27999
28194
|
{
|
|
28000
28195
|
label: "Horizontal line",
|
|
28001
28196
|
action: ["setHorizontalRule"],
|
|
@@ -28109,7 +28304,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
28109
28304
|
};
|
|
28110
28305
|
}
|
|
28111
28306
|
});
|
|
28112
|
-
const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
28307
|
+
const EditorToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-62e3d651"]]);
|
|
28113
28308
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28114
28309
|
__name: "TopToolbar",
|
|
28115
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.
|
|
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.
|
|
29
|
+
"@tailor-cms/ce-html-manifest": "0.1.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@tiptap/extension-color": "^2.25.0",
|