@phtngyn/cms 0.2.0-beta.6 → 0.2.0-beta.7
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/package.json +1 -1
- package/src/{Configuration-JQ1qyaU0.js → Configuration-Da5B2PVH.js} +2 -2
- package/src/{Configuration-JQ1qyaU0.js.map → Configuration-Da5B2PVH.js.map} +1 -1
- package/src/Content.js +3 -3
- package/src/Content.js.map +1 -1
- package/src/{DocumentEngine-j6Vi7nQo.js → DocumentEngine-hh_IGPXO.js} +2 -2
- package/src/{DocumentEngine-j6Vi7nQo.js.map → DocumentEngine-hh_IGPXO.js.map} +1 -1
- package/src/Module.js +1 -1
- package/src/{S3MediaObjects-BRuPQbxl.js → S3MediaObjects-Dwhl2deX.js} +4 -4
- package/src/{S3MediaObjects-BRuPQbxl.js.map → S3MediaObjects-Dwhl2deX.js.map} +1 -1
- package/src/cli.js +3 -3
- package/src/{dev-lifecycle-CExksm2R.js → dev-lifecycle-CjDq63Ft.js} +7 -7
- package/src/dev-lifecycle-CjDq63Ft.js.map +1 -0
- package/src/{installation-BoG8E3nJ.js → installation-DYNQQBD3.js} +7 -9
- package/src/{installation-BoG8E3nJ.js.map → installation-DYNQQBD3.js.map} +1 -1
- package/src/internal/authoring-catalog.js +1 -1
- package/src/internal/authoring-metadata.js +1 -1
- package/src/internal/configuration.js +1 -1
- package/src/internal/dev-lifecycle.js +1 -1
- package/src/internal/document-model.js +2 -2
- package/src/{metadata-UzZmjwxM.js → metadata-DN9_K6Yl.js} +87 -7
- package/src/metadata-DN9_K6Yl.js.map +1 -0
- package/src/runtime/installation.js +1 -1
- package/src/runtime/plugin.js +1 -1
- package/src/runtime/preview/controller.js +3 -2
- package/src/runtime/preview/controller.js.map +1 -1
- package/src/runtime/preview/crypto.js +16 -0
- package/src/runtime/preview/crypto.js.map +1 -0
- package/src/runtime/preview/plugin.client.js +1 -1
- package/src/runtime/preview/store.js +1 -1
- package/src/runtime/studio-app.js +1 -1
- package/src/runtime/studio-app.js.map +1 -1
- package/src/runtime/studio-document.js +46 -0
- package/src/runtime/studio-document.js.map +1 -0
- package/src/runtime/studio-entry.js +5 -22
- package/src/runtime/studio-entry.js.map +1 -1
- package/src/{store-PKKB8xa2.js → store-X1e1o_MF.js} +2 -2
- package/src/{store-PKKB8xa2.js.map → store-X1e1o_MF.js.map} +1 -1
- package/studio/{CreateDocumentDialog-DqvusuGU.js → CreateDocumentDialog-BpjBYGfI.js} +59 -59
- package/studio/{SelectMenu-BgikeouH.js → SelectMenu-KiXwx4Y_.js} +8778 -8661
- package/studio/host.js +4647 -4735
- package/src/dev-lifecycle-CExksm2R.js.map +0 -1
- package/src/metadata-UzZmjwxM.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as e, Bt as t, Dt as n, Et as r, It as i, Nt as a, Pt as o, Q as s, Y as c, at as l, cn as u, dn as d, en as f, et as p, ht as m, mt as h, nt as g, on as _, q as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as e, Bt as t, Dt as n, Et as r, It as i, Nt as a, Pt as o, Q as s, Y as c, at as l, cn as u, dn as d, en as f, et as p, ht as m, mt as h, nt as g, on as _, q as v, st as y, tt as b, wt as x } from "./editor-P2rB7Csp.js";
|
|
2
|
+
import { Ar as S, Di as C, F as ee, I as te, L as ne, Ma as w, O as re, Oi as T, Or as ie, P as E, j as ae, jr as D, ki as O, kr as k, n as A, or as j, r as oe, sr as se, t as ce, ua as M, vr as le, z as ue } from "./SelectMenu-KiXwx4Y_.js";
|
|
3
3
|
//#region virtual:nuxt-ui-templates/ui/collapsible.ts
|
|
4
4
|
var N = { slots: {
|
|
5
5
|
root: "",
|
|
@@ -39,21 +39,21 @@ var N = { slots: {
|
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:open"],
|
|
41
41
|
setup(e, { emit: r }) {
|
|
42
|
-
let i = e, a = r, c = o(), d = D("collapsible", i), f =
|
|
42
|
+
let i = e, a = r, c = o(), d = D("collapsible", i), f = M(), h = S(w(d, "as", "defaultOpen", "open", "disabled", "unmountOnHide"), a), g = s(() => k({
|
|
43
43
|
extend: N,
|
|
44
44
|
...f.ui?.collapsible || {}
|
|
45
45
|
})());
|
|
46
|
-
return (e, r) => (
|
|
46
|
+
return (e, r) => (x(), p(_(O), m(_(h), {
|
|
47
47
|
"data-slot": "root",
|
|
48
48
|
class: g.value.root({ class: [_(d).ui?.root, _(d).class] })
|
|
49
49
|
}), {
|
|
50
|
-
default: t(({ open: r }) => [c.default ? (
|
|
50
|
+
default: t(({ open: r }) => [c.default ? (x(), p(_(C), {
|
|
51
51
|
key: 0,
|
|
52
52
|
"as-child": ""
|
|
53
53
|
}, {
|
|
54
54
|
default: t(() => [n(e.$slots, "default", { open: r })]),
|
|
55
55
|
_: 2
|
|
56
|
-
}, 1024)) :
|
|
56
|
+
}, 1024)) : b("", !0), l(_(T), {
|
|
57
57
|
"data-slot": "content",
|
|
58
58
|
class: u(g.value.content({ class: _(d).ui?.content }))
|
|
59
59
|
}, {
|
|
@@ -75,7 +75,7 @@ var N = { slots: {
|
|
|
75
75
|
}, be = {
|
|
76
76
|
key: 6,
|
|
77
77
|
class: "-mt-2 text-xs text-error"
|
|
78
|
-
}, xe = { class: "flex w-full justify-end gap-2" }, R = "__top_level__", z = /* @__PURE__ */
|
|
78
|
+
}, xe = { class: "flex w-full justify-end gap-2" }, R = "__top_level__", z = /* @__PURE__ */ y({
|
|
79
79
|
__name: "CreateDocumentDialog",
|
|
80
80
|
props: /*@__PURE__*/ h({
|
|
81
81
|
catalog: {},
|
|
@@ -86,11 +86,11 @@ var N = { slots: {
|
|
|
86
86
|
}),
|
|
87
87
|
emits: /*@__PURE__*/ h(["close"], ["update:open"]),
|
|
88
88
|
setup(n, { emit: o }) {
|
|
89
|
-
let m = o, h = a(n, "open"),
|
|
89
|
+
let m = o, h = a(n, "open"), y = E(), S = y.bootstrap.documents, C = S.types.filter((e) => e.canCreate), w = (S.locales?.locales ?? []).map((e) => ({
|
|
90
90
|
label: $(e),
|
|
91
91
|
value: String(e)
|
|
92
|
-
})),
|
|
93
|
-
let e =
|
|
92
|
+
})), T = f(""), D = f(!1), O = f(""), k = f(""), M = f(!1), N = f(""), z = f(R), B = f(S.locales?.defaultLocale ?? ""), V = f(!1), H = s(() => {
|
|
93
|
+
let e = C.map((e) => ({
|
|
94
94
|
collection: e.collection,
|
|
95
95
|
key: `entry:${e.collection}`,
|
|
96
96
|
kind: "entry",
|
|
@@ -98,14 +98,14 @@ var N = { slots: {
|
|
|
98
98
|
type: e,
|
|
99
99
|
urlHint: e.routes.entry.replace(/:[a-z][\w.]*\*?/giu, "…")
|
|
100
100
|
}));
|
|
101
|
-
return [...
|
|
102
|
-
let t = A(
|
|
101
|
+
return [...C.filter((e) => !n.catalog.entries.value.some((t) => t.document.collection === e.collection && t.document.locale === (B.value || void 0) && t.document.placement.kind === "home")).flatMap((e) => {
|
|
102
|
+
let t = A(S, {
|
|
103
103
|
collection: e.collection,
|
|
104
104
|
locale: B.value || void 0,
|
|
105
105
|
placement: { kind: "home" },
|
|
106
106
|
title: "Home"
|
|
107
107
|
});
|
|
108
|
-
return
|
|
108
|
+
return j(t) || n.catalog.entries.value.some((e) => e.document.path === t.success.path) ? [] : [{
|
|
109
109
|
collection: e.collection,
|
|
110
110
|
key: `home:${e.collection}`,
|
|
111
111
|
kind: "home",
|
|
@@ -116,33 +116,33 @@ var N = { slots: {
|
|
|
116
116
|
}), ...e];
|
|
117
117
|
}), U = s(() => H.value.find((e) => e.key === N.value)), W = s(() => n.catalog.entries.value.find((e) => e.document.collection === U.value?.collection && e.document.locale === (B.value || void 0) && e.document.placement.kind === "home")), Se = s(() => H.value.length > 1 ? "Choose a page type and add a title." : "Add a title to get started."), Ce = s(() => U.value?.kind === "home" ? "Homepage" : z.value === R || z.value === W.value?.document.id ? "Top level" : n.catalog.byId(z.value)?.document.title ?? "Selected location"), we = s(() => {
|
|
118
118
|
let e = [Ce.value];
|
|
119
|
-
return
|
|
119
|
+
return w.length && e.unshift($(B.value)), e.join(" · ");
|
|
120
120
|
}), G = s(() => {
|
|
121
121
|
if (U.value?.kind === "home") return { kind: "home" };
|
|
122
122
|
let e = z.value === R ? W.value?.document.id : z.value;
|
|
123
123
|
return e ? {
|
|
124
124
|
kind: "entry",
|
|
125
125
|
parentDocumentId: e,
|
|
126
|
-
slug:
|
|
126
|
+
slug: k.value
|
|
127
127
|
} : void 0;
|
|
128
128
|
}), K = s(() => {
|
|
129
129
|
let e = U.value, t = G.value;
|
|
130
|
-
if (!e || !t || e.kind === "entry" && !
|
|
130
|
+
if (!e || !t || e.kind === "entry" && !k.value.trim()) return;
|
|
131
131
|
let r = {
|
|
132
132
|
collection: e.collection,
|
|
133
133
|
placement: t,
|
|
134
|
-
title:
|
|
134
|
+
title: O.value || "Untitled"
|
|
135
135
|
}, i = r.placement.kind === "entry" ? n.catalog.byId(r.placement.parentDocumentId)?.document.path : void 0;
|
|
136
|
-
return A(
|
|
136
|
+
return A(S, B.value ? {
|
|
137
137
|
...r,
|
|
138
138
|
locale: B.value
|
|
139
139
|
} : r, i);
|
|
140
140
|
}), q = s(() => {
|
|
141
141
|
let e = K.value;
|
|
142
|
-
return e &&
|
|
142
|
+
return e && se(e) ? e.success : void 0;
|
|
143
143
|
}), J = s(() => {
|
|
144
144
|
let e = K.value;
|
|
145
|
-
return e &&
|
|
145
|
+
return e && j(e) ? e.failure : "";
|
|
146
146
|
}), Y = s(() => q.value && n.catalog.entries.value.some((e) => e.document.path === q.value?.path)), X = s(() => {
|
|
147
147
|
let e = U.value;
|
|
148
148
|
if (!e || e.kind === "home" || !e.type.hierarchy) return [];
|
|
@@ -160,24 +160,24 @@ var N = { slots: {
|
|
|
160
160
|
label: "Top level",
|
|
161
161
|
value: R
|
|
162
162
|
}, ...t];
|
|
163
|
-
}), Z = s(() => !!
|
|
164
|
-
i(
|
|
165
|
-
|
|
163
|
+
}), Z = s(() => !!O.value.trim() && !!U.value && !!q.value && !Y.value);
|
|
164
|
+
i(O, (e) => {
|
|
165
|
+
M.value || (k.value = oe(e));
|
|
166
166
|
}), i(N, () => z.value = R, { flush: "sync" }), i(B, () => {
|
|
167
167
|
z.value = R, U.value || (N.value = Q());
|
|
168
168
|
}, { flush: "sync" }), i(h, (e) => {
|
|
169
|
-
e && (
|
|
169
|
+
e && (T.value = "", O.value = "", k.value = "", M.value = !1, V.value = !1, B.value = n.context?.locale ?? S.locales?.defaultLocale ?? "", N.value = n.context?.collection ? `entry:${n.context.collection}` : Q(), z.value = n.context?.parent === W.value?.document.id ? R : n.context?.parent || R, n.context?.slug && (k.value = n.context.slug, M.value = !0));
|
|
170
170
|
}, { immediate: !0 });
|
|
171
171
|
async function Te() {
|
|
172
172
|
let e = U.value, t = G.value;
|
|
173
|
-
if (Z.value && e && t && !
|
|
174
|
-
|
|
173
|
+
if (Z.value && e && t && !D.value) {
|
|
174
|
+
D.value = !0, T.value = "";
|
|
175
175
|
try {
|
|
176
176
|
let r = {
|
|
177
177
|
collection: e.collection,
|
|
178
178
|
placement: t,
|
|
179
|
-
title:
|
|
180
|
-
}, i = await
|
|
179
|
+
title: O.value
|
|
180
|
+
}, i = await y.gateway.documents.create(B.value ? {
|
|
181
181
|
...r,
|
|
182
182
|
locale: B.value
|
|
183
183
|
} : r);
|
|
@@ -186,9 +186,9 @@ var N = { slots: {
|
|
|
186
186
|
if (!a) throw Error("The page was created but could not be opened.");
|
|
187
187
|
m("close", a.document.id);
|
|
188
188
|
} catch (e) {
|
|
189
|
-
|
|
189
|
+
T.value = ue(e);
|
|
190
190
|
} finally {
|
|
191
|
-
|
|
191
|
+
D.value = !1;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
}
|
|
@@ -203,8 +203,8 @@ var N = { slots: {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return (n, i) => {
|
|
206
|
-
let a =
|
|
207
|
-
return
|
|
206
|
+
let a = ne, o = ee, s = te, f = ie, m = re, y = ce, S = de, C = le, E = ae;
|
|
207
|
+
return x(), p(E, {
|
|
208
208
|
open: h.value,
|
|
209
209
|
"onUpdate:open": i[7] ||= (e) => h.value = e,
|
|
210
210
|
title: "Create page",
|
|
@@ -214,64 +214,64 @@ var N = { slots: {
|
|
|
214
214
|
body: t(() => [e("form", {
|
|
215
215
|
id: "create-document-form",
|
|
216
216
|
class: "space-y-4",
|
|
217
|
-
onSubmit:
|
|
217
|
+
onSubmit: v(Te, ["prevent"])
|
|
218
218
|
}, [
|
|
219
|
-
|
|
219
|
+
T.value ? (x(), p(a, {
|
|
220
220
|
key: 0,
|
|
221
|
-
description:
|
|
221
|
+
description: T.value,
|
|
222
222
|
color: "error",
|
|
223
223
|
variant: "subtle"
|
|
224
|
-
}, null, 8, ["description"])) :
|
|
225
|
-
H.value.length ? H.value.length > 1 ? (
|
|
224
|
+
}, null, 8, ["description"])) : b("", !0),
|
|
225
|
+
H.value.length ? H.value.length > 1 ? (x(), g("fieldset", fe, [i[8] ||= e("legend", { class: "mb-2 text-sm font-medium text-highlighted" }, "Page type", -1), e("div", pe, [(x(!0), g(c, null, r(H.value, (t) => (x(), g("button", {
|
|
226
226
|
key: t.key,
|
|
227
227
|
type: "button",
|
|
228
228
|
"aria-pressed": t.key === N.value,
|
|
229
229
|
class: u(["min-w-28 border-l border-default px-3 py-2 text-center text-sm transition-[color,background-color,transform] duration-150 ease-out first:border-l-0 active:scale-[0.98] motion-reduce:transition-none", t.key === N.value ? "bg-muted font-medium text-highlighted" : "bg-default text-muted hover:bg-muted/50 hover:text-highlighted"]),
|
|
230
230
|
onClick: (e) => N.value = t.key
|
|
231
|
-
}, [e("span", he, d(t.label), 1)], 10, me))), 128))])])) :
|
|
231
|
+
}, [e("span", he, d(t.label), 1)], 10, me))), 128))])])) : b("", !0) : (x(), p(a, {
|
|
232
232
|
key: 1,
|
|
233
233
|
title: "Document creation is not configured",
|
|
234
234
|
description: "A developer needs to make at least one collection creatable in Studio.",
|
|
235
235
|
color: "warning",
|
|
236
236
|
variant: "subtle"
|
|
237
237
|
})),
|
|
238
|
-
U.value ? (
|
|
238
|
+
U.value ? (x(), g("div", P, [l(s, {
|
|
239
239
|
label: "Title",
|
|
240
240
|
required: ""
|
|
241
241
|
}, {
|
|
242
242
|
default: t(() => [l(o, {
|
|
243
|
-
modelValue:
|
|
244
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
243
|
+
modelValue: O.value,
|
|
244
|
+
"onUpdate:modelValue": i[0] ||= (e) => O.value = e,
|
|
245
245
|
autofocus: "",
|
|
246
246
|
placeholder: "About us",
|
|
247
247
|
class: "w-full"
|
|
248
248
|
}, null, 8, ["modelValue"])]),
|
|
249
249
|
_: 1
|
|
250
|
-
})])) :
|
|
251
|
-
U.value ? (
|
|
250
|
+
})])) : b("", !0),
|
|
251
|
+
U.value ? (x(), g("div", F, [l(S, {
|
|
252
252
|
open: V.value,
|
|
253
253
|
"onUpdate:open": i[5] ||= (e) => V.value = e
|
|
254
254
|
}, {
|
|
255
255
|
content: t(() => [e("div", ve, [
|
|
256
|
-
_(
|
|
256
|
+
_(w).length ? (x(), p(s, {
|
|
257
257
|
key: 0,
|
|
258
258
|
label: "Language"
|
|
259
259
|
}, {
|
|
260
260
|
default: t(() => [l(m, {
|
|
261
261
|
modelValue: B.value,
|
|
262
262
|
"onUpdate:modelValue": i[1] ||= (e) => B.value = e,
|
|
263
|
-
items: _(
|
|
263
|
+
items: _(w),
|
|
264
264
|
"value-key": "value",
|
|
265
265
|
class: "w-full"
|
|
266
266
|
}, null, 8, ["modelValue", "items"])]),
|
|
267
267
|
_: 1
|
|
268
|
-
})) :
|
|
269
|
-
U.value.kind === "entry" && U.value.type.hierarchy ? (
|
|
268
|
+
})) : b("", !0),
|
|
269
|
+
U.value.kind === "entry" && U.value.type.hierarchy ? (x(), p(s, {
|
|
270
270
|
key: 1,
|
|
271
271
|
label: "Location",
|
|
272
|
-
class: u(_(
|
|
272
|
+
class: u(_(w).length ? "" : "sm:col-span-2")
|
|
273
273
|
}, {
|
|
274
|
-
default: t(() => [l(
|
|
274
|
+
default: t(() => [l(y, {
|
|
275
275
|
modelValue: z.value,
|
|
276
276
|
"onUpdate:modelValue": i[2] ||= (e) => z.value = e,
|
|
277
277
|
"aria-label": "Location",
|
|
@@ -282,8 +282,8 @@ var N = { slots: {
|
|
|
282
282
|
class: "w-full"
|
|
283
283
|
}, null, 8, ["modelValue", "items"])]),
|
|
284
284
|
_: 1
|
|
285
|
-
}, 8, ["class"])) :
|
|
286
|
-
U.value.kind === "entry" ? (
|
|
285
|
+
}, 8, ["class"])) : b("", !0),
|
|
286
|
+
U.value.kind === "entry" ? (x(), p(s, {
|
|
287
287
|
key: 2,
|
|
288
288
|
label: "Page address",
|
|
289
289
|
description: "The final part of this page's web address.",
|
|
@@ -291,13 +291,13 @@ var N = { slots: {
|
|
|
291
291
|
required: ""
|
|
292
292
|
}, {
|
|
293
293
|
default: t(() => [l(o, {
|
|
294
|
-
modelValue:
|
|
295
|
-
"onUpdate:modelValue": [i[3] ||= (e) =>
|
|
294
|
+
modelValue: k.value,
|
|
295
|
+
"onUpdate:modelValue": [i[3] ||= (e) => k.value = e, i[4] ||= (e) => M.value = !0],
|
|
296
296
|
placeholder: "about-us",
|
|
297
297
|
class: "w-full"
|
|
298
298
|
}, null, 8, ["modelValue"])]),
|
|
299
299
|
_: 1
|
|
300
|
-
})) :
|
|
300
|
+
})) : b("", !0)
|
|
301
301
|
])]),
|
|
302
302
|
default: t(() => [e("button", I, [
|
|
303
303
|
e("span", L, [e("span", ge, d(we.value), 1), e("span", { class: u(["mt-0.5 block truncate font-mono text-xs", Y.value || J.value ? "text-error" : "text-highlighted"]) }, d(q.value?.path || U.value.urlHint), 3)]),
|
|
@@ -308,22 +308,22 @@ var N = { slots: {
|
|
|
308
308
|
}, null, 8, ["class"])
|
|
309
309
|
])]),
|
|
310
310
|
_: 1
|
|
311
|
-
}, 8, ["open"])])) :
|
|
312
|
-
Y.value ? (
|
|
311
|
+
}, 8, ["open"])])) : b("", !0),
|
|
312
|
+
Y.value ? (x(), g("p", ye, "This page address is already in use.")) : J.value ? (x(), g("p", be, d(J.value), 1)) : b("", !0)
|
|
313
313
|
], 32)]),
|
|
314
|
-
footer: t(() => [e("div", xe, [l(
|
|
314
|
+
footer: t(() => [e("div", xe, [l(C, {
|
|
315
315
|
color: "neutral",
|
|
316
316
|
variant: "ghost",
|
|
317
317
|
label: "Cancel",
|
|
318
318
|
class: "transition-transform duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none",
|
|
319
319
|
onClick: i[6] ||= (e) => h.value = !1
|
|
320
|
-
}), l(
|
|
320
|
+
}), l(C, {
|
|
321
321
|
type: "submit",
|
|
322
322
|
form: "create-document-form",
|
|
323
323
|
color: "neutral",
|
|
324
324
|
label: "Create page",
|
|
325
325
|
class: "transition-transform duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none",
|
|
326
|
-
loading:
|
|
326
|
+
loading: D.value,
|
|
327
327
|
disabled: !Z.value
|
|
328
328
|
}, null, 8, ["loading", "disabled"])])]),
|
|
329
329
|
_: 1
|