camox 0.71.0 → 0.74.1

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 (104) hide show
  1. package/dist/core/createApp.d.ts +4 -103
  2. package/dist/core/createApp.js +3 -24
  3. package/dist/core/createBlock.d.ts +2 -2
  4. package/dist/core/createBlock.js +41 -185
  5. package/dist/core/createLayout.d.ts +6 -77
  6. package/dist/core/createLayout.js +12 -50
  7. package/dist/core/editing/createEditableBlock.d.ts +9 -75
  8. package/dist/core/editing/createEditableBlock.js +258 -640
  9. package/dist/core/hooks/useIsEditable.js +2 -2
  10. package/dist/core/lib/artifactData.js +8 -3
  11. package/dist/core/lib/contentType.d.ts +23 -38
  12. package/dist/core/lib/contentType.js +34 -62
  13. package/dist/core/lib/iconTypes.d.ts +0 -3
  14. package/dist/core/lib/icons.js +63 -51
  15. package/dist/core/lib/recordScope.js +1 -1
  16. package/dist/features/canvas/CanvasOverlays.js +94 -176
  17. package/dist/features/canvas/CanvasPageFrame.js +62 -68
  18. package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -3
  19. package/dist/features/canvas/canvasOverlayGeometry.js +1 -7
  20. package/dist/features/canvas/sidebar/CuratedPageInspector.js +3 -21
  21. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +1 -2
  22. package/dist/features/canvas/useCanvasCamera.js +1 -1
  23. package/dist/features/canvas/useCanvasFrame.js +1 -1
  24. package/dist/features/content/ContentCollection.js +2 -2
  25. package/dist/features/content/collection-form.js +6 -7
  26. package/dist/features/page/CuratedPageContent.js +15 -24
  27. package/dist/features/page/UnplacedBlockContent.js +1 -6
  28. package/dist/features/preview/CamoxPreview.js +30 -33
  29. package/dist/features/preview/EditablePageContent.js +131 -151
  30. package/dist/features/preview/components/BlockActionsPopover.js +43 -152
  31. package/dist/features/preview/components/CanvasPreview.js +2 -2
  32. package/dist/features/preview/components/Frame.js +3 -3
  33. package/dist/features/preview/components/IconFieldEditor.js +1 -1
  34. package/dist/features/preview/components/ItemFieldsEditor.js +1 -3
  35. package/dist/features/preview/components/Overlays.js +18 -84
  36. package/dist/features/preview/components/PageInfo.js +121 -98
  37. package/dist/features/preview/components/PageTree.js +57 -103
  38. package/dist/features/preview/components/PreviewPanel.js +8 -11
  39. package/dist/features/preview/components/RecordCombobox.js +65 -78
  40. package/dist/features/preview/components/ReferenceFieldEditor.js +1 -19
  41. package/dist/features/preview/components/ReferenceListFieldEditor.js +1 -19
  42. package/dist/features/preview/components/RemovedBlockPlaceholder.js +2 -2
  43. package/dist/features/preview/components/SelectionEditor.js +6 -5
  44. package/dist/features/preview/components/useRepeatableItemActions.js +18 -24
  45. package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
  46. package/dist/features/preview/overlayMessages.js +1 -4
  47. package/dist/features/preview/previewStore.js +3 -23
  48. package/dist/features/renderer/RendererApp.js +17 -141
  49. package/dist/features/renderer/definitionAnswers.js +1 -8
  50. package/dist/features/renderer/rendererHost.js +1 -31
  51. package/dist/features/renderer/studioConnection.js +1 -25
  52. package/dist/features/routes/pageRuntime.js +15 -4
  53. package/dist/features/runtime/ClaimCard.js +192 -0
  54. package/dist/features/runtime/pageApp.js +5 -4
  55. package/dist/features/runtime/runtime.js +29 -8
  56. package/dist/features/runtime/worker.js +2 -2
  57. package/dist/features/runtime/workerRequest.d.ts +6 -0
  58. package/dist/features/runtime/workerRequest.js +13 -1
  59. package/dist/features/runtime/workerRuntime.d.ts +2 -2
  60. package/dist/features/runtime/workerRuntime.js +2 -2
  61. package/dist/features/studio/components/AgentSidebar.js +7 -7
  62. package/dist/features/studio/components/ChatWidget.js +142 -106
  63. package/dist/features/studio/components/ContentFindings.js +127 -230
  64. package/dist/features/studio/components/DeleteDraftDialog.js +112 -0
  65. package/dist/features/studio/components/DraftBar.js +98 -53
  66. package/dist/features/studio/components/DraftsControl.js +203 -190
  67. package/dist/features/studio/components/ReviewDraftDialog.js +670 -0
  68. package/dist/features/studio/components/{Patrol.js → Specialists.js} +291 -330
  69. package/dist/features/studio/components/Squareling.js +5 -5
  70. package/dist/features/studio/components/ThreadComposer.js +106 -127
  71. package/dist/features/studio/components/ThreadMessages.js +137 -45
  72. package/dist/features/studio/findingSentence.js +14 -12
  73. package/dist/features/studio/fixMessage.js +23 -0
  74. package/dist/features/studio/reportSentence.js +1 -1
  75. package/dist/features/studio/{patrollerBio.js → specialistBio.js} +8 -5
  76. package/dist/features/studio/studioStore.js +29 -15
  77. package/dist/features/studio/workingSentence.js +1 -1
  78. package/dist/features/vite/blockBoilerplate.js +1 -1
  79. package/dist/features/vite/definitionsSync.js +1 -8
  80. package/dist/lib/api-client.js +5 -1
  81. package/dist/lib/queries.js +5 -6
  82. package/dist/lib/studio-definitions.js +0 -2
  83. package/dist/lib/studio-reads.d.ts +1 -1
  84. package/dist/lib/studio-reads.js +5 -10
  85. package/dist/lib/use-thread.js +196 -138
  86. package/dist/package.js +1 -1
  87. package/dist/studio-overlays.css +0 -29
  88. package/dist/studio.css +1 -1
  89. package/package.json +4 -4
  90. package/skills/camox/SKILL.md +1 -1
  91. package/skills/camox/references/artifacts.md +4 -4
  92. package/skills/camox/references/block-definitions.md +21 -25
  93. package/skills/camox/references/dom-integrations.md +1 -1
  94. package/skills/camox/references/layout-definitions.md +3 -12
  95. package/skills/camox/references/routed-layouts.md +2 -2
  96. package/skills/camox-expand/SKILL.md +5 -5
  97. package/skills/camoxify/SKILL.md +4 -4
  98. package/dist/features/canvas/canvasInsertionSeams.js +0 -44
  99. package/dist/features/preview/components/AddBlockSheet.js +0 -314
  100. package/dist/features/preview/components/BlockPeek.js +0 -66
  101. package/dist/features/preview/components/BlockThumbnail.js +0 -281
  102. package/dist/features/preview/components/blockGridNavigation.js +0 -15
  103. package/dist/features/preview/referencePickerFocus.js +0 -29
  104. package/dist/features/studio/components/ReviewDraftSheet.js +0 -1587
@@ -22,23 +22,7 @@ interface LayoutBlock<TLayoutOnly extends boolean = boolean> {
22
22
  layoutOnly: TLayoutOnly;
23
23
  Component: React.ComponentType<{
24
24
  blockData: any;
25
- mode: "site" | "peek" | "layout";
26
- isFirstBlock?: boolean;
27
- showAddBlockTop?: boolean;
28
- showAddBlockBottom?: boolean;
29
- addBlockAfterPosition?: string | null;
30
25
  }>;
31
- getInitialBundle: () => {
32
- content: Record<string, unknown>;
33
- settings: Record<string, unknown>;
34
- repeatableItems: Array<{
35
- tempId: string;
36
- parentTempId: string | null;
37
- fieldName: string;
38
- content: Record<string, unknown>;
39
- position: string;
40
- }>;
41
- };
42
26
  };
43
27
  }
44
28
  /**
@@ -49,15 +33,6 @@ interface LayoutBlock<TLayoutOnly extends boolean = boolean> {
49
33
  * instead of the unreadable structural diff on the full Block shape.
50
34
  */
51
35
  type ValidateLayoutOnlyBlocks<T extends readonly LayoutBlock[]> = { [K in keyof T]: T[K] extends LayoutBlock<true> ? T[K] : "❌ Camox: blocks in `blocks.before` and `blocks.after` must be defined with `layoutOnly: true`. Add `layoutOnly: true` to this block's `createBlock` options."; };
52
- /**
53
- * A block module, imported only when Camox seeds the initial page. A static import would put
54
- * the block in every visitor's bundle, since layouts load on every page.
55
- */
56
- type InitialBlockImport = () => Promise<{
57
- block: LayoutBlock;
58
- }>;
59
- declare const INITIAL_LAYOUT_ONLY_ERROR = "❌ Camox: blocks in `blocks.initial` must NOT be `layoutOnly: true` — `initial` is for page-content blocks. Remove `layoutOnly: true` from this block's `createBlock` options.";
60
- type ValidatePageContentBlocks<T extends readonly InitialBlockImport[]> = { [K in keyof T]: Awaited<ReturnType<T[K]>>["block"] extends LayoutBlock<true> ? typeof INITIAL_LAYOUT_ONLY_ERROR : T[K]; };
61
36
  /** Successful ordinary loader result. Data must be JSON-serializable. */
62
37
  export interface LayoutLoaderResult<Data = unknown> {
63
38
  kind: "data";
@@ -185,21 +160,16 @@ export type RecordPages = {
185
160
  field: string;
186
161
  param?: string;
187
162
  };
188
- interface LayoutBaseOptions<TBefore extends readonly LayoutBlock[], TAfter extends readonly LayoutBlock[], TInitial extends readonly InitialBlockImport[]> {
163
+ interface LayoutBaseOptions<TBefore extends readonly LayoutBlock[], TAfter extends readonly LayoutBlock[]> {
189
164
  id: string;
190
165
  title: string;
191
166
  description: string;
192
167
  blocks: {
193
168
  before: ValidateLayoutOnlyBlocks<TBefore>;
194
169
  after: ValidateLayoutOnlyBlocks<TAfter>;
195
- /**
196
- * Ordered list of blocks to create on the initial page when a project is first set up, as
197
- * imports of their modules: `[() => import("../blocks/hero")]`.
198
- */
199
- initial?: ValidatePageContentBlocks<TInitial>;
200
170
  };
201
171
  }
202
- type CreateLayoutOptions<TBefore extends readonly LayoutBlock[], TAfter extends readonly LayoutBlock[], TInitial extends readonly InitialBlockImport[], Result extends LoaderReturn = LoaderReturn, Declared extends LayoutStructuredData | undefined = LayoutStructuredData | undefined> = LayoutBaseOptions<TBefore, TAfter, TInitial> & {
172
+ type CreateLayoutOptions<TBefore extends readonly LayoutBlock[], TAfter extends readonly LayoutBlock[], Result extends LoaderReturn = LoaderReturn, Declared extends LayoutStructuredData | undefined = LayoutStructuredData | undefined> = LayoutBaseOptions<TBefore, TAfter> & {
203
173
  kind?: "curated" | "derived" | "singleton";
204
174
  loader?: (context: LayoutLoaderContext) => Result;
205
175
  /** Lists the pages of a derived layout, for the sitemap and the Canvas. */
@@ -215,11 +185,10 @@ type CreateLayoutOptions<TBefore extends readonly LayoutBlock[], TAfter extends
215
185
  * Every option a layout may define, as the implementation reads them. The public signatures
216
186
  * validated which slot each block may go in.
217
187
  */
218
- type AnyLayoutOptions = Omit<LayoutBaseOptions<any, any, any>, "blocks"> & {
188
+ type AnyLayoutOptions = Omit<LayoutBaseOptions<any, any>, "blocks"> & {
219
189
  blocks: {
220
190
  before: readonly LayoutBlock<true>[];
221
191
  after: readonly LayoutBlock<true>[];
222
- initial?: readonly InitialBlockImport[];
223
192
  };
224
193
  kind?: "curated" | "derived" | "singleton";
225
194
  loader?: (context: LayoutLoaderContext) => LoaderReturn;
@@ -271,41 +240,11 @@ declare function createLayoutDefinition(options: AnyLayoutOptions): {
271
240
  toStructuredData: (context: AnyLayoutContext) => LayoutStructuredData | undefined;
272
241
  blockDefinitions: ({
273
242
  type: string;
274
- content: Record<string, unknown>;
275
- settings: Record<string, unknown>;
276
- repeatableItems: {
277
- tempId: string;
278
- parentTempId: string | null;
279
- fieldName: string;
280
- content: Record<string, unknown>;
281
- position: string;
282
- }[];
283
243
  slot: "before";
284
244
  } | {
285
245
  type: string;
286
- content: Record<string, unknown>;
287
- settings: Record<string, unknown>;
288
- repeatableItems: {
289
- tempId: string;
290
- parentTempId: string | null;
291
- fieldName: string;
292
- content: Record<string, unknown>;
293
- position: string;
294
- }[];
295
246
  slot: "after";
296
247
  })[];
297
- loadInitialBlockBundles: (() => Promise<{
298
- type: string;
299
- content: Record<string, unknown>;
300
- settings: Record<string, unknown>;
301
- repeatableItems: {
302
- tempId: string;
303
- parentTempId: string | null;
304
- fieldName: string;
305
- content: Record<string, unknown>;
306
- position: string;
307
- }[];
308
- }[]>) | undefined;
309
248
  /** Renders the layout around the page, with the page's context as props. */
310
249
  toReact: React.ComponentType<AnyLayoutContext & {
311
250
  children?: React.ReactNode;
@@ -328,7 +267,7 @@ type Params<Id extends string> = Id extends `${infer Head}.${infer Tail}` ? Para
328
267
  type RouteParams<Id extends string> = Id extends keyof LayoutFileRoutes ? LayoutFileRoutes[Id] extends {
329
268
  params: infer P;
330
269
  } ? P : Params<Id> : Params<Id>;
331
- type FileOptions<Id extends string, Result extends LoaderReturn, B extends readonly LayoutBlock[], A extends readonly LayoutBlock[], I extends readonly InitialBlockImport[], Declared extends LayoutStructuredData | undefined> = Omit<LayoutBaseOptions<B, A, I>, "id"> & (({
270
+ type FileOptions<Id extends string, Result extends LoaderReturn, B extends readonly LayoutBlock[], A extends readonly LayoutBlock[], Declared extends LayoutStructuredData | undefined> = Omit<LayoutBaseOptions<B, A>, "id"> & (({
332
271
  kind: "curated";
333
272
  loader?: never;
334
273
  routes?: never;
@@ -338,11 +277,6 @@ type FileOptions<Id extends string, Result extends LoaderReturn, B extends reado
338
277
  children: React.ReactNode;
339
278
  }, Declared>) | ({
340
279
  kind: "singleton";
341
- blocks: {
342
- before: ValidateLayoutOnlyBlocks<B>;
343
- after: ValidateLayoutOnlyBlocks<A>;
344
- initial?: never;
345
- };
346
280
  loader?: (context: LayoutLoaderContext<Record<string, never>>) => Result;
347
281
  routes?: never;
348
282
  recordPages?: never;
@@ -351,11 +285,6 @@ type FileOptions<Id extends string, Result extends LoaderReturn, B extends reado
351
285
  children?: never;
352
286
  }, Declared>) | ({
353
287
  kind: "derived";
354
- blocks: {
355
- before: ValidateLayoutOnlyBlocks<B>;
356
- after: ValidateLayoutOnlyBlocks<A>;
357
- initial?: never;
358
- };
359
288
  loader: (context: LayoutLoaderContext<RouteParams<Id>>) => Result;
360
289
  routes?: (context: LayoutRoutesContext) => RoutesReturn<RouteParams<Id>>;
361
290
  recordPages?: RecordPages;
@@ -363,7 +292,7 @@ type FileOptions<Id extends string, Result extends LoaderReturn, B extends reado
363
292
  } & LayoutOutputs<LoadedContext<LoaderData<Result>, RouteParams<Id>, RecordFields<Result>>, {
364
293
  children?: never;
365
294
  }, Declared>));
366
- export declare function createLayout<const B extends readonly LayoutBlock[], const A extends readonly LayoutBlock[], const I extends readonly InitialBlockImport[] = [], Result extends LoaderReturn = never, Declared extends LayoutStructuredData | undefined = undefined>(options: CreateLayoutOptions<B, A, I, Result, Declared>): LayoutFor<Result>;
367
- export declare function createLayout<const Id extends string>(id: Id): <Result extends LoaderReturn = never, const B extends readonly LayoutBlock[] = [], const A extends readonly LayoutBlock[] = [], const I extends readonly InitialBlockImport[] = [], Declared extends LayoutStructuredData | undefined = undefined>(options: FileOptions<Id, Result, B, A, I, Declared>) => LayoutFor<Result>;
295
+ export declare function createLayout<const B extends readonly LayoutBlock[], const A extends readonly LayoutBlock[], Result extends LoaderReturn = never, Declared extends LayoutStructuredData | undefined = undefined>(options: CreateLayoutOptions<B, A, Result, Declared>): LayoutFor<Result>;
296
+ export declare function createLayout<const Id extends string>(id: Id): <Result extends LoaderReturn = never, const B extends readonly LayoutBlock[] = [], const A extends readonly LayoutBlock[] = [], Declared extends LayoutStructuredData | undefined = undefined>(options: FileOptions<Id, Result, B, A, Declared>) => LayoutFor<Result>;
368
297
  //#endregion
369
298
  export { type CuratedLayoutContext, type LayoutPage, type LayoutProject, type LayoutRequestContext, type LayoutStructuredData, type LoadedLayoutContext, type MainEntity, type RecordLayoutContext, type StructuredDataNode, type StructuredDataType, type WebPageKind, notFound };
@@ -9,33 +9,25 @@ import * as React from "react";
9
9
  import { Fragment, jsx } from "react/jsx-runtime";
10
10
 
11
11
  //#region src/core/createLayout.tsx
12
- const INITIAL_LAYOUT_ONLY_ERROR = "❌ Camox: blocks in `blocks.initial` must NOT be `layoutOnly: true` — `initial` is for page-content blocks. Remove `layoutOnly: true` from this block's `createBlock` options.";
13
12
  function createLayoutDefinition(options) {
14
13
  if (options.kind === "singleton" && !/^[\w-]+(?:\.[\w-]+)*$/.test(options.id)) throw new Error(`Singleton layouts require a fixed file route: ${options.id}`);
15
- if (options.kind && options.kind !== "curated" && options.blocks.initial) throw new Error("Code-owned layouts cannot define initial page blocks");
16
14
  if (options.routes && options.kind !== "derived") throw new Error(`Only derived layouts can define routes: ${options.id}`);
17
15
  if (options.toMarkdown && (options.kind ?? "curated") === "curated") throw new Error(`Curated layouts cannot define toMarkdown: ${options.id}`);
18
16
  const LayoutContext = React.createContext(null);
19
- const { before: beforeBlocks, after: afterBlocks, initial: initialBlocks } = options.blocks;
17
+ const { before: beforeBlocks, after: afterBlocks } = options.blocks;
20
18
  const BeforeBlocks = () => {
21
19
  const $ = c(4);
22
20
  const ctx = React.use(LayoutContext);
23
21
  if (!ctx) throw new Error(`Layout "${options.id}" BeforeBlocks must be rendered inside its Provider`);
24
22
  let t0;
25
23
  if ($[0] !== ctx) {
26
- t0 = beforeBlocks.map((block, i) => {
24
+ t0 = beforeBlocks.map((block) => {
27
25
  const blockData = ctx.layoutBlocks[block._internal.id];
28
26
  if (!blockData) return null;
29
- const isLastBefore = i === beforeBlocks.length - 1;
30
27
  return /* @__PURE__ */ jsx(BlockErrorBoundary, {
31
28
  blockId: blockData._id,
32
29
  blockType: blockData.type,
33
- children: /* @__PURE__ */ jsx(block._internal.Component, {
34
- blockData,
35
- mode: "layout",
36
- showAddBlockBottom: (options.kind ?? "curated") === "curated" && isLastBefore || void 0,
37
- addBlockAfterPosition: isLastBefore ? "" : void 0
38
- })
30
+ children: /* @__PURE__ */ jsx(block._internal.Component, { blockData })
39
31
  }, block._internal.id);
40
32
  });
41
33
  $[0] = ctx;
@@ -56,19 +48,13 @@ function createLayoutDefinition(options) {
56
48
  if (!ctx) throw new Error(`Layout "${options.id}" AfterBlocks must be rendered inside its Provider`);
57
49
  let t0;
58
50
  if ($[0] !== ctx) {
59
- t0 = afterBlocks.map((block, i) => {
51
+ t0 = afterBlocks.map((block) => {
60
52
  const blockData = ctx.layoutBlocks[block._internal.id];
61
53
  if (!blockData) return null;
62
- const isFirstAfter = i === 0;
63
54
  return /* @__PURE__ */ jsx(BlockErrorBoundary, {
64
55
  blockId: blockData._id,
65
56
  blockType: blockData.type,
66
- children: /* @__PURE__ */ jsx(block._internal.Component, {
67
- blockData,
68
- mode: "layout",
69
- showAddBlockTop: (options.kind ?? "curated") === "curated" && isFirstAfter || void 0,
70
- addBlockAfterPosition: isFirstAfter ? null : void 0
71
- })
57
+ children: /* @__PURE__ */ jsx(block._internal.Component, { blockData })
72
58
  }, block._internal.id);
73
59
  });
74
60
  $[0] = ctx;
@@ -172,36 +158,13 @@ function createLayoutDefinition(options) {
172
158
  return t1;
173
159
  };
174
160
  Item.displayName = `LayoutItem(${options.id})`;
175
- const blockDefinitions = [...beforeBlocks.map((block) => {
176
- const bundle = block._internal.getInitialBundle();
177
- return {
178
- type: block._internal.id,
179
- content: bundle.content,
180
- settings: bundle.settings,
181
- repeatableItems: bundle.repeatableItems,
182
- slot: "before"
183
- };
184
- }), ...afterBlocks.map((block) => {
185
- const bundle = block._internal.getInitialBundle();
186
- return {
187
- type: block._internal.id,
188
- content: bundle.content,
189
- settings: bundle.settings,
190
- repeatableItems: bundle.repeatableItems,
191
- slot: "after"
192
- };
193
- })];
194
- const loadInitialBlockBundles = initialBlocks && (() => Promise.all(initialBlocks.map(async (load) => {
195
- const { block } = await load();
196
- if (block._internal.layoutOnly) throw new Error(`${INITIAL_LAYOUT_ONLY_ERROR} (block "${block._internal.id}")`);
197
- const bundle = block._internal.getInitialBundle();
198
- return {
199
- type: block._internal.id,
200
- content: bundle.content,
201
- settings: bundle.settings,
202
- repeatableItems: bundle.repeatableItems
203
- };
204
- })));
161
+ const blockDefinitions = [...beforeBlocks.map((block) => ({
162
+ type: block._internal.id,
163
+ slot: "before"
164
+ })), ...afterBlocks.map((block) => ({
165
+ type: block._internal.id,
166
+ slot: "after"
167
+ }))];
205
168
  return {
206
169
  BeforeBlocks,
207
170
  AfterBlocks,
@@ -225,7 +188,6 @@ function createLayoutDefinition(options) {
225
188
  toImage: options.toImage,
226
189
  toStructuredData: (context) => options.toStructuredData?.(context),
227
190
  blockDefinitions,
228
- loadInitialBlockBundles,
229
191
  toReact: options.toReact,
230
192
  Provider
231
193
  }
@@ -23,13 +23,14 @@ interface BlockBaseOptions<TSchemaShape extends Record<string, TSchema>, TSettin
23
23
  */
24
24
  description: string;
25
25
  /**
26
- * The block's editable content, built from `field`. Every field needs a default.
26
+ * The block's editable content, built from `field`. An unset field holds the empty value of
27
+ * its kind.
27
28
  *
28
29
  * @example
29
30
  * content: (field) => ({
30
- * title: field.string({ default: "Hello" }),
31
+ * title: field.string(),
31
32
  * items: field.repeater({
32
- * content: (field) => ({ name: field.string({ default: "Item" }) }),
33
+ * content: (field) => ({ name: field.string() }),
33
34
  * minItems: 1,
34
35
  * maxItems: 10,
35
36
  * toTitle: ({ content }) => content.name,
@@ -44,14 +45,14 @@ interface BlockBaseOptions<TSchemaShape extends Record<string, TSchema>, TSettin
44
45
  *
45
46
  * @example
46
47
  * settings: (setting) => ({
47
- * alignment: setting.enum({ default: "left", options: { left: "Left", center: "Center" } }),
48
- * showBackground: setting.boolean({ default: true }),
48
+ * alignment: setting.enum({ options: { left: "Left", center: "Center" } }),
49
+ * showBackground: setting.boolean(),
49
50
  * })
50
51
  */
51
52
  settings?: (setting: SettingBuilder) => TSettingsShape;
52
53
  /**
53
- * When true, this block can only be used inside layouts and won't appear in the block picker
54
- * or be available for AI page generation.
54
+ * When true, this block can only be used inside layouts and isn't available for AI page
55
+ * generation.
55
56
  */
56
57
  layoutOnly?: TLayoutOnly;
57
58
  /** Share content and settings across all placements of this block definition. Defaults to false. */
@@ -121,36 +122,6 @@ interface BlockData<TContent> {
121
122
  }
122
123
  export interface BlockComponentProps<TContent> {
123
124
  blockData: BlockData<TContent>;
124
- mode: "site" | "peek" | "layout";
125
- isFirstBlock?: boolean;
126
- showAddBlockTop?: boolean;
127
- showAddBlockBottom?: boolean;
128
- addBlockAfterPosition?: string | null;
129
- }
130
- export interface PeekItem {
131
- id: string;
132
- blockId: string;
133
- parentItemId: string | null;
134
- fieldName: string;
135
- content: unknown;
136
- settings: Record<string, unknown> | null;
137
- summary: string;
138
- title: string;
139
- position: string;
140
- createdAt: number;
141
- updatedAt: number;
142
- projectId: number | null;
143
- sharedContentType: string | null;
144
- /** Peek items link no records. */
145
- references: Record<string, never>;
146
- }
147
- export interface RepeatableItemSeed {
148
- tempId: string;
149
- parentTempId: string | null;
150
- fieldName: string;
151
- content: Record<string, unknown>;
152
- settings?: Record<string, unknown>;
153
- position: string;
154
125
  }
155
126
  export declare function createEditableBlock<TSchemaShape extends Record<string, TSchema>, TSettingsShape extends Record<string, TSchema> = Record<string, never>, TLayoutOnly extends boolean = false, TNodes extends BlockStructuredData = BlockStructuredData>(options: CreateBlockOptions<TSchemaShape, TSettingsShape, TLayoutOnly, TNodes>): {
156
127
  Detached: ({ children }: {
@@ -1684,7 +1655,7 @@ export declare function createEditableBlock<TSchemaShape extends Record<string,
1684
1655
  * It exposes context that will be consumed by the Field component, and provides visual editing
1685
1656
  * capabilities (e.g. delete and reorder blocks).
1686
1657
  */
1687
- Component: ({ blockData, mode, isFirstBlock, showAddBlockTop, showAddBlockBottom, addBlockAfterPosition }: BlockComponentProps<import("@sinclair/typebox").Evaluate<Readonly<Partial<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1658
+ Component: ({ blockData }: BlockComponentProps<import("@sinclair/typebox").Evaluate<Readonly<Partial<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1688
1659
  params: unknown[] & [];
1689
1660
  })["static"]; }, { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchemaShape[K]> ? K : never : never; }[keyof TSchemaShape]>>> & Readonly<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1690
1661
  params: unknown[] & [];
@@ -1715,43 +1686,6 @@ export declare function createEditableBlock<TSchemaShape extends Record<string,
1715
1686
  } | undefined;
1716
1687
  layoutOnly: TLayoutOnly;
1717
1688
  synced: boolean;
1718
- getInitialBundle: () => {
1719
- content: Record<string, unknown>;
1720
- settings: {
1721
- [x: string]: unknown;
1722
- };
1723
- repeatableItems: RepeatableItemSeed[];
1724
- };
1725
- getInitialContent: () => import("@sinclair/typebox").Evaluate<Readonly<Partial<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1726
- params: unknown[] & [];
1727
- })["static"]; }, { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchemaShape[K]> ? K : never : never; }[keyof TSchemaShape]>>> & Readonly<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1728
- params: unknown[] & [];
1729
- })["static"]; }, { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchemaShape[K]> ? never : K : never; }[keyof TSchemaShape]>> & Partial<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1730
- params: unknown[] & [];
1731
- })["static"]; }, { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchemaShape[K]> ? never : K : never; }[keyof TSchemaShape]>> & Required<Pick<{ [K in keyof TSchemaShape]: (TSchemaShape[K] & {
1732
- params: unknown[] & [];
1733
- })["static"]; }, Exclude<keyof TSchemaShape, { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchemaShape[K]> ? never : K : never; }[keyof TSchemaShape] | { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchemaShape[K]> ? K : never : never; }[keyof TSchemaShape] | { [K in keyof TSchemaShape]: TSchemaShape[K] extends import("@sinclair/typebox").TReadonly<TSchema> ? TSchemaShape[K] extends import("@sinclair/typebox").TOptional<TSchemaShape[K]> ? never : K : never; }[keyof TSchemaShape]>>>>;
1734
- getInitialSettings: () => {
1735
- [x: string]: unknown;
1736
- };
1737
- getPeekBundle: () => {
1738
- block: {
1739
- id: string;
1740
- pageId: null;
1741
- layoutId: null;
1742
- type: string;
1743
- content: Record<string, unknown>;
1744
- settings: Record<string, unknown>;
1745
- slot: null;
1746
- summary: string;
1747
- title: string;
1748
- position: string;
1749
- createdAt: number;
1750
- updatedAt: number;
1751
- };
1752
- repeatableItems: PeekItem[];
1753
- files: never[];
1754
- };
1755
1689
  };
1756
1690
  };
1757
1691
  //#endregion