@aswin.dev/editor 0.6.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/AccessibilityPanel-CvQGLdu6.js +108 -0
  2. package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
  3. package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
  4. package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
  5. package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
  6. package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
  7. package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
  8. package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
  9. package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
  10. package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
  11. package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
  12. package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
  13. package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
  14. package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
  15. package/dist/ParagraphEditor-D75wl3BX.js +695 -0
  16. package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
  17. package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
  18. package/dist/SnapshotHistory-BR3eV120.js +127 -0
  19. package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
  20. package/dist/TestEmailModal--ue5w9fT.js +94 -0
  21. package/dist/TitleEditor-fStSADI-.js +172 -0
  22. package/dist/TplModal-BwSfxIHf.js +44 -0
  23. package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
  24. package/dist/accessibility-e8JYu_zd.js +27 -0
  25. package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
  26. package/dist/bundle-stats.json +10 -0
  27. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
  28. package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
  29. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
  30. package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
  31. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
  32. package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
  33. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
  34. package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
  35. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
  36. package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
  37. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
  38. package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
  39. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
  40. package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
  41. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
  42. package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
  43. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
  44. package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
  45. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
  46. package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
  47. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
  48. package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
  49. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
  50. package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
  51. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
  52. package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
  53. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
  54. package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
  55. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
  56. package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
  57. package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
  58. package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
  59. package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
  60. package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
  61. package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
  62. package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
  63. package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
  64. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  65. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
  66. package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
  67. package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
  68. package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
  69. package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
  70. package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
  71. package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
  72. package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
  73. package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
  74. package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
  75. package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
  76. package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
  77. package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
  78. package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
  79. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
  80. package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
  81. package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
  82. package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
  83. package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
  84. package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
  85. package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
  86. package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
  87. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
  88. package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
  89. package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
  90. package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
  91. package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
  92. package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
  93. package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
  94. package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
  95. package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
  96. package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
  97. package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
  98. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
  99. package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
  100. package/dist/cdn/editor.css +2 -0
  101. package/dist/cdn/editor.js +250 -0
  102. package/dist/cdn/editor.js.map +1 -0
  103. package/dist/check-Da05j8yl.js +7 -0
  104. package/dist/chevron-down-R2uY34iD.js +7 -0
  105. package/dist/circle-alert-DZuGWPX-.js +25 -0
  106. package/dist/clock-CRp2sIub.js +12 -0
  107. package/dist/cloud-DEk_b4CR.js +1733 -0
  108. package/dist/createLucideIcon-C3pa2siy.js +43 -0
  109. package/dist/de-Brqvgr43.js +521 -0
  110. package/dist/de-DCaaCE5s.js +207 -0
  111. package/dist/dist-B1IR0bpH.js +326 -0
  112. package/dist/dist-BFawx6IS.js +519 -0
  113. package/dist/dist-BaQIYPsn.js +35 -0
  114. package/dist/dist-Cp0zXPAD.js +189 -0
  115. package/dist/dist-D6uC2xhi.js +5 -0
  116. package/dist/dist-D90y8dvT.js +2082 -0
  117. package/dist/dist-DDJIWTRY.js +776 -0
  118. package/dist/dist-DJmnUmW9.js +362 -0
  119. package/dist/dist-DjviJBCi.js +74 -0
  120. package/dist/dist-KoBJjK1G.js +61 -0
  121. package/dist/dist-aRzjfSRN.js +35 -0
  122. package/dist/dist-iLBdeBDR.js +10658 -0
  123. package/dist/dist-us-RpCWN.js +47 -0
  124. package/dist/dist-wzMIGj-D.js +5 -0
  125. package/dist/emojiData-PQyVa4bU.js +17 -0
  126. package/dist/en-DXCyK4-X.js +207 -0
  127. package/dist/en-WDVp87TE.js +521 -0
  128. package/dist/extensions-CUcl9Ok4.js +799 -0
  129. package/dist/formatRelativeTime-BOEf47hq.js +12 -0
  130. package/dist/image-up-MBZKKg9p.js +23 -0
  131. package/dist/index.d.ts +275 -0
  132. package/dist/info-CJEC7piy.js +19 -0
  133. package/dist/keys-ciNfSSGj.js +10 -0
  134. package/dist/liquid.browser-CdMv1BTn.js +3277 -0
  135. package/dist/loader-circle-DsY5Yg33.js +7 -0
  136. package/dist/message-circle-yElBbR2C.js +7 -0
  137. package/dist/readableTextColor-CY3SiRnt.js +30 -0
  138. package/dist/refresh-cw-CE_AGtn8.js +29 -0
  139. package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
  140. package/dist/scan-line-D0vcUekt.js +25 -0
  141. package/dist/send-DH4oDQqC.js +10 -0
  142. package/dist/shield-check-CfJgs2Hd.js +10 -0
  143. package/dist/sparkles-CvRXGqFs.js +23 -0
  144. package/dist/style.css +2 -0
  145. package/dist/styleConstants-fWzlIIwN.js +55 -0
  146. package/dist/styles-DEXEkBvg.js +3176 -0
  147. package/dist/templatical-editor.js +249 -0
  148. package/dist/text-align-start-BT9VUDxK.js +43 -0
  149. package/dist/timeouts-BSGxjuUF.js +4 -0
  150. package/dist/trash-2-DbP2Y6t2.js +25 -0
  151. package/dist/triangle-alert-aOXceTSe.js +17 -0
  152. package/dist/useCloudI18n-BuIwR6OE.js +23 -0
  153. package/dist/useEditorCore-C6ost42Q.js +9342 -0
  154. package/dist/useI18n-lb2DHDiu.js +17 -0
  155. package/dist/useMergeTag-CBwKnnNB.js +34 -0
  156. package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
  157. package/dist/x-u2oVmjN_.js +10 -0
  158. package/package.json +1 -1
@@ -0,0 +1,497 @@
1
+ import { $ as e, F as t, H as n, N as r, P as i, S as a, _ as o, at as s, b as c, ct as l, d as u, g as d, h as f, j as ee, lt as p, m, n as h, p as g, r as _, st as v, u as te, w as y, y as b } from "./draggable-Bcb86AsV.js";
2
+ import { O as x, Ot as ne, St as re, w as S } from "./features-DEMb13KS.js";
3
+ import { A as ie, B as ae, R as oe, W as se, b as ce } from "./icons-CsLTcirh.js";
4
+ import { a as le, c as ue, d as C, f as w, h as T, i as E, l as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P } from "./media-library-CVaNvhpM.js";
5
+ //#region ../media-library/src/standalone/MediaLibrary.vue?vue&type=script&setup=true&lang.ts
6
+ var F = {
7
+ class: "tpl tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
8
+ style: {
9
+ width: "100%",
10
+ height: "100%",
11
+ "background-color": "var(--tpl-bg-elevated)",
12
+ border: "1px solid var(--tpl-border)"
13
+ }
14
+ }, I = {
15
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
16
+ style: { "border-color": "var(--tpl-border)" }
17
+ }, L = {
18
+ class: "tpl:text-sm tpl:font-semibold",
19
+ style: { color: "var(--tpl-text)" }
20
+ }, R = { class: "tpl:flex tpl:items-center tpl:gap-3" }, z = { class: "tpl:relative" }, B = ["value", "placeholder"], V = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, H = {
21
+ key: 0,
22
+ class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
23
+ style: {
24
+ "border-color": "var(--tpl-border)",
25
+ "background-color": "var(--tpl-bg)"
26
+ }
27
+ }, U = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, de = {
28
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
29
+ style: { "border-color": "var(--tpl-border)" }
30
+ }, fe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, pe = ["title"], me = {
31
+ key: 1,
32
+ class: "tpl:text-xs tpl:font-medium",
33
+ style: { color: "var(--tpl-text)" }
34
+ }, he = {
35
+ class: "tpl:flex tpl:rounded-md tpl:p-0.5",
36
+ style: {
37
+ border: "1px solid var(--tpl-border)",
38
+ "background-color": "var(--tpl-bg)"
39
+ }
40
+ }, ge = ["title"], _e = ["title"], ve = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ye = ["value"], be = { value: "" }, xe = ["value"], Se = ["value"], Ce = { value: "newest" }, we = { value: "oldest" }, Te = { value: "name_asc" }, Ee = { value: "name_desc" }, De = { value: "size_asc" }, Oe = { value: "size_desc" }, ke = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Ae = {
41
+ key: 0,
42
+ class: "tpl:px-4 tpl:pt-3"
43
+ }, je = {
44
+ class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
45
+ style: {
46
+ "background-color": "var(--tpl-bg-elevated)",
47
+ "box-shadow": "var(--tpl-shadow-xl)"
48
+ }
49
+ }, Me = {
50
+ class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
51
+ style: { color: "var(--tpl-text)" }
52
+ }, Ne = {
53
+ key: 0,
54
+ class: "tpl:mb-4 tpl:text-xs",
55
+ style: { color: "var(--tpl-text-muted)" }
56
+ }, Pe = {
57
+ key: 1,
58
+ class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
59
+ style: { "border-color": "var(--tpl-border)" }
60
+ }, Fe = { class: "tpl:font-medium" }, Ie = { style: { color: "var(--tpl-text-muted)" } }, Le = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Re = {
61
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
62
+ style: { "border-color": "var(--tpl-border)" }
63
+ }, ze = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Be = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Ve = {
64
+ key: 0,
65
+ class: "tpl:flex tpl:items-center tpl:gap-2"
66
+ }, He = {
67
+ key: 1,
68
+ class: "tpl:relative"
69
+ }, Ue = { class: "tpl:flex tpl:items-center tpl:gap-2" }, W = ["disabled"], G = /* @__PURE__ */ a({
70
+ __name: "MediaLibrary",
71
+ props: {
72
+ authManager: {},
73
+ projectId: {},
74
+ planConfig: {},
75
+ translations: {},
76
+ onSelect: { type: Function },
77
+ onError: { type: Function }
78
+ },
79
+ emits: ["ready"],
80
+ setup(a, { emit: _ }) {
81
+ let y = a, x = _, S = g(() => y.translations);
82
+ i("translations", y.translations), i("authManager", y.authManager), i("projectId", g(() => y.projectId)), i("planConfig", {
83
+ config: e(y.planConfig),
84
+ isLoading: e(!1),
85
+ hasFeature: (e) => y.planConfig.features[e] ?? !1,
86
+ features: g(() => y.planConfig.features),
87
+ fetchConfig: async () => {}
88
+ });
89
+ let N = g(() => y.planConfig.features.media_folders ?? !1), G = g(() => y.planConfig.features.import_from_url ?? !1), K = g(() => y.planConfig.storage.used_bytes ?? 0), q = g(() => y.planConfig.storage.limit_bytes ?? 0), { availableCategories: J } = w(), Y = T({
90
+ projectId: y.projectId,
91
+ authManager: y.authManager,
92
+ onError: y.onError
93
+ }), X = O({
94
+ library: Y,
95
+ canUseMediaFolders: N,
96
+ translations: S
97
+ });
98
+ function Z() {
99
+ if (!Y.previewItem.value) return;
100
+ let e = Y.previewItem.value;
101
+ y.onSelect?.({
102
+ ...e,
103
+ url: X.selectedUrl.value || e.url
104
+ });
105
+ }
106
+ return ee(() => {
107
+ Y.loadItems(), Y.loadFrequentlyUsed(), x("ready");
108
+ }), (e, i) => (r(), o("div", F, [
109
+ m("div", I, [m("h2", L, p(S.value.mediaLibrary.title), 1), m("div", R, [c(j, {
110
+ "used-bytes": K.value,
111
+ "limit-bytes": q.value,
112
+ size: 22
113
+ }, null, 8, ["used-bytes", "limit-bytes"]), m("div", z, [m("input", {
114
+ value: s(X).searchInput.value,
115
+ type: "text",
116
+ class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)]",
117
+ style: {
118
+ "border-color": "var(--tpl-border)",
119
+ "background-color": "var(--tpl-bg)",
120
+ color: "var(--tpl-text)"
121
+ },
122
+ placeholder: S.value.mediaLibrary.searchPlaceholder,
123
+ onInput: i[0] ||= (e) => s(X).handleSearchInput(e.target.value)
124
+ }, null, 40, B), c(s(ce), {
125
+ class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
126
+ size: 13,
127
+ "stroke-width": 2,
128
+ style: { color: "var(--tpl-text-dim)" }
129
+ })])])]),
130
+ m("div", V, [c(h, {
131
+ "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
132
+ "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
133
+ "enter-to-class": "tpl:ml-0 tpl:opacity-100",
134
+ "leave-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-in",
135
+ "leave-from-class": "tpl:ml-0 tpl:opacity-100",
136
+ "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
137
+ }, {
138
+ default: n(() => [N.value && s(X).showSidebar.value ? (r(), o("div", H, [c(P, {
139
+ folders: s(Y).folders.value,
140
+ "current-folder-id": s(Y).currentFolderId.value,
141
+ "view-mode": s(Y).viewMode.value,
142
+ "has-frequently-used": s(X).hasFrequentlyUsed.value,
143
+ onNavigate: s(Y).navigateToFolder,
144
+ onCreateFolder: s(X).handleCreateFolder,
145
+ onRenameFolder: s(X).handleRenameFolder,
146
+ onDeleteFolder: s(X).handleDeleteFolder,
147
+ onShowFrequentlyUsed: s(Y).showFrequentlyUsed
148
+ }, null, 8, [
149
+ "folders",
150
+ "current-folder-id",
151
+ "view-mode",
152
+ "has-frequently-used",
153
+ "onNavigate",
154
+ "onCreateFolder",
155
+ "onRenameFolder",
156
+ "onDeleteFolder",
157
+ "onShowFrequentlyUsed"
158
+ ])])) : d("", !0)]),
159
+ _: 1
160
+ }), m("div", U, [m("div", de, [m("div", fe, [
161
+ N.value ? (r(), o("button", {
162
+ key: 0,
163
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
164
+ style: l({
165
+ color: s(X).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
166
+ backgroundColor: s(X).showSidebar.value ? "var(--tpl-bg)" : "transparent",
167
+ border: s(X).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
168
+ }),
169
+ title: s(X).showSidebar.value ? S.value.mediaLibrary.hideFolders : S.value.mediaLibrary.showFolders,
170
+ onClick: i[1] ||= (e) => s(X).showSidebar.value = !s(X).showSidebar.value
171
+ }, [c(s(ie), {
172
+ size: 16,
173
+ "stroke-width": 2
174
+ })], 12, pe)) : d("", !0),
175
+ s(Y).viewMode.value === "frequently-used" ? (r(), o("span", me, p(S.value.mediaLibrary.frequentlyUsed), 1)) : (r(), f(A, {
176
+ key: 2,
177
+ folders: s(Y).folders.value,
178
+ "current-folder-id": s(Y).currentFolderId.value,
179
+ onNavigate: s(Y).navigateToFolder
180
+ }, null, 8, [
181
+ "folders",
182
+ "current-folder-id",
183
+ "onNavigate"
184
+ ])),
185
+ m("div", he, [m("button", {
186
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
187
+ style: l({
188
+ color: s(X).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
189
+ backgroundColor: s(X).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
190
+ }),
191
+ title: S.value.mediaLibrary.viewGrid,
192
+ onClick: i[2] ||= (e) => s(X).layoutMode.value = "grid"
193
+ }, [c(s(se), {
194
+ size: 14,
195
+ "stroke-width": 2
196
+ })], 12, ge), m("button", {
197
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
198
+ style: l({
199
+ color: s(X).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
200
+ backgroundColor: s(X).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
201
+ }),
202
+ title: S.value.mediaLibrary.viewList,
203
+ onClick: i[3] ||= (e) => s(X).layoutMode.value = "list"
204
+ }, [c(s(oe), {
205
+ size: 14,
206
+ "stroke-width": 2
207
+ })], 12, _e)])
208
+ ]), m("div", ve, [s(J).length > 1 ? (r(), o("select", {
209
+ key: 0,
210
+ class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
211
+ style: {
212
+ "border-color": "var(--tpl-border)",
213
+ "background-color": "var(--tpl-bg)",
214
+ color: "var(--tpl-text)"
215
+ },
216
+ value: s(Y).categoryFilter.value ?? "",
217
+ onChange: i[4] ||= (e) => s(Y).filterByCategory(e.target.value || null)
218
+ }, [m("option", be, p(S.value.mediaLibrary.filterAll), 1), (r(!0), o(u, null, t(s(J), (e) => (r(), o("option", {
219
+ key: e,
220
+ value: e
221
+ }, p(s(X).getCategoryLabel(e)), 9, xe))), 128))], 40, ye)) : d("", !0), m("select", {
222
+ class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
223
+ style: {
224
+ "border-color": "var(--tpl-border)",
225
+ "background-color": "var(--tpl-bg)",
226
+ color: "var(--tpl-text)"
227
+ },
228
+ value: s(Y).sortOption.value,
229
+ onChange: i[5] ||= (e) => s(Y).sortBy(e.target.value)
230
+ }, [
231
+ m("option", Ce, p(S.value.mediaLibrary.sortNewest), 1),
232
+ m("option", we, p(S.value.mediaLibrary.sortOldest), 1),
233
+ m("option", Te, p(S.value.mediaLibrary.sortNameAsc), 1),
234
+ m("option", Ee, p(S.value.mediaLibrary.sortNameDesc), 1),
235
+ m("option", De, p(S.value.mediaLibrary.sortSizeAsc), 1),
236
+ m("option", Oe, p(S.value.mediaLibrary.sortSizeDesc), 1)
237
+ ], 40, Se)])]), m("div", ke, [s(Y).viewMode.value === "files" ? (r(), o("div", Ae, [c(E, {
238
+ "is-uploading": s(Y).isUploading.value,
239
+ "upload-progress": s(Y).uploadProgress.value,
240
+ onUpload: s(X).handleUpload
241
+ }, null, 8, [
242
+ "is-uploading",
243
+ "upload-progress",
244
+ "onUpload"
245
+ ]), G.value ? (r(), o("button", {
246
+ key: 0,
247
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
248
+ style: {
249
+ "border-color": "var(--tpl-border)",
250
+ color: "var(--tpl-text-muted)",
251
+ "background-color": "var(--tpl-bg)"
252
+ },
253
+ onClick: i[6] ||= (e) => s(X).showImportUrlModal.value = !0
254
+ }, [c(s(ae), {
255
+ size: 14,
256
+ "stroke-width": 2
257
+ }), b(" " + p(S.value.mediaLibrary.importFromUrl), 1)])) : d("", !0)])) : d("", !0), c(D, {
258
+ items: s(X).displayItems.value,
259
+ "selected-ids": s(Y).selectedItems.value,
260
+ "is-loading": s(Y).isLoading.value,
261
+ "has-more": s(Y).viewMode.value === "files" && s(Y).hasMore.value,
262
+ layout: s(X).layoutMode.value,
263
+ onSelect: s(X).handleSelect,
264
+ onToggle: s(Y).toggleSelection,
265
+ onLoadMore: s(Y).loadMore,
266
+ onEdit: s(X).handleEditItem,
267
+ onReplace: s(X).handleReplaceItem
268
+ }, null, 8, [
269
+ "items",
270
+ "selected-ids",
271
+ "is-loading",
272
+ "has-more",
273
+ "layout",
274
+ "onSelect",
275
+ "onToggle",
276
+ "onLoadMore",
277
+ "onEdit",
278
+ "onReplace"
279
+ ])])])]),
280
+ c(ue, {
281
+ visible: s(X).showImportUrlModal.value,
282
+ "is-importing": s(Y).isImportingFromUrl.value,
283
+ error: s(Y).importFromUrlError.value,
284
+ onImport: s(X).handleImportFromUrl,
285
+ onClose: i[7] ||= (e) => s(X).showImportUrlModal.value = !1
286
+ }, null, 8, [
287
+ "visible",
288
+ "is-importing",
289
+ "error",
290
+ "onImport"
291
+ ]),
292
+ c(C, {
293
+ visible: !!s(X).editingItem.value,
294
+ item: s(X).editingItem.value,
295
+ onSave: s(X).handleEditSave,
296
+ onClose: i[8] ||= (e) => s(X).editingItem.value = null
297
+ }, null, 8, [
298
+ "visible",
299
+ "item",
300
+ "onSave"
301
+ ]),
302
+ c(le, {
303
+ visible: s(Y).showReplaceWarning.value,
304
+ item: s(Y).pendingReplaceItem.value,
305
+ "usage-info": s(Y).replaceUsageInfo.value,
306
+ "is-replacing": s(Y).isReplacing.value,
307
+ error: s(Y).replaceError.value,
308
+ onReplace: s(X).handleReplaceFile,
309
+ onClose: s(Y).cancelReplace
310
+ }, null, 8, [
311
+ "visible",
312
+ "item",
313
+ "usage-info",
314
+ "is-replacing",
315
+ "error",
316
+ "onReplace",
317
+ "onClose"
318
+ ]),
319
+ c(h, {
320
+ "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
321
+ "enter-from-class": "tpl:opacity-0",
322
+ "enter-to-class": "tpl:opacity-100",
323
+ "leave-active-class": "tpl:transition tpl:ease-in tpl:duration-100",
324
+ "leave-from-class": "tpl:opacity-100",
325
+ "leave-to-class": "tpl:opacity-0"
326
+ }, {
327
+ default: n(() => [s(Y).showDeleteWarning.value ? (r(), o("div", {
328
+ key: 0,
329
+ class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
330
+ style: {
331
+ "background-color": "rgba(0, 0, 0, 0.5)",
332
+ "backdrop-filter": "blur(8px)",
333
+ "-webkit-backdrop-filter": "blur(8px)"
334
+ },
335
+ onClick: i[11] ||= te((...e) => s(Y).cancelDelete && s(Y).cancelDelete(...e), ["self"])
336
+ }, [m("div", je, [
337
+ m("h3", Me, p(S.value.mediaLibrary.deleteWarningTitle), 1),
338
+ m("p", {
339
+ class: v(["tpl:text-xs", s(X).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
340
+ style: { color: "var(--tpl-text-muted)" }
341
+ }, p(S.value.mediaLibrary.deleteWarningMessage), 3),
342
+ s(X).hasUsedFiles.value ? (r(), o("p", Ne, p(S.value.mediaLibrary.deleteWarningUsageNote), 1)) : d("", !0),
343
+ s(X).hasUsedFiles.value ? (r(), o("div", Pe, [(r(!0), o(u, null, t(s(Y).deleteUsageInfo.value, (e, t) => (r(), o("div", {
344
+ key: t,
345
+ class: "tpl:text-xs",
346
+ style: { color: "var(--tpl-text)" }
347
+ }, [e.template_count > 0 ? (r(), o(u, { key: 0 }, [m("span", Fe, p(s(X).displayItems.value.find((e) => e.id === t)?.filename || t), 1), m("span", Ie, " - " + p(S.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : d("", !0)]))), 128))])) : d("", !0),
348
+ m("div", Le, [m("button", {
349
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
350
+ style: {
351
+ "border-color": "var(--tpl-border)",
352
+ color: "var(--tpl-text)",
353
+ "background-color": "var(--tpl-bg)"
354
+ },
355
+ onClick: i[9] ||= (...e) => s(Y).cancelDelete && s(Y).cancelDelete(...e)
356
+ }, p(S.value.mediaLibrary.cancel), 1), m("button", {
357
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
358
+ style: {
359
+ "border-color": "var(--tpl-danger)",
360
+ color: "var(--tpl-danger)",
361
+ "background-color": "var(--tpl-danger-light)"
362
+ },
363
+ onClick: i[10] ||= (...e) => s(Y).confirmDelete && s(Y).confirmDelete(...e)
364
+ }, p(s(X).hasUsedFiles.value ? S.value.mediaLibrary.deleteAnyway : S.value.mediaLibrary.confirmDelete), 1)])
365
+ ])])) : d("", !0)]),
366
+ _: 1
367
+ }),
368
+ m("div", Re, [m("div", ze, [s(Y).previewItem.value ? (r(), f(k, {
369
+ key: 0,
370
+ "selected-conversion": s(X).selectedConversion.value,
371
+ "onUpdate:selectedConversion": i[12] ||= (e) => s(X).selectedConversion.value = e,
372
+ item: s(Y).previewItem.value,
373
+ folders: s(Y).folders.value
374
+ }, null, 8, [
375
+ "selected-conversion",
376
+ "item",
377
+ "folders"
378
+ ])) : d("", !0)]), m("div", Be, [s(Y).selectedItems.value.size > 0 ? (r(), o("div", Ve, [s(Y).previewItem.value ? (r(), o("button", {
379
+ key: 0,
380
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
381
+ style: l({
382
+ borderColor: s(X).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
383
+ color: s(X).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
384
+ backgroundColor: "var(--tpl-bg)"
385
+ }),
386
+ onClick: i[13] ||= (e) => s(X).copy(s(X).selectedUrl.value)
387
+ }, [s(X).copied.value ? (r(), f(s(ne), {
388
+ key: 1,
389
+ size: 12,
390
+ "stroke-width": 2
391
+ })) : (r(), f(s(re), {
392
+ key: 0,
393
+ size: 12,
394
+ "stroke-width": 2
395
+ })), b(" " + p(s(X).copied.value ? S.value.mediaLibrary.copied : S.value.mediaLibrary.copyUrl), 1)], 4)) : d("", !0), N.value ? (r(), o("div", He, [m("button", {
396
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
397
+ style: {
398
+ "border-color": "var(--tpl-border)",
399
+ color: "var(--tpl-text)",
400
+ "background-color": "var(--tpl-bg)"
401
+ },
402
+ onClick: i[14] ||= (e) => s(X).showMovePicker.value = !s(X).showMovePicker.value
403
+ }, p(S.value.mediaLibrary.moveSelected), 1), s(X).showMovePicker.value ? (r(), f(M, {
404
+ key: 0,
405
+ folders: s(Y).folders.value,
406
+ "current-folder-id": s(Y).currentFolderId.value,
407
+ onSelect: s(X).handleMoveToFolder,
408
+ onClose: i[15] ||= (e) => s(X).showMovePicker.value = !1
409
+ }, null, 8, [
410
+ "folders",
411
+ "current-folder-id",
412
+ "onSelect"
413
+ ])) : d("", !0)])) : d("", !0)])) : d("", !0), m("div", Ue, [s(Y).selectedItems.value.size > 0 ? (r(), o("button", {
414
+ key: 0,
415
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
416
+ style: {
417
+ "border-color": "var(--tpl-danger)",
418
+ color: "var(--tpl-danger)",
419
+ "background-color": "var(--tpl-danger-light)"
420
+ },
421
+ onClick: i[16] ||= (...e) => s(X).handleDeleteClick && s(X).handleDeleteClick(...e)
422
+ }, p(S.value.mediaLibrary.deleteSelected), 1)) : d("", !0), a.onSelect ? (r(), o("button", {
423
+ key: 1,
424
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 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",
425
+ style: {
426
+ "background-color": "var(--tpl-primary)",
427
+ color: "var(--tpl-bg)"
428
+ },
429
+ disabled: !s(Y).previewItem.value,
430
+ onClick: Z
431
+ }, p(S.value.mediaLibrary.selectFile), 9, W)) : d("", !0)])])])
432
+ ]));
433
+ }
434
+ }), K = (e, t, n) => {
435
+ let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
436
+ return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
437
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
438
+ });
439
+ }, q = ["en", "de"];
440
+ function J(e) {
441
+ return e.split("-")[0].toLowerCase();
442
+ }
443
+ async function Y(e) {
444
+ let t = J(e), n = q.includes(t) ? t : "en";
445
+ return (await K(/* @__PURE__ */ Object.assign({
446
+ "./locales/de.ts": () => import("./de-Ce-LbJ2J.js"),
447
+ "./locales/en.ts": () => import("./en-DiCWK5fG.js")
448
+ }), `./locales/${n}.ts`, 3)).default;
449
+ }
450
+ //#endregion
451
+ //#region ../media-library/src/standalone/visual.ts
452
+ var X = null, Z = e(null);
453
+ async function We(e) {
454
+ let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
455
+ if (!t) throw Error(`Container element not found: ${e.container}`);
456
+ let n = x(e.auth, e.onError);
457
+ await n.initialize();
458
+ let r = await new S(n).fetchConfig(), i = await Y(e.locale ?? "en");
459
+ return $(t, e.theme), X && Q(), new Promise((a, o) => {
460
+ try {
461
+ X = _({ setup() {
462
+ let o = () => {
463
+ a({
464
+ setTheme: (e) => $(t, e),
465
+ unmount: Q
466
+ });
467
+ };
468
+ return () => y(G, {
469
+ authManager: n,
470
+ projectId: n.projectId,
471
+ planConfig: r,
472
+ translations: i,
473
+ onSelect: e.onSelect,
474
+ onError: e.onError,
475
+ ref: Z,
476
+ onReady: o
477
+ });
478
+ } }), X.mount(t);
479
+ } catch (e) {
480
+ o(e);
481
+ }
482
+ });
483
+ }
484
+ function Q() {
485
+ X && (X.unmount(), X = null, Z.value = null);
486
+ }
487
+ function $(e, t) {
488
+ t && (t.primaryColor && e.style.setProperty("--tpl-primary", t.primaryColor), t.borderRadius !== void 0 && (e.style.setProperty("--tpl-radius", `${t.borderRadius}px`), e.style.setProperty("--tpl-radius-sm", `${Math.max(0, t.borderRadius - 3)}px`), e.style.setProperty("--tpl-radius-lg", `${t.borderRadius + 4}px`)));
489
+ }
490
+ typeof window < "u" && (window.TemplaticalMedia = {
491
+ init: We,
492
+ unmount: Q
493
+ });
494
+ //#endregion
495
+ export { N as MediaLibraryModal };
496
+
497
+ //# sourceMappingURL=src-CRaqN-p8.js.map