@templatical/editor 0.54.2 → 0.55.0
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/{AiAltTextPopover-BBKVJ6HA.js → AiAltTextPopover-D5QosKvB.js} +1 -1
- package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-D1W_lrI_.js} +1 -1
- package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-BwztoMov.js} +4 -4
- package/dist/{BlockPreviewCanvas-DtOo5y3U.js → BlockPreviewCanvas-C23A6FRm.js} +4 -4
- package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-Baoaj6Xf.js} +1 -1
- package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
- package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-nmFhWG1p.js} +1 -1
- package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-DcABUYop.js} +3 -3
- package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
- package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-JJeZbFkD.js} +1 -1
- package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
- package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
- package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-VXYwGoz_.js} +8 -8
- package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
- package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
- package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
- package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
- package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
- package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
- package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-C_LHLm5M.js} +4 -4
- package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-CLIRn7eL.js} +5 -5
- package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-frdtjC8h.js} +1 -1
- package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-D5kC56Jl.js} +4 -4
- package/dist/{Toolbar-BppchV2k.js → Toolbar-D904Yw_R.js} +551 -503
- package/dist/{TplModal-BFWOoK8l.js → TplModal-BBdotDf1.js} +1 -1
- package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
- package/dist/{WrapperBlock-BUzQTZuu.js → WrapperBlock-BAT3T0Cz.js} +3 -3
- package/dist/{blockTypeIcons-D91v9k0x.js → blockTypeIcons-CoRQV_hP.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/{cdn/chunks/ca-DOuIxWRv.js → ca-DIkMxYCN.js} +10 -3
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-B9vm_L-8.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-CQ0vNgsH.js} +2 -2
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-BoHeIjvw.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-BnYN5N1h.js} +7 -7
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
- package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-BELdMRni.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-Cal9hY3U.js} +9 -9
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-C6N9RFls.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-CpoKZ8oV.js} +5 -5
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-DI3z__Bd.js} +8 -8
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-C2syRLdZ.js} +4 -4
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-NEE8qxYh.js} +754 -706
- package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-B1MgvtX8.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-B1MgvtX8.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js → WrapperBlock-DFY-7YSs.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js.map → WrapperBlock-DFY-7YSs.js.map} +1 -1
- package/dist/{ca-DOuIxWRv.js → cdn/chunks/ca-DIkMxYCN.js} +12 -1
- package/dist/cdn/chunks/{ca-DOuIxWRv.js.map → ca-DIkMxYCN.js.map} +1 -1
- package/dist/cdn/chunks/{composables-BxikPuC1.js → composables-nyxwrM27.js} +610 -594
- package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js.map → createCloudRuntime-DJkDGKQ_.js.map} +1 -1
- package/dist/{de-DaOUfYBX.js → cdn/chunks/de-Cc6Ue0UD.js} +12 -1
- package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +1 -0
- package/dist/cdn/chunks/{en-C0pHHMiR.js → en-BX4FujAQ.js} +11 -2
- package/dist/cdn/chunks/en-BX4FujAQ.js.map +1 -0
- package/dist/{es-CxyEKr6n.js → cdn/chunks/es-Do5b-MKU.js} +12 -1
- package/dist/cdn/chunks/es-Do5b-MKU.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DuDWpKo7.js → extensions-BcwkOjVq.js} +76 -70
- package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +1 -0
- package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-S1n2Ebzp.js} +12 -1
- package/dist/cdn/chunks/fr-S1n2Ebzp.js.map +1 -0
- package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +11 -2
- package/dist/cdn/chunks/ja-DLwcq4bA.js.map +1 -0
- package/dist/{nl-DkrB-VKZ.js → cdn/chunks/nl-0JSWaZpT.js} +12 -1
- package/dist/cdn/chunks/nl-0JSWaZpT.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-Bn_hl4jd.js → normalizeMergeTagMarkup-BrGw5jxk.js} +99 -89
- package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Cj0XYwuh.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js.map → preRenderCustomBlocks-Cj0XYwuh.js.map} +1 -1
- package/dist/{pt-BR-CY5Ye7eP.js → cdn/chunks/pt-BR-D3VlIMDZ.js} +12 -1
- package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +1 -0
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js → sanitizeHtml-GxJCxKcP.js} +3 -3
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-B5zrrV8-.js} +387 -386
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
- package/dist/cdn/chunks/{src-712f3ofG.js → src-Diw9SLIe.js} +673 -554
- package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
- package/dist/cdn/chunks/{src-B2tQbzf6.js → src-UR3AQocX.js} +221 -215
- package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
- package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-v47QHNmB.js} +809 -659
- package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
- package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-Cbp3I7UN.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-1lrpNyR5.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-DZfmiv8V.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
- package/dist/cdn/editor.js +284 -284
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{composables-BbPFRlBf.js → composables-DPgNn9GZ.js} +929 -913
- package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
- package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
- package/dist/{dist-C34cYI5S.js → dist-CBdk1Vcb.js} +963 -813
- package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
- package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
- package/dist/{extensions-xCiyqSg7.js → extensions-QFAARrjF.js} +338 -332
- package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
- package/dist/index.d.ts +14 -1
- package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
- package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
- package/dist/{normalizeMergeTagMarkup-C7FGNURu.js → normalizeMergeTagMarkup-BS0nRvhq.js} +89 -79
- package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CiKvKd8V.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
- package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-USjTyALR.js} +1 -1
- package/dist/{socialIcons-DhAolBjt.js → socialIcons-NvIg5ahU.js} +338 -337
- package/dist/templatical-editor.js +41 -41
- package/dist/{useLocalizedDisplay-C9MBFUr4.js → useLocalizedDisplay-LdjosX4w.js} +1 -1
- package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-D8zgkXfb.js} +1 -1
- package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-k7Kr0nMd.js} +1 -1
- package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-Bzeg_gfH.js} +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
- package/dist/cdn/chunks/composables-BxikPuC1.js.map +0 -1
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
- package/dist/cdn/chunks/extensions-DuDWpKo7.js.map +0 -1
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
- package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
- package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
- package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { B as e, Ft as t, M as n, Mt as r, O as i, P as a, Pt as o, S as s, U as c, Y as l, Z as u, _ as d, a as f, c as p, ct as m, d as h, et as g, f as _, g as v, l as y, q as b, r as x, u as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
2
|
import { c as T, n as E, s as ee, t as D } from "./runtime-dom.esm-bundler-DlHp8xgy.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import { et as
|
|
8
|
-
import { t as
|
|
9
|
-
import { d as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { a as
|
|
13
|
-
import { t as
|
|
14
|
-
var
|
|
3
|
+
import { Jt as O, ct as te, dt as k, ft as A, g as j, qt as M, vt as N } from "./dist-CBdk1Vcb.js";
|
|
4
|
+
import { t as P } from "./createLucideIcon-CgDE3xAR.js";
|
|
5
|
+
import { t as F } from "./pencil-BK7GrQuA.js";
|
|
6
|
+
import { t as I } from "./x-BIBStNMS.js";
|
|
7
|
+
import { et as ne, it as re, p as ie, tt as L } from "./keys-BCqskl51.js";
|
|
8
|
+
import { t as R } from "./useI18n-CgtvtF4C.js";
|
|
9
|
+
import { d as ae } from "./styleConstants-CgiNKdnc.js";
|
|
10
|
+
import { t as oe } from "./dist-0alKVRc_.js";
|
|
11
|
+
import { t as z } from "./useMergeTag-k7Kr0nMd.js";
|
|
12
|
+
import { a as se, c as ce, n as le, o as ue, r as de, s as fe, t as pe } from "./usePopoverPosition-VDQjyX_A.js";
|
|
13
|
+
import { t as me } from "./useLogicTag-D8zgkXfb.js";
|
|
14
|
+
var B = P({
|
|
15
15
|
name: "braces",
|
|
16
16
|
size: 24,
|
|
17
17
|
node: [["path", {
|
|
@@ -22,7 +22,7 @@ var z = M({
|
|
|
22
22
|
key: "e1hn23"
|
|
23
23
|
}]],
|
|
24
24
|
aliases: ["curly-braces"]
|
|
25
|
-
}),
|
|
25
|
+
}), V = P({
|
|
26
26
|
name: "scan-line",
|
|
27
27
|
size: 24,
|
|
28
28
|
node: [
|
|
@@ -47,32 +47,32 @@ var z = M({
|
|
|
47
47
|
key: "b7w52i"
|
|
48
48
|
}]
|
|
49
49
|
]
|
|
50
|
-
}),
|
|
50
|
+
}), H = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, U = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n, he = (e) => be(W(e)), W = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
51
51
|
r: parseInt(e[0] + e[0], 16),
|
|
52
52
|
g: parseInt(e[1] + e[1], 16),
|
|
53
53
|
b: parseInt(e[2] + e[2], 16),
|
|
54
|
-
a: e.length === 4 ?
|
|
54
|
+
a: e.length === 4 ? U(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
55
55
|
} : {
|
|
56
56
|
r: parseInt(e.substring(0, 2), 16),
|
|
57
57
|
g: parseInt(e.substring(2, 4), 16),
|
|
58
58
|
b: parseInt(e.substring(4, 6), 16),
|
|
59
|
-
a: e.length === 8 ?
|
|
60
|
-
}),
|
|
59
|
+
a: e.length === 8 ? U(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
60
|
+
}), ge = (e) => ye(ve(e)), _e = ({ h: e, s: t, v: n, a: r }) => {
|
|
61
61
|
let i = (200 - t) * n / 100;
|
|
62
62
|
return {
|
|
63
|
-
h:
|
|
64
|
-
s:
|
|
65
|
-
l:
|
|
66
|
-
a:
|
|
63
|
+
h: U(e),
|
|
64
|
+
s: U(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
65
|
+
l: U(i / 2),
|
|
66
|
+
a: U(r, 2)
|
|
67
67
|
};
|
|
68
|
-
},
|
|
69
|
-
let { h: t, s: n, l: r } =
|
|
68
|
+
}, G = (e) => {
|
|
69
|
+
let { h: t, s: n, l: r } = _e(e);
|
|
70
70
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
71
|
-
},
|
|
71
|
+
}, ve = ({ h: e, s: t, v: n, a: r }) => {
|
|
72
72
|
e = e / 360 * 6, t /= 100, n /= 100;
|
|
73
73
|
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;
|
|
74
74
|
return {
|
|
75
|
-
r:
|
|
75
|
+
r: U([
|
|
76
76
|
n,
|
|
77
77
|
o,
|
|
78
78
|
a,
|
|
@@ -80,7 +80,7 @@ var z = M({
|
|
|
80
80
|
s,
|
|
81
81
|
n
|
|
82
82
|
][c] * 255),
|
|
83
|
-
g:
|
|
83
|
+
g: U([
|
|
84
84
|
s,
|
|
85
85
|
n,
|
|
86
86
|
n,
|
|
@@ -88,7 +88,7 @@ var z = M({
|
|
|
88
88
|
a,
|
|
89
89
|
a
|
|
90
90
|
][c] * 255),
|
|
91
|
-
b:
|
|
91
|
+
b: U([
|
|
92
92
|
a,
|
|
93
93
|
a,
|
|
94
94
|
s,
|
|
@@ -96,73 +96,73 @@ var z = M({
|
|
|
96
96
|
n,
|
|
97
97
|
o
|
|
98
98
|
][c] * 255),
|
|
99
|
-
a:
|
|
99
|
+
a: U(r, 2)
|
|
100
100
|
};
|
|
101
|
-
},
|
|
101
|
+
}, K = (e) => {
|
|
102
102
|
let t = e.toString(16);
|
|
103
103
|
return t.length < 2 ? "0" + t : t;
|
|
104
|
-
},
|
|
105
|
-
let i = r < 1 ?
|
|
106
|
-
return "#" +
|
|
107
|
-
},
|
|
104
|
+
}, ye = ({ r: e, g: t, b: n, a: r }) => {
|
|
105
|
+
let i = r < 1 ? K(U(r * 255)) : "";
|
|
106
|
+
return "#" + K(e) + K(t) + K(n) + i;
|
|
107
|
+
}, be = ({ r: e, g: t, b: n, a: r }) => {
|
|
108
108
|
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;
|
|
109
109
|
return {
|
|
110
|
-
h:
|
|
111
|
-
s:
|
|
112
|
-
v:
|
|
110
|
+
h: U(60 * (o < 0 ? o + 6 : o)),
|
|
111
|
+
s: U(i ? a / i * 100 : 0),
|
|
112
|
+
v: U(i / 255 * 100),
|
|
113
113
|
a: r
|
|
114
114
|
};
|
|
115
|
-
},
|
|
115
|
+
}, q = (e, t) => {
|
|
116
116
|
if (e === t) return !0;
|
|
117
117
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
118
118
|
return !0;
|
|
119
|
-
},
|
|
120
|
-
let t =
|
|
121
|
-
return t || (t = document.createElement("template"), t.innerHTML = e,
|
|
122
|
-
},
|
|
119
|
+
}, xe = (e, t) => e.toLowerCase() === t.toLowerCase() || q(W(e), W(t)), J = {}, Se = (e) => {
|
|
120
|
+
let t = J[e];
|
|
121
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, J[e] = t), t;
|
|
122
|
+
}, Y = (e, t, n) => {
|
|
123
123
|
e.dispatchEvent(new CustomEvent(t, {
|
|
124
124
|
bubbles: !0,
|
|
125
125
|
detail: n
|
|
126
126
|
}));
|
|
127
|
-
},
|
|
128
|
-
let n =
|
|
129
|
-
|
|
130
|
-
x:
|
|
131
|
-
y:
|
|
127
|
+
}, X = !1, Z = (e) => "touches" in e, Ce = (e) => X && !Z(e) ? !1 : (X ||= Z(e), !0), Q = (e, t) => {
|
|
128
|
+
let n = Z(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
129
|
+
Y(e.el, "move", e.getMove({
|
|
130
|
+
x: H((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
131
|
+
y: H((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
132
132
|
}));
|
|
133
|
-
},
|
|
133
|
+
}, we = (e, t) => {
|
|
134
134
|
let n = t.keyCode;
|
|
135
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(),
|
|
135
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), Y(e.el, "move", e.getMove({
|
|
136
136
|
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
137
137
|
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
138
138
|
}, !0)));
|
|
139
|
-
},
|
|
139
|
+
}, Te = class {
|
|
140
140
|
constructor(e, t, n, r) {
|
|
141
|
-
let i =
|
|
141
|
+
let i = Se(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
142
142
|
e.appendChild(i.content.cloneNode(!0));
|
|
143
143
|
let a = e.querySelector(`[part=${t}]`);
|
|
144
144
|
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
145
145
|
}
|
|
146
146
|
set dragging(e) {
|
|
147
147
|
let t = e ? document.addEventListener : document.removeEventListener;
|
|
148
|
-
t(
|
|
148
|
+
t(X ? "touchmove" : "mousemove", this), t(X ? "touchend" : "mouseup", this);
|
|
149
149
|
}
|
|
150
150
|
handleEvent(e) {
|
|
151
151
|
switch (e.type) {
|
|
152
152
|
case "mousedown":
|
|
153
153
|
case "touchstart":
|
|
154
|
-
if (e.preventDefault(), !
|
|
155
|
-
this.el.focus(),
|
|
154
|
+
if (e.preventDefault(), !Ce(e) || !X && e.button != 0) return;
|
|
155
|
+
this.el.focus(), Q(this, e), this.dragging = !0;
|
|
156
156
|
break;
|
|
157
157
|
case "mousemove":
|
|
158
158
|
case "touchmove":
|
|
159
|
-
e.preventDefault(),
|
|
159
|
+
e.preventDefault(), Q(this, e);
|
|
160
160
|
break;
|
|
161
161
|
case "mouseup":
|
|
162
162
|
case "touchend":
|
|
163
163
|
this.dragging = !1;
|
|
164
164
|
break;
|
|
165
|
-
case "keydown":
|
|
165
|
+
case "keydown": we(this, e);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
style(e) {
|
|
@@ -170,25 +170,25 @@ var z = M({
|
|
|
170
170
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
},
|
|
173
|
+
}, Ee = class extends Te {
|
|
174
174
|
constructor(e) {
|
|
175
175
|
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
176
176
|
}
|
|
177
177
|
update({ h: e }) {
|
|
178
178
|
this.h = e, this.style([{
|
|
179
179
|
left: `${e / 360 * 100}%`,
|
|
180
|
-
color:
|
|
180
|
+
color: G({
|
|
181
181
|
h: e,
|
|
182
182
|
s: 100,
|
|
183
183
|
v: 100,
|
|
184
184
|
a: 1
|
|
185
185
|
})
|
|
186
|
-
}]), this.el.setAttribute("aria-valuenow", `${
|
|
186
|
+
}]), this.el.setAttribute("aria-valuenow", `${U(e)}`);
|
|
187
187
|
}
|
|
188
188
|
getMove(e, t) {
|
|
189
|
-
return { h: t ?
|
|
189
|
+
return { h: t ? H(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, De = class extends Te {
|
|
192
192
|
constructor(e) {
|
|
193
193
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
194
194
|
}
|
|
@@ -196,47 +196,47 @@ var z = M({
|
|
|
196
196
|
this.hsva = e, this.style([{
|
|
197
197
|
top: `${100 - e.v}%`,
|
|
198
198
|
left: `${e.s}%`,
|
|
199
|
-
color:
|
|
200
|
-
}, { "background-color":
|
|
199
|
+
color: G(e)
|
|
200
|
+
}, { "background-color": G({
|
|
201
201
|
h: e.h,
|
|
202
202
|
s: 100,
|
|
203
203
|
v: 100,
|
|
204
204
|
a: 1
|
|
205
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${
|
|
205
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${U(e.s)}%, Brightness ${U(e.v)}%`);
|
|
206
206
|
}
|
|
207
207
|
getMove(e, t) {
|
|
208
208
|
return {
|
|
209
|
-
s: t ?
|
|
210
|
-
v: t ?
|
|
209
|
+
s: t ? H(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
210
|
+
v: t ? H(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
},
|
|
213
|
+
}, Oe = ":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)}", ke = "[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}", Ae = "[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}", $ = Symbol("same"), je = Symbol("color"), Me = Symbol("hsva"), Ne = Symbol("update"), Pe = Symbol("parts"), Fe = Symbol("css"), Ie = Symbol("sliders"), Le = class extends HTMLElement {
|
|
214
214
|
static get observedAttributes() {
|
|
215
215
|
return ["color"];
|
|
216
216
|
}
|
|
217
|
-
get [
|
|
217
|
+
get [Fe]() {
|
|
218
218
|
return [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
Oe,
|
|
220
|
+
ke,
|
|
221
|
+
Ae
|
|
222
222
|
];
|
|
223
223
|
}
|
|
224
|
-
get [
|
|
225
|
-
return [
|
|
224
|
+
get [Ie]() {
|
|
225
|
+
return [De, Ee];
|
|
226
226
|
}
|
|
227
227
|
get color() {
|
|
228
|
-
return this[
|
|
228
|
+
return this[je];
|
|
229
229
|
}
|
|
230
230
|
set color(e) {
|
|
231
|
-
if (!this[
|
|
231
|
+
if (!this[$](e)) {
|
|
232
232
|
let t = this.colorModel.toHsva(e);
|
|
233
|
-
this[
|
|
233
|
+
this[Ne](t), this[je] = e;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
constructor() {
|
|
237
237
|
super();
|
|
238
|
-
let e =
|
|
239
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[
|
|
238
|
+
let e = Se(`<style>${this[Fe].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
239
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Pe] = this[Ie].map((e) => new e(t));
|
|
240
240
|
}
|
|
241
241
|
connectedCallback() {
|
|
242
242
|
if (this.hasOwnProperty("color")) {
|
|
@@ -246,78 +246,78 @@ var z = M({
|
|
|
246
246
|
}
|
|
247
247
|
attributeChangedCallback(e, t, n) {
|
|
248
248
|
let r = this.colorModel.fromAttr(n);
|
|
249
|
-
this[
|
|
249
|
+
this[$](r) || (this.color = r);
|
|
250
250
|
}
|
|
251
251
|
handleEvent(e) {
|
|
252
|
-
let t = this[
|
|
252
|
+
let t = this[Me], n = {
|
|
253
253
|
...t,
|
|
254
254
|
...e.detail
|
|
255
255
|
};
|
|
256
|
-
this[
|
|
256
|
+
this[Ne](n);
|
|
257
257
|
let r;
|
|
258
|
-
!
|
|
258
|
+
!q(n, t) && !this[$](r = this.colorModel.fromHsva(n)) && (this[je] = r, Y(this, "color-changed", { value: r }));
|
|
259
259
|
}
|
|
260
|
-
[
|
|
260
|
+
[$](e) {
|
|
261
261
|
return this.color && this.colorModel.equal(e, this.color);
|
|
262
262
|
}
|
|
263
|
-
[
|
|
264
|
-
this[
|
|
263
|
+
[Ne](e) {
|
|
264
|
+
this[Me] = e, this[Pe].forEach((t) => t.update(e));
|
|
265
265
|
}
|
|
266
|
-
},
|
|
266
|
+
}, Re = {
|
|
267
267
|
defaultColor: "#000",
|
|
268
|
-
toHsva:
|
|
269
|
-
fromHsva: ({ h: e, s: t, v: n }) =>
|
|
268
|
+
toHsva: he,
|
|
269
|
+
fromHsva: ({ h: e, s: t, v: n }) => ge({
|
|
270
270
|
h: e,
|
|
271
271
|
s: t,
|
|
272
272
|
v: n,
|
|
273
273
|
a: 1
|
|
274
274
|
}),
|
|
275
|
-
equal:
|
|
275
|
+
equal: xe,
|
|
276
276
|
fromAttr: (e) => e
|
|
277
|
-
},
|
|
277
|
+
}, ze = class extends Le {
|
|
278
278
|
get colorModel() {
|
|
279
|
-
return
|
|
279
|
+
return Re;
|
|
280
280
|
}
|
|
281
|
-
},
|
|
282
|
-
customElements.define("hex-color-picker",
|
|
281
|
+
}, Be = class extends ze {};
|
|
282
|
+
customElements.define("hex-color-picker", Be);
|
|
283
283
|
// src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
284
|
-
var
|
|
284
|
+
var Ve = [
|
|
285
285
|
"disabled",
|
|
286
286
|
"aria-label",
|
|
287
287
|
"title",
|
|
288
288
|
"aria-expanded"
|
|
289
|
-
],
|
|
289
|
+
], He = {
|
|
290
290
|
key: 0,
|
|
291
291
|
class: "tpl:relative tpl:flex-1"
|
|
292
|
-
},
|
|
292
|
+
}, Ue = [
|
|
293
293
|
"value",
|
|
294
294
|
"placeholder",
|
|
295
295
|
"disabled",
|
|
296
296
|
"aria-label"
|
|
297
|
-
],
|
|
297
|
+
], We = ["aria-label", "title"], Ge = ["data-tpl-theme"], Ke = [
|
|
298
298
|
"aria-pressed",
|
|
299
299
|
"aria-label",
|
|
300
300
|
"title"
|
|
301
|
-
],
|
|
301
|
+
], qe = ["aria-label"], Je = [
|
|
302
302
|
"aria-label",
|
|
303
303
|
"title",
|
|
304
304
|
"aria-checked",
|
|
305
305
|
"tabindex"
|
|
306
|
-
],
|
|
306
|
+
], Ye = [
|
|
307
307
|
"aria-label",
|
|
308
308
|
"title",
|
|
309
309
|
"aria-checked",
|
|
310
310
|
"tabindex",
|
|
311
311
|
"onClick"
|
|
312
|
-
],
|
|
312
|
+
], Xe = ["color", "aria-label"], Ze = {
|
|
313
313
|
key: 3,
|
|
314
314
|
class: "tpl:relative tpl:mt-2"
|
|
315
|
-
},
|
|
315
|
+
}, Qe = [
|
|
316
316
|
"value",
|
|
317
317
|
"placeholder",
|
|
318
318
|
"disabled",
|
|
319
319
|
"aria-label"
|
|
320
|
-
],
|
|
320
|
+
], $e = ["aria-label", "title"], et = /* @__PURE__ */ w({
|
|
321
321
|
__name: "ColorPicker",
|
|
322
322
|
props: {
|
|
323
323
|
modelValue: {},
|
|
@@ -345,37 +345,37 @@ var Re = [
|
|
|
345
345
|
},
|
|
346
346
|
emits: ["update:modelValue"],
|
|
347
347
|
setup(i, { emit: s }) {
|
|
348
|
-
let l = i, u =
|
|
348
|
+
let l = i, u = ce(), b = p(() => l.disabled || !u.value), w = s, { t: E } = R(), O = g(!1);
|
|
349
349
|
e(b, (e) => {
|
|
350
350
|
e && (O.value = !1);
|
|
351
351
|
}, { flush: "sync" });
|
|
352
|
-
let
|
|
353
|
-
|
|
352
|
+
let te = g(), k = g(), A = g(!1);
|
|
353
|
+
oe(te, () => {
|
|
354
354
|
O.value = !1;
|
|
355
|
-
}, { ignore: [
|
|
356
|
-
let
|
|
357
|
-
function
|
|
358
|
-
return
|
|
355
|
+
}, { ignore: [k] });
|
|
356
|
+
let j = p(() => !l.modelValue), M = p(() => l.modelValue.trim().toLowerCase() === "transparent"), N = p(() => ue(l.modelValue)), P = p(() => (l.modelValue ? fe(l.modelValue) : null) || (fe(l.seedColor) ?? "#ffffff")), F = p(() => !b.value && !j.value), L = C(ie, de), z = p(() => [...new Set(l.presets ?? L.presets)]), me = p(() => l.allowCustom ?? L.allowCustom), B = p(() => z.value.length > 0), V = p(() => me.value || !B.value), H = p(() => se(l.modelValue));
|
|
357
|
+
function U(e) {
|
|
358
|
+
return H.value !== "" && se(e) === H.value;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function he(e) {
|
|
361
361
|
b.value || w("update:modelValue", e);
|
|
362
362
|
}
|
|
363
|
-
let
|
|
364
|
-
function
|
|
365
|
-
return
|
|
363
|
+
let W = p(() => B.value && !V.value);
|
|
364
|
+
function ge(e) {
|
|
365
|
+
return W.value ? e + 1 : e;
|
|
366
366
|
}
|
|
367
|
-
let
|
|
368
|
-
if (
|
|
369
|
-
let e =
|
|
370
|
-
return e === -1 ? 0 :
|
|
367
|
+
let _e = p(() => {
|
|
368
|
+
if (W.value && j.value) return 0;
|
|
369
|
+
let e = z.value.findIndex((e) => U(e));
|
|
370
|
+
return e === -1 ? 0 : ge(e);
|
|
371
371
|
});
|
|
372
|
-
function
|
|
373
|
-
return
|
|
372
|
+
function G() {
|
|
373
|
+
return _e.value === 0 ? 0 : -1;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
return
|
|
375
|
+
function ve(e) {
|
|
376
|
+
return ge(e) === _e.value ? 0 : -1;
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function K(e) {
|
|
379
379
|
if (![
|
|
380
380
|
"ArrowRight",
|
|
381
381
|
"ArrowDown",
|
|
@@ -385,35 +385,35 @@ var Re = [
|
|
|
385
385
|
let t = e.currentTarget, n = Array.from(t.querySelectorAll("[role=\"radio\"]")), r = e.target.closest("[role=\"radio\"]"), i = r ? n.indexOf(r) : -1;
|
|
386
386
|
i !== -1 && (n[(i + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + n.length) % n.length]?.focus(), e.preventDefault());
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
b.value || (
|
|
390
|
-
}
|
|
391
|
-
function ye() {
|
|
392
|
-
b.value || (j.value = !1);
|
|
388
|
+
function ye(e) {
|
|
389
|
+
b.value || (A.value = !0, w("update:modelValue", e.detail.value));
|
|
393
390
|
}
|
|
394
391
|
function be() {
|
|
395
|
-
b.value ||
|
|
392
|
+
b.value || (A.value = !1);
|
|
393
|
+
}
|
|
394
|
+
function q() {
|
|
395
|
+
b.value || !A.value && j.value && w("update:modelValue", P.value);
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function xe(e) {
|
|
398
398
|
b.value || w("update:modelValue", e.target.value);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function J() {
|
|
401
401
|
b.value || w("update:modelValue", "");
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Se() {
|
|
404
404
|
b.value || w("update:modelValue", "transparent");
|
|
405
405
|
}
|
|
406
|
-
let
|
|
406
|
+
let Y = le(), { toLocal: X } = pe(), Z = C(ne, null), Ce = C(re, null), Q = g({
|
|
407
407
|
top: 0,
|
|
408
408
|
left: 0
|
|
409
409
|
});
|
|
410
|
-
function
|
|
410
|
+
function we() {
|
|
411
411
|
if (!b.value) {
|
|
412
412
|
if (!O.value) {
|
|
413
|
-
let e =
|
|
413
|
+
let e = k.value?.getBoundingClientRect();
|
|
414
414
|
if (e) {
|
|
415
415
|
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
416
|
-
|
|
416
|
+
Q.value = X({
|
|
417
417
|
top: t,
|
|
418
418
|
left: e.left
|
|
419
419
|
});
|
|
@@ -425,7 +425,7 @@ var Re = [
|
|
|
425
425
|
return (e, s) => (n(), _("div", { class: r(["tpl:flex tpl:items-center tpl:gap-2 tpl:relative", b.value && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
|
|
426
426
|
y("button", {
|
|
427
427
|
ref_key: "swatchRef",
|
|
428
|
-
ref:
|
|
428
|
+
ref: k,
|
|
429
429
|
type: "button",
|
|
430
430
|
disabled: b.value,
|
|
431
431
|
"aria-label": i.ariaLabel || m(E).colorPicker.pickColor,
|
|
@@ -437,37 +437,37 @@ var Re = [
|
|
|
437
437
|
O.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !b.value && "tpl:hover:border-[var(--tpl-text-dim)]",
|
|
438
438
|
i.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
439
439
|
]),
|
|
440
|
-
onClick:
|
|
440
|
+
onClick: we
|
|
441
441
|
}, [y("span", {
|
|
442
442
|
class: r(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", {
|
|
443
|
-
"tpl-color-swatch-empty":
|
|
444
|
-
"tpl-color-swatch-transparent":
|
|
443
|
+
"tpl-color-swatch-empty": j.value,
|
|
444
|
+
"tpl-color-swatch-transparent": M.value
|
|
445
445
|
}]),
|
|
446
|
-
style: o(
|
|
447
|
-
}, null, 6)], 10,
|
|
448
|
-
!i.swatchOnly &&
|
|
446
|
+
style: o(j.value || M.value ? void 0 : { backgroundColor: N.value })
|
|
447
|
+
}, null, 6)], 10, Ve),
|
|
448
|
+
!i.swatchOnly && V.value ? (n(), _("div", He, [y("input", {
|
|
449
449
|
type: "text",
|
|
450
|
-
class: r([m(
|
|
451
|
-
style: o(
|
|
452
|
-
value:
|
|
450
|
+
class: r([m(ae), "tpl:w-full"]),
|
|
451
|
+
style: o(F.value ? { paddingRight: "2.25rem" } : void 0),
|
|
452
|
+
value: N.value,
|
|
453
453
|
placeholder: i.placeholder || m(E).colorPicker.notSet,
|
|
454
454
|
disabled: b.value,
|
|
455
455
|
"aria-label": m(E).colorPicker.hexValue,
|
|
456
|
-
onInput:
|
|
457
|
-
}, null, 46,
|
|
456
|
+
onInput: xe
|
|
457
|
+
}, null, 46, Ue), F.value ? (n(), _("button", {
|
|
458
458
|
key: 0,
|
|
459
459
|
type: "button",
|
|
460
460
|
"aria-label": m(E).colorPicker.clear,
|
|
461
461
|
title: m(E).colorPicker.clear,
|
|
462
462
|
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)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
463
|
-
onClick:
|
|
464
|
-
}, [d(m(
|
|
463
|
+
onClick: J
|
|
464
|
+
}, [d(m(I), {
|
|
465
465
|
size: 14,
|
|
466
466
|
"stroke-width": 1.5
|
|
467
|
-
})], 8,
|
|
467
|
+
})], 8, We)) : h("", !0)])) : h("", !0),
|
|
468
468
|
(n(), S(f, {
|
|
469
|
-
to: m(
|
|
470
|
-
disabled: !m(
|
|
469
|
+
to: m(Y),
|
|
470
|
+
disabled: !m(Y)
|
|
471
471
|
}, [d(D, {
|
|
472
472
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
473
473
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
@@ -479,100 +479,100 @@ var Re = [
|
|
|
479
479
|
default: c(() => [O.value ? (n(), _("div", {
|
|
480
480
|
key: 0,
|
|
481
481
|
ref_key: "popoverRef",
|
|
482
|
-
ref:
|
|
483
|
-
"data-tpl-theme": m(
|
|
482
|
+
ref: te,
|
|
483
|
+
"data-tpl-theme": m(Ce),
|
|
484
484
|
class: "tpl-color-popover tpl:absolute tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3 tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
485
485
|
style: o({
|
|
486
|
-
top: `${
|
|
487
|
-
left: `${
|
|
488
|
-
...m(
|
|
486
|
+
top: `${Q.value.top}px`,
|
|
487
|
+
left: `${Q.value.left}px`,
|
|
488
|
+
...m(Z)
|
|
489
489
|
})
|
|
490
490
|
}, [
|
|
491
491
|
i.allowTransparent ? (n(), _("button", {
|
|
492
492
|
key: 0,
|
|
493
493
|
type: "button",
|
|
494
494
|
"data-testid": "color-picker-transparent",
|
|
495
|
-
"aria-pressed":
|
|
495
|
+
"aria-pressed": M.value,
|
|
496
496
|
"aria-label": m(E).colorPicker.transparent,
|
|
497
497
|
title: m(E).colorPicker.transparent,
|
|
498
|
-
class: r(["tpl:mb-2 tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:py-1 tpl:text-left tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)]",
|
|
499
|
-
onClick:
|
|
500
|
-
}, [s[2] ||= y("span", { class: "tpl-color-swatch-transparent tpl:size-4 tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)]" }, null, -1), v(" " + t(m(E).colorPicker.transparent), 1)], 10,
|
|
501
|
-
|
|
498
|
+
class: r(["tpl:mb-2 tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:py-1 tpl:text-left tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)]", M.value ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
499
|
+
onClick: Se
|
|
500
|
+
}, [s[2] ||= y("span", { class: "tpl-color-swatch-transparent tpl:size-4 tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)]" }, null, -1), v(" " + t(m(E).colorPicker.transparent), 1)], 10, Ke)) : h("", !0),
|
|
501
|
+
B.value ? (n(), _("div", {
|
|
502
502
|
key: 1,
|
|
503
503
|
role: "radiogroup",
|
|
504
504
|
"aria-label": m(E).colorPicker.presetColors,
|
|
505
|
-
class: r(["tpl:flex tpl:flex-wrap tpl:gap-1.5",
|
|
506
|
-
onKeydown:
|
|
507
|
-
}, [
|
|
505
|
+
class: r(["tpl:flex tpl:flex-wrap tpl:gap-1.5", V.value && "tpl:mb-2"]),
|
|
506
|
+
onKeydown: K
|
|
507
|
+
}, [W.value ? (n(), _("button", {
|
|
508
508
|
key: 0,
|
|
509
509
|
type: "button",
|
|
510
510
|
role: "radio",
|
|
511
511
|
"aria-label": m(E).colorPicker.clear,
|
|
512
512
|
title: m(E).colorPicker.clear,
|
|
513
|
-
"aria-checked":
|
|
514
|
-
tabindex:
|
|
515
|
-
class: r(["tpl-color-swatch-empty tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]",
|
|
516
|
-
onClick:
|
|
517
|
-
}, null, 10,
|
|
513
|
+
"aria-checked": j.value,
|
|
514
|
+
tabindex: G(),
|
|
515
|
+
class: r(["tpl-color-swatch-empty tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", j.value ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
516
|
+
onClick: J
|
|
517
|
+
}, null, 10, Je)) : h("", !0), (n(!0), _(x, null, a(z.value, (e, t) => (n(), _("button", {
|
|
518
518
|
key: e,
|
|
519
519
|
type: "button",
|
|
520
520
|
role: "radio",
|
|
521
521
|
"aria-label": e,
|
|
522
522
|
title: e,
|
|
523
|
-
"aria-checked":
|
|
524
|
-
tabindex:
|
|
523
|
+
"aria-checked": U(e),
|
|
524
|
+
tabindex: ve(t),
|
|
525
525
|
style: o({ backgroundColor: e }),
|
|
526
|
-
class: r(["tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]",
|
|
527
|
-
onClick: (t) =>
|
|
528
|
-
}, null, 14,
|
|
529
|
-
|
|
526
|
+
class: r(["tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:focus-visible:ring-2 tpl:focus-visible:ring-[var(--tpl-primary)] tpl:focus-visible:ring-offset-1 tpl:focus-visible:ring-offset-[var(--tpl-bg-elevated)]", U(e) ? "tpl:ring-2 tpl:ring-[var(--tpl-primary)] tpl:ring-offset-1 tpl:ring-offset-[var(--tpl-bg-elevated)]" : "tpl:hover:border-[var(--tpl-text-dim)]"]),
|
|
527
|
+
onClick: (t) => he(e)
|
|
528
|
+
}, null, 14, Ye))), 128))], 42, qe)) : h("", !0),
|
|
529
|
+
V.value ? (n(), _("hex-color-picker", {
|
|
530
530
|
key: 2,
|
|
531
|
-
color:
|
|
531
|
+
color: P.value,
|
|
532
532
|
"aria-label": m(E).colorPicker.pickColor,
|
|
533
|
-
onColorChanged:
|
|
534
|
-
onPointerdown:
|
|
535
|
-
onPointerup:
|
|
533
|
+
onColorChanged: ye,
|
|
534
|
+
onPointerdown: be,
|
|
535
|
+
onPointerup: q,
|
|
536
536
|
onKeydown: s[0] ||= ee((e) => O.value = !1, ["escape"])
|
|
537
|
-
}, null, 40,
|
|
538
|
-
i.swatchOnly &&
|
|
537
|
+
}, null, 40, Xe)) : h("", !0),
|
|
538
|
+
i.swatchOnly && V.value ? (n(), _("div", Ze, [y("input", {
|
|
539
539
|
type: "text",
|
|
540
|
-
class: r([m(
|
|
541
|
-
style: o(
|
|
542
|
-
value:
|
|
540
|
+
class: r([m(ae), "tpl:w-full"]),
|
|
541
|
+
style: o(F.value ? { paddingRight: "2.25rem" } : void 0),
|
|
542
|
+
value: N.value,
|
|
543
543
|
placeholder: i.placeholder || m(E).colorPicker.notSet,
|
|
544
544
|
disabled: b.value,
|
|
545
545
|
"aria-label": m(E).colorPicker.hexValue,
|
|
546
|
-
onChange:
|
|
546
|
+
onChange: xe,
|
|
547
547
|
onKeydown: s[1] ||= ee(T((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
548
|
-
}, null, 46,
|
|
548
|
+
}, null, 46, Qe), F.value ? (n(), _("button", {
|
|
549
549
|
key: 0,
|
|
550
550
|
type: "button",
|
|
551
551
|
"aria-label": m(E).colorPicker.clear,
|
|
552
552
|
title: m(E).colorPicker.clear,
|
|
553
553
|
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)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
554
|
-
onClick:
|
|
555
|
-
}, [d(m(
|
|
554
|
+
onClick: J
|
|
555
|
+
}, [d(m(I), {
|
|
556
556
|
size: 14,
|
|
557
557
|
"stroke-width": 1.5
|
|
558
|
-
})], 8,
|
|
559
|
-
], 12,
|
|
558
|
+
})], 8, $e)) : h("", !0)])) : h("", !0)
|
|
559
|
+
], 12, Ge)) : h("", !0)]),
|
|
560
560
|
_: 1
|
|
561
561
|
})], 8, ["to", "disabled"]))
|
|
562
562
|
], 2));
|
|
563
563
|
}
|
|
564
|
-
}),
|
|
564
|
+
}), tt = ["id"], nt = {
|
|
565
565
|
key: 0,
|
|
566
566
|
class: "tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
567
567
|
"data-testid": "merge-tag-suggestion-empty"
|
|
568
|
-
},
|
|
568
|
+
}, rt = [
|
|
569
569
|
"id",
|
|
570
570
|
"aria-selected",
|
|
571
571
|
"data-selected",
|
|
572
572
|
"data-merge-tag-value",
|
|
573
573
|
"onMousedown",
|
|
574
574
|
"onMousemove"
|
|
575
|
-
],
|
|
575
|
+
], it = { class: "tpl:font-medium" }, at = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, ot = /* @__PURE__ */ w({
|
|
576
576
|
__name: "MergeTagSuggestionList",
|
|
577
577
|
props: {
|
|
578
578
|
items: {},
|
|
@@ -591,7 +591,7 @@ var Re = [
|
|
|
591
591
|
class: "tpl:min-w-[200px] tpl:max-w-[320px] tpl:max-h-[50vh] tpl:overflow-y-auto tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:py-1 tpl:shadow-[var(--tpl-shadow-lg)]",
|
|
592
592
|
role: "listbox",
|
|
593
593
|
"data-testid": "merge-tag-suggestion-list"
|
|
594
|
-
}, [e.items.length === 0 ? (n(), _("div",
|
|
594
|
+
}, [e.items.length === 0 ? (n(), _("div", nt, t(e.emptyText), 1)) : h("", !0), (n(!0), _(x, null, a(e.items, (a, s) => (n(), _("button", {
|
|
595
595
|
key: a.value,
|
|
596
596
|
id: o(s),
|
|
597
597
|
type: "button",
|
|
@@ -602,21 +602,21 @@ var Re = [
|
|
|
602
602
|
class: r(["tpl:flex tpl:w-full tpl:flex-col tpl:items-start tpl:gap-0.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors", s === e.selectedIndex ? "tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text)] tpl:hover:bg-[var(--tpl-bg-hover)]"]),
|
|
603
603
|
onMousedown: T((e) => i.$emit("select", a), ["prevent", "stop"]),
|
|
604
604
|
onMousemove: (t) => s !== e.selectedIndex && i.$emit("hover", s)
|
|
605
|
-
}, [y("span",
|
|
605
|
+
}, [y("span", it, t(a.label), 1), y("span", at, t(a.value), 1)], 42, rt))), 128))], 8, tt));
|
|
606
606
|
}
|
|
607
|
-
}),
|
|
608
|
-
function
|
|
607
|
+
}), st = 10, ct = 0;
|
|
608
|
+
function lt(e, t) {
|
|
609
609
|
let n = t.trim().toLowerCase();
|
|
610
|
-
return n === "" ? e.slice(0,
|
|
610
|
+
return n === "" ? e.slice(0, st) : e.filter((e) => {
|
|
611
611
|
let t = e.label.toLowerCase(), r = e.value.toLowerCase();
|
|
612
612
|
return t.includes(n) || r.includes(n);
|
|
613
|
-
}).slice(0,
|
|
613
|
+
}).slice(0, st);
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function ut(e, t, n, r) {
|
|
616
616
|
return t.length === 0 ? e.key === "Enter" || e.key === "Tab" : e.key === "ArrowDown" ? (n.value = (n.value + 1) % t.length, !0) : e.key === "ArrowUp" ? (n.value = (n.value - 1 + t.length) % t.length, !0) : e.key === "Enter" || e.key === "Tab" ? (r(t[n.value]), !0) : !1;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
619
|
-
let n = null, r = null, i = null, a = g([]), o = g(0), c = null, l = `tpl-merge-tag-suggestion-${++
|
|
618
|
+
function dt(e, t) {
|
|
619
|
+
let n = null, r = null, i = null, a = g([]), o = g(0), c = null, l = `tpl-merge-tag-suggestion-${++ct}`, u = null, d = [], f = null;
|
|
620
620
|
function p() {
|
|
621
621
|
y(u?.() ?? null);
|
|
622
622
|
}
|
|
@@ -680,7 +680,7 @@ function ct(e, t) {
|
|
|
680
680
|
return {
|
|
681
681
|
open: ({ items: d, getRect: f, anchorEl: p, onCommand: h }) => {
|
|
682
682
|
a.value = d, o.value = 0, c = h, r = document.createElement("div"), r.setAttribute("data-testid", "merge-tag-suggestion-popup"), i = p, b(r, p), (t?.value ?? document.body).appendChild(r), n = E({ render() {
|
|
683
|
-
return s(
|
|
683
|
+
return s(ot, {
|
|
684
684
|
items: a.value,
|
|
685
685
|
selectedIndex: o.value,
|
|
686
686
|
emptyText: e,
|
|
@@ -696,7 +696,7 @@ function ct(e, t) {
|
|
|
696
696
|
a.value = e, o.value >= e.length && (o.value = 0), c = n, S(), u = t, m();
|
|
697
697
|
},
|
|
698
698
|
handleKeyDown: (e) => {
|
|
699
|
-
let t =
|
|
699
|
+
let t = ut(e, a.value, o, C);
|
|
700
700
|
return t && S(), t;
|
|
701
701
|
},
|
|
702
702
|
close: () => {
|
|
@@ -706,10 +706,10 @@ function ct(e, t) {
|
|
|
706
706
|
};
|
|
707
707
|
}
|
|
708
708
|
// src/utils/mergeTagTrigger.ts
|
|
709
|
-
function
|
|
709
|
+
function ft(e, t, n, r, i) {
|
|
710
710
|
if (!n) return null;
|
|
711
711
|
let a = e.slice(0, t), o = a.lastIndexOf(n);
|
|
712
|
-
if (o === -1 || i && o <
|
|
712
|
+
if (o === -1 || i && o < pt(a, i)) return null;
|
|
713
713
|
let s = a.slice(o + n.length);
|
|
714
714
|
return /\s/.test(s) || r && s.includes(r) ? null : {
|
|
715
715
|
triggerStart: o,
|
|
@@ -717,14 +717,19 @@ function lt(e, t, n, r, i) {
|
|
|
717
717
|
query: s
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
|
-
function
|
|
721
|
-
let n =
|
|
722
|
-
|
|
723
|
-
|
|
720
|
+
function pt(e, t) {
|
|
721
|
+
let n = Object.values(j).find((e) => e.value === t);
|
|
722
|
+
if (n) {
|
|
723
|
+
let t = O(e, n, "value"), r = t[t.length - 1];
|
|
724
|
+
return r ? r.index + r.value.length : 0;
|
|
725
|
+
}
|
|
726
|
+
let r = new RegExp(t.source, `${t.flags.replace(/[gy]/g, "")}g`), i = 0;
|
|
727
|
+
for (let t of e.matchAll(r)) i = t.index + t[0].length;
|
|
728
|
+
return i;
|
|
724
729
|
}
|
|
725
730
|
// src/utils/textFieldCaret.ts
|
|
726
|
-
var
|
|
727
|
-
function
|
|
731
|
+
var mt = /* @__PURE__ */ "boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderStyle.paddingTop.paddingRight.paddingBottom.paddingLeft.fontStyle.fontVariant.fontWeight.fontStretch.fontSize.lineHeight.fontFamily.textAlign.textTransform.textIndent.letterSpacing.wordSpacing.tabSize.whiteSpace.wordWrap.wordBreak".split(".");
|
|
732
|
+
function ht(e, t, n) {
|
|
728
733
|
return {
|
|
729
734
|
left: e,
|
|
730
735
|
top: t,
|
|
@@ -737,7 +742,7 @@ function ft(e, t, n) {
|
|
|
737
742
|
toJSON: () => ({})
|
|
738
743
|
};
|
|
739
744
|
}
|
|
740
|
-
function
|
|
745
|
+
function gt(e, t) {
|
|
741
746
|
let n = e.ownerDocument, r = n.defaultView;
|
|
742
747
|
if (!r) return null;
|
|
743
748
|
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
@@ -745,7 +750,7 @@ function pt(e, t) {
|
|
|
745
750
|
let s = o.style;
|
|
746
751
|
s.position = "absolute", s.visibility = "hidden", s.top = "0", s.left = "0", s.overflow = "hidden", s.whiteSpace = i ? "pre" : "pre-wrap", s.wordWrap = i ? "normal" : "break-word";
|
|
747
752
|
let c = s, l = a;
|
|
748
|
-
for (let e of
|
|
753
|
+
for (let e of mt) c[e] = l[e];
|
|
749
754
|
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
750
755
|
let u = e.value, d = u.slice(0, t);
|
|
751
756
|
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
@@ -754,19 +759,19 @@ function pt(e, t) {
|
|
|
754
759
|
let p = f.offsetTop, m = f.offsetLeft;
|
|
755
760
|
n.body.removeChild(o);
|
|
756
761
|
let h = e.getBoundingClientRect(), g = parseFloat(a.borderTopWidth) || 0, _ = parseFloat(a.borderLeftWidth) || 0, v = parseFloat(a.lineHeight) || parseFloat(a.fontSize) || 0, y = h.left + m + _ - e.scrollLeft;
|
|
757
|
-
if (i) return
|
|
762
|
+
if (i) return ht(y, h.top, h.bottom);
|
|
758
763
|
let b = h.top + p + g - e.scrollTop;
|
|
759
|
-
return
|
|
764
|
+
return ht(y, b, b + v);
|
|
760
765
|
}
|
|
761
766
|
// src/composables/useMergeTagAutocomplete.ts
|
|
762
|
-
var
|
|
767
|
+
var _t = /* @__PURE__ */ new Set([
|
|
763
768
|
"ArrowLeft",
|
|
764
769
|
"ArrowRight",
|
|
765
770
|
"Home",
|
|
766
771
|
"End"
|
|
767
772
|
]);
|
|
768
|
-
function
|
|
769
|
-
let { elementRef: n, modelValue: r, emit: a, mergeTags: o, syntax: s, enabled: c, onInsert: d } = t, f =
|
|
773
|
+
function vt(t) {
|
|
774
|
+
let { elementRef: n, modelValue: r, emit: a, mergeTags: o, syntax: s, enabled: c, onInsert: d } = t, f = ce(), m = A(s), h = k(s), g = p(() => f.value && c && m !== null && o.value.length > 0), _ = C(L, null), v = dt((l(_) ? _.value : _)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", le());
|
|
770
775
|
e(f, (e) => {
|
|
771
776
|
e || v.close();
|
|
772
777
|
}, { flush: "sync" });
|
|
@@ -776,7 +781,7 @@ function ht(t) {
|
|
|
776
781
|
});
|
|
777
782
|
function x(e) {
|
|
778
783
|
let t = e.value ?? "";
|
|
779
|
-
return
|
|
784
|
+
return ft(t, e.selectionStart ?? t.length, m, h, s.value);
|
|
780
785
|
}
|
|
781
786
|
function S(e, t, o) {
|
|
782
787
|
if (!f.value) return;
|
|
@@ -799,7 +804,7 @@ function ht(t) {
|
|
|
799
804
|
v.close();
|
|
800
805
|
return;
|
|
801
806
|
}
|
|
802
|
-
let r =
|
|
807
|
+
let r = lt(o.value, t.query), i = () => gt(e, t.triggerStart), a = (n) => S(e, t, n);
|
|
803
808
|
v.isOpen() ? v.update({
|
|
804
809
|
items: r,
|
|
805
810
|
getRect: i,
|
|
@@ -812,7 +817,7 @@ function ht(t) {
|
|
|
812
817
|
});
|
|
813
818
|
}
|
|
814
819
|
function T(e) {
|
|
815
|
-
return v.isOpen() ? e.key === "Escape" ? (v.close(), !0) :
|
|
820
|
+
return v.isOpen() ? e.key === "Escape" ? (v.close(), !0) : _t.has(e.key) ? (v.close(), !1) : v.handleKeyDown(e) : !1;
|
|
816
821
|
}
|
|
817
822
|
return {
|
|
818
823
|
available: g,
|
|
@@ -823,12 +828,12 @@ function ht(t) {
|
|
|
823
828
|
};
|
|
824
829
|
}
|
|
825
830
|
// src/composables/useMergeTagField.ts
|
|
826
|
-
function
|
|
827
|
-
let { modelValue: t, emit: n, elementRef: r } = e, { mergeTags: a, canRequestMergeTag: o, isRequesting: s, isMergeTagValue: c, getMergeTagDisplayLabel: l, findMergeTag: d, requestMergeTag: f, syntax: m, autocomplete: h } =
|
|
831
|
+
function yt(e) {
|
|
832
|
+
let { modelValue: t, emit: n, elementRef: r } = e, { mergeTags: a, canRequestMergeTag: o, isRequesting: s, isMergeTagValue: c, getMergeTagDisplayLabel: l, findMergeTag: d, requestMergeTag: f, syntax: m, autocomplete: h } = z(), { canInsertLogicTag: _, isRequesting: v, requestLogicTag: y } = me(), x = g(!1), S = !1, C = !1;
|
|
828
833
|
b() && u(() => {
|
|
829
834
|
C = !0;
|
|
830
835
|
});
|
|
831
|
-
let w =
|
|
836
|
+
let w = vt({
|
|
832
837
|
elementRef: r,
|
|
833
838
|
modelValue: t,
|
|
834
839
|
emit: n,
|
|
@@ -841,29 +846,29 @@ function gt(e) {
|
|
|
841
846
|
}), T = p(() => {
|
|
842
847
|
let e = t();
|
|
843
848
|
if (!e) return [];
|
|
844
|
-
let n = [], r =
|
|
845
|
-
for (
|
|
846
|
-
|
|
849
|
+
let n = [], r = 0;
|
|
850
|
+
for (let t of M(e, m)) {
|
|
851
|
+
t.index > r && n.push({
|
|
847
852
|
type: "text",
|
|
848
|
-
value: e.slice(
|
|
853
|
+
value: e.slice(r, t.index)
|
|
849
854
|
});
|
|
850
|
-
let
|
|
851
|
-
c(
|
|
855
|
+
let i = t.value;
|
|
856
|
+
c(i) ? n.push({
|
|
852
857
|
type: "mergeTag",
|
|
853
|
-
value:
|
|
854
|
-
label: l(
|
|
855
|
-
}) :
|
|
858
|
+
value: i,
|
|
859
|
+
label: l(i)
|
|
860
|
+
}) : N(i, m) ? n.push({
|
|
856
861
|
type: "logicMergeTag",
|
|
857
|
-
value:
|
|
858
|
-
keyword:
|
|
862
|
+
value: i,
|
|
863
|
+
keyword: te(i, m)
|
|
859
864
|
}) : n.push({
|
|
860
865
|
type: "text",
|
|
861
|
-
value:
|
|
862
|
-
}),
|
|
866
|
+
value: i
|
|
867
|
+
}), r = t.index + i.length;
|
|
863
868
|
}
|
|
864
|
-
return
|
|
869
|
+
return r < e.length && n.push({
|
|
865
870
|
type: "text",
|
|
866
|
-
value: e.slice(
|
|
871
|
+
value: e.slice(r)
|
|
867
872
|
}), n;
|
|
868
873
|
}), E = p(() => T.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
869
874
|
function ee() {
|
|
@@ -876,22 +881,22 @@ function gt(e) {
|
|
|
876
881
|
function D() {
|
|
877
882
|
S || (x.value = !1);
|
|
878
883
|
}
|
|
879
|
-
function
|
|
884
|
+
function O(e) {
|
|
880
885
|
n(e.target.value), w.refresh();
|
|
881
886
|
}
|
|
882
|
-
function
|
|
887
|
+
function k(e) {
|
|
883
888
|
return w.handleKeydown(e) ? (e.preventDefault(), !0) : (e.key === "Escape" && D(), !1);
|
|
884
889
|
}
|
|
885
|
-
function
|
|
890
|
+
function A() {
|
|
886
891
|
w.refresh();
|
|
887
892
|
}
|
|
888
|
-
function
|
|
893
|
+
function j() {
|
|
889
894
|
w.close(), D();
|
|
890
895
|
}
|
|
891
896
|
function P() {
|
|
892
897
|
n("");
|
|
893
898
|
}
|
|
894
|
-
async function
|
|
899
|
+
async function F() {
|
|
895
900
|
let e = x.value && r.value ? r.value.selectionStart ?? t().length : t().length;
|
|
896
901
|
S = !0;
|
|
897
902
|
let a;
|
|
@@ -909,7 +914,7 @@ function gt(e) {
|
|
|
909
914
|
});
|
|
910
915
|
}
|
|
911
916
|
}
|
|
912
|
-
async function
|
|
917
|
+
async function I(e) {
|
|
913
918
|
let t = T.value, r = t[e];
|
|
914
919
|
if (r?.type !== "mergeTag") return;
|
|
915
920
|
S = !0;
|
|
@@ -924,7 +929,7 @@ function gt(e) {
|
|
|
924
929
|
}
|
|
925
930
|
!C && i && n(t.map((t, n) => n === e ? i.value : t.value).join(""));
|
|
926
931
|
}
|
|
927
|
-
async function
|
|
932
|
+
async function ne() {
|
|
928
933
|
let e = r.value, a = e?.selectionStart ?? t().length, o = e?.selectionEnd ?? a;
|
|
929
934
|
S = !0;
|
|
930
935
|
let s;
|
|
@@ -949,26 +954,26 @@ function gt(e) {
|
|
|
949
954
|
isEditing: x,
|
|
950
955
|
startEditing: ee,
|
|
951
956
|
stopEditing: D,
|
|
952
|
-
handleInput:
|
|
953
|
-
handleKeydown:
|
|
954
|
-
handleClick:
|
|
955
|
-
handleBlur:
|
|
957
|
+
handleInput: O,
|
|
958
|
+
handleKeydown: k,
|
|
959
|
+
handleClick: A,
|
|
960
|
+
handleBlur: j,
|
|
956
961
|
clearValue: P,
|
|
957
|
-
insertMergeTag:
|
|
958
|
-
replaceMergeTagAt:
|
|
959
|
-
insertLogicTag:
|
|
962
|
+
insertMergeTag: F,
|
|
963
|
+
replaceMergeTagAt: I,
|
|
964
|
+
insertLogicTag: ne,
|
|
960
965
|
autocompleteAvailable: w.available
|
|
961
966
|
};
|
|
962
967
|
}
|
|
963
968
|
// src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
964
|
-
var
|
|
969
|
+
var bt = ["aria-label"], xt = [
|
|
965
970
|
"data-tooltip",
|
|
966
971
|
"aria-label",
|
|
967
972
|
"onClick"
|
|
968
|
-
],
|
|
973
|
+
], St = ["data-tooltip"], Ct = ["data-tooltip"], wt = {
|
|
969
974
|
key: 3,
|
|
970
975
|
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
971
|
-
},
|
|
976
|
+
}, Tt = ["aria-label", "title"], Et = ["aria-label", "title"], Dt = /* @__PURE__ */ w({
|
|
972
977
|
__name: "MergeTagSegments",
|
|
973
978
|
props: {
|
|
974
979
|
segments: {},
|
|
@@ -981,7 +986,7 @@ var _t = ["aria-label"], vt = [
|
|
|
981
986
|
"repick"
|
|
982
987
|
],
|
|
983
988
|
setup(e, { emit: i }) {
|
|
984
|
-
let o = i, { t: s, format: c } =
|
|
989
|
+
let o = i, { t: s, format: c } = R(), { canRepickMergeTag: l, showRawValue: u } = z();
|
|
985
990
|
function f() {
|
|
986
991
|
o("edit");
|
|
987
992
|
}
|
|
@@ -1003,7 +1008,7 @@ var _t = ["aria-label"], vt = [
|
|
|
1003
1008
|
color: "var(--tpl-primary)"
|
|
1004
1009
|
},
|
|
1005
1010
|
onClick: T((e) => o("repick", i), ["stop"])
|
|
1006
|
-
}, t(e.label), 11,
|
|
1011
|
+
}, t(e.label), 11, xt)) : e.type === "mergeTag" ? (n(), _("span", {
|
|
1007
1012
|
key: 1,
|
|
1008
1013
|
class: r(["tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium", m(u) ? "tpl-tooltip" : ""]),
|
|
1009
1014
|
"data-tooltip": m(u) ? e.value : void 0,
|
|
@@ -1011,7 +1016,7 @@ var _t = ["aria-label"], vt = [
|
|
|
1011
1016
|
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
1012
1017
|
color: "var(--tpl-primary)"
|
|
1013
1018
|
}
|
|
1014
|
-
}, t(e.label), 11,
|
|
1019
|
+
}, t(e.label), 11, St)) : e.type === "logicMergeTag" ? (n(), _("span", {
|
|
1015
1020
|
key: 2,
|
|
1016
1021
|
class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
|
|
1017
1022
|
"data-tooltip": e.value,
|
|
@@ -1020,7 +1025,7 @@ var _t = ["aria-label"], vt = [
|
|
|
1020
1025
|
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
1021
1026
|
color: "var(--tpl-primary)"
|
|
1022
1027
|
}
|
|
1023
|
-
}, t(e.keyword), 9,
|
|
1028
|
+
}, t(e.keyword), 9, Ct)) : (n(), _("span", wt, t(e.value), 1))], 64))), 128)),
|
|
1024
1029
|
y("button", {
|
|
1025
1030
|
type: "button",
|
|
1026
1031
|
class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all tpl:hover:text-[var(--tpl-primary)] tpl:hover:opacity-100",
|
|
@@ -1028,10 +1033,10 @@ var _t = ["aria-label"], vt = [
|
|
|
1028
1033
|
title: m(s).mergeTag.editAsText,
|
|
1029
1034
|
"data-testid": "merge-tag-field-edit",
|
|
1030
1035
|
onClick: T(f, ["stop"])
|
|
1031
|
-
}, [d(m(
|
|
1036
|
+
}, [d(m(F), {
|
|
1032
1037
|
size: 12,
|
|
1033
1038
|
"stroke-width": 2
|
|
1034
|
-
})], 8,
|
|
1039
|
+
})], 8, Tt),
|
|
1035
1040
|
y("button", {
|
|
1036
1041
|
type: "button",
|
|
1037
1042
|
class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all tpl:hover:text-[var(--tpl-danger)] tpl:hover:opacity-100",
|
|
@@ -1039,58 +1044,58 @@ var _t = ["aria-label"], vt = [
|
|
|
1039
1044
|
title: m(s).mergeTag.remove,
|
|
1040
1045
|
"data-testid": "merge-tag-field-clear",
|
|
1041
1046
|
onClick: p[0] ||= T((e) => o("clear"), ["stop"])
|
|
1042
|
-
}, [d(m(
|
|
1047
|
+
}, [d(m(I), {
|
|
1043
1048
|
size: 12,
|
|
1044
1049
|
"stroke-width": 2.5
|
|
1045
|
-
})], 8,
|
|
1046
|
-
], 10,
|
|
1050
|
+
})], 8, Et)
|
|
1051
|
+
], 10, bt));
|
|
1047
1052
|
}
|
|
1048
|
-
}),
|
|
1053
|
+
}), Ot = [
|
|
1049
1054
|
"aria-label",
|
|
1050
1055
|
"title",
|
|
1051
1056
|
"disabled"
|
|
1052
|
-
],
|
|
1057
|
+
], kt = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:hover:bg-[var(--tpl-primary-light)] tpl:hover:text-[var(--tpl-primary)] tpl:hover:border-[var(--tpl-primary)]", At = /* @__PURE__ */ w({
|
|
1053
1058
|
__name: "MergeTagInsertButton",
|
|
1054
1059
|
props: { disabled: { type: Boolean } },
|
|
1055
1060
|
emits: ["insert"],
|
|
1056
1061
|
setup(e) {
|
|
1057
|
-
let { t: i } =
|
|
1062
|
+
let { t: i } = R();
|
|
1058
1063
|
return (a, o) => (n(), _("button", {
|
|
1059
1064
|
type: "button",
|
|
1060
|
-
class: r([
|
|
1065
|
+
class: r([kt, "tpl:mt-1.5"]),
|
|
1061
1066
|
"aria-label": m(i).mergeTag.insert,
|
|
1062
1067
|
title: m(i).mergeTag.insert,
|
|
1063
1068
|
disabled: e.disabled,
|
|
1064
1069
|
onMousedown: o[0] ||= T(() => {}, ["prevent"]),
|
|
1065
1070
|
onClick: o[1] ||= (e) => a.$emit("insert")
|
|
1066
|
-
}, [d(m(
|
|
1071
|
+
}, [d(m(V), {
|
|
1067
1072
|
size: 12,
|
|
1068
1073
|
"stroke-width": 2
|
|
1069
|
-
}), v(" " + t(m(i).mergeTag.insertShort), 1)], 42,
|
|
1074
|
+
}), v(" " + t(m(i).mergeTag.insertShort), 1)], 42, Ot));
|
|
1070
1075
|
}
|
|
1071
|
-
}),
|
|
1076
|
+
}), jt = [
|
|
1072
1077
|
"aria-label",
|
|
1073
1078
|
"title",
|
|
1074
1079
|
"disabled"
|
|
1075
|
-
],
|
|
1080
|
+
], Mt = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:hover:bg-[var(--tpl-primary-light)] tpl:hover:text-[var(--tpl-primary)] tpl:hover:border-[var(--tpl-primary)]", Nt = /* @__PURE__ */ w({
|
|
1076
1081
|
__name: "LogicTagInsertButton",
|
|
1077
1082
|
props: { disabled: { type: Boolean } },
|
|
1078
1083
|
emits: ["insert"],
|
|
1079
1084
|
setup(e) {
|
|
1080
|
-
let { t: i } =
|
|
1085
|
+
let { t: i } = R();
|
|
1081
1086
|
return (a, o) => (n(), _("button", {
|
|
1082
1087
|
type: "button",
|
|
1083
|
-
class: r([
|
|
1088
|
+
class: r([Mt, "tpl:mt-1.5"]),
|
|
1084
1089
|
"aria-label": m(i).logicTag.insert,
|
|
1085
1090
|
title: m(i).logicTag.insert,
|
|
1086
1091
|
disabled: e.disabled,
|
|
1087
1092
|
"data-testid": "field-insert-logic-button",
|
|
1088
1093
|
onMousedown: o[0] ||= T(() => {}, ["prevent"]),
|
|
1089
1094
|
onClick: o[1] ||= (e) => a.$emit("insert")
|
|
1090
|
-
}, [d(m(
|
|
1095
|
+
}, [d(m(B), {
|
|
1091
1096
|
size: 12,
|
|
1092
1097
|
"stroke-width": 2
|
|
1093
|
-
}), v(" " + t(m(i).logicTag.insertShort), 1)], 42,
|
|
1098
|
+
}), v(" " + t(m(i).logicTag.insertShort), 1)], 42, jt));
|
|
1094
1099
|
}
|
|
1095
1100
|
});
|
|
1096
|
-
export {
|
|
1101
|
+
export { dt as a, et as c, yt as i, V as l, At as n, lt as o, Dt as r, ut as s, Nt as t, B as u };
|