@templatical/editor 0.0.1 → 0.0.2

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 (130) hide show
  1. package/dist/AiChatSidebar-XBj5Rw2l.js +214 -0
  2. package/dist/AiFeatureMenu-my1mZ9DL.js +63 -0
  3. package/dist/CloudEditor-BVjgKwq3.js +940 -0
  4. package/dist/CollaboratorBar-BZq_Gv38.js +91 -0
  5. package/dist/CommentsSidebar-D9oxqO6l.js +439 -0
  6. package/dist/DesignReferenceSidebar-CyHq4SWt.js +272 -0
  7. package/dist/LoadingTrack-vK8W2PJf.js +10 -0
  8. package/dist/ModuleBrowserModal-Cus2Hdwl.js +205 -0
  9. package/dist/ModulePreviewCanvas-DaByXKY_.js +106 -0
  10. package/dist/ParagraphEditor-BSyk5B6S.js +670 -0
  11. package/dist/RichTextEditorContent-BRpjJ6SV.js +133 -0
  12. package/dist/SaveModuleDialog-BIZBQrd8.js +122 -0
  13. package/dist/SnapshotHistory-Ds1-QNbx.js +126 -0
  14. package/dist/TemplateScoringPanel-C8XSk_Ys.js +249 -0
  15. package/dist/TestEmailModal-CCVfaFgV.js +94 -0
  16. package/dist/TitleEditor-V4qaEULF.js +167 -0
  17. package/dist/TplModal-LT3FXlgs.js +44 -0
  18. package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
  19. package/dist/blockTypeIcons-BujoY5Dl.js +126 -0
  20. package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js +3 -0
  21. package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js.map +1 -0
  22. package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js +2 -0
  23. package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js.map +1 -0
  24. package/dist/cdn/chunks/TitleEditor-CC3Adjai.js +3 -0
  25. package/dist/cdn/chunks/TitleEditor-CC3Adjai.js.map +1 -0
  26. package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
  27. package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
  28. package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
  29. package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
  30. package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
  31. package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
  32. package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
  33. package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
  34. package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
  35. package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
  36. package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
  37. package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
  38. package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
  39. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
  40. package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
  41. package/dist/cdn/chunks/extensions-BfjbWqOx.js +2 -0
  42. package/dist/cdn/chunks/extensions-BfjbWqOx.js.map +1 -0
  43. package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
  44. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
  45. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
  46. package/dist/cdn/chunks/styleConstants-UTJ94gco.js +2 -0
  47. package/dist/cdn/chunks/styleConstants-UTJ94gco.js.map +1 -0
  48. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
  49. package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
  50. package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js +2 -0
  51. package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js.map +1 -0
  52. package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js +2 -0
  53. package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js.map +1 -0
  54. package/dist/cdn/editor.css +1 -0
  55. package/dist/cdn/editor.js +2 -0
  56. package/dist/cdn/editor.js.map +1 -0
  57. package/dist/check-B7kDuZmP.js +7 -0
  58. package/dist/chevron-down-DJLW2Q9Z.js +7 -0
  59. package/dist/circle-alert-E2vYPs5r.js +25 -0
  60. package/dist/clock-lWIIQA3C.js +12 -0
  61. package/dist/de-B4Ob4vCo.js +682 -0
  62. package/dist/dist-4LiM9FDd.js +35 -0
  63. package/dist/dist-Bu7veieH.js +776 -0
  64. package/dist/dist-C1BIRHCQ.js +61 -0
  65. package/dist/dist-CG-vEqSU.js +314 -0
  66. package/dist/dist-C_ymrGFi.js +10625 -0
  67. package/dist/dist-ChAGLpWo.js +35 -0
  68. package/dist/dist-DNjZKe2Z.js +513 -0
  69. package/dist/dist-D_HQYSY-.js +189 -0
  70. package/dist/dist-DkypH7qG.js +5 -0
  71. package/dist/dist-DmOE-Ubp.js +74 -0
  72. package/dist/dist-DrvKRSU6.js +47 -0
  73. package/dist/dist-Dxnd0GRf.js +5 -0
  74. package/dist/dist-DysAFIPy.js +2054 -0
  75. package/dist/emojiData-BfWQS72m.js +17 -0
  76. package/dist/en-YXsspZJG.js +682 -0
  77. package/dist/extensions-BA4NshZQ.js +420 -0
  78. package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
  79. package/dist/i18n-ikyi28RU.js +23 -0
  80. package/dist/image-up-X4xIq4ea.js +23 -0
  81. package/dist/keys-8B5MFafK.js +4 -0
  82. package/dist/liquid.browser-BemTg3sZ.js +3272 -0
  83. package/dist/loader-circle-BTQQxC3l.js +7 -0
  84. package/dist/message-circle-Blgm6V_h.js +7 -0
  85. package/dist/refresh-cw-Bb4PEeW1.js +44 -0
  86. package/dist/scan-line-7lZPfOdm.js +25 -0
  87. package/dist/send-C0ltAQrv.js +10 -0
  88. package/dist/shield-check-f-qv4RKs.js +10 -0
  89. package/dist/sparkles-KhBCGlqB.js +23 -0
  90. package/dist/styleConstants-CgtFM9hQ.js +43 -0
  91. package/dist/styles-hQgJKM4i.js +3406 -0
  92. package/dist/templatical-editor.css +2 -1
  93. package/dist/templatical-editor.js +242 -9
  94. package/dist/templatical-editor.umd.cjs +112 -524
  95. package/dist/timeouts-CmBrLeZA.js +4 -0
  96. package/dist/trash-2-OwjZ-guZ.js +25 -0
  97. package/dist/triangle-alert-DOSRIUYZ.js +17 -0
  98. package/dist/useEditorCore-DVp5qmtC.js +5552 -0
  99. package/dist/useI18n-DzH4KXDk.js +17 -0
  100. package/dist/useMergeTag-D9zQVE-e.js +33 -0
  101. package/dist/x-CGlq2XQe.js +10 -0
  102. package/package.json +30 -20
  103. package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
  104. package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
  105. package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
  106. package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
  107. package/dist/CommentsSidebar-PVUlloyB.js +0 -655
  108. package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
  109. package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
  110. package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
  111. package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
  112. package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
  113. package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
  114. package/dist/TestEmailModal-Cwre5elw.js +0 -128
  115. package/dist/TextEditor-BuUOIByX.js +0 -780
  116. package/dist/de-BWIAblxs.js +0 -685
  117. package/dist/en-cYyUzNV1.js +0 -685
  118. package/dist/index-0tWUczNu.js +0 -47
  119. package/dist/index-4okvXjqk.js +0 -41
  120. package/dist/index-BSc6h5zo.js +0 -967
  121. package/dist/index-CrvwWlhN.js +0 -41
  122. package/dist/index-D-iD-7lO.js +0 -10961
  123. package/dist/index-D-ygXbc8.js +0 -2452
  124. package/dist/index-DbrWKz-e.js +0 -1415
  125. package/dist/index-DeUeHy6g.js +0 -422
  126. package/dist/index-Ude6e9RU.js +0 -41
  127. package/dist/index-ZQzHBwkr.js +0 -12767
  128. package/dist/liquid.browser-CeNxS2GL.js +0 -3493
  129. package/dist/loader-circle-tM9j2mRh.js +0 -13
  130. package/dist/shield-check-Ngi9jAQc.js +0 -20
@@ -0,0 +1,272 @@
1
+ import "./timeouts-CmBrLeZA.js";
2
+ import { f as e, r as t } from "./keys-8B5MFafK.js";
3
+ import { t as n } from "./useI18n-DzH4KXDk.js";
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";
6
+ import { t as a } from "./image-up-X4xIq4ea.js";
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", [
12
+ ["path", {
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
+ key: "1oefj6"
15
+ }],
16
+ ["path", {
17
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
18
+ key: "wfsgrz"
19
+ }],
20
+ ["circle", {
21
+ cx: "10",
22
+ cy: "12",
23
+ r: "2",
24
+ key: "737tya"
25
+ }],
26
+ ["path", {
27
+ d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",
28
+ key: "wt3hpn"
29
+ }]
30
+ ]), b = r("file-text", [
31
+ ["path", {
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
+ key: "1oefj6"
34
+ }],
35
+ ["path", {
36
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
37
+ key: "wfsgrz"
38
+ }],
39
+ ["path", {
40
+ d: "M10 9H8",
41
+ key: "b1mrlr"
42
+ }],
43
+ ["path", {
44
+ d: "M16 13H8",
45
+ key: "t4e002"
46
+ }],
47
+ ["path", {
48
+ d: "M16 17H8",
49
+ key: "z1uh3a"
50
+ }]
51
+ ]), de = r("upload", [
52
+ ["path", {
53
+ d: "M12 3v12",
54
+ key: "1x0j5s"
55
+ }],
56
+ ["path", {
57
+ d: "m17 8-5-5-5 5",
58
+ key: "7q97r8"
59
+ }],
60
+ ["path", {
61
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
62
+ key: "ih7n3h"
63
+ }]
64
+ ]), fe = {
65
+ key: 0,
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)]" }, x = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, S = {
68
+ key: 0,
69
+ class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
70
+ }, C = { class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3" }, w = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, T = {
71
+ key: 1,
72
+ class: "tpl:flex tpl:flex-col tpl:gap-4"
73
+ }, E = { class: "tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, D = {
74
+ key: 0,
75
+ class: "tpl:flex tpl:flex-col tpl:gap-2"
76
+ }, O = { class: "tpl:relative tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, k = ["src", "alt"], A = {
77
+ key: 1,
78
+ class: "tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2"
79
+ }, j = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, M = { class: "tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, N = { class: "tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, P = ["accept"], F = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, I = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, L = ["placeholder"], R = {
80
+ key: 0,
81
+ class: "tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:px-3 tpl:py-3 tpl:bg-[var(--tpl-warning-light)] tpl:border tpl:border-[var(--tpl-warning)]"
82
+ }, z = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]" }, he = { class: "tpl:flex tpl:gap-2" }, ge = {
83
+ key: 1,
84
+ class: "tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
85
+ }, _e = ["disabled"], ve = { class: "tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, B = /* @__PURE__ */ i(/* @__PURE__ */ f({
86
+ __name: "DesignReferenceSidebar",
87
+ props: {
88
+ visible: { type: Boolean },
89
+ hasExistingBlocks: { type: Boolean }
90
+ },
91
+ emits: ["close", "apply"],
92
+ setup(r, { emit: i }) {
93
+ let f = r, B = i, { t: V } = n(), ye = p(e), H = le({
94
+ authManager: p(t),
95
+ getTemplateId: () => ye.state.template?.id ?? null,
96
+ onApply: (e) => B("apply", e)
97
+ }), U = g("image"), W = g(null), G = g(""), K = g(null), q = g(!1), J = g(!1), Y = re(() => H.isGenerating.value ? !1 : W.value !== null);
98
+ function X(e) {
99
+ U.value = e, Q();
100
+ }
101
+ function be(e) {
102
+ let t = e.target, n = t.files?.[0];
103
+ n && Z(n), t.value = "";
104
+ }
105
+ function Z(e) {
106
+ if (e.size > 10485760) {
107
+ H.error.value = V.designReference.fileTooLarge;
108
+ return;
109
+ }
110
+ if (U.value === "image") {
111
+ if (![
112
+ "image/png",
113
+ "image/jpeg",
114
+ "image/jpg",
115
+ "image/webp"
116
+ ].includes(e.type)) {
117
+ H.error.value = V.designReference.invalidFileType;
118
+ return;
119
+ }
120
+ } else if (U.value === "pdf" && e.type !== "application/pdf") {
121
+ H.error.value = V.designReference.invalidFileType;
122
+ return;
123
+ }
124
+ W.value = e, H.error.value = null, K.value && URL.revokeObjectURL(K.value), e.type.startsWith("image/") ? K.value = URL.createObjectURL(e) : K.value = null;
125
+ }
126
+ function Q() {
127
+ K.value &&= (URL.revokeObjectURL(K.value), null), W.value = null;
128
+ }
129
+ function xe(e) {
130
+ e.preventDefault(), J.value = !0;
131
+ }
132
+ function Se() {
133
+ J.value = !1;
134
+ }
135
+ function Ce(e) {
136
+ e.preventDefault(), J.value = !1;
137
+ let t = e.dataTransfer?.files?.[0];
138
+ t && Z(t);
139
+ }
140
+ function $() {
141
+ if (!Y.value) return;
142
+ if (f.hasExistingBlocks && !q.value) {
143
+ q.value = !0;
144
+ return;
145
+ }
146
+ q.value = !1;
147
+ let e = {};
148
+ G.value.trim() && (e.prompt = G.value.trim()), U.value === "image" && W.value ? e.imageUpload = W.value : U.value === "pdf" && W.value && (e.pdfUpload = W.value), H.generate(e);
149
+ }
150
+ function we() {
151
+ q.value = !1;
152
+ }
153
+ return oe(() => f.visible, (e) => {
154
+ e || (q.value = !1);
155
+ }), (e, t) => (h(), ie(ne, {
156
+ "enter-active-class": "tpl-design-slide-enter-active",
157
+ "enter-from-class": "tpl:translate-x-full",
158
+ "enter-to-class": "tpl:translate-x-0",
159
+ "leave-active-class": "tpl-design-slide-leave-active",
160
+ "leave-from-class": "tpl:translate-x-0",
161
+ "leave-to-class": "tpl:translate-x-full"
162
+ }, {
163
+ default: se(() => [r.visible ? (h(), c("div", fe, [l("div", pe, [l("div", me, [d(v(a), {
164
+ size: 13,
165
+ "stroke-width": 2
166
+ }), l("span", null, _(v(V).designReference.title), 1)]), l("button", {
167
+ class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
168
+ onClick: t[0] ||= (e) => B("close")
169
+ }, [d(v(o), {
170
+ size: 14,
171
+ "stroke-width": 2
172
+ })])]), l("div", x, [v(H).isGenerating.value ? (h(), c("div", S, [l("div", C, [d(te), l("p", w, _(v(V).designReference.generating), 1)])])) : (h(), c("div", T, [
173
+ l("div", E, [l("button", {
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({
176
+ backgroundColor: U.value === "image" ? "var(--tpl-bg)" : "transparent",
177
+ color: U.value === "image" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
178
+ boxShadow: U.value === "image" ? "var(--tpl-shadow)" : "none"
179
+ }),
180
+ onClick: t[1] ||= (e) => X("image")
181
+ }, [d(v(ue), {
182
+ size: 12,
183
+ "stroke-width": 2
184
+ }), u(" " + _(v(V).designReference.uploadImage), 1)], 4), l("button", {
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({
187
+ backgroundColor: U.value === "pdf" ? "var(--tpl-bg)" : "transparent",
188
+ color: U.value === "pdf" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
189
+ boxShadow: U.value === "pdf" ? "var(--tpl-shadow)" : "none"
190
+ }),
191
+ onClick: t[2] ||= (e) => X("pdf")
192
+ }, [d(v(b), {
193
+ size: 12,
194
+ "stroke-width": 2
195
+ }), u(" " + _(v(V).designReference.uploadPdf), 1)], 4)]),
196
+ l("div", null, [W.value ? (h(), c("div", D, [l("div", O, [K.value ? (h(), c("img", {
197
+ key: 0,
198
+ src: K.value,
199
+ alt: W.value.name,
200
+ class: "tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"
201
+ }, null, 8, k)) : (h(), c("div", A, [d(v(b), {
202
+ size: 32,
203
+ "stroke-width": 1.5,
204
+ class: "tpl:text-[var(--tpl-text-dim)]"
205
+ }), l("span", j, _(W.value.name), 1)])), l("button", {
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
+ onClick: Q
208
+ }, [d(v(o), {
209
+ size: 12,
210
+ "stroke-width": 2
211
+ })])])])) : (h(), c("div", {
212
+ key: 1,
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({
215
+ borderColor: J.value ? "var(--tpl-primary)" : "var(--tpl-border-light)",
216
+ backgroundColor: J.value ? "var(--tpl-primary-light)" : "var(--tpl-bg)"
217
+ }),
218
+ onClick: t[3] ||= (t) => e.$refs.fileInput?.click(),
219
+ onDragover: xe,
220
+ onDragleave: Se,
221
+ onDrop: Ce
222
+ }, [
223
+ d(v(de), {
224
+ size: 24,
225
+ "stroke-width": 1.5,
226
+ class: "tpl:text-[var(--tpl-text-dim)]"
227
+ }),
228
+ l("span", M, _(v(V).designReference.dropHint), 1),
229
+ l("span", N, _(U.value === "image" ? v(V).designReference.acceptedImages : v(V).designReference.acceptedPdf), 1)
230
+ ], 36)), l("input", {
231
+ ref: "fileInput",
232
+ type: "file",
233
+ class: "tpl:hidden",
234
+ accept: U.value === "image" ? "image/png,image/jpeg,image/webp" : "application/pdf",
235
+ onChange: be
236
+ }, null, 40, P)]),
237
+ l("div", F, [l("label", I, _(v(V).designReference.promptLabel), 1), ce(l("textarea", {
238
+ "onUpdate:modelValue": t[4] ||= (e) => G.value = e,
239
+ 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"]]),
240
+ placeholder: v(V).designReference.promptPlaceholder,
241
+ rows: "3"
242
+ }, null, 8, L), [[y, G.value]])]),
243
+ q.value ? (h(), c("div", R, [l("p", z, _(v(V).designReference.replaceWarning), 1), l("div", he, [l("button", {
244
+ 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)]",
245
+ style: { "background-color": "transparent" },
246
+ onClick: we
247
+ }, _(v(V).designReference.replaceCancel), 1), l("button", {
248
+ 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)]",
249
+ onClick: $
250
+ }, _(v(V).designReference.replaceConfirm), 1)])])) : s("", !0),
251
+ v(H).error.value ? (h(), c("div", ge, [d(v(ee), {
252
+ size: 14,
253
+ "stroke-width": 2,
254
+ class: "tpl:mt-0.5 tpl:shrink-0"
255
+ }), l("span", null, _(v(V).designReference.error), 1)])) : s("", !0),
256
+ q.value ? s("", !0) : (h(), c("button", {
257
+ key: 2,
258
+ 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)]",
259
+ disabled: !Y.value,
260
+ onClick: $
261
+ }, [d(v(a), {
262
+ size: 16,
263
+ "stroke-width": 2
264
+ }), u(" " + _(v(V).designReference.generate), 1)], 8, _e)),
265
+ l("p", ve, _(v(V).aiMenu.disclaimer), 1)
266
+ ]))])])) : s("", !0)]),
267
+ _: 1
268
+ }));
269
+ }
270
+ }), [["__scopeId", "data-v-0b1509fc"]]);
271
+ //#endregion
272
+ export { B as default };
@@ -0,0 +1,10 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B1-bu7yR.js";
2
+ import { createElementBlock as t, openBlock as n } from "vue";
3
+ //#region src/components/LoadingTrack.vue
4
+ var r = {}, i = { class: "tpl-loading-track" };
5
+ function a(e, r) {
6
+ return n(), t("div", i);
7
+ }
8
+ var o = /* @__PURE__ */ e(r, [["render", a], ["__scopeId", "data-v-1ed538ec"]]);
9
+ //#endregion
10
+ export { o as t };
@@ -0,0 +1,205 @@
1
+ import "./useEditorCore-DVp5qmtC.js";
2
+ import { f as e, y as t } from "./keys-8B5MFafK.js";
3
+ import { t as n } from "./useI18n-DzH4KXDk.js";
4
+ import { n as r } from "./_plugin-vue_export-helper-B1-bu7yR.js";
5
+ import { n as i, t as a } from "./blockTypeIcons-BujoY5Dl.js";
6
+ import { t as ee } from "./trash-2-OwjZ-guZ.js";
7
+ import { t as te } from "./x-CGlq2XQe.js";
8
+ import { t as ne } from "./TplModal-LT3FXlgs.js";
9
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as re, createElementBlock as l, createElementVNode as u, createVNode as d, defineAsyncComponent as ie, defineComponent as f, inject as p, normalizeStyle as ae, openBlock as m, ref as h, renderList as g, resolveDynamicComponent as oe, toDisplayString as _, unref as v, vModelSelect as se, vModelText as ce, watch as le, withCtx as ue, withDirectives as y, withModifiers as b } from "vue";
10
+ var de = r("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
+ }]]), fe = {
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
+ }, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, me = {
29
+ id: "tpl-module-browser-title",
30
+ class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
31
+ }, he = ["aria-label"], x = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, S = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, C = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, w = { class: "tpl:relative" }, T = ["placeholder"], E = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, D = {
32
+ key: 0,
33
+ class: "tpl:flex tpl:flex-col tpl:gap-1"
34
+ }, O = ["aria-pressed", "onClick"], k = { class: "tpl:flex tpl:items-center tpl:gap-2" }, A = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, j = { 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)]" }, M = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, N = {
35
+ key: 0,
36
+ class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
37
+ }, P = ["aria-label", "onClick"], F = [
38
+ "aria-label",
39
+ "title",
40
+ "onClick"
41
+ ], I = {
42
+ key: 1,
43
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
44
+ }, L = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, R = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, ge = {
45
+ key: 0,
46
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
47
+ }, _e = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, z = {
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__ */ f({
51
+ __name: "ModuleBrowserModal",
52
+ props: { visible: { type: Boolean } },
53
+ emits: ["close", "insert"],
54
+ setup(r, { emit: f }) {
55
+ let B = r, V = f, Te = ie(() => import("./ModulePreviewCanvas-DaByXKY_.js")), { t: H } = n(), U = p(t), W = p(e), G = h(""), K = h(null), q = h(null), J = h("end"), Y = s(() => {
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 = s(() => K.value ? U.modules.value.find((e) => e.id === K.value) ?? null : null), Ee = s(() => {
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 = s(() => {
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
+ le(() => 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) && a[r.type] && (n.add(r.type), t.push({
92
+ type: r.type,
93
+ icon: a[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) => (m(), c(ne, {
118
+ visible: r.visible,
119
+ onClose: $,
120
+ onKeydown: Ae
121
+ }, {
122
+ default: ue(() => [u("div", fe, [
123
+ u("div", pe, [u("h3", me, _(v(H).modules.browse), 1), u("button", {
124
+ "aria-label": v(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
+ }, [d(v(te), {
128
+ size: 16,
129
+ "stroke-width": 2
130
+ })], 8, he)]),
131
+ u("div", x, [u("div", S, [u("div", C, [u("div", w, [d(v(de), {
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
+ }), y(u("input", {
136
+ "onUpdate:modelValue": t[0] ||= (e) => G.value = e,
137
+ type: "text",
138
+ placeholder: v(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, T), [[ce, G.value]])])]), u("div", E, [Y.value.length > 0 ? (m(), l("div", D, [(m(!0), l(o, null, g(Y.value, (e) => (m(), l("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: ae({
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
+ }, [u("div", k, [u("span", A, _(e.name), 1), u("span", j, _(v(H).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), u("div", M, [
151
+ (m(!0), l(o, null, g(Oe(e), (e) => (m(), c(oe(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 ? (m(), l("span", N, " +" + _(Z(e)), 1)) : re("", !0),
158
+ q.value === e.id ? (m(), l("button", {
159
+ key: 1,
160
+ "aria-label": v(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: b((t) => ke(e.id), ["stop"])
164
+ }, _(v(H).modules.deleteConfirm), 9, P)) : (m(), l("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": v(H).modules.delete,
168
+ title: v(H).modules.delete,
169
+ onClick: b((t) => q.value = e.id, ["stop"])
170
+ }, [d(v(ee), {
171
+ size: 12,
172
+ "stroke-width": 1.5
173
+ })], 8, F))
174
+ ])], 12, O))), 128))])) : (m(), l("div", I, [d(v(i), {
175
+ size: 32,
176
+ "stroke-width": 1,
177
+ class: "tpl:text-[var(--tpl-text-dim)]"
178
+ }), u("p", L, _(G.value ? v(H).modules.noModules : v(H).modules.noModulesHint), 1)]))])]), u("div", R, [X.value ? (m(), l("div", ge, [u("div", _e, [d(v(Te), { blocks: X.value.content }, null, 8, ["blocks"])])])) : (m(), l("div", z, [d(v(i), {
179
+ size: 32,
180
+ "stroke-width": 1,
181
+ class: "tpl:text-[var(--tpl-text-dim)]"
182
+ }), u("p", ve, _(v(H).modules.selectToPreview), 1)]))])]),
183
+ u("div", ye, [u("div", be, [u("label", xe, _(v(H).modules.insertPosition), 1), y(u("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
+ }, [(m(!0), l(o, null, g(Ee.value, (e) => (m(), l("option", {
187
+ key: e.value,
188
+ value: e.value
189
+ }, _(e.label), 9, Se))), 128))], 512), [[se, J.value]])]), u("div", Ce, [u("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(H).modules.close), 1), u("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(H).modules.insert), 9, we)])])
199
+ ])]),
200
+ _: 1
201
+ }, 8, ["visible"]));
202
+ }
203
+ });
204
+ //#endregion
205
+ export { B as default };
@@ -0,0 +1,106 @@
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-DVp5qmtC.js";
2
+ import { o as m } from "./keys-8B5MFafK.js";
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
+ //#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
5
+ var O = { class: "tpl:w-full" }, k = { class: "tpl:flex tpl:gap-0" }, A = /* @__PURE__ */ b({
6
+ name: "PreviewSectionBlock",
7
+ __name: "PreviewSectionBlock",
8
+ props: {
9
+ block: {},
10
+ viewport: {}
11
+ },
12
+ setup(b) {
13
+ let A = {
14
+ title: d,
15
+ paragraph: s,
16
+ image: i,
17
+ video: c,
18
+ button: e,
19
+ divider: f,
20
+ social: n,
21
+ menu: a,
22
+ table: u,
23
+ spacer: o,
24
+ html: t,
25
+ custom: p
26
+ }, j = b, M = x(m), N = g(() => {
27
+ switch (j.block.columns) {
28
+ case "2": return ["50%", "50%"];
29
+ case "3": return [
30
+ "33.33%",
31
+ "33.33%",
32
+ "33.33%"
33
+ ];
34
+ case "1-2": return ["33.33%", "66.67%"];
35
+ case "2-1": return ["66.67%", "33.33%"];
36
+ default: return ["100%"];
37
+ }
38
+ }), P = g(() => {
39
+ let e = N.value.length, t = [...j.block.children];
40
+ for (; t.length < e;) t.push([]);
41
+ return t.slice(0, e);
42
+ });
43
+ function F(e) {
44
+ return P.value[e] || [];
45
+ }
46
+ function I(e) {
47
+ return l(e, M, A);
48
+ }
49
+ return (e, t) => {
50
+ let n = T("PreviewSectionBlock", !0);
51
+ return C(), v("div", O, [y("div", k, [(C(!0), v(h, null, w(P.value, (e, t) => (C(), v("div", {
52
+ key: t,
53
+ style: S({ width: N.value[t] })
54
+ }, [(C(!0), v(h, null, w(F(t), (e) => (C(), v("div", {
55
+ key: e.id,
56
+ style: S(D(r)(e))
57
+ }, [e.type === "section" ? (C(), _(n, {
58
+ key: 0,
59
+ block: e,
60
+ viewport: "desktop"
61
+ }, null, 8, ["block"])) : (C(), _(E(I(e)), {
62
+ key: 1,
63
+ block: e,
64
+ viewport: "desktop"
65
+ }, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
66
+ };
67
+ }
68
+ }), j = {
69
+ class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg",
70
+ style: {
71
+ "background-color": "var(--tpl-canvas-bg)",
72
+ "box-shadow": "var(--tpl-shadow-sm)"
73
+ }
74
+ }, M = /* @__PURE__ */ b({
75
+ __name: "ModulePreviewCanvas",
76
+ props: { blocks: {} },
77
+ setup(g) {
78
+ let y = x(m), b = {
79
+ section: A,
80
+ title: d,
81
+ paragraph: s,
82
+ image: i,
83
+ video: c,
84
+ button: e,
85
+ divider: f,
86
+ social: n,
87
+ menu: a,
88
+ table: u,
89
+ spacer: o,
90
+ html: t,
91
+ custom: p
92
+ };
93
+ function T(e) {
94
+ return l(e, y, b);
95
+ }
96
+ return (e, t) => (C(), v("div", j, [(C(!0), v(h, null, w(g.blocks, (e) => (C(), v("div", {
97
+ key: e.id,
98
+ style: S(D(r)(e))
99
+ }, [(C(), _(E(T(e)), {
100
+ block: e,
101
+ viewport: "desktop"
102
+ }, null, 8, ["block"]))], 4))), 128))]));
103
+ }
104
+ });
105
+ //#endregion
106
+ export { M as default };