smoodly 0.0.46 → 0.0.48
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/browser/main.js +2 -0
- package/dist/admin/client-ops.js +1 -0
- package/dist/admin/delivery-mode.d.ts +5 -0
- package/dist/admin/delivery-mode.js +20 -0
- package/dist/admin/editor/EditorView.js +3 -0
- package/dist/admin/files.generated.js +1 -1
- package/dist/admin/handler.d.ts +5 -1
- package/dist/admin/handler.js +2 -1
- package/dist/admin/health.d.ts +4 -0
- package/dist/admin/ops-impl.d.ts +13 -0
- package/dist/admin/ops-impl.js +48 -2
- package/dist/admin/ops.d.ts +11 -0
- package/dist/admin/page-data.d.ts +2 -0
- package/dist/admin/shell/AdminApp.js +47 -1
- package/dist/admin/shell/ContentHealthPage.js +3 -1
- package/dist/admin/shell/EntryForm.js +3 -0
- package/dist/admin/shell/GlobalForm.js +5 -1
- package/dist/admin/shell/IconRail.d.ts +8 -1
- package/dist/admin/shell/IconRail.js +8 -3
- package/dist/admin/shell/deploy-tile.d.ts +20 -0
- package/dist/admin/shell/deploy-tile.js +35 -0
- package/dist/admin/ui/PublishControl.js +3 -1
- package/dist/admin/ui/theme.js +12 -0
- package/dist/astro/deploy-deps.d.ts +10 -0
- package/dist/astro/deploy-deps.js +8 -0
- package/dist/astro/index.d.ts +9 -4
- package/dist/astro/index.js +75 -15
- package/dist/astro/middleware.js +4 -0
- package/dist/astro/routes/admin.js +2 -1
- package/dist/astro/routes/preview.astro +17 -5
- package/dist/astro/routes/static-page.astro +21 -0
- package/dist/astro/runtime.d.ts +6 -0
- package/dist/astro/runtime.js +4 -1
- package/dist/astro/server.d.ts +6 -0
- package/dist/astro/server.js +7 -1
- package/dist/astro/static.d.ts +36 -0
- package/dist/astro/static.js +59 -0
- package/dist/cli/load-config.d.ts +3 -0
- package/dist/cli/load-config.js +8 -1
- package/dist/cli/migrate.d.ts +10 -0
- package/dist/cli/migrate.js +22 -1
- package/dist/cli/space-io.js +3 -3
- package/dist/deploy-state.d.ts +28 -0
- package/dist/deploy-state.js +31 -0
- package/dist/document-stamp.d.ts +7 -0
- package/dist/document-stamp.js +48 -0
- package/dist/project.d.ts +22 -3
- package/dist/project.js +33 -12
- package/dist/published.d.ts +50 -4
- package/dist/published.js +46 -7
- package/dist/schema-version.d.ts +1 -1
- package/dist/schema-version.js +1 -1
- package/dist/site.d.ts +2 -0
- package/dist/site.js +53 -11
- package/dist/sql-space.d.ts +4 -2
- package/dist/sql-space.js +4 -2
- package/dist/sql.js +20 -1
- package/dist/supabase-published-store.d.ts +24 -3
- package/dist/supabase-published-store.js +104 -5
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/migrations/20261008120000_smoodly_v10.sql +47 -0
- package/migrations/20261009120000_smoodly_v11.sql +49 -0
- package/package.json +1 -1
|
@@ -5,12 +5,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { createRoot } from "react-dom/client";
|
|
6
6
|
import { ADMIN_DATA_ID, ADMIN_ROOT_ID } from "../page-data.js";
|
|
7
7
|
import { setPreviewBase } from "../editor/canvas-address.js";
|
|
8
|
+
import { setDelivery } from "../delivery-mode.js";
|
|
8
9
|
import { AdminApp } from "../shell/AdminApp.js";
|
|
9
10
|
import { fontFaceCss } from "../ui/fonts.js";
|
|
10
11
|
import { ADMIN_CSS } from "../ui/theme.js";
|
|
11
12
|
import { fetchOp } from "./fetch-op.js";
|
|
12
13
|
const data = JSON.parse(document.getElementById(ADMIN_DATA_ID).textContent ?? "");
|
|
13
14
|
setPreviewBase(data.previewBase ?? "");
|
|
15
|
+
setDelivery(data.delivery ?? "live");
|
|
14
16
|
// One <style>, fonts first: the canvas copies this element's text into the site's frame (editor/useInlineSession.ts).
|
|
15
17
|
const style = document.createElement("style");
|
|
16
18
|
style.setAttribute("data-smoodly-admin-styles", "");
|
package/dist/admin/client-ops.js
CHANGED
|
@@ -8,6 +8,7 @@ const GROUPS = {
|
|
|
8
8
|
health: ["scan"],
|
|
9
9
|
schema: ["status"],
|
|
10
10
|
preview: ["enable", "disable"],
|
|
11
|
+
deploy: ["status", "trigger"],
|
|
11
12
|
};
|
|
12
13
|
/** `onExpired` runs when the server refuses the token outright (gateAdminOp's `expired`): the browser
|
|
13
14
|
* still holds a session the auth project no longer knows — after a database reset, a deleted user —
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function setDelivery(value: "live" | "static"): void;
|
|
2
|
+
export declare const delivery: () => "live" | "static";
|
|
3
|
+
/** A publish succeeded somewhere in the admin: the shell re-reads deploy.status. */
|
|
4
|
+
export declare function notePublished(): void;
|
|
5
|
+
export declare function onPublished(listener: () => void): () => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// packages/smoodly/src/admin/delivery-mode.ts
|
|
2
|
+
// Which delivery mode the site runs (spec 2026-10-09 static mode §6): the server names it once, in the
|
|
3
|
+
// page's data, and the shell shows the Deploy tile for a static site. Module state, set by the browser
|
|
4
|
+
// entry before the shell mounts, like the preview base (editor/canvas-address.ts). The publish controls
|
|
5
|
+
// tell the shell when a publish landed, so the tile's count refreshes at once.
|
|
6
|
+
let mode = "live";
|
|
7
|
+
const listeners = new Set();
|
|
8
|
+
export function setDelivery(value) {
|
|
9
|
+
mode = value;
|
|
10
|
+
}
|
|
11
|
+
export const delivery = () => mode;
|
|
12
|
+
/** A publish succeeded somewhere in the admin: the shell re-reads deploy.status. */
|
|
13
|
+
export function notePublished() {
|
|
14
|
+
for (const listener of listeners)
|
|
15
|
+
listener();
|
|
16
|
+
}
|
|
17
|
+
export function onPublished(listener) {
|
|
18
|
+
listeners.add(listener);
|
|
19
|
+
return () => void listeners.delete(listener);
|
|
20
|
+
}
|
|
@@ -29,6 +29,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
29
29
|
// that knows about Next, and it ships to the site, not the admin.
|
|
30
30
|
import { Eye } from "lucide-react";
|
|
31
31
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
32
|
+
import { notePublished } from "../delivery-mode.js";
|
|
32
33
|
import { CSS_KEY, GLOBAL_NODE_TYPE, SETTINGS_KEY, STYLES_KEY, globalNameOf } from "../../global.js";
|
|
33
34
|
import { descriptorAt, getAtPath, unsetAtPath } from "../field-paths.js";
|
|
34
35
|
import { FieldWidget } from "../forms/FieldWidget.js";
|
|
@@ -670,6 +671,7 @@ export function EditorView({ ops, registry, id }) {
|
|
|
670
671
|
setRecord(result.data);
|
|
671
672
|
presence?.announce(pageTarget(locale), result.data.locales[locale]?.draftSavedAt ?? null);
|
|
672
673
|
setPublished(true);
|
|
674
|
+
notePublished();
|
|
673
675
|
setTimeout(() => setPublished(false), 1600);
|
|
674
676
|
}
|
|
675
677
|
else if (isStale(result)) {
|
|
@@ -727,6 +729,7 @@ export function EditorView({ ops, registry, id }) {
|
|
|
727
729
|
return;
|
|
728
730
|
}
|
|
729
731
|
setRecord(result.data);
|
|
732
|
+
notePublished(); // an unpublish is a change waiting on a static site too
|
|
730
733
|
};
|
|
731
734
|
/** History: flush first so the list's draft row is current, then list the locale's versions. */
|
|
732
735
|
const doHistory = async () => {
|