@realiizlabs/admin 0.15.9 → 0.16.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.
- package/dist/shell/index.cjs +22 -17
- package/dist/shell/index.cjs.map +1 -1
- package/dist/shell/index.d.cts +1 -1
- package/dist/shell/index.d.ts +1 -1
- package/dist/shell/index.js +22 -17
- package/dist/shell/index.js.map +1 -1
- package/dist/studio/index.cjs +13 -5
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.d.cts +7 -0
- package/dist/studio/index.d.ts +7 -0
- package/dist/studio/index.js +13 -5
- package/dist/studio/index.js.map +1 -1
- package/dist/studio-ui/index.cjs +34 -23
- package/dist/studio-ui/index.cjs.map +1 -1
- package/dist/studio-ui/index.d.cts +17 -3
- package/dist/studio-ui/index.d.ts +17 -3
- package/dist/studio-ui/index.js +35 -24
- package/dist/studio-ui/index.js.map +1 -1
- package/package.json +2 -2
package/dist/studio-ui/index.cjs
CHANGED
|
@@ -13,8 +13,8 @@ var Link3__default = /*#__PURE__*/_interopDefault(Link3);
|
|
|
13
13
|
|
|
14
14
|
// src/studio-ui/context.tsx
|
|
15
15
|
var Ctx = react.createContext(null);
|
|
16
|
-
function StudioProvider({ contentTypes, actions, supportName = "your web team", siteName = "Studio", children }) {
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Ctx.Provider, { value: { contentTypes, actions, supportName, siteName }, children });
|
|
16
|
+
function StudioProvider({ contentTypes, actions, supportName = "your web team", siteName = "Studio", options = {}, children }) {
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Ctx.Provider, { value: { contentTypes, actions, supportName, siteName, options }, children });
|
|
18
18
|
}
|
|
19
19
|
function useStudio() {
|
|
20
20
|
const v = react.useContext(Ctx);
|
|
@@ -22,7 +22,10 @@ function useStudio() {
|
|
|
22
22
|
return v;
|
|
23
23
|
}
|
|
24
24
|
function useEntry(typeId) {
|
|
25
|
-
|
|
25
|
+
const { contentTypes, options } = useStudio();
|
|
26
|
+
const entry = contentTypes[typeId] ?? null;
|
|
27
|
+
const served = options[typeId];
|
|
28
|
+
return react.useMemo(() => entry && served ? { ...entry, options: { ...entry.options, ...served } } : entry, [entry, served]);
|
|
26
29
|
}
|
|
27
30
|
function publicDirOf(entry) {
|
|
28
31
|
return `/${entry.folder.split("/").filter(Boolean).pop() ?? "images"}/`;
|
|
@@ -313,20 +316,22 @@ function AccountMenu({ user, role, theme, onTheme, signOutPath, accountHref, hel
|
|
|
313
316
|
}
|
|
314
317
|
function TopBar({ siteName, productName, logoUrl, homeHref, siteUrl, user, role, theme, onTheme, signOutPath, accountHref, helpHref, version }) {
|
|
315
318
|
return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "rz-topbar", children: [
|
|
316
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rz-topbar__brand", children: [
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
321
|
+
"a",
|
|
322
|
+
{
|
|
323
|
+
href: siteUrl || homeHref,
|
|
324
|
+
className: "rz-topbar__site",
|
|
325
|
+
...siteUrl ? { target: "_blank", rel: "noreferrer", title: "Open the live website in a new tab" } : {},
|
|
326
|
+
children: [
|
|
327
|
+
logoUrl && /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoUrl, alt: "", className: "rz-topbar__logo" }),
|
|
328
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: siteName }),
|
|
329
|
+
siteUrl && /* @__PURE__ */ jsxRuntime.jsx(OutboundArrow, {})
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
),
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rz-topbar__product", children: productName })
|
|
334
|
+
] }),
|
|
330
335
|
user && role && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rz-topbar__right", children: [
|
|
331
336
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "rz-topbar__greeting", "data-testid": "rz-greeting", children: [
|
|
332
337
|
"Welcome back, ",
|
|
@@ -389,11 +394,14 @@ var SHELL_CSS = `
|
|
|
389
394
|
|
|
390
395
|
/* ---- frame ---------------------------------------------------------- */
|
|
391
396
|
.rz-topbar { height: var(--rz-topbar); display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; border-bottom: 1px solid var(--border); background: var(--surface-1); flex-shrink: 0; }
|
|
392
|
-
.rz-topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9375rem;
|
|
397
|
+
.rz-topbar__brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9375rem; }
|
|
398
|
+
.rz-topbar__site { display: inline-flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; }
|
|
399
|
+
.rz-topbar__site:hover { color: var(--signal); }
|
|
393
400
|
.rz-topbar__logo { height: 22px; width: auto; display: block; }
|
|
394
401
|
.rz-topbar__product { font-weight: 400; color: var(--text-secondary); }
|
|
395
|
-
|
|
396
|
-
.rz-
|
|
402
|
+
/* The arrow's width is reserved, so "Studio" never shifts when it fades in. */
|
|
403
|
+
.rz-topbar__site .rz-arrow { color: var(--text-muted); opacity: 0; margin-left: -.25rem; transition: opacity .15s, transform .15s; }
|
|
404
|
+
.rz-topbar__site:hover .rz-arrow { opacity: 1; color: var(--signal); }
|
|
397
405
|
.rz-topbar__right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
|
|
398
406
|
.rz-topbar__greeting { color: var(--text-secondary); font-size: .8rem; }
|
|
399
407
|
.rz-body { display: flex; flex: 1; min-height: 0; }
|
|
@@ -739,7 +747,7 @@ function Tabs({ options, value, onChange, label = "Sections" }) {
|
|
|
739
747
|
}
|
|
740
748
|
|
|
741
749
|
// src/version.ts
|
|
742
|
-
var ADMIN_VERSION = "0.
|
|
750
|
+
var ADMIN_VERSION = "0.16.0" ;
|
|
743
751
|
|
|
744
752
|
// src/studio-ui/css.ts
|
|
745
753
|
var STUDIO_CSS = `
|
|
@@ -3121,7 +3129,7 @@ function toBase64(blob) {
|
|
|
3121
3129
|
r.readAsDataURL(blob);
|
|
3122
3130
|
});
|
|
3123
3131
|
}
|
|
3124
|
-
function ContentEditor({ typeId, initialValues, initialBody, existing = null, isNew = false, footer }) {
|
|
3132
|
+
function ContentEditor({ typeId, initialValues, initialBody, existing = null, isNew = false, replaces = null, footer }) {
|
|
3125
3133
|
const entry = useEntry(typeId);
|
|
3126
3134
|
const { publishContent, previewBody } = useStudio().actions;
|
|
3127
3135
|
const [error, setError] = react.useState(null);
|
|
@@ -3139,7 +3147,7 @@ function ContentEditor({ typeId, initialValues, initialBody, existing = null, is
|
|
|
3139
3147
|
startTransition(async () => {
|
|
3140
3148
|
setError(null);
|
|
3141
3149
|
const images = await pictures.toPayload(s.images, s.body);
|
|
3142
|
-
const result = await publishContent({ type: typeId, frontmatter: s.frontmatter, body: s.body, images, existing: existing ? { number: existing.number, branch: existing.branch } : null });
|
|
3150
|
+
const result = await publishContent({ type: typeId, frontmatter: s.frontmatter, body: s.body, images, existing: existing ? { number: existing.number, branch: existing.branch } : null, replaces });
|
|
3143
3151
|
if (result && result.ok === false) setError(result.error);
|
|
3144
3152
|
resolve();
|
|
3145
3153
|
});
|
|
@@ -3677,6 +3685,7 @@ function StudioEdit({ typeId, slug, frontmatter, body, pending }) {
|
|
|
3677
3685
|
typeId: entry.id,
|
|
3678
3686
|
initialValues: frontmatter,
|
|
3679
3687
|
initialBody: body,
|
|
3688
|
+
replaces: slug,
|
|
3680
3689
|
existing: pending ? { number: pending.number, branch: pending.branch, state: pending.state } : null,
|
|
3681
3690
|
footer: !pending ? /* @__PURE__ */ jsxRuntime.jsx(RemoveItem, { typeId: entry.id, slug }) : void 0
|
|
3682
3691
|
}
|
|
@@ -4992,6 +5001,8 @@ The old listing shows "Rescheduled" with a link to the new date. The new one is
|
|
|
4992
5001
|
|
|
4993
5002
|
You can, for small corrections. But once people have shared the link or put it in a calendar, a visible "moved" trail avoids no-shows on the wrong day.
|
|
4994
5003
|
|
|
5004
|
+
On sites where the date is part of the event's web address, changing the date moves the event to a new address and the old one stops working \u2014 Studio handles the move cleanly (one file, not two), but any link already shared points at nothing. That's the real reason to prefer **Moved to**.
|
|
5005
|
+
|
|
4995
5006
|
## After it's over
|
|
4996
5007
|
|
|
4997
5008
|
Nothing to do. Past events move to the **Past** section automatically the day after they end.
|