@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
package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-Bt2PXbQ0.js}
RENAMED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { C as e, E as t, F as n, G as r, H as i, L as a, O as o, Q as s, X as c, Y as l, _ as u, b as d, c as f, ct as p, dt as m, f as h, g, h as _, j as v, l as y, m as b, mt as x, n as S, p as C, pt as w, r as T, tt as E, u as D, x as O } from "./draggable-DepKdldn.js";
|
|
2
|
-
import {
|
|
3
|
-
import { G as
|
|
4
|
-
import { et as ee, it as te, p as ne, tt as
|
|
5
|
-
import { t as
|
|
6
|
-
import { d as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
2
|
+
import { H as k, J as A, W as j, X as M, nt as N, q as P, tt as F } from "./src-v47QHNmB.js";
|
|
3
|
+
import { G as I, Ht as L, N as R, t as z } from "./icons-Da9GKjPx.js";
|
|
4
|
+
import { et as ee, it as te, p as ne, tt as B } from "./keys-CoQtCqNv.js";
|
|
5
|
+
import { t as V } from "./useI18n-BnJYydPv.js";
|
|
6
|
+
import { d as re } from "./styleConstants-CgiNKdnc.js";
|
|
7
|
+
import { t as ie } from "./dist-DqGgijFI.js";
|
|
8
|
+
import { t as ae } from "./useMergeTag-1lrpNyR5.js";
|
|
9
9
|
import { a as oe, c as se, n as ce, o as le, r as ue, s as de, t as fe } from "./usePopoverPosition-BWAXWeBv.js";
|
|
10
|
-
import { t as
|
|
10
|
+
import { t as H } from "./useLogicTag-Cbp3I7UN.js";
|
|
11
11
|
// ../../node_modules/.pnpm/vanilla-colorful@0.7.2/node_modules/vanilla-colorful/lib/utils/math.js
|
|
12
|
-
var
|
|
12
|
+
var U = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, W = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n, G = (e) => ge(K(e)), K = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
|
|
13
13
|
r: parseInt(e[0] + e[0], 16),
|
|
14
14
|
g: parseInt(e[1] + e[1], 16),
|
|
15
15
|
b: parseInt(e[2] + e[2], 16),
|
|
16
|
-
a: e.length === 4 ?
|
|
16
|
+
a: e.length === 4 ? W(parseInt(e[3] + e[3], 16) / 255, 2) : 1
|
|
17
17
|
} : {
|
|
18
18
|
r: parseInt(e.substring(0, 2), 16),
|
|
19
19
|
g: parseInt(e.substring(2, 4), 16),
|
|
20
20
|
b: parseInt(e.substring(4, 6), 16),
|
|
21
|
-
a: e.length === 8 ?
|
|
22
|
-
}),
|
|
21
|
+
a: e.length === 8 ? W(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
|
|
22
|
+
}), q = (e) => he(me(e)), pe = ({ h: e, s: t, v: n, a: r }) => {
|
|
23
23
|
let i = (200 - t) * n / 100;
|
|
24
24
|
return {
|
|
25
|
-
h:
|
|
26
|
-
s:
|
|
27
|
-
l:
|
|
28
|
-
a:
|
|
25
|
+
h: W(e),
|
|
26
|
+
s: W(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
|
|
27
|
+
l: W(i / 2),
|
|
28
|
+
a: W(r, 2)
|
|
29
29
|
};
|
|
30
|
-
},
|
|
31
|
-
let { h: t, s: n, l: r } =
|
|
30
|
+
}, J = (e) => {
|
|
31
|
+
let { h: t, s: n, l: r } = pe(e);
|
|
32
32
|
return `hsl(${t}, ${n}%, ${r}%)`;
|
|
33
|
-
},
|
|
33
|
+
}, me = ({ h: e, s: t, v: n, a: r }) => {
|
|
34
34
|
e = e / 360 * 6, t /= 100, n /= 100;
|
|
35
35
|
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;
|
|
36
36
|
return {
|
|
37
|
-
r:
|
|
37
|
+
r: W([
|
|
38
38
|
n,
|
|
39
39
|
o,
|
|
40
40
|
a,
|
|
@@ -42,7 +42,7 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
42
42
|
s,
|
|
43
43
|
n
|
|
44
44
|
][c] * 255),
|
|
45
|
-
g:
|
|
45
|
+
g: W([
|
|
46
46
|
s,
|
|
47
47
|
n,
|
|
48
48
|
n,
|
|
@@ -50,7 +50,7 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
50
50
|
a,
|
|
51
51
|
a
|
|
52
52
|
][c] * 255),
|
|
53
|
-
b:
|
|
53
|
+
b: W([
|
|
54
54
|
a,
|
|
55
55
|
a,
|
|
56
56
|
s,
|
|
@@ -58,73 +58,73 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
58
58
|
n,
|
|
59
59
|
o
|
|
60
60
|
][c] * 255),
|
|
61
|
-
a:
|
|
61
|
+
a: W(r, 2)
|
|
62
62
|
};
|
|
63
|
-
},
|
|
63
|
+
}, Y = (e) => {
|
|
64
64
|
let t = e.toString(16);
|
|
65
65
|
return t.length < 2 ? "0" + t : t;
|
|
66
|
-
}, me = ({ r: e, g: t, b: n, a: r }) => {
|
|
67
|
-
let i = r < 1 ? q(V(r * 255)) : "";
|
|
68
|
-
return "#" + q(e) + q(t) + q(n) + i;
|
|
69
66
|
}, he = ({ r: e, g: t, b: n, a: r }) => {
|
|
67
|
+
let i = r < 1 ? Y(W(r * 255)) : "";
|
|
68
|
+
return "#" + Y(e) + Y(t) + Y(n) + i;
|
|
69
|
+
}, ge = ({ r: e, g: t, b: n, a: r }) => {
|
|
70
70
|
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;
|
|
71
71
|
return {
|
|
72
|
-
h:
|
|
73
|
-
s:
|
|
74
|
-
v:
|
|
72
|
+
h: W(60 * (o < 0 ? o + 6 : o)),
|
|
73
|
+
s: W(i ? a / i * 100 : 0),
|
|
74
|
+
v: W(i / 255 * 100),
|
|
75
75
|
a: r
|
|
76
76
|
};
|
|
77
|
-
},
|
|
77
|
+
}, _e = (e, t) => {
|
|
78
78
|
if (e === t) return !0;
|
|
79
79
|
for (let n in e) if (e[n] !== t[n]) return !1;
|
|
80
80
|
return !0;
|
|
81
|
-
},
|
|
82
|
-
let t =
|
|
83
|
-
return t || (t = document.createElement("template"), t.innerHTML = e,
|
|
84
|
-
},
|
|
81
|
+
}, ve = (e, t) => e.toLowerCase() === t.toLowerCase() || _e(K(e), K(t)), X = {}, Z = (e) => {
|
|
82
|
+
let t = X[e];
|
|
83
|
+
return t || (t = document.createElement("template"), t.innerHTML = e, X[e] = t), t;
|
|
84
|
+
}, Q = (e, t, n) => {
|
|
85
85
|
e.dispatchEvent(new CustomEvent(t, {
|
|
86
86
|
bubbles: !0,
|
|
87
87
|
detail: n
|
|
88
88
|
}));
|
|
89
|
-
},
|
|
90
|
-
let n =
|
|
91
|
-
|
|
92
|
-
x:
|
|
93
|
-
y:
|
|
89
|
+
}, $ = !1, ye = (e) => "touches" in e, be = (e) => $ && !ye(e) ? !1 : ($ ||= ye(e), !0), xe = (e, t) => {
|
|
90
|
+
let n = ye(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
|
|
91
|
+
Q(e.el, "move", e.getMove({
|
|
92
|
+
x: U((n.pageX - (r.left + window.pageXOffset)) / r.width),
|
|
93
|
+
y: U((n.pageY - (r.top + window.pageYOffset)) / r.height)
|
|
94
94
|
}));
|
|
95
|
-
},
|
|
95
|
+
}, Se = (e, t) => {
|
|
96
96
|
let n = t.keyCode;
|
|
97
|
-
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(),
|
|
97
|
+
n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), Q(e.el, "move", e.getMove({
|
|
98
98
|
x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
|
|
99
99
|
y: n === 40 ? .01 : n === 38 ? -.01 : 0
|
|
100
100
|
}, !0)));
|
|
101
|
-
},
|
|
101
|
+
}, Ce = class {
|
|
102
102
|
constructor(e, t, n, r) {
|
|
103
|
-
let i =
|
|
103
|
+
let i = Z(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
|
|
104
104
|
e.appendChild(i.content.cloneNode(!0));
|
|
105
105
|
let a = e.querySelector(`[part=${t}]`);
|
|
106
106
|
a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
|
|
107
107
|
}
|
|
108
108
|
set dragging(e) {
|
|
109
109
|
let t = e ? document.addEventListener : document.removeEventListener;
|
|
110
|
-
t(
|
|
110
|
+
t($ ? "touchmove" : "mousemove", this), t($ ? "touchend" : "mouseup", this);
|
|
111
111
|
}
|
|
112
112
|
handleEvent(e) {
|
|
113
113
|
switch (e.type) {
|
|
114
114
|
case "mousedown":
|
|
115
115
|
case "touchstart":
|
|
116
|
-
if (e.preventDefault(), !be(e) ||
|
|
117
|
-
this.el.focus(),
|
|
116
|
+
if (e.preventDefault(), !be(e) || !$ && e.button != 0) return;
|
|
117
|
+
this.el.focus(), xe(this, e), this.dragging = !0;
|
|
118
118
|
break;
|
|
119
119
|
case "mousemove":
|
|
120
120
|
case "touchmove":
|
|
121
|
-
e.preventDefault(),
|
|
121
|
+
e.preventDefault(), xe(this, e);
|
|
122
122
|
break;
|
|
123
123
|
case "mouseup":
|
|
124
124
|
case "touchend":
|
|
125
125
|
this.dragging = !1;
|
|
126
126
|
break;
|
|
127
|
-
case "keydown":
|
|
127
|
+
case "keydown": Se(this, e);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
style(e) {
|
|
@@ -132,25 +132,25 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
132
132
|
for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
},
|
|
135
|
+
}, we = class extends Ce {
|
|
136
136
|
constructor(e) {
|
|
137
137
|
super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
|
|
138
138
|
}
|
|
139
139
|
update({ h: e }) {
|
|
140
140
|
this.h = e, this.style([{
|
|
141
141
|
left: `${e / 360 * 100}%`,
|
|
142
|
-
color:
|
|
142
|
+
color: J({
|
|
143
143
|
h: e,
|
|
144
144
|
s: 100,
|
|
145
145
|
v: 100,
|
|
146
146
|
a: 1
|
|
147
147
|
})
|
|
148
|
-
}]), this.el.setAttribute("aria-valuenow", `${
|
|
148
|
+
}]), this.el.setAttribute("aria-valuenow", `${W(e)}`);
|
|
149
149
|
}
|
|
150
150
|
getMove(e, t) {
|
|
151
|
-
return { h: t ?
|
|
151
|
+
return { h: t ? U(this.h + e.x * 360, 0, 360) : 360 * e.x };
|
|
152
152
|
}
|
|
153
|
-
},
|
|
153
|
+
}, Te = class extends Ce {
|
|
154
154
|
constructor(e) {
|
|
155
155
|
super(e, "saturation", "aria-label=\"Color\"", !0);
|
|
156
156
|
}
|
|
@@ -158,47 +158,47 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
158
158
|
this.hsva = e, this.style([{
|
|
159
159
|
top: `${100 - e.v}%`,
|
|
160
160
|
left: `${e.s}%`,
|
|
161
|
-
color:
|
|
162
|
-
}, { "background-color":
|
|
161
|
+
color: J(e)
|
|
162
|
+
}, { "background-color": J({
|
|
163
163
|
h: e.h,
|
|
164
164
|
s: 100,
|
|
165
165
|
v: 100,
|
|
166
166
|
a: 1
|
|
167
|
-
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${
|
|
167
|
+
}) }]), this.el.setAttribute("aria-valuetext", `Saturation ${W(e.s)}%, Brightness ${W(e.v)}%`);
|
|
168
168
|
}
|
|
169
169
|
getMove(e, t) {
|
|
170
170
|
return {
|
|
171
|
-
s: t ?
|
|
172
|
-
v: t ?
|
|
171
|
+
s: t ? U(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
|
|
172
|
+
v: t ? U(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, Ee = ":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)}", De = "[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}", Oe = "[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}", ke = Symbol("same"), Ae = Symbol("color"), je = Symbol("hsva"), Me = Symbol("update"), Ne = Symbol("parts"), Pe = Symbol("css"), Fe = Symbol("sliders"), Ie = class extends HTMLElement {
|
|
176
176
|
static get observedAttributes() {
|
|
177
177
|
return ["color"];
|
|
178
178
|
}
|
|
179
|
-
get [
|
|
179
|
+
get [Pe]() {
|
|
180
180
|
return [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
Ee,
|
|
182
|
+
De,
|
|
183
|
+
Oe
|
|
184
184
|
];
|
|
185
185
|
}
|
|
186
|
-
get [
|
|
187
|
-
return [
|
|
186
|
+
get [Fe]() {
|
|
187
|
+
return [Te, we];
|
|
188
188
|
}
|
|
189
189
|
get color() {
|
|
190
|
-
return this[
|
|
190
|
+
return this[Ae];
|
|
191
191
|
}
|
|
192
192
|
set color(e) {
|
|
193
|
-
if (!this[
|
|
193
|
+
if (!this[ke](e)) {
|
|
194
194
|
let t = this.colorModel.toHsva(e);
|
|
195
|
-
this[
|
|
195
|
+
this[Me](t), this[Ae] = e;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
constructor() {
|
|
199
199
|
super();
|
|
200
|
-
let e =
|
|
201
|
-
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[
|
|
200
|
+
let e = Z(`<style>${this[Pe].join("")}</style>`), t = this.attachShadow({ mode: "open" });
|
|
201
|
+
t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[Ne] = this[Fe].map((e) => new e(t));
|
|
202
202
|
}
|
|
203
203
|
connectedCallback() {
|
|
204
204
|
if (this.hasOwnProperty("color")) {
|
|
@@ -208,78 +208,78 @@ var B = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, V = (e, t = 0, n = 10 **
|
|
|
208
208
|
}
|
|
209
209
|
attributeChangedCallback(e, t, n) {
|
|
210
210
|
let r = this.colorModel.fromAttr(n);
|
|
211
|
-
this[
|
|
211
|
+
this[ke](r) || (this.color = r);
|
|
212
212
|
}
|
|
213
213
|
handleEvent(e) {
|
|
214
|
-
let t = this[
|
|
214
|
+
let t = this[je], n = {
|
|
215
215
|
...t,
|
|
216
216
|
...e.detail
|
|
217
217
|
};
|
|
218
|
-
this[
|
|
218
|
+
this[Me](n);
|
|
219
219
|
let r;
|
|
220
|
-
!
|
|
220
|
+
!_e(n, t) && !this[ke](r = this.colorModel.fromHsva(n)) && (this[Ae] = r, Q(this, "color-changed", { value: r }));
|
|
221
221
|
}
|
|
222
|
-
[
|
|
222
|
+
[ke](e) {
|
|
223
223
|
return this.color && this.colorModel.equal(e, this.color);
|
|
224
224
|
}
|
|
225
|
-
[
|
|
226
|
-
this[
|
|
225
|
+
[Me](e) {
|
|
226
|
+
this[je] = e, this[Ne].forEach((t) => t.update(e));
|
|
227
227
|
}
|
|
228
|
-
},
|
|
228
|
+
}, Le = {
|
|
229
229
|
defaultColor: "#000",
|
|
230
|
-
toHsva:
|
|
231
|
-
fromHsva: ({ h: e, s: t, v: n }) =>
|
|
230
|
+
toHsva: G,
|
|
231
|
+
fromHsva: ({ h: e, s: t, v: n }) => q({
|
|
232
232
|
h: e,
|
|
233
233
|
s: t,
|
|
234
234
|
v: n,
|
|
235
235
|
a: 1
|
|
236
236
|
}),
|
|
237
|
-
equal:
|
|
237
|
+
equal: ve,
|
|
238
238
|
fromAttr: (e) => e
|
|
239
|
-
},
|
|
239
|
+
}, Re = class extends Ie {
|
|
240
240
|
get colorModel() {
|
|
241
|
-
return
|
|
241
|
+
return Le;
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
|
-
customElements.define("hex-color-picker", class extends
|
|
244
|
+
customElements.define("hex-color-picker", class extends Re {});
|
|
245
245
|
// src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
246
|
-
var
|
|
246
|
+
var ze = [
|
|
247
247
|
"disabled",
|
|
248
248
|
"aria-label",
|
|
249
249
|
"title",
|
|
250
250
|
"aria-expanded"
|
|
251
|
-
],
|
|
251
|
+
], Be = {
|
|
252
252
|
key: 0,
|
|
253
253
|
class: "tpl:relative tpl:flex-1"
|
|
254
|
-
},
|
|
254
|
+
}, Ve = [
|
|
255
255
|
"value",
|
|
256
256
|
"placeholder",
|
|
257
257
|
"disabled",
|
|
258
258
|
"aria-label"
|
|
259
|
-
],
|
|
259
|
+
], He = ["aria-label", "title"], Ue = ["data-tpl-theme"], We = [
|
|
260
260
|
"aria-pressed",
|
|
261
261
|
"aria-label",
|
|
262
262
|
"title"
|
|
263
|
-
],
|
|
263
|
+
], Ge = ["aria-label"], Ke = [
|
|
264
264
|
"aria-label",
|
|
265
265
|
"title",
|
|
266
266
|
"aria-checked",
|
|
267
267
|
"tabindex"
|
|
268
|
-
],
|
|
268
|
+
], qe = [
|
|
269
269
|
"aria-label",
|
|
270
270
|
"title",
|
|
271
271
|
"aria-checked",
|
|
272
272
|
"tabindex",
|
|
273
273
|
"onClick"
|
|
274
|
-
],
|
|
274
|
+
], Je = ["color", "aria-label"], Ye = {
|
|
275
275
|
key: 3,
|
|
276
276
|
class: "tpl:relative tpl:mt-2"
|
|
277
|
-
},
|
|
277
|
+
}, Xe = [
|
|
278
278
|
"value",
|
|
279
279
|
"placeholder",
|
|
280
280
|
"disabled",
|
|
281
281
|
"aria-label"
|
|
282
|
-
],
|
|
282
|
+
], Ze = ["aria-label", "title"], Qe = /* @__PURE__ */ e({
|
|
283
283
|
__name: "ColorPicker",
|
|
284
284
|
props: {
|
|
285
285
|
modelValue: {},
|
|
@@ -307,37 +307,37 @@ var Ie = [
|
|
|
307
307
|
},
|
|
308
308
|
emits: ["update:modelValue"],
|
|
309
309
|
setup(e, { emit: t }) {
|
|
310
|
-
let s = e, c = se(), l = C(() => s.disabled || !c.value), v = t, { t: T } =
|
|
310
|
+
let s = e, c = se(), l = C(() => s.disabled || !c.value), v = t, { t: T } = V(), k = E(!1);
|
|
311
311
|
i(l, (e) => {
|
|
312
312
|
e && (k.value = !1);
|
|
313
313
|
}, { flush: "sync" });
|
|
314
314
|
let A = E(), j = E(), M = E(!1);
|
|
315
|
-
|
|
315
|
+
ie(A, () => {
|
|
316
316
|
k.value = !1;
|
|
317
317
|
}, { ignore: [j] });
|
|
318
|
-
let N = C(() => !s.modelValue), P = C(() => s.modelValue.trim().toLowerCase() === "transparent"), F = C(() => le(s.modelValue)),
|
|
319
|
-
function W(e) {
|
|
320
|
-
return pe.value !== "" && oe(e) === pe.value;
|
|
321
|
-
}
|
|
318
|
+
let N = C(() => !s.modelValue), P = C(() => s.modelValue.trim().toLowerCase() === "transparent"), F = C(() => le(s.modelValue)), I = C(() => (s.modelValue ? de(s.modelValue) : null) || (de(s.seedColor) ?? "#ffffff")), L = C(() => !l.value && !N.value), R = o(ne, ue), B = C(() => [...new Set(s.presets ?? R.presets)]), ae = C(() => s.allowCustom ?? R.allowCustom), H = C(() => B.value.length > 0), U = C(() => ae.value || !H.value), W = C(() => oe(s.modelValue));
|
|
322
319
|
function G(e) {
|
|
320
|
+
return W.value !== "" && oe(e) === W.value;
|
|
321
|
+
}
|
|
322
|
+
function K(e) {
|
|
323
323
|
l.value || v("update:modelValue", e);
|
|
324
324
|
}
|
|
325
|
-
let
|
|
326
|
-
function
|
|
327
|
-
return
|
|
325
|
+
let q = C(() => H.value && !U.value);
|
|
326
|
+
function pe(e) {
|
|
327
|
+
return q.value ? e + 1 : e;
|
|
328
328
|
}
|
|
329
|
-
let
|
|
330
|
-
if (
|
|
331
|
-
let e = B.value.findIndex((e) =>
|
|
332
|
-
return e === -1 ? 0 :
|
|
329
|
+
let J = C(() => {
|
|
330
|
+
if (q.value && N.value) return 0;
|
|
331
|
+
let e = B.value.findIndex((e) => G(e));
|
|
332
|
+
return e === -1 ? 0 : pe(e);
|
|
333
333
|
});
|
|
334
|
-
function
|
|
335
|
-
return
|
|
334
|
+
function me() {
|
|
335
|
+
return J.value === 0 ? 0 : -1;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
337
|
+
function Y(e) {
|
|
338
|
+
return pe(e) === J.value ? 0 : -1;
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function he(e) {
|
|
341
341
|
if (![
|
|
342
342
|
"ArrowRight",
|
|
343
343
|
"ArrowDown",
|
|
@@ -347,35 +347,35 @@ var Ie = [
|
|
|
347
347
|
let t = Array.from(e.currentTarget.querySelectorAll("[role=\"radio\"]")), n = e.target.closest("[role=\"radio\"]"), r = n ? t.indexOf(n) : -1;
|
|
348
348
|
r !== -1 && (t[(r + (e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus(), e.preventDefault());
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function ge(e) {
|
|
351
351
|
l.value || (M.value = !0, v("update:modelValue", e.detail.value));
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function _e() {
|
|
354
354
|
l.value || (M.value = !1);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
l.value || !M.value && N.value && v("update:modelValue",
|
|
356
|
+
function ve() {
|
|
357
|
+
l.value || !M.value && N.value && v("update:modelValue", I.value);
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function X(e) {
|
|
360
360
|
l.value || v("update:modelValue", e.target.value);
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Z() {
|
|
363
363
|
l.value || v("update:modelValue", "");
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function Q() {
|
|
366
366
|
l.value || v("update:modelValue", "transparent");
|
|
367
367
|
}
|
|
368
|
-
let
|
|
368
|
+
let $ = ce(), { toLocal: ye } = fe(), be = o(ee, null), xe = o(te, null), Se = E({
|
|
369
369
|
top: 0,
|
|
370
370
|
left: 0
|
|
371
371
|
});
|
|
372
|
-
function
|
|
372
|
+
function Ce() {
|
|
373
373
|
if (!l.value) {
|
|
374
374
|
if (!k.value) {
|
|
375
375
|
let e = j.value?.getBoundingClientRect();
|
|
376
376
|
if (e) {
|
|
377
377
|
let t = e.bottom + 8 + 240 <= window.innerHeight ? e.bottom + 8 : Math.max(8, e.top - 240 - 8);
|
|
378
|
-
|
|
378
|
+
Se.value = ye({
|
|
379
379
|
top: t,
|
|
380
380
|
left: e.left
|
|
381
381
|
});
|
|
@@ -399,37 +399,37 @@ var Ie = [
|
|
|
399
399
|
k.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !l.value && "tpl:hover:border-[var(--tpl-text-dim)]",
|
|
400
400
|
e.size === "sm" ? "tpl:size-8" : "tpl:size-10"
|
|
401
401
|
]),
|
|
402
|
-
onClick:
|
|
402
|
+
onClick: Ce
|
|
403
403
|
}, [b("span", {
|
|
404
404
|
class: m(["tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]", {
|
|
405
405
|
"tpl-color-swatch-empty": N.value,
|
|
406
406
|
"tpl-color-swatch-transparent": P.value
|
|
407
407
|
}]),
|
|
408
408
|
style: w(N.value || P.value ? void 0 : { backgroundColor: F.value })
|
|
409
|
-
}, null, 6)], 10,
|
|
410
|
-
!e.swatchOnly && U.value ? (n(), u("div",
|
|
409
|
+
}, null, 6)], 10, ze),
|
|
410
|
+
!e.swatchOnly && U.value ? (n(), u("div", Be, [b("input", {
|
|
411
411
|
type: "text",
|
|
412
|
-
class: m([p(
|
|
413
|
-
style: w(
|
|
412
|
+
class: m([p(re), "tpl:w-full"]),
|
|
413
|
+
style: w(L.value ? { paddingRight: "2.25rem" } : void 0),
|
|
414
414
|
value: F.value,
|
|
415
415
|
placeholder: e.placeholder || p(T).colorPicker.notSet,
|
|
416
416
|
disabled: l.value,
|
|
417
417
|
"aria-label": p(T).colorPicker.hexValue,
|
|
418
|
-
onInput:
|
|
419
|
-
}, null, 46,
|
|
418
|
+
onInput: X
|
|
419
|
+
}, null, 46, Ve), L.value ? (n(), u("button", {
|
|
420
420
|
key: 0,
|
|
421
421
|
type: "button",
|
|
422
422
|
"aria-label": p(T).colorPicker.clear,
|
|
423
423
|
title: p(T).colorPicker.clear,
|
|
424
424
|
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)]",
|
|
425
|
-
onClick:
|
|
426
|
-
}, [O(p(
|
|
425
|
+
onClick: Z
|
|
426
|
+
}, [O(p(z), {
|
|
427
427
|
size: 14,
|
|
428
428
|
"stroke-width": 1.5
|
|
429
|
-
})], 8,
|
|
429
|
+
})], 8, He)) : g("", !0)])) : g("", !0),
|
|
430
430
|
(n(), _(h, {
|
|
431
|
-
to: p(
|
|
432
|
-
disabled: !p(
|
|
431
|
+
to: p($),
|
|
432
|
+
disabled: !p($)
|
|
433
433
|
}, [O(S, {
|
|
434
434
|
"enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
435
435
|
"enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
|
|
@@ -442,12 +442,12 @@ var Ie = [
|
|
|
442
442
|
key: 0,
|
|
443
443
|
ref_key: "popoverRef",
|
|
444
444
|
ref: A,
|
|
445
|
-
"data-tpl-theme": p(
|
|
445
|
+
"data-tpl-theme": p(xe),
|
|
446
446
|
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)]",
|
|
447
447
|
style: w({
|
|
448
|
-
top: `${
|
|
449
|
-
left: `${
|
|
450
|
-
...p(
|
|
448
|
+
top: `${Se.value.top}px`,
|
|
449
|
+
left: `${Se.value.left}px`,
|
|
450
|
+
...p(be)
|
|
451
451
|
})
|
|
452
452
|
}, [
|
|
453
453
|
e.allowTransparent ? (n(), u("button", {
|
|
@@ -458,83 +458,83 @@ var Ie = [
|
|
|
458
458
|
"aria-label": p(T).colorPicker.transparent,
|
|
459
459
|
title: p(T).colorPicker.transparent,
|
|
460
460
|
class: m(["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)]", P.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)]"]),
|
|
461
|
-
onClick:
|
|
462
|
-
}, [i[2] ||= b("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), d(" " + x(p(T).colorPicker.transparent), 1)], 10,
|
|
461
|
+
onClick: Q
|
|
462
|
+
}, [i[2] ||= b("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), d(" " + x(p(T).colorPicker.transparent), 1)], 10, We)) : g("", !0),
|
|
463
463
|
H.value ? (n(), u("div", {
|
|
464
464
|
key: 1,
|
|
465
465
|
role: "radiogroup",
|
|
466
466
|
"aria-label": p(T).colorPicker.presetColors,
|
|
467
467
|
class: m(["tpl:flex tpl:flex-wrap tpl:gap-1.5", U.value && "tpl:mb-2"]),
|
|
468
|
-
onKeydown:
|
|
469
|
-
}, [
|
|
468
|
+
onKeydown: he
|
|
469
|
+
}, [q.value ? (n(), u("button", {
|
|
470
470
|
key: 0,
|
|
471
471
|
type: "button",
|
|
472
472
|
role: "radio",
|
|
473
473
|
"aria-label": p(T).colorPicker.clear,
|
|
474
474
|
title: p(T).colorPicker.clear,
|
|
475
475
|
"aria-checked": N.value,
|
|
476
|
-
tabindex:
|
|
476
|
+
tabindex: me(),
|
|
477
477
|
class: m(["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)]", N.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)]"]),
|
|
478
|
-
onClick:
|
|
479
|
-
}, null, 10,
|
|
478
|
+
onClick: Z
|
|
479
|
+
}, null, 10, Ke)) : g("", !0), (n(!0), u(D, null, a(B.value, (e, t) => (n(), u("button", {
|
|
480
480
|
key: e,
|
|
481
481
|
type: "button",
|
|
482
482
|
role: "radio",
|
|
483
483
|
"aria-label": e,
|
|
484
484
|
title: e,
|
|
485
|
-
"aria-checked":
|
|
486
|
-
tabindex:
|
|
485
|
+
"aria-checked": G(e),
|
|
486
|
+
tabindex: Y(t),
|
|
487
487
|
style: w({ backgroundColor: e }),
|
|
488
|
-
class: m(["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)]",
|
|
489
|
-
onClick: (t) =>
|
|
490
|
-
}, null, 14,
|
|
488
|
+
class: m(["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)]", G(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)]"]),
|
|
489
|
+
onClick: (t) => K(e)
|
|
490
|
+
}, null, 14, qe))), 128))], 42, Ge)) : g("", !0),
|
|
491
491
|
U.value ? (n(), u("hex-color-picker", {
|
|
492
492
|
key: 2,
|
|
493
|
-
color:
|
|
493
|
+
color: I.value,
|
|
494
494
|
"aria-label": p(T).colorPicker.pickColor,
|
|
495
|
-
onColorChanged:
|
|
496
|
-
onPointerdown:
|
|
497
|
-
onPointerup:
|
|
495
|
+
onColorChanged: ge,
|
|
496
|
+
onPointerdown: _e,
|
|
497
|
+
onPointerup: ve,
|
|
498
498
|
onKeydown: i[0] ||= f((e) => k.value = !1, ["escape"])
|
|
499
|
-
}, null, 40,
|
|
500
|
-
e.swatchOnly && U.value ? (n(), u("div",
|
|
499
|
+
}, null, 40, Je)) : g("", !0),
|
|
500
|
+
e.swatchOnly && U.value ? (n(), u("div", Ye, [b("input", {
|
|
501
501
|
type: "text",
|
|
502
|
-
class: m([p(
|
|
503
|
-
style: w(
|
|
502
|
+
class: m([p(re), "tpl:w-full"]),
|
|
503
|
+
style: w(L.value ? { paddingRight: "2.25rem" } : void 0),
|
|
504
504
|
value: F.value,
|
|
505
505
|
placeholder: e.placeholder || p(T).colorPicker.notSet,
|
|
506
506
|
disabled: l.value,
|
|
507
507
|
"aria-label": p(T).colorPicker.hexValue,
|
|
508
|
-
onChange:
|
|
508
|
+
onChange: X,
|
|
509
509
|
onKeydown: i[1] ||= f(y((e) => e.target.blur(), ["prevent"]), ["enter"])
|
|
510
|
-
}, null, 46,
|
|
510
|
+
}, null, 46, Xe), L.value ? (n(), u("button", {
|
|
511
511
|
key: 0,
|
|
512
512
|
type: "button",
|
|
513
513
|
"aria-label": p(T).colorPicker.clear,
|
|
514
514
|
title: p(T).colorPicker.clear,
|
|
515
515
|
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)]",
|
|
516
|
-
onClick:
|
|
517
|
-
}, [O(p(
|
|
516
|
+
onClick: Z
|
|
517
|
+
}, [O(p(z), {
|
|
518
518
|
size: 14,
|
|
519
519
|
"stroke-width": 1.5
|
|
520
|
-
})], 8,
|
|
521
|
-
], 12,
|
|
520
|
+
})], 8, Ze)) : g("", !0)])) : g("", !0)
|
|
521
|
+
], 12, Ue)) : g("", !0)]),
|
|
522
522
|
_: 1
|
|
523
523
|
})], 8, ["to", "disabled"]))
|
|
524
524
|
], 2));
|
|
525
525
|
}
|
|
526
|
-
}),
|
|
526
|
+
}), $e = ["id"], et = {
|
|
527
527
|
key: 0,
|
|
528
528
|
class: "tpl:px-3 tpl:py-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]",
|
|
529
529
|
"data-testid": "merge-tag-suggestion-empty"
|
|
530
|
-
},
|
|
530
|
+
}, tt = [
|
|
531
531
|
"id",
|
|
532
532
|
"aria-selected",
|
|
533
533
|
"data-selected",
|
|
534
534
|
"data-merge-tag-value",
|
|
535
535
|
"onMousedown",
|
|
536
536
|
"onMousemove"
|
|
537
|
-
],
|
|
537
|
+
], nt = { class: "tpl:font-medium" }, rt = { class: "tpl:text-[var(--tpl-text-dim)] tpl:font-mono" }, it = /* @__PURE__ */ e({
|
|
538
538
|
__name: "MergeTagSuggestionList",
|
|
539
539
|
props: {
|
|
540
540
|
items: {},
|
|
@@ -553,7 +553,7 @@ var Ie = [
|
|
|
553
553
|
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)]",
|
|
554
554
|
role: "listbox",
|
|
555
555
|
"data-testid": "merge-tag-suggestion-list"
|
|
556
|
-
}, [e.items.length === 0 ? (n(), u("div",
|
|
556
|
+
}, [e.items.length === 0 ? (n(), u("div", et, x(e.emptyText), 1)) : g("", !0), (n(!0), u(D, null, a(e.items, (i, a) => (n(), u("button", {
|
|
557
557
|
key: i.value,
|
|
558
558
|
id: r(a),
|
|
559
559
|
type: "button",
|
|
@@ -564,21 +564,21 @@ var Ie = [
|
|
|
564
564
|
class: m(["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", a === 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)]"]),
|
|
565
565
|
onMousedown: y((e) => t.$emit("select", i), ["prevent", "stop"]),
|
|
566
566
|
onMousemove: (n) => a !== e.selectedIndex && t.$emit("hover", a)
|
|
567
|
-
}, [b("span",
|
|
567
|
+
}, [b("span", nt, x(i.label), 1), b("span", rt, x(i.value), 1)], 42, tt))), 128))], 8, $e));
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
570
|
-
function
|
|
569
|
+
}), at = 10, ot = 0;
|
|
570
|
+
function st(e, t) {
|
|
571
571
|
let n = t.trim().toLowerCase();
|
|
572
|
-
return n === "" ? e.slice(0,
|
|
572
|
+
return n === "" ? e.slice(0, at) : e.filter((e) => {
|
|
573
573
|
let t = e.label.toLowerCase(), r = e.value.toLowerCase();
|
|
574
574
|
return t.includes(n) || r.includes(n);
|
|
575
|
-
}).slice(0,
|
|
575
|
+
}).slice(0, at);
|
|
576
576
|
}
|
|
577
|
-
function
|
|
577
|
+
function ct(e, t, n, r) {
|
|
578
578
|
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;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
581
|
-
let r = null, i = null, a = null, o = E([]), s = E(0), c = null, l = `tpl-merge-tag-suggestion-${++
|
|
580
|
+
function lt(e, n) {
|
|
581
|
+
let r = null, i = null, a = null, o = E([]), s = E(0), c = null, l = `tpl-merge-tag-suggestion-${++ot}`, u = null, d = [], f = null;
|
|
582
582
|
function p() {
|
|
583
583
|
v(u?.() ?? null);
|
|
584
584
|
}
|
|
@@ -642,7 +642,7 @@ function ot(e, n) {
|
|
|
642
642
|
return {
|
|
643
643
|
open: ({ items: d, getRect: f, anchorEl: p, onCommand: h }) => {
|
|
644
644
|
o.value = d, s.value = 0, c = h, i = document.createElement("div"), i.setAttribute("data-testid", "merge-tag-suggestion-popup"), a = p, y(i, p), (n?.value ?? document.body).appendChild(i), r = T({ render() {
|
|
645
|
-
return t(
|
|
645
|
+
return t(it, {
|
|
646
646
|
items: o.value,
|
|
647
647
|
selectedIndex: s.value,
|
|
648
648
|
emptyText: e,
|
|
@@ -658,7 +658,7 @@ function ot(e, n) {
|
|
|
658
658
|
o.value = e, s.value >= e.length && (s.value = 0), c = n, x(), u = t, m();
|
|
659
659
|
},
|
|
660
660
|
handleKeyDown: (e) => {
|
|
661
|
-
let t =
|
|
661
|
+
let t = ct(e, o.value, s, S);
|
|
662
662
|
return t && x(), t;
|
|
663
663
|
},
|
|
664
664
|
close: () => {
|
|
@@ -668,10 +668,10 @@ function ot(e, n) {
|
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
// src/utils/mergeTagTrigger.ts
|
|
671
|
-
function
|
|
671
|
+
function ut(e, t, n, r, i) {
|
|
672
672
|
if (!n) return null;
|
|
673
673
|
let a = e.slice(0, t), o = a.lastIndexOf(n);
|
|
674
|
-
if (o === -1 || i && o <
|
|
674
|
+
if (o === -1 || i && o < dt(a, i)) return null;
|
|
675
675
|
let s = a.slice(o + n.length);
|
|
676
676
|
return /\s/.test(s) || r && s.includes(r) ? null : {
|
|
677
677
|
triggerStart: o,
|
|
@@ -679,14 +679,19 @@ function st(e, t, n, r, i) {
|
|
|
679
679
|
query: s
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
|
-
function
|
|
683
|
-
let n =
|
|
684
|
-
|
|
685
|
-
|
|
682
|
+
function dt(e, t) {
|
|
683
|
+
let n = Object.values(k).find((e) => e.value === t);
|
|
684
|
+
if (n) {
|
|
685
|
+
let t = N(e, n, "value"), r = t[t.length - 1];
|
|
686
|
+
return r ? r.index + r.value.length : 0;
|
|
687
|
+
}
|
|
688
|
+
let r = new RegExp(t.source, `${t.flags.replace(/[gy]/g, "")}g`), i = 0;
|
|
689
|
+
for (let t of e.matchAll(r)) i = t.index + t[0].length;
|
|
690
|
+
return i;
|
|
686
691
|
}
|
|
687
692
|
// src/utils/textFieldCaret.ts
|
|
688
|
-
var
|
|
689
|
-
function
|
|
693
|
+
var ft = /* @__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(".");
|
|
694
|
+
function pt(e, t, n) {
|
|
690
695
|
return {
|
|
691
696
|
left: e,
|
|
692
697
|
top: t,
|
|
@@ -699,7 +704,7 @@ function ut(e, t, n) {
|
|
|
699
704
|
toJSON: () => ({})
|
|
700
705
|
};
|
|
701
706
|
}
|
|
702
|
-
function
|
|
707
|
+
function mt(e, t) {
|
|
703
708
|
let n = e.ownerDocument, r = n.defaultView;
|
|
704
709
|
if (!r) return null;
|
|
705
710
|
let i = e.tagName === "INPUT", a = r.getComputedStyle(e), o = n.createElement("div");
|
|
@@ -707,7 +712,7 @@ function dt(e, t) {
|
|
|
707
712
|
let s = o.style;
|
|
708
713
|
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";
|
|
709
714
|
let c = s, l = a;
|
|
710
|
-
for (let e of
|
|
715
|
+
for (let e of ft) c[e] = l[e];
|
|
711
716
|
i && (s.width = "auto", s.whiteSpace = "pre");
|
|
712
717
|
let u = e.value, d = u.slice(0, t);
|
|
713
718
|
i && (d = d.replace(/\s/g, "\xA0")), o.textContent = d;
|
|
@@ -716,19 +721,19 @@ function dt(e, t) {
|
|
|
716
721
|
let p = f.offsetTop, m = f.offsetLeft;
|
|
717
722
|
n.body.removeChild(o);
|
|
718
723
|
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;
|
|
719
|
-
if (i) return
|
|
724
|
+
if (i) return pt(y, h.top, h.bottom);
|
|
720
725
|
let b = h.top + p + g - e.scrollTop;
|
|
721
|
-
return
|
|
726
|
+
return pt(y, b, b + v);
|
|
722
727
|
}
|
|
723
728
|
// src/composables/useMergeTagAutocomplete.ts
|
|
724
|
-
var
|
|
729
|
+
var ht = /* @__PURE__ */ new Set([
|
|
725
730
|
"ArrowLeft",
|
|
726
731
|
"ArrowRight",
|
|
727
732
|
"Home",
|
|
728
733
|
"End"
|
|
729
734
|
]);
|
|
730
|
-
function
|
|
731
|
-
let { elementRef: t, modelValue: n, emit: r, mergeTags: a, syntax: u, enabled: d, onInsert: f } = e, p = se(), m =
|
|
735
|
+
function gt(e) {
|
|
736
|
+
let { elementRef: t, modelValue: n, emit: r, mergeTags: a, syntax: u, enabled: d, onInsert: f } = e, p = se(), m = A(u), h = P(u), g = C(() => p.value && d && m !== null && a.value.length > 0), _ = o(B, null), y = lt((c(_) ? _.value : _)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", ce());
|
|
732
737
|
i(p, (e) => {
|
|
733
738
|
e || y.close();
|
|
734
739
|
}, { flush: "sync" });
|
|
@@ -738,7 +743,7 @@ function pt(e) {
|
|
|
738
743
|
});
|
|
739
744
|
function x(e) {
|
|
740
745
|
let t = e.value ?? "";
|
|
741
|
-
return
|
|
746
|
+
return ut(t, e.selectionStart ?? t.length, m, h, u.value);
|
|
742
747
|
}
|
|
743
748
|
function S(e, i, a) {
|
|
744
749
|
if (!p.value) return;
|
|
@@ -761,7 +766,7 @@ function pt(e) {
|
|
|
761
766
|
y.close();
|
|
762
767
|
return;
|
|
763
768
|
}
|
|
764
|
-
let r =
|
|
769
|
+
let r = st(a.value, n.query), i = () => mt(e, n.triggerStart), o = (t) => S(e, n, t);
|
|
765
770
|
y.isOpen() ? y.update({
|
|
766
771
|
items: r,
|
|
767
772
|
getRect: i,
|
|
@@ -774,7 +779,7 @@ function pt(e) {
|
|
|
774
779
|
});
|
|
775
780
|
}
|
|
776
781
|
function T(e) {
|
|
777
|
-
return y.isOpen() ? e.key === "Escape" ? (y.close(), !0) :
|
|
782
|
+
return y.isOpen() ? e.key === "Escape" ? (y.close(), !0) : ht.has(e.key) ? (y.close(), !1) : y.handleKeyDown(e) : !1;
|
|
778
783
|
}
|
|
779
784
|
return {
|
|
780
785
|
available: g,
|
|
@@ -785,12 +790,12 @@ function pt(e) {
|
|
|
785
790
|
};
|
|
786
791
|
}
|
|
787
792
|
// src/composables/useMergeTagField.ts
|
|
788
|
-
function
|
|
789
|
-
let { modelValue: t, emit: n, elementRef: r } = e, { mergeTags: i, canRequestMergeTag: a, isRequesting: o, isMergeTagValue: c, getMergeTagDisplayLabel: u, findMergeTag: d, requestMergeTag: f, syntax: p, autocomplete: m } =
|
|
793
|
+
function _t(e) {
|
|
794
|
+
let { modelValue: t, emit: n, elementRef: r } = e, { mergeTags: i, canRequestMergeTag: a, isRequesting: o, isMergeTagValue: c, getMergeTagDisplayLabel: u, findMergeTag: d, requestMergeTag: f, syntax: p, autocomplete: m } = ae(), { canInsertLogicTag: h, isRequesting: g, requestLogicTag: _ } = H(), y = E(!1), b = !1, x = !1;
|
|
790
795
|
l() && s(() => {
|
|
791
796
|
x = !0;
|
|
792
797
|
});
|
|
793
|
-
let S =
|
|
798
|
+
let S = gt({
|
|
794
799
|
elementRef: r,
|
|
795
800
|
modelValue: t,
|
|
796
801
|
emit: n,
|
|
@@ -803,29 +808,29 @@ function mt(e) {
|
|
|
803
808
|
}), w = C(() => {
|
|
804
809
|
let e = t();
|
|
805
810
|
if (!e) return [];
|
|
806
|
-
let n = [], r =
|
|
807
|
-
for (
|
|
808
|
-
|
|
811
|
+
let n = [], r = 0;
|
|
812
|
+
for (let t of F(e, p)) {
|
|
813
|
+
t.index > r && n.push({
|
|
809
814
|
type: "text",
|
|
810
|
-
value: e.slice(
|
|
815
|
+
value: e.slice(r, t.index)
|
|
811
816
|
});
|
|
812
|
-
let
|
|
813
|
-
c(
|
|
817
|
+
let i = t.value;
|
|
818
|
+
c(i) ? n.push({
|
|
814
819
|
type: "mergeTag",
|
|
815
|
-
value:
|
|
816
|
-
label: u(
|
|
817
|
-
}) : M(
|
|
820
|
+
value: i,
|
|
821
|
+
label: u(i)
|
|
822
|
+
}) : M(i, p) ? n.push({
|
|
818
823
|
type: "logicMergeTag",
|
|
819
|
-
value:
|
|
820
|
-
keyword:
|
|
824
|
+
value: i,
|
|
825
|
+
keyword: j(i, p)
|
|
821
826
|
}) : n.push({
|
|
822
827
|
type: "text",
|
|
823
|
-
value:
|
|
824
|
-
}),
|
|
828
|
+
value: i
|
|
829
|
+
}), r = t.index + i.length;
|
|
825
830
|
}
|
|
826
|
-
return
|
|
831
|
+
return r < e.length && n.push({
|
|
827
832
|
type: "text",
|
|
828
|
-
value: e.slice(
|
|
833
|
+
value: e.slice(r)
|
|
829
834
|
}), n;
|
|
830
835
|
}), T = C(() => w.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
|
|
831
836
|
function D() {
|
|
@@ -841,7 +846,7 @@ function mt(e) {
|
|
|
841
846
|
function k(e) {
|
|
842
847
|
n(e.target.value), S.refresh();
|
|
843
848
|
}
|
|
844
|
-
function
|
|
849
|
+
function A(e) {
|
|
845
850
|
return S.handleKeydown(e) ? (e.preventDefault(), !0) : (e.key === "Escape" && O(), !1);
|
|
846
851
|
}
|
|
847
852
|
function N() {
|
|
@@ -850,10 +855,10 @@ function mt(e) {
|
|
|
850
855
|
function P() {
|
|
851
856
|
S.close(), O();
|
|
852
857
|
}
|
|
853
|
-
function
|
|
858
|
+
function I() {
|
|
854
859
|
n("");
|
|
855
860
|
}
|
|
856
|
-
async function
|
|
861
|
+
async function L() {
|
|
857
862
|
let e = y.value && r.value ? r.value.selectionStart ?? t().length : t().length;
|
|
858
863
|
b = !0;
|
|
859
864
|
let i;
|
|
@@ -871,7 +876,7 @@ function mt(e) {
|
|
|
871
876
|
});
|
|
872
877
|
}
|
|
873
878
|
}
|
|
874
|
-
async function
|
|
879
|
+
async function R(e) {
|
|
875
880
|
let t = w.value, r = t[e];
|
|
876
881
|
if (r?.type !== "mergeTag") return;
|
|
877
882
|
b = !0;
|
|
@@ -886,7 +891,7 @@ function mt(e) {
|
|
|
886
891
|
}
|
|
887
892
|
!x && i && n(t.map((t, n) => n === e ? i.value : t.value).join(""));
|
|
888
893
|
}
|
|
889
|
-
async function
|
|
894
|
+
async function z() {
|
|
890
895
|
let e = r.value, i = e?.selectionStart ?? t().length, a = e?.selectionEnd ?? i;
|
|
891
896
|
b = !0;
|
|
892
897
|
let o;
|
|
@@ -912,25 +917,25 @@ function mt(e) {
|
|
|
912
917
|
startEditing: D,
|
|
913
918
|
stopEditing: O,
|
|
914
919
|
handleInput: k,
|
|
915
|
-
handleKeydown:
|
|
920
|
+
handleKeydown: A,
|
|
916
921
|
handleClick: N,
|
|
917
922
|
handleBlur: P,
|
|
918
|
-
clearValue:
|
|
919
|
-
insertMergeTag:
|
|
920
|
-
replaceMergeTagAt:
|
|
921
|
-
insertLogicTag:
|
|
923
|
+
clearValue: I,
|
|
924
|
+
insertMergeTag: L,
|
|
925
|
+
replaceMergeTagAt: R,
|
|
926
|
+
insertLogicTag: z,
|
|
922
927
|
autocompleteAvailable: S.available
|
|
923
928
|
};
|
|
924
929
|
}
|
|
925
930
|
// src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
|
|
926
|
-
var
|
|
931
|
+
var vt = ["aria-label"], yt = [
|
|
927
932
|
"data-tooltip",
|
|
928
933
|
"aria-label",
|
|
929
934
|
"onClick"
|
|
930
|
-
],
|
|
935
|
+
], bt = ["data-tooltip"], xt = ["data-tooltip"], St = {
|
|
931
936
|
key: 3,
|
|
932
937
|
class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
|
|
933
|
-
},
|
|
938
|
+
}, Ct = ["aria-label", "title"], wt = ["aria-label", "title"], Tt = /* @__PURE__ */ e({
|
|
934
939
|
__name: "MergeTagSegments",
|
|
935
940
|
props: {
|
|
936
941
|
segments: {},
|
|
@@ -943,7 +948,7 @@ var ht = ["aria-label"], gt = [
|
|
|
943
948
|
"repick"
|
|
944
949
|
],
|
|
945
950
|
setup(e, { emit: t }) {
|
|
946
|
-
let r = t, { t: i, format: o } =
|
|
951
|
+
let r = t, { t: i, format: o } = V(), { canRepickMergeTag: s, showRawValue: c } = ae();
|
|
947
952
|
function l() {
|
|
948
953
|
r("edit");
|
|
949
954
|
}
|
|
@@ -965,7 +970,7 @@ var ht = ["aria-label"], gt = [
|
|
|
965
970
|
color: "var(--tpl-primary)"
|
|
966
971
|
},
|
|
967
972
|
onClick: y((e) => r("repick", t), ["stop"])
|
|
968
|
-
}, x(e.label), 11,
|
|
973
|
+
}, x(e.label), 11, yt)) : e.type === "mergeTag" ? (n(), u("span", {
|
|
969
974
|
key: 1,
|
|
970
975
|
class: m(["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", p(c) ? "tpl-tooltip" : ""]),
|
|
971
976
|
"data-tooltip": p(c) ? e.value : void 0,
|
|
@@ -973,7 +978,7 @@ var ht = ["aria-label"], gt = [
|
|
|
973
978
|
"background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
|
|
974
979
|
color: "var(--tpl-primary)"
|
|
975
980
|
}
|
|
976
|
-
}, x(e.label), 11,
|
|
981
|
+
}, x(e.label), 11, bt)) : e.type === "logicMergeTag" ? (n(), u("span", {
|
|
977
982
|
key: 2,
|
|
978
983
|
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",
|
|
979
984
|
"data-tooltip": e.value,
|
|
@@ -982,7 +987,7 @@ var ht = ["aria-label"], gt = [
|
|
|
982
987
|
border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
|
|
983
988
|
color: "var(--tpl-primary)"
|
|
984
989
|
}
|
|
985
|
-
}, x(e.keyword), 9,
|
|
990
|
+
}, x(e.keyword), 9, xt)) : (n(), u("span", St, x(e.value), 1))], 64))), 128)),
|
|
986
991
|
b("button", {
|
|
987
992
|
type: "button",
|
|
988
993
|
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",
|
|
@@ -990,10 +995,10 @@ var ht = ["aria-label"], gt = [
|
|
|
990
995
|
title: p(i).mergeTag.editAsText,
|
|
991
996
|
"data-testid": "merge-tag-field-edit",
|
|
992
997
|
onClick: y(l, ["stop"])
|
|
993
|
-
}, [O(p(
|
|
998
|
+
}, [O(p(I), {
|
|
994
999
|
size: 12,
|
|
995
1000
|
"stroke-width": 2
|
|
996
|
-
})], 8,
|
|
1001
|
+
})], 8, Ct),
|
|
997
1002
|
b("button", {
|
|
998
1003
|
type: "button",
|
|
999
1004
|
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",
|
|
@@ -1001,60 +1006,60 @@ var ht = ["aria-label"], gt = [
|
|
|
1001
1006
|
title: p(i).mergeTag.remove,
|
|
1002
1007
|
"data-testid": "merge-tag-field-clear",
|
|
1003
1008
|
onClick: d[0] ||= y((e) => r("clear"), ["stop"])
|
|
1004
|
-
}, [O(p(
|
|
1009
|
+
}, [O(p(z), {
|
|
1005
1010
|
size: 12,
|
|
1006
1011
|
"stroke-width": 2.5
|
|
1007
|
-
})], 8,
|
|
1008
|
-
], 10,
|
|
1012
|
+
})], 8, wt)
|
|
1013
|
+
], 10, vt));
|
|
1009
1014
|
}
|
|
1010
|
-
}),
|
|
1015
|
+
}), Et = [
|
|
1011
1016
|
"aria-label",
|
|
1012
1017
|
"title",
|
|
1013
1018
|
"disabled"
|
|
1014
|
-
],
|
|
1019
|
+
], Dt = "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)]", Ot = /* @__PURE__ */ e({
|
|
1015
1020
|
__name: "MergeTagInsertButton",
|
|
1016
1021
|
props: { disabled: { type: Boolean } },
|
|
1017
1022
|
emits: ["insert"],
|
|
1018
1023
|
setup(e) {
|
|
1019
|
-
let { t } =
|
|
1024
|
+
let { t } = V();
|
|
1020
1025
|
return (r, i) => (n(), u("button", {
|
|
1021
1026
|
type: "button",
|
|
1022
|
-
class: m([
|
|
1027
|
+
class: m([Dt, "tpl:mt-1.5"]),
|
|
1023
1028
|
"aria-label": p(t).mergeTag.insert,
|
|
1024
1029
|
title: p(t).mergeTag.insert,
|
|
1025
1030
|
disabled: e.disabled,
|
|
1026
1031
|
onMousedown: i[0] ||= y(() => {}, ["prevent"]),
|
|
1027
1032
|
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
1028
|
-
}, [O(p(
|
|
1033
|
+
}, [O(p(R), {
|
|
1029
1034
|
size: 12,
|
|
1030
1035
|
"stroke-width": 2
|
|
1031
|
-
}), d(" " + x(p(t).mergeTag.insertShort), 1)], 42,
|
|
1036
|
+
}), d(" " + x(p(t).mergeTag.insertShort), 1)], 42, Et));
|
|
1032
1037
|
}
|
|
1033
|
-
}),
|
|
1038
|
+
}), kt = [
|
|
1034
1039
|
"aria-label",
|
|
1035
1040
|
"title",
|
|
1036
1041
|
"disabled"
|
|
1037
|
-
],
|
|
1042
|
+
], At = "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)]", jt = /* @__PURE__ */ e({
|
|
1038
1043
|
__name: "LogicTagInsertButton",
|
|
1039
1044
|
props: { disabled: { type: Boolean } },
|
|
1040
1045
|
emits: ["insert"],
|
|
1041
1046
|
setup(e) {
|
|
1042
|
-
let { t } =
|
|
1047
|
+
let { t } = V();
|
|
1043
1048
|
return (r, i) => (n(), u("button", {
|
|
1044
1049
|
type: "button",
|
|
1045
|
-
class: m([
|
|
1050
|
+
class: m([At, "tpl:mt-1.5"]),
|
|
1046
1051
|
"aria-label": p(t).logicTag.insert,
|
|
1047
1052
|
title: p(t).logicTag.insert,
|
|
1048
1053
|
disabled: e.disabled,
|
|
1049
1054
|
"data-testid": "field-insert-logic-button",
|
|
1050
1055
|
onMousedown: i[0] ||= y(() => {}, ["prevent"]),
|
|
1051
1056
|
onClick: i[1] ||= (e) => r.$emit("insert")
|
|
1052
|
-
}, [O(p(
|
|
1057
|
+
}, [O(p(L), {
|
|
1053
1058
|
size: 12,
|
|
1054
1059
|
"stroke-width": 2
|
|
1055
|
-
}), d(" " + x(p(t).logicTag.insertShort), 1)], 42,
|
|
1060
|
+
}), d(" " + x(p(t).logicTag.insertShort), 1)], 42, kt));
|
|
1056
1061
|
}
|
|
1057
1062
|
});
|
|
1058
|
-
export {
|
|
1063
|
+
export { lt as a, Qe as c, _t as i, Ot as n, st as o, Tt as r, ct as s, jt as t };
|
|
1059
1064
|
|
|
1060
|
-
//# sourceMappingURL=LogicTagInsertButton-
|
|
1065
|
+
//# sourceMappingURL=LogicTagInsertButton-Bt2PXbQ0.js.map
|