@lacecms/content 0.1.0-alpha.8 → 0.1.0-rc1
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 +340 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +261 -37
- package/dist/index.js.map +1 -1
- package/dist/video-embeds.d.ts +1 -0
- package/dist/video-embeds.d.ts.map +1 -1
- package/dist/video-embeds.js +2 -0
- package/dist/video-embeds.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -131,9 +131,46 @@ export interface FormLayout<Key extends string = string> {
|
|
|
131
131
|
export declare function normalizeFormLayout<Key extends string>(value: unknown, fields: Readonly<Record<Key, unknown>>, path?: string): FormLayout<Key> | undefined;
|
|
132
132
|
/** Sibling field order used by rendering and validation summaries. */
|
|
133
133
|
export declare function formFieldKeys(fields: Readonly<Record<string, unknown>>, layout?: FormLayout): readonly string[];
|
|
134
|
+
/** A sibling rule: its target applies only while `field` holds one of `values`. */
|
|
135
|
+
export interface FieldVisibilityRule<Controller extends string = string, Value extends boolean | string = boolean | string> {
|
|
136
|
+
readonly field: Controller;
|
|
137
|
+
readonly values: readonly Value[];
|
|
138
|
+
}
|
|
139
|
+
type VisibilityControllerValue<Definition> = Definition extends {
|
|
140
|
+
readonly type: "boolean";
|
|
141
|
+
} ? boolean : Definition extends {
|
|
142
|
+
readonly type: "select";
|
|
143
|
+
readonly options: readonly (infer Choice extends string)[];
|
|
144
|
+
} ? Choice : never;
|
|
145
|
+
type VisibilityControllerKey<Fields> = {
|
|
146
|
+
[Key in keyof Fields & string]: [VisibilityControllerValue<Fields[Key]>] extends [never] ? never : Key;
|
|
147
|
+
}[keyof Fields & string];
|
|
148
|
+
type VisibilityRuleFor<Fields, Target extends string> = {
|
|
149
|
+
[Controller in Exclude<VisibilityControllerKey<Fields>, Target>]: FieldVisibilityRule<Controller, VisibilityControllerValue<Fields[Controller]>>;
|
|
150
|
+
}[Exclude<VisibilityControllerKey<Fields>, Target>];
|
|
151
|
+
/** Conditional-field rules of one field-map owner, keyed by target field. */
|
|
152
|
+
export type FieldVisibility<Fields = ModelFieldDefinitions> = string extends keyof Fields ? Readonly<Record<string, FieldVisibilityRule>> : Readonly<{
|
|
153
|
+
[Target in keyof Fields & string]?: VisibilityRuleFor<Fields, Target>;
|
|
154
|
+
}>;
|
|
155
|
+
/** Rejects rule targets outside `Fields` when the rules are part of an inferred input. */
|
|
156
|
+
type FieldVisibilityInput<Fields, Options> = FieldVisibility<Fields> & (Options extends {
|
|
157
|
+
readonly visibility: infer Given;
|
|
158
|
+
} ? {
|
|
159
|
+
readonly [Key in Exclude<keyof Given, keyof Fields>]: never;
|
|
160
|
+
} : unknown);
|
|
161
|
+
/** Validates, detaches and freezes the conditional-field rules of one owner. */
|
|
162
|
+
export declare function normalizeFieldVisibility(value: unknown, fields: Readonly<Record<string, FieldDefinition>>, path?: string): FieldVisibility | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Whether `target` applies in one normalized object occurrence: a target
|
|
165
|
+
* without a rule is visible; otherwise its controller's value (present or
|
|
166
|
+
* materialized default) must be listed. An absent controller matches nothing.
|
|
167
|
+
*/
|
|
168
|
+
export declare function isFieldVisible(visibility: FieldVisibility | undefined, target: string, values: Readonly<Record<string, unknown>>): boolean;
|
|
134
169
|
/** A finite group of named child descriptors. */
|
|
135
170
|
export interface GroupFieldDefinition {
|
|
136
171
|
readonly layout?: FormLayout;
|
|
172
|
+
/** Conditional-field rules over the group's immediate children. */
|
|
173
|
+
readonly visibility?: FieldVisibility;
|
|
137
174
|
readonly type: "group";
|
|
138
175
|
readonly fields: ModelFieldDefinitions;
|
|
139
176
|
readonly required: boolean;
|
|
@@ -190,7 +227,9 @@ export type FieldValue<Definition extends FieldDefinition> = Definition extends
|
|
|
190
227
|
} ? Choice : never : Definition extends {
|
|
191
228
|
readonly type: "group";
|
|
192
229
|
readonly fields: infer Fields extends ModelFieldDefinitions;
|
|
193
|
-
} ? string extends keyof Fields ? JsonObject :
|
|
230
|
+
} ? string extends keyof Fields ? JsonObject : Definition extends {
|
|
231
|
+
readonly visibility: infer Visibility;
|
|
232
|
+
} ? BlockDataValues<Fields, Visibility> : BlockDataValues<Fields> : Definition extends {
|
|
194
233
|
readonly type: "list";
|
|
195
234
|
readonly item: infer Item extends ListItemDefinition;
|
|
196
235
|
} ? readonly FieldValue<Item>[] : string;
|
|
@@ -213,7 +252,8 @@ export declare const field: {
|
|
|
213
252
|
readonly fields: ModelFieldDefinitions;
|
|
214
253
|
}>(options: Options & CommonFieldOptions<NoInfer<{ readonly [Key in keyof Options["fields"]]?: DraftFieldValue<Options["fields"][Key]>; }>> & {
|
|
215
254
|
readonly layout?: FormLayout<keyof Options["fields"] & string>;
|
|
216
|
-
|
|
255
|
+
readonly visibility?: FieldVisibilityInput<Options["fields"], Options>;
|
|
256
|
+
}) => CommonDefinition<"group", Options> & PropertyFrom<Options, "layout"> & PropertyFrom<Options, "visibility"> & {
|
|
217
257
|
readonly fields: Options["fields"];
|
|
218
258
|
};
|
|
219
259
|
/** Define an ordered array of scalar or group values. */
|
|
@@ -343,7 +383,19 @@ export type ModelFieldValues = JsonObject;
|
|
|
343
383
|
/** The validation state of a content snapshot. */
|
|
344
384
|
export type ContentValidationMode = "draft" | "publish";
|
|
345
385
|
/** Validates field data for either an incomplete draft or a publish candidate. */
|
|
346
|
-
export declare function validateModelFields(definitions: ModelFieldDefinitions, value: unknown, mode: ContentValidationMode, path?: readonly ValidationPathSegment[]): ModelFieldValues;
|
|
386
|
+
export declare function validateModelFields(definitions: ModelFieldDefinitions, value: unknown, mode: ContentValidationMode, path?: readonly ValidationPathSegment[], visibility?: FieldVisibility): ModelFieldValues;
|
|
387
|
+
/**
|
|
388
|
+
* Removes every hidden target from already normalized values, recursively
|
|
389
|
+
* through visible groups and list items, without inserting or reordering.
|
|
390
|
+
*/
|
|
391
|
+
export declare function publishedFieldValues(definitions: ModelFieldDefinitions, values: JsonObject, visibility?: FieldVisibility): JsonObject;
|
|
392
|
+
/**
|
|
393
|
+
* Whether an owner or any nested group, including list-item groups, declares
|
|
394
|
+
* conditional-field rules, so its published projection can differ from its values.
|
|
395
|
+
*/
|
|
396
|
+
export declare function declaresFieldVisibility(definitions: ModelFieldDefinitions, visibility?: FieldVisibility): boolean;
|
|
397
|
+
/** The published projection of one block's normalized data. */
|
|
398
|
+
export declare function publishedBlockData(definition: BlockMetadata, data: JsonObject): JsonObject;
|
|
347
399
|
/** Checks already normalized model/block values against one snapshot-wide budget. */
|
|
348
400
|
export declare function validateSnapshotListBudget(fields: ModelFieldDefinitions, values: JsonObject, blocks: readonly {
|
|
349
401
|
readonly fields: ModelFieldDefinitions;
|
|
@@ -378,7 +430,9 @@ export declare function collectSnapshotInternalLinks(fields: ModelFieldDefinitio
|
|
|
378
430
|
readonly fields: ModelFieldDefinitions;
|
|
379
431
|
readonly data: JsonObject;
|
|
380
432
|
readonly hidden?: boolean;
|
|
381
|
-
|
|
433
|
+
/** The block's data rules; links inside hidden targets are not delivered. */
|
|
434
|
+
readonly visibility?: FieldVisibility;
|
|
435
|
+
}[], visibility?: FieldVisibility): readonly InternalLinkReference[];
|
|
382
436
|
/** Finds declared media leaves only; ordinary strings never become references. */
|
|
383
437
|
export declare function collectFieldMedia(definitions: ModelFieldDefinitions, values: JsonObject): readonly FieldMediaReference[];
|
|
384
438
|
/**
|
|
@@ -448,6 +502,8 @@ export interface BlockDefinitionInput<Fields extends ModelFieldDefinitions = Mod
|
|
|
448
502
|
readonly layout?: FormLayout<keyof Fields & string>;
|
|
449
503
|
readonly settingsLayout?: FormLayout<keyof Settings & string>;
|
|
450
504
|
readonly settingsVisibility?: SettingsVisibility<keyof Settings & string>;
|
|
505
|
+
/** Conditional-field rules over block data fields; settings use `settingsVisibility`. */
|
|
506
|
+
readonly visibility?: FieldVisibility<Fields>;
|
|
451
507
|
readonly label?: string;
|
|
452
508
|
/** Data and settings migrations from earlier versions, keyed by target version. */
|
|
453
509
|
readonly migrations?: BlockMigrations;
|
|
@@ -456,24 +512,37 @@ export interface BlockDefinitionInput<Fields extends ModelFieldDefinitions = Mod
|
|
|
456
512
|
readonly type: string;
|
|
457
513
|
readonly version: number;
|
|
458
514
|
}
|
|
459
|
-
/**
|
|
460
|
-
|
|
461
|
-
|
|
515
|
+
/**
|
|
516
|
+
* The target keys of an owner's inferred conditional-field rules: keys the
|
|
517
|
+
* inferred rules declare. Keys that are merely permitted (optional, as in a
|
|
518
|
+
* wide `FieldVisibility<Fields>`) are not targets.
|
|
519
|
+
*/
|
|
520
|
+
export type FieldVisibilityTargets<Visibility> = [Visibility] extends [undefined] ? never : {
|
|
521
|
+
[Key in keyof NonNullable<Visibility>]-?: {} extends Pick<NonNullable<Visibility>, Key> ? never : Key;
|
|
522
|
+
}[keyof NonNullable<Visibility>];
|
|
523
|
+
/**
|
|
524
|
+
* The data shape inferred from a block's field definitions. Conditional targets
|
|
525
|
+
* named by `Visibility` are optional: they are absent while hidden.
|
|
526
|
+
*/
|
|
527
|
+
export type BlockDataValues<Fields extends ModelFieldDefinitions, Visibility = undefined> = Readonly<{
|
|
528
|
+
[Key in keyof Fields as Key extends FieldVisibilityTargets<Visibility> ? never : FieldIsRequired<Fields[Key]> extends true ? Key : never]: FieldValue<Fields[Key]>;
|
|
462
529
|
} & {
|
|
463
|
-
readonly [Key in keyof Fields as FieldIsRequired<Fields[Key]> extends true ? never : Key]?: FieldValue<Fields[Key]>;
|
|
530
|
+
readonly [Key in keyof Fields as Key extends FieldVisibilityTargets<Visibility> ? Key : FieldIsRequired<Fields[Key]> extends true ? never : Key]?: FieldValue<Fields[Key]>;
|
|
464
531
|
}>;
|
|
465
532
|
/** The settings record of a block; every setting has a default, so every key is present. */
|
|
466
533
|
export type BlockSettingsValues<Settings extends ModelFieldDefinitions> = Readonly<{
|
|
467
534
|
[Key in keyof Settings]: FieldValue<Settings[Key]>;
|
|
468
535
|
}>;
|
|
469
536
|
/** A detached JSON-safe representation of a block definition. */
|
|
470
|
-
export interface BlockMetadata<Fields extends ModelFieldDefinitions = ModelFieldDefinitions, Settings extends ModelFieldDefinitions = ModelFieldDefinitions> {
|
|
471
|
-
readonly defaultValue?: BlockDataValues<Fields>;
|
|
537
|
+
export interface BlockMetadata<Fields extends ModelFieldDefinitions = ModelFieldDefinitions, Settings extends ModelFieldDefinitions = ModelFieldDefinitions, Visibility = undefined> {
|
|
538
|
+
readonly defaultValue?: BlockDataValues<Fields, Visibility>;
|
|
472
539
|
readonly description?: string;
|
|
473
540
|
readonly fields: Fields;
|
|
474
541
|
readonly layout?: FormLayout<keyof Fields & string>;
|
|
475
542
|
readonly settingsLayout?: FormLayout<keyof Settings & string>;
|
|
476
543
|
readonly settingsVisibility?: SettingsVisibility<keyof Settings & string>;
|
|
544
|
+
/** Conditional-field rules over block data fields. */
|
|
545
|
+
readonly visibility?: FieldVisibility<Fields>;
|
|
477
546
|
readonly label?: string;
|
|
478
547
|
/** Declared settings; absent when the block declares none. */
|
|
479
548
|
readonly settings?: Settings;
|
|
@@ -481,13 +550,15 @@ export interface BlockMetadata<Fields extends ModelFieldDefinitions = ModelField
|
|
|
481
550
|
readonly version: number;
|
|
482
551
|
}
|
|
483
552
|
/** An executable block definition retained only in the runtime projection. */
|
|
484
|
-
export interface BlockDefinition<Fields extends ModelFieldDefinitions = ModelFieldDefinitions, Settings extends ModelFieldDefinitions = ModelFieldDefinitions> extends BlockMetadata<Fields, Settings> {
|
|
553
|
+
export interface BlockDefinition<Fields extends ModelFieldDefinitions = ModelFieldDefinitions, Settings extends ModelFieldDefinitions = ModelFieldDefinitions, Visibility = undefined> extends BlockMetadata<Fields, Settings, Visibility> {
|
|
485
554
|
/** Runtime-only migrations keyed by target version; never part of metadata. */
|
|
486
555
|
readonly migrations?: BlockMigrations;
|
|
487
|
-
readonly validate: (value: unknown, mode: ContentValidationMode) => BlockDataValues<Fields>;
|
|
556
|
+
readonly validate: (value: unknown, mode: ContentValidationMode) => BlockDataValues<Fields, Visibility>;
|
|
488
557
|
}
|
|
489
558
|
/** Defines a versioned block using only portable field descriptors. */
|
|
490
|
-
export declare function defineBlock<const Fields extends ModelFieldDefinitions, const Settings extends ModelFieldDefinitions = NoBlockSettings>(input: BlockDefinitionInput<Fields, Settings>
|
|
559
|
+
export declare function defineBlock<const Fields extends ModelFieldDefinitions, const Settings extends ModelFieldDefinitions = NoBlockSettings, const Visibility extends FieldVisibility<Fields> | undefined = undefined>(input: BlockDefinitionInput<Fields, Settings> & {
|
|
560
|
+
readonly visibility?: Visibility;
|
|
561
|
+
}): BlockDefinition<Fields, Settings, Visibility>;
|
|
491
562
|
/** Projects a block definition into detached, JSON-safe metadata. */
|
|
492
563
|
export declare function toBlockMetadata(definition: BlockDefinition): BlockMetadata;
|
|
493
564
|
/** A registry of the current executable definition for every allowed block type. */
|
|
@@ -634,7 +705,7 @@ export declare const builtInBlocks: {
|
|
|
634
705
|
readonly required: true;
|
|
635
706
|
readonly type: "text";
|
|
636
707
|
};
|
|
637
|
-
}, Readonly<Record<never, FieldDefinition
|
|
708
|
+
}, Readonly<Record<never, FieldDefinition>>, undefined>;
|
|
638
709
|
gallery: BlockDefinition<{
|
|
639
710
|
readonly images: {
|
|
640
711
|
readonly required: false;
|
|
@@ -642,29 +713,180 @@ export declare const builtInBlocks: {
|
|
|
642
713
|
} & {
|
|
643
714
|
readonly defaultValue: readonly [];
|
|
644
715
|
} & {
|
|
645
|
-
readonly label: "Images";
|
|
716
|
+
readonly label: "Images and videos";
|
|
646
717
|
} & {
|
|
647
718
|
readonly item: {
|
|
648
719
|
readonly required: false;
|
|
649
720
|
readonly type: "group";
|
|
721
|
+
} & {
|
|
722
|
+
readonly visibility: {
|
|
723
|
+
readonly media: {
|
|
724
|
+
readonly field: "kind";
|
|
725
|
+
readonly values: readonly ["image"];
|
|
726
|
+
};
|
|
727
|
+
readonly alt: {
|
|
728
|
+
readonly field: "kind";
|
|
729
|
+
readonly values: readonly ["image"];
|
|
730
|
+
};
|
|
731
|
+
readonly link: {
|
|
732
|
+
readonly field: "kind";
|
|
733
|
+
readonly values: readonly ["image"];
|
|
734
|
+
};
|
|
735
|
+
readonly videoUrl: {
|
|
736
|
+
readonly field: "kind";
|
|
737
|
+
readonly values: readonly ["video"];
|
|
738
|
+
};
|
|
739
|
+
readonly videoTitle: {
|
|
740
|
+
readonly field: "kind";
|
|
741
|
+
readonly values: readonly ["video"];
|
|
742
|
+
};
|
|
743
|
+
readonly playback: {
|
|
744
|
+
readonly field: "kind";
|
|
745
|
+
readonly values: readonly ["video"];
|
|
746
|
+
};
|
|
747
|
+
readonly aspectRatio: {
|
|
748
|
+
readonly field: "kind";
|
|
749
|
+
readonly values: readonly ["video"];
|
|
750
|
+
};
|
|
751
|
+
};
|
|
650
752
|
} & {
|
|
651
753
|
readonly fields: {
|
|
754
|
+
readonly kind: SelectFieldDefinition<readonly ["image", "video"], {
|
|
755
|
+
readonly options: readonly ["image", "video"];
|
|
756
|
+
readonly required: true;
|
|
757
|
+
readonly defaultValue: "image";
|
|
758
|
+
readonly label: "Type";
|
|
759
|
+
readonly presentation: {
|
|
760
|
+
readonly control: "cards";
|
|
761
|
+
readonly choices: readonly [{
|
|
762
|
+
readonly value: "image";
|
|
763
|
+
readonly label: "Image";
|
|
764
|
+
readonly description: "A picture from the media library.";
|
|
765
|
+
}, {
|
|
766
|
+
readonly value: "video";
|
|
767
|
+
readonly label: "Video";
|
|
768
|
+
readonly description: "A YouTube or Vimeo video.";
|
|
769
|
+
}];
|
|
770
|
+
};
|
|
771
|
+
} & SelectFieldOptions<readonly ["image", "video"]>>;
|
|
652
772
|
readonly media: MediaFieldDefinition<{
|
|
653
773
|
readonly label: "Image";
|
|
654
774
|
readonly required: true;
|
|
655
775
|
}>;
|
|
776
|
+
readonly videoUrl: UrlFieldDefinition<{
|
|
777
|
+
readonly required: true;
|
|
778
|
+
readonly embedProviders: readonly ["youtube", "vimeo"];
|
|
779
|
+
readonly label: "Video URL";
|
|
780
|
+
readonly description: "Paste a YouTube or Vimeo video link, not iframe code.";
|
|
781
|
+
}>;
|
|
656
782
|
readonly alt: TextFieldDefinition<{
|
|
657
783
|
readonly description: "Leave empty to use the media item's alt text.";
|
|
658
784
|
readonly label: "Alt text";
|
|
659
785
|
}>;
|
|
786
|
+
readonly videoTitle: TextFieldDefinition<{
|
|
787
|
+
readonly required: true;
|
|
788
|
+
readonly minLength: 1;
|
|
789
|
+
readonly label: "Video title";
|
|
790
|
+
readonly description: "Names the video for visitors using assistive technology.";
|
|
791
|
+
}>;
|
|
660
792
|
readonly caption: TextFieldDefinition<{
|
|
661
|
-
readonly description: "
|
|
793
|
+
readonly description: "An empty image caption uses the media item's caption.";
|
|
662
794
|
readonly label: "Caption";
|
|
663
795
|
}>;
|
|
664
796
|
readonly link: UrlFieldDefinition<{
|
|
665
797
|
readonly description: "Selecting the image opens this link instead of the full-screen view.";
|
|
666
798
|
readonly label: "Link";
|
|
667
799
|
}>;
|
|
800
|
+
readonly playback: SelectFieldDefinition<readonly ["player", "ambient"], {
|
|
801
|
+
readonly options: readonly ["player", "ambient"];
|
|
802
|
+
readonly required: true;
|
|
803
|
+
readonly defaultValue: "player";
|
|
804
|
+
readonly label: "Playback";
|
|
805
|
+
readonly description: "Ambient videos play muted and loop without controls.";
|
|
806
|
+
readonly presentation: {
|
|
807
|
+
readonly control: "cards";
|
|
808
|
+
readonly choices: readonly [{
|
|
809
|
+
readonly value: "player";
|
|
810
|
+
readonly label: "Player";
|
|
811
|
+
readonly description: "Visitors start the video.";
|
|
812
|
+
}, {
|
|
813
|
+
readonly value: "ambient";
|
|
814
|
+
readonly label: "Ambient";
|
|
815
|
+
readonly description: "Muted, looping, no controls; respects reduced motion.";
|
|
816
|
+
}];
|
|
817
|
+
};
|
|
818
|
+
} & SelectFieldOptions<readonly ["player", "ambient"]>>;
|
|
819
|
+
readonly aspectRatio: SelectFieldDefinition<readonly ["16:9", "4:3", "1:1", "4:5", "9:16"], {
|
|
820
|
+
readonly options: readonly ["16:9", "4:3", "1:1", "4:5", "9:16"];
|
|
821
|
+
readonly required: true;
|
|
822
|
+
readonly defaultValue: "16:9";
|
|
823
|
+
readonly label: "Aspect ratio";
|
|
824
|
+
readonly description: "Reserves the video area before the player loads.";
|
|
825
|
+
readonly presentation: {
|
|
826
|
+
readonly control: "cards";
|
|
827
|
+
readonly choices: readonly [{
|
|
828
|
+
readonly value: "16:9";
|
|
829
|
+
readonly label: "16:9";
|
|
830
|
+
readonly description: "Wide landscape.";
|
|
831
|
+
readonly diagram: {
|
|
832
|
+
readonly cells: readonly [{
|
|
833
|
+
readonly x: 0;
|
|
834
|
+
readonly y: 2;
|
|
835
|
+
readonly width: 12;
|
|
836
|
+
readonly height: 7;
|
|
837
|
+
}];
|
|
838
|
+
};
|
|
839
|
+
}, {
|
|
840
|
+
readonly value: "4:3";
|
|
841
|
+
readonly label: "4:3";
|
|
842
|
+
readonly description: "Classic landscape.";
|
|
843
|
+
readonly diagram: {
|
|
844
|
+
readonly cells: readonly [{
|
|
845
|
+
readonly x: 0;
|
|
846
|
+
readonly y: 1;
|
|
847
|
+
readonly width: 12;
|
|
848
|
+
readonly height: 9;
|
|
849
|
+
}];
|
|
850
|
+
};
|
|
851
|
+
}, {
|
|
852
|
+
readonly value: "1:1";
|
|
853
|
+
readonly label: "1:1";
|
|
854
|
+
readonly description: "Square.";
|
|
855
|
+
readonly diagram: {
|
|
856
|
+
readonly cells: readonly [{
|
|
857
|
+
readonly x: 1;
|
|
858
|
+
readonly y: 1;
|
|
859
|
+
readonly width: 9;
|
|
860
|
+
readonly height: 9;
|
|
861
|
+
}];
|
|
862
|
+
};
|
|
863
|
+
}, {
|
|
864
|
+
readonly value: "4:5";
|
|
865
|
+
readonly label: "4:5";
|
|
866
|
+
readonly description: "Portrait.";
|
|
867
|
+
readonly diagram: {
|
|
868
|
+
readonly cells: readonly [{
|
|
869
|
+
readonly x: 2;
|
|
870
|
+
readonly y: 1;
|
|
871
|
+
readonly width: 8;
|
|
872
|
+
readonly height: 10;
|
|
873
|
+
}];
|
|
874
|
+
};
|
|
875
|
+
}, {
|
|
876
|
+
readonly value: "9:16";
|
|
877
|
+
readonly label: "9:16";
|
|
878
|
+
readonly description: "Tall portrait.";
|
|
879
|
+
readonly diagram: {
|
|
880
|
+
readonly cells: readonly [{
|
|
881
|
+
readonly x: 3;
|
|
882
|
+
readonly y: 0;
|
|
883
|
+
readonly width: 6;
|
|
884
|
+
readonly height: 11;
|
|
885
|
+
}];
|
|
886
|
+
};
|
|
887
|
+
}];
|
|
888
|
+
};
|
|
889
|
+
} & SelectFieldOptions<readonly ["16:9", "4:3", "1:1", "4:5", "9:16"]>>;
|
|
668
890
|
};
|
|
669
891
|
};
|
|
670
892
|
} & {
|
|
@@ -759,7 +981,7 @@ export declare const builtInBlocks: {
|
|
|
759
981
|
readonly description: "Opens the original image full screen when it is selected.";
|
|
760
982
|
readonly label: "Open full screen";
|
|
761
983
|
}>;
|
|
762
|
-
}>;
|
|
984
|
+
}, undefined>;
|
|
763
985
|
hero: BlockDefinition<{
|
|
764
986
|
readonly body: {
|
|
765
987
|
readonly required: false;
|
|
@@ -785,7 +1007,7 @@ export declare const builtInBlocks: {
|
|
|
785
1007
|
readonly required: false;
|
|
786
1008
|
readonly type: "url";
|
|
787
1009
|
};
|
|
788
|
-
}, Readonly<Record<never, FieldDefinition
|
|
1010
|
+
}, Readonly<Record<never, FieldDefinition>>, undefined>;
|
|
789
1011
|
image: BlockDefinition<{
|
|
790
1012
|
readonly media: {
|
|
791
1013
|
readonly required: true;
|
|
@@ -809,7 +1031,7 @@ export declare const builtInBlocks: {
|
|
|
809
1031
|
readonly description: "Opens the original image full screen when it is selected.";
|
|
810
1032
|
readonly label: "Open full screen";
|
|
811
1033
|
}>;
|
|
812
|
-
}>;
|
|
1034
|
+
}, undefined>;
|
|
813
1035
|
link: BlockDefinition<{
|
|
814
1036
|
readonly label: TextFieldDefinition<{
|
|
815
1037
|
readonly label: "Label";
|
|
@@ -833,7 +1055,7 @@ export declare const builtInBlocks: {
|
|
|
833
1055
|
readonly defaultValue: false;
|
|
834
1056
|
readonly required: true;
|
|
835
1057
|
}>;
|
|
836
|
-
}>;
|
|
1058
|
+
}, undefined>;
|
|
837
1059
|
navigation: BlockDefinition<{
|
|
838
1060
|
readonly links: {
|
|
839
1061
|
readonly required: false;
|
|
@@ -895,7 +1117,7 @@ export declare const builtInBlocks: {
|
|
|
895
1117
|
readonly description: "Read by screen readers, for example Main or On this page.";
|
|
896
1118
|
readonly label: "Navigation name";
|
|
897
1119
|
}>;
|
|
898
|
-
}, Readonly<Record<never, FieldDefinition
|
|
1120
|
+
}, Readonly<Record<never, FieldDefinition>>, undefined>;
|
|
899
1121
|
quote: BlockDefinition<{
|
|
900
1122
|
readonly attribution: {
|
|
901
1123
|
readonly required: false;
|
|
@@ -905,13 +1127,13 @@ export declare const builtInBlocks: {
|
|
|
905
1127
|
readonly required: true;
|
|
906
1128
|
readonly type: "text";
|
|
907
1129
|
};
|
|
908
|
-
}, Readonly<Record<never, FieldDefinition
|
|
1130
|
+
}, Readonly<Record<never, FieldDefinition>>, undefined>;
|
|
909
1131
|
richText: BlockDefinition<{
|
|
910
1132
|
readonly content: {
|
|
911
1133
|
readonly required: true;
|
|
912
1134
|
readonly type: "richText";
|
|
913
1135
|
};
|
|
914
|
-
}, Readonly<Record<never, FieldDefinition
|
|
1136
|
+
}, Readonly<Record<never, FieldDefinition>>, undefined>;
|
|
915
1137
|
videoEmbed: BlockDefinition<{
|
|
916
1138
|
readonly url: UrlFieldDefinition<{
|
|
917
1139
|
readonly required: true;
|
|
@@ -927,12 +1149,103 @@ export declare const builtInBlocks: {
|
|
|
927
1149
|
}>;
|
|
928
1150
|
readonly poster: MediaFieldDefinition<{
|
|
929
1151
|
readonly label: "Preview image";
|
|
930
|
-
readonly description: "Optional.
|
|
1152
|
+
readonly description: "Optional. Defers player loading until selected in Player mode; stays underneath Ambient playback.";
|
|
931
1153
|
}>;
|
|
932
1154
|
readonly caption: TextFieldDefinition<{
|
|
933
1155
|
readonly label: "Caption";
|
|
934
1156
|
}>;
|
|
935
|
-
},
|
|
1157
|
+
}, {
|
|
1158
|
+
readonly aspectRatio: SelectFieldDefinition<readonly ["16:9", "4:3", "1:1", "4:5", "9:16"], {
|
|
1159
|
+
readonly options: readonly ["16:9", "4:3", "1:1", "4:5", "9:16"];
|
|
1160
|
+
readonly required: true;
|
|
1161
|
+
readonly defaultValue: "16:9";
|
|
1162
|
+
readonly label: "Aspect ratio";
|
|
1163
|
+
readonly description: "Reserves the video area before the player loads.";
|
|
1164
|
+
readonly presentation: {
|
|
1165
|
+
readonly control: "cards";
|
|
1166
|
+
readonly choices: readonly [{
|
|
1167
|
+
readonly value: "16:9";
|
|
1168
|
+
readonly label: "16:9";
|
|
1169
|
+
readonly description: "Wide landscape.";
|
|
1170
|
+
readonly diagram: {
|
|
1171
|
+
readonly cells: readonly [{
|
|
1172
|
+
readonly x: 0;
|
|
1173
|
+
readonly y: 2;
|
|
1174
|
+
readonly width: 12;
|
|
1175
|
+
readonly height: 7;
|
|
1176
|
+
}];
|
|
1177
|
+
};
|
|
1178
|
+
}, {
|
|
1179
|
+
readonly value: "4:3";
|
|
1180
|
+
readonly label: "4:3";
|
|
1181
|
+
readonly description: "Classic landscape.";
|
|
1182
|
+
readonly diagram: {
|
|
1183
|
+
readonly cells: readonly [{
|
|
1184
|
+
readonly x: 0;
|
|
1185
|
+
readonly y: 1;
|
|
1186
|
+
readonly width: 12;
|
|
1187
|
+
readonly height: 9;
|
|
1188
|
+
}];
|
|
1189
|
+
};
|
|
1190
|
+
}, {
|
|
1191
|
+
readonly value: "1:1";
|
|
1192
|
+
readonly label: "1:1";
|
|
1193
|
+
readonly description: "Square.";
|
|
1194
|
+
readonly diagram: {
|
|
1195
|
+
readonly cells: readonly [{
|
|
1196
|
+
readonly x: 1;
|
|
1197
|
+
readonly y: 1;
|
|
1198
|
+
readonly width: 9;
|
|
1199
|
+
readonly height: 9;
|
|
1200
|
+
}];
|
|
1201
|
+
};
|
|
1202
|
+
}, {
|
|
1203
|
+
readonly value: "4:5";
|
|
1204
|
+
readonly label: "4:5";
|
|
1205
|
+
readonly description: "Portrait.";
|
|
1206
|
+
readonly diagram: {
|
|
1207
|
+
readonly cells: readonly [{
|
|
1208
|
+
readonly x: 2;
|
|
1209
|
+
readonly y: 1;
|
|
1210
|
+
readonly width: 8;
|
|
1211
|
+
readonly height: 10;
|
|
1212
|
+
}];
|
|
1213
|
+
};
|
|
1214
|
+
}, {
|
|
1215
|
+
readonly value: "9:16";
|
|
1216
|
+
readonly label: "9:16";
|
|
1217
|
+
readonly description: "Tall portrait.";
|
|
1218
|
+
readonly diagram: {
|
|
1219
|
+
readonly cells: readonly [{
|
|
1220
|
+
readonly x: 3;
|
|
1221
|
+
readonly y: 0;
|
|
1222
|
+
readonly width: 6;
|
|
1223
|
+
readonly height: 11;
|
|
1224
|
+
}];
|
|
1225
|
+
};
|
|
1226
|
+
}];
|
|
1227
|
+
};
|
|
1228
|
+
} & SelectFieldOptions<readonly ["16:9", "4:3", "1:1", "4:5", "9:16"]>>;
|
|
1229
|
+
readonly playback: SelectFieldDefinition<readonly ["player", "ambient"], {
|
|
1230
|
+
readonly options: readonly ["player", "ambient"];
|
|
1231
|
+
readonly required: true;
|
|
1232
|
+
readonly defaultValue: "player";
|
|
1233
|
+
readonly label: "Playback";
|
|
1234
|
+
readonly description: "Ambient videos play muted and loop without controls.";
|
|
1235
|
+
readonly presentation: {
|
|
1236
|
+
readonly control: "cards";
|
|
1237
|
+
readonly choices: readonly [{
|
|
1238
|
+
readonly value: "player";
|
|
1239
|
+
readonly label: "Player";
|
|
1240
|
+
readonly description: "Visitors start the video.";
|
|
1241
|
+
}, {
|
|
1242
|
+
readonly value: "ambient";
|
|
1243
|
+
readonly label: "Ambient";
|
|
1244
|
+
readonly description: "Muted, looping, no controls; respects reduced motion.";
|
|
1245
|
+
}];
|
|
1246
|
+
};
|
|
1247
|
+
} & SelectFieldOptions<readonly ["player", "ambient"]>>;
|
|
1248
|
+
}, undefined>;
|
|
936
1249
|
};
|
|
937
1250
|
/** Maximum title length shared by draft, publish, REST, and admin validation. */
|
|
938
1251
|
export declare const MAX_TITLE_LENGTH = 200;
|
|
@@ -975,6 +1288,8 @@ export interface EntryAggregateModel {
|
|
|
975
1288
|
readonly blocks: readonly string[];
|
|
976
1289
|
readonly fields: ModelFieldDefinitions;
|
|
977
1290
|
readonly kind: ContentModelKind;
|
|
1291
|
+
/** Conditional-field rules over the model's own fields. */
|
|
1292
|
+
readonly visibility?: FieldVisibility;
|
|
978
1293
|
}
|
|
979
1294
|
/** One ordered, typed block submitted as part of an entry aggregate. */
|
|
980
1295
|
export interface EntryAggregateBlock {
|