@blinkk/root-cms 3.0.2 → 3.0.3
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/app.js +5 -5
- package/dist/{chunk-3HARN4U6.js → chunk-7Z5IRD2G.js} +176 -83
- package/dist/{chunk-2BSW7SIH.js → chunk-N4K6ICFR.js} +4 -4
- package/dist/{chunk-BGTUWIV6.js → chunk-PNLLZXVY.js} +4 -4
- package/dist/{chunk-C245C557.js → chunk-RXWDB3K4.js} +3 -3
- package/dist/{chunk-XLX37FRL.js → chunk-TEKMLYXS.js} +3 -4
- package/dist/cli/cli.d.ts +12 -0
- package/dist/cli/docs.d.ts +49 -0
- package/dist/cli/export.d.ts +11 -0
- package/dist/cli/generate-types.d.ts +6 -0
- package/dist/cli/import.d.ts +13 -0
- package/dist/cli/init-firebase.d.ts +7 -0
- package/dist/cli/utils.d.ts +27 -0
- package/dist/cli.js +10 -10
- package/dist/client.js +1 -1
- package/dist/core/ai-tools.d.ts +156 -0
- package/dist/core/ai.d.ts +330 -0
- package/dist/core/api.d.ts +21 -0
- package/dist/core/app.d.ts +16 -0
- package/dist/core/checks-translations.d.ts +13 -0
- package/dist/core/checks.d.ts +48 -0
- package/dist/core/client.d.ts +715 -0
- package/dist/core/core.d.ts +5 -0
- package/dist/core/cron.d.ts +19 -0
- package/dist/core/csv.d.ts +5 -0
- package/dist/core/functions.d.ts +9 -0
- package/dist/core/plugin.d.ts +357 -0
- package/dist/{project.d.ts → core/project.d.ts} +8 -12
- package/dist/core/richtext.d.ts +101 -0
- package/dist/{core.d.ts → core/route.d.ts} +13 -66
- package/dist/core/runtime.d.ts +46 -0
- package/dist/{schema-Db_xODoi.d.ts → core/schema.d.ts} +47 -100
- package/dist/core/search-extract.d.ts +70 -0
- package/dist/core/search-index.d.ts +182 -0
- package/dist/core/search-query.d.ts +68 -0
- package/dist/core/security.d.ts +6 -0
- package/dist/core/server-version.d.ts +5 -0
- package/dist/core/services-notifications.d.ts +57 -0
- package/dist/core/services.d.ts +44 -0
- package/dist/core/sse.d.ts +10 -0
- package/dist/core/translations-manager.d.ts +187 -0
- package/dist/core/translations.d.ts +83 -0
- package/dist/core/url-safety.d.ts +19 -0
- package/dist/core/validation.d.ts +30 -0
- package/dist/core/values.d.ts +9 -0
- package/dist/core/versions.d.ts +48 -0
- package/dist/core.js +1 -1
- package/dist/edit-M4PN4SGX.js +7 -0
- package/dist/functions.js +4 -4
- package/dist/{generate-types-SPV7I3A5.js → generate-types-JWIG4QVI.js} +1 -1
- package/dist/plugin.js +124 -129
- package/dist/shared/marshal.d.ts +68 -0
- package/dist/shared/objects.d.ts +9 -0
- package/dist/shared/richtext.d.ts +74 -0
- package/dist/shared/safe-json.d.ts +11 -0
- package/dist/shared/sanitize.d.ts +12 -0
- package/dist/shared/slug.d.ts +19 -0
- package/dist/shared/sse.d.ts +16 -0
- package/dist/shared/strings.d.ts +23 -0
- package/dist/ui/AIPage-2LUC2PWC.js +1 -0
- package/dist/ui/AssetsPage-PODV4QAB.js +1 -0
- package/dist/ui/CollectionPage-4DMKW5YB.js +1 -0
- package/dist/ui/ComparePage-JMJE5A5Y.js +1 -0
- package/dist/ui/DataPage-MVLZT2BU.js +1 -0
- package/dist/ui/DataSourcePage-4RPBXRI2.js +1 -0
- package/dist/ui/DocTranslationsPage-XJSPKGVX.js +1 -0
- package/dist/ui/DocumentPage-R2PVNG24.js +1 -0
- package/dist/ui/EditDataSourcePage-3SHAARNL.js +1 -0
- package/dist/ui/EditReleasePage-G5VW2OGW.js +1 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js +81 -0
- package/dist/ui/ImageEditorDialog-4H665KK2.js.LEGAL.txt +17 -0
- package/dist/ui/LogsPage-K6KYEG2P.js +1 -0
- package/dist/ui/NewDataSourcePage-O2VQEOJG.js +1 -0
- package/dist/ui/NewReleasePage-RSVS32RZ.js +1 -0
- package/dist/ui/NotFoundPage-ZYD5ILG6.js +1 -0
- package/dist/ui/ProjectPage-X3YQBWL4.js +1 -0
- package/dist/ui/ReleasePage-FJHHXNNB.js +1 -0
- package/dist/ui/ReleasesPage-VGWIBNEZ.js +1 -0
- package/dist/ui/SettingsPage-C4RXOQ6T.js +1 -0
- package/dist/ui/SidebarToolsPage-ZBOKPEMP.js +1 -0
- package/dist/ui/TaskPage-BQ4OX5WN.js +1 -0
- package/dist/ui/TasksPage-3IGQYVYS.js +1 -0
- package/dist/ui/TranslationsArbPage-GGHCWPQL.js +2 -0
- package/dist/ui/TranslationsEditPage-E2BCMKYV.js +1 -0
- package/dist/ui/TranslationsPage-MC4O4ZNI.js +162 -0
- package/dist/ui/ai-tools-5E5ELLZX.js +1 -0
- package/dist/ui/chunk-3IYZCUPI.js +1 -0
- package/dist/ui/chunk-4KE2SZKH.js +1 -0
- package/dist/ui/chunk-4W73RW5I.js +1 -0
- package/dist/ui/chunk-54DVDYU6.js +1 -0
- package/dist/ui/chunk-5MV6XVGA.js +1 -0
- package/dist/ui/chunk-62UWGWON.js +1 -0
- package/dist/ui/chunk-6IFGKSIE.js +1 -0
- package/dist/ui/chunk-767BAQ53.js +1 -0
- package/dist/ui/chunk-AFWBSIPL.js +1 -0
- package/dist/ui/chunk-AL3TN2KI.js +1 -0
- package/dist/ui/chunk-B6BLDN24.js +141 -0
- package/dist/ui/chunk-B6BLDN24.js.LEGAL.txt +106 -0
- package/dist/ui/chunk-BZIRGB4W.js +1 -0
- package/dist/ui/chunk-C5NH23G4.js +3 -0
- package/dist/ui/chunk-CGCKJFL4.js +1 -0
- package/dist/ui/chunk-DEGMKEHP.js +1 -0
- package/dist/ui/chunk-DTMZLUNY.js +15 -0
- package/dist/ui/chunk-DTMZLUNY.js.LEGAL.txt +237 -0
- package/dist/ui/chunk-DUJYIOLE.js +5 -0
- package/dist/ui/chunk-E2RCCK2T.js +1 -0
- package/dist/ui/chunk-EGEB6N4J.js +22 -0
- package/dist/ui/chunk-EGEB6N4J.js.LEGAL.txt +1059 -0
- package/dist/ui/chunk-GXSAEPU3.js +1 -0
- package/dist/ui/chunk-HHMG665Z.js +1 -0
- package/dist/ui/chunk-HKINZLMW.js +84 -0
- package/dist/ui/chunk-HLMBCVRX.js +1 -0
- package/dist/ui/chunk-HRGYNHZ3.js +1 -0
- package/dist/ui/chunk-I6ICVKEC.js +1 -0
- package/dist/ui/chunk-IU36W2TB.js +1 -0
- package/dist/ui/chunk-JDW4UORS.js +1 -0
- package/dist/ui/chunk-JHBAMPGB.js +1 -0
- package/dist/ui/chunk-JYFLU7DM.js +19 -0
- package/dist/ui/chunk-JZFTZ4X4.js +87 -0
- package/dist/ui/chunk-JZFTZ4X4.js.LEGAL.txt +9 -0
- package/dist/ui/chunk-KFAZBEPV.js +1 -0
- package/dist/ui/chunk-KKEWCXVV.js +1 -0
- package/dist/ui/chunk-KUCVLANF.js +1 -0
- package/dist/ui/chunk-KYDOSLTO.js +1 -0
- package/dist/ui/chunk-L4RHGQUG.js +1 -0
- package/dist/ui/chunk-MDUBCXU2.js +1 -0
- package/dist/ui/chunk-NXQVLOTK.js +1 -0
- package/dist/ui/chunk-NZHF733K.js +7 -0
- package/dist/ui/chunk-NZHF733K.js.LEGAL.txt +146 -0
- package/dist/ui/chunk-ONTGW2VA.js +1 -0
- package/dist/ui/chunk-ORXEMIQC.js +1 -0
- package/dist/ui/chunk-PHBMVORG.js +1 -0
- package/dist/ui/chunk-PJA7YP4A.js +1 -0
- package/dist/ui/chunk-PVAE643M.js +1 -0
- package/dist/ui/chunk-PWKJDYE2.js +1 -0
- package/dist/ui/chunk-RSVO46S3.js +1 -0
- package/dist/ui/chunk-SKEP5WYH.js +10 -0
- package/dist/ui/chunk-SKEP5WYH.js.LEGAL.txt +176 -0
- package/dist/ui/chunk-SQRKKWRG.js +3 -0
- package/dist/ui/chunk-UEON4JAT.js +1 -0
- package/dist/ui/chunk-V7S4IAGB.js +1 -0
- package/dist/ui/chunk-VMT7JFAM.js +1 -0
- package/dist/ui/chunk-W3BJ2EZX.js +1 -0
- package/dist/ui/chunk-W3HIZQ4Z.js +1 -0
- package/dist/ui/chunk-X2WHBGTP.js +1 -0
- package/dist/ui/chunk-XOQ3KDSR.js +3 -0
- package/dist/ui/chunk-YDO2EDVY.js +1 -0
- package/dist/ui/chunk-YFA6U2CV.js +1 -0
- package/dist/ui/gcs-L33FIRZU.js +1 -0
- package/dist/ui/prerender-Q4YSDCPB.js +1 -0
- package/dist/ui/signin.js +1 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +1 -630
- package/dist/ui/ui.js.LEGAL.txt +19 -732
- package/package.json +20 -20
- package/dist/client-1puwLgNx.d.ts +0 -1552
- package/dist/client.d.ts +0 -5
- package/dist/edit-MT4B37QK.js +0 -7
- package/dist/functions.d.ts +0 -13
- package/dist/plugin.d.ts +0 -5
- package/dist/richtext.d.ts +0 -104
package/dist/client.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import '@blinkk/root';
|
|
2
|
-
import 'firebase-admin/app';
|
|
3
|
-
import 'firebase-admin/firestore';
|
|
4
|
-
export { A as Action, r as ArrayObject, F as BatchRequest, B as BatchRequestOptions, y as BatchRequestQuery, z as BatchRequestQueryOptions, I as BatchResponse, C as CronUnit, d as DataSource, c as DataSourceCron, e as DataSourceData, f as DataSourceMode, b as Doc, D as DocMode, j as GetCountOptions, G as GetDocOptions, H as HttpMethod, m as ListActionsOptions, i as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, l as Release, R as RootCMSClient, g as SaveDraftOptions, S as SetDocOptions, k as Translation, E as TranslationsDoc, T as TranslationsMap, h as UpdateDraftOptions, U as UserRole, o as getCmsPlugin, n as isRichTextData, s as marshalArray, p as marshalData, q as normalizeData, x as parseDocId, t as toArrayObject, w as translationsForLocale, v as unmarshalArray, u as unmarshalData } from './client-1puwLgNx.js';
|
|
5
|
-
import './schema-Db_xODoi.js';
|
package/dist/edit-MT4B37QK.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import "./chunk-MLKGABMK.js";
|
|
2
|
-
|
|
3
|
-
// shared/ai/prompts/edit.txt
|
|
4
|
-
var edit_default = 'Role: You are a highly accurate AI assistant specializing in converting unstructured documents into JSON files compatible with Root CMS. Root CMS is a web-based CMS for building websites and landing pages, storing its content as JSON files in a Firebase Firestore database.\n\nObjective: To edit and/or generate highly accurate JSON files compatible with Root CMS, based on user input (screenshots, chat messages, etc.) and, when editing JSON files, the original JSON file you are editing. The resulting content should contain all of the marketing content provided by the user input (and none of the annotations or superfluous content). The JSON files should be perfectly compatible with Root CMS.\n\nInput Requirements & Handling:\n\n- You will receive unstructured documents and you must convert them into JSON files compatible with Root CMS by either editing the existing JSON files or generating new ones from scratch. The JSON files you produce will typically represent a single section of a page of the website, such as a hero section, a feature section, or a footer.\n\n- When editing an existing JSON file, it will be annotated with a key `_type` that indicates the type of section it is, such as `Hero`, `Feature`, or `Footer`. You must ensure that the resulting JSON file is compatible with Root CMS and contains all of the marketing content provided by the user input. You will also be given a TypeScript interface in `root-cms.d.ts` that describes the structure of the JSON file you are editing. You must ensure that the resulting JSON file is compatible with this interface.\n\n- The input you receive will be broken into three parts. (1) `root-cms-d.ts` (the TypeScript interface), (2) the existing JSON file you are editing (or an empty JSON file when generating new content), and (3) the user input (screenshots, chat messages, instructions, etc.). You must ensure that the resulting JSON file is compatible with the structure defined by the TypeScript interface and contains all of the marketing content provided by the user input.\n\n- When you provide your response, if the user instructs you to only edit one part of the original JSON, make sure to leave the rest of the JSON file untouched. You must return the entire JSON document after applying changes. Never omit, rename, reorder or invent top-level keys. Copy all unmodified fields exactly as they appear in the input.\n\nRoot CMS JSON File Structure:\n\n- Root CMS JSON files are standard JSON files described by the TypeScript interface in `root-cms.d.ts`. However, there is one critical syntax rule that you must understand and always follow regarding array values. Array values are expressed as hash maps. The order of the resulting data when Root CMS unmarshals the data is provided by a special key called `_array`. For example, to represent an array [1, 2, 3] in the CMS, the JSON data may look like this. You may generate your own UIDs for the keys and the items within `_array`.\n\n```json\n{\n "_array": ["2HGwoV", "LjFHWk", "OLakGA", "UaGHJh"],\n "2HGwoV": 1,\n "LjFHWk": 2,\n "OLakGA": 3,\n "UaGHJh": 4\n}\n```\n\nWhen creating arrays in your JSON output, you must _never_ forget to add an `_array` key. If you forget to add an `_array` key, the output will NOT work with Root CMS. When adding new array items, you can create your own array keys.\n\nThe ONE exception to this rule is the `blocks` array inside a Rich Text field (see #3 below). Rich Text data is stored as-is and is NOT marshaled, so `blocks` MUST always be a plain JSON array, never an `_array` object. Wrapping rich text `blocks` in `_array` notation will corrupt the data when it is saved.\n\n2. Images and file fields have system-provided metadata, that looks like this example:\n\n```\n{\n "src": "https://storage.googleapis.com/rootjs-dev.appspot.com/www/uploads/2cad5d65bb7690bad5dcd4a041cf2fef46361678.svg",\n "filename": "600x400.svg",\n "uploadedAt": "1754023634564",\n "alt": "",\n "width": "600",\n "uploadedBy": "user@example.com",\n "height": "400"\n}\n```\n\n3. Rich Text fields are stored as Editor.js / Lexical documents, which look like this. You may generate your own UIDs for the `id` fields. Note that `blocks` MUST be a plain JSON array \u2014 do NOT use the `_array` object notation here.\n\n```\n{\n "version": "2.28.2",\n "time": 1754024041637,\n "blocks": [\n {\n "type": "paragraph",\n "data": {\n "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. <a href=\\"https://example.com\\">This accepts HTML</a>."\n },\n "id": "_8PEf3kBx2"\n },\n {\n "data": {\n "style": "unordered",\n "items": [\n {\n "content": "This is list item 1.",\n "items": []\n },\n {\n "items": [],\n "content": "This is list item 2."\n }\n ]\n },\n "id": "G5zMDP1ytM",\n "type": "unorderedList"\n }\n ]\n}\n```\n\n4. Root CMS supports "oneOf" fields, where values can be "one of" another schema. These are typically used as array values or object values, where the user can from one of other schema types to structure the data value. For example, each module in a page\'s module list is "one of" the modules available in the library. One of values have a system-provided `_type` key that describes the type of the value. For example, this is a hero module, whose type is "TemplateHeadline", one of the available templates from the module library:\n\n```\n{\n "eyebrow": "Lorem ipsum",\n "_type": "TemplateHeadline",\n "body": {\n "time": 1754023554170,\n "version": "2.28.2",\n "blocks": [\n {\n "type": "paragraph",\n "data": {\n "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."\n },\n "id": "IVmxEVsxmt"\n },\n {\n "id": "aMiHiywkQD",\n "type": "paragraph",\n "data": {\n "text": "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."\n }\n }\n ]\n },\n "title": "Welcome to our website"\n}\n```\n\nWhen adding new items to arrays that use `oneOf` fields, try your best to figure out which content type would best satisfy the user\'s request. You must never _invent_ new content types, for example, if "TemplateFoo" doesn\'t exist in `root-cms.d.ts`, you must never add a value with `{"_type": "TemplateFoo"}`. If none of the available content types within `root-cms.d.ts` satisfy the user\'s request, avoid creating the new array item and inform the user that there is no existing template compatible.\n\nAdditionally, when adding new items to existing JSON data, you must carefully check the structure of those items as defined by `root-cms.d.ts`. Avoid inventing new fields for content types, use only those defined by the `root-cms.d.ts`. For example, if you are adding a button to a module, carefully check the button structure defined in `root-cms.d.ts` and only populate fields that are defined there.\n\nFinally, when you provide your response, it MUST be structured in the following way for handling by the chat client.\n\n{\n "data": <The JSON data generated by you via the instructions above>,\n "message": <A brief message that describes what you did.>\n}\n\nYou must always ONLY reply in this exact format. The brief message that describes what you did should be written succinctly, tersely, in a friendly but not cute tone, and be no more than a sentence or two.\n';
|
|
5
|
-
export {
|
|
6
|
-
edit_default as default
|
|
7
|
-
};
|
package/dist/functions.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as firebase_functions_scheduler from 'firebase-functions/scheduler';
|
|
2
|
-
import { ScheduleOptions } from 'firebase-functions/v2/scheduler';
|
|
3
|
-
|
|
4
|
-
interface CronOptions {
|
|
5
|
-
rootDir?: string;
|
|
6
|
-
scheduleOptions?: Partial<ScheduleOptions>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Runs offline CMS tasks, such as publishing of scheduled docs.
|
|
10
|
-
*/
|
|
11
|
-
declare function cron(options?: CronOptions): firebase_functions_scheduler.ScheduleFunction;
|
|
12
|
-
|
|
13
|
-
export { type CronOptions, cron };
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import '@blinkk/root';
|
|
2
|
-
import 'firebase-admin/app';
|
|
3
|
-
import 'firebase-admin/firestore';
|
|
4
|
-
export { a5 as AiConfig, a6 as AiModelConfig, a7 as AiProvider, $ as CMSAIConfig, Z as CMSBuiltInSidebarTool, a8 as CMSCheck, ag as CMSNotificationService, a3 as CMSPlugin, a2 as CMSPluginOptions, a0 as CMSSearchIndexConfig, ae as CMSService, af as CMSServiceContext, a1 as CMSSidebarTool, aj as CMSTranslationService, _ as CMSUser, aa as CheckContext, a9 as CheckResult, ab as CheckStatus, ah as NotificationResult, ai as NotificationServiceContext, ak as TranslationExportResult, al as TranslationImportResult, am as TranslationRow, an as TranslationServiceContext, ad as TranslationsCheckOptions, a4 as cmsPlugin, ac as translationsCheck } from './client-1puwLgNx.js';
|
|
5
|
-
import './schema-Db_xODoi.js';
|
package/dist/richtext.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import * as preact from 'preact';
|
|
2
|
-
import { FunctionalComponent } from 'preact';
|
|
3
|
-
|
|
4
|
-
interface RichTextBlock {
|
|
5
|
-
type: string;
|
|
6
|
-
data?: any;
|
|
7
|
-
}
|
|
8
|
-
interface RichTextData {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
blocks: RichTextBlock[];
|
|
11
|
-
}
|
|
12
|
-
type RichTextComponent = FunctionalComponent<any>;
|
|
13
|
-
type RichTextBlockComponent = RichTextComponent;
|
|
14
|
-
type RichTextInlineComponent = RichTextComponent;
|
|
15
|
-
type RichTextComponentMap = Record<string, RichTextComponent>;
|
|
16
|
-
interface RichTextContextProps {
|
|
17
|
-
/**
|
|
18
|
-
* Rich text components override for both inline and block level components.
|
|
19
|
-
*/
|
|
20
|
-
components?: RichTextComponentMap;
|
|
21
|
-
/**
|
|
22
|
-
* Translator function override.
|
|
23
|
-
*/
|
|
24
|
-
t?: (msg: string, params?: Record<string, string | number>) => string;
|
|
25
|
-
}
|
|
26
|
-
declare const RichTextContext: preact.Context<RichTextContextProps>;
|
|
27
|
-
declare function useRichTextContext(): RichTextContextProps;
|
|
28
|
-
interface RichTextProps {
|
|
29
|
-
data: RichTextData | undefined;
|
|
30
|
-
components?: Record<string, RichTextBlockComponent>;
|
|
31
|
-
/** @deprecated */
|
|
32
|
-
translate?: boolean;
|
|
33
|
-
}
|
|
34
|
-
/** Renders data from the "richtext" field. */
|
|
35
|
-
declare function RichText(props: RichTextProps): preact.JSX.Element | null;
|
|
36
|
-
declare namespace RichText {
|
|
37
|
-
var Block: (props: RichTextBlock) => preact.JSX.Element | null;
|
|
38
|
-
var ParagraphBlock: (props: RichTextParagraphBlockProps) => preact.JSX.Element | null;
|
|
39
|
-
var HeadingBlock: (props: RichTextHeadingBlockProps) => preact.JSX.Element | null;
|
|
40
|
-
var ListBlock: (props: RichTextListBlockProps) => preact.JSX.Element | null;
|
|
41
|
-
var ImageBlock: (props: RichTextImageBlockProps) => preact.JSX.Element | null;
|
|
42
|
-
var HtmlBlock: (props: RichTextHtmlBlockProps) => preact.JSX.Element | null;
|
|
43
|
-
var TableBlock: (props: RichTextTableBlockProps) => preact.JSX.Element | null;
|
|
44
|
-
}
|
|
45
|
-
interface RichTextParagraphBlockProps {
|
|
46
|
-
type: 'paragraph';
|
|
47
|
-
data?: {
|
|
48
|
-
text?: string;
|
|
49
|
-
components?: Record<string, any>;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
interface RichTextHeadingBlockProps {
|
|
53
|
-
type: 'heading';
|
|
54
|
-
data?: {
|
|
55
|
-
level?: number;
|
|
56
|
-
text?: string;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
interface ListItem {
|
|
60
|
-
content?: string;
|
|
61
|
-
items?: ListItem[];
|
|
62
|
-
components?: Record<string, any>;
|
|
63
|
-
}
|
|
64
|
-
interface RichTextListBlockProps {
|
|
65
|
-
type: 'orderedList' | 'unorderedList';
|
|
66
|
-
data?: {
|
|
67
|
-
style?: 'ordered' | 'unordered';
|
|
68
|
-
items?: ListItem[];
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
interface RichTextImageBlockProps {
|
|
72
|
-
type: 'image';
|
|
73
|
-
data?: {
|
|
74
|
-
/** The caption entered into the CMS Image field. */
|
|
75
|
-
caption?: string;
|
|
76
|
-
file?: {
|
|
77
|
-
url: string;
|
|
78
|
-
width: string | number;
|
|
79
|
-
height: string | number;
|
|
80
|
-
alt: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
interface RichTextHtmlBlockProps {
|
|
85
|
-
type: 'html';
|
|
86
|
-
data?: {
|
|
87
|
-
html?: string;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
interface RichTextTableBlockProps {
|
|
91
|
-
type: 'table';
|
|
92
|
-
data?: {
|
|
93
|
-
rows?: Array<{
|
|
94
|
-
cells: Array<{
|
|
95
|
-
blocks: RichTextBlock[];
|
|
96
|
-
type: 'header' | 'data';
|
|
97
|
-
}>;
|
|
98
|
-
}>;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/** Returns whether the rich text value is truthy. */
|
|
102
|
-
declare function testContent(data: RichTextData): boolean;
|
|
103
|
-
|
|
104
|
-
export { RichText, type RichTextBlock, type RichTextBlockComponent, type RichTextComponent, type RichTextComponentMap, RichTextContext, type RichTextContextProps, type RichTextData, type RichTextHeadingBlockProps, type RichTextHtmlBlockProps, type RichTextImageBlockProps, type RichTextInlineComponent, type RichTextListBlockProps, type RichTextParagraphBlockProps, type RichTextProps, type RichTextTableBlockProps, testContent, useRichTextContext };
|