@aswin.dev/editor 0.7.1 → 0.7.3
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.
- package/LICENSE +56 -0
- package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-Dt5pvG5t.js} +37 -51
- package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-BipxcGap.js} +1 -1
- package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-CnUX0IOW.js} +283 -239
- package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-NaaZTjbs.js} +2 -2
- package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DE6ZsM4D.js} +9 -10
- package/dist/CountdownBlock-Ba3T-i2X.js +1536 -0
- package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-CbhSp_uq.js} +1 -1
- package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-CZg97bbj.js} +1 -1
- package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-D2EVdexc.js} +4 -4
- package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-P3N-nxkU.js} +52 -47
- package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-CihczoAd.js} +1 -1
- package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-BbRuKhWv.js} +7 -7
- package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-DLZa3m3O.js} +2 -2
- package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-Csg1_jXi.js} +3 -3
- package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-m3okLbJz.js} +2 -2
- package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CtJIS5ER.js} +2 -2
- package/dist/{TplModal-BAsVzcTb.js → TplModal-CQCrKeKP.js} +1 -1
- package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-Dah0pgt-.js} +50 -19
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-56lVcdot.js +1220 -0
- package/dist/cdn/chunks/CloudEditor-56lVcdot.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js.map +1 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js +113 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js.map +1 -0
- package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js +171 -0
- package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js +24 -0
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js.map +1 -0
- package/dist/cdn/chunks/de-B05yW8Gi.js +840 -0
- package/dist/cdn/chunks/de-B05yW8Gi.js.map +1 -0
- package/dist/cdn/chunks/de-BPHtelu7.js +209 -0
- package/dist/cdn/chunks/de-BPHtelu7.js.map +1 -0
- package/dist/cdn/chunks/de-BRDqJwJe.js +89 -0
- package/dist/cdn/chunks/de-BRDqJwJe.js.map +1 -0
- package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
- package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
- package/dist/cdn/chunks/emojiData-DUHzsh4j.js +19 -0
- package/dist/cdn/chunks/emojiData-DUHzsh4j.js.map +1 -0
- package/dist/cdn/chunks/en-BII7695P.js +840 -0
- package/dist/cdn/chunks/en-BII7695P.js.map +1 -0
- package/dist/cdn/chunks/en-Cdj_Ikl1.js +89 -0
- package/dist/cdn/chunks/en-Cdj_Ikl1.js.map +1 -0
- package/dist/cdn/chunks/en-DejwuJhw.js +209 -0
- package/dist/cdn/chunks/en-DejwuJhw.js.map +1 -0
- package/dist/cdn/chunks/extensions-B0eT-yjf.js +598 -0
- package/dist/cdn/chunks/extensions-B0eT-yjf.js.map +1 -0
- package/dist/cdn/chunks/features-BrvE2Fzv.js +9677 -0
- package/dist/cdn/chunks/features-BrvE2Fzv.js.map +1 -0
- package/dist/cdn/chunks/icons-C7wtAD8p.js +1043 -0
- package/dist/cdn/chunks/icons-C7wtAD8p.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-CllF-us3.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-CllF-us3.js.map +1 -0
- package/dist/cdn/chunks/media-library-Cl5XuaKy.js +6030 -0
- package/dist/cdn/chunks/media-library-Cl5XuaKy.js.map +1 -0
- package/dist/cdn/chunks/pusher-i7-OBujc.js +2508 -0
- package/dist/cdn/chunks/pusher-i7-OBujc.js.map +1 -0
- package/dist/cdn/chunks/quality-Va91a3N8.js +1456 -0
- package/dist/cdn/chunks/quality-Va91a3N8.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
- package/dist/cdn/chunks/renderer-si0Zgxeb.js +642 -0
- package/dist/cdn/chunks/renderer-si0Zgxeb.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-BLyYIbdZ.js +497 -0
- package/dist/cdn/chunks/src-BLyYIbdZ.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-DfcU8u_r.js +57 -0
- package/dist/cdn/chunks/styleConstants-DfcU8u_r.js.map +1 -0
- package/dist/cdn/chunks/styles-C6BQLT9F.js +5807 -0
- package/dist/cdn/chunks/styles-C6BQLT9F.js.map +1 -0
- package/dist/cdn/chunks/tiptap-D8whBv5F.js +14654 -0
- package/dist/cdn/chunks/tiptap-D8whBv5F.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +367 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/{cloud-6ZmAvF0j.js → cloud-BoS0J0vs.js} +1 -1
- package/dist/{de-DWcgp-7T.js → de-C74F9xK3.js} +112 -3
- package/dist/dist-C2grMquk.js +1261 -0
- package/dist/{dist-CivF9P8b.js → dist-Djgi0A6k.js} +92 -77
- package/dist/{en-Cxd4fhNm.js → en-B24jVTeO.js} +112 -3
- package/dist/{extensions-D__hOlV1.js → extensions-DsmjHqBF.js} +14 -14
- package/dist/index.d.ts +21 -10
- package/dist/{pencil-BZJPNYWR.js → pencil-Bpimrzzw.js} +5 -2
- package/dist/style.css +1 -1
- package/dist/styles-BMFMtR9R.js +6341 -0
- package/dist/templatical-editor.js +197 -139
- package/dist/undo-2-m1EUDbUg.js +16 -0
- package/dist/{useEditorCore-wslttMH-.js → useEditorCore-CtNAo0uy.js} +2154 -2025
- package/dist/useMergeTag-2vTcVpNo.js +34 -0
- package/package.json +12 -12
- package/dist/CountdownBlock-DaYGxKqo.js +0 -92
- package/dist/check-DJrpDKO_.js +0 -7
- package/dist/dist-C04s_fLA.js +0 -563
- package/dist/styles-B4tjX5SP.js +0 -5224
- package/dist/useMergeTag-DX0XG5V9.js +0 -34
- /package/dist/{clock-ik2pRJKG.js → clock-Ba4p3rJM.js} +0 -0
- /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { C as e, F as t, I as n, M as r, P as i, T as a, W as o, _ as s, b as c, ct as l, d as ee, dt as u, f as d, ft as f, g as p, h as m, m as h, n as g, r as _, tt as v, ut as te, v as y, x as b } from "./draggable-C-1_gch3.js";
|
|
2
|
+
import { Ft as x, O as S, Ot as ne, w as C } from "./features-BrvE2Fzv.js";
|
|
3
|
+
import { P as re, S as ie, Y as ae, et as oe, q as se } from "./icons-C7wtAD8p.js";
|
|
4
|
+
import { a as ce, c as le, d as ue, 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-Cl5XuaKy.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__ */ e({
|
|
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(e, { emit: a }) {
|
|
81
|
+
let _ = e, S = a, C = h(() => _.translations);
|
|
82
|
+
t("translations", _.translations), t("authManager", _.authManager), t("projectId", h(() => _.projectId)), t("planConfig", {
|
|
83
|
+
config: v(_.planConfig),
|
|
84
|
+
isLoading: v(!1),
|
|
85
|
+
hasFeature: (e) => _.planConfig.features[e] ?? !1,
|
|
86
|
+
features: h(() => _.planConfig.features),
|
|
87
|
+
fetchConfig: async () => {}
|
|
88
|
+
});
|
|
89
|
+
let N = h(() => _.planConfig.features.media_folders ?? !1), G = h(() => _.planConfig.features.import_from_url ?? !1), K = h(() => _.planConfig.storage.used_bytes ?? 0), q = h(() => _.planConfig.storage.limit_bytes ?? 0), { availableCategories: J } = w(), Y = T({
|
|
90
|
+
projectId: _.projectId,
|
|
91
|
+
authManager: _.authManager,
|
|
92
|
+
onError: _.onError
|
|
93
|
+
}), X = O({
|
|
94
|
+
library: Y,
|
|
95
|
+
canUseMediaFolders: N,
|
|
96
|
+
translations: C
|
|
97
|
+
});
|
|
98
|
+
function Z() {
|
|
99
|
+
if (!Y.previewItem.value) return;
|
|
100
|
+
let e = Y.previewItem.value;
|
|
101
|
+
_.onSelect?.({
|
|
102
|
+
...e,
|
|
103
|
+
url: X.selectedUrl.value || e.url
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return r(() => {
|
|
107
|
+
Y.loadItems(), Y.loadFrequentlyUsed(), S("ready");
|
|
108
|
+
}), (t, r) => (i(), y("div", F, [
|
|
109
|
+
m("div", I, [m("h2", L, f(C.value.mediaLibrary.title), 1), m("div", R, [b(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: l(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: C.value.mediaLibrary.searchPlaceholder,
|
|
123
|
+
onInput: r[0] ||= (e) => l(X).handleSearchInput(e.target.value)
|
|
124
|
+
}, null, 40, B), b(l(ie), {
|
|
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, [b(g, {
|
|
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: o(() => [N.value && l(X).showSidebar.value ? (i(), y("div", H, [b(P, {
|
|
139
|
+
folders: l(Y).folders.value,
|
|
140
|
+
"current-folder-id": l(Y).currentFolderId.value,
|
|
141
|
+
"view-mode": l(Y).viewMode.value,
|
|
142
|
+
"has-frequently-used": l(X).hasFrequentlyUsed.value,
|
|
143
|
+
onNavigate: l(Y).navigateToFolder,
|
|
144
|
+
onCreateFolder: l(X).handleCreateFolder,
|
|
145
|
+
onRenameFolder: l(X).handleRenameFolder,
|
|
146
|
+
onDeleteFolder: l(X).handleDeleteFolder,
|
|
147
|
+
onShowFrequentlyUsed: l(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
|
+
])])) : s("", !0)]),
|
|
159
|
+
_: 1
|
|
160
|
+
}), m("div", U, [m("div", de, [m("div", fe, [
|
|
161
|
+
N.value ? (i(), y("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: u({
|
|
165
|
+
color: l(X).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
166
|
+
backgroundColor: l(X).showSidebar.value ? "var(--tpl-bg)" : "transparent",
|
|
167
|
+
border: l(X).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
|
|
168
|
+
}),
|
|
169
|
+
title: l(X).showSidebar.value ? C.value.mediaLibrary.hideFolders : C.value.mediaLibrary.showFolders,
|
|
170
|
+
onClick: r[1] ||= (e) => l(X).showSidebar.value = !l(X).showSidebar.value
|
|
171
|
+
}, [b(l(re), {
|
|
172
|
+
size: 16,
|
|
173
|
+
"stroke-width": 2
|
|
174
|
+
})], 12, pe)) : s("", !0),
|
|
175
|
+
l(Y).viewMode.value === "frequently-used" ? (i(), y("span", me, f(C.value.mediaLibrary.frequentlyUsed), 1)) : (i(), p(A, {
|
|
176
|
+
key: 2,
|
|
177
|
+
folders: l(Y).folders.value,
|
|
178
|
+
"current-folder-id": l(Y).currentFolderId.value,
|
|
179
|
+
onNavigate: l(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: u({
|
|
188
|
+
color: l(X).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
189
|
+
backgroundColor: l(X).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
190
|
+
}),
|
|
191
|
+
title: C.value.mediaLibrary.viewGrid,
|
|
192
|
+
onClick: r[2] ||= (e) => l(X).layoutMode.value = "grid"
|
|
193
|
+
}, [b(l(oe), {
|
|
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: u({
|
|
199
|
+
color: l(X).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
200
|
+
backgroundColor: l(X).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
|
|
201
|
+
}),
|
|
202
|
+
title: C.value.mediaLibrary.viewList,
|
|
203
|
+
onClick: r[3] ||= (e) => l(X).layoutMode.value = "list"
|
|
204
|
+
}, [b(l(se), {
|
|
205
|
+
size: 14,
|
|
206
|
+
"stroke-width": 2
|
|
207
|
+
})], 12, _e)])
|
|
208
|
+
]), m("div", ve, [l(J).length > 1 ? (i(), y("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: l(Y).categoryFilter.value ?? "",
|
|
217
|
+
onChange: r[4] ||= (e) => l(Y).filterByCategory(e.target.value || null)
|
|
218
|
+
}, [m("option", be, f(C.value.mediaLibrary.filterAll), 1), (i(!0), y(d, null, n(l(J), (e) => (i(), y("option", {
|
|
219
|
+
key: e,
|
|
220
|
+
value: e
|
|
221
|
+
}, f(l(X).getCategoryLabel(e)), 9, xe))), 128))], 40, ye)) : s("", !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: l(Y).sortOption.value,
|
|
229
|
+
onChange: r[5] ||= (e) => l(Y).sortBy(e.target.value)
|
|
230
|
+
}, [
|
|
231
|
+
m("option", Ce, f(C.value.mediaLibrary.sortNewest), 1),
|
|
232
|
+
m("option", we, f(C.value.mediaLibrary.sortOldest), 1),
|
|
233
|
+
m("option", Te, f(C.value.mediaLibrary.sortNameAsc), 1),
|
|
234
|
+
m("option", Ee, f(C.value.mediaLibrary.sortNameDesc), 1),
|
|
235
|
+
m("option", De, f(C.value.mediaLibrary.sortSizeAsc), 1),
|
|
236
|
+
m("option", Oe, f(C.value.mediaLibrary.sortSizeDesc), 1)
|
|
237
|
+
], 40, Se)])]), m("div", ke, [l(Y).viewMode.value === "files" ? (i(), y("div", Ae, [b(E, {
|
|
238
|
+
"is-uploading": l(Y).isUploading.value,
|
|
239
|
+
"upload-progress": l(Y).uploadProgress.value,
|
|
240
|
+
onUpload: l(X).handleUpload
|
|
241
|
+
}, null, 8, [
|
|
242
|
+
"is-uploading",
|
|
243
|
+
"upload-progress",
|
|
244
|
+
"onUpload"
|
|
245
|
+
]), G.value ? (i(), y("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: r[6] ||= (e) => l(X).showImportUrlModal.value = !0
|
|
254
|
+
}, [b(l(ae), {
|
|
255
|
+
size: 14,
|
|
256
|
+
"stroke-width": 2
|
|
257
|
+
}), c(" " + f(C.value.mediaLibrary.importFromUrl), 1)])) : s("", !0)])) : s("", !0), b(D, {
|
|
258
|
+
items: l(X).displayItems.value,
|
|
259
|
+
"selected-ids": l(Y).selectedItems.value,
|
|
260
|
+
"is-loading": l(Y).isLoading.value,
|
|
261
|
+
"has-more": l(Y).viewMode.value === "files" && l(Y).hasMore.value,
|
|
262
|
+
layout: l(X).layoutMode.value,
|
|
263
|
+
onSelect: l(X).handleSelect,
|
|
264
|
+
onToggle: l(Y).toggleSelection,
|
|
265
|
+
onLoadMore: l(Y).loadMore,
|
|
266
|
+
onEdit: l(X).handleEditItem,
|
|
267
|
+
onReplace: l(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
|
+
b(le, {
|
|
281
|
+
visible: l(X).showImportUrlModal.value,
|
|
282
|
+
"is-importing": l(Y).isImportingFromUrl.value,
|
|
283
|
+
error: l(Y).importFromUrlError.value,
|
|
284
|
+
onImport: l(X).handleImportFromUrl,
|
|
285
|
+
onClose: r[7] ||= (e) => l(X).showImportUrlModal.value = !1
|
|
286
|
+
}, null, 8, [
|
|
287
|
+
"visible",
|
|
288
|
+
"is-importing",
|
|
289
|
+
"error",
|
|
290
|
+
"onImport"
|
|
291
|
+
]),
|
|
292
|
+
b(ue, {
|
|
293
|
+
visible: !!l(X).editingItem.value,
|
|
294
|
+
item: l(X).editingItem.value,
|
|
295
|
+
onSave: l(X).handleEditSave,
|
|
296
|
+
onClose: r[8] ||= (e) => l(X).editingItem.value = null
|
|
297
|
+
}, null, 8, [
|
|
298
|
+
"visible",
|
|
299
|
+
"item",
|
|
300
|
+
"onSave"
|
|
301
|
+
]),
|
|
302
|
+
b(ce, {
|
|
303
|
+
visible: l(Y).showReplaceWarning.value,
|
|
304
|
+
item: l(Y).pendingReplaceItem.value,
|
|
305
|
+
"usage-info": l(Y).replaceUsageInfo.value,
|
|
306
|
+
"is-replacing": l(Y).isReplacing.value,
|
|
307
|
+
error: l(Y).replaceError.value,
|
|
308
|
+
onReplace: l(X).handleReplaceFile,
|
|
309
|
+
onClose: l(Y).cancelReplace
|
|
310
|
+
}, null, 8, [
|
|
311
|
+
"visible",
|
|
312
|
+
"item",
|
|
313
|
+
"usage-info",
|
|
314
|
+
"is-replacing",
|
|
315
|
+
"error",
|
|
316
|
+
"onReplace",
|
|
317
|
+
"onClose"
|
|
318
|
+
]),
|
|
319
|
+
b(g, {
|
|
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: o(() => [l(Y).showDeleteWarning.value ? (i(), y("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: r[11] ||= ee((...e) => l(Y).cancelDelete && l(Y).cancelDelete(...e), ["self"])
|
|
336
|
+
}, [m("div", je, [
|
|
337
|
+
m("h3", Me, f(C.value.mediaLibrary.deleteWarningTitle), 1),
|
|
338
|
+
m("p", {
|
|
339
|
+
class: te(["tpl:text-xs", l(X).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
|
|
340
|
+
style: { color: "var(--tpl-text-muted)" }
|
|
341
|
+
}, f(C.value.mediaLibrary.deleteWarningMessage), 3),
|
|
342
|
+
l(X).hasUsedFiles.value ? (i(), y("p", Ne, f(C.value.mediaLibrary.deleteWarningUsageNote), 1)) : s("", !0),
|
|
343
|
+
l(X).hasUsedFiles.value ? (i(), y("div", Pe, [(i(!0), y(d, null, n(l(Y).deleteUsageInfo.value, (e, t) => (i(), y("div", {
|
|
344
|
+
key: t,
|
|
345
|
+
class: "tpl:text-xs",
|
|
346
|
+
style: { color: "var(--tpl-text)" }
|
|
347
|
+
}, [e.template_count > 0 ? (i(), y(d, { key: 0 }, [m("span", Fe, f(l(X).displayItems.value.find((e) => e.id === t)?.filename || t), 1), m("span", Ie, " - " + f(C.value.mediaLibrary.usedInTemplates.replace("{count}", e.template_count.toString())), 1)], 64)) : s("", !0)]))), 128))])) : s("", !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: r[9] ||= (...e) => l(Y).cancelDelete && l(Y).cancelDelete(...e)
|
|
356
|
+
}, f(C.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: r[10] ||= (...e) => l(Y).confirmDelete && l(Y).confirmDelete(...e)
|
|
364
|
+
}, f(l(X).hasUsedFiles.value ? C.value.mediaLibrary.deleteAnyway : C.value.mediaLibrary.confirmDelete), 1)])
|
|
365
|
+
])])) : s("", !0)]),
|
|
366
|
+
_: 1
|
|
367
|
+
}),
|
|
368
|
+
m("div", Re, [m("div", ze, [l(Y).previewItem.value ? (i(), p(k, {
|
|
369
|
+
key: 0,
|
|
370
|
+
"selected-conversion": l(X).selectedConversion.value,
|
|
371
|
+
"onUpdate:selectedConversion": r[12] ||= (e) => l(X).selectedConversion.value = e,
|
|
372
|
+
item: l(Y).previewItem.value,
|
|
373
|
+
folders: l(Y).folders.value
|
|
374
|
+
}, null, 8, [
|
|
375
|
+
"selected-conversion",
|
|
376
|
+
"item",
|
|
377
|
+
"folders"
|
|
378
|
+
])) : s("", !0)]), m("div", Be, [l(Y).selectedItems.value.size > 0 ? (i(), y("div", Ve, [l(Y).previewItem.value ? (i(), y("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: u({
|
|
382
|
+
borderColor: l(X).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
|
|
383
|
+
color: l(X).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
|
|
384
|
+
backgroundColor: "var(--tpl-bg)"
|
|
385
|
+
}),
|
|
386
|
+
onClick: r[13] ||= (e) => l(X).copy(l(X).selectedUrl.value)
|
|
387
|
+
}, [l(X).copied.value ? (i(), p(l(x), {
|
|
388
|
+
key: 1,
|
|
389
|
+
size: 12,
|
|
390
|
+
"stroke-width": 2
|
|
391
|
+
})) : (i(), p(l(ne), {
|
|
392
|
+
key: 0,
|
|
393
|
+
size: 12,
|
|
394
|
+
"stroke-width": 2
|
|
395
|
+
})), c(" " + f(l(X).copied.value ? C.value.mediaLibrary.copied : C.value.mediaLibrary.copyUrl), 1)], 4)) : s("", !0), N.value ? (i(), y("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: r[14] ||= (e) => l(X).showMovePicker.value = !l(X).showMovePicker.value
|
|
403
|
+
}, f(C.value.mediaLibrary.moveSelected), 1), l(X).showMovePicker.value ? (i(), p(M, {
|
|
404
|
+
key: 0,
|
|
405
|
+
folders: l(Y).folders.value,
|
|
406
|
+
"current-folder-id": l(Y).currentFolderId.value,
|
|
407
|
+
onSelect: l(X).handleMoveToFolder,
|
|
408
|
+
onClose: r[15] ||= (e) => l(X).showMovePicker.value = !1
|
|
409
|
+
}, null, 8, [
|
|
410
|
+
"folders",
|
|
411
|
+
"current-folder-id",
|
|
412
|
+
"onSelect"
|
|
413
|
+
])) : s("", !0)])) : s("", !0)])) : s("", !0), m("div", Ue, [l(Y).selectedItems.value.size > 0 ? (i(), y("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: r[16] ||= (...e) => l(X).handleDeleteClick && l(X).handleDeleteClick(...e)
|
|
422
|
+
}, f(C.value.mediaLibrary.deleteSelected), 1)) : s("", !0), e.onSelect ? (i(), y("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: !l(Y).previewItem.value,
|
|
430
|
+
onClick: Z
|
|
431
|
+
}, f(C.value.mediaLibrary.selectFile), 9, W)) : s("", !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-BRDqJwJe.js"),
|
|
447
|
+
"./locales/en.ts": () => import("./en-Cdj_Ikl1.js")
|
|
448
|
+
}), `./locales/${n}.ts`, 3)).default;
|
|
449
|
+
}
|
|
450
|
+
//#endregion
|
|
451
|
+
//#region ../media-library/src/standalone/visual.ts
|
|
452
|
+
var X = null, Z = v(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 = S(e.auth, e.onError);
|
|
457
|
+
await n.initialize();
|
|
458
|
+
let r = await new C(n).fetchConfig(), i = await Y(e.locale ?? "en");
|
|
459
|
+
return $(t, e.theme), X && Q(), new Promise((o, s) => {
|
|
460
|
+
try {
|
|
461
|
+
X = _({ setup() {
|
|
462
|
+
let s = () => {
|
|
463
|
+
o({
|
|
464
|
+
setTheme: (e) => $(t, e),
|
|
465
|
+
unmount: Q
|
|
466
|
+
});
|
|
467
|
+
};
|
|
468
|
+
return () => a(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: s
|
|
477
|
+
});
|
|
478
|
+
} }), X.mount(t);
|
|
479
|
+
} catch (e) {
|
|
480
|
+
s(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-BLyYIbdZ.js.map
|