smoodly 0.0.55 → 0.0.57
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/admin/editor/PageSettings.js +3 -2
- package/dist/admin/editor/global-edit.js +5 -2
- package/dist/admin/files.generated.js +1 -1
- package/dist/admin/forms/FieldWidget.js +4 -1
- package/dist/admin/shell/IconRail.js +13 -8
- package/dist/admin/shell/console-links.d.ts +3 -0
- package/dist/admin/shell/console-links.js +8 -3
- package/dist/admin/tree-ops.js +6 -2
- package/dist/admin/ui/theme.js +25 -12
- package/dist/admin/validate.d.ts +4 -0
- package/dist/admin/validate.js +9 -0
- package/dist/astro/components/RichText.astro +2 -1
- package/dist/astro/preview.d.ts +6 -3
- package/dist/astro/preview.js +25 -12
- package/dist/astro/richtext.js +2 -2
- package/dist/astro/routes/admin.js +2 -2
- package/dist/config.js +6 -3
- package/dist/css.js +4 -0
- package/dist/custom/index.js +3 -0
- package/dist/entry-store.d.ts +3 -0
- package/dist/image/markup.js +19 -3
- package/dist/marks.d.ts +4 -2
- package/dist/marks.js +4 -2
- package/dist/read-shapes.d.ts +1 -0
- package/dist/read-shapes.js +4 -1
- package/dist/registration.d.ts +3 -2
- package/dist/registration.js +7 -2
- package/dist/richtext/index.js +9 -0
- package/dist/richtext-href.d.ts +2 -0
- package/dist/richtext-href.js +2 -0
- package/dist/richtext-render.js +5 -4
- package/dist/store.d.ts +3 -0
- package/dist/store.js +6 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views.js +27 -0
- package/package.json +5 -1
|
@@ -23,10 +23,11 @@ export function PageSettings({ record, locale, registry, path, fixed, redirects,
|
|
|
23
23
|
/** One commit at a time: Enter commits, then the confirm's autofocus blurs the input, and that blur must not ask again. */
|
|
24
24
|
const committing = useRef(false);
|
|
25
25
|
const isHome = record.parentId === null && record.locales[registry.locales.default]?.slug === registry.homePageSlug;
|
|
26
|
-
//
|
|
26
|
+
// Re-seed the inputs when the stored title or slug changes (a rename, a locale switch, a restore) — not on the
|
|
27
|
+
// record's identity: every autosave ack replaces the record, and typing in a field meanwhile must survive it.
|
|
27
28
|
useEffect(() => {
|
|
28
29
|
setDraft({ title: row?.title ?? "", slug: row?.slug ?? "" });
|
|
29
|
-
}, [
|
|
30
|
+
}, [row?.title, row?.slug, locale]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
30
31
|
if (!row)
|
|
31
32
|
return null;
|
|
32
33
|
const commit = async (key) => {
|
|
@@ -102,12 +102,15 @@ export function createGlobalEdit(opts) {
|
|
|
102
102
|
},
|
|
103
103
|
flush: autosave.flush,
|
|
104
104
|
async setStatus(name, status) {
|
|
105
|
-
|
|
106
|
-
if (!item)
|
|
105
|
+
if (!items[name])
|
|
107
106
|
return { ok: false, code: "not_found", message: "This item hasn't loaded yet." };
|
|
108
107
|
if (!(await autosave.flush())) {
|
|
109
108
|
return { ok: false, code: "internal", message: "Couldn't save your latest changes — publish cancelled." };
|
|
110
109
|
}
|
|
110
|
+
// Read the item after the flush: a save it landed replaced the record, and with it the token.
|
|
111
|
+
const item = items[name];
|
|
112
|
+
if (!item)
|
|
113
|
+
return { ok: false, code: "not_found", message: "This item hasn't loaded yet." };
|
|
111
114
|
let r;
|
|
112
115
|
try {
|
|
113
116
|
r = await opts.ops.globals.setStatus(name, item.locale, status, draftToken(item.record.locales[item.locale]));
|