@templatical/editor 0.20.0 → 0.21.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/README.md +1 -0
- package/dist/{AiChatSidebar-ChrE6pUq.js → AiChatSidebar-K_AehWc-.js} +9 -9
- package/dist/{AiFeatureMenu-DkQ9HhQ6.js → AiFeatureMenu-CPdNpHpZ.js} +6 -6
- package/dist/{BlockIssueBadge-B4QjePax.js → BlockIssueBadge-Dmj9rVra.js} +4 -4
- package/dist/{CloudEditor-CfX-aMiV.js → CloudEditor-3a7mqMhe.js} +263 -315
- package/dist/{CollaboratorBar-DTibhQ1j.js → CollaboratorBar-Ds0YZWzV.js} +3 -3
- package/dist/{ColorPicker-4vDYhdGe.js → ColorPicker-s9GHXjZs.js} +4 -4
- package/dist/CommentsSidebar-DvNEdugN.js +435 -0
- package/dist/{CountdownBlock-Bn5w7C-p.js → CountdownBlock-BUHYIAe9.js} +1 -1
- package/dist/{CountdownToolbar-D7yQqnA2.js → CountdownToolbar-DPRcv3Fu.js} +3 -4
- package/dist/{DesignReferenceSidebar-DnO6ZdwS.js → DesignReferenceSidebar-DNmK3dxp.js} +8 -8
- package/dist/{IssuesPanel-X_vkNGrs.js → IssuesPanel-CEnEGFtd.js} +7 -7
- package/dist/{MergeTagSuggestion-DCuaSOPQ.js → MergeTagSuggestion-DMe4rqn0.js} +2 -2
- package/dist/NumberWithSuffix-CCPN_oCh.js +121 -0
- package/dist/{ParagraphEditor-C5ixOIYb.js → ParagraphEditor-CkwBirNl.js} +47 -47
- package/dist/{RichTextEditorContent-DwhDnMsG.js → RichTextEditorContent-FbnWsh46.js} +6 -6
- package/dist/SaveBlockDialog-Cc5BSUBx.js +264 -0
- package/dist/SavedBlockPreviewCanvas-ubttfmKr.js +109 -0
- package/dist/SavedBlocksBrowserModal-LkY_U3lY.js +323 -0
- package/dist/SavedBlocksPanels-CET0zvH6.js +36 -0
- package/dist/SavedBlocksPickBar-poGS4PoI.js +52 -0
- package/dist/{SnapshotHistory-DaVueFv6.js → SnapshotHistory-BvF5IXn1.js} +8 -8
- package/dist/{TemplateScoringPanel-B0UHoTLx.js → TemplateScoringPanel-ifGGGWs5.js} +14 -14
- package/dist/{TestEmailModal-BkauxF7j.js → TestEmailModal-BRaM_eko.js} +4 -4
- package/dist/{TitleEditor-n6WDVDjW.js → TitleEditor-Bhgzh-iQ.js} +11 -11
- package/dist/{TplModal-BDDyvT-C.js → TplModal-BA-Zsg0O.js} +3 -3
- package/dist/{blockTypeIcons-4D0aFXNg.js → blockTypeIcons-B1-Yzp-a.js} +6 -6
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-DbWoy4rG.js → ca-BBgad6y5.js} +50 -5
- package/dist/cdn/chunks/{AiFeatureMenu-CIBHAGSz.js → AiFeatureMenu--PdArSnv.js} +7 -7
- package/dist/cdn/chunks/{AiFeatureMenu-CIBHAGSz.js.map → AiFeatureMenu--PdArSnv.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CxMiLo3p.js → BlockIssueBadge-DMSd0SIl.js} +5 -5
- package/dist/cdn/chunks/{BlockIssueBadge-CxMiLo3p.js.map → BlockIssueBadge-DMSd0SIl.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-CEa3Xgqh.js → CloudEditor-DnTfI5GU.js} +270 -322
- package/dist/cdn/chunks/CloudEditor-DnTfI5GU.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-Bk1gD02G.js → CollaboratorBar-CBqd7ldq.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-Bk1gD02G.js.map → CollaboratorBar-CBqd7ldq.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-ll8pynws.js → ColorPicker-DCdWP8YB.js} +161 -161
- package/dist/cdn/chunks/{ColorPicker-ll8pynws.js.map → ColorPicker-DCdWP8YB.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-eGUE7hhw.js → CountdownBlock-BDnWMAME.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-eGUE7hhw.js.map → CountdownBlock-BDnWMAME.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C1bkSjUR.js → CountdownToolbar-BbLoo22S.js} +4 -5
- package/dist/cdn/chunks/{CountdownToolbar-C1bkSjUR.js.map → CountdownToolbar-BbLoo22S.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-Csasylf_.js → IssuesPanel-CfudrI3T.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-Csasylf_.js.map → IssuesPanel-CfudrI3T.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js → MergeTagSuggestion-D7TsECll.js} +2 -2
- package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js.map → MergeTagSuggestion-D7TsECll.js.map} +1 -1
- package/dist/cdn/chunks/NumberWithSuffix-BmMx9_n_.js +123 -0
- package/dist/cdn/chunks/NumberWithSuffix-BmMx9_n_.js.map +1 -0
- package/dist/cdn/chunks/{ParagraphEditor-v0_XEL-v.js → ParagraphEditor-DPCUSXpx.js} +86 -86
- package/dist/cdn/chunks/{ParagraphEditor-v0_XEL-v.js.map → ParagraphEditor-DPCUSXpx.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-NQExNsaV.js → RichTextEditorContent-B8dOiv_D.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-NQExNsaV.js.map → RichTextEditorContent-B8dOiv_D.js.map} +1 -1
- package/dist/cdn/chunks/SaveBlockDialog-BY3SMnNV.js +259 -0
- package/dist/cdn/chunks/SaveBlockDialog-BY3SMnNV.js.map +1 -0
- package/dist/cdn/chunks/SavedBlockPreviewCanvas-LpaOcusq.js +110 -0
- package/dist/cdn/chunks/SavedBlockPreviewCanvas-LpaOcusq.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CfIcmyzF.js +318 -0
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CfIcmyzF.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksPanels-kIowCfh_.js +38 -0
- package/dist/cdn/chunks/SavedBlocksPanels-kIowCfh_.js.map +1 -0
- package/dist/cdn/chunks/SavedBlocksPickBar-WSGe1GiZ.js +52 -0
- package/dist/cdn/chunks/SavedBlocksPickBar-WSGe1GiZ.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-CS-_MzYs.js → TitleEditor-iwd-O9sO.js} +11 -11
- package/dist/cdn/chunks/{TitleEditor-CS-_MzYs.js.map → TitleEditor-iwd-O9sO.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-B0Hjh42a.js → blockTypeIcons-BYz0fgLz.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-B0Hjh42a.js.map → blockTypeIcons-BYz0fgLz.js.map} +1 -1
- package/dist/{ca-DbWoy4rG.js → cdn/chunks/ca-BBgad6y5.js} +52 -3
- package/dist/cdn/chunks/ca-BBgad6y5.js.map +1 -0
- package/dist/{de-CTYXVU9v.js → cdn/chunks/de-Bw6fB5JU.js} +2 -24
- package/dist/cdn/chunks/{de-CTYXVU9v.js.map → de-Bw6fB5JU.js.map} +1 -1
- package/dist/cdn/chunks/{de-CgGOnerg.js → de-D7WbpFBR.js} +50 -3
- package/dist/cdn/chunks/de-D7WbpFBR.js.map +1 -0
- package/dist/{en-DrUV9xth.js → cdn/chunks/en-BrZ0uGK2.js} +51 -2
- package/dist/cdn/chunks/en-BrZ0uGK2.js.map +1 -0
- package/dist/{en-BtmIaJeb.js → cdn/chunks/en-DAdHJz7h.js} +2 -24
- package/dist/cdn/chunks/{en-BtmIaJeb.js.map → en-DAdHJz7h.js.map} +1 -1
- package/dist/{es-DwbKjU7q.js → cdn/chunks/es-tLSLysPs.js} +51 -2
- package/dist/cdn/chunks/es-tLSLysPs.js.map +1 -0
- package/dist/cdn/chunks/{extensions-Di3hdIRT.js → extensions-DeJh3E9b.js} +26 -26
- package/dist/cdn/chunks/{extensions-Di3hdIRT.js.map → extensions-DeJh3E9b.js.map} +1 -1
- package/dist/cdn/chunks/{features-CLIZ7Q-Y.js → features-pLfGJWIB.js} +1118 -962
- package/dist/cdn/chunks/features-pLfGJWIB.js.map +1 -0
- package/dist/cdn/chunks/{icons-GX40Qm2W.js → icons-FLemooQz.js} +16 -16
- package/dist/cdn/chunks/{icons-GX40Qm2W.js.map → icons-FLemooQz.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-yYAkAagU.js → media-library-mCCZieYO.js} +176 -176
- package/dist/cdn/chunks/{media-library-yYAkAagU.js.map → media-library-mCCZieYO.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +50 -3
- package/dist/cdn/chunks/pt-BR-BWFokdTU.js.map +1 -0
- package/dist/{pt-BR-B2ZvFlRL.js → cdn/chunks/pt-BR-w2sGzHNX.js} +2 -24
- package/dist/cdn/chunks/{pt-BR-B2ZvFlRL.js.map → pt-BR-w2sGzHNX.js.map} +1 -1
- package/dist/cdn/chunks/quality-BRbHtAk1.js +2180 -0
- package/dist/cdn/chunks/{quality-DffYv9j5.js.map → quality-BRbHtAk1.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-DpBGiXOg.js → renderer-Yg1XhsBN.js} +17 -17
- package/dist/cdn/chunks/{renderer-DpBGiXOg.js.map → renderer-Yg1XhsBN.js.map} +1 -1
- package/dist/cdn/chunks/{src-9K6uFiuK.js → src-BDJeYiVE.js} +33 -33
- package/dist/cdn/chunks/{src-9K6uFiuK.js.map → src-BDJeYiVE.js.map} +1 -1
- package/dist/cdn/chunks/{styles-DHSmjlpX.js → styles-Bp5Jsu9J.js} +1380 -1294
- package/dist/cdn/chunks/styles-Bp5Jsu9J.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C2indasq.js → tiptap-BMZ-OENR.js} +2012 -1863
- package/dist/cdn/chunks/tiptap-BMZ-OENR.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +123 -114
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Bl4J_tYV.js → check-BpQDKiPz.js} +1 -1
- package/dist/{chevron-down-COEcl2iP.js → chevron-down-j8GrdTyz.js} +1 -1
- package/dist/chevron-up-BACyVhyC.js +7 -0
- package/dist/{circle-alert-CvHi5etc.js → circle-alert-CgtE46ND.js} +1 -1
- package/dist/{clock-CZZw62e8.js → clock-BzKLLW5L.js} +1 -1
- package/dist/{cloud-B-RebwxI.js → cloud-Du7mnkz2.js} +19 -47
- package/dist/{createLucideIcon-_peTZQtY.js → createLucideIcon-JWHwTI6N.js} +2 -2
- package/dist/{cdn/chunks/de-CTYXVU9v.js → de-Bw6fB5JU.js} +0 -26
- package/dist/{de-CgGOnerg.js → de-D7WbpFBR.js} +49 -2
- package/dist/{dist-CgTKuIUN.js → dist-BEpCh2mG.js} +1158 -1125
- package/dist/{dist-Cx7IUM7J.js → dist-BgPYC_8-.js} +14 -6
- package/dist/{dist-BKKo5wPC.js → dist-BkM8A17N.js} +2 -2
- package/dist/{dist-CcX5sLpz.js → dist-BuNDAAVp.js} +361 -256
- package/dist/{dist-COSN3oDJ.js → dist-CBzCU-a-.js} +2 -2
- package/dist/{dist-YSCPD13F.js → dist-CDO52Rxy.js} +2 -2
- package/dist/{dist-Dk5AdwoQ.js → dist-CrjzhIxB.js} +2 -2
- package/dist/{dist-DXAZUjj3.js → dist-CtcgoC_R.js} +2 -2
- package/dist/{dist-D6M5FAY7.js → dist-CuXha2_7.js} +2 -2
- package/dist/dist-CweLDZrs.js +5 -0
- package/dist/dist-DOsdqAEZ.js +5 -0
- package/dist/{dist-8TKf-Jpg.js → dist-DYClLqy8.js} +6 -3
- package/dist/{cdn/chunks/en-DrUV9xth.js → en-BrZ0uGK2.js} +49 -4
- package/dist/{cdn/chunks/en-BtmIaJeb.js → en-DAdHJz7h.js} +0 -26
- package/dist/{cdn/chunks/es-DwbKjU7q.js → es-tLSLysPs.js} +49 -4
- package/dist/{extensions-BCA9pyer.js → extensions-ClY5Sh7S.js} +5 -5
- package/dist/{image-up-D26rNdfX.js → image-up-CQdtq8ge.js} +1 -1
- package/dist/index.d.ts +81 -4
- package/dist/{info-CE3JSTqk.js → info-BUJBXoE6.js} +1 -1
- package/dist/{keys-DFaIbGR8.js → keys-CHPcp-Nz.js} +2 -2
- package/dist/{list-checks-BQsLrtBB.js → list-checks-BGHaCSD5.js} +1 -1
- package/dist/{loader-circle-s9Rh5lLd.js → loader-circle-C-Z6kgI6.js} +1 -1
- package/dist/{message-circle-CI62d690.js → message-circle-CEm5qckV.js} +1 -1
- package/dist/pencil-DdwmkKLb.js +10 -0
- package/dist/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +49 -2
- package/dist/{cdn/chunks/pt-BR-B2ZvFlRL.js → pt-BR-w2sGzHNX.js} +0 -26
- package/dist/{refresh-cw-DlYfl65Y.js → refresh-cw-maKlg0dl.js} +1 -1
- package/dist/{scan-line-CHadrYVb.js → scan-line-BFgesTOY.js} +1 -1
- package/dist/{send-CbP40otC.js → send-B70aQDrA.js} +1 -1
- package/dist/{shield-check-Bnj9aRoJ.js → shield-check-B7x5OKt5.js} +1 -1
- package/dist/{sparkles-CncWT57a.js → sparkles-DVlm1Ipp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DkF_-uX8.js → styles-DIDAJdkj.js} +1237 -1151
- package/dist/templatical-editor.js +134 -125
- package/dist/{text-align-start-B458vzYw.js → text-align-start-Vay3Kvo2.js} +1 -1
- package/dist/{trash-2-DO0yjSU1.js → trash-2-DE8CmxAG.js} +1 -1
- package/dist/{triangle-alert-C18_ima6.js → triangle-alert-Djg6IG8N.js} +1 -1
- package/dist/{upload-DsCd2zTR.js → upload-BwwE0U6G.js} +1 -1
- package/dist/{useCloudI18n-PCDOC2kz.js → useCloudI18n-BmiygEM4.js} +1 -1
- package/dist/{useEditorCore-kKUemYY6.js → useEditorCore-Bd9CA4L_.js} +997 -817
- package/dist/{useI18n-BNMzZTM5.js → useI18n-D2L9Mkik.js} +1 -1
- package/dist/{useMergeTag-DfEY0eK5.js → useMergeTag-BTdDq5DC.js} +1 -1
- package/dist/{usePopoverPosition-F9STHRIr.js → usePopoverPosition-BO2LNy5n.js} +1 -1
- package/dist/{x-BCFQuE_q.js → x-CkD6A1iB.js} +1 -1
- package/package.json +21 -21
- package/dist/CommentsSidebar-D-o5Stlg.js +0 -442
- package/dist/ModuleBrowserModal-AJt--JPh.js +0 -202
- package/dist/ModulePreviewCanvas-BKYOcVCh.js +0 -106
- package/dist/NumberWithSuffix-Bf3rNxza.js +0 -89
- package/dist/SaveModuleDialog-B4QX9eiv.js +0 -125
- package/dist/ToggleSwitch-DUNuUPsZ.js +0 -37
- package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +0 -1
- package/dist/cdn/chunks/ModuleBrowserModal-DznWWtBI.js +0 -198
- package/dist/cdn/chunks/ModuleBrowserModal-DznWWtBI.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-D-h7fr87.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-D-h7fr87.js.map +0 -1
- package/dist/cdn/chunks/NumberWithSuffix-Dt-0odUN.js +0 -91
- package/dist/cdn/chunks/NumberWithSuffix-Dt-0odUN.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-BpFhTi-k.js +0 -120
- package/dist/cdn/chunks/SaveModuleDialog-BpFhTi-k.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +0 -39
- package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +0 -1
- package/dist/cdn/chunks/ca-DbWoy4rG.js.map +0 -1
- package/dist/cdn/chunks/de-CgGOnerg.js.map +0 -1
- package/dist/cdn/chunks/en-DrUV9xth.js.map +0 -1
- package/dist/cdn/chunks/es-DwbKjU7q.js.map +0 -1
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-Bcc5Tjed.js.map +0 -1
- package/dist/cdn/chunks/quality-DffYv9j5.js +0 -2180
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C2indasq.js.map +0 -1
- package/dist/dist-BDVm2MrW.js +0 -5
- package/dist/dist-DbekZDmJ.js +0 -5
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { A as e, Dt as t, Et as n, N as r, O as i, Ot as a, _ as o, c as s, d as c, j as l, l as u, m as d, nt as f, r as p, s as m, u as h } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
|
+
import { h as g, m as _, p as v } from "./ColorPicker-s9GHXjZs.js";
|
|
3
|
+
//#region src/components/ToggleSwitch.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var y = { key: 0 }, b = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
7
|
+
}, x = [
|
|
8
|
+
"aria-checked",
|
|
9
|
+
"aria-label",
|
|
10
|
+
"disabled"
|
|
11
|
+
], S = /* @__PURE__ */ o({
|
|
12
|
+
__name: "ToggleSwitch",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { type: Boolean },
|
|
15
|
+
label: {},
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
required: { type: Boolean }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(e, { emit: t }) {
|
|
21
|
+
let r = t;
|
|
22
|
+
return (t, o) => (i(), c("label", { class: n(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [t.$slots.default || e.label || e.required ? (i(), c("span", y, [l(t.$slots, "default", {}, () => [d(a(e.label), 1)]), e.required ? (i(), c("span", b, " *")) : h("", !0)])) : h("", !0), s("button", {
|
|
23
|
+
type: "button",
|
|
24
|
+
role: "switch",
|
|
25
|
+
"aria-checked": e.modelValue,
|
|
26
|
+
"aria-label": e.label,
|
|
27
|
+
disabled: e.disabled,
|
|
28
|
+
class: n([
|
|
29
|
+
"tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",
|
|
30
|
+
e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
|
|
31
|
+
e.disabled ? "tpl:cursor-not-allowed tpl:opacity-60" : "tpl:cursor-pointer"
|
|
32
|
+
]),
|
|
33
|
+
onClick: o[0] ||= (t) => !e.disabled && r("update:modelValue", !e.modelValue)
|
|
34
|
+
}, [s("span", { class: n(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200", e.modelValue ? "tpl:translate-x-4" : "tpl:translate-x-0"]) }, null, 2)], 10, x)], 2));
|
|
35
|
+
}
|
|
36
|
+
}), C = [
|
|
37
|
+
"aria-checked",
|
|
38
|
+
"aria-label",
|
|
39
|
+
"title",
|
|
40
|
+
"onClick"
|
|
41
|
+
], w = { key: 1 }, T = /* @__PURE__ */ o({
|
|
42
|
+
__name: "SlidingPillSelect",
|
|
43
|
+
props: {
|
|
44
|
+
options: {},
|
|
45
|
+
modelValue: {}
|
|
46
|
+
},
|
|
47
|
+
emits: ["update:modelValue"],
|
|
48
|
+
setup(n, { emit: o }) {
|
|
49
|
+
let s = n, l = o, d = m(() => s.options.findIndex((e) => e.value === s.modelValue)), f = m(() => `translateX(${Math.max(d.value, 0) * 100}%)`);
|
|
50
|
+
return (o, s) => (i(), c("div", {
|
|
51
|
+
role: "radiogroup",
|
|
52
|
+
class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
53
|
+
style: t({
|
|
54
|
+
gridTemplateColumns: `repeat(${n.options.length}, 1fr)`,
|
|
55
|
+
backgroundColor: "var(--tpl-bg-hover)"
|
|
56
|
+
})
|
|
57
|
+
}, [d.value >= 0 ? (i(), c("div", {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
|
|
60
|
+
style: t({
|
|
61
|
+
left: "4px",
|
|
62
|
+
width: `calc((100% - 8px) / ${n.options.length})`,
|
|
63
|
+
transform: f.value,
|
|
64
|
+
backgroundColor: "var(--tpl-bg)",
|
|
65
|
+
boxShadow: "var(--tpl-shadow)",
|
|
66
|
+
transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
67
|
+
})
|
|
68
|
+
}, null, 4)) : h("", !0), (i(!0), c(p, null, e(n.options, (e) => (i(), c("button", {
|
|
69
|
+
key: e.value,
|
|
70
|
+
role: "radio",
|
|
71
|
+
"aria-checked": n.modelValue === e.value,
|
|
72
|
+
"aria-label": e.label,
|
|
73
|
+
class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
|
|
74
|
+
style: t({
|
|
75
|
+
color: n.modelValue === e.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
76
|
+
transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
|
|
77
|
+
}),
|
|
78
|
+
title: e.label,
|
|
79
|
+
onClick: (t) => l("update:modelValue", e.value)
|
|
80
|
+
}, [e.icon ? (i(), u(r(e.icon), {
|
|
81
|
+
key: 0,
|
|
82
|
+
size: 14,
|
|
83
|
+
"stroke-width": 2
|
|
84
|
+
})) : (i(), c("span", w, a(e.label), 1))], 12, C))), 128))], 4));
|
|
85
|
+
}
|
|
86
|
+
}), E = { class: "tpl:mb-3.5" }, D = /* @__PURE__ */ o({
|
|
87
|
+
__name: "FieldRow",
|
|
88
|
+
props: { label: {} },
|
|
89
|
+
setup(e) {
|
|
90
|
+
return (t, r) => (i(), c("div", E, [e.label ? (i(), c("label", {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: n(f(g))
|
|
93
|
+
}, a(e.label), 3)) : h("", !0), l(t.$slots, "default")]));
|
|
94
|
+
}
|
|
95
|
+
}), O = { class: "tpl:flex tpl:items-stretch" }, k = [
|
|
96
|
+
"value",
|
|
97
|
+
"min",
|
|
98
|
+
"max"
|
|
99
|
+
], A = /* @__PURE__ */ o({
|
|
100
|
+
__name: "NumberWithSuffix",
|
|
101
|
+
props: {
|
|
102
|
+
modelValue: {},
|
|
103
|
+
min: {},
|
|
104
|
+
max: {},
|
|
105
|
+
suffix: {}
|
|
106
|
+
},
|
|
107
|
+
emits: ["update:modelValue"],
|
|
108
|
+
setup(e, { emit: t }) {
|
|
109
|
+
let r = t;
|
|
110
|
+
return (t, o) => (i(), c("div", O, [s("input", {
|
|
111
|
+
type: "number",
|
|
112
|
+
class: n(f(v)),
|
|
113
|
+
value: e.modelValue,
|
|
114
|
+
min: e.min,
|
|
115
|
+
max: e.max,
|
|
116
|
+
onInput: o[0] ||= (e) => r("update:modelValue", Number(e.target.value))
|
|
117
|
+
}, null, 42, k), s("span", { class: n(f(_)) }, a(e.suffix), 3)]));
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
//#endregion
|
|
121
|
+
export { S as i, D as n, T as r, A as t };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { A as e, Dt as t, Et as n, N as r, O as i, Ot as a, W as o, Y as s, _ as c, c as l, d as u, h as d, i as f, l as p, m, nt as h, r as g, s as _, u as v, x as y } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
2
|
import { c as b, s as x } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as E, s as D } from "./usePopoverPosition-
|
|
5
|
-
import { B as O, D as k, L as A, _ as ee, h as te, w as ne, z as re } from "./keys-
|
|
6
|
-
import { t as j } from "./useI18n-
|
|
7
|
-
import { t as M } from "./createLucideIcon-
|
|
8
|
-
import { a as ie, i as ae, n as N, r as oe, t as P } from "./RichTextEditorContent-
|
|
9
|
-
import { n as se, t as ce } from "./scan-line-
|
|
10
|
-
import { t as le } from "./loader-circle-
|
|
11
|
-
import { n as ue, r as de, t as fe } from "./text-align-start-
|
|
3
|
+
import { C as S, D as C, O as w, S as T } from "./useEditorCore-Bd9CA4L_.js";
|
|
4
|
+
import { n as E, s as D } from "./usePopoverPosition-BO2LNy5n.js";
|
|
5
|
+
import { B as O, D as k, L as A, _ as ee, h as te, w as ne, z as re } from "./keys-CHPcp-Nz.js";
|
|
6
|
+
import { t as j } from "./useI18n-D2L9Mkik.js";
|
|
7
|
+
import { t as M } from "./createLucideIcon-JWHwTI6N.js";
|
|
8
|
+
import { a as ie, i as ae, n as N, r as oe, t as P } from "./RichTextEditorContent-FbnWsh46.js";
|
|
9
|
+
import { n as se, t as ce } from "./scan-line-BFgesTOY.js";
|
|
10
|
+
import { t as le } from "./loader-circle-C-Z6kgI6.js";
|
|
11
|
+
import { n as ue, r as de, t as fe } from "./text-align-start-Vay3Kvo2.js";
|
|
12
12
|
import { t as F } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
13
|
-
import { c as pe, o as me, r as he, s as ge, t as I } from "./ColorPicker-
|
|
13
|
+
import { c as pe, o as me, r as he, s as ge, t as I } from "./ColorPicker-s9GHXjZs.js";
|
|
14
14
|
var L = M("list-ordered", [
|
|
15
15
|
["path", {
|
|
16
16
|
d: "M11 5h10",
|
|
@@ -107,7 +107,20 @@ var L = M("list-ordered", [
|
|
|
107
107
|
y2: "9",
|
|
108
108
|
key: "1p4y9e"
|
|
109
109
|
}]
|
|
110
|
-
]), ye = M("
|
|
110
|
+
]), ye = M("subscript", [
|
|
111
|
+
["path", {
|
|
112
|
+
d: "m4 5 8 8",
|
|
113
|
+
key: "1eunvl"
|
|
114
|
+
}],
|
|
115
|
+
["path", {
|
|
116
|
+
d: "m12 5-8 8",
|
|
117
|
+
key: "1ah0jp"
|
|
118
|
+
}],
|
|
119
|
+
["path", {
|
|
120
|
+
d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",
|
|
121
|
+
key: "e8ta8j"
|
|
122
|
+
}]
|
|
123
|
+
]), be = M("strikethrough", [
|
|
111
124
|
["path", {
|
|
112
125
|
d: "M16 4H9a3 3 0 0 0-2.83 4",
|
|
113
126
|
key: "43sutm"
|
|
@@ -123,19 +136,6 @@ var L = M("list-ordered", [
|
|
|
123
136
|
y2: "12",
|
|
124
137
|
key: "1e0a9i"
|
|
125
138
|
}]
|
|
126
|
-
]), be = M("subscript", [
|
|
127
|
-
["path", {
|
|
128
|
-
d: "m4 5 8 8",
|
|
129
|
-
key: "1eunvl"
|
|
130
|
-
}],
|
|
131
|
-
["path", {
|
|
132
|
-
d: "m12 5-8 8",
|
|
133
|
-
key: "1ah0jp"
|
|
134
|
-
}],
|
|
135
|
-
["path", {
|
|
136
|
-
d: "M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",
|
|
137
|
-
key: "e8ta8j"
|
|
138
|
-
}]
|
|
139
139
|
]), xe = M("superscript", [
|
|
140
140
|
["path", {
|
|
141
141
|
d: "m4 19 8-8",
|
|
@@ -166,8 +166,8 @@ var L = M("list-ordered", [
|
|
|
166
166
|
__name: "EmojiPickerDropdown",
|
|
167
167
|
emits: ["insert"],
|
|
168
168
|
setup(t, { emit: r }) {
|
|
169
|
-
let o = r, { categories: c, isOpen: f, toggle: p, close: m } = C(), { t: y, format:
|
|
170
|
-
|
|
169
|
+
let o = r, { categories: c, isOpen: f, toggle: p, close: m } = C(), { t: y, format: S } = j(), T = s(null), E = s(null);
|
|
170
|
+
w(T, _(() => f.value)), D(E, () => {
|
|
171
171
|
f.value && m();
|
|
172
172
|
});
|
|
173
173
|
function O(e) {
|
|
@@ -206,7 +206,7 @@ var L = M("list-ordered", [
|
|
|
206
206
|
}, [l("div", V, a(h(y).emoji[t.key]), 1), l("div", H, [(i(!0), u(g, null, e(t.emojis, (e) => (i(), u("button", {
|
|
207
207
|
key: e,
|
|
208
208
|
type: "button",
|
|
209
|
-
"aria-label": h(
|
|
209
|
+
"aria-label": h(S)(h(y).paragraphEditor.emojiItemLabel, { emoji: e }),
|
|
210
210
|
class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:text-base tpl:transition-all tpl:duration-100 tpl:hover:scale-125 tpl:hover:bg-[var(--tpl-bg-active)]",
|
|
211
211
|
onClick: (t) => O(e)
|
|
212
212
|
}, a(e), 9, U))), 128))])]))), 128))], 40, B)) : v("", !0)], 512));
|
|
@@ -457,7 +457,7 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
457
457
|
"active"
|
|
458
458
|
]),
|
|
459
459
|
d(G, {
|
|
460
|
-
icon: h(
|
|
460
|
+
icon: h(be),
|
|
461
461
|
label: h(D).paragraphEditor.strikethrough,
|
|
462
462
|
active: e.editor.isActive("strike"),
|
|
463
463
|
onClick: r[3] ||= (t) => e.editor.chain().focus().toggleStrike().run()
|
|
@@ -468,7 +468,7 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
468
468
|
]),
|
|
469
469
|
d(Y),
|
|
470
470
|
d(G, {
|
|
471
|
-
icon: h(
|
|
471
|
+
icon: h(ye),
|
|
472
472
|
label: h(D).paragraphEditor.subscript,
|
|
473
473
|
active: e.editor.isActive("subscript"),
|
|
474
474
|
onClick: r[4] ||= (t) => e.editor.chain().focus().toggleSubscript().run()
|
|
@@ -618,25 +618,25 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
618
618
|
},
|
|
619
619
|
emits: ["done"],
|
|
620
620
|
setup(e, { emit: t }) {
|
|
621
|
-
let n = e, r = t, a = E(), { editor: s, EditorContent: c, isLoading: l, initError: f, retry: p, showLinkDialog: m, linkUrl: g, linkColor: _, linkDialogRef: v, canRequestMergeTag: y, canInsertLogicTag: b, openLinkDialog: x, insertLink:
|
|
621
|
+
let n = e, r = t, a = E(), { editor: s, EditorContent: c, isLoading: l, initError: f, retry: p, showLinkDialog: m, linkUrl: g, linkColor: _, linkDialogRef: v, canRequestMergeTag: y, canInsertLogicTag: b, openLinkDialog: x, insertLink: C, removeLink: w, closeLinkDialog: D, handleLinkKeydown: O, handleAddMergeTag: k, handleAddLogicTag: A } = T({
|
|
622
622
|
blockId: () => n.block.id,
|
|
623
623
|
blockContent: () => n.block.content,
|
|
624
624
|
onDone: () => r("done"),
|
|
625
625
|
editorName: "ParagraphEditor",
|
|
626
626
|
async loadExtensions({ mergeTags: e, syntax: t, triggerChar: n, autocompleteEnabled: r, suggestionEmptyText: i }) {
|
|
627
|
-
let [{ Editor: o, EditorContent: s }, { default: c }, { default: l }, { default: u }, { default: d }, { default: f }, { default: p }, { TextStyle: m }, { default: h }, { default: g }, { default: _ }, { MergeTagNode: v, MergeTagSuggestion: y, LogicMergeTagNode: b, FontSize: x, LineHeight:
|
|
628
|
-
import("./dist-
|
|
629
|
-
import("./dist-
|
|
630
|
-
import("./dist-
|
|
631
|
-
import("./dist-
|
|
632
|
-
import("./dist-
|
|
633
|
-
import("./dist-
|
|
634
|
-
import("./dist-
|
|
635
|
-
import("./dist-
|
|
636
|
-
import("./dist-
|
|
637
|
-
import("./dist-
|
|
638
|
-
import("./dist-
|
|
639
|
-
import("./extensions-
|
|
627
|
+
let [{ Editor: o, EditorContent: s }, { default: c }, { default: l }, { default: u }, { default: d }, { default: f }, { default: p }, { TextStyle: m }, { default: h }, { default: g }, { default: _ }, { MergeTagNode: v, MergeTagSuggestion: y, LogicMergeTagNode: b, FontSize: x, LineHeight: C, LetterSpacing: w }] = await Promise.all([
|
|
628
|
+
import("./dist-DYClLqy8.js").then((e) => e.r),
|
|
629
|
+
import("./dist-BgPYC_8-.js"),
|
|
630
|
+
import("./dist-BuNDAAVp.js"),
|
|
631
|
+
import("./dist-CtcgoC_R.js"),
|
|
632
|
+
import("./dist-CrjzhIxB.js"),
|
|
633
|
+
import("./dist-BkM8A17N.js"),
|
|
634
|
+
import("./dist-CuXha2_7.js"),
|
|
635
|
+
import("./dist-CBzCU-a-.js"),
|
|
636
|
+
import("./dist-CweLDZrs.js"),
|
|
637
|
+
import("./dist-DOsdqAEZ.js"),
|
|
638
|
+
import("./dist-CDO52Rxy.js"),
|
|
639
|
+
import("./extensions-ClY5Sh7S.js")
|
|
640
640
|
]);
|
|
641
641
|
return {
|
|
642
642
|
TiptapEditor: o,
|
|
@@ -653,7 +653,7 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
653
653
|
u,
|
|
654
654
|
d,
|
|
655
655
|
f,
|
|
656
|
-
|
|
656
|
+
S(l).configure({
|
|
657
657
|
openOnClick: !1,
|
|
658
658
|
HTMLAttributes: {
|
|
659
659
|
target: "_blank",
|
|
@@ -666,8 +666,8 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
666
666
|
g,
|
|
667
667
|
_.configure({ multicolor: !0 }),
|
|
668
668
|
x,
|
|
669
|
-
S,
|
|
670
669
|
C,
|
|
670
|
+
w,
|
|
671
671
|
v.configure({
|
|
672
672
|
mergeTags: e,
|
|
673
673
|
syntax: t
|
|
@@ -726,8 +726,8 @@ var Ee = ["data-tpl-theme", "aria-label"], De = { class: "tpl:flex tpl:items-cen
|
|
|
726
726
|
"link-color": h(_),
|
|
727
727
|
"onUpdate:linkColor": n[2] ||= (e) => o(_) ? _.value = e : null,
|
|
728
728
|
onClose: h(D),
|
|
729
|
-
onInsert: h(
|
|
730
|
-
onRemove: h(
|
|
729
|
+
onInsert: h(C),
|
|
730
|
+
onRemove: h(w),
|
|
731
731
|
onKeydown: h(O)
|
|
732
732
|
}, null, 8, [
|
|
733
733
|
"visible",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { C as e, Dt as t, N as n, O as r, Ot as i, P as a, _ as o, c as s, d as c, h as l, i as u, l as d, m as f, nt as p, s as m, u as h, x as g, z as _ } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
2
|
import { a as v, c as y } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
|
|
3
|
-
import { n as b } from "./usePopoverPosition-
|
|
4
|
-
import { L as x, h as S, z as C } from "./keys-
|
|
5
|
-
import { t as w } from "./useI18n-
|
|
6
|
-
import { t as T } from "./createLucideIcon-
|
|
7
|
-
import { t as E } from "./x-
|
|
8
|
-
import { t as D } from "./ColorPicker-
|
|
3
|
+
import { n as b } from "./usePopoverPosition-BO2LNy5n.js";
|
|
4
|
+
import { L as x, h as S, z as C } from "./keys-CHPcp-Nz.js";
|
|
5
|
+
import { t as w } from "./useI18n-D2L9Mkik.js";
|
|
6
|
+
import { t as T } from "./createLucideIcon-JWHwTI6N.js";
|
|
7
|
+
import { t as E } from "./x-CkD6A1iB.js";
|
|
8
|
+
import { t as D } from "./ColorPicker-s9GHXjZs.js";
|
|
9
9
|
var O = T("bold", [["path", {
|
|
10
10
|
d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",
|
|
11
11
|
key: "mg9rjx"
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { A as e, Dt as t, E as n, Et as r, I as i, N as a, O as o, Ot as s, R as c, T as l, Y as u, _ as d, c as f, d as p, h as m, l as h, m as g, nt as _, r as v, s as y, u as b, x, z as S } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
|
+
import { a as C, c as w, s as T } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
|
|
3
|
+
import { H as E, P as D, c as O } from "./useEditorCore-Bd9CA4L_.js";
|
|
4
|
+
import { B as k, P as A, f as j, h as M } from "./keys-CHPcp-Nz.js";
|
|
5
|
+
import { t as N } from "./useI18n-D2L9Mkik.js";
|
|
6
|
+
import { t as P } from "./chevron-down-j8GrdTyz.js";
|
|
7
|
+
import { t as F } from "./chevron-up-BACyVhyC.js";
|
|
8
|
+
import { t as I } from "./loader-circle-C-Z6kgI6.js";
|
|
9
|
+
import { t as L } from "./TplModal-BA-Zsg0O.js";
|
|
10
|
+
import { t as R } from "./SavedBlockPreviewCanvas-ubttfmKr.js";
|
|
11
|
+
//#region src/components/SavedBlockPreviewRow.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relative tpl:min-w-0 tpl:flex-1" }, H = {
|
|
13
|
+
key: 0,
|
|
14
|
+
"data-testid": "saved-blocks-preview-fade",
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-0 tpl:h-10",
|
|
17
|
+
style: { background: "linear-gradient(\n to bottom,\n transparent,\n var(--tpl-bg) 90%\n )" }
|
|
18
|
+
}, U = ["aria-label", "aria-expanded"], W = 600, G = 240, K = /* @__PURE__ */ d({
|
|
19
|
+
__name: "SavedBlockPreviewRow",
|
|
20
|
+
props: {
|
|
21
|
+
block: {},
|
|
22
|
+
position: {},
|
|
23
|
+
total: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["move"],
|
|
26
|
+
setup(e, { emit: r }) {
|
|
27
|
+
let i = e, c = r, { t: d, format: v } = N(), S = x(j, []), C = u(null), O = u(null), k = u(1), A = u(null), M = u(!1), I = null, L = y(() => A.value !== null && A.value > G), K = y(() => A.value === null ? null : M.value || !L.value ? A.value : G);
|
|
28
|
+
function q() {
|
|
29
|
+
let e = C.value, t = O.value;
|
|
30
|
+
if (!e || !t) return;
|
|
31
|
+
let n = e.clientWidth;
|
|
32
|
+
if (n <= 0) return;
|
|
33
|
+
let r = Math.min(1, n / W);
|
|
34
|
+
k.value = r, A.value = t.offsetHeight * r;
|
|
35
|
+
}
|
|
36
|
+
n(() => {
|
|
37
|
+
q(), !(typeof ResizeObserver > "u") && (I = new ResizeObserver(() => q()), C.value && I.observe(C.value), O.value && I.observe(O.value));
|
|
38
|
+
}), l(() => {
|
|
39
|
+
I?.disconnect(), I = null;
|
|
40
|
+
});
|
|
41
|
+
let J = y(() => E(i.block, d, S)), Y = y(() => v(d.savedBlocks.reorderHandle, {
|
|
42
|
+
block: J.value,
|
|
43
|
+
position: i.position,
|
|
44
|
+
total: i.total
|
|
45
|
+
})), X = y(() => v(M.value ? d.savedBlocks.collapsePreview : d.savedBlocks.expandPreview, { block: J.value }));
|
|
46
|
+
return (n, r) => (o(), p("div", {
|
|
47
|
+
"data-testid": "saved-blocks-reorder-row",
|
|
48
|
+
"data-block-id": e.block.id,
|
|
49
|
+
class: "tpl:flex tpl:items-start tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:p-1.5 tpl:border-[var(--tpl-border)]",
|
|
50
|
+
style: { "background-color": "var(--tpl-bg)" }
|
|
51
|
+
}, [f("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
"data-testid": "saved-blocks-reorder-handle",
|
|
54
|
+
class: "tpl-saved-block-reorder-handle tpl:mt-0.5 tpl:shrink-0 tpl:cursor-grab tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:text-[var(--tpl-text-dim)]",
|
|
55
|
+
"aria-label": Y.value,
|
|
56
|
+
title: _(d).savedBlocks.reorderHint,
|
|
57
|
+
onKeydown: [r[0] ||= T(w((e) => c("move", -1), ["prevent"]), ["up"]), r[1] ||= T(w((e) => c("move", 1), ["prevent"]), ["down"])]
|
|
58
|
+
}, [m(_(D), {
|
|
59
|
+
size: 14,
|
|
60
|
+
"stroke-width": 1.5
|
|
61
|
+
})], 40, B), f("div", V, [
|
|
62
|
+
f("div", {
|
|
63
|
+
ref_key: "frameEl",
|
|
64
|
+
ref: C,
|
|
65
|
+
class: "tpl:overflow-hidden",
|
|
66
|
+
style: t({ height: K.value === null ? void 0 : `${K.value}px` })
|
|
67
|
+
}, [f("div", {
|
|
68
|
+
ref_key: "contentEl",
|
|
69
|
+
ref: O,
|
|
70
|
+
style: t({
|
|
71
|
+
width: `${W}px`,
|
|
72
|
+
transform: `scale(${k.value})`,
|
|
73
|
+
transformOrigin: "top left"
|
|
74
|
+
})
|
|
75
|
+
}, [m(R, { blocks: [e.block] }, null, 8, ["blocks"])], 4)], 4),
|
|
76
|
+
L.value && !M.value ? (o(), p("div", H)) : b("", !0),
|
|
77
|
+
L.value ? (o(), p("button", {
|
|
78
|
+
key: 1,
|
|
79
|
+
type: "button",
|
|
80
|
+
"data-testid": "saved-blocks-preview-toggle",
|
|
81
|
+
class: "tpl:absolute tpl:bottom-1 tpl:right-1 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)]",
|
|
82
|
+
"aria-label": X.value,
|
|
83
|
+
"aria-expanded": M.value,
|
|
84
|
+
onClick: r[2] ||= (e) => M.value = !M.value
|
|
85
|
+
}, [(o(), h(a(M.value ? _(F) : _(P)), {
|
|
86
|
+
size: 11,
|
|
87
|
+
"stroke-width": 2
|
|
88
|
+
})), g(" " + s(M.value ? _(d).savedBlocks.collapse : _(d).savedBlocks.expand), 1)], 8, U)) : b("", !0)
|
|
89
|
+
])], 8, z));
|
|
90
|
+
}
|
|
91
|
+
}), q = ["aria-busy"], J = {
|
|
92
|
+
id: "tpl-save-block-title",
|
|
93
|
+
class: "tpl:mb-4 tpl:shrink-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
94
|
+
}, Y = { class: "tpl:mb-3 tpl:shrink-0" }, X = { class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, ee = ["placeholder", "disabled"], te = { class: "tpl:mb-3 tpl:shrink-0" }, ne = {
|
|
95
|
+
for: "tpl-save-block-category",
|
|
96
|
+
class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]"
|
|
97
|
+
}, re = ["placeholder", "disabled"], ie = { id: "tpl-saved-block-categories" }, ae = ["value"], oe = {
|
|
98
|
+
"data-testid": "saved-blocks-save-summary",
|
|
99
|
+
class: "tpl:mb-1.5 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
|
|
100
|
+
}, se = { class: "tpl:text-[var(--tpl-text-dim)]" }, ce = {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: "tpl:mb-1.5 tpl:shrink-0 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]"
|
|
103
|
+
}, le = {
|
|
104
|
+
class: "tpl-sr-only",
|
|
105
|
+
role: "status",
|
|
106
|
+
"aria-live": "polite",
|
|
107
|
+
"aria-atomic": "true"
|
|
108
|
+
}, ue = {
|
|
109
|
+
key: 1,
|
|
110
|
+
role: "alert",
|
|
111
|
+
class: "tpl:mb-3 tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-danger)]"
|
|
112
|
+
}, de = { class: "tpl:flex tpl:shrink-0 tpl:justify-end tpl:gap-2" }, fe = ["disabled"], pe = ["disabled"], me = {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
115
|
+
}, he = { key: 1 }, Z = /* @__PURE__ */ d({
|
|
116
|
+
__name: "SaveBlockDialog",
|
|
117
|
+
props: {
|
|
118
|
+
visible: { type: Boolean },
|
|
119
|
+
pickedIds: {}
|
|
120
|
+
},
|
|
121
|
+
emits: ["close", "saved"],
|
|
122
|
+
setup(t, { emit: n }) {
|
|
123
|
+
let a = t, l = n, { t: d, format: w } = N(), T = k(M, "SaveBlockDialog"), D = k(A, "SaveBlockDialog"), P = x(j, []), F = u(""), R = u(""), z = u(!1), B = u(null), V = u(""), H = u([]), U = y(() => {
|
|
124
|
+
let e = new Map(T.content.value.blocks.map((e) => [e.id, e]));
|
|
125
|
+
return H.value.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
126
|
+
}), W = y({
|
|
127
|
+
get: () => U.value,
|
|
128
|
+
set: (e) => {
|
|
129
|
+
H.value = e.map((e) => e.id);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
function G(e, t) {
|
|
133
|
+
let n = U.value.map((e) => e.id), r = n.indexOf(e), i = r + t;
|
|
134
|
+
if (r === -1 || i < 0 || i >= n.length) return;
|
|
135
|
+
[n[r], n[i]] = [n[i], n[r]], H.value = n;
|
|
136
|
+
let a = U.value[i];
|
|
137
|
+
V.value = a ? w(d.savedBlocks.reorderAnnouncement, {
|
|
138
|
+
block: Z(a),
|
|
139
|
+
position: i + 1,
|
|
140
|
+
total: n.length
|
|
141
|
+
}) : "";
|
|
142
|
+
}
|
|
143
|
+
function Z(e) {
|
|
144
|
+
return E(e, d, P);
|
|
145
|
+
}
|
|
146
|
+
let ge = y(() => U.value.map(Z).join(", "));
|
|
147
|
+
i(() => a.visible, (e) => {
|
|
148
|
+
e && (F.value = "", R.value = "", B.value = null, V.value = "", H.value = [...a.pickedIds]);
|
|
149
|
+
}, { immediate: !0 });
|
|
150
|
+
let Q = y(() => F.value.trim().length > 0 && U.value.length > 0 && !z.value);
|
|
151
|
+
async function _e() {
|
|
152
|
+
if (!Q.value) return;
|
|
153
|
+
let e = U.value;
|
|
154
|
+
if (e.length !== 0) {
|
|
155
|
+
z.value = !0, B.value = null;
|
|
156
|
+
try {
|
|
157
|
+
await D.create(F.value.trim(), e, R.value.trim() || void 0), l("saved"), l("close");
|
|
158
|
+
} catch (e) {
|
|
159
|
+
B.value = e.message;
|
|
160
|
+
} finally {
|
|
161
|
+
z.value = !1;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function $() {
|
|
166
|
+
z.value || l("close");
|
|
167
|
+
}
|
|
168
|
+
function ve(e) {
|
|
169
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), _e()), e.key === "Escape" && $();
|
|
170
|
+
}
|
|
171
|
+
return (n, i) => (o(), h(L, {
|
|
172
|
+
visible: t.visible,
|
|
173
|
+
onClose: $,
|
|
174
|
+
onKeydown: ve
|
|
175
|
+
}, {
|
|
176
|
+
default: c(() => [f("div", {
|
|
177
|
+
role: "dialog",
|
|
178
|
+
"aria-modal": "true",
|
|
179
|
+
"aria-busy": z.value,
|
|
180
|
+
"aria-labelledby": "tpl-save-block-title",
|
|
181
|
+
class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-2xl tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
182
|
+
style: {
|
|
183
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
184
|
+
"box-shadow": "var(--tpl-shadow-xl)",
|
|
185
|
+
"max-height": "90vh"
|
|
186
|
+
}
|
|
187
|
+
}, [
|
|
188
|
+
f("h3", J, s(_(d).savedBlocks.saveAsBlock), 1),
|
|
189
|
+
f("div", Y, [f("label", X, s(_(d).savedBlocks.name), 1), S(f("input", {
|
|
190
|
+
"onUpdate:modelValue": i[0] ||= (e) => F.value = e,
|
|
191
|
+
type: "text",
|
|
192
|
+
"data-testid": "saved-blocks-name-input",
|
|
193
|
+
placeholder: _(d).savedBlocks.namePlaceholder,
|
|
194
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
195
|
+
disabled: z.value
|
|
196
|
+
}, null, 8, ee), [[C, F.value]])]),
|
|
197
|
+
f("div", te, [
|
|
198
|
+
f("label", ne, s(_(d).savedBlocks.category), 1),
|
|
199
|
+
S(f("input", {
|
|
200
|
+
id: "tpl-save-block-category",
|
|
201
|
+
"onUpdate:modelValue": i[1] ||= (e) => R.value = e,
|
|
202
|
+
type: "text",
|
|
203
|
+
"data-testid": "saved-blocks-category-input",
|
|
204
|
+
list: "tpl-saved-block-categories",
|
|
205
|
+
placeholder: _(d).savedBlocks.categoryPlaceholder,
|
|
206
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
207
|
+
disabled: z.value
|
|
208
|
+
}, null, 8, re), [[C, R.value]]),
|
|
209
|
+
f("datalist", ie, [(o(!0), p(v, null, e(_(D).categories.value, (e) => (o(), p("option", {
|
|
210
|
+
key: e,
|
|
211
|
+
value: e
|
|
212
|
+
}, null, 8, ae))), 128))])
|
|
213
|
+
]),
|
|
214
|
+
f("p", oe, [g(s(_(w)(_(d).savedBlocks.savingCount, { count: U.value.length })) + " ", 1), f("span", se, s(ge.value), 1)]),
|
|
215
|
+
U.value.length > 1 ? (o(), p("p", ce, s(_(d).savedBlocks.reorderHint), 1)) : b("", !0),
|
|
216
|
+
m(_(O), {
|
|
217
|
+
modelValue: W.value,
|
|
218
|
+
"onUpdate:modelValue": i[2] ||= (e) => W.value = e,
|
|
219
|
+
"data-testid": "saved-blocks-reorder-list",
|
|
220
|
+
animation: 150,
|
|
221
|
+
"ghost-class": "tpl-ghost",
|
|
222
|
+
"drag-class": "tpl-dragging",
|
|
223
|
+
handle: ".tpl-saved-block-reorder-handle",
|
|
224
|
+
"force-fallback": !0,
|
|
225
|
+
class: "tpl:mb-4 tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:gap-1.5 tpl:overflow-y-auto"
|
|
226
|
+
}, {
|
|
227
|
+
default: c(() => [(o(!0), p(v, null, e(W.value, (e, t) => (o(), h(K, {
|
|
228
|
+
key: e.id,
|
|
229
|
+
block: e,
|
|
230
|
+
position: t + 1,
|
|
231
|
+
total: W.value.length,
|
|
232
|
+
onMove: (t) => G(e.id, t)
|
|
233
|
+
}, null, 8, [
|
|
234
|
+
"block",
|
|
235
|
+
"position",
|
|
236
|
+
"total",
|
|
237
|
+
"onMove"
|
|
238
|
+
]))), 128))]),
|
|
239
|
+
_: 1
|
|
240
|
+
}, 8, ["modelValue"]),
|
|
241
|
+
f("div", le, s(V.value), 1),
|
|
242
|
+
B.value ? (o(), p("p", ue, s(B.value), 1)) : b("", !0),
|
|
243
|
+
f("div", de, [f("button", {
|
|
244
|
+
type: "button",
|
|
245
|
+
class: r(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", { "tpl:cursor-not-allowed tpl:opacity-50": z.value }]),
|
|
246
|
+
disabled: z.value,
|
|
247
|
+
onClick: $
|
|
248
|
+
}, s(_(d).savedBlocks.cancel), 11, fe), f("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
251
|
+
disabled: !Q.value,
|
|
252
|
+
onClick: _e
|
|
253
|
+
}, [z.value ? (o(), p("span", me, [m(_(I), {
|
|
254
|
+
class: "tpl:animate-spin",
|
|
255
|
+
size: 12,
|
|
256
|
+
"stroke-width": 2
|
|
257
|
+
}), g(" " + s(_(d).savedBlocks.saving), 1)])) : (o(), p("span", he, s(_(d).savedBlocks.save), 1))], 8, pe)])
|
|
258
|
+
], 8, q)]),
|
|
259
|
+
_: 1
|
|
260
|
+
}, 8, ["visible"]));
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
//#endregion
|
|
264
|
+
export { Z as default };
|