@templatical/editor 0.0.1 → 0.0.3
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/AiChatSidebar-busJk9hm.js +214 -0
- package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
- package/dist/CloudEditor-BDnHd6Um.js +919 -0
- package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
- package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
- package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
- package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
- package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
- package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
- package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
- package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
- package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
- package/dist/TestEmailModal-Dpq1is9S.js +94 -0
- package/dist/TitleEditor-CLcDdcWI.js +167 -0
- package/dist/TplModal-CGzRjR96.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BpPTqcok.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +1 -0
- package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
- package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
- package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
- package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
- package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
- package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
- package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
- package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
- package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
- package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.js +2 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.js.map +1 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.js +2 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.js.map +1 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +2 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +1 -0
- package/dist/cdn/editor.css +1 -0
- package/dist/cdn/editor.js +2 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-B7kDuZmP.js +7 -0
- package/dist/chevron-down-DJLW2Q9Z.js +7 -0
- package/dist/circle-alert-E2vYPs5r.js +25 -0
- package/dist/clock-lWIIQA3C.js +12 -0
- package/dist/de-B4Ob4vCo.js +682 -0
- package/dist/dist-4LiM9FDd.js +35 -0
- package/dist/dist-Bu7veieH.js +776 -0
- package/dist/dist-C1BIRHCQ.js +61 -0
- package/dist/dist-CG-vEqSU.js +314 -0
- package/dist/dist-C_ymrGFi.js +10625 -0
- package/dist/dist-ChAGLpWo.js +35 -0
- package/dist/dist-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DmpMJbmZ.js +513 -0
- package/dist/dist-DrvKRSU6.js +47 -0
- package/dist/dist-Dxnd0GRf.js +5 -0
- package/dist/dist-DysAFIPy.js +2054 -0
- package/dist/emojiData-BfWQS72m.js +17 -0
- package/dist/en-YXsspZJG.js +682 -0
- package/dist/extensions-CKM99njP.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-CJsFtdbZ.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-Dwa2PmdD.js +10 -0
- package/dist/liquid.browser-BemTg3sZ.js +3272 -0
- package/dist/loader-circle-BTQQxC3l.js +7 -0
- package/dist/message-circle-Blgm6V_h.js +7 -0
- package/dist/refresh-cw-Bb4PEeW1.js +44 -0
- package/dist/scan-line-7lZPfOdm.js +25 -0
- package/dist/send-C0ltAQrv.js +10 -0
- package/dist/shield-check-f-qv4RKs.js +10 -0
- package/dist/sparkles-KhBCGlqB.js +23 -0
- package/dist/styleConstants-D4SOZGBV.js +94 -0
- package/dist/styles-DSw1VNU3.js +3406 -0
- package/dist/templatical-editor.css +2 -1
- package/dist/templatical-editor.js +242 -9
- package/dist/templatical-editor.umd.cjs +112 -524
- package/dist/timeouts-CmBrLeZA.js +4 -0
- package/dist/trash-2-OwjZ-guZ.js +25 -0
- package/dist/triangle-alert-DOSRIUYZ.js +17 -0
- package/dist/useEditorCore-Cc4RCwWq.js +5556 -0
- package/dist/useI18n-DUirdXEX.js +17 -0
- package/dist/useMergeTag-DVnlvPYJ.js +33 -0
- package/dist/x-CGlq2XQe.js +10 -0
- package/package.json +30 -20
- package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
- package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
- package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
- package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
- package/dist/CommentsSidebar-PVUlloyB.js +0 -655
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
- package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
- package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
- package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
- package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
- package/dist/TestEmailModal-Cwre5elw.js +0 -128
- package/dist/TextEditor-BuUOIByX.js +0 -780
- package/dist/de-BWIAblxs.js +0 -685
- package/dist/en-cYyUzNV1.js +0 -685
- package/dist/index-0tWUczNu.js +0 -47
- package/dist/index-4okvXjqk.js +0 -41
- package/dist/index-BSc6h5zo.js +0 -967
- package/dist/index-CrvwWlhN.js +0 -41
- package/dist/index-D-iD-7lO.js +0 -10961
- package/dist/index-D-ygXbc8.js +0 -2452
- package/dist/index-DbrWKz-e.js +0 -1415
- package/dist/index-DeUeHy6g.js +0 -422
- package/dist/index-Ude6e9RU.js +0 -41
- package/dist/index-ZQzHBwkr.js +0 -12767
- package/dist/liquid.browser-CeNxS2GL.js +0 -3493
- package/dist/loader-circle-tM9j2mRh.js +0 -13
- package/dist/shield-check-Ngi9jAQc.js +0 -20
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Wt as e, c as t } from "./dist-C_ymrGFi.js";
|
|
2
|
+
//#region ../../node_modules/.bun/@tiptap+extension-underline@3.22.1+ea875cbca4543ce7/node_modules/@tiptap/extension-underline/dist/index.js
|
|
3
|
+
var n = t.create({
|
|
4
|
+
name: "underline",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return { HTMLAttributes: {} };
|
|
7
|
+
},
|
|
8
|
+
parseHTML() {
|
|
9
|
+
return [{ tag: "u" }, {
|
|
10
|
+
style: "text-decoration",
|
|
11
|
+
consuming: !1,
|
|
12
|
+
getAttrs: (e) => e.includes("underline") ? {} : !1
|
|
13
|
+
}];
|
|
14
|
+
},
|
|
15
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
16
|
+
return [
|
|
17
|
+
"u",
|
|
18
|
+
e(this.options.HTMLAttributes, t),
|
|
19
|
+
0
|
|
20
|
+
];
|
|
21
|
+
},
|
|
22
|
+
parseMarkdown(e, t) {
|
|
23
|
+
return t.applyMark(this.name || "underline", t.parseInline(e.tokens || []));
|
|
24
|
+
},
|
|
25
|
+
renderMarkdown(e, t) {
|
|
26
|
+
return `++${t.renderChildren(e)}++`;
|
|
27
|
+
},
|
|
28
|
+
markdownTokenizer: {
|
|
29
|
+
name: "underline",
|
|
30
|
+
level: "inline",
|
|
31
|
+
start(e) {
|
|
32
|
+
return e.indexOf("++");
|
|
33
|
+
},
|
|
34
|
+
tokenize(e, t, n) {
|
|
35
|
+
let r = /^(\+\+)([\s\S]+?)(\+\+)/.exec(e);
|
|
36
|
+
if (!r) return;
|
|
37
|
+
let i = r[2].trim();
|
|
38
|
+
return {
|
|
39
|
+
type: "underline",
|
|
40
|
+
raw: r[0],
|
|
41
|
+
text: i,
|
|
42
|
+
tokens: n.inlineTokens(i)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
addCommands() {
|
|
47
|
+
return {
|
|
48
|
+
setUnderline: () => ({ commands: e }) => e.setMark(this.name),
|
|
49
|
+
toggleUnderline: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
50
|
+
unsetUnderline: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
addKeyboardShortcuts() {
|
|
54
|
+
return {
|
|
55
|
+
"Mod-u": () => this.editor.commands.toggleUnderline(),
|
|
56
|
+
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}), r = n;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { n as Underline, r as default };
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { computed as e, getCurrentInstance as t, getCurrentScope as n, hasInjectionContext as r, inject as i, isRef as a, nextTick as o, onMounted as s, onScopeDispose as c, shallowReadonly as l, shallowRef as u, toValue as d, unref as f, watch as p, watchEffect as m } from "vue";
|
|
2
|
+
//#region ../../node_modules/.bun/@vueuse+shared@14.2.1+cc44681ce9393ba4/node_modules/@vueuse/shared/dist/index.js
|
|
3
|
+
function h(e, t) {
|
|
4
|
+
return n() ? (c(e, t), !0) : !1;
|
|
5
|
+
}
|
|
6
|
+
var g = /* @__PURE__ */ new WeakMap(), _ = (...e) => {
|
|
7
|
+
let a = e[0], o = t()?.proxy ?? n();
|
|
8
|
+
if (o == null && !r()) throw Error("injectLocal must be called in setup");
|
|
9
|
+
return o && g.has(o) && a in g.get(o) ? g.get(o)[a] : i(...e);
|
|
10
|
+
}, v = typeof window < "u" && typeof document < "u";
|
|
11
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
12
|
+
var y = (e) => e != null, b = Object.prototype.toString, x = (e) => b.call(e) === "[object Object]", S = () => {}, C = /* @__PURE__ */ w();
|
|
13
|
+
function w() {
|
|
14
|
+
var e, t;
|
|
15
|
+
return v && !!(!((e = window) == null || (e = e.navigator) == null) && e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window) == null || (t = t.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
|
|
16
|
+
}
|
|
17
|
+
function T(e, t) {
|
|
18
|
+
function n(...n) {
|
|
19
|
+
return new Promise((r, i) => {
|
|
20
|
+
Promise.resolve(e(() => t.apply(this, n), {
|
|
21
|
+
fn: t,
|
|
22
|
+
thisArg: this,
|
|
23
|
+
args: n
|
|
24
|
+
})).then(r).catch(i);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
function E(e, t = {}) {
|
|
30
|
+
let n, r, i = S, a = (e) => {
|
|
31
|
+
clearTimeout(e), i(), i = S;
|
|
32
|
+
}, o;
|
|
33
|
+
return (s) => {
|
|
34
|
+
let c = d(e), l = d(t.maxWait);
|
|
35
|
+
return n && a(n), c <= 0 || l !== void 0 && l <= 0 ? (r &&= (a(r), void 0), Promise.resolve(s())) : new Promise((e, u) => {
|
|
36
|
+
i = t.rejectOnCancel ? u : e, o = s, l && !r && (r = setTimeout(() => {
|
|
37
|
+
n && a(n), r = void 0, e(o());
|
|
38
|
+
}, l)), n = setTimeout(() => {
|
|
39
|
+
r && a(r), r = void 0, e(s());
|
|
40
|
+
}, c);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function D(e) {
|
|
45
|
+
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
|
|
46
|
+
}
|
|
47
|
+
function O(e) {
|
|
48
|
+
return Array.isArray(e) ? e : [e];
|
|
49
|
+
}
|
|
50
|
+
function k(e) {
|
|
51
|
+
return e || t();
|
|
52
|
+
}
|
|
53
|
+
function A(e, t = 200, n = {}) {
|
|
54
|
+
return T(E(t, n), e);
|
|
55
|
+
}
|
|
56
|
+
function j(e, t = !0, n) {
|
|
57
|
+
k(n) ? s(e, n) : t ? e() : o(e);
|
|
58
|
+
}
|
|
59
|
+
function M(e, t = 1e3, n = {}) {
|
|
60
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, o = null, s = u(!1);
|
|
61
|
+
function c() {
|
|
62
|
+
o &&= (clearInterval(o), null);
|
|
63
|
+
}
|
|
64
|
+
function f() {
|
|
65
|
+
s.value = !1, c();
|
|
66
|
+
}
|
|
67
|
+
function m() {
|
|
68
|
+
let n = d(t);
|
|
69
|
+
n <= 0 || (s.value = !0, i && e(), c(), s.value && (o = setInterval(e, n)));
|
|
70
|
+
}
|
|
71
|
+
return r && v && m(), (a(t) || typeof t == "function") && h(p(t, () => {
|
|
72
|
+
s.value && v && m();
|
|
73
|
+
})), h(f), {
|
|
74
|
+
isActive: l(s),
|
|
75
|
+
pause: f,
|
|
76
|
+
resume: m
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function N(e, t, n = {}) {
|
|
80
|
+
let { immediate: r = !0, immediateCallback: i = !1 } = n, a = u(!1), o;
|
|
81
|
+
function s() {
|
|
82
|
+
o &&= (clearTimeout(o), void 0);
|
|
83
|
+
}
|
|
84
|
+
function c() {
|
|
85
|
+
a.value = !1, s();
|
|
86
|
+
}
|
|
87
|
+
function f(...n) {
|
|
88
|
+
i && e(), s(), a.value = !0, o = setTimeout(() => {
|
|
89
|
+
a.value = !1, o = void 0, e(...n);
|
|
90
|
+
}, d(t));
|
|
91
|
+
}
|
|
92
|
+
return r && (a.value = !0, v && f()), h(c), {
|
|
93
|
+
isPending: l(a),
|
|
94
|
+
start: f,
|
|
95
|
+
stop: c
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function P(e = !1, t = {}) {
|
|
99
|
+
let { truthyValue: n = !0, falsyValue: r = !1 } = t, i = a(e), o = u(e);
|
|
100
|
+
function s(e) {
|
|
101
|
+
if (arguments.length) return o.value = e, o.value;
|
|
102
|
+
{
|
|
103
|
+
let e = d(n);
|
|
104
|
+
return o.value = o.value === e ? d(r) : e, o.value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return i ? s : [o, s];
|
|
108
|
+
}
|
|
109
|
+
function F(e, t, n) {
|
|
110
|
+
return p(e, t, {
|
|
111
|
+
...n,
|
|
112
|
+
immediate: !0
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region ../../node_modules/.bun/@vueuse+core@14.2.1+cc44681ce9393ba4/node_modules/@vueuse/core/dist/index.js
|
|
117
|
+
var I = v ? window : void 0;
|
|
118
|
+
v && window.document, v && window.navigator, v && window.location;
|
|
119
|
+
function L(e) {
|
|
120
|
+
let t = d(e);
|
|
121
|
+
return t?.$el ?? t;
|
|
122
|
+
}
|
|
123
|
+
function R(...t) {
|
|
124
|
+
let n = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), r = e(() => {
|
|
125
|
+
let e = O(d(t[0])).filter((e) => e != null);
|
|
126
|
+
return e.every((e) => typeof e != "string") ? e : void 0;
|
|
127
|
+
});
|
|
128
|
+
return F(() => [
|
|
129
|
+
r.value?.map((e) => L(e)) ?? [I].filter((e) => e != null),
|
|
130
|
+
O(d(r.value ? t[1] : t[0])),
|
|
131
|
+
O(f(r.value ? t[2] : t[1])),
|
|
132
|
+
d(r.value ? t[3] : t[2])
|
|
133
|
+
], ([e, t, r, i], a, o) => {
|
|
134
|
+
if (!e?.length || !t?.length || !r?.length) return;
|
|
135
|
+
let s = x(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
|
|
136
|
+
o(() => {
|
|
137
|
+
c.forEach((e) => e());
|
|
138
|
+
});
|
|
139
|
+
}, { flush: "post" });
|
|
140
|
+
}
|
|
141
|
+
var z = !1;
|
|
142
|
+
function B(e, t, n = {}) {
|
|
143
|
+
let { window: r = I, ignore: i = [], capture: a = !0, detectIframe: o = !1, controls: s = !1 } = n;
|
|
144
|
+
if (!r) return s ? {
|
|
145
|
+
stop: S,
|
|
146
|
+
cancel: S,
|
|
147
|
+
trigger: S
|
|
148
|
+
} : S;
|
|
149
|
+
if (C && !z) {
|
|
150
|
+
z = !0;
|
|
151
|
+
let e = { passive: !0 };
|
|
152
|
+
Array.from(r.document.body.children).forEach((t) => t.addEventListener("click", S, e)), r.document.documentElement.addEventListener("click", S, e);
|
|
153
|
+
}
|
|
154
|
+
let c = !0, l = (e) => d(i).some((t) => {
|
|
155
|
+
if (typeof t == "string") return Array.from(r.document.querySelectorAll(t)).some((t) => t === e.target || e.composedPath().includes(t));
|
|
156
|
+
{
|
|
157
|
+
let n = L(t);
|
|
158
|
+
return n && (e.target === n || e.composedPath().includes(n));
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
function u(e) {
|
|
162
|
+
let t = d(e);
|
|
163
|
+
return t && t.$.subTree.shapeFlag === 16;
|
|
164
|
+
}
|
|
165
|
+
function f(e, t) {
|
|
166
|
+
let n = d(e), r = n.$.subTree && n.$.subTree.children;
|
|
167
|
+
return r == null || !Array.isArray(r) ? !1 : r.some((e) => e.el === t.target || t.composedPath().includes(e.el));
|
|
168
|
+
}
|
|
169
|
+
let p = (n) => {
|
|
170
|
+
let r = L(e);
|
|
171
|
+
if (n.target != null && !(!(r instanceof Element) && u(e) && f(e, n)) && !(!r || r === n.target || n.composedPath().includes(r))) {
|
|
172
|
+
if ("detail" in n && n.detail === 0 && (c = !l(n)), !c) {
|
|
173
|
+
c = !0;
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
t(n);
|
|
177
|
+
}
|
|
178
|
+
}, m = !1, h = [
|
|
179
|
+
R(r, "click", (e) => {
|
|
180
|
+
m || (m = !0, setTimeout(() => {
|
|
181
|
+
m = !1;
|
|
182
|
+
}, 0), p(e));
|
|
183
|
+
}, {
|
|
184
|
+
passive: !0,
|
|
185
|
+
capture: a
|
|
186
|
+
}),
|
|
187
|
+
R(r, "pointerdown", (t) => {
|
|
188
|
+
let n = L(e);
|
|
189
|
+
c = !l(t) && !!(n && !t.composedPath().includes(n));
|
|
190
|
+
}, { passive: !0 }),
|
|
191
|
+
o && R(r, "blur", (n) => {
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
let i = L(e);
|
|
194
|
+
r.document.activeElement?.tagName === "IFRAME" && !i?.contains(r.document.activeElement) && t(n);
|
|
195
|
+
}, 0);
|
|
196
|
+
}, { passive: !0 })
|
|
197
|
+
].filter(Boolean), g = () => h.forEach((e) => e());
|
|
198
|
+
return s ? {
|
|
199
|
+
stop: g,
|
|
200
|
+
cancel: () => {
|
|
201
|
+
c = !1;
|
|
202
|
+
},
|
|
203
|
+
trigger: (e) => {
|
|
204
|
+
c = !0, p(e), c = !1;
|
|
205
|
+
}
|
|
206
|
+
} : g;
|
|
207
|
+
}
|
|
208
|
+
function V() {
|
|
209
|
+
let e = u(!1), n = t();
|
|
210
|
+
return n && s(() => {
|
|
211
|
+
e.value = !0;
|
|
212
|
+
}, n), e;
|
|
213
|
+
}
|
|
214
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
215
|
+
function H(t) {
|
|
216
|
+
let n = V();
|
|
217
|
+
return e(() => (n.value, !!t()));
|
|
218
|
+
}
|
|
219
|
+
function U(t, n, r = {}) {
|
|
220
|
+
let { window: i = I, ...a } = r, o, s = /* @__PURE__ */ H(() => i && "MutationObserver" in i), c = () => {
|
|
221
|
+
o &&= (o.disconnect(), void 0);
|
|
222
|
+
}, l = p(e(() => {
|
|
223
|
+
let e = O(d(t)).map(L).filter(y);
|
|
224
|
+
return new Set(e);
|
|
225
|
+
}), (e) => {
|
|
226
|
+
c(), s.value && e.size && (o = new MutationObserver(n), e.forEach((e) => o.observe(e, a)));
|
|
227
|
+
}, {
|
|
228
|
+
immediate: !0,
|
|
229
|
+
flush: "post"
|
|
230
|
+
}), u = () => o?.takeRecords(), f = () => {
|
|
231
|
+
l(), c();
|
|
232
|
+
};
|
|
233
|
+
return h(f), {
|
|
234
|
+
isSupported: s,
|
|
235
|
+
stop: f,
|
|
236
|
+
takeRecords: u
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
var W = Symbol("vueuse-ssr-width");
|
|
240
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
241
|
+
function G() {
|
|
242
|
+
let e = r() ? _(W, null) : null;
|
|
243
|
+
return typeof e == "number" ? e : void 0;
|
|
244
|
+
}
|
|
245
|
+
function K(t, n = {}) {
|
|
246
|
+
let { window: r = I, ssrWidth: i = /* @__PURE__ */ G() } = n, a = /* @__PURE__ */ H(() => r && "matchMedia" in r && typeof r.matchMedia == "function"), o = u(typeof i == "number"), s = u(), c = u(!1);
|
|
247
|
+
return m(() => {
|
|
248
|
+
if (o.value) {
|
|
249
|
+
o.value = !a.value, c.value = d(t).split(",").some((e) => {
|
|
250
|
+
let t = e.includes("not all"), n = e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), r = e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), a = !!(n || r);
|
|
251
|
+
return n && a && (a = i >= D(n[1])), r && a && (a = i <= D(r[1])), t ? !a : a;
|
|
252
|
+
});
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
a.value && (s.value = r.matchMedia(d(t)), c.value = s.value.matches);
|
|
256
|
+
}), R(s, "change", (e) => {
|
|
257
|
+
c.value = e.matches;
|
|
258
|
+
}, { passive: !0 }), e(() => c.value);
|
|
259
|
+
}
|
|
260
|
+
function q(t, n, r = {}) {
|
|
261
|
+
let { window: i = I, ...a } = r, o, s = /* @__PURE__ */ H(() => i && "ResizeObserver" in i), c = () => {
|
|
262
|
+
o &&= (o.disconnect(), void 0);
|
|
263
|
+
}, l = p(e(() => {
|
|
264
|
+
let e = d(t);
|
|
265
|
+
return Array.isArray(e) ? e.map((e) => L(e)) : [L(e)];
|
|
266
|
+
}), (e) => {
|
|
267
|
+
if (c(), s.value && i) {
|
|
268
|
+
o = new ResizeObserver(n);
|
|
269
|
+
for (let t of e) t && o.observe(t, a);
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
immediate: !0,
|
|
273
|
+
flush: "post"
|
|
274
|
+
}), u = () => {
|
|
275
|
+
c(), l();
|
|
276
|
+
};
|
|
277
|
+
return h(u), {
|
|
278
|
+
isSupported: s,
|
|
279
|
+
stop: u
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function J(e, t = {}) {
|
|
283
|
+
let { reset: n = !0, windowResize: r = !0, windowScroll: i = !0, immediate: a = !0, updateTiming: o = "sync" } = t, s = u(0), c = u(0), l = u(0), d = u(0), f = u(0), m = u(0), h = u(0), g = u(0);
|
|
284
|
+
function _() {
|
|
285
|
+
let t = L(e);
|
|
286
|
+
if (!t) {
|
|
287
|
+
n && (s.value = 0, c.value = 0, l.value = 0, d.value = 0, f.value = 0, m.value = 0, h.value = 0, g.value = 0);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
let r = t.getBoundingClientRect();
|
|
291
|
+
s.value = r.height, c.value = r.bottom, l.value = r.left, d.value = r.right, f.value = r.top, m.value = r.width, h.value = r.x, g.value = r.y;
|
|
292
|
+
}
|
|
293
|
+
function v() {
|
|
294
|
+
o === "sync" ? _() : o === "next-frame" && requestAnimationFrame(() => _());
|
|
295
|
+
}
|
|
296
|
+
return q(e, v), p(() => L(e), (e) => !e && v()), U(e, v, { attributeFilter: ["style", "class"] }), i && R("scroll", v, {
|
|
297
|
+
capture: !0,
|
|
298
|
+
passive: !0
|
|
299
|
+
}), r && R("resize", v, { passive: !0 }), j(() => {
|
|
300
|
+
a && v();
|
|
301
|
+
}), {
|
|
302
|
+
height: s,
|
|
303
|
+
bottom: c,
|
|
304
|
+
left: l,
|
|
305
|
+
right: d,
|
|
306
|
+
top: f,
|
|
307
|
+
width: m,
|
|
308
|
+
x: h,
|
|
309
|
+
y: g,
|
|
310
|
+
update: v
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
//#endregion
|
|
314
|
+
export { A as a, P as c, K as i, J as n, M as o, R as r, N as s, B as t };
|