@templatical/editor 0.0.3 → 0.0.5

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 (144) hide show
  1. package/dist/{AiChatSidebar-busJk9hm.js → AiChatSidebar-DwME3f-a.js} +84 -70
  2. package/dist/{AiFeatureMenu-DLGv_-pj.js → AiFeatureMenu-DJvWL1GZ.js} +23 -23
  3. package/dist/CloudEditor-Fe0ssRgi.js +1082 -0
  4. package/dist/{CollaboratorBar-Dv3l52vC.js → CollaboratorBar-DTT0EkZn.js} +25 -21
  5. package/dist/{CommentsSidebar-4tjp0VU5.js → CommentsSidebar-DrJhQRXK.js} +131 -131
  6. package/dist/{DesignReferenceSidebar-CmwXvltV.js → DesignReferenceSidebar-DdOht5zn.js} +49 -49
  7. package/dist/ModuleBrowserModal-CiV_jOEM.js +205 -0
  8. package/dist/{ModulePreviewCanvas-BcBJLnwL.js → ModulePreviewCanvas-Bmy6Y1WE.js} +2 -2
  9. package/dist/ParagraphEditor-CoQ3NlS7.js +688 -0
  10. package/dist/{RichTextEditorContent-CQqodi7p.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
  11. package/dist/{SaveModuleDialog-Bmzi72td.js → SaveModuleDialog-CD2ZYq1o.js} +25 -25
  12. package/dist/{SnapshotHistory-AEgi9Xsn.js → SnapshotHistory-DltsKvhP.js} +2 -2
  13. package/dist/TemplateScoringPanel-DmnmUE3y.js +254 -0
  14. package/dist/{TestEmailModal-Dpq1is9S.js → TestEmailModal-Dl633j9o.js} +3 -3
  15. package/dist/{TitleEditor-CLcDdcWI.js → TitleEditor-C7fds2Nc.js} +7 -7
  16. package/dist/{TplModal-CGzRjR96.js → TplModal-C5_CF-qn.js} +2 -2
  17. package/dist/{blockTypeIcons-BpPTqcok.js → blockTypeIcons-BrKZB10B.js} +1 -1
  18. package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +2 -0
  19. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js +59 -0
  20. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js.map +1 -0
  21. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js +1056 -0
  22. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +1 -0
  23. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js +51 -0
  24. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js.map +1 -0
  25. package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +2 -0
  26. package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +2 -0
  27. package/dist/{ModuleBrowserModal-lrk3Fr0H.js → cdn/chunks/ModuleBrowserModal-ChBr3aXj.js} +52 -62
  28. package/dist/cdn/chunks/ModuleBrowserModal-ChBr3aXj.js.map +1 -0
  29. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js +107 -0
  30. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js.map +1 -0
  31. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js +539 -0
  32. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +1 -0
  33. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js +106 -0
  34. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js.map +1 -0
  35. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js +119 -0
  36. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js.map +1 -0
  37. package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +2 -0
  38. package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +2 -0
  39. package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +2 -0
  40. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js +166 -0
  41. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js.map +1 -0
  42. package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
  43. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js +22 -0
  44. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js.map +1 -0
  45. package/dist/cdn/chunks/de-BB3dgVOc.js +700 -0
  46. package/dist/cdn/chunks/de-BB3dgVOc.js.map +1 -0
  47. package/dist/cdn/chunks/de-BvYD17KT.js +89 -0
  48. package/dist/cdn/chunks/de-BvYD17KT.js.map +1 -0
  49. package/dist/cdn/chunks/dist-BF5c3Dr-.js +2 -0
  50. package/dist/cdn/chunks/dist-BGzvIxcJ.js +2 -0
  51. package/dist/cdn/chunks/dist-CFemF8rI.js +2 -0
  52. package/dist/cdn/chunks/dist-Co6uFhFK.js +2 -0
  53. package/dist/cdn/chunks/dist-DCikBY9K.js +2 -0
  54. package/dist/cdn/chunks/dist-DUILafAC.js +2 -0
  55. package/dist/cdn/chunks/dist-DghiKH0A.js +2 -0
  56. package/dist/cdn/chunks/dist-Dw8ckvfK.js +2 -0
  57. package/dist/cdn/chunks/dist-H07p0KAw.js +2 -0
  58. package/dist/cdn/chunks/dist-KYv9v_1z2.js +457 -0
  59. package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +1 -0
  60. package/dist/cdn/chunks/dist-MjnKIc0W.js +2 -0
  61. package/dist/cdn/chunks/dist-odp0vGRv.js +2 -0
  62. package/dist/cdn/chunks/draggable-BQNU47zu.js +11544 -0
  63. package/dist/cdn/chunks/{draggable-ClUwYCFL.js.map → draggable-BQNU47zu.js.map} +1 -1
  64. package/dist/cdn/chunks/emojiData-BVEJHcNH.js +19 -0
  65. package/dist/cdn/chunks/{emojiData-6fVLNqeH.js.map → emojiData-BVEJHcNH.js.map} +1 -1
  66. package/dist/cdn/chunks/en-CpotcOPr.js +89 -0
  67. package/dist/cdn/chunks/en-CpotcOPr.js.map +1 -0
  68. package/dist/cdn/chunks/en-DeDcpnoS.js +700 -0
  69. package/dist/cdn/chunks/en-DeDcpnoS.js.map +1 -0
  70. package/dist/cdn/chunks/extensions-Bj7USRLr.js +419 -0
  71. package/dist/cdn/chunks/{extensions-ea_ewKUl.js.map → extensions-Bj7USRLr.js.map} +1 -1
  72. package/dist/cdn/chunks/features-Ds0XUfte.js +6737 -0
  73. package/dist/cdn/chunks/features-Ds0XUfte.js.map +1 -0
  74. package/dist/cdn/chunks/icons-fWsuSvgd.js +653 -0
  75. package/dist/cdn/chunks/icons-fWsuSvgd.js.map +1 -0
  76. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js +3272 -0
  77. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +1 -0
  78. package/dist/cdn/chunks/media-library-BGQm_OyC.js +6005 -0
  79. package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +1 -0
  80. package/dist/cdn/chunks/pusher-DJPhQnE8.js +2505 -0
  81. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +1 -0
  82. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js +32 -0
  83. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -0
  84. package/dist/cdn/chunks/rolldown-runtime-DPITmOBR.js +20 -0
  85. package/dist/cdn/chunks/src-3i8rPuqd.js +494 -0
  86. package/dist/cdn/chunks/src-3i8rPuqd.js.map +1 -0
  87. package/dist/cdn/chunks/styleConstants-DFe3I4Op.js +57 -0
  88. package/dist/cdn/chunks/{styleConstants-CNejCb-L.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
  89. package/dist/cdn/chunks/styles-Dgijy53u.js +3350 -0
  90. package/dist/cdn/chunks/styles-Dgijy53u.js.map +1 -0
  91. package/dist/cdn/chunks/tiptap-BhxaWR8R.js +14208 -0
  92. package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-BhxaWR8R.js.map} +1 -1
  93. package/dist/cdn/editor.css +2 -1
  94. package/dist/cdn/editor.js +231 -1
  95. package/dist/cdn/editor.js.map +1 -1
  96. package/dist/{de-B4Ob4vCo.js → de-D7TLGIPA.js} +20 -4
  97. package/dist/{dist-DmpMJbmZ.js → dist-Ci5lFuUy.js} +1 -1
  98. package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
  99. package/dist/{extensions-CKM99njP.js → extensions-DWx_jj8v.js} +3 -3
  100. package/dist/{keys-Dwa2PmdD.js → keys-C0MQRs8d.js} +3 -3
  101. package/dist/readableTextColor-LDlmVEUv.js +30 -0
  102. package/dist/{styleConstants-D4SOZGBV.js → styleConstants-Cxw88naD.js} +5 -5
  103. package/dist/styles-fdXNRqI3.js +3556 -0
  104. package/dist/templatical-editor.css +1 -1
  105. package/dist/templatical-editor.js +122 -128
  106. package/dist/templatical-editor.umd.cjs +62 -71
  107. package/dist/{useEditorCore-Cc4RCwWq.js → useEditorCore-DUGD6pq_.js} +1247 -1088
  108. package/dist/{useI18n-DUirdXEX.js → useI18n-D6m7ZUgY.js} +1 -1
  109. package/dist/{useMergeTag-DVnlvPYJ.js → useMergeTag-BZ3X0bNr.js} +1 -1
  110. package/package.json +4 -2
  111. package/dist/CloudEditor-BDnHd6Um.js +0 -919
  112. package/dist/ParagraphEditor-DH8cSC6m.js +0 -625
  113. package/dist/TemplateScoringPanel-CTgMtc0-.js +0 -249
  114. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +0 -3
  115. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +0 -1
  116. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +0 -2
  117. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +0 -1
  118. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +0 -3
  119. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +0 -1
  120. package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
  121. package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
  122. package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
  123. package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
  124. package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
  125. package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
  126. package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
  127. package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
  128. package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
  129. package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
  130. package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
  131. package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
  132. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
  133. package/dist/cdn/chunks/extensions-ea_ewKUl.js +0 -2
  134. package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
  135. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
  136. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
  137. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +0 -2
  138. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
  139. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +0 -2
  140. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +0 -1
  141. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +0 -2
  142. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +0 -1
  143. package/dist/i18n-CJsFtdbZ.js +0 -23
  144. package/dist/styles-DSw1VNU3.js +0 -3406
@@ -1,14 +1,14 @@
1
1
  import "./timeouts-CmBrLeZA.js";
2
- import { f as e, r as t } from "./keys-Dwa2PmdD.js";
3
- import { t as n } from "./useI18n-DUirdXEX.js";
2
+ import { T as e, f as t, r as n } from "./keys-C0MQRs8d.js";
3
+ import { t as ee } from "./useI18n-D6m7ZUgY.js";
4
4
  import { n as r, t as i } from "./_plugin-vue_export-helper-B1-bu7yR.js";
5
- import { t as ee } from "./circle-alert-E2vYPs5r.js";
5
+ import { t as te } from "./circle-alert-E2vYPs5r.js";
6
6
  import { t as a } from "./image-up-X4xIq4ea.js";
7
7
  import { t as o } from "./x-CGlq2XQe.js";
8
- import { t as te } from "./LoadingTrack-vK8W2PJf.js";
9
- import { Transition as ne, computed as re, createBlock as ie, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, normalizeClass as ae, normalizeStyle as m, openBlock as h, ref as g, toDisplayString as _, unref as v, vModelText as y, watch as oe, withCtx as se, withDirectives as ce } from "vue";
10
- import { useDesignReference as le } from "@templatical/core/cloud";
11
- var ue = r("file-image", [
8
+ import { t as ne } from "./LoadingTrack-vK8W2PJf.js";
9
+ import { Transition as re, computed as ie, createBlock as ae, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as oe, normalizeStyle as p, openBlock as m, ref as h, toDisplayString as g, unref as _, vModelText as v, watch as se, withCtx as ce, withDirectives as le } from "vue";
10
+ import { useDesignReference as ue } from "@templatical/core/cloud";
11
+ var de = r("file-image", [
12
12
  ["path", {
13
13
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
14
14
  key: "1oefj6"
@@ -27,7 +27,7 @@ var ue = r("file-image", [
27
27
  d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",
28
28
  key: "wt3hpn"
29
29
  }]
30
- ]), b = r("file-text", [
30
+ ]), y = r("file-text", [
31
31
  ["path", {
32
32
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
33
33
  key: "1oefj6"
@@ -48,7 +48,7 @@ var ue = r("file-image", [
48
48
  d: "M16 17H8",
49
49
  key: "z1uh3a"
50
50
  }]
51
- ]), de = r("upload", [
51
+ ]), fe = r("upload", [
52
52
  ["path", {
53
53
  d: "M12 3v12",
54
54
  key: "1x0j5s"
@@ -61,10 +61,10 @@ var ue = r("file-image", [
61
61
  d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
62
62
  key: "ih7n3h"
63
63
  }]
64
- ]), fe = {
64
+ ]), pe = {
65
65
  key: 0,
66
66
  class: "tpl-design-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
67
- }, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, me = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, he = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, x = {
67
+ }, me = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, he = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, b = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, x = {
68
68
  key: 0,
69
69
  class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
70
70
  }, S = { class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3" }, C = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, w = {
@@ -90,11 +90,11 @@ var ue = r("file-image", [
90
90
  },
91
91
  emits: ["close", "apply"],
92
92
  setup(r, { emit: i }) {
93
- let f = r, z = i, { t: B } = n(), be = p(e), V = le({
94
- authManager: p(t),
93
+ let f = r, z = i, { t: B } = ee(), be = e(t, "DesignReferenceSidebar"), V = ue({
94
+ authManager: e(n, "DesignReferenceSidebar"),
95
95
  getTemplateId: () => be.state.template?.id ?? null,
96
96
  onApply: (e) => z("apply", e)
97
- }), H = g(null), U = g("image"), W = g(null), G = g(""), K = g(null), q = g(!1), J = g(!1), Y = re(() => V.isGenerating.value ? !1 : W.value !== null);
97
+ }), H = h(null), U = h("image"), W = h(null), G = h(""), K = h(null), q = h(!1), J = h(!1), Y = ie(() => V.isGenerating.value ? !1 : W.value !== null);
98
98
  function X(e) {
99
99
  U.value = e, Q();
100
100
  }
@@ -150,9 +150,9 @@ var ue = r("file-image", [
150
150
  function Te() {
151
151
  q.value = !1;
152
152
  }
153
- return oe(() => f.visible, (e) => {
153
+ return se(() => f.visible, (e) => {
154
154
  e || (q.value = !1);
155
- }), (e, t) => (h(), ie(ne, {
155
+ }), (e, t) => (m(), ae(re, {
156
156
  "enter-active-class": "tpl-design-slide-enter-active",
157
157
  "enter-from-class": "tpl:translate-x-full",
158
158
  "enter-to-class": "tpl:translate-x-0",
@@ -160,58 +160,58 @@ var ue = r("file-image", [
160
160
  "leave-from-class": "tpl:translate-x-0",
161
161
  "leave-to-class": "tpl:translate-x-full"
162
162
  }, {
163
- default: se(() => [r.visible ? (h(), c("div", fe, [l("div", pe, [l("div", me, [d(v(a), {
163
+ default: ce(() => [r.visible ? (m(), c("div", pe, [l("div", me, [l("div", he, [d(_(a), {
164
164
  size: 13,
165
165
  "stroke-width": 2
166
- }), l("span", null, _(v(B).designReference.title), 1)]), l("button", {
166
+ }), l("span", null, g(_(B).designReference.title), 1)]), l("button", {
167
167
  class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
168
168
  onClick: t[0] ||= (e) => z("close")
169
- }, [d(v(o), {
169
+ }, [d(_(o), {
170
170
  size: 14,
171
171
  "stroke-width": 2
172
- })])]), l("div", he, [v(V).isGenerating.value ? (h(), c("div", x, [l("div", S, [d(te), l("p", C, _(v(B).designReference.generating), 1)])])) : (h(), c("div", w, [
172
+ })])]), l("div", b, [_(V).isGenerating.value ? (m(), c("div", x, [l("div", S, [d(ne), l("p", C, g(_(B).designReference.generating), 1)])])) : (m(), c("div", w, [
173
173
  l("div", T, [l("button", {
174
174
  class: "tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
175
- style: m({
175
+ style: p({
176
176
  backgroundColor: U.value === "image" ? "var(--tpl-bg)" : "transparent",
177
177
  color: U.value === "image" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
178
178
  boxShadow: U.value === "image" ? "var(--tpl-shadow)" : "none"
179
179
  }),
180
180
  onClick: t[1] ||= (e) => X("image")
181
- }, [d(v(ue), {
181
+ }, [d(_(de), {
182
182
  size: 12,
183
183
  "stroke-width": 2
184
- }), u(" " + _(v(B).designReference.uploadImage), 1)], 4), l("button", {
184
+ }), u(" " + g(_(B).designReference.uploadImage), 1)], 4), l("button", {
185
185
  class: "tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
186
- style: m({
186
+ style: p({
187
187
  backgroundColor: U.value === "pdf" ? "var(--tpl-bg)" : "transparent",
188
188
  color: U.value === "pdf" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
189
189
  boxShadow: U.value === "pdf" ? "var(--tpl-shadow)" : "none"
190
190
  }),
191
191
  onClick: t[2] ||= (e) => X("pdf")
192
- }, [d(v(b), {
192
+ }, [d(_(y), {
193
193
  size: 12,
194
194
  "stroke-width": 2
195
- }), u(" " + _(v(B).designReference.uploadPdf), 1)], 4)]),
196
- l("div", null, [W.value ? (h(), c("div", E, [l("div", D, [K.value ? (h(), c("img", {
195
+ }), u(" " + g(_(B).designReference.uploadPdf), 1)], 4)]),
196
+ l("div", null, [W.value ? (m(), c("div", E, [l("div", D, [K.value ? (m(), c("img", {
197
197
  key: 0,
198
198
  src: K.value,
199
199
  alt: W.value.name,
200
200
  class: "tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"
201
- }, null, 8, O)) : (h(), c("div", k, [d(v(b), {
201
+ }, null, 8, O)) : (m(), c("div", k, [d(_(y), {
202
202
  size: 32,
203
203
  "stroke-width": 1.5,
204
204
  class: "tpl:text-[var(--tpl-text-dim)]"
205
- }), l("span", A, _(W.value.name), 1)])), l("button", {
205
+ }), l("span", A, g(W.value.name), 1)])), l("button", {
206
206
  class: "tpl:absolute tpl:top-2 tpl:right-2 tpl:rounded-full tpl:p-1 tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:shadow-[var(--tpl-shadow)]",
207
207
  onClick: Q
208
- }, [d(v(o), {
208
+ }, [d(_(o), {
209
209
  size: 12,
210
210
  "stroke-width": 2
211
- })])])])) : (h(), c("div", {
211
+ })])])])) : (m(), c("div", {
212
212
  key: 1,
213
213
  class: "tpl-design-dropzone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border-2 tpl:border-dashed tpl:px-4 tpl:py-8 tpl:transition-colors tpl:duration-150",
214
- style: m({
214
+ style: p({
215
215
  borderColor: J.value ? "var(--tpl-primary)" : "var(--tpl-border-light)",
216
216
  backgroundColor: J.value ? "var(--tpl-primary-light)" : "var(--tpl-bg)"
217
217
  }),
@@ -220,13 +220,13 @@ var ue = r("file-image", [
220
220
  onDragleave: Ce,
221
221
  onDrop: we
222
222
  }, [
223
- d(v(de), {
223
+ d(_(fe), {
224
224
  size: 24,
225
225
  "stroke-width": 1.5,
226
226
  class: "tpl:text-[var(--tpl-text-dim)]"
227
227
  }),
228
- l("span", j, _(v(B).designReference.dropHint), 1),
229
- l("span", M, _(U.value === "image" ? v(B).designReference.acceptedImages : v(B).designReference.acceptedPdf), 1)
228
+ l("span", j, g(_(B).designReference.dropHint), 1),
229
+ l("span", M, g(U.value === "image" ? _(B).designReference.acceptedImages : _(B).designReference.acceptedPdf), 1)
230
230
  ], 36)), l("input", {
231
231
  ref_key: "fileInput",
232
232
  ref: H,
@@ -235,39 +235,39 @@ var ue = r("file-image", [
235
235
  accept: U.value === "image" ? "image/png,image/jpeg,image/webp" : "application/pdf",
236
236
  onChange: xe
237
237
  }, null, 40, N)]),
238
- l("div", P, [l("label", F, _(v(B).designReference.promptLabel), 1), ce(l("textarea", {
238
+ l("div", P, [l("label", F, g(_(B).designReference.promptLabel), 1), le(l("textarea", {
239
239
  "onUpdate:modelValue": t[4] ||= (e) => G.value = e,
240
- class: ae(["tpl:min-h-[72px] tpl:w-full tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:font-sans tpl:text-sm tpl:outline-none tpl:transition-colors tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", ["tpl-design-prompt-input"]]),
241
- placeholder: v(B).designReference.promptPlaceholder,
240
+ class: oe(["tpl:min-h-[72px] tpl:w-full tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:font-sans tpl:text-sm tpl:outline-none tpl:transition-colors tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", ["tpl-design-prompt-input"]]),
241
+ placeholder: _(B).designReference.promptPlaceholder,
242
242
  rows: "3"
243
- }, null, 8, I), [[y, G.value]])]),
244
- q.value ? (h(), c("div", L, [l("p", R, _(v(B).designReference.replaceWarning), 1), l("div", ge, [l("button", {
243
+ }, null, 8, I), [[v, G.value]])]),
244
+ q.value ? (m(), c("div", L, [l("p", R, g(_(B).designReference.replaceWarning), 1), l("div", ge, [l("button", {
245
245
  class: "tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
246
246
  style: { "background-color": "transparent" },
247
247
  onClick: Te
248
- }, _(v(B).designReference.replaceCancel), 1), l("button", {
248
+ }, g(_(B).designReference.replaceCancel), 1), l("button", {
249
249
  class: "tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
250
250
  onClick: $
251
- }, _(v(B).designReference.replaceConfirm), 1)])])) : s("", !0),
252
- v(V).error.value ? (h(), c("div", _e, [d(v(ee), {
251
+ }, g(_(B).designReference.replaceConfirm), 1)])])) : s("", !0),
252
+ _(V).error.value ? (m(), c("div", _e, [d(_(te), {
253
253
  size: 14,
254
254
  "stroke-width": 2,
255
255
  class: "tpl:mt-0.5 tpl:shrink-0"
256
- }), l("span", null, _(v(B).designReference.error), 1)])) : s("", !0),
257
- q.value ? s("", !0) : (h(), c("button", {
256
+ }), l("span", null, g(_(B).designReference.error), 1)])) : s("", !0),
257
+ q.value ? s("", !0) : (m(), c("button", {
258
258
  key: 2,
259
259
  class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium 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)]",
260
260
  disabled: !Y.value,
261
261
  onClick: $
262
- }, [d(v(a), {
262
+ }, [d(_(a), {
263
263
  size: 16,
264
264
  "stroke-width": 2
265
- }), u(" " + _(v(B).designReference.generate), 1)], 8, ve)),
266
- l("p", ye, _(v(B).aiMenu.disclaimer), 1)
265
+ }), u(" " + g(_(B).designReference.generate), 1)], 8, ve)),
266
+ l("p", ye, g(_(B).aiMenu.disclaimer), 1)
267
267
  ]))])])) : s("", !0)]),
268
268
  _: 1
269
269
  }));
270
270
  }
271
- }), [["__scopeId", "data-v-1c8d2ac8"]]);
271
+ }), [["__scopeId", "data-v-d70ec3cf"]]);
272
272
  //#endregion
273
273
  export { z as default };
@@ -0,0 +1,205 @@
1
+ import "./useEditorCore-DUGD6pq_.js";
2
+ import { T as e, b as t, f as n } from "./keys-C0MQRs8d.js";
3
+ import { t as r } from "./useI18n-D6m7ZUgY.js";
4
+ import { n as i } from "./_plugin-vue_export-helper-B1-bu7yR.js";
5
+ import { n as a, t as o } from "./blockTypeIcons-BrKZB10B.js";
6
+ import { t as s } from "./trash-2-OwjZ-guZ.js";
7
+ import { t as ee } from "./x-CGlq2XQe.js";
8
+ import { t as te } from "./TplModal-C5_CF-qn.js";
9
+ import { Fragment as c, computed as l, createBlock as u, createCommentVNode as ne, createElementBlock as d, createElementVNode as f, createVNode as p, defineAsyncComponent as re, defineComponent as m, normalizeStyle as ie, openBlock as h, ref as g, renderList as _, resolveDynamicComponent as ae, toDisplayString as v, unref as y, vModelSelect as oe, vModelText as se, watch as ce, withCtx as le, withDirectives as b, withModifiers as x } from "vue";
10
+ var ue = i("search", [["path", {
11
+ d: "m21 21-4.34-4.34",
12
+ key: "14j7rj"
13
+ }], ["circle", {
14
+ cx: "11",
15
+ cy: "11",
16
+ r: "8",
17
+ key: "4ej97u"
18
+ }]]), de = {
19
+ role: "dialog",
20
+ "aria-modal": "true",
21
+ "aria-labelledby": "tpl-module-browser-title",
22
+ class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-[1000px] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
23
+ style: {
24
+ "background-color": "var(--tpl-bg-elevated)",
25
+ "box-shadow": "var(--tpl-shadow-xl)",
26
+ "max-height": "90vh"
27
+ }
28
+ }, fe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, pe = {
29
+ id: "tpl-module-browser-title",
30
+ class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
31
+ }, me = ["aria-label"], S = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, C = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, w = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, T = { class: "tpl:relative" }, E = ["placeholder"], D = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, O = {
32
+ key: 0,
33
+ class: "tpl:flex tpl:flex-col tpl:gap-1"
34
+ }, k = ["aria-pressed", "onClick"], A = { class: "tpl:flex tpl:items-center tpl:gap-2" }, j = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, M = { class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]" }, N = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, P = {
35
+ key: 0,
36
+ class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
37
+ }, F = ["aria-label", "onClick"], I = [
38
+ "aria-label",
39
+ "title",
40
+ "onClick"
41
+ ], L = {
42
+ key: 1,
43
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
44
+ }, R = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, z = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, he = {
45
+ key: 0,
46
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
47
+ }, ge = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, _e = {
48
+ key: 1,
49
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
50
+ }, ve = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, ye = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, be = { class: "tpl:flex tpl:items-center tpl:gap-2" }, xe = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Se = ["value"], Ce = { class: "tpl:flex tpl:gap-2" }, we = ["disabled"], B = /* @__PURE__ */ m({
51
+ __name: "ModuleBrowserModal",
52
+ props: { visible: { type: Boolean } },
53
+ emits: ["close", "insert"],
54
+ setup(i, { emit: m }) {
55
+ let B = i, V = m, Te = re(() => import("./ModulePreviewCanvas-Bmy6Y1WE.js")), { t: H } = r(), U = e(t, "ModuleBrowserModal"), W = e(n, "ModuleBrowserModal"), G = g(""), K = g(null), q = g(null), J = g("end"), Y = l(() => {
56
+ let e = U.modules.value;
57
+ if (!G.value) return e;
58
+ let t = G.value.toLowerCase();
59
+ return e.filter((e) => e.name.toLowerCase().includes(t));
60
+ }), X = l(() => K.value ? U.modules.value.find((e) => e.id === K.value) ?? null : null), Ee = l(() => {
61
+ let e = [{
62
+ value: "beginning",
63
+ label: H.modules.insertAtBeginning
64
+ }], t = W.content.value.blocks;
65
+ for (let n = 0; n < t.length; n++) {
66
+ let r = t[n], i = r.type, a = H.blocks[i] ?? r.type;
67
+ e.push({
68
+ value: r.id,
69
+ label: H.modules.insertAfterBlock.replace("{block}", `${a} ${n + 1}`)
70
+ });
71
+ }
72
+ return e.push({
73
+ value: "end",
74
+ label: H.modules.insertAtEnd
75
+ }), e;
76
+ }), De = l(() => {
77
+ if (J.value === "end") return;
78
+ if (J.value === "beginning") return 0;
79
+ let e = W.content.value.blocks.findIndex((e) => e.id === J.value);
80
+ if (e !== -1) return e + 1;
81
+ });
82
+ ce(() => B.visible, (e) => {
83
+ if (e) {
84
+ G.value = "", K.value = null, q.value = null;
85
+ let e = W.state.selectedBlockId;
86
+ e ? J.value = W.content.value.blocks.findIndex((t) => t.id === e) === -1 ? "end" : e : J.value = "end";
87
+ }
88
+ });
89
+ function Oe(e) {
90
+ let t = [], n = /* @__PURE__ */ new Set();
91
+ for (let r of e.content) if (!n.has(r.type) && o[r.type] && (n.add(r.type), t.push({
92
+ type: r.type,
93
+ icon: o[r.type]
94
+ })), t.length >= 5) break;
95
+ return t;
96
+ }
97
+ function Z(e) {
98
+ let t = new Set(e.content.map((e) => e.type));
99
+ return Math.max(0, t.size - 5);
100
+ }
101
+ async function ke(e) {
102
+ try {
103
+ await U.deleteModule(e), K.value === e && (K.value = null);
104
+ } finally {
105
+ q.value = null;
106
+ }
107
+ }
108
+ function Q() {
109
+ X.value && V("insert", X.value, De.value);
110
+ }
111
+ function $() {
112
+ V("close");
113
+ }
114
+ function Ae(e) {
115
+ e.key === "Escape" && $(), e.key === "Enter" && X.value && (e.preventDefault(), Q());
116
+ }
117
+ return (e, t) => (h(), u(te, {
118
+ visible: i.visible,
119
+ onClose: $,
120
+ onKeydown: Ae
121
+ }, {
122
+ default: le(() => [f("div", de, [
123
+ f("div", fe, [f("h3", pe, v(y(H).modules.browse), 1), f("button", {
124
+ "aria-label": y(H).modules.close,
125
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]",
126
+ onClick: $
127
+ }, [p(y(ee), {
128
+ size: 16,
129
+ "stroke-width": 2
130
+ })], 8, me)]),
131
+ f("div", S, [f("div", C, [f("div", w, [f("div", T, [p(y(ue), {
132
+ size: 14,
133
+ "stroke-width": 2,
134
+ class: "tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]"
135
+ }), b(f("input", {
136
+ "onUpdate:modelValue": t[0] ||= (e) => G.value = e,
137
+ type: "text",
138
+ placeholder: y(H).modules.search,
139
+ class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
140
+ }, null, 8, E), [[se, G.value]])])]), f("div", D, [Y.value.length > 0 ? (h(), d("div", O, [(h(!0), d(c, null, _(Y.value, (e) => (h(), d("button", {
141
+ key: e.id,
142
+ type: "button",
143
+ "aria-pressed": K.value === e.id,
144
+ class: "tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]",
145
+ style: ie({
146
+ borderColor: K.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
147
+ backgroundColor: K.value === e.id ? "var(--tpl-primary-light)" : "transparent"
148
+ }),
149
+ onClick: (t) => K.value = e.id
150
+ }, [f("div", A, [f("span", j, v(e.name), 1), f("span", M, v(y(H).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), f("div", N, [
151
+ (h(!0), d(c, null, _(Oe(e), (e) => (h(), u(ae(e.icon), {
152
+ key: e.type,
153
+ size: 14,
154
+ "stroke-width": 1.5,
155
+ class: "tpl:text-[var(--tpl-text-dim)]"
156
+ }))), 128)),
157
+ Z(e) > 0 ? (h(), d("span", P, " +" + v(Z(e)), 1)) : ne("", !0),
158
+ q.value === e.id ? (h(), d("button", {
159
+ key: 1,
160
+ "aria-label": y(H).modules.deleteConfirm,
161
+ class: "tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-100 tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]",
162
+ style: { "background-color": "transparent" },
163
+ onClick: x((t) => ke(e.id), ["stop"])
164
+ }, v(y(H).modules.deleteConfirm), 9, F)) : (h(), d("button", {
165
+ key: 2,
166
+ class: "tpl-module-delete-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]",
167
+ "aria-label": y(H).modules.delete,
168
+ title: y(H).modules.delete,
169
+ onClick: x((t) => q.value = e.id, ["stop"])
170
+ }, [p(y(s), {
171
+ size: 12,
172
+ "stroke-width": 1.5
173
+ })], 8, I))
174
+ ])], 12, k))), 128))])) : (h(), d("div", L, [p(y(a), {
175
+ size: 32,
176
+ "stroke-width": 1,
177
+ class: "tpl:text-[var(--tpl-text-dim)]"
178
+ }), f("p", R, v(G.value ? y(H).modules.noModules : y(H).modules.noModulesHint), 1)]))])]), f("div", z, [X.value ? (h(), d("div", he, [f("div", ge, [p(y(Te), { blocks: X.value.content }, null, 8, ["blocks"])])])) : (h(), d("div", _e, [p(y(a), {
179
+ size: 32,
180
+ "stroke-width": 1,
181
+ class: "tpl:text-[var(--tpl-text-dim)]"
182
+ }), f("p", ve, v(y(H).modules.selectToPreview), 1)]))])]),
183
+ f("div", ye, [f("div", be, [f("label", xe, v(y(H).modules.insertPosition), 1), b(f("select", {
184
+ "onUpdate:modelValue": t[1] ||= (e) => J.value = e,
185
+ class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
186
+ }, [(h(!0), d(c, null, _(Ee.value, (e) => (h(), d("option", {
187
+ key: e.value,
188
+ value: e.value
189
+ }, v(e.label), 9, Se))), 128))], 512), [[oe, J.value]])]), f("div", Ce, [f("button", {
190
+ type: "button",
191
+ class: "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)]",
192
+ onClick: $
193
+ }, v(y(H).modules.close), 1), f("button", {
194
+ type: "button",
195
+ 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)]",
196
+ disabled: !X.value,
197
+ onClick: Q
198
+ }, v(y(H).modules.insert), 9, we)])])
199
+ ])]),
200
+ _: 1
201
+ }, 8, ["visible"]));
202
+ }
203
+ });
204
+ //#endregion
205
+ export { B as default };
@@ -1,5 +1,5 @@
1
- import { P as e, _ as t, a as n, f as r, g as i, h as a, i as o, m as s, n as c, p as l, r as u, u as d, v as f, y as p } from "./useEditorCore-Cc4RCwWq.js";
2
- import { o as m } from "./keys-Dwa2PmdD.js";
1
+ import { P as e, _ as t, a as n, f as r, g as i, h as a, i as o, m as s, n as c, p as l, r as u, u as d, v as f, y as p } from "./useEditorCore-DUGD6pq_.js";
2
+ import { o as m } from "./keys-C0MQRs8d.js";
3
3
  import { Fragment as h, computed as g, createBlock as _, createElementBlock as v, createElementVNode as y, defineComponent as b, inject as x, normalizeStyle as S, openBlock as C, renderList as w, resolveComponent as T, resolveDynamicComponent as E, unref as D } from "vue";
4
4
  //#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
5
5
  var O = { class: "tpl:w-full" }, k = { class: "tpl:flex tpl:gap-0" }, A = /* @__PURE__ */ b({