@templatical/editor 0.16.0 → 0.16.1
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-B-k_Sdas.js → AiChatSidebar-EaPCeDXr.js} +14 -14
- package/dist/{AiFeatureMenu-B5_IKOlI.js → AiFeatureMenu-Rb8G3EBo.js} +7 -7
- package/dist/{BlockIssueBadge-B3xVgMTh.js → BlockIssueBadge-CZYgn-qg.js} +5 -5
- package/dist/{CloudEditor-BUJk4vXS.js → CloudEditor-D88gLBXp.js} +24 -24
- package/dist/{CollaboratorBar-BAUQfXUk.js → CollaboratorBar-dxCD8jSi.js} +4 -4
- package/dist/ColorPicker-CAgMCX3A.js +442 -0
- package/dist/{CommentsSidebar-D_tSGvTX.js → CommentsSidebar-DDKiFsSq.js} +13 -13
- package/dist/{CountdownBlock-apiYUhkQ.js → CountdownBlock-173fiO5Z.js} +3 -3
- package/dist/{CountdownToolbar-CS0axcjz.js → CountdownToolbar-8XVTOuGX.js} +4 -4
- package/dist/{DesignReferenceSidebar-BYQcuaL4.js → DesignReferenceSidebar-D6TfC176.js} +11 -11
- package/dist/{IssuesPanel-CR1MPaDE.js → IssuesPanel-CQQipLQP.js} +8 -8
- package/dist/{LoadingTrack-DsecR8Rw.js → LoadingTrack-KIcREPlS.js} +1 -1
- package/dist/{MergeTagSuggestion-DLVykS0K.js → MergeTagSuggestion-DrT3LiZ4.js} +4 -4
- package/dist/{ModuleBrowserModal-BzDuagt5.js → ModuleBrowserModal-l4_RCC8m.js} +11 -11
- package/dist/{ModulePreviewCanvas-CK11BX4i.js → ModulePreviewCanvas-BqYAr4fz.js} +3 -3
- package/dist/NumberWithSuffix-Di-cDy_m.js +89 -0
- package/dist/{ParagraphEditor-fg9Ljy_Z.js → ParagraphEditor-DIQ1jmSP.js} +230 -195
- package/dist/{RichTextEditorContent-BqLHIZY7.js → RichTextEditorContent-DkTJ6KK8.js} +56 -45
- package/dist/{SaveModuleDialog-D27ufH5q.js → SaveModuleDialog-DPo3Raon.js} +8 -8
- package/dist/{SnapshotHistory-Cymqkk9_.js → SnapshotHistory-m7brKV7C.js} +10 -10
- package/dist/{TemplateScoringPanel-CZ62rGHz.js → TemplateScoringPanel-C8VOC6gn.js} +15 -15
- package/dist/{TestEmailModal-BIvdHidU.js → TestEmailModal-BE9sFEIl.js} +6 -6
- package/dist/{TitleEditor-D0a4NdOn.js → TitleEditor-BATN-k-Q.js} +38 -35
- package/dist/{TplModal-dYXt3vyd.js → TplModal-DHBcZ1gq.js} +5 -5
- package/dist/{blockTypeIcons-JSBvsa0M.js → blockTypeIcons-wRchKKx0.js} +7 -7
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-C58VqAgo.js → ca-B3eR47lE.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B6V5CzCc.js → AiFeatureMenu-W7VQFAwq.js} +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-B6V5CzCc.js.map → AiFeatureMenu-W7VQFAwq.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-C6Xpl1KK.js → BlockIssueBadge-ww2vNIfJ.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-C6Xpl1KK.js.map → BlockIssueBadge-ww2vNIfJ.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-C-npgK-l.js → CloudEditor-BVSJ1kvB.js} +161 -161
- package/dist/cdn/chunks/{CloudEditor-C-npgK-l.js.map → CloudEditor-BVSJ1kvB.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BSKXgw9D.js → CollaboratorBar-BFrAua9a.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-BSKXgw9D.js.map → CollaboratorBar-BFrAua9a.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js +439 -0
- package/dist/cdn/chunks/ColorPicker-DmxMDn-t.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-Y-nycxv2.js → CountdownBlock-MC-mhtQD.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-Y-nycxv2.js.map → CountdownBlock-MC-mhtQD.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-9LqnhGyh.js → CountdownToolbar-dXyr7tz-.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-9LqnhGyh.js.map → CountdownToolbar-dXyr7tz-.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BYfGf1rC.js → IssuesPanel-CTxSgViL.js} +8 -8
- package/dist/cdn/chunks/{IssuesPanel-BYfGf1rC.js.map → IssuesPanel-CTxSgViL.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-DQzKlLH7.js → MergeTagSuggestion-jesxS7An.js} +3 -3
- package/dist/cdn/chunks/{MergeTagSuggestion-DQzKlLH7.js.map → MergeTagSuggestion-jesxS7An.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-EzKgW5TG.js → ModuleBrowserModal-B5sCsrud.js} +9 -9
- package/dist/cdn/chunks/{ModuleBrowserModal-EzKgW5TG.js.map → ModuleBrowserModal-B5sCsrud.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DxbSzXm8.js → ModulePreviewCanvas-DGTGo8kg.js} +11 -11
- package/dist/cdn/chunks/{ModulePreviewCanvas-DxbSzXm8.js.map → ModulePreviewCanvas-DGTGo8kg.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-tAHfui6k.js +91 -0
- package/dist/cdn/chunks/NumberWithSuffix-tAHfui6k.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-CJNgRMhw.js → ParagraphEditor-CB5FGRs3.js} +213 -179
- package/dist/cdn/chunks/ParagraphEditor-CB5FGRs3.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-Cebdzomd.js → RichTextEditorContent-CPelbtck.js} +53 -42
- package/dist/cdn/chunks/RichTextEditorContent-CPelbtck.js.map +1 -0
- package/dist/cdn/chunks/{SaveModuleDialog-Cufwqoln.js → SaveModuleDialog-7f9uUUEC.js} +6 -6
- package/dist/cdn/chunks/{SaveModuleDialog-Cufwqoln.js.map → SaveModuleDialog-7f9uUUEC.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-7BhmKL-_.js → TitleEditor-C0mYpgs4.js} +46 -43
- package/dist/cdn/chunks/TitleEditor-C0mYpgs4.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-d4Sb61H-.js → blockTypeIcons-BtxaUtlx.js} +5 -5
- package/dist/cdn/chunks/{blockTypeIcons-d4Sb61H-.js.map → blockTypeIcons-BtxaUtlx.js.map} +1 -1
- package/dist/cdn/chunks/{ca-C58VqAgo.js → ca-B3eR47lE.js} +3 -2
- package/dist/cdn/chunks/ca-B3eR47lE.js.map +1 -0
- package/dist/cdn/chunks/{de-C0sMmfic.js → de-Cy8FB-Ii.js} +3 -2
- package/dist/cdn/chunks/de-Cy8FB-Ii.js.map +1 -0
- package/dist/cdn/chunks/{draggable-kG-D5Xsm.js → draggable-D840DIZB.js} +52 -39
- package/dist/cdn/chunks/draggable-D840DIZB.js.map +1 -0
- package/dist/cdn/chunks/{en-CsGBTBOf.js → en-Bu-zS_5o.js} +3 -2
- package/dist/cdn/chunks/en-Bu-zS_5o.js.map +1 -0
- package/dist/cdn/chunks/{es-DgjbcPIu.js → es-CD3ZD6hK.js} +3 -2
- package/dist/cdn/chunks/es-CD3ZD6hK.js.map +1 -0
- package/dist/cdn/chunks/{extensions-BeAsz_mp.js → extensions-BJ7vaBol.js} +28 -28
- package/dist/cdn/chunks/{extensions-BeAsz_mp.js.map → extensions-BJ7vaBol.js.map} +1 -1
- package/dist/cdn/chunks/{features-DO71hPJr.js → features-CgbSSCgv.js} +589 -553
- package/dist/cdn/chunks/features-CgbSSCgv.js.map +1 -0
- package/dist/cdn/chunks/{icons-BfP1cRNb.js → icons-Dlx5MT1V.js} +2 -2
- package/dist/cdn/chunks/{icons-BfP1cRNb.js.map → icons-Dlx5MT1V.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-0S3e0i8G.js → media-library-BMlykZGq.js} +104 -104
- package/dist/cdn/chunks/{media-library-0S3e0i8G.js.map → media-library-BMlykZGq.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-DXaP5lMJ.js → pt-BR-CgICL-CQ.js} +3 -2
- package/dist/cdn/chunks/pt-BR-CgICL-CQ.js.map +1 -0
- package/dist/cdn/chunks/quality-DsVgXk_j.js +2180 -0
- package/dist/cdn/chunks/{quality-B6V4R_df.js.map → quality-DsVgXk_j.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Dhn1J4H4.js → renderer-DPvEtVGO.js} +17 -17
- package/dist/cdn/chunks/{renderer-Dhn1J4H4.js.map → renderer-DPvEtVGO.js.map} +1 -1
- package/dist/cdn/chunks/{src-DoKjbqU2.js → src-CAdirukY.js} +5 -5
- package/dist/cdn/chunks/{src-DoKjbqU2.js.map → src-CAdirukY.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CSqligXJ.js → styles-D7u4vCpH.js} +820 -820
- package/dist/cdn/chunks/{styles-CSqligXJ.js.map → styles-D7u4vCpH.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-DVHUKGZf.js → tiptap-zpXk5mN4.js} +1131 -1134
- package/dist/cdn/chunks/{tiptap-DVHUKGZf.js.map → tiptap-zpXk5mN4.js.map} +1 -1
- package/dist/cdn/editor.js +74 -74
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-rl7ok6uJ.js → check-D1zYtCPK.js} +1 -1
- package/dist/{chevron-down-BKe__NOD.js → chevron-down-ByXpufZD.js} +1 -1
- package/dist/{circle-alert-C8xmpMsK.js → circle-alert-CjcAORUw.js} +1 -1
- package/dist/{clock-BW4JuDCN.js → clock-5lWLadUn.js} +1 -1
- package/dist/{cloud-CFpaFRCV.js → cloud-BogxOeZu.js} +1 -1
- package/dist/{createLucideIcon-Dx-EjR9r.js → createLucideIcon-Bh9xOmlW.js} +3 -3
- package/dist/{de-C0sMmfic.js → de-Cy8FB-Ii.js} +2 -1
- package/dist/dist-BE9m_i60.js +5 -0
- package/dist/{dist-C5-0GG3g.js → dist-BPPeDw62.js} +2 -2
- package/dist/{dist-DEcNpSJi.js → dist-BReUTadj.js} +4 -4
- package/dist/dist-BXR1aBJV.js +5 -0
- package/dist/{dist-r_2rJCMg.js → dist-Bm07Z3Es.js} +2 -2
- package/dist/{dist-BEWiuOMi.js → dist-CFOQvhSC.js} +3 -3
- package/dist/{dist-Ci5GHd96.js → dist-CHLoeloJ.js} +2 -2
- package/dist/{dist-0VHbLR6h.js → dist-D1WmF8BF.js} +2 -2
- package/dist/{dist-DrlHbc8g.js → dist-D9g4CSnm.js} +1 -1
- package/dist/{dist-Drm7i-yw.js → dist-DGEaAAIb.js} +2 -2
- package/dist/{dist-CTT6WYJ6.js → dist-DYv_Pttj.js} +2 -2
- package/dist/{dist-Dsoq4knU.js → dist-DcKlLQ8d.js} +2 -2
- package/dist/{dist-D_-AsMP4.js → dist-DhY2di4U.js} +2 -2
- package/dist/{dist-FVawx7ou.js → dist-i_Z7t67A.js} +260 -263
- package/dist/{en-CsGBTBOf.js → en-Bu-zS_5o.js} +2 -1
- package/dist/{es-DgjbcPIu.js → es-CD3ZD6hK.js} +2 -1
- package/dist/{extensions-3jhgwhV-.js → extensions-B2poxDIo.js} +7 -7
- package/dist/{image-up-BwBCmQ4P.js → image-up-Bj_nes3f.js} +1 -1
- package/dist/{info-TCn7uWR5.js → info-BhSQCxBV.js} +1 -1
- package/dist/{keys-Cv8-8GsD.js → keys-BbDgCU6K.js} +1 -1
- package/dist/{list-checks-CSrOWNgq.js → list-checks-CgxyUg7i.js} +1 -1
- package/dist/{loader-circle-BLmicnPG.js → loader-circle-DFU0HPAa.js} +1 -1
- package/dist/{message-circle-C9hHMQCI.js → message-circle-BEBsCHnk.js} +1 -1
- package/dist/{pt-BR-DXaP5lMJ.js → pt-BR-CgICL-CQ.js} +2 -1
- package/dist/{refresh-cw-D1JQ1LNa.js → refresh-cw--lvWGy0_.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-BzuoCyNp.js → runtime-dom.esm-bundler-GdMI8WqG.js} +6 -7
- package/dist/{scan-line-DgijVq9y.js → scan-line-QgyDIgn_.js} +1 -1
- package/dist/{send-DjPdq69F.js → send-BMyisUim.js} +1 -1
- package/dist/{shield-check-Bqluu8FS.js → shield-check-C49M20le.js} +1 -1
- package/dist/{sparkles-M4azPVSP.js → sparkles-DV7Dman6.js} +1 -1
- package/dist/{styles-5sGbDIA2.js → styles-B-yhoJnH.js} +78 -78
- package/dist/templatical-editor.js +61 -61
- package/dist/{text-align-start-CMya5pCQ.js → text-align-start-BMU70uAm.js} +1 -1
- package/dist/{trash-2-C-81rkLS.js → trash-2-B6M659Ey.js} +1 -1
- package/dist/{triangle-alert-BuRWnynk.js → triangle-alert-D1lzx6ds.js} +1 -1
- package/dist/{upload-CWBIoLd4.js → upload-3A1oZtOR.js} +1 -1
- package/dist/{useAliveFlag-CECL_OUb.js → useAliveFlag-C43EhZFY.js} +1 -1
- package/dist/{useCloudI18n-AKCy98qD.js → useCloudI18n-WbfVWq5k.js} +2 -2
- package/dist/{useEditorCore-AQ0BN1ug.js → useEditorCore-CV1ct_17.js} +616 -580
- package/dist/{useI18n-C-TDeJBt.js → useI18n-eR1yVW0v.js} +2 -2
- package/dist/{useMergeTag-D0aZw7Q5.js → useMergeTag-C3GfSktg.js} +2 -2
- package/dist/usePopoverRoot-C1j0D7cc.js +8 -0
- package/dist/{vue.runtime.esm-bundler-l0XAqiyv.js → vue.runtime.esm-bundler-B0xoGkDv.js} +84 -70
- package/dist/{x-CQSvXnGR.js → x-CG_NV3nP.js} +1 -1
- package/package.json +22 -22
- package/dist/NumberWithSuffix-CrA6quxx.js +0 -445
- package/dist/cdn/chunks/NumberWithSuffix-Conp_Pki.js +0 -444
- package/dist/cdn/chunks/NumberWithSuffix-Conp_Pki.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-CJNgRMhw.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-Cebdzomd.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-7BhmKL-_.js.map +0 -1
- package/dist/cdn/chunks/ca-C58VqAgo.js.map +0 -1
- package/dist/cdn/chunks/de-C0sMmfic.js.map +0 -1
- package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +0 -1
- package/dist/cdn/chunks/en-CsGBTBOf.js.map +0 -1
- package/dist/cdn/chunks/es-DgjbcPIu.js.map +0 -1
- package/dist/cdn/chunks/features-DO71hPJr.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-DXaP5lMJ.js.map +0 -1
- package/dist/cdn/chunks/quality-B6V4R_df.js +0 -2180
- package/dist/cdn/chunks/styleConstants-lGobwiLH.js +0 -57
- package/dist/cdn/chunks/styleConstants-lGobwiLH.js.map +0 -1
- package/dist/dist-DR-6IpV6.js +0 -5
- package/dist/dist-DW8b0TO6.js +0 -5
- package/dist/styleConstants-lGobwiLH.js +0 -55
- package/dist/usePopoverRoot-DKUDnr55.js +0 -8
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
import { A as e, Dt as t, Et as n, N as r, O as i, Ot as a, R as o, Y as s, _ as c, c as l, d as u, h as d, j as f, l as p, nt as m, r as h, s as g, u as _ } from "./vue.runtime.esm-bundler-l0XAqiyv.js";
|
|
2
|
-
import { s as v, t as y } from "./runtime-dom.esm-bundler-BzuoCyNp.js";
|
|
3
|
-
import { t as b } from "./dist-BEWiuOMi.js";
|
|
4
|
-
import { t as ee } from "./useI18n-C-TDeJBt.js";
|
|
5
|
-
import { t as te } from "./x-CQSvXnGR.js";
|
|
6
|
-
import { h as x, m as S, p as C, u as ne } from "./styleConstants-lGobwiLH.js";
|
|
7
|
-
//#region ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
|
|
8
|
-
var w = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, T = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
|
|
9
|
-
360 / (Math.PI * 2);
|
|
10
|
-
var E = (e) => ae(D(e)), D = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
11
|
-
r: parseInt(e[0] + e[0], 16),
|
|
12
|
-
g: parseInt(e[1] + e[1], 16),
|
|
13
|
-
b: parseInt(e[2] + e[2], 16),
|
|
14
|
-
a: e.length === 4 ? T(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
15
|
-
} : {
|
|
16
|
-
r: parseInt(e.substring(0, 2), 16),
|
|
17
|
-
g: parseInt(e.substring(2, 4), 16),
|
|
18
|
-
b: parseInt(e.substring(4, 6), 16),
|
|
19
|
-
a: e.length === 8 ? T(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
20
|
-
}), O = (e) => ie(re(e)), k = ({ h: e, s: t, v: n, a: r }) => {
|
|
21
|
-
let i = (200 - t) * n / 100;
|
|
22
|
-
return {
|
|
23
|
-
h: T(e),
|
|
24
|
-
s: T(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
25
|
-
l: T(i / 2),
|
|
26
|
-
a: T(r, 2)
|
|
27
|
-
};
|
|
28
|
-
}, A = (e) => {
|
|
29
|
-
let { h: t, s: n, l: r } = k(e);
|
|
30
|
-
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
31
|
-
}, re = ({ h: e, s: t, v: n, a: r }) => {
|
|
32
|
-
e = e / 360 * 6, t /= 100, n /= 100;
|
|
33
|
-
let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
|
|
34
|
-
return {
|
|
35
|
-
r: T([
|
|
36
|
-
n,
|
|
37
|
-
o,
|
|
38
|
-
a,
|
|
39
|
-
a,
|
|
40
|
-
s,
|
|
41
|
-
n
|
|
42
|
-
][c] * 255),
|
|
43
|
-
g: T([
|
|
44
|
-
s,
|
|
45
|
-
n,
|
|
46
|
-
n,
|
|
47
|
-
o,
|
|
48
|
-
a,
|
|
49
|
-
a
|
|
50
|
-
][c] * 255),
|
|
51
|
-
b: T([
|
|
52
|
-
a,
|
|
53
|
-
a,
|
|
54
|
-
s,
|
|
55
|
-
n,
|
|
56
|
-
n,
|
|
57
|
-
o
|
|
58
|
-
][c] * 255),
|
|
59
|
-
a: T(r, 2)
|
|
60
|
-
};
|
|
61
|
-
}, j = (e) => {
|
|
62
|
-
let t = e.toString(16);
|
|
63
|
-
return t.length < 2 ? "0" + t : t;
|
|
64
|
-
}, ie = ({ r: e, g: t, b: n, a: r }) => {
|
|
65
|
-
let i = r < 1 ? j(T(r * 255)) : "";
|
|
66
|
-
return "#" + j(e) + j(t) + j(n) + i;
|
|
67
|
-
}, ae = ({ r: e, g: t, b: n, a: r }) => {
|
|
68
|
-
let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
|
|
69
|
-
return {
|
|
70
|
-
h: T(60 * (o < 0 ? o + 6 : o)),
|
|
71
|
-
s: T(i ? a / i * 100 : 0),
|
|
72
|
-
v: T(i / 255 * 100),
|
|
73
|
-
a: r
|
|
74
|
-
};
|
|
75
|
-
}, M = (e, t) => {
|
|
76
|
-
if (e === t) return !0;
|
|
77
|
-
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
78
|
-
return !0;
|
|
79
|
-
}, N = (e, t) => e.toLowerCase() === t.toLowerCase() || M(D(e), D(t)), P = {}, F = (e) => {
|
|
80
|
-
let t = P[e];
|
|
81
|
-
return t || (t = document.createElement("template"), t.innerHTML = e, P[e] = t), t;
|
|
82
|
-
}, I = (e, t, n) => {
|
|
83
|
-
e.dispatchEvent(new CustomEvent(t, {
|
|
84
|
-
bubbles: !0,
|
|
85
|
-
detail: n
|
|
86
|
-
}));
|
|
87
|
-
}, L = !1, R = (e) => "touches" in e, oe = (e) => L && !R(e) ? !1 : (L ||= R(e), !0), z = (e, t) => {
|
|
88
|
-
let n = R(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
89
|
-
I(e.el, "move", e.getMove({
|
|
90
|
-
x: w((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
91
|
-
y: w((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
92
|
-
}));
|
|
93
|
-
}, B = (e, t) => {
|
|
94
|
-
let n = t.keyCode;
|
|
95
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), I(e.el, "move", e.getMove({
|
|
96
|
-
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
97
|
-
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
98
|
-
}, !0)));
|
|
99
|
-
}, V = class {
|
|
100
|
-
constructor(e, t, n, r) {
|
|
101
|
-
let i = F(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
102
|
-
e.appendChild(i.content.cloneNode(!0));
|
|
103
|
-
let a = e.querySelector(`[part=${t}]`);
|
|
104
|
-
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
105
|
-
}
|
|
106
|
-
set dragging(e) {
|
|
107
|
-
let t = e ? document.addEventListener : document.removeEventListener;
|
|
108
|
-
t(L ? "touchmove" : "mousemove", this), t(L ? "touchend" : "mouseup", this);
|
|
109
|
-
}
|
|
110
|
-
handleEvent(e) {
|
|
111
|
-
switch (e.type) {
|
|
112
|
-
case "mousedown":
|
|
113
|
-
case "touchstart":
|
|
114
|
-
if (e.preventDefault(), !oe(e) || !L && e.button != 0) return;
|
|
115
|
-
this.el.focus(), z(this, e), this.dragging = !0;
|
|
116
|
-
break;
|
|
117
|
-
case "mousemove":
|
|
118
|
-
case "touchmove":
|
|
119
|
-
e.preventDefault(), z(this, e);
|
|
120
|
-
break;
|
|
121
|
-
case "mouseup":
|
|
122
|
-
case "touchend":
|
|
123
|
-
this.dragging = !1;
|
|
124
|
-
break;
|
|
125
|
-
case "keydown":
|
|
126
|
-
B(this, e);
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
style(e) {
|
|
131
|
-
e.forEach((e, t) => {
|
|
132
|
-
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}, H = class extends V {
|
|
136
|
-
constructor(e) {
|
|
137
|
-
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
138
|
-
}
|
|
139
|
-
update({ h: e }) {
|
|
140
|
-
this.h = e, this.style([{
|
|
141
|
-
left: `${e / 360 * 100}%`,
|
|
142
|
-
color: A({
|
|
143
|
-
h: e,
|
|
144
|
-
s: 100,
|
|
145
|
-
v: 100,
|
|
146
|
-
a: 1
|
|
147
|
-
})
|
|
148
|
-
}]), this.el.setAttribute("aria-valuenow", `${T(e)}`);
|
|
149
|
-
}
|
|
150
|
-
getMove(e, t) {
|
|
151
|
-
return { h: t ? w(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
152
|
-
}
|
|
153
|
-
}, U = class extends V {
|
|
154
|
-
constructor(e) {
|
|
155
|
-
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
156
|
-
}
|
|
157
|
-
update(e) {
|
|
158
|
-
this.hsva = e, this.style([{
|
|
159
|
-
top: `${100 - e.v}%`,
|
|
160
|
-
left: `${e.s}%`,
|
|
161
|
-
color: A(e)
|
|
162
|
-
}, { "background-color": A({
|
|
163
|
-
h: e.h,
|
|
164
|
-
s: 100,
|
|
165
|
-
v: 100,
|
|
166
|
-
a: 1
|
|
167
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${T(e.s)}%, Brightness ${T(e.v)}%`);
|
|
168
|
-
}
|
|
169
|
-
getMove(e, t) {
|
|
170
|
-
return {
|
|
171
|
-
s: t ? w(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
172
|
-
v: t ? w(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
}, W = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", G = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", K = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", q = Symbol("same"), J = Symbol("color"), Y = Symbol("hsva"), X = Symbol("update"), Z = Symbol("parts"), Q = Symbol("css"), $ = Symbol("sliders"), se = class extends HTMLElement {
|
|
176
|
-
static get observedAttributes() {
|
|
177
|
-
return ["color"];
|
|
178
|
-
}
|
|
179
|
-
get [Q]() {
|
|
180
|
-
return [
|
|
181
|
-
W,
|
|
182
|
-
G,
|
|
183
|
-
K
|
|
184
|
-
];
|
|
185
|
-
}
|
|
186
|
-
get [$]() {
|
|
187
|
-
return [U, H];
|
|
188
|
-
}
|
|
189
|
-
get color() {
|
|
190
|
-
return this[J];
|
|
191
|
-
}
|
|
192
|
-
set color(e) {
|
|
193
|
-
if (!this[q](e)) {
|
|
194
|
-
let t = this.colorModel.toHsva(e);
|
|
195
|
-
this[X](t), this[J] = e;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
constructor() {
|
|
199
|
-
super();
|
|
200
|
-
let e = F(`<style>${this[Q].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
201
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Z] = this[$].map((e) => new e(t));
|
|
202
|
-
}
|
|
203
|
-
connectedCallback() {
|
|
204
|
-
if (this.hasOwnProperty("color")) {
|
|
205
|
-
let e = this.color;
|
|
206
|
-
delete this.color, this.color = e;
|
|
207
|
-
} else this.color ||= this.colorModel.defaultColor;
|
|
208
|
-
}
|
|
209
|
-
attributeChangedCallback(e, t, n) {
|
|
210
|
-
let r = this.colorModel.fromAttr(n);
|
|
211
|
-
this[q](r) || (this.color = r);
|
|
212
|
-
}
|
|
213
|
-
handleEvent(e) {
|
|
214
|
-
let t = this[Y], n = {
|
|
215
|
-
...t,
|
|
216
|
-
...e.detail
|
|
217
|
-
};
|
|
218
|
-
this[X](n);
|
|
219
|
-
let r;
|
|
220
|
-
!M(n, t) && !this[q](r = this.colorModel.fromHsva(n)) && (this[J] = r, I(this, "color-changed", { value: r }));
|
|
221
|
-
}
|
|
222
|
-
[q](e) {
|
|
223
|
-
return this.color && this.colorModel.equal(e, this.color);
|
|
224
|
-
}
|
|
225
|
-
[X](e) {
|
|
226
|
-
this[Y] = e, this[Z].forEach((t) => t.update(e));
|
|
227
|
-
}
|
|
228
|
-
}, ce = {
|
|
229
|
-
defaultColor: "#000",
|
|
230
|
-
toHsva: E,
|
|
231
|
-
fromHsva: ({ h: e, s: t, v: n }) => O({
|
|
232
|
-
h: e,
|
|
233
|
-
s: t,
|
|
234
|
-
v: n,
|
|
235
|
-
a: 1
|
|
236
|
-
}),
|
|
237
|
-
equal: N,
|
|
238
|
-
fromAttr: (e) => e
|
|
239
|
-
}, le = class extends se {
|
|
240
|
-
get colorModel() {
|
|
241
|
-
return ce;
|
|
242
|
-
}
|
|
243
|
-
}, ue = class extends le {};
|
|
244
|
-
customElements.define("hex-color-picker", ue);
|
|
245
|
-
//#endregion
|
|
246
|
-
//#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
247
|
-
var de = [
|
|
248
|
-
"disabled",
|
|
249
|
-
"aria-label",
|
|
250
|
-
"aria-expanded"
|
|
251
|
-
], fe = {
|
|
252
|
-
key: 0,
|
|
253
|
-
class: "tpl:relative tpl:flex-1"
|
|
254
|
-
}, pe = [
|
|
255
|
-
"value",
|
|
256
|
-
"placeholder",
|
|
257
|
-
"disabled",
|
|
258
|
-
"aria-label"
|
|
259
|
-
], me = ["aria-label", "title"], he = ["color", "aria-label"], ge = /* @__PURE__ */ c({
|
|
260
|
-
__name: "ColorPicker",
|
|
261
|
-
props: {
|
|
262
|
-
modelValue: {},
|
|
263
|
-
placeholder: { default: "" },
|
|
264
|
-
seedColor: { default: "#ffffff" },
|
|
265
|
-
swatchOnly: {
|
|
266
|
-
type: Boolean,
|
|
267
|
-
default: !1
|
|
268
|
-
},
|
|
269
|
-
disabled: {
|
|
270
|
-
type: Boolean,
|
|
271
|
-
default: !1
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
emits: ["update:modelValue"],
|
|
275
|
-
setup(e, { emit: r }) {
|
|
276
|
-
let a = e, c = r, { t: f } = ee(), p = s(!1), h = s(), x = s(), S = s(!1);
|
|
277
|
-
b(h, () => {
|
|
278
|
-
p.value = !1;
|
|
279
|
-
}, { ignore: [x] });
|
|
280
|
-
let C = g(() => !a.modelValue), w = g(() => a.modelValue || a.seedColor), T = g(() => !a.swatchOnly && !a.disabled && !C.value);
|
|
281
|
-
function E(e) {
|
|
282
|
-
S.value = !0, c("update:modelValue", e.detail.value);
|
|
283
|
-
}
|
|
284
|
-
function D() {
|
|
285
|
-
S.value = !1;
|
|
286
|
-
}
|
|
287
|
-
function O() {
|
|
288
|
-
!S.value && C.value && c("update:modelValue", w.value);
|
|
289
|
-
}
|
|
290
|
-
function k(e) {
|
|
291
|
-
c("update:modelValue", e.target.value);
|
|
292
|
-
}
|
|
293
|
-
function A() {
|
|
294
|
-
c("update:modelValue", "");
|
|
295
|
-
}
|
|
296
|
-
return (r, a) => (i(), u("div", { class: n(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
297
|
-
l("button", {
|
|
298
|
-
ref_key: "swatchRef",
|
|
299
|
-
ref: x,
|
|
300
|
-
type: "button",
|
|
301
|
-
disabled: e.disabled,
|
|
302
|
-
"aria-label": m(f).colorPicker.pickColor,
|
|
303
|
-
"aria-expanded": p.value,
|
|
304
|
-
class: n([
|
|
305
|
-
"tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
306
|
-
e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
|
|
307
|
-
p.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
|
|
308
|
-
"tpl:size-10"
|
|
309
|
-
]),
|
|
310
|
-
onClick: a[0] ||= (t) => !e.disabled && (p.value = !p.value)
|
|
311
|
-
}, [l("span", {
|
|
312
|
-
class: n(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", { "tpl-color-swatch-empty": C.value }]),
|
|
313
|
-
style: t(C.value ? void 0 : { backgroundColor: e.modelValue })
|
|
314
|
-
}, null, 6)], 10, de),
|
|
315
|
-
e.swatchOnly ? _("", !0) : (i(), u("div", fe, [l("input", {
|
|
316
|
-
type: "text",
|
|
317
|
-
class: n([m(ne), "tpl:w-full"]),
|
|
318
|
-
style: t(T.value ? { paddingRight: "2.25rem" } : void 0),
|
|
319
|
-
value: e.modelValue,
|
|
320
|
-
placeholder: e.placeholder || m(f).colorPicker.notSet,
|
|
321
|
-
disabled: e.disabled,
|
|
322
|
-
"aria-label": m(f).colorPicker.hexValue,
|
|
323
|
-
onInput: k
|
|
324
|
-
}, null, 46, pe), T.value ? (i(), u("button", {
|
|
325
|
-
key: 0,
|
|
326
|
-
type: "button",
|
|
327
|
-
"aria-label": m(f).colorPicker.clear,
|
|
328
|
-
title: m(f).colorPicker.clear,
|
|
329
|
-
class: "tpl:absolute tpl:right-2 tpl:top-1/2 tpl:flex tpl:size-6 tpl:-translate-y-1/2 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:text-[var(--tpl-text-dim)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)]",
|
|
330
|
-
onClick: A
|
|
331
|
-
}, [d(m(te), {
|
|
332
|
-
size: 14,
|
|
333
|
-
"stroke-width": 1.5
|
|
334
|
-
})], 8, me)) : _("", !0)])),
|
|
335
|
-
d(y, {
|
|
336
|
-
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
337
|
-
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
338
|
-
"enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
339
|
-
"leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
340
|
-
"leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
|
|
341
|
-
"leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
|
|
342
|
-
}, {
|
|
343
|
-
default: o(() => [p.value ? (i(), u("div", {
|
|
344
|
-
key: 0,
|
|
345
|
-
ref_key: "popoverRef",
|
|
346
|
-
ref: h,
|
|
347
|
-
class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
|
|
348
|
-
}, [l("hex-color-picker", {
|
|
349
|
-
color: w.value,
|
|
350
|
-
"aria-label": m(f).colorPicker.pickColor,
|
|
351
|
-
onColorChanged: E,
|
|
352
|
-
onPointerdown: D,
|
|
353
|
-
onPointerup: O,
|
|
354
|
-
onKeydown: a[1] ||= v((e) => p.value = !1, ["escape"])
|
|
355
|
-
}, null, 40, he)], 512)) : _("", !0)]),
|
|
356
|
-
_: 1
|
|
357
|
-
})
|
|
358
|
-
], 2));
|
|
359
|
-
}
|
|
360
|
-
}), _e = [
|
|
361
|
-
"aria-checked",
|
|
362
|
-
"aria-label",
|
|
363
|
-
"title",
|
|
364
|
-
"onClick"
|
|
365
|
-
], ve = { key: 1 }, ye = /* @__PURE__ */ c({
|
|
366
|
-
__name: "SlidingPillSelect",
|
|
367
|
-
props: {
|
|
368
|
-
options: {},
|
|
369
|
-
modelValue: {}
|
|
370
|
-
},
|
|
371
|
-
emits: ["update:modelValue"],
|
|
372
|
-
setup(n, { emit: o }) {
|
|
373
|
-
let s = n, c = o, l = g(() => s.options.findIndex((e) => e.value === s.modelValue)), d = g(() => `translateX(${Math.max(l.value, 0) * 100}%)`);
|
|
374
|
-
return (o, s) => (i(), u("div", {
|
|
375
|
-
role: "radiogroup",
|
|
376
|
-
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
377
|
-
style: t({
|
|
378
|
-
gridTemplateColumns: `repeat(${n.options.length}, 1fr)`,
|
|
379
|
-
backgroundColor: "var(--tpl-bg-hover)"
|
|
380
|
-
})
|
|
381
|
-
}, [l.value >= 0 ? (i(), u("div", {
|
|
382
|
-
key: 0,
|
|
383
|
-
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
384
|
-
style: t({
|
|
385
|
-
left: "4px",
|
|
386
|
-
width: `calc((100% - 8px) / ${n.options.length})`,
|
|
387
|
-
transform: d.value,
|
|
388
|
-
backgroundColor: "var(--tpl-bg)",
|
|
389
|
-
boxShadow: "var(--tpl-shadow)",
|
|
390
|
-
transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
391
|
-
})
|
|
392
|
-
}, null, 4)) : _("", !0), (i(!0), u(h, null, e(n.options, (e) => (i(), u("button", {
|
|
393
|
-
key: e.value,
|
|
394
|
-
role: "radio",
|
|
395
|
-
"aria-checked": n.modelValue === e.value,
|
|
396
|
-
"aria-label": e.label,
|
|
397
|
-
class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
|
|
398
|
-
style: t({
|
|
399
|
-
color: n.modelValue === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
400
|
-
transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
401
|
-
}),
|
|
402
|
-
title: e.label,
|
|
403
|
-
onClick: (t) => c("update:modelValue", e.value)
|
|
404
|
-
}, [e.icon ? (i(), p(r(e.icon), {
|
|
405
|
-
key: 0,
|
|
406
|
-
size: 14,
|
|
407
|
-
"stroke-width": 2
|
|
408
|
-
})) : (i(), u("span", ve, a(e.label), 1))], 12, _e))), 128))], 4));
|
|
409
|
-
}
|
|
410
|
-
}), be = { class: "tpl:mb-3.5" }, xe = /* @__PURE__ */ c({
|
|
411
|
-
__name: "FieldRow",
|
|
412
|
-
props: { label: {} },
|
|
413
|
-
setup(e) {
|
|
414
|
-
return (t, r) => (i(), u("div", be, [e.label ? (i(), u("label", {
|
|
415
|
-
key: 0,
|
|
416
|
-
class: n(m(x))
|
|
417
|
-
}, a(e.label), 3)) : _("", !0), f(t.$slots, "default")]));
|
|
418
|
-
}
|
|
419
|
-
}), Se = { class: "tpl:flex tpl:items-stretch" }, Ce = [
|
|
420
|
-
"value",
|
|
421
|
-
"min",
|
|
422
|
-
"max"
|
|
423
|
-
], we = /* @__PURE__ */ c({
|
|
424
|
-
__name: "NumberWithSuffix",
|
|
425
|
-
props: {
|
|
426
|
-
modelValue: {},
|
|
427
|
-
min: {},
|
|
428
|
-
max: {},
|
|
429
|
-
suffix: {}
|
|
430
|
-
},
|
|
431
|
-
emits: ["update:modelValue"],
|
|
432
|
-
setup(e, { emit: t }) {
|
|
433
|
-
let r = t;
|
|
434
|
-
return (t, o) => (i(), u("div", Se, [l("input", {
|
|
435
|
-
type: "number",
|
|
436
|
-
class: n(m(C)),
|
|
437
|
-
value: e.modelValue,
|
|
438
|
-
min: e.min,
|
|
439
|
-
max: e.max,
|
|
440
|
-
onInput: o[0] ||= (e) => r("update:modelValue", Number(e.target.value))
|
|
441
|
-
}, null, 42, Ce), l("span", { class: n(m(S)) }, a(e.suffix), 3)]));
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
//#endregion
|
|
445
|
-
export { ge as i, xe as n, ye as r, we as t };
|