@shapio/schema 0.3.1 → 0.4.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.
- package/dist/index.d.ts +36 -9
- package/dist/index.js +181 -73
- package/dist/index.js.map +1 -1
- package/dist/resolve-7-z9VQqw.d.ts +91 -0
- package/dist/resolve-viddCEYd.js +91 -0
- package/dist/resolve-viddCEYd.js.map +1 -0
- package/dist/seoResolve.d.ts +2 -0
- package/dist/seoResolve.js +2 -0
- package/package.json +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as isEmptyRichText, i as RichTextResult, n as RichTextNode, o as richTextMediaIds, r as RichTextProblem, s as validateRichText, t as RichTextDocument } from "./validate-Oyo0GJ9j.js";
|
|
2
|
+
import { S as SeoFieldKey, _ as SEO_FIELD_IDS, a as EMPTY_SEO_DEFAULTS, b as SEO_TITLE_TEMPLATE_PATTERN, c as seoDefaultsForLocale, d as SeoLocaleDefaults, f as SeoLocaleDefaultsSchema, g as SEO_EDITOR_ID, h as SEO_DESCRIPTION_SOFT_MAX, i as resolveSeo, l as SeoDefaults, m as SEO_COMPONENT_ID, n as ResolveSeoContext, o as applyTitleTemplate, p as SEO_COMPONENT_API_KEY, r as SeoKeys, s as isValidTitleTemplate, t as DEFAULT_SEO_KEYS, u as SeoDefaultsSchema, v as SEO_TITLE_PLACEHOLDER, x as SEO_TWITTER_HANDLE_PATTERN, y as SEO_TITLE_SOFT_MAX } from "./resolve-7-z9VQqw.js";
|
|
2
3
|
import { Static, TSchema, Type } from "typebox";
|
|
3
4
|
//#region src/ids.d.ts
|
|
4
5
|
/**
|
|
@@ -584,15 +585,27 @@ export declare const listCompatibleEditors: (field: FieldDefinition) => EditorCa
|
|
|
584
585
|
//#endregion
|
|
585
586
|
//#region src/display/layout.d.ts
|
|
586
587
|
/**
|
|
587
|
-
* Data types that
|
|
588
|
-
* media must hold several files (`isCanvasEligible`); a single component or file is a property
|
|
588
|
+
* Data types that are blocks of the entry document's canvas by default. Components must also be repeatable
|
|
589
|
+
* and media must hold several files (`isCanvasEligible`); a single component or file is a property unless
|
|
590
|
+
* `display.canvasFieldIds` places it in the document.
|
|
589
591
|
*/
|
|
590
592
|
export declare const CANVAS_ELIGIBLE: ReadonlySet<DataType>;
|
|
591
593
|
/** Title types that the document edits inline as its H1; any other title type stays a property. */
|
|
592
594
|
export declare const INLINE_TITLE_TYPES: ReadonlySet<DataType>;
|
|
593
595
|
/** How many properties the strip shows when `display.stripFieldIds` is not set. */
|
|
594
596
|
export declare const STRIP_DEFAULT_COUNT = 5;
|
|
597
|
+
/**
|
|
598
|
+
* The automatic rule: the fields written in the document while `display.canvasFieldIds` is unset (rich
|
|
599
|
+
* text, dynamic zones, repeatable components, media with several files). Also what a canvas field can take
|
|
600
|
+
* between blocks: only these hold blocks.
|
|
601
|
+
*/
|
|
595
602
|
export declare const isCanvasEligible: (field: FieldDefinition) => boolean;
|
|
603
|
+
/**
|
|
604
|
+
* Whether `display.canvasFieldIds` may list the field: any field but the entry's title (`effectiveTitleField`),
|
|
605
|
+
* which the document shows as its heading. A configured cover is refused by the validator; an automatically
|
|
606
|
+
* chosen one placed in the document simply stops being the cover.
|
|
607
|
+
*/
|
|
608
|
+
export declare const isDocumentPlaceable: (field: FieldDefinition, title: FieldDefinition | undefined) => boolean;
|
|
596
609
|
/** A single `media` field that may hold an image. */
|
|
597
610
|
export declare const isCoverEligible: (field: FieldDefinition) => boolean;
|
|
598
611
|
/** Properties under one of the model's `display.groups` (`label` undefined for ungrouped fields). */
|
|
@@ -607,7 +620,10 @@ export type DocumentLayout = {
|
|
|
607
620
|
/** The title is edited inline as the H1 (string/text); otherwise it is shown read-only and is a property. */
|
|
608
621
|
titleInline: boolean;
|
|
609
622
|
cover: FieldDefinition | undefined;
|
|
610
|
-
/**
|
|
623
|
+
/**
|
|
624
|
+
* The fields written in the document, in order: block fields (`isCanvasEligible`) and any other field
|
|
625
|
+
* that `display.canvasFieldIds` places there, each under its heading.
|
|
626
|
+
*/
|
|
611
627
|
canvas: FieldDefinition[];
|
|
612
628
|
/** Every other live field, ordered by `display.groups`, then field order. */
|
|
613
629
|
properties: FieldDefinition[];
|
|
@@ -620,10 +636,10 @@ export type DocumentLayout = {
|
|
|
620
636
|
strip: FieldDefinition[] | null;
|
|
621
637
|
};
|
|
622
638
|
/**
|
|
623
|
-
* The entry document's layout: title, cover,
|
|
624
|
-
* when they point at live, eligible fields; anything else falls back to the defaults (canvas: every
|
|
625
|
-
*
|
|
626
|
-
* skipped, so a stale definition never breaks the editor. Pure: no values, no I/O.
|
|
639
|
+
* The entry document's layout: title, cover, document fields and properties. Configured `display` ids win
|
|
640
|
+
* when they point at live, eligible fields; anything else falls back to the defaults (canvas: every block
|
|
641
|
+
* field in field order; cover: the first single image field not in the canvas). Deprecated, unknown ids and
|
|
642
|
+
* the title are skipped, so a stale definition never breaks the editor. Pure: no values, no I/O.
|
|
627
643
|
*/
|
|
628
644
|
export declare const effectiveLayout: (model: ModelDefinition) => DocumentLayout;
|
|
629
645
|
/** The strip's properties: the configured ones, or the first `limit` that `hasValue` says are non-empty. */
|
|
@@ -1171,7 +1187,7 @@ export type ThemeVariant = (typeof THEME_VARIANTS)[number];
|
|
|
1171
1187
|
/** A theme key: used in `data-theme` and in CSS selectors, so deliberately narrow. */
|
|
1172
1188
|
export declare const THEME_KEY_PATTERN: RegExp;
|
|
1173
1189
|
/** The themes the admin ships; an extension theme may not reuse these keys. */
|
|
1174
|
-
export declare const BUILT_IN_THEME_KEYS: readonly ["shapio", "classic", "murdered-out", "snowed"];
|
|
1190
|
+
export declare const BUILT_IN_THEME_KEYS: readonly ["shapio", "classic", "murdered-out", "forest", "snowed", "butter"];
|
|
1175
1191
|
export type BuiltInThemeKey = (typeof BUILT_IN_THEME_KEYS)[number];
|
|
1176
1192
|
/**
|
|
1177
1193
|
* A token value an extension may use: a hex colour or a colour function whose arguments are numbers, units
|
|
@@ -1208,5 +1224,16 @@ export type ContrastCheck = {
|
|
|
1208
1224
|
/** Every pair the variant must meet, with its ratio. Missing tokens report an undefined ratio. */
|
|
1209
1225
|
export declare const checkThemeContrast: (tokens: Readonly<Record<string, string>>, variant: ThemeVariant) => ContrastCheck[];
|
|
1210
1226
|
//#endregion
|
|
1211
|
-
|
|
1227
|
+
//#region src/seo/field.d.ts
|
|
1228
|
+
/** Whether a field holds the built-in SEO component (by stable ID, whatever its API ID or editor). */
|
|
1229
|
+
export declare const isSeoField: (field: FieldDefinition) => boolean;
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/seo/definition.d.ts
|
|
1232
|
+
/**
|
|
1233
|
+
* The built-in SEO component as first created. All fields are public and none has a length limit: the 70 and
|
|
1234
|
+
* 160 character marks are admin-only counters (`SEO_TITLE_SOFT_MAX`), never validation.
|
|
1235
|
+
*/
|
|
1236
|
+
export declare const seoComponentDefinition: () => ComponentDefinition;
|
|
1237
|
+
//#endregion
|
|
1238
|
+
export { DEFAULT_SEO_KEYS, EMPTY_SEO_DEFAULTS, ResolveSeoContext, RichTextDocument, RichTextNode, RichTextProblem, RichTextResult, SEO_COMPONENT_API_KEY, SEO_COMPONENT_ID, SEO_DESCRIPTION_SOFT_MAX, SEO_EDITOR_ID, SEO_FIELD_IDS, SEO_TITLE_PLACEHOLDER, SEO_TITLE_SOFT_MAX, SEO_TITLE_TEMPLATE_PATTERN, SEO_TWITTER_HANDLE_PATTERN, SeoDefaults, SeoDefaultsSchema, SeoFieldKey, SeoKeys, SeoLocaleDefaults, SeoLocaleDefaultsSchema, applyTitleTemplate, isEmptyRichText, isValidTitleTemplate, resolveSeo, richTextMediaIds, seoDefaultsForLocale, validateRichText };
|
|
1212
1239
|
//# sourceMappingURL=index.d.ts.map
|