smoodly 0.0.52 → 0.0.53

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 (51) hide show
  1. package/dist/admin/client-ops.js +1 -1
  2. package/dist/admin/files.generated.js +1 -1
  3. package/dist/admin/handler.d.ts +1 -1
  4. package/dist/admin/index.d.ts +2 -2
  5. package/dist/admin/ops.d.ts +4 -10
  6. package/dist/admin/page-data.d.ts +1 -1
  7. package/dist/admin/session-flow.d.ts +24 -2
  8. package/dist/admin/session-flow.js +29 -2
  9. package/dist/admin/shell/AdminApp.d.ts +1 -1
  10. package/dist/admin/shell/IconRail.js +5 -4
  11. package/dist/admin/shell/presence.d.ts +1 -1
  12. package/dist/admin/shell/session.d.ts +1 -2
  13. package/dist/admin/shell/session.js +10 -9
  14. package/dist/admin/ui/primitives.js +2 -1
  15. package/dist/api-client.js +1 -1
  16. package/dist/assemble.js +1 -1
  17. package/dist/astro/cache.d.ts +1 -1
  18. package/dist/astro/index.js +11 -6
  19. package/dist/astro/runtime.d.ts +1 -1
  20. package/dist/astro/runtime.js +1 -1
  21. package/dist/astro/shell.d.ts +1 -1
  22. package/dist/astro/shell.js +1 -1
  23. package/dist/content/content-api.d.ts +1 -0
  24. package/dist/content/content-api.js +3 -1
  25. package/dist/css.js +1 -1
  26. package/dist/entry-store.d.ts +5 -5
  27. package/dist/entry-store.js +7 -7
  28. package/dist/image/markup.js +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js +1 -1
  31. package/dist/media-cut.d.ts +1 -1
  32. package/dist/media-cut.js +2 -2
  33. package/dist/media.d.ts +1 -1
  34. package/dist/media.js +2 -2
  35. package/dist/member-store.d.ts +0 -29
  36. package/dist/member-store.js +0 -4
  37. package/dist/paths.d.ts +1 -1
  38. package/dist/paths.js +1 -1
  39. package/dist/revalidate.d.ts +1 -1
  40. package/dist/revalidate.js +1 -1
  41. package/dist/space-transfer.d.ts +1 -1
  42. package/dist/space-transfer.js +1 -1
  43. package/dist/version.d.ts +1 -1
  44. package/dist/version.js +1 -1
  45. package/package.json +1 -1
  46. package/dist/admin/auth-config.d.ts +0 -7
  47. package/dist/admin/auth-config.js +0 -1
  48. package/dist/admin/browser/fetch-op.d.ts +0 -10
  49. package/dist/admin/browser/fetch-op.js +0 -45
  50. package/dist/admin/browser/main.d.ts +0 -1
  51. package/dist/admin/browser/main.js +0 -27
package/dist/paths.js CHANGED
@@ -162,7 +162,7 @@ export function collectionSegment(path, locale, set) {
162
162
  * it is a non-empty string — absent, null, or `""` all mean "no URL".
163
163
  * There is no sibling-slug index: sibling uniqueness is the primary key
164
164
  * of `paths` plus the pre-check each store makes per locale before it
165
- * writes (spec 2026-09-06 §12), so Postgres and memory agree on which
165
+ * writes (spec 2026-09-06 §12), so every store agrees on which
166
166
  * entries can collide. */
167
167
  export const slugOf = (fields) => {
168
168
  const slug = fields.slug;
@@ -26,7 +26,7 @@ export declare const addressesTag: () => string;
26
26
  /** Every published response of a space carries it (spec 2026-10-16 the control plane §4): a push that changed the
27
27
  * registry purges this one tag, and the new schema applies on the next read. */
28
28
  export declare const spaceTag: (space: string) => string;
29
- /** An asset's original and every cut of it at the edge (plan 2026-10-18 media (c) decision 4): its delete purges it. */
29
+ /** An asset's original and every cut of it at the edge (spec 2026-10-18 media on R2 and Images §5): its delete purges it. */
30
30
  export declare const mediaTag: (asset: string) => string;
31
31
  /** Every media file of a space at the edge: the space's delete purges it. Never a content tag, so a publish purges no bytes. */
32
32
  export declare const mediaSpaceTag: (space: string) => string;
@@ -25,7 +25,7 @@ export const addressesTag = () => "addresses";
25
25
  /** Every published response of a space carries it (spec 2026-10-16 the control plane §4): a push that changed the
26
26
  * registry purges this one tag, and the new schema applies on the next read. */
27
27
  export const spaceTag = (space) => `space:${space}`;
28
- /** An asset's original and every cut of it at the edge (plan 2026-10-18 media (c) decision 4): its delete purges it. */
28
+ /** An asset's original and every cut of it at the edge (spec 2026-10-18 media on R2 and Images §5): its delete purges it. */
29
29
  export const mediaTag = (asset) => `media:${asset}`;
30
30
  /** Every media file of a space at the edge: the space's delete purges it. Never a content tag, so a publish purges no bytes. */
31
31
  export const mediaSpaceTag = (space) => `media-space:${space}`;
@@ -27,7 +27,7 @@ export type Manifest = {
27
27
  export declare const INSERT_ORDER: readonly ContentTable[];
28
28
  /** A row's identity inside one space: its primary key without `space_id`. */
29
29
  export declare const ROW_KEY: Record<ContentTable, readonly string[]>;
30
- /** The primary key as Postgres declares it — what "on conflict do nothing" names. */
30
+ /** The primary key, in column order — what the import's skip-duplicates names. */
31
31
  export declare const CONFLICT_COLUMNS: Record<ContentTable, string>;
32
32
  export declare const rowKey: (table: ContentTable, row: Row) => string;
33
33
  /** Sorted by key, so two exports of an unchanged space diff cleanly (spec §7). */
@@ -37,7 +37,7 @@ export const ROW_KEY = {
37
37
  paths: ["locale", "anchor", "path"],
38
38
  assets: ["id"],
39
39
  };
40
- /** The primary key as Postgres declares it — what "on conflict do nothing" names. */
40
+ /** The primary key, in column order — what the import's skip-duplicates names. */
41
41
  export const CONFLICT_COLUMNS = Object.fromEntries(CONTENT_TABLES.map((t) => [t, (t === "paths" ? ["space_id", ...ROW_KEY[t]] : ROW_KEY[t]).join(",")]));
42
42
  export const rowKey = (table, row) => JSON.stringify(ROW_KEY[table].map((c) => row[c]));
43
43
  /** Sorted by key, so two exports of an unchanged space diff cleanly (spec §7). */
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SMOODLY_VERSION = "0.0.52";
1
+ export declare const SMOODLY_VERSION = "0.0.53";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/write-version.mjs from package.json — do not edit.
2
- export const SMOODLY_VERSION = "0.0.52";
2
+ export const SMOODLY_VERSION = "0.0.53";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoodly",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "Open-source, code-first CMS for Astro and Next.js: define a component once, it becomes a typed, editable building block.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,7 +0,0 @@
1
- /** Where the admin sends a person to sign in, and the dashboard its account menu and Members page link to (spec
2
- * 2026-10-16 sign-in and the dashboard §1, §6): `GET /v1/auth` answers it from the Worker's env; the handler and the
3
- * page data carry it. Public values only. */
4
- export type SignInConfig = {
5
- signInUrl: string;
6
- consoleUrl: string;
7
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- import type { AdminOpAction } from "../ops.ts";
2
- /** JSON has no `undefined`: in an array it becomes null, which several ops read as a value (`expected:
3
- * null` is "no draft", `undefined` is "skip the check"). Trailing ones are dropped; one between two
4
- * arguments cannot be sent and is named here. */
5
- export declare function wireArgs(args: unknown[]): unknown[];
6
- /** `fetcher` is the test seam. A network failure rejects; every answer resolves to a typed result.
7
- * One operation at a time, in call order: Next queued server actions per browser, and the admin's reads
8
- * and writes rely on it (a read sent after a save must see that save's token; a save typed during a
9
- * publish must follow the publish). A call that fails does not hold the ones behind it. */
10
- export declare function fetchOp(url: string, fetcher?: typeof fetch): AdminOpAction;
@@ -1,45 +0,0 @@
1
- /** JSON has no `undefined`: in an array it becomes null, which several ops read as a value (`expected:
2
- * null` is "no draft", `undefined` is "skip the check"). Trailing ones are dropped; one between two
3
- * arguments cannot be sent and is named here. */
4
- export function wireArgs(args) {
5
- let end = args.length;
6
- while (end > 0 && args[end - 1] === undefined)
7
- end--;
8
- const out = args.slice(0, end);
9
- if (out.some((a) => a === undefined)) {
10
- throw new Error("smoodly: an operation argument is undefined between two others — pass null or a value; JSON cannot carry undefined.");
11
- }
12
- return out;
13
- }
14
- const noResult = (status) => ({ ok: false, code: "internal", message: `smoodly: the admin API answered ${status} without a result — see the server log.` });
15
- /** `fetcher` is the test seam. A network failure rejects; every answer resolves to a typed result.
16
- * One operation at a time, in call order: Next queued server actions per browser, and the admin's reads
17
- * and writes rely on it (a read sent after a save must see that save's token; a save typed during a
18
- * publish must follow the publish). A call that fails does not hold the ones behind it. */
19
- export function fetchOp(url, fetcher = fetch) {
20
- const send = async (call) => {
21
- const res = await fetcher(url, {
22
- method: "POST",
23
- // The endpoint is the service's origin; the session rides the header, no cookie crosses.
24
- credentials: "omit",
25
- headers: { "content-type": "application/json", ...(call.token ? { authorization: `Bearer ${call.token}` } : {}) },
26
- body: JSON.stringify({ path: call.path, args: wireArgs(call.args) }),
27
- });
28
- let body;
29
- try {
30
- body = await res.json();
31
- }
32
- catch {
33
- return noResult(res.status);
34
- }
35
- if (typeof body === "object" && body !== null && typeof body.ok === "boolean")
36
- return body;
37
- return noResult(res.status);
38
- };
39
- let last = Promise.resolve();
40
- return (call) => {
41
- const run = last.then(() => send(call));
42
- last = run.catch(() => { });
43
- return run;
44
- };
45
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // packages/smoodly/src/admin/browser/main.tsx
3
- // The prebuilt admin's entry (spec 2026-10-02 astro cloud fit §4): reads the page's data, writes the
4
- // stylesheet into the document and mounts the shell. Bundled by scripts/build-admin.ts; no app compiles it.
5
- import { createRoot } from "react-dom/client";
6
- import { ADMIN_DATA_ID, ADMIN_ROOT_ID } from "../page-data.js";
7
- import { setCanvasMarks, setPreviewBase, setPreviewUrl } from "../editor/canvas-address.js";
8
- import { setDelivery } from "../delivery-mode.js";
9
- import { AdminApp } from "../shell/AdminApp.js";
10
- import { setConsole } from "../shell/console-links.js";
11
- import { fontFaceCss } from "../ui/fonts.js";
12
- import { ADMIN_CSS } from "../ui/theme.js";
13
- import { fetchOp } from "./fetch-op.js";
14
- const data = JSON.parse(document.getElementById(ADMIN_DATA_ID).textContent ?? "");
15
- setPreviewBase(data.previewBase ?? "");
16
- setCanvasMarks(data.canvasMarks ?? "query");
17
- setPreviewUrl(data.previewUrl ?? "");
18
- setDelivery(data.delivery ?? "live");
19
- setConsole(data.signIn.consoleUrl, data.spaceId);
20
- // One <style>, fonts first: the canvas copies this element's text into the site's frame (editor/useInlineSession.ts).
21
- const style = document.createElement("style");
22
- style.setAttribute("data-smoodly-admin-styles", "");
23
- style.textContent = `${fontFaceCss(data.filesBase)}\n${ADMIN_CSS}`;
24
- document.head.appendChild(style);
25
- // The page's own background rules did their job (admin/page.ts): the stylesheet owns the look now.
26
- document.querySelector("style[data-smoodly-boot]")?.remove();
27
- createRoot(document.getElementById(ADMIN_ROOT_ID)).render(_jsx(AdminApp, { registry: data.registry, op: fetchOp(data.opUrl), signIn: data.signIn, api: { apiUrl: data.apiUrl, spaceId: data.spaceId }, presenceConfig: data.presence ?? undefined }));