@drawnagency/primitives 0.1.97 → 0.1.98

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 (44) hide show
  1. package/dist/{chunk-F2337B35.js → chunk-26ALJO4K.js} +1 -1
  2. package/dist/{chunk-S4L3ZFKM.js → chunk-3COSXTOY.js} +1 -1
  3. package/dist/{chunk-RHWWQV3J.js → chunk-BGHWUJFV.js} +1 -0
  4. package/dist/{chunk-YDXBJR74.js → chunk-EWNDBKYK.js} +1 -1
  5. package/dist/{chunk-XYCCXKVC.js → chunk-FOY5TF7D.js} +1 -1
  6. package/dist/{chunk-II3X7GLJ.js → chunk-GYCBWGVW.js} +1 -1
  7. package/dist/{chunk-FOEZNEF5.js → chunk-HKHEAH5F.js} +6 -6
  8. package/dist/{chunk-5BFPJWIO.js → chunk-KP4DWTPR.js} +3 -3
  9. package/dist/{chunk-KPP2CFW6.js → chunk-MUTHF2GT.js} +2 -2
  10. package/dist/{chunk-QEHPGA5N.js → chunk-NA5EJM6Z.js} +1 -1
  11. package/dist/chunk-TGNS7D4F.js +200 -0
  12. package/dist/collab/rebase.js +1 -1
  13. package/dist/components/editor/index.js +5 -5
  14. package/dist/components/primitives/index.js +6 -6
  15. package/dist/components/sections/brand-guide.js +6 -6
  16. package/dist/components/sections/register-schemas.js +9 -9
  17. package/dist/components/sections/register.js +9 -9
  18. package/dist/components/shell/EditorShell.d.ts.map +1 -1
  19. package/dist/hooks/useEditorPersistence.d.ts +7 -0
  20. package/dist/hooks/useEditorPersistence.d.ts.map +1 -1
  21. package/dist/index.js +12 -10
  22. package/dist/lib/dexie.d.ts.map +1 -1
  23. package/dist/lib/dexie.js +6 -1
  24. package/dist/lib/index-ops.d.ts +138 -2
  25. package/dist/lib/index-ops.d.ts.map +1 -1
  26. package/dist/lib/index-ops.js +176 -8
  27. package/dist/lib/index.js +4 -4
  28. package/dist/media/index.js +3 -3
  29. package/dist/media/provider.d.ts +0 -1
  30. package/dist/media/provider.d.ts.map +1 -1
  31. package/dist/schemas/index.js +4 -2
  32. package/dist/schemas/site-config.d.ts +1 -0
  33. package/dist/schemas/site-config.d.ts.map +1 -1
  34. package/dist/types/database.d.ts +0 -3
  35. package/dist/types/database.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/components/shell/EditorShell.tsx +27 -8
  38. package/src/hooks/useEditorPersistence.ts +14 -0
  39. package/src/lib/dexie.ts +6 -1
  40. package/src/lib/index-ops.ts +261 -7
  41. package/src/media/provider.ts +0 -1
  42. package/src/schemas/site-config.ts +3 -1
  43. package/src/types/database.ts +0 -3
  44. package/dist/chunk-ZD6XGRQM.js +0 -85
@@ -1,5 +1,29 @@
1
1
  import { z } from "zod";
2
- import { type SiteIndex } from "../schemas/site-config";
2
+ import { PageStatusSchema, type SiteIndex } from "../schemas/site-config";
3
+ /**
4
+ * Server-applied index deltas for the MCP connector's save path. An agent
5
+ * cannot reliably hand-transcribe a real site's 40–51 KB index into a tool
6
+ * parameter (two consecutive attempts each introduced an id-level slip), so
7
+ * structural edits are expressed as ops and applied here against the index the
8
+ * write is concurrency-checked against.
9
+ *
10
+ * Pure by contract: no I/O, no storage, no octokit. The caller owns reading the
11
+ * base index at the right commit and committing the result.
12
+ */
13
+ declare const OpStatusSchema: z.ZodEnum<{
14
+ draft: "draft";
15
+ live: "live";
16
+ archived: "archived";
17
+ }>;
18
+ declare const SectionInsertSchema: z.ZodObject<{
19
+ id: z.ZodString;
20
+ status: z.ZodOptional<z.ZodEnum<{
21
+ draft: "draft";
22
+ live: "live";
23
+ archived: "archived";
24
+ }>>;
25
+ access: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ }, z.core.$strip>;
3
27
  export declare const IndexOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
28
  op: z.ZodLiteral<"insertAfter">;
5
29
  pageId: z.ZodString;
@@ -50,8 +74,119 @@ export declare const IndexOpSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
74
  slug: z.ZodOptional<z.ZodString>;
51
75
  showInNav: z.ZodOptional<z.ZodBoolean>;
52
76
  access: z.ZodOptional<z.ZodArray<z.ZodString>>;
77
+ status: z.ZodOptional<z.ZodEnum<{
78
+ live: "live";
79
+ archived: "archived";
80
+ }>>;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ op: z.ZodLiteral<"addPage">;
83
+ id: z.ZodString;
84
+ title: z.ZodString;
85
+ slug: z.ZodOptional<z.ZodString>;
86
+ showInNav: z.ZodOptional<z.ZodBoolean>;
87
+ access: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ navGroupId: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ op: z.ZodLiteral<"removePage">;
91
+ pageId: z.ZodString;
92
+ removeSections: z.ZodOptional<z.ZodBoolean>;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ op: z.ZodLiteral<"addNavGroup">;
95
+ id: z.ZodString;
96
+ label: z.ZodOptional<z.ZodString>;
97
+ startCollapsed: z.ZodOptional<z.ZodBoolean>;
98
+ pageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ op: z.ZodLiteral<"removeNavGroup">;
101
+ groupId: z.ZodString;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ op: z.ZodLiteral<"setNavGroupMeta">;
104
+ groupId: z.ZodString;
105
+ label: z.ZodOptional<z.ZodString>;
106
+ startCollapsed: z.ZodOptional<z.ZodBoolean>;
107
+ }, z.core.$strip>, z.ZodObject<{
108
+ op: z.ZodLiteral<"movePageInNav">;
109
+ pageId: z.ZodString;
110
+ groupId: z.ZodNullable<z.ZodString>;
111
+ position: z.ZodOptional<z.ZodNumber>;
53
112
  }, z.core.$strip>], "op">;
54
- export type IndexOp = z.infer<typeof IndexOpSchema>;
113
+ /**
114
+ * Written out rather than `z.infer<typeof IndexOpSchema>`.
115
+ *
116
+ * The MCP SDK infers a tool's handler and JSON-Schema types from the Zod shape it
117
+ * is registered with, and at twelve union members each carrying several described
118
+ * optionals, re-deriving this union at that boundary overflowed tsc's stack — the
119
+ * `apps/mcp` typecheck segfaulted rather than failing with a diagnostic. Naming
120
+ * the type once caps that inference: consumers see this union directly instead of
121
+ * re-deriving it through the schema. `assertIndexOpTypesMatchSchema` in
122
+ * tests/lib/index-ops.test.ts pins the two together so they cannot drift.
123
+ */
124
+ export type IndexOp = {
125
+ op: "insertAfter";
126
+ pageId: string;
127
+ afterId: string | null;
128
+ sections: SectionInsert[];
129
+ } | {
130
+ op: "insertAt";
131
+ pageId: string;
132
+ position: number;
133
+ sections: SectionInsert[];
134
+ } | {
135
+ op: "move";
136
+ pageId: string;
137
+ id: string;
138
+ afterId: string | null;
139
+ } | {
140
+ op: "remove";
141
+ ids: string[];
142
+ } | {
143
+ op: "setMeta";
144
+ id: string;
145
+ status?: OpStatus;
146
+ access?: string[];
147
+ } | {
148
+ op: "setPageMeta";
149
+ pageId: string;
150
+ title?: string;
151
+ slug?: string;
152
+ showInNav?: boolean;
153
+ access?: string[];
154
+ status?: PageStatus;
155
+ } | {
156
+ op: "addPage";
157
+ id: string;
158
+ title: string;
159
+ slug?: string;
160
+ showInNav?: boolean;
161
+ access?: string[];
162
+ navGroupId?: string;
163
+ } | {
164
+ op: "removePage";
165
+ pageId: string;
166
+ removeSections?: boolean;
167
+ } | {
168
+ op: "addNavGroup";
169
+ id: string;
170
+ label?: string;
171
+ startCollapsed?: boolean;
172
+ pageIds?: string[];
173
+ } | {
174
+ op: "removeNavGroup";
175
+ groupId: string;
176
+ } | {
177
+ op: "setNavGroupMeta";
178
+ groupId: string;
179
+ label?: string;
180
+ startCollapsed?: boolean;
181
+ } | {
182
+ op: "movePageInNav";
183
+ pageId: string;
184
+ groupId: string | null;
185
+ position?: number;
186
+ };
187
+ type OpStatus = z.infer<typeof OpStatusSchema>;
188
+ type PageStatus = z.infer<typeof PageStatusSchema>;
189
+ type SectionInsert = z.infer<typeof SectionInsertSchema>;
55
190
  export type ApplyIndexOpsResult = {
56
191
  ok: true;
57
192
  index: SiteIndex;
@@ -74,4 +209,5 @@ export declare function collectPostedTypes(sections: {
74
209
  */
75
210
  export declare function opTouchedSectionIds(ops: IndexOp[]): string[];
76
211
  export declare function applyIndexOps(rawIndex: unknown, ops: IndexOp[], newSectionTypes: Record<string, string>): ApplyIndexOpsResult;
212
+ export {};
77
213
  //# sourceMappingURL=index-ops.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-ops.d.ts","sourceRoot":"","sources":["../../src/lib/index-ops.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA+B,KAAK,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAgCvG,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAqCxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GACxE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOnH;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAQ5D;AAID,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,OA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AAEvF,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC/C,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACnD,KAAK,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GACxE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOnH;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAQ5D;AAiCD,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,OAAO,EACjB,GAAG,EAAE,OAAO,EAAE,EACd,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,mBAAmB,CAiVrB"}
@@ -1,7 +1,23 @@
1
+ import {
2
+ addGroup,
3
+ addPage,
4
+ deleteGroup,
5
+ deletePage,
6
+ groupOfPage,
7
+ moveNavEntry,
8
+ navEntries,
9
+ reconcileNav,
10
+ renameGroup,
11
+ setGroupStartCollapsed,
12
+ slugifyPageSlug,
13
+ uniquePageSlug
14
+ } from "../chunk-TGNS7D4F.js";
1
15
  import {
2
16
  IndexSchema,
3
- RESERVED_SLUGS
4
- } from "../chunk-RHWWQV3J.js";
17
+ PageStatusSchema,
18
+ RESERVED_SLUGS,
19
+ SLUG_RE
20
+ } from "../chunk-BGHWUJFV.js";
5
21
  import "../chunk-FM4M4Q2W.js";
6
22
  import "../chunk-JSBRDJBE.js";
7
23
 
@@ -9,6 +25,7 @@ import "../chunk-JSBRDJBE.js";
9
25
  import { z } from "zod";
10
26
  var OpStatusSchema = z.enum(["draft", "live", "archived"]);
11
27
  var SAFE_SECTION_ID = /^[a-zA-Z0-9_-]{1,64}$/;
28
+ var SAFE_ENTITY_ID = /^[a-zA-Z0-9_-]{1,64}$/;
12
29
  var SectionInsertSchema = z.object({
13
30
  id: z.string().regex(SAFE_SECTION_ID, "Section ids may only contain letters, numbers, dashes and underscores (max 64 chars) \u2014 they become filenames.").describe("The new section's id: letters, numbers, dashes, underscores; max 64 chars. Must not already exist in the index."),
14
31
  status: OpStatusSchema.optional().describe('Defaults to "draft" \u2014 invisible to viewers until promoted to "live".'),
@@ -49,7 +66,45 @@ var IndexOpSchema = z.discriminatedUnion("op", [
49
66
  title: z.string().optional().describe("New page title."),
50
67
  slug: z.string().optional().describe("New URL slug (lowercase words joined by dashes). Not settable on the home page, whose slug is always empty."),
51
68
  showInNav: z.boolean().optional().describe("Whether the page appears in site navigation."),
52
- access: z.array(z.string()).optional().describe("New audience slugs from list_audiences; [] means everyone.")
69
+ access: z.array(z.string()).optional().describe("New audience slugs from list_audiences; [] means everyone."),
70
+ status: PageStatusSchema.optional().describe('Page status. "archived" hides the page and its sections from viewers without deleting anything; the home page cannot be archived.')
71
+ }),
72
+ z.object({
73
+ op: z.literal("addPage"),
74
+ id: z.string().regex(SAFE_ENTITY_ID, "Page ids may only contain letters, numbers, dashes and underscores (max 64 chars).").describe("The new page's id: letters, numbers, dashes, underscores; max 64 chars. Must not already exist."),
75
+ title: z.string().describe("Page title, shown in navigation."),
76
+ slug: z.string().optional().describe("URL slug (lowercase words joined by dashes). Defaults to a unique slug derived from the title."),
77
+ showInNav: z.boolean().optional().describe("Whether the page appears in site navigation. Defaults to true."),
78
+ access: z.array(z.string()).optional().describe("Audience slugs from list_audiences. Defaults to [] (everyone)."),
79
+ navGroupId: z.string().optional().describe("Put the new page inside this existing nav group instead of at the top level.")
80
+ }),
81
+ z.object({
82
+ op: z.literal("removePage"),
83
+ pageId: z.string().describe("The page to delete. The home page cannot be deleted."),
84
+ removeSections: z.boolean().optional().describe("Required `true` when the page still holds sections \u2014 they are deleted with it and their content files removed. Without it a non-empty page is refused, so a page is never emptied by accident.")
85
+ }),
86
+ z.object({
87
+ op: z.literal("addNavGroup"),
88
+ id: z.string().regex(SAFE_ENTITY_ID, "Nav group ids may only contain letters, numbers, dashes and underscores (max 64 chars).").describe("The new group's id: letters, numbers, dashes, underscores; max 64 chars."),
89
+ label: z.string().optional().describe('Group heading in the sidebar. Blank renders as "Untitled group".'),
90
+ startCollapsed: z.boolean().optional().describe("Whether the group renders collapsed on first viewer load. Defaults to false."),
91
+ pageIds: z.array(z.string()).optional().describe("Existing page ids to move into the group, in order. A page belongs to at most one group, so listing it here removes it from wherever it was.")
92
+ }),
93
+ z.object({
94
+ op: z.literal("removeNavGroup"),
95
+ groupId: z.string().describe("The group to remove. Its member pages are NOT deleted \u2014 they become top-level nav entries at the group's former position.")
96
+ }),
97
+ z.object({
98
+ op: z.literal("setNavGroupMeta"),
99
+ groupId: z.string().describe("An existing nav group id."),
100
+ label: z.string().optional().describe("New sidebar heading."),
101
+ startCollapsed: z.boolean().optional().describe("Whether the group renders collapsed on first viewer load.")
102
+ }),
103
+ z.object({
104
+ op: z.literal("movePageInNav"),
105
+ pageId: z.string().describe("The page to reposition in the sidebar."),
106
+ groupId: z.string().nullable().describe("Destination group id, or null to move the page out to the top level."),
107
+ position: z.number().int().min(0).optional().describe("0-based slot within the destination (inside the group, or among top-level nav entries). Defaults to the end.")
53
108
  })
54
109
  ]);
55
110
  function collectPostedTypes(sections) {
@@ -70,6 +125,13 @@ function opTouchedSectionIds(ops) {
70
125
  return [...ids];
71
126
  }
72
127
  var fmt = (ids) => ids.map((id) => `"${id}"`).join(", ");
128
+ function moveIntoGroup(index, pageId, groupId, position) {
129
+ const entries = navEntries(index);
130
+ const currentGroup = groupOfPage(index, pageId);
131
+ const from = currentGroup ? { groupId: currentGroup.id, index: currentGroup.pageIds.indexOf(pageId) } : { groupId: null, index: entries.findIndex((e) => e.kind === "page" && e.pageId === pageId) };
132
+ const destLength = groupId === null ? entries.length : entries.find((e) => e.kind === "group" && e.id === groupId)?.pageIds.length ?? 0;
133
+ return moveNavEntry(index, from, { groupId, index: position ?? destLength });
134
+ }
73
135
  function applyIndexOps(rawIndex, ops, newSectionTypes) {
74
136
  const base = IndexSchema.safeParse(rawIndex);
75
137
  if (!base.success) {
@@ -78,14 +140,17 @@ function applyIndexOps(rawIndex, ops, newSectionTypes) {
78
140
  error: "the site's current index could not be parsed, so indexOps cannot be applied \u2014 read it with get_site_index and post a repaired full `index` instead. " + base.error.issues.map((i) => i.message).join("; ")
79
141
  };
80
142
  }
81
- const index = {
143
+ const rawNav = rawIndex?.nav;
144
+ let index = {
82
145
  ...base.data,
83
146
  pages: base.data.pages.map((p) => ({ ...p, order: [...p.order] })),
84
- sections: Object.fromEntries(Object.entries(base.data.sections).map(([k, v]) => [k, { ...v }]))
147
+ sections: Object.fromEntries(Object.entries(base.data.sections).map(([k, v]) => [k, { ...v }])),
148
+ ...Array.isArray(rawNav) ? { nav: rawNav } : {}
85
149
  };
86
150
  const removed = /* @__PURE__ */ new Set();
87
151
  const warnings = [];
88
152
  const fail = (error) => ({ ok: false, error });
153
+ let navTouched = false;
89
154
  for (const [i, op] of ops.entries()) {
90
155
  const at = `indexOps[${i}] ${op.op}`;
91
156
  if (op.op === "insertAfter" || op.op === "insertAt") {
@@ -181,11 +246,112 @@ function applyIndexOps(rawIndex, ops, newSectionTypes) {
181
246
  if (op.access !== void 0) meta.access = op.access;
182
247
  continue;
183
248
  }
184
- if (op.title === void 0 && op.slug === void 0 && op.showInNav === void 0 && op.access === void 0) {
185
- return fail(`${at}: nothing to set \u2014 provide title, slug, showInNav and/or access.`);
249
+ if (op.op === "addPage") {
250
+ if (index.pages.some((p) => p.id === op.id)) {
251
+ return fail(`${at}: a page with id "${op.id}" already exists \u2014 use setPageMeta to edit it.`);
252
+ }
253
+ let slug;
254
+ if (op.slug !== void 0) {
255
+ if (!SLUG_RE.test(op.slug)) {
256
+ return fail(`${at}: slug "${op.slug}" is not a valid URL slug \u2014 use lowercase words joined by dashes (e.g. "brand-guide").`);
257
+ }
258
+ if (RESERVED_SLUGS.includes(op.slug)) {
259
+ return fail(`${at}: slug "${op.slug}" is reserved by a platform route and would shadow this page. Pick another slug.`);
260
+ }
261
+ if (index.pages.some((p) => p.slug === op.slug)) {
262
+ return fail(`${at}: slug "${op.slug}" is already used by another page. Slugs must be unique.`);
263
+ }
264
+ slug = op.slug;
265
+ } else {
266
+ slug = uniquePageSlug(slugifyPageSlug(op.title), index.pages.map((p) => p.slug));
267
+ }
268
+ if (op.navGroupId !== void 0 && !navEntries(index).some((e) => e.kind === "group" && e.id === op.navGroupId)) {
269
+ return fail(`${at}: no nav group with id "${op.navGroupId}" \u2014 create it with addNavGroup first, or omit navGroupId to place the page at the top level.`);
270
+ }
271
+ index = addPage(index, op.id);
272
+ const created = index.pages.find((p) => p.id === op.id);
273
+ created.title = op.title;
274
+ created.slug = slug;
275
+ if (op.showInNav !== void 0) created.showInNav = op.showInNav;
276
+ if (op.access !== void 0) created.access = op.access;
277
+ if (op.navGroupId !== void 0) {
278
+ index = moveIntoGroup(index, op.id, op.navGroupId, void 0);
279
+ }
280
+ navTouched = true;
281
+ continue;
282
+ }
283
+ if (op.op === "removePage") {
284
+ const page2 = index.pages.find((p) => p.id === op.pageId);
285
+ if (!page2) return fail(`${at}: no page with id "${op.pageId}" \u2014 page ids come from get_site_index.`);
286
+ if (page2.isHome) {
287
+ return fail(`${at}: the home page cannot be removed \u2014 it is the site's root. Promote a different page to home in the editor first.`);
288
+ }
289
+ if (page2.order.length > 0 && op.removeSections !== true) {
290
+ return fail(
291
+ `${at}: page "${op.pageId}" still holds ${page2.order.length} section(s) (${fmt(page2.order.slice(0, 5))}${page2.order.length > 5 ? ", \u2026" : ""}). Pass removeSections: true to delete them with the page, or move them elsewhere first with move ops.`
292
+ );
293
+ }
294
+ const result2 = deletePage(index, op.pageId);
295
+ index = result2.index;
296
+ for (const id of result2.removedSectionIds) removed.add(id);
297
+ navTouched = true;
298
+ continue;
299
+ }
300
+ if (op.op === "addNavGroup") {
301
+ const entries = navEntries(index);
302
+ if (entries.some((e) => e.kind === "group" && e.id === op.id)) {
303
+ return fail(`${at}: a nav group with id "${op.id}" already exists \u2014 use setNavGroupMeta to edit it.`);
304
+ }
305
+ const missing = (op.pageIds ?? []).filter((id) => !index.pages.some((p) => p.id === id));
306
+ if (missing.length > 0) {
307
+ return fail(`${at}: no page with id ${fmt(missing)} \u2014 page ids come from get_site_index.`);
308
+ }
309
+ index = addGroup(index, op.id);
310
+ if (op.label !== void 0) index = renameGroup(index, op.id, op.label);
311
+ if (op.startCollapsed !== void 0) index = setGroupStartCollapsed(index, op.id, op.startCollapsed);
312
+ for (const pageId of op.pageIds ?? []) index = moveIntoGroup(index, pageId, op.id, void 0);
313
+ navTouched = true;
314
+ continue;
315
+ }
316
+ if (op.op === "removeNavGroup") {
317
+ if (!navEntries(index).some((e) => e.kind === "group" && e.id === op.groupId)) {
318
+ return fail(`${at}: no nav group with id "${op.groupId}" \u2014 group ids come from the \`nav\` on get_site_index.`);
319
+ }
320
+ index = deleteGroup(index, op.groupId);
321
+ navTouched = true;
322
+ continue;
323
+ }
324
+ if (op.op === "setNavGroupMeta") {
325
+ if (op.label === void 0 && op.startCollapsed === void 0) {
326
+ return fail(`${at}: nothing to set \u2014 provide label and/or startCollapsed.`);
327
+ }
328
+ if (!navEntries(index).some((e) => e.kind === "group" && e.id === op.groupId)) {
329
+ return fail(`${at}: no nav group with id "${op.groupId}" \u2014 group ids come from the \`nav\` on get_site_index.`);
330
+ }
331
+ if (op.label !== void 0) index = renameGroup(index, op.groupId, op.label);
332
+ if (op.startCollapsed !== void 0) index = setGroupStartCollapsed(index, op.groupId, op.startCollapsed);
333
+ navTouched = true;
334
+ continue;
335
+ }
336
+ if (op.op === "movePageInNav") {
337
+ if (!index.pages.some((p) => p.id === op.pageId)) {
338
+ return fail(`${at}: no page with id "${op.pageId}" \u2014 page ids come from get_site_index.`);
339
+ }
340
+ if (op.groupId !== null && !navEntries(index).some((e) => e.kind === "group" && e.id === op.groupId)) {
341
+ return fail(`${at}: no nav group with id "${op.groupId}" \u2014 group ids come from the \`nav\` on get_site_index.`);
342
+ }
343
+ index = moveIntoGroup(index, op.pageId, op.groupId, op.position);
344
+ navTouched = true;
345
+ continue;
346
+ }
347
+ if (op.title === void 0 && op.slug === void 0 && op.showInNav === void 0 && op.access === void 0 && op.status === void 0) {
348
+ return fail(`${at}: nothing to set \u2014 provide title, slug, showInNav, access and/or status.`);
186
349
  }
187
350
  const page = index.pages.find((p) => p.id === op.pageId);
188
351
  if (!page) return fail(`${at}: no page with id "${op.pageId}" \u2014 page ids come from get_site_index.`);
352
+ if (op.status === "archived" && page.isHome) {
353
+ return fail(`${at}: the home page cannot be archived \u2014 it is the site's root. Promote a different page to home in the editor first.`);
354
+ }
189
355
  if (op.slug !== void 0 && page.isHome) {
190
356
  return fail(`${at}: the home page's slug is always empty and cannot be set. Promote a different page to home in the editor if you need to change which page is the root.`);
191
357
  }
@@ -195,6 +361,7 @@ function applyIndexOps(rawIndex, ops, newSectionTypes) {
195
361
  if (op.title !== void 0) page.title = op.title;
196
362
  if (op.slug !== void 0) page.slug = op.slug;
197
363
  if (op.showInNav !== void 0) page.showInNav = op.showInNav;
364
+ if (op.status !== void 0) page.status = op.status;
198
365
  if (op.access !== void 0) {
199
366
  const dropped = page.access.filter((a) => !op.access.includes(a));
200
367
  page.access = op.access;
@@ -213,7 +380,8 @@ function applyIndexOps(rawIndex, ops, newSectionTypes) {
213
380
  if (!validated.success) {
214
381
  return fail(`applying indexOps produced an invalid index: ${validated.error.issues.map((issue) => issue.message).join("; ")}`);
215
382
  }
216
- return { ok: true, index: validated.data, removedIds, warnings };
383
+ const result = navTouched ? { ...validated.data, nav: reconcileNav(index.nav ?? [], validated.data.pages) } : validated.data;
384
+ return { ok: true, index: result, removedIds, warnings };
217
385
  }
218
386
  export {
219
387
  IndexOpSchema,
package/dist/lib/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  safeRedirect,
19
19
  suggestAccessibleOn,
20
20
  wcagLevel
21
- } from "../chunk-QEHPGA5N.js";
21
+ } from "../chunk-NA5EJM6Z.js";
22
22
  import {
23
23
  curatedIcons,
24
24
  getIcon
@@ -38,6 +38,7 @@ import {
38
38
  import {
39
39
  cn
40
40
  } from "../chunk-7EOSDFS3.js";
41
+ import "../chunk-S2L3BPLS.js";
41
42
  import {
42
43
  audiencePasses,
43
44
  groupDisplayLabel,
@@ -45,8 +46,7 @@ import {
45
46
  navEntries,
46
47
  pagesInNavOrder,
47
48
  reconcileNav
48
- } from "../chunk-ZD6XGRQM.js";
49
- import "../chunk-S2L3BPLS.js";
49
+ } from "../chunk-TGNS7D4F.js";
50
50
  import "../chunk-5BM2Y3NJ.js";
51
51
  import "../chunk-HJSE6SK5.js";
52
52
  import "../chunk-TZQPOR5A.js";
@@ -61,7 +61,7 @@ import {
61
61
  registerSchema,
62
62
  registerSection
63
63
  } from "../chunk-VKAGMEKE.js";
64
- import "../chunk-RHWWQV3J.js";
64
+ import "../chunk-BGHWUJFV.js";
65
65
  import "../chunk-FM4M4Q2W.js";
66
66
  import "../chunk-NSCT3AMV.js";
67
67
  import {
@@ -18,15 +18,15 @@ import {
18
18
  resolveMedia,
19
19
  sanitizeMediaName,
20
20
  setMediaProvider
21
- } from "../chunk-S4L3ZFKM.js";
22
- import "../chunk-ZD6XGRQM.js";
21
+ } from "../chunk-3COSXTOY.js";
22
+ import "../chunk-TGNS7D4F.js";
23
23
  import {
24
24
  ImageManifestSchema,
25
25
  MediaConfigSchema,
26
26
  MediaFolderSchema,
27
27
  MediaItemSchema,
28
28
  VariantSchema
29
- } from "../chunk-RHWWQV3J.js";
29
+ } from "../chunk-BGHWUJFV.js";
30
30
  import "../chunk-FM4M4Q2W.js";
31
31
  import "../chunk-JSBRDJBE.js";
32
32
  export {
@@ -1,6 +1,5 @@
1
1
  import type { MediaManifest, MediaItem, ResolvedMedia } from "./types";
2
2
  export interface MediaProvider {
3
- getManifest(): Promise<MediaManifest>;
4
3
  resolve(item: MediaItem, sizes: number[]): ResolvedMedia | null;
5
4
  exists(hash: string, manifest: MediaManifest): boolean;
6
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/media/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,aAAa;IAC5B,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC;IAChE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC;CACxD"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/media/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvE,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI,CAAC;IAChE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC;CACxD"}
@@ -3,7 +3,7 @@ import {
3
3
  AudienceNameSchema,
4
4
  MediaGridOptionsSchema,
5
5
  slugifyAudienceName
6
- } from "../chunk-XYCCXKVC.js";
6
+ } from "../chunk-FOY5TF7D.js";
7
7
  import {
8
8
  AudienceSchema,
9
9
  RoleSchema,
@@ -39,6 +39,7 @@ import {
39
39
  PageSchema,
40
40
  PageStatusSchema,
41
41
  RESERVED_SLUGS,
42
+ SLUG_RE,
42
43
  SectionMetaSchema,
43
44
  SingleMediaReferenceSchema,
44
45
  SiteConfigSchema,
@@ -46,7 +47,7 @@ import {
46
47
  TextLineSchema,
47
48
  VariantSchema,
48
49
  normalizeSiteIndex
49
- } from "../chunk-RHWWQV3J.js";
50
+ } from "../chunk-BGHWUJFV.js";
50
51
  import "../chunk-FM4M4Q2W.js";
51
52
  import "../chunk-NSCT3AMV.js";
52
53
  import "../chunk-JSBRDJBE.js";
@@ -74,6 +75,7 @@ export {
74
75
  PageStatusSchema,
75
76
  RESERVED_SLUGS,
76
77
  RoleSchema,
78
+ SLUG_RE,
77
79
  SectionMetaSchema,
78
80
  SessionSchema,
79
81
  SingleMediaReferenceSchema,
@@ -85,6 +85,7 @@ export declare const PageSchema: z.ZodObject<{
85
85
  }, z.core.$strip>>;
86
86
  }, z.core.$strip>;
87
87
  export type Page = z.infer<typeof PageSchema>;
88
+ export declare const SLUG_RE: RegExp;
88
89
  declare const CanonicalIndexSchema: z.ZodObject<{
89
90
  siteId: z.ZodString;
90
91
  pages: z.ZodArray<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"site-config.d.ts","sourceRoot":"","sources":["../../src/schemas/site-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,YAAY;;;;;+FAExB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;iBAI5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAQ5D,e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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAyE,CAAC;AAElG;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAA;CAAE,CAAC;AAEpF,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,CAE1D;AAMD,eAAO,MAAM,iBAAiB;;;;;iBAM5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAiC5B,CAAC;AACL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmE3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -377,7 +377,6 @@ export type Database = {
377
377
  client_id: string;
378
378
  client_id_issued_at: number | null;
379
379
  client_metadata: Json;
380
- client_secret_hash: string | null;
381
380
  created_at: string;
382
381
  redirect_uris: string[];
383
382
  };
@@ -385,7 +384,6 @@ export type Database = {
385
384
  client_id: string;
386
385
  client_id_issued_at?: number | null;
387
386
  client_metadata?: Json;
388
- client_secret_hash?: string | null;
389
387
  created_at?: string;
390
388
  redirect_uris: string[];
391
389
  };
@@ -393,7 +391,6 @@ export type Database = {
393
391
  client_id?: string;
394
392
  client_id_issued_at?: number | null;
395
393
  client_metadata?: Json;
396
- client_secret_hash?: string | null;
397
394
  created_at?: string;
398
395
  redirect_uris?: string[];
399
396
  };