@aswin.dev/editor 0.6.3 → 0.7.1

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 (85) hide show
  1. package/README.md +3 -3
  2. package/dist/AccessibilityPanel-COL6Wm7p.js +108 -0
  3. package/dist/AiChatSidebar-DWGPVtvC.js +229 -0
  4. package/dist/AiFeatureMenu-duUFSfDf.js +63 -0
  5. package/dist/BlockA11yBadge-Qs6HtXid.js +34 -0
  6. package/dist/CloudEditor-CFldoCOb.js +1207 -0
  7. package/dist/CollaboratorBar-Bw-lbt61.js +95 -0
  8. package/dist/CommentsSidebar-BaD5F53-.js +436 -0
  9. package/dist/CountdownBlock-DaYGxKqo.js +92 -0
  10. package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
  11. package/dist/DesignReferenceSidebar-BSH7uNP_.js +276 -0
  12. package/dist/LoadingTrack-Ba2pfF57.js +10 -0
  13. package/dist/ModuleBrowserModal-6phxZSKI.js +206 -0
  14. package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
  15. package/dist/NumberWithSuffix-BpUzQOJt.js +422 -0
  16. package/dist/ParagraphEditor-DNSzAB-I.js +695 -0
  17. package/dist/RichTextEditorContent-CrqPQdnk.js +137 -0
  18. package/dist/SaveModuleDialog-zMQTpez7.js +123 -0
  19. package/dist/SnapshotHistory-Do-A5rYU.js +122 -0
  20. package/dist/TemplateScoringPanel-CS7o62zS.js +256 -0
  21. package/dist/TestEmailModal-DGj_9V1u.js +94 -0
  22. package/dist/TitleEditor-C7IDnAoS.js +172 -0
  23. package/dist/TplModal-BAsVzcTb.js +44 -0
  24. package/dist/_plugin-vue_export-helper-BVAJ4lgT.js +8 -0
  25. package/dist/accessibility-BU09xZrQ.js +27 -0
  26. package/dist/blockTypeIcons-C6LDKvmd.js +140 -0
  27. package/dist/bundle-stats.json +10 -0
  28. package/dist/check-DJrpDKO_.js +7 -0
  29. package/dist/chevron-down-C5oBUhT8.js +7 -0
  30. package/dist/chevron-right-BqCptpdp.js +10 -0
  31. package/dist/circle-alert-ZQQc98HC.js +25 -0
  32. package/dist/clock-ik2pRJKG.js +12 -0
  33. package/dist/cloud-6ZmAvF0j.js +1791 -0
  34. package/dist/createLucideIcon-ClREiSx3.js +43 -0
  35. package/dist/de-DWcgp-7T.js +729 -0
  36. package/dist/de-GOtR9DwW.js +207 -0
  37. package/dist/dist-BUzw1buG.js +35 -0
  38. package/dist/dist-BZyY-SS4.js +74 -0
  39. package/dist/dist-BadNx4qo.js +5 -0
  40. package/dist/dist-BesOh2mk.js +35 -0
  41. package/dist/dist-Bz3M4RXG.js +2082 -0
  42. package/dist/dist-C04s_fLA.js +563 -0
  43. package/dist/dist-C3T2AKtB.js +776 -0
  44. package/dist/dist-C9ckKEZL.js +519 -0
  45. package/dist/dist-CBItRG-Z.js +47 -0
  46. package/dist/dist-COSzWQUs.js +5 -0
  47. package/dist/dist-CivF9P8b.js +382 -0
  48. package/dist/dist-DXa1uAMh.js +10658 -0
  49. package/dist/dist-DtiDUrX-.js +189 -0
  50. package/dist/dist-Dzt5foyL.js +61 -0
  51. package/dist/emojiData-DrBuvEoP.js +17 -0
  52. package/dist/en-Cxd4fhNm.js +729 -0
  53. package/dist/en-dFFQVzNn.js +207 -0
  54. package/dist/extensions-D__hOlV1.js +799 -0
  55. package/dist/formatRelativeTime-BhhO8yCl.js +12 -0
  56. package/dist/image-up-DT7gcJLN.js +23 -0
  57. package/dist/index.d.ts +352 -0
  58. package/dist/info-BSPGcsSM.js +19 -0
  59. package/dist/keys-CvX8D-8C.js +10 -0
  60. package/dist/liquid.browser-BvCyLQII.js +3277 -0
  61. package/dist/loader-circle-Balo8p3d.js +7 -0
  62. package/dist/message-circle-B39qAHxs.js +7 -0
  63. package/dist/pencil-BZJPNYWR.js +10 -0
  64. package/dist/readableTextColor-DVuzNX1y.js +30 -0
  65. package/dist/refresh-cw-DwDqGUM0.js +29 -0
  66. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  67. package/dist/scan-line-CzfFJO1o.js +25 -0
  68. package/dist/send-D2eSo4GH.js +10 -0
  69. package/dist/shield-check-jkpgcC0-.js +10 -0
  70. package/dist/sparkles-Chm5CZfb.js +23 -0
  71. package/dist/style.css +2 -0
  72. package/dist/styleConstants-34eUKPOZ.js +55 -0
  73. package/dist/styles-B4tjX5SP.js +5224 -0
  74. package/dist/templatical-editor.js +312 -0
  75. package/dist/text-align-start-CzBnJsW8.js +43 -0
  76. package/dist/timeouts-BSGxjuUF.js +4 -0
  77. package/dist/trash-2-CtK2apEH.js +25 -0
  78. package/dist/triangle-alert-KpDVNbpn.js +17 -0
  79. package/dist/useCloudI18n-DOKSZql1.js +23 -0
  80. package/dist/useEditorCore-wslttMH-.js +9517 -0
  81. package/dist/useI18n-C2xQZ6K9.js +17 -0
  82. package/dist/useMergeTag-DX0XG5V9.js +34 -0
  83. package/dist/vue.runtime.esm-bundler-CjauPXjj.js +5775 -0
  84. package/dist/x-BkaOMosX.js +10 -0
  85. package/package.json +10 -10
@@ -0,0 +1,210 @@
1
+ import { At as e, C as t, F as n, Ft as r, N as i, U as a, b as o, f as s, g as c, h as l, m as u, st as d, v as f, x as p } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
+ import { t as m } from "./useI18n-C2xQZ6K9.js";
3
+ import { f as h } from "./styleConstants-34eUKPOZ.js";
4
+ import { i as g, n as _, r as v, t as y } from "./NumberWithSuffix-BpUzQOJt.js";
5
+ //#region src/components/toolbar/CheckboxItem.vue?vue&type=script&setup=true&lang.ts
6
+ var b = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, x = ["checked"], S = /* @__PURE__ */ t({
7
+ __name: "CheckboxItem",
8
+ props: {
9
+ modelValue: { type: Boolean },
10
+ label: {}
11
+ },
12
+ emits: ["update:modelValue"],
13
+ setup(e, { emit: t }) {
14
+ let n = t;
15
+ return (t, a) => (i(), f("label", b, [l("input", {
16
+ type: "checkbox",
17
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
18
+ checked: e.modelValue,
19
+ onChange: a[0] ||= (e) => n("update:modelValue", e.target.checked)
20
+ }, null, 40, x), o(" " + r(e.label), 1)]));
21
+ }
22
+ }), C = ["value"], w = ["value"], T = ["value"], E = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, D = ["value"], O = { value: "" }, k = ["value"], A = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, j = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, M = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, N = [
23
+ "value",
24
+ "placeholder",
25
+ "onInput"
26
+ ], P = ["value", "placeholder"], F = ["value"], I = /* @__PURE__ */ t({
27
+ __name: "CountdownToolbar",
28
+ props: {
29
+ block: {},
30
+ fontFamilies: {}
31
+ },
32
+ emits: ["update"],
33
+ setup(t, { emit: o }) {
34
+ let b = o, { t: x } = m(), I = [
35
+ "UTC",
36
+ "America/New_York",
37
+ "America/Chicago",
38
+ "America/Denver",
39
+ "America/Los_Angeles",
40
+ "Europe/London",
41
+ "Europe/Berlin",
42
+ "Europe/Paris",
43
+ "Europe/Moscow",
44
+ "Asia/Dubai",
45
+ "Asia/Kolkata",
46
+ "Asia/Shanghai",
47
+ "Asia/Tokyo",
48
+ "Australia/Sydney",
49
+ "Pacific/Auckland"
50
+ ], L = [
51
+ {
52
+ value: ":",
53
+ label: ":"
54
+ },
55
+ {
56
+ value: "-",
57
+ label: "-"
58
+ },
59
+ {
60
+ value: " ",
61
+ label: "␣"
62
+ }
63
+ ], R = [
64
+ "Days",
65
+ "Hours",
66
+ "Minutes",
67
+ "Seconds"
68
+ ], z = u(() => R.map((e) => ({
69
+ unit: e,
70
+ showKey: `show${e}`,
71
+ labelKey: `label${e}`,
72
+ translationKey: e.toLowerCase()
73
+ })));
74
+ function B(e, t) {
75
+ b("update", { [e]: t });
76
+ }
77
+ return (o, u) => (i(), f(s, null, [
78
+ p(_, { label: d(x).countdown.targetDate }, {
79
+ default: a(() => [l("input", {
80
+ type: "datetime-local",
81
+ class: e(d(h)),
82
+ value: t.block.targetDate,
83
+ onInput: u[0] ||= (e) => B("targetDate", e.target.value)
84
+ }, null, 42, C)]),
85
+ _: 1
86
+ }, 8, ["label"]),
87
+ p(_, { label: d(x).countdown.timezone }, {
88
+ default: a(() => [l("select", {
89
+ class: e(d(h)),
90
+ value: t.block.timezone,
91
+ onChange: u[1] ||= (e) => B("timezone", e.target.value)
92
+ }, [(i(), f(s, null, n(I, (e) => l("option", {
93
+ key: e,
94
+ value: e
95
+ }, r(e), 9, T)), 64))], 42, w)]),
96
+ _: 1
97
+ }, 8, ["label"]),
98
+ p(_, { label: d(x).countdown.display }, {
99
+ default: a(() => [l("div", E, [(i(!0), f(s, null, n(z.value, (e) => (i(), c(S, {
100
+ key: e.unit,
101
+ "model-value": t.block[e.showKey],
102
+ label: d(x).countdown[e.translationKey],
103
+ "onUpdate:modelValue": (t) => B(e.showKey, t)
104
+ }, null, 8, [
105
+ "model-value",
106
+ "label",
107
+ "onUpdate:modelValue"
108
+ ]))), 128))])]),
109
+ _: 1
110
+ }, 8, ["label"]),
111
+ p(_, { label: d(x).countdown.separator }, {
112
+ default: a(() => [p(v, {
113
+ options: L,
114
+ "model-value": t.block.separator,
115
+ "onUpdate:modelValue": u[2] ||= (e) => B("separator", e)
116
+ }, null, 8, ["model-value"])]),
117
+ _: 1
118
+ }, 8, ["label"]),
119
+ p(_, { label: d(x).countdown.fontFamily }, {
120
+ default: a(() => [l("select", {
121
+ class: e(d(h)),
122
+ value: t.block.fontFamily || "",
123
+ onChange: u[3] ||= (e) => B("fontFamily", e.target.value || void 0)
124
+ }, [l("option", O, r(d(x).countdown.inheritFont), 1), (i(!0), f(s, null, n(t.fontFamilies, (e) => (i(), f("option", {
125
+ key: e.value,
126
+ value: e.value
127
+ }, r(e.label), 9, k))), 128))], 42, D)]),
128
+ _: 1
129
+ }, 8, ["label"]),
130
+ l("div", A, [p(_, { label: d(x).countdown.digitFontSize }, {
131
+ default: a(() => [p(y, {
132
+ "model-value": t.block.digitFontSize,
133
+ min: 12,
134
+ max: 72,
135
+ suffix: "px",
136
+ "onUpdate:modelValue": u[4] ||= (e) => B("digitFontSize", e)
137
+ }, null, 8, ["model-value"])]),
138
+ _: 1
139
+ }, 8, ["label"]), p(_, { label: d(x).countdown.labelFontSize }, {
140
+ default: a(() => [p(y, {
141
+ "model-value": t.block.labelFontSize,
142
+ min: 8,
143
+ max: 24,
144
+ suffix: "px",
145
+ "onUpdate:modelValue": u[5] ||= (e) => B("labelFontSize", e)
146
+ }, null, 8, ["model-value"])]),
147
+ _: 1
148
+ }, 8, ["label"])]),
149
+ l("div", j, [p(_, { label: d(x).countdown.digitColor }, {
150
+ default: a(() => [p(g, {
151
+ "model-value": t.block.digitColor,
152
+ "onUpdate:modelValue": u[6] ||= (e) => B("digitColor", e)
153
+ }, null, 8, ["model-value"])]),
154
+ _: 1
155
+ }, 8, ["label"]), p(_, { label: d(x).countdown.labelColor }, {
156
+ default: a(() => [p(g, {
157
+ "model-value": t.block.labelColor,
158
+ "onUpdate:modelValue": u[7] ||= (e) => B("labelColor", e)
159
+ }, null, 8, ["model-value"])]),
160
+ _: 1
161
+ }, 8, ["label"])]),
162
+ p(_, { label: d(x).countdown.background }, {
163
+ default: a(() => [p(g, {
164
+ "model-value": t.block.backgroundColor,
165
+ "onUpdate:modelValue": u[8] ||= (e) => B("backgroundColor", e)
166
+ }, null, 8, ["model-value"])]),
167
+ _: 1
168
+ }, 8, ["label"]),
169
+ p(_, { label: d(x).countdown.labels }, {
170
+ default: a(() => [l("div", M, [(i(!0), f(s, null, n(z.value, (n) => (i(), f("input", {
171
+ key: n.unit,
172
+ type: "text",
173
+ class: e(d(h)),
174
+ value: t.block[n.labelKey],
175
+ placeholder: d(x).countdown[n.translationKey],
176
+ onInput: (e) => B(n.labelKey, e.target.value)
177
+ }, null, 42, N))), 128))])]),
178
+ _: 1
179
+ }, 8, ["label"]),
180
+ p(_, { label: d(x).countdown.expiry }, {
181
+ default: a(() => [l("input", {
182
+ type: "text",
183
+ class: e(d(h)),
184
+ value: t.block.expiredMessage,
185
+ placeholder: d(x).countdown.expiredMessagePlaceholder,
186
+ onInput: u[9] ||= (e) => B("expiredMessage", e.target.value)
187
+ }, null, 42, P)]),
188
+ _: 1
189
+ }, 8, ["label"]),
190
+ p(_, { label: d(x).countdown.expiredImageUrl }, {
191
+ default: a(() => [l("input", {
192
+ type: "url",
193
+ class: e(d(h)),
194
+ value: t.block.expiredImageUrl,
195
+ placeholder: "https://...",
196
+ onInput: u[10] ||= (e) => B("expiredImageUrl", e.target.value)
197
+ }, null, 42, F)]),
198
+ _: 1
199
+ }, 8, ["label"]),
200
+ p(S, {
201
+ "model-value": t.block.hideOnExpiry,
202
+ label: d(x).countdown.hideOnExpiry,
203
+ class: "tpl:mb-3.5",
204
+ "onUpdate:modelValue": u[11] ||= (e) => B("hideOnExpiry", e)
205
+ }, null, 8, ["model-value", "label"])
206
+ ], 64));
207
+ }
208
+ });
209
+ //#endregion
210
+ export { I as default };
@@ -0,0 +1,276 @@
1
+ import { A as e, At as t, C as n, Ft as r, N as i, U as ee, V as a, W as te, _ as o, b as s, c as ne, et as c, g as re, h as l, jt as u, m as ie, st as d, t as ae, v as f, x as p } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
+ import "./timeouts-BSGxjuUF.js";
3
+ import { A as m, i as oe, m as h } from "./keys-CvX8D-8C.js";
4
+ import { t as g } from "./createLucideIcon-ClREiSx3.js";
5
+ import { t as se } from "./circle-alert-ZQQc98HC.js";
6
+ import { t as _ } from "./image-up-DT7gcJLN.js";
7
+ import { t as v } from "./x-BkaOMosX.js";
8
+ import { t as ce } from "./LoadingTrack-Ba2pfF57.js";
9
+ import { t as y } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
10
+ import { n as le } from "./useCloudI18n-DOKSZql1.js";
11
+ import { u as ue } from "./cloud-6ZmAvF0j.js";
12
+ var de = g("file-image", [
13
+ ["path", {
14
+ 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",
15
+ key: "1oefj6"
16
+ }],
17
+ ["path", {
18
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
19
+ key: "wfsgrz"
20
+ }],
21
+ ["circle", {
22
+ cx: "10",
23
+ cy: "12",
24
+ r: "2",
25
+ key: "737tya"
26
+ }],
27
+ ["path", {
28
+ d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",
29
+ key: "wt3hpn"
30
+ }]
31
+ ]), b = g("file-text", [
32
+ ["path", {
33
+ 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",
34
+ key: "1oefj6"
35
+ }],
36
+ ["path", {
37
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
38
+ key: "wfsgrz"
39
+ }],
40
+ ["path", {
41
+ d: "M10 9H8",
42
+ key: "b1mrlr"
43
+ }],
44
+ ["path", {
45
+ d: "M16 13H8",
46
+ key: "t4e002"
47
+ }],
48
+ ["path", {
49
+ d: "M16 17H8",
50
+ key: "z1uh3a"
51
+ }]
52
+ ]), fe = g("upload", [
53
+ ["path", {
54
+ d: "M12 3v12",
55
+ key: "1x0j5s"
56
+ }],
57
+ ["path", {
58
+ d: "m17 8-5-5-5 5",
59
+ key: "7q97r8"
60
+ }],
61
+ ["path", {
62
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
63
+ key: "ih7n3h"
64
+ }]
65
+ ]), pe = {
66
+ key: 0,
67
+ 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)]"
68
+ }, 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)]" }, x = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, S = {
69
+ key: 0,
70
+ class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
71
+ }, 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 = {
72
+ key: 1,
73
+ class: "tpl:flex tpl:flex-col tpl:gap-4"
74
+ }, E = { class: "tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, D = {
75
+ key: 0,
76
+ class: "tpl:flex tpl:flex-col tpl:gap-2"
77
+ }, 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 = {
78
+ key: 1,
79
+ class: "tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2"
80
+ }, 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 = {
81
+ key: 0,
82
+ 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)]"
83
+ }, ge = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]" }, _e = { class: "tpl:flex tpl:gap-2" }, ve = {
84
+ key: 1,
85
+ 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)]"
86
+ }, ye = ["disabled"], be = { class: "tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, z = /* @__PURE__ */ y(/* @__PURE__ */ n({
87
+ __name: "DesignReferenceSidebar",
88
+ props: {
89
+ visible: { type: Boolean },
90
+ hasExistingBlocks: { type: Boolean }
91
+ },
92
+ emits: ["close", "apply"],
93
+ setup(n, { emit: g }) {
94
+ let y = n, z = g, { t: B } = le(), xe = m(h, "DesignReferenceSidebar"), V = ue({
95
+ authManager: m(oe, "DesignReferenceSidebar"),
96
+ getTemplateId: () => xe.state.template?.id ?? null,
97
+ onApply: (e) => z("apply", e)
98
+ }), H = c(null), U = c("image"), W = c(null), G = c(""), K = c(null), q = c(!1), J = c(!1), Y = ie(() => V.isGenerating.value ? !1 : W.value !== null);
99
+ function X(e) {
100
+ U.value = e, Q();
101
+ }
102
+ function Se(e) {
103
+ let t = e.target, n = t.files?.[0];
104
+ n && Z(n), t.value = "";
105
+ }
106
+ function Z(e) {
107
+ if (e.size > 10485760) {
108
+ V.error.value = B.designReference.fileTooLarge;
109
+ return;
110
+ }
111
+ if (U.value === "image") {
112
+ if (![
113
+ "image/png",
114
+ "image/jpeg",
115
+ "image/jpg",
116
+ "image/webp"
117
+ ].includes(e.type)) {
118
+ V.error.value = B.designReference.invalidFileType;
119
+ return;
120
+ }
121
+ } else if (U.value === "pdf" && e.type !== "application/pdf") {
122
+ V.error.value = B.designReference.invalidFileType;
123
+ return;
124
+ }
125
+ W.value = e, V.error.value = null, K.value && URL.revokeObjectURL(K.value), e.type.startsWith("image/") ? K.value = URL.createObjectURL(e) : K.value = null;
126
+ }
127
+ function Q() {
128
+ K.value &&= (URL.revokeObjectURL(K.value), null), W.value = null;
129
+ }
130
+ function Ce(e) {
131
+ e.preventDefault(), J.value = !0;
132
+ }
133
+ function we() {
134
+ J.value = !1;
135
+ }
136
+ function Te(e) {
137
+ e.preventDefault(), J.value = !1;
138
+ let t = e.dataTransfer?.files?.[0];
139
+ t && Z(t);
140
+ }
141
+ function $() {
142
+ if (!Y.value) return;
143
+ if (y.hasExistingBlocks && !q.value) {
144
+ q.value = !0;
145
+ return;
146
+ }
147
+ q.value = !1;
148
+ let e = {};
149
+ 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), V.generate(e);
150
+ }
151
+ function Ee() {
152
+ q.value = !1;
153
+ }
154
+ return a(() => y.visible, (e) => {
155
+ e || (q.value = !1);
156
+ }), e(() => {
157
+ K.value &&= (URL.revokeObjectURL(K.value), null);
158
+ }), (e, a) => (i(), re(ae, {
159
+ "enter-active-class": "tpl-design-slide-enter-active",
160
+ "enter-from-class": "tpl:translate-x-full",
161
+ "enter-to-class": "tpl:translate-x-0",
162
+ "leave-active-class": "tpl-design-slide-leave-active",
163
+ "leave-from-class": "tpl:translate-x-0",
164
+ "leave-to-class": "tpl:translate-x-full"
165
+ }, {
166
+ default: ee(() => [n.visible ? (i(), f("div", pe, [l("div", me, [l("div", he, [p(d(_), {
167
+ size: 13,
168
+ "stroke-width": 2
169
+ }), l("span", null, r(d(B).designReference.title), 1)]), l("button", {
170
+ class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
171
+ onClick: a[0] ||= (e) => z("close")
172
+ }, [p(d(v), {
173
+ size: 14,
174
+ "stroke-width": 2
175
+ })])]), l("div", x, [d(V).isGenerating.value ? (i(), f("div", S, [l("div", C, [p(ce), l("p", w, r(d(B).designReference.generating), 1)])])) : (i(), f("div", T, [
176
+ l("div", E, [l("button", {
177
+ 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",
178
+ style: u({
179
+ backgroundColor: U.value === "image" ? "var(--tpl-bg)" : "transparent",
180
+ color: U.value === "image" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
181
+ boxShadow: U.value === "image" ? "var(--tpl-shadow)" : "none"
182
+ }),
183
+ onClick: a[1] ||= (e) => X("image")
184
+ }, [p(d(de), {
185
+ size: 12,
186
+ "stroke-width": 2
187
+ }), s(" " + r(d(B).designReference.uploadImage), 1)], 4), l("button", {
188
+ 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",
189
+ style: u({
190
+ backgroundColor: U.value === "pdf" ? "var(--tpl-bg)" : "transparent",
191
+ color: U.value === "pdf" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
192
+ boxShadow: U.value === "pdf" ? "var(--tpl-shadow)" : "none"
193
+ }),
194
+ onClick: a[2] ||= (e) => X("pdf")
195
+ }, [p(d(b), {
196
+ size: 12,
197
+ "stroke-width": 2
198
+ }), s(" " + r(d(B).designReference.uploadPdf), 1)], 4)]),
199
+ l("div", null, [W.value ? (i(), f("div", D, [l("div", O, [K.value ? (i(), f("img", {
200
+ key: 0,
201
+ src: K.value,
202
+ alt: W.value.name,
203
+ class: "tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"
204
+ }, null, 8, k)) : (i(), f("div", A, [p(d(b), {
205
+ size: 32,
206
+ "stroke-width": 1.5,
207
+ class: "tpl:text-[var(--tpl-text-dim)]"
208
+ }), l("span", j, r(W.value.name), 1)])), l("button", {
209
+ 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)]",
210
+ onClick: Q
211
+ }, [p(d(v), {
212
+ size: 12,
213
+ "stroke-width": 2
214
+ })])])])) : (i(), f("div", {
215
+ key: 1,
216
+ 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",
217
+ style: u({
218
+ borderColor: J.value ? "var(--tpl-primary)" : "var(--tpl-border-light)",
219
+ backgroundColor: J.value ? "var(--tpl-primary-light)" : "var(--tpl-bg)"
220
+ }),
221
+ onClick: a[3] ||= (e) => H.value?.click(),
222
+ onDragover: Ce,
223
+ onDragleave: we,
224
+ onDrop: Te
225
+ }, [
226
+ p(d(fe), {
227
+ size: 24,
228
+ "stroke-width": 1.5,
229
+ class: "tpl:text-[var(--tpl-text-dim)]"
230
+ }),
231
+ l("span", M, r(d(B).designReference.dropHint), 1),
232
+ l("span", N, r(U.value === "image" ? d(B).designReference.acceptedImages : d(B).designReference.acceptedPdf), 1)
233
+ ], 36)), l("input", {
234
+ ref_key: "fileInput",
235
+ ref: H,
236
+ type: "file",
237
+ class: "tpl:hidden",
238
+ accept: U.value === "image" ? "image/png,image/jpeg,image/webp" : "application/pdf",
239
+ onChange: Se
240
+ }, null, 40, P)]),
241
+ l("div", F, [l("label", I, r(d(B).designReference.promptLabel), 1), te(l("textarea", {
242
+ "onUpdate:modelValue": a[4] ||= (e) => G.value = e,
243
+ class: t(["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"]]),
244
+ placeholder: d(B).designReference.promptPlaceholder,
245
+ rows: "3"
246
+ }, null, 8, L), [[ne, G.value]])]),
247
+ q.value ? (i(), f("div", R, [l("p", ge, r(d(B).designReference.replaceWarning), 1), l("div", _e, [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:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
249
+ style: { "background-color": "transparent" },
250
+ onClick: Ee
251
+ }, r(d(B).designReference.replaceCancel), 1), l("button", {
252
+ 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)]",
253
+ onClick: $
254
+ }, r(d(B).designReference.replaceConfirm), 1)])])) : o("", !0),
255
+ d(V).error.value ? (i(), f("div", ve, [p(d(se), {
256
+ size: 14,
257
+ "stroke-width": 2,
258
+ class: "tpl:mt-0.5 tpl:shrink-0"
259
+ }), l("span", null, r(d(B).designReference.error), 1)])) : o("", !0),
260
+ q.value ? o("", !0) : (i(), f("button", {
261
+ key: 2,
262
+ 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)]",
263
+ disabled: !Y.value,
264
+ onClick: $
265
+ }, [p(d(_), {
266
+ size: 16,
267
+ "stroke-width": 2
268
+ }), s(" " + r(d(B).designReference.generate), 1)], 8, ye)),
269
+ l("p", be, r(d(B).aiMenu.disclaimer), 1)
270
+ ]))])])) : o("", !0)]),
271
+ _: 1
272
+ }));
273
+ }
274
+ }), [["__scopeId", "data-v-b9358bf2"]]);
275
+ //#endregion
276
+ export { z as default };
@@ -0,0 +1,10 @@
1
+ import { N as e, v as t } from "./vue.runtime.esm-bundler-CjauPXjj.js";
2
+ import { t as n } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
3
+ //#region src/components/LoadingTrack.vue
4
+ var r = {}, i = { class: "tpl-loading-track" };
5
+ function a(n, r) {
6
+ return e(), t("div", i);
7
+ }
8
+ var o = /* @__PURE__ */ n(r, [["render", a], ["__scopeId", "data-v-1ed538ec"]]);
9
+ //#endregion
10
+ export { o as t };