@templatical/editor 0.19.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.
Files changed (189) hide show
  1. package/README.md +1 -0
  2. package/dist/{AiChatSidebar-DAQTFuvi.js → AiChatSidebar-K_AehWc-.js} +9 -9
  3. package/dist/{AiFeatureMenu-aFSO20PR.js → AiFeatureMenu-CPdNpHpZ.js} +6 -6
  4. package/dist/{BlockIssueBadge-BQmq1bxn.js → BlockIssueBadge-Dmj9rVra.js} +4 -4
  5. package/dist/{CloudEditor-D0K-m1GA.js → CloudEditor-3a7mqMhe.js} +263 -315
  6. package/dist/{CollaboratorBar-CJO3l6Dt.js → CollaboratorBar-Ds0YZWzV.js} +3 -3
  7. package/dist/{ColorPicker-BsgpTJqK.js → ColorPicker-s9GHXjZs.js} +4 -4
  8. package/dist/CommentsSidebar-DvNEdugN.js +435 -0
  9. package/dist/{CountdownBlock-Bn5w7C-p.js → CountdownBlock-BUHYIAe9.js} +1 -1
  10. package/dist/{CountdownToolbar-PJI3ffi1.js → CountdownToolbar-DPRcv3Fu.js} +3 -4
  11. package/dist/{DesignReferenceSidebar-QfAV8XT9.js → DesignReferenceSidebar-DNmK3dxp.js} +8 -8
  12. package/dist/{IssuesPanel-CTjRgz8w.js → IssuesPanel-CEnEGFtd.js} +7 -7
  13. package/dist/{MergeTagSuggestion-DCuaSOPQ.js → MergeTagSuggestion-DMe4rqn0.js} +2 -2
  14. package/dist/NumberWithSuffix-CCPN_oCh.js +121 -0
  15. package/dist/{ParagraphEditor-Cf75UfSo.js → ParagraphEditor-CkwBirNl.js} +47 -47
  16. package/dist/{RichTextEditorContent-MdaLz6Q3.js → RichTextEditorContent-FbnWsh46.js} +6 -6
  17. package/dist/SaveBlockDialog-Cc5BSUBx.js +264 -0
  18. package/dist/SavedBlockPreviewCanvas-ubttfmKr.js +109 -0
  19. package/dist/SavedBlocksBrowserModal-LkY_U3lY.js +323 -0
  20. package/dist/SavedBlocksPanels-CET0zvH6.js +36 -0
  21. package/dist/SavedBlocksPickBar-poGS4PoI.js +52 -0
  22. package/dist/{SnapshotHistory-C_Y1LzAY.js → SnapshotHistory-BvF5IXn1.js} +8 -8
  23. package/dist/{TemplateScoringPanel-DikuKc6i.js → TemplateScoringPanel-ifGGGWs5.js} +14 -14
  24. package/dist/{TestEmailModal-BW8aTtzf.js → TestEmailModal-BRaM_eko.js} +4 -4
  25. package/dist/{TitleEditor-CCUkbRN0.js → TitleEditor-Bhgzh-iQ.js} +11 -11
  26. package/dist/{TplModal-DoOwUKlT.js → TplModal-BA-Zsg0O.js} +3 -3
  27. package/dist/{blockTypeIcons-BlPKjD7M.js → blockTypeIcons-B1-Yzp-a.js} +6 -6
  28. package/dist/bundle-stats.json +8 -8
  29. package/dist/{ca-DbWoy4rG.js → ca-BBgad6y5.js} +50 -3
  30. package/dist/cdn/chunks/{AiFeatureMenu-RwJiaPXZ.js → AiFeatureMenu--PdArSnv.js} +7 -7
  31. package/dist/cdn/chunks/{AiFeatureMenu-RwJiaPXZ.js.map → AiFeatureMenu--PdArSnv.js.map} +1 -1
  32. package/dist/cdn/chunks/{BlockIssueBadge-DM-TDKbr.js → BlockIssueBadge-DMSd0SIl.js} +4 -4
  33. package/dist/cdn/chunks/{BlockIssueBadge-DM-TDKbr.js.map → BlockIssueBadge-DMSd0SIl.js.map} +1 -1
  34. package/dist/cdn/chunks/{CloudEditor-Dufl354p.js → CloudEditor-DnTfI5GU.js} +273 -325
  35. package/dist/cdn/chunks/CloudEditor-DnTfI5GU.js.map +1 -0
  36. package/dist/cdn/chunks/{CollaboratorBar-xsU20iPl.js → CollaboratorBar-CBqd7ldq.js} +3 -3
  37. package/dist/cdn/chunks/{CollaboratorBar-xsU20iPl.js.map → CollaboratorBar-CBqd7ldq.js.map} +1 -1
  38. package/dist/cdn/chunks/{ColorPicker-y_obnw4o.js → ColorPicker-DCdWP8YB.js} +99 -99
  39. package/dist/cdn/chunks/ColorPicker-DCdWP8YB.js.map +1 -0
  40. package/dist/cdn/chunks/{CountdownBlock-sHsRMe1q.js → CountdownBlock-BDnWMAME.js} +2 -2
  41. package/dist/cdn/chunks/{CountdownBlock-sHsRMe1q.js.map → CountdownBlock-BDnWMAME.js.map} +1 -1
  42. package/dist/cdn/chunks/{CountdownToolbar-Ckc_jEi-.js → CountdownToolbar-BbLoo22S.js} +4 -5
  43. package/dist/cdn/chunks/{CountdownToolbar-Ckc_jEi-.js.map → CountdownToolbar-BbLoo22S.js.map} +1 -1
  44. package/dist/cdn/chunks/{IssuesPanel-DF5Ajuna.js → IssuesPanel-CfudrI3T.js} +7 -7
  45. package/dist/cdn/chunks/{IssuesPanel-DF5Ajuna.js.map → IssuesPanel-CfudrI3T.js.map} +1 -1
  46. package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js → MergeTagSuggestion-D7TsECll.js} +2 -2
  47. package/dist/cdn/chunks/{MergeTagSuggestion-BmMmdcRg.js.map → MergeTagSuggestion-D7TsECll.js.map} +1 -1
  48. package/dist/cdn/chunks/NumberWithSuffix-BmMx9_n_.js +123 -0
  49. package/dist/cdn/chunks/NumberWithSuffix-BmMx9_n_.js.map +1 -0
  50. package/dist/cdn/chunks/{ParagraphEditor-BkafKSju.js → ParagraphEditor-DPCUSXpx.js} +82 -82
  51. package/dist/cdn/chunks/{ParagraphEditor-BkafKSju.js.map → ParagraphEditor-DPCUSXpx.js.map} +1 -1
  52. package/dist/cdn/chunks/{RichTextEditorContent-BthhzOZS.js → RichTextEditorContent-B8dOiv_D.js} +5 -5
  53. package/dist/cdn/chunks/{RichTextEditorContent-BthhzOZS.js.map → RichTextEditorContent-B8dOiv_D.js.map} +1 -1
  54. package/dist/cdn/chunks/SaveBlockDialog-BY3SMnNV.js +259 -0
  55. package/dist/cdn/chunks/SaveBlockDialog-BY3SMnNV.js.map +1 -0
  56. package/dist/cdn/chunks/SavedBlockPreviewCanvas-LpaOcusq.js +110 -0
  57. package/dist/cdn/chunks/SavedBlockPreviewCanvas-LpaOcusq.js.map +1 -0
  58. package/dist/cdn/chunks/SavedBlocksBrowserModal-CfIcmyzF.js +318 -0
  59. package/dist/cdn/chunks/SavedBlocksBrowserModal-CfIcmyzF.js.map +1 -0
  60. package/dist/cdn/chunks/SavedBlocksPanels-kIowCfh_.js +38 -0
  61. package/dist/cdn/chunks/SavedBlocksPanels-kIowCfh_.js.map +1 -0
  62. package/dist/cdn/chunks/SavedBlocksPickBar-WSGe1GiZ.js +52 -0
  63. package/dist/cdn/chunks/SavedBlocksPickBar-WSGe1GiZ.js.map +1 -0
  64. package/dist/cdn/chunks/{TitleEditor-DLv9cXba.js → TitleEditor-iwd-O9sO.js} +11 -11
  65. package/dist/cdn/chunks/{TitleEditor-DLv9cXba.js.map → TitleEditor-iwd-O9sO.js.map} +1 -1
  66. package/dist/cdn/chunks/{blockTypeIcons-B0uibGX7.js → blockTypeIcons-BYz0fgLz.js} +7 -7
  67. package/dist/cdn/chunks/{blockTypeIcons-B0uibGX7.js.map → blockTypeIcons-BYz0fgLz.js.map} +1 -1
  68. package/dist/cdn/chunks/{ca-DbWoy4rG.js → ca-BBgad6y5.js} +51 -4
  69. package/dist/cdn/chunks/ca-BBgad6y5.js.map +1 -0
  70. package/dist/{de-CTYXVU9v.js → cdn/chunks/de-Bw6fB5JU.js} +2 -24
  71. package/dist/cdn/chunks/{de-CTYXVU9v.js.map → de-Bw6fB5JU.js.map} +1 -1
  72. package/dist/cdn/chunks/{de-CgGOnerg.js → de-D7WbpFBR.js} +50 -3
  73. package/dist/cdn/chunks/de-D7WbpFBR.js.map +1 -0
  74. package/dist/{en-DrUV9xth.js → cdn/chunks/en-BrZ0uGK2.js} +51 -2
  75. package/dist/cdn/chunks/en-BrZ0uGK2.js.map +1 -0
  76. package/dist/{en-BtmIaJeb.js → cdn/chunks/en-DAdHJz7h.js} +2 -24
  77. package/dist/cdn/chunks/{en-BtmIaJeb.js.map → en-DAdHJz7h.js.map} +1 -1
  78. package/dist/{es-DwbKjU7q.js → cdn/chunks/es-tLSLysPs.js} +51 -2
  79. package/dist/cdn/chunks/es-tLSLysPs.js.map +1 -0
  80. package/dist/cdn/chunks/{extensions-DLHvZ0UH.js → extensions-DeJh3E9b.js} +29 -29
  81. package/dist/cdn/chunks/{extensions-DLHvZ0UH.js.map → extensions-DeJh3E9b.js.map} +1 -1
  82. package/dist/cdn/chunks/{features-Cnfv4QAY.js → features-pLfGJWIB.js} +1802 -1603
  83. package/dist/cdn/chunks/features-pLfGJWIB.js.map +1 -0
  84. package/dist/cdn/chunks/{icons-DbcM69bb.js → icons-FLemooQz.js} +16 -16
  85. package/dist/cdn/chunks/{icons-DbcM69bb.js.map → icons-FLemooQz.js.map} +1 -1
  86. package/dist/cdn/chunks/{media-library-DpSMwHd4.js → media-library-mCCZieYO.js} +163 -163
  87. package/dist/cdn/chunks/{media-library-DpSMwHd4.js.map → media-library-mCCZieYO.js.map} +1 -1
  88. package/dist/cdn/chunks/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +50 -3
  89. package/dist/cdn/chunks/pt-BR-BWFokdTU.js.map +1 -0
  90. package/dist/{pt-BR-B2ZvFlRL.js → cdn/chunks/pt-BR-w2sGzHNX.js} +2 -24
  91. package/dist/cdn/chunks/{pt-BR-B2ZvFlRL.js.map → pt-BR-w2sGzHNX.js.map} +1 -1
  92. package/dist/cdn/chunks/{pusher-CIwiKF8H.js → pusher-R0v5p99W.js} +27 -22
  93. package/dist/cdn/chunks/pusher-R0v5p99W.js.map +1 -0
  94. package/dist/cdn/chunks/{quality-D9QqkRcU.js → quality-BRbHtAk1.js} +460 -460
  95. package/dist/cdn/chunks/{quality-D9QqkRcU.js.map → quality-BRbHtAk1.js.map} +1 -1
  96. package/dist/cdn/chunks/{renderer-BsLQZNXU.js → renderer-Yg1XhsBN.js} +18 -18
  97. package/dist/cdn/chunks/{renderer-BsLQZNXU.js.map → renderer-Yg1XhsBN.js.map} +1 -1
  98. package/dist/cdn/chunks/{src-zu1ehVNN.js → src-BDJeYiVE.js} +33 -33
  99. package/dist/cdn/chunks/{src-zu1ehVNN.js.map → src-BDJeYiVE.js.map} +1 -1
  100. package/dist/cdn/chunks/{styles-Dx-jXeCd.js → styles-Bp5Jsu9J.js} +1422 -1332
  101. package/dist/cdn/chunks/styles-Bp5Jsu9J.js.map +1 -0
  102. package/dist/cdn/chunks/{tiptap-C2indasq.js → tiptap-BMZ-OENR.js} +2012 -1863
  103. package/dist/cdn/chunks/tiptap-BMZ-OENR.js.map +1 -0
  104. package/dist/cdn/editor.css +1 -1
  105. package/dist/cdn/editor.js +123 -114
  106. package/dist/cdn/editor.js.map +1 -1
  107. package/dist/{check-Cg6Mc2pP.js → check-BpQDKiPz.js} +1 -1
  108. package/dist/{chevron-down-dClfxKrJ.js → chevron-down-j8GrdTyz.js} +1 -1
  109. package/dist/chevron-up-BACyVhyC.js +7 -0
  110. package/dist/{circle-alert-Bhzm-fNA.js → circle-alert-CgtE46ND.js} +1 -1
  111. package/dist/{clock-m7TwQw4b.js → clock-BzKLLW5L.js} +1 -1
  112. package/dist/{cloud-B-RebwxI.js → cloud-Du7mnkz2.js} +19 -47
  113. package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-JWHwTI6N.js} +2 -2
  114. package/dist/{cdn/chunks/de-CTYXVU9v.js → de-Bw6fB5JU.js} +0 -26
  115. package/dist/{de-CgGOnerg.js → de-D7WbpFBR.js} +49 -2
  116. package/dist/{dist-CgTKuIUN.js → dist-BEpCh2mG.js} +1158 -1125
  117. package/dist/{dist-Cx7IUM7J.js → dist-BgPYC_8-.js} +14 -6
  118. package/dist/{dist-BKKo5wPC.js → dist-BkM8A17N.js} +2 -2
  119. package/dist/{dist-CcX5sLpz.js → dist-BuNDAAVp.js} +361 -256
  120. package/dist/{dist-COSN3oDJ.js → dist-CBzCU-a-.js} +2 -2
  121. package/dist/{dist-YSCPD13F.js → dist-CDO52Rxy.js} +2 -2
  122. package/dist/{dist-Dk5AdwoQ.js → dist-CrjzhIxB.js} +2 -2
  123. package/dist/{dist-DXAZUjj3.js → dist-CtcgoC_R.js} +2 -2
  124. package/dist/{dist-D6M5FAY7.js → dist-CuXha2_7.js} +2 -2
  125. package/dist/dist-CweLDZrs.js +5 -0
  126. package/dist/dist-DOsdqAEZ.js +5 -0
  127. package/dist/{dist-8TKf-Jpg.js → dist-DYClLqy8.js} +6 -3
  128. package/dist/{cdn/chunks/en-DrUV9xth.js → en-BrZ0uGK2.js} +49 -4
  129. package/dist/{cdn/chunks/en-BtmIaJeb.js → en-DAdHJz7h.js} +0 -26
  130. package/dist/{cdn/chunks/es-DwbKjU7q.js → es-tLSLysPs.js} +49 -4
  131. package/dist/{extensions-BCA9pyer.js → extensions-ClY5Sh7S.js} +5 -5
  132. package/dist/{image-up-CDEgJqwA.js → image-up-CQdtq8ge.js} +1 -1
  133. package/dist/index.d.ts +81 -4
  134. package/dist/{info-BNP8yGsK.js → info-BUJBXoE6.js} +1 -1
  135. package/dist/{keys-DFaIbGR8.js → keys-CHPcp-Nz.js} +2 -2
  136. package/dist/{list-checks-jepi4iYr.js → list-checks-BGHaCSD5.js} +1 -1
  137. package/dist/{loader-circle-BT38qSm3.js → loader-circle-C-Z6kgI6.js} +1 -1
  138. package/dist/{message-circle-BAHcL9S-.js → message-circle-CEm5qckV.js} +1 -1
  139. package/dist/pencil-DdwmkKLb.js +10 -0
  140. package/dist/{pt-BR-Bcc5Tjed.js → pt-BR-BWFokdTU.js} +49 -2
  141. package/dist/{cdn/chunks/pt-BR-B2ZvFlRL.js → pt-BR-w2sGzHNX.js} +0 -26
  142. package/dist/{refresh-cw-as5Bmg4X.js → refresh-cw-maKlg0dl.js} +1 -1
  143. package/dist/{scan-line-IAMjPtRw.js → scan-line-BFgesTOY.js} +1 -1
  144. package/dist/{send-DvMay6bt.js → send-B70aQDrA.js} +1 -1
  145. package/dist/{shield-check-YYDhGroE.js → shield-check-B7x5OKt5.js} +1 -1
  146. package/dist/{sparkles-CCwQMMMZ.js → sparkles-DVlm1Ipp.js} +1 -1
  147. package/dist/style.css +1 -1
  148. package/dist/{styles-64uLkPJV.js → styles-DIDAJdkj.js} +1241 -1151
  149. package/dist/templatical-editor.js +134 -125
  150. package/dist/{text-align-start-BwsA6QzC.js → text-align-start-Vay3Kvo2.js} +1 -1
  151. package/dist/{trash-2-CRBDolnR.js → trash-2-DE8CmxAG.js} +1 -1
  152. package/dist/{triangle-alert-B2g0ALvq.js → triangle-alert-Djg6IG8N.js} +1 -1
  153. package/dist/{upload-y4gxiFp5.js → upload-BwwE0U6G.js} +1 -1
  154. package/dist/{useCloudI18n-PCDOC2kz.js → useCloudI18n-BmiygEM4.js} +1 -1
  155. package/dist/{useEditorCore-ea9OrrH3.js → useEditorCore-Bd9CA4L_.js} +1236 -1013
  156. package/dist/{useI18n-BNMzZTM5.js → useI18n-D2L9Mkik.js} +1 -1
  157. package/dist/{useMergeTag-DfEY0eK5.js → useMergeTag-BTdDq5DC.js} +1 -1
  158. package/dist/{usePopoverPosition-F9STHRIr.js → usePopoverPosition-BO2LNy5n.js} +1 -1
  159. package/dist/{x-Ctg_250T.js → x-CkD6A1iB.js} +1 -1
  160. package/package.json +23 -23
  161. package/dist/CommentsSidebar-BYMVucZh.js +0 -442
  162. package/dist/ModuleBrowserModal-BNalLx0k.js +0 -202
  163. package/dist/ModulePreviewCanvas-BwObwisa.js +0 -106
  164. package/dist/NumberWithSuffix-D3BKz66W.js +0 -89
  165. package/dist/SaveModuleDialog-MTjwiF9D.js +0 -125
  166. package/dist/ToggleSwitch-DUNuUPsZ.js +0 -37
  167. package/dist/cdn/chunks/CloudEditor-Dufl354p.js.map +0 -1
  168. package/dist/cdn/chunks/ColorPicker-y_obnw4o.js.map +0 -1
  169. package/dist/cdn/chunks/ModuleBrowserModal-DG4AVFjH.js +0 -198
  170. package/dist/cdn/chunks/ModuleBrowserModal-DG4AVFjH.js.map +0 -1
  171. package/dist/cdn/chunks/ModulePreviewCanvas-Bc_PcJuc.js +0 -107
  172. package/dist/cdn/chunks/ModulePreviewCanvas-Bc_PcJuc.js.map +0 -1
  173. package/dist/cdn/chunks/NumberWithSuffix-8fOO-LC_.js +0 -91
  174. package/dist/cdn/chunks/NumberWithSuffix-8fOO-LC_.js.map +0 -1
  175. package/dist/cdn/chunks/SaveModuleDialog-DhsfYf2n.js +0 -120
  176. package/dist/cdn/chunks/SaveModuleDialog-DhsfYf2n.js.map +0 -1
  177. package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js +0 -39
  178. package/dist/cdn/chunks/ToggleSwitch-OrmX_w18.js.map +0 -1
  179. package/dist/cdn/chunks/ca-DbWoy4rG.js.map +0 -1
  180. package/dist/cdn/chunks/de-CgGOnerg.js.map +0 -1
  181. package/dist/cdn/chunks/en-DrUV9xth.js.map +0 -1
  182. package/dist/cdn/chunks/es-DwbKjU7q.js.map +0 -1
  183. package/dist/cdn/chunks/features-Cnfv4QAY.js.map +0 -1
  184. package/dist/cdn/chunks/pt-BR-Bcc5Tjed.js.map +0 -1
  185. package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
  186. package/dist/cdn/chunks/styles-Dx-jXeCd.js.map +0 -1
  187. package/dist/cdn/chunks/tiptap-C2indasq.js.map +0 -1
  188. package/dist/dist-BDVm2MrW.js +0 -5
  189. 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 { D as S, E as C, S as w, x as T } from "./useEditorCore-ea9OrrH3.js";
4
- import { n as E, s as D } from "./usePopoverPosition-F9STHRIr.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-DFaIbGR8.js";
6
- import { t as j } from "./useI18n-BNMzZTM5.js";
7
- import { t as M } from "./createLucideIcon-FSF4peHQ.js";
8
- import { a as ie, i as ae, n as N, r as oe, t as P } from "./RichTextEditorContent-MdaLz6Q3.js";
9
- import { n as se, t as ce } from "./scan-line-IAMjPtRw.js";
10
- import { t as le } from "./loader-circle-BT38qSm3.js";
11
- import { n as ue, r as de, t as fe } from "./text-align-start-BwsA6QzC.js";
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-BsgpTJqK.js";
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("strikethrough", [
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: w } = j(), T = s(null), E = s(null);
170
- S(T, _(() => f.value)), D(E, () => {
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(w)(h(y).paragraphEditor.emojiItemLabel, { emoji: e }),
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(ye),
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(be),
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: S, removeLink: C, closeLinkDialog: D, handleLinkKeydown: O, handleAddMergeTag: k, handleAddLogicTag: A } = 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: 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: S, LetterSpacing: C }] = await Promise.all([
628
- import("./dist-8TKf-Jpg.js").then((e) => e.r),
629
- import("./dist-Cx7IUM7J.js"),
630
- import("./dist-CcX5sLpz.js"),
631
- import("./dist-DXAZUjj3.js"),
632
- import("./dist-Dk5AdwoQ.js"),
633
- import("./dist-BKKo5wPC.js"),
634
- import("./dist-D6M5FAY7.js"),
635
- import("./dist-COSN3oDJ.js"),
636
- import("./dist-DbekZDmJ.js"),
637
- import("./dist-BDVm2MrW.js"),
638
- import("./dist-YSCPD13F.js"),
639
- import("./extensions-BCA9pyer.js")
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
- w(l).configure({
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(S),
730
- onRemove: h(C),
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-F9STHRIr.js";
4
- import { L as x, h as S, z as C } from "./keys-DFaIbGR8.js";
5
- import { t as w } from "./useI18n-BNMzZTM5.js";
6
- import { t as T } from "./createLucideIcon-FSF4peHQ.js";
7
- import { t as E } from "./x-Ctg_250T.js";
8
- import { t as D } from "./ColorPicker-BsgpTJqK.js";
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 };