@bettercms-ai/types 1.58.0 → 1.60.0

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/index.d.ts CHANGED
@@ -73,7 +73,7 @@ declare const BLOCK_FIELD_TYPES: readonly ["text", "longtext", "richtext", "imag
73
73
  * here is refused with `schema.block_field_unrenderable` only until its renderer ships, and then
74
74
  * joins this list. When this equals BLOCK_FIELD_TYPES (G7), the staging is over.
75
75
  */
76
- declare const BLOCK_FIELD_TYPES_RENDERABLE_NOW: readonly ["text", "longtext", "richtext", "image", "link", "slug", "email", "phone", "color", "select", "number", "rating", "date", "datetime", "boolean"];
76
+ declare const BLOCK_FIELD_TYPES_RENDERABLE_NOW: readonly ["text", "longtext", "richtext", "image", "link", "slug", "email", "phone", "color", "select", "number", "rating", "date", "datetime", "boolean", "video", "file", "tags", "reference", "object", "array"];
77
77
  /** `openMode` values (content-model.ts OpenMode). */
78
78
  declare const OPEN_MODES: readonly ["inline", "drill", "popover", "dialog"];
79
79
  /**
@@ -172,15 +172,20 @@ declare const UI_REFUSAL_IDS: readonly UiRefusalId[];
172
172
  declare const uiRefusalId: (r: UiRefusal) => UiRefusalId;
173
173
  /** The refusals a frame may report about itself; the host owns every other one. */
174
174
  declare const FRAME_REFUSALS: readonly ["runtime.crashed", "runtime.blank", "runtime.csp_violation", "protocol.unsupported"];
175
- /** What a host speaks, best first (dock-input ui2.ts HOST_PROTOCOLS). */
176
- declare const UI_PROTOCOLS: readonly ["bcms-ui/2", "bcms-input/1", "bcms-panel/1"];
175
+ /**
176
+ * The protocols a manifest entry declares. The first three are the frame protocols a host
177
+ * speaks, best first (dock-input ui2.ts HOST_PROTOCOLS); `bcms-function/1` is a `function:<name>`
178
+ * entry, the third UI scope: js only, never framed.
179
+ */
180
+ declare const UI_PROTOCOLS: readonly ["bcms-ui/2", "bcms-input/1", "bcms-panel/1", "bcms-function/1"];
177
181
  type UiProtocol = (typeof UI_PROTOCOLS)[number];
178
182
  interface UiManifestEntry {
179
183
  /** The bundle's content key: its files are `bundles/<k>/<js>` and `bundles/<k>/<html>`. */
180
184
  k: string;
181
185
  protocol: UiProtocol;
182
186
  js: string;
183
- html: string;
187
+ /** Absent on a `function:<name>` entry, which has no frame. */
188
+ html?: string;
184
189
  }
185
190
  interface UiManifestV2 {
186
191
  version: 2;
@@ -191,7 +196,7 @@ interface UiManifestV2 {
191
196
  version: string;
192
197
  stylesSha: string;
193
198
  } | null;
194
- /** By `input:<name>` | `panel:<name>`. */
199
+ /** By `input:<name>` | `panel:<name>` | `function:<name>`. */
195
200
  entries: Record<string, UiManifestEntry>;
196
201
  }
197
202
  declare const isUiRefusal: (v: unknown) => v is UiRefusal;
@@ -217,7 +222,7 @@ declare const isDeriveReservedKey: (key: string) => boolean;
217
222
  */
218
223
  declare const PRIMITIVE_ARRAY_RULE: {
219
224
  readonly itemTypes: readonly ["text", "number", "date", "image", "link", "richtext"];
220
- readonly configKeys: readonly ["itemType", "minItems", "maxItems", "aliases"];
225
+ readonly configKeys: readonly ["itemType", "minItems", "maxItems", "aliases", "item"];
221
226
  readonly notWithZones: readonly ["image", "link", "richtext"];
222
227
  };
223
228
  declare function canonicalJson(value: unknown): string;
package/dist/index.js CHANGED
@@ -4620,7 +4620,13 @@ var BLOCK_FIELD_TYPES_RENDERABLE_NOW = [
4620
4620
  "rating",
4621
4621
  "date",
4622
4622
  "datetime",
4623
- "boolean"
4623
+ "boolean",
4624
+ "video",
4625
+ "file",
4626
+ "tags",
4627
+ "reference",
4628
+ "object",
4629
+ "array"
4624
4630
  ];
4625
4631
  var OPEN_MODES = ["inline", "drill", "popover", "dialog"];
4626
4632
  var OPEN_MODE_TYPES = ["object", "array", "group", "repeater", "table", "code"];
@@ -4693,7 +4699,7 @@ var FRAME_REFUSALS = [
4693
4699
  "runtime.csp_violation",
4694
4700
  "protocol.unsupported"
4695
4701
  ];
4696
- var UI_PROTOCOLS = ["bcms-ui/2", "bcms-input/1", "bcms-panel/1"];
4702
+ var UI_PROTOCOLS = ["bcms-ui/2", "bcms-input/1", "bcms-panel/1", "bcms-function/1"];
4697
4703
  var isUiRefusal = (v) => {
4698
4704
  if (typeof v !== "object" || v === null) return false;
4699
4705
  const { family, code, message } = v;
@@ -4708,7 +4714,8 @@ var isReservedKey = (key) => KEY_FORBIDDEN.has(key) || KEY_RESERVED.has(key) ||
4708
4714
  var isDeriveReservedKey = (key) => isReservedKey(key) || DERIVE_MINTED_RESERVED.has(key);
4709
4715
  var PRIMITIVE_ARRAY_RULE = {
4710
4716
  itemTypes: ["text", "number", "date", "image", "link", "richtext"],
4711
- configKeys: ["itemType", "minItems", "maxItems", "aliases"],
4717
+ // `item`: the per-item settings (the arrayItemSettings shape), as a component's `config.item`.
4718
+ configKeys: ["itemType", "minItems", "maxItems", "aliases", "item"],
4712
4719
  notWithZones: ["image", "link", "richtext"]
4713
4720
  };
4714
4721
  function canonicalNumber(value) {