@juit/vue-tiny-editor 1.0.64 → 1.0.66
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/index.js +8 -8
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { openBlock as w, createElementBlock as y, createElementVNode as b, defineComponent as Ge, useModel as Xe, watch as N, shallowRef as q, ref as T, computed as _, onMounted as Je, nextTick as Oe, onUnmounted as Qe, normalizeClass as j, Fragment as Ye, renderList as Ze, createTextVNode as et, toDisplayString as z, createCommentVNode as me, createVNode as H, unref as $, withDirectives as je, vModelText as Le, createBlock as tt, mergeModels as nt } from "vue";
|
|
2
2
|
function ie(t, e) {
|
|
3
3
|
return t instanceof Node && (t = F(t)), t.isPointInRange(e.startContainer, e.startOffset) && t.isPointInRange(e.endContainer, e.endOffset) ? e : null;
|
|
4
4
|
}
|
|
@@ -281,7 +281,7 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
281
281
|
}, Lt = ["contenteditable"], Mt = { class: "-jte-toolbox" }, Bt = /* @__PURE__ */ Ge({
|
|
282
282
|
name: "JuitTinyEditor",
|
|
283
283
|
__name: "editor",
|
|
284
|
-
props: /* @__PURE__ */
|
|
284
|
+
props: /* @__PURE__ */ nt({
|
|
285
285
|
/** A flag indicating if content can be edited (default: `true`) */
|
|
286
286
|
editable: {
|
|
287
287
|
type: Boolean,
|
|
@@ -328,7 +328,7 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
328
328
|
}),
|
|
329
329
|
emits: ["update:modelValue"],
|
|
330
330
|
setup(t) {
|
|
331
|
-
const e =
|
|
331
|
+
const e = Xe(t, "modelValue"), l = t;
|
|
332
332
|
N(() => l.dark, (r) => {
|
|
333
333
|
s.value?.style.setProperty("color-scheme", r ? "dark light" : "light dark");
|
|
334
334
|
});
|
|
@@ -504,7 +504,7 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
504
504
|
function Ne(r) {
|
|
505
505
|
s.value && xe(s.value) || (W.value = null, te.value = null, K.value = null), c.value = o.value ? xe(o.value) : null, we();
|
|
506
506
|
}
|
|
507
|
-
return N(k, (r) => r && l.onMention?.(r)),
|
|
507
|
+
return N(k, (r) => r && l.onMention?.(r)), Je(() => {
|
|
508
508
|
if (document.addEventListener("selectionchange", Ne), !s.value) throw new Error("Root not referenced");
|
|
509
509
|
if (!o.value) throw new Error("Editor not referenced");
|
|
510
510
|
if (!i.value) throw new Error("Popup not referenced");
|
|
@@ -561,7 +561,7 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
561
561
|
}, { immediate: !0 }), N(c, (v) => {
|
|
562
562
|
v ? (W.value = ae(n, v, "a"), ue.value = ae(n, v, "b"), ce.value = ae(n, v, "i")) : (W.value = null, ue.value = null, ce.value = null);
|
|
563
563
|
}, { immediate: !0 });
|
|
564
|
-
}),
|
|
564
|
+
}), Qe(() => {
|
|
565
565
|
document.removeEventListener("selectionchange", Ne), G && clearInterval(G);
|
|
566
566
|
}), (r, n) => (w(), y("div", {
|
|
567
567
|
class: j(["juit-tiny-edit", { "-jte-editable": t.editable, "-jte-dark": t.dark }])
|
|
@@ -580,13 +580,13 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
580
580
|
ref_key: "mentionsListRef",
|
|
581
581
|
ref: a
|
|
582
582
|
}, [
|
|
583
|
-
(w(!0), y(
|
|
583
|
+
(w(!0), y(Ye, null, Ze(L.value, (u, h) => (w(), y("li", {
|
|
584
584
|
key: h,
|
|
585
585
|
class: j({ "-jte-mentions-selected": p.value === h }),
|
|
586
586
|
onMousedown: (g) => ye(u.name, u.value)
|
|
587
587
|
}, [
|
|
588
588
|
b("div", kt, [
|
|
589
|
-
|
|
589
|
+
et(z(u.value) + " ", 1),
|
|
590
590
|
b("span", Rt, z(u.name), 1)
|
|
591
591
|
])
|
|
592
592
|
], 42, Et))), 128))
|
|
@@ -650,7 +650,7 @@ const Tt = { render: Nt }, Et = ["onMousedown"], kt = { class: "-jte-mentions-en
|
|
|
650
650
|
class: j(["-jte-icon -jte-icon-href", de(P.value)]),
|
|
651
651
|
onClick: n[11] || (n[11] = (u) => X("a", { href: "http://__placeholder__/" }))
|
|
652
652
|
}, null, 8, ["class"]),
|
|
653
|
-
t.onSubmit ? (w(),
|
|
653
|
+
t.onSubmit ? (w(), tt($(wt), {
|
|
654
654
|
key: 0,
|
|
655
655
|
class: j(["-jte-icon -jte-icon-send", { "-jte-disabled": !m.value, "-jte-active": !!m.value }]),
|
|
656
656
|
onClick: Ie
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juit/vue-tiny-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.66",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
"test": "vitest"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"vue": "^3.5.
|
|
20
|
+
"vue": "^3.5.27"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@plugjs/eslint-plugin": "^0.5.
|
|
23
|
+
"@plugjs/eslint-plugin": "^0.5.20",
|
|
24
24
|
"@types/node": "<25",
|
|
25
25
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
26
|
-
"@vitest/coverage-v8": "^4.0.
|
|
26
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
27
27
|
"@vue/test-utils": "^2.4.6",
|
|
28
28
|
"eslint": "^9.39.2",
|
|
29
|
-
"eslint-plugin-vue": "^10.
|
|
29
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
30
30
|
"jsdom": "^27.4.0",
|
|
31
31
|
"typescript": "^5.9.3",
|
|
32
32
|
"vite": "^7.3.1",
|
|
33
33
|
"vite-plugin-dts": "^4.5.4",
|
|
34
34
|
"vite-svg-loader": "^5.1.0",
|
|
35
|
-
"vitest": "^4.0.
|
|
36
|
-
"vue": "^3.5.
|
|
37
|
-
"vue-tsc": "^3.2.
|
|
35
|
+
"vitest": "^4.0.18",
|
|
36
|
+
"vue": "^3.5.27",
|
|
37
|
+
"vue-tsc": "^3.2.4"
|
|
38
38
|
},
|
|
39
39
|
"author": "Juit Developers <developers@juit.com>",
|
|
40
40
|
"license": "Apache-2.0",
|