smoodly 0.0.47 → 0.0.49

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.
Files changed (55) hide show
  1. package/dist/admin/browser/main.js +2 -0
  2. package/dist/admin/client-ops.js +1 -0
  3. package/dist/admin/delivery-mode.d.ts +5 -0
  4. package/dist/admin/delivery-mode.js +20 -0
  5. package/dist/admin/editor/EditorView.js +3 -0
  6. package/dist/admin/files.generated.js +1 -1
  7. package/dist/admin/handler.d.ts +5 -1
  8. package/dist/admin/handler.js +2 -1
  9. package/dist/admin/ops-impl.d.ts +13 -0
  10. package/dist/admin/ops-impl.js +46 -0
  11. package/dist/admin/ops.d.ts +11 -0
  12. package/dist/admin/page-data.d.ts +2 -0
  13. package/dist/admin/shell/AdminApp.js +47 -1
  14. package/dist/admin/shell/EntryForm.js +3 -0
  15. package/dist/admin/shell/GlobalForm.js +5 -1
  16. package/dist/admin/shell/IconRail.d.ts +8 -1
  17. package/dist/admin/shell/IconRail.js +8 -3
  18. package/dist/admin/shell/deploy-tile.d.ts +20 -0
  19. package/dist/admin/shell/deploy-tile.js +35 -0
  20. package/dist/admin/ui/PublishControl.js +3 -1
  21. package/dist/admin/ui/theme.js +12 -0
  22. package/dist/astro/deploy-deps.d.ts +10 -0
  23. package/dist/astro/deploy-deps.js +8 -0
  24. package/dist/astro/index.d.ts +9 -4
  25. package/dist/astro/index.js +75 -15
  26. package/dist/astro/middleware.js +4 -0
  27. package/dist/astro/routes/admin.js +2 -1
  28. package/dist/astro/routes/preview.astro +17 -5
  29. package/dist/astro/routes/static-page.astro +21 -0
  30. package/dist/astro/runtime.d.ts +6 -0
  31. package/dist/astro/runtime.js +4 -1
  32. package/dist/astro/server.d.ts +8 -0
  33. package/dist/astro/server.js +9 -1
  34. package/dist/astro/static.d.ts +39 -0
  35. package/dist/astro/static.js +63 -0
  36. package/dist/cli/load-config.d.ts +3 -0
  37. package/dist/cli/load-config.js +8 -1
  38. package/dist/deploy-state.d.ts +28 -0
  39. package/dist/deploy-state.js +31 -0
  40. package/dist/project.d.ts +3 -0
  41. package/dist/project.js +8 -5
  42. package/dist/published.d.ts +31 -4
  43. package/dist/published.js +35 -7
  44. package/dist/schema-version.d.ts +1 -1
  45. package/dist/schema-version.js +1 -1
  46. package/dist/site.js +2 -2
  47. package/dist/sql-space.d.ts +3 -2
  48. package/dist/sql-space.js +3 -2
  49. package/dist/sql.js +10 -0
  50. package/dist/supabase-published-store.d.ts +14 -3
  51. package/dist/supabase-published-store.js +72 -5
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/migrations/20261009120000_smoodly_v11.sql +49 -0
  55. 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", "");
@@ -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 () => {