@payloadcms/richtext-lexical 4.0.0-internal.5f0cd13 → 4.0.0-internal.688c4d0
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/@types/assets.d.js +2 -0
- package/dist/@types/assets.d.js.map +1 -0
- package/dist/cell/rscEntry.d.ts.map +1 -1
- package/dist/cell/rscEntry.js +5 -5
- package/dist/cell/rscEntry.js.map +1 -1
- package/dist/exports/client/Field-VYBSMSRY.js +2 -0
- package/dist/exports/client/Field-VYBSMSRY.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-5VIL27GI.js +2 -0
- package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
- package/dist/exports/client/chunk-ESITTE3C.js +2 -0
- package/dist/exports/client/chunk-ESITTE3C.js.map +7 -0
- package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
- package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
- package/dist/exports/client/{component-HKTAZ77E.js → component-PHZQBOJE.js} +2 -2
- package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
- package/dist/exports/client/index.d.ts +1 -0
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +25 -25
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/rsc.browser.d.ts +11 -0
- package/dist/exports/server/rsc.browser.d.ts.map +1 -0
- package/dist/exports/server/rsc.browser.js +10 -0
- package/dist/exports/server/rsc.browser.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts +1 -0
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +16 -8
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +15 -7
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +4 -2
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +1 -0
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +6 -8
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/schema.d.ts +5 -5
- package/dist/features/blocks/server/schema.d.ts.map +1 -1
- package/dist/features/blocks/server/schema.js +26 -23
- package/dist/features/blocks/server/schema.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.d.ts +13 -15
- package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts +13 -15
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts +2 -2
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.js +5 -4
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts +12 -14
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +12 -14
- package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
- package/dist/features/experimental_table/server/schema.d.ts.map +1 -1
- package/dist/features/experimental_table/server/schema.js +6 -3
- package/dist/features/experimental_table/server/schema.js.map +1 -1
- package/dist/features/link/server/schema.d.ts.map +1 -1
- package/dist/features/link/server/schema.js +10 -7
- package/dist/features/link/server/schema.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +5 -8
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/upload/client/component/index.css +2 -2
- package/dist/features/upload/server/schema.d.ts +4 -4
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +34 -18
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/clientEntry.d.ts +29 -0
- package/dist/field/clientEntry.d.ts.map +1 -0
- package/dist/field/clientEntry.js +86 -0
- package/dist/field/clientEntry.js.map +1 -0
- package/dist/field/index.css +13 -12
- package/dist/field/index.js +1 -1
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js +2 -0
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -4
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +36 -2
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +22 -7
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +5 -1
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/types/builtInNodes.d.ts.map +1 -1
- package/dist/types/builtInNodes.js +17 -17
- package/dist/types/builtInNodes.js.map +1 -1
- package/dist/types/index.d.ts +16 -16
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts +2 -0
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
- package/dist/types/jsonSchemaHelpers.js +7 -3
- package/dist/types/jsonSchemaHelpers.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +51 -9
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js +3 -3
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types/schema.js +12 -2
- package/dist/types/schema.js.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
- package/dist/utilities/applyBaseFilterToFields.js +1 -2
- package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts +17 -3
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js +8 -0
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +2 -1
- package/dist/utilities/buildInitialState.d.ts.map +1 -1
- package/dist/utilities/buildInitialState.js.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/index.css +16 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +7 -3
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
- package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
- package/package.json +9 -8
- package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
- package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
- package/dist/exports/client/chunk-6QWQ7JV4.js +0 -2
- package/dist/exports/client/chunk-6QWQ7JV4.js.map +0 -7
- package/dist/exports/client/chunk-INBEEENE.js +0 -2
- package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
- package/dist/exports/client/chunk-UAKNDD6R.js +0 -2
- package/dist/exports/client/chunk-UAKNDD6R.js.map +0 -7
- package/dist/exports/client/componentInline-D3A6OW76.js +0 -2
- /package/dist/exports/client/{component-HKTAZ77E.js.map → component-PHZQBOJE.js.map} +0 -0
- /package/dist/exports/client/{componentInline-D3A6OW76.js.map → componentInline-H24N7GUG.js.map} +0 -0
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { fieldsToJSONSchema, flattenAllFields,
|
|
1
|
+
import { fieldsToJSONSchema, flattenAllFields, registerBlockInterface } from 'payload';
|
|
2
2
|
import { formatSchema } from '../../../types/jsonSchemaHelpers.js';
|
|
3
3
|
/**
|
|
4
4
|
* MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and
|
|
5
5
|
* `SerializedInlineBlockNode` declared above.
|
|
6
6
|
*/
|
|
7
|
-
const BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = {
|
|
7
|
+
const BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {
|
|
8
8
|
type: 'block';
|
|
9
9
|
format: LexicalElementFormat;
|
|
10
10
|
version: number;
|
|
11
11
|
fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;
|
|
12
|
-
};
|
|
13
|
-
export type SerializedInlineBlockNode<TFields extends { blockType: string }> = {
|
|
12
|
+
} : never;
|
|
13
|
+
export type SerializedInlineBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {
|
|
14
14
|
type: 'inlineBlock';
|
|
15
15
|
version: number;
|
|
16
16
|
fields: { id: string } & Omit<TFields, 'id'>;
|
|
17
|
-
};`;
|
|
18
|
-
/** Block `interfaceName` if set, otherwise a PascalCase form of the slug. */
|
|
19
|
-
const blockFieldsInterfaceName = block => block.interfaceName ?? toWords(block.slug, true);
|
|
17
|
+
} : never;`;
|
|
20
18
|
/**
|
|
21
19
|
* JSON Schema for one block's `fields:` payload. Strips Payload's auto-added
|
|
22
20
|
* `id`/`blockName` and re-adds them with strict runtime types: required
|
|
23
21
|
* non-null `id`, optional `blockName?: string | null` (omitted for inline
|
|
24
|
-
* blocks).
|
|
22
|
+
* blocks). Registers the interface through `registerBlockInterface` (shared with
|
|
23
|
+
* payload core) and returns its collision-safe name.
|
|
25
24
|
*/
|
|
26
25
|
const buildBlockFieldsSchema = (block, args, {
|
|
27
26
|
isInlineBlock
|
|
@@ -68,24 +67,24 @@ const buildBlockFieldsSchema = (block, args, {
|
|
|
68
67
|
properties,
|
|
69
68
|
required
|
|
70
69
|
};
|
|
71
|
-
|
|
72
|
-
args.interfaceNameDefinitions.set(definitionName, fieldsSchema);
|
|
73
|
-
return {
|
|
74
|
-
$ref: `#/definitions/${definitionName}`
|
|
75
|
-
};
|
|
70
|
+
return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions);
|
|
76
71
|
};
|
|
77
72
|
export const createBlockNodeJSONSchema = blockConfigs => args => {
|
|
78
73
|
args.typeStringDefinitions.add(BLOCK_NODES_TS);
|
|
79
|
-
const
|
|
74
|
+
const definitionNames = blockConfigs.map(block => buildBlockFieldsSchema(block, args, {
|
|
80
75
|
isInlineBlock: false
|
|
81
76
|
}));
|
|
82
|
-
const fieldsSchema =
|
|
77
|
+
const fieldsSchema = definitionNames.length === 0 ? {
|
|
83
78
|
type: 'object',
|
|
84
79
|
additionalProperties: true
|
|
85
|
-
} :
|
|
86
|
-
|
|
80
|
+
} : definitionNames.length === 1 ? {
|
|
81
|
+
$ref: `#/$defs/${definitionNames[0]}`
|
|
82
|
+
} : {
|
|
83
|
+
oneOf: definitionNames.map(name => ({
|
|
84
|
+
$ref: `#/$defs/${name}`
|
|
85
|
+
}))
|
|
87
86
|
};
|
|
88
|
-
const tsType =
|
|
87
|
+
const tsType = definitionNames.length > 0 ? `SerializedBlockNode<${definitionNames.join(' | ')}>` : `SerializedBlockNode<{ blockType: string }>`;
|
|
89
88
|
return {
|
|
90
89
|
type: 'object',
|
|
91
90
|
additionalProperties: false,
|
|
@@ -106,16 +105,20 @@ export const createBlockNodeJSONSchema = blockConfigs => args => {
|
|
|
106
105
|
};
|
|
107
106
|
export const createInlineBlockNodeJSONSchema = inlineBlockConfigs => args => {
|
|
108
107
|
args.typeStringDefinitions.add(BLOCK_NODES_TS);
|
|
109
|
-
const
|
|
108
|
+
const definitionNames = inlineBlockConfigs.map(block => buildBlockFieldsSchema(block, args, {
|
|
110
109
|
isInlineBlock: true
|
|
111
110
|
}));
|
|
112
|
-
const fieldsSchema =
|
|
111
|
+
const fieldsSchema = definitionNames.length === 0 ? {
|
|
113
112
|
type: 'object',
|
|
114
113
|
additionalProperties: true
|
|
115
|
-
} :
|
|
116
|
-
|
|
114
|
+
} : definitionNames.length === 1 ? {
|
|
115
|
+
$ref: `#/$defs/${definitionNames[0]}`
|
|
116
|
+
} : {
|
|
117
|
+
oneOf: definitionNames.map(name => ({
|
|
118
|
+
$ref: `#/$defs/${name}`
|
|
119
|
+
}))
|
|
117
120
|
};
|
|
118
|
-
const tsType =
|
|
121
|
+
const tsType = definitionNames.length > 0 ? `SerializedInlineBlockNode<${definitionNames.join(' | ')}>` : `SerializedInlineBlockNode<{ blockType: string }>`;
|
|
119
122
|
return {
|
|
120
123
|
type: 'object',
|
|
121
124
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":["fieldsToJSONSchema","flattenAllFields","toWords","formatSchema","BLOCK_NODES_TS","blockFieldsInterfaceName","block","interfaceName","slug","buildBlockFieldsSchema","args","isInlineBlock","flattened","fields","userFieldsSchema","config","collectionIDFieldTypes","i18n","interfaceNameDefinitions","typeStringDefinitions","properties","required","id","_stripId","blockName","_stripBlockName","userOnlyProperties","userOnlyRequired","filter","r","type","blockType","const","fieldsSchema","additionalProperties","definitionName","set","$ref","createBlockNodeJSONSchema","blockConfigs","add","blockFieldsSchemas","map","length","oneOf","tsType","b","join","format","version","createInlineBlockNodeJSONSchema","inlineBlockConfigs"],"sources":["../../../../src/features/blocks/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { Block, JsonObject } from 'payload'\n\nimport { fieldsToJSONSchema, flattenAllFields, toWords } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaArgs, JSONSchemaFn } from '../../typesServer.js'\n\nimport { formatSchema } from '../../../types/jsonSchemaHelpers.js'\n\ntype BaseBlockFields<TFields extends JsonObject = JsonObject> = {\n blockName?: null | string\n blockType: string\n} & TFields\n\nexport type BlockFields<TFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TFields>\n\nexport type BlockFieldsOptionalID<TFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TFields>\n\nexport type InlineBlockFields<TFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TFields\n\nexport type SerializedBlockNode<TFields extends { blockType: string } = { blockType: string }> = {\n fields: { blockName?: string | null; id: string } & Omit<TFields, 'blockName' | 'id'>\n format: LexicalElementFormat\n type: 'block'\n version: number\n}\n\nexport type SerializedInlineBlockNode<\n TFields extends { blockType: string } = { blockType: string },\n> = {\n fields: { id: string } & Omit<TFields, 'id'>\n type: 'inlineBlock'\n version: number\n}\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and\n * `SerializedInlineBlockNode` declared above.\n */\nconst BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = {\n type: 'block';\n format: LexicalElementFormat;\n version: number;\n fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;\n};\nexport type SerializedInlineBlockNode<TFields extends { blockType: string }> = {\n type: 'inlineBlock';\n version: number;\n fields: { id: string } & Omit<TFields, 'id'>;\n};`\n\n/** Block `interfaceName` if set, otherwise a PascalCase form of the slug. */\nconst blockFieldsInterfaceName = (block: Block) => block.interfaceName ?? toWords(block.slug, true)\n\n/**\n * JSON Schema for one block's `fields:` payload. Strips Payload's auto-added\n * `id`/`blockName` and re-adds them with strict runtime types: required\n * non-null `id`, optional `blockName?: string | null` (omitted for inline\n * blocks). Always registers as a top-level `$ref`.\n */\nconst buildBlockFieldsSchema = (\n block: Block,\n args: JSONSchemaArgs,\n { isInlineBlock }: { isInlineBlock: boolean },\n): JSONSchema4 => {\n const flattened = flattenAllFields({ fields: block.fields })\n const userFieldsSchema = args.config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes: args.collectionIDFieldTypes,\n config: args.config,\n fields: flattened,\n i18n: args.i18n,\n interfaceNameDefinitions: args.interfaceNameDefinitions,\n typeStringDefinitions: args.typeStringDefinitions,\n })\n : { properties: {}, required: [] }\n\n const {\n id: _stripId,\n blockName: _stripBlockName,\n ...userOnlyProperties\n } = (userFieldsSchema.properties ?? {}) as { [k: string]: JSONSchema4 }\n const userOnlyRequired = (userFieldsSchema.required ?? []).filter(\n (r) => r !== 'id' && r !== 'blockName',\n )\n\n const properties: { [k: string]: JSONSchema4 } = {\n id: { type: 'string' },\n blockType: { type: 'string', const: block.slug },\n ...userOnlyProperties,\n }\n const required = ['id', 'blockType', ...userOnlyRequired]\n\n if (!isInlineBlock) {\n properties.blockName = { type: ['string', 'null'] }\n }\n\n const fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties,\n required,\n }\n\n const definitionName = blockFieldsInterfaceName(block)\n args.interfaceNameDefinitions.set(definitionName, fieldsSchema)\n return { $ref: `#/definitions/${definitionName}` }\n}\n\nexport const createBlockNodeJSONSchema =\n (blockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const blockFieldsSchemas = blockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: false }),\n )\n\n const fieldsSchema: JSONSchema4 =\n blockFieldsSchemas.length === 0\n ? { type: 'object', additionalProperties: true }\n : blockFieldsSchemas.length === 1\n ? blockFieldsSchemas[0]!\n : { oneOf: blockFieldsSchemas }\n\n const tsType =\n blockConfigs.length > 0\n ? `SerializedBlockNode<${blockConfigs.map((b) => blockFieldsInterfaceName(b)).join(' | ')}>`\n : `SerializedBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'block' },\n fields: fieldsSchema,\n format: formatSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'format', 'type', 'version'],\n tsType,\n }\n }\n\nexport const createInlineBlockNodeJSONSchema =\n (inlineBlockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const blockFieldsSchemas = inlineBlockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: true }),\n )\n\n const fieldsSchema: JSONSchema4 =\n blockFieldsSchemas.length === 0\n ? { type: 'object', additionalProperties: true }\n : blockFieldsSchemas.length === 1\n ? blockFieldsSchemas[0]!\n : { oneOf: blockFieldsSchemas }\n\n const tsType =\n inlineBlockConfigs.length > 0\n ? `SerializedInlineBlockNode<${inlineBlockConfigs.map((b) => blockFieldsInterfaceName(b)).join(' | ')}>`\n : `SerializedInlineBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'inlineBlock' },\n fields: fieldsSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'type', 'version'],\n tsType,\n }\n }\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QoB,YAAA;MACRe,MAAA,EAAQ7C,YAAA;MACR8C,OAAA,EAAS;QAAEnB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,UAAU,QAAQ,UAAU;IACjDwB;EACF;AACF;AAEF,OAAO,MAAMK,+BAAA,GACVC,kBAAA,IACAzC,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACqB,GAAG,CAACpC,cAAA;EAC/B,MAAMqC,kBAAA,GAAqBU,kBAAA,CAAmBT,GAAG,CAAEpC,KAAA,IACjDG,sBAAA,CAAuBH,KAAA,EAAOI,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAK;EAG5D,MAAMsB,YAAA,GACJQ,kBAAA,CAAmBE,MAAM,KAAK,IAC1B;IAAEb,IAAA,EAAM;IAAUI,oBAAA,EAAsB;EAAK,IAC7CO,kBAAA,CAAmBE,MAAM,KAAK,IAC5BF,kBAAkB,CAAC,EAAE,GACrB;IAAEG,KAAA,EAAOH;EAAmB;EAEpC,MAAMI,MAAA,GACJM,kBAAA,CAAmBR,MAAM,GAAG,IACxB,6BAA6BQ,kBAAA,CAAmBT,GAAG,CAAEI,CAAA,IAAMzC,wBAAA,CAAyByC,CAAA,GAAIC,IAAI,CAAC,SAAS,GACtG,kDAAkD;EAExD,OAAO;IACLjB,IAAA,EAAM;IACNI,oBAAA,EAAsB;IACtBd,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAc;MAC7CnB,MAAA,EAAQoB,YAAA;MACRgB,OAAA,EAAS;QAAEnB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,QAAQ,UAAU;IACvCwB;EACF;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"schema.js","names":["fieldsToJSONSchema","flattenAllFields","registerBlockInterface","formatSchema","BLOCK_NODES_TS","buildBlockFieldsSchema","block","args","isInlineBlock","flattened","fields","userFieldsSchema","config","collectionIDFieldTypes","i18n","interfaceNameDefinitions","typeStringDefinitions","properties","required","id","_stripId","blockName","_stripBlockName","userOnlyProperties","userOnlyRequired","filter","r","type","blockType","const","slug","fieldsSchema","additionalProperties","createBlockNodeJSONSchema","blockConfigs","add","definitionNames","map","length","$ref","oneOf","name","tsType","join","format","version","createInlineBlockNodeJSONSchema","inlineBlockConfigs"],"sources":["../../../../src/features/blocks/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { Block, JsonObject } from 'payload'\n\nimport { fieldsToJSONSchema, flattenAllFields, registerBlockInterface } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaArgs, JSONSchemaFn } from '../../typesServer.js'\n\nimport { formatSchema } from '../../../types/jsonSchemaHelpers.js'\n\ntype BaseBlockFields<TFields extends JsonObject = JsonObject> = {\n blockName?: null | string\n blockType: string\n} & TFields\n\nexport type BlockFields<TFields extends JsonObject = JsonObject> = {\n id: string\n} & BaseBlockFields<TFields>\n\nexport type BlockFieldsOptionalID<TFields extends JsonObject = JsonObject> = {\n id?: string\n} & BaseBlockFields<TFields>\n\nexport type InlineBlockFields<TFields extends JsonObject = JsonObject> = {\n blockType: string\n id: string\n} & TFields\n\n// Distributive (`TFields extends unknown ?`) so `SerializedBlockNode<A | B>` expands to\n// `SerializedBlockNode<A> | SerializedBlockNode<B>` - i.e. a discriminated union where each block\n// keeps its own fields. Without this, `Omit<A | B, ...>` collapses to the blocks' common keys and\n// every block-specific field is lost. Lets users write either form interchangeably.\nexport type SerializedBlockNode<TFields extends { blockType: string } = { blockType: string }> =\n TFields extends unknown\n ? {\n fields: { blockName?: null | string; id: string } & Omit<TFields, 'blockName' | 'id'>\n format: LexicalElementFormat\n type: 'block'\n version: number\n }\n : never\n\nexport type SerializedInlineBlockNode<\n TFields extends { blockType: string } = { blockType: string },\n> = TFields extends unknown\n ? {\n fields: { id: string } & Omit<TFields, 'id'>\n type: 'inlineBlock'\n version: number\n }\n : never\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedBlockNode` and\n * `SerializedInlineBlockNode` declared above.\n */\nconst BLOCK_NODES_TS = `export type SerializedBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'block';\n format: LexicalElementFormat;\n version: number;\n fields: { id: string; blockName?: string | null } & Omit<TFields, 'id' | 'blockName'>;\n} : never;\nexport type SerializedInlineBlockNode<TFields extends { blockType: string }> = TFields extends unknown ? {\n type: 'inlineBlock';\n version: number;\n fields: { id: string } & Omit<TFields, 'id'>;\n} : never;`\n\n/**\n * JSON Schema for one block's `fields:` payload. Strips Payload's auto-added\n * `id`/`blockName` and re-adds them with strict runtime types: required\n * non-null `id`, optional `blockName?: string | null` (omitted for inline\n * blocks). Registers the interface through `registerBlockInterface` (shared with\n * payload core) and returns its collision-safe name.\n */\nconst buildBlockFieldsSchema = (\n block: Block,\n args: JSONSchemaArgs,\n { isInlineBlock }: { isInlineBlock: boolean },\n): string => {\n const flattened = flattenAllFields({ fields: block.fields })\n const userFieldsSchema = args.config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes: args.collectionIDFieldTypes,\n config: args.config,\n fields: flattened,\n i18n: args.i18n,\n interfaceNameDefinitions: args.interfaceNameDefinitions,\n typeStringDefinitions: args.typeStringDefinitions,\n })\n : { properties: {}, required: [] }\n\n const {\n id: _stripId,\n blockName: _stripBlockName,\n ...userOnlyProperties\n } = (userFieldsSchema.properties ?? {}) as { [k: string]: JSONSchema4 }\n const userOnlyRequired = (userFieldsSchema.required ?? []).filter(\n (r) => r !== 'id' && r !== 'blockName',\n )\n\n const properties: { [k: string]: JSONSchema4 } = {\n id: { type: 'string' },\n blockType: { type: 'string', const: block.slug },\n ...userOnlyProperties,\n }\n const required = ['id', 'blockType', ...userOnlyRequired]\n\n if (!isInlineBlock) {\n properties.blockName = { type: ['string', 'null'] }\n }\n\n const fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties,\n required,\n }\n\n return registerBlockInterface(block, fieldsSchema, args.interfaceNameDefinitions)\n}\n\nexport const createBlockNodeJSONSchema =\n (blockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = blockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: false }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'block' },\n fields: fieldsSchema,\n format: formatSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'format', 'type', 'version'],\n tsType,\n }\n }\n\nexport const createInlineBlockNodeJSONSchema =\n (inlineBlockConfigs: Block[]): JSONSchemaFn =>\n (args) => {\n args.typeStringDefinitions.add(BLOCK_NODES_TS)\n const definitionNames = inlineBlockConfigs.map((block) =>\n buildBlockFieldsSchema(block, args, { isInlineBlock: true }),\n )\n\n const fieldsSchema: JSONSchema4 =\n definitionNames.length === 0\n ? { type: 'object', additionalProperties: true }\n : definitionNames.length === 1\n ? { $ref: `#/$defs/${definitionNames[0]!}` }\n : { oneOf: definitionNames.map((name) => ({ $ref: `#/$defs/${name}` })) }\n\n const tsType =\n definitionNames.length > 0\n ? `SerializedInlineBlockNode<${definitionNames.join(' | ')}>`\n : `SerializedInlineBlockNode<{ blockType: string }>`\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { type: 'string', const: 'inlineBlock' },\n fields: fieldsSchema,\n version: { type: 'integer' },\n },\n required: ['fields', 'type', 'version'],\n tsType,\n }\n }\n"],"mappings":"AAGA,SAASA,kBAAkB,EAAE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AAA,IACAxC,IAAA;EACCA,IAAA,CAAKS,qBAAqB,CAACmB,GAAG,CAAC/B,cAAA;EAC/B,MAAMgC,eAAA,GAAkBW,kBAAA,CAAmBV,GAAG,CAAE/B,KAAA,IAC9CD,sBAAA,CAAuBC,KAAA,EAAOC,IAAA,EAAM;IAAEC,aAAA,EAAe;EAAK;EAG5D,MAAMuB,YAAA,GACJK,eAAA,CAAgBE,MAAM,KAAK,IACvB;IAAEX,IAAA,EAAM;IAAUK,oBAAA,EAAsB;EAAK,IAC7CI,eAAA,CAAgBE,MAAM,KAAK,IACzB;IAAEC,IAAA,EAAM,WAAWH,eAAe,CAAC,EAAE;EAAI,IACzC;IAAEI,KAAA,EAAOJ,eAAA,CAAgBC,GAAG,CAAEI,IAAA,KAAU;MAAEF,IAAA,EAAM,WAAWE,IAAA;IAAO;EAAI;EAE9E,MAAMC,MAAA,GACJN,eAAA,CAAgBE,MAAM,GAAG,IACrB,6BAA6BF,eAAA,CAAgBO,IAAI,CAAC,SAAS,GAC3D,kDAAkD;EAExD,OAAO;IACLhB,IAAA,EAAM;IACNK,oBAAA,EAAsB;IACtBf,UAAA,EAAY;MACVU,IAAA,EAAM;QAAEA,IAAA,EAAM;QAAUE,KAAA,EAAO;MAAc;MAC7CnB,MAAA,EAAQqB,YAAA;MACRc,OAAA,EAAS;QAAElB,IAAA,EAAM;MAAU;IAC7B;IACAT,QAAA,EAAU,CAAC,UAAU,QAAQ,UAAU;IACvCwB;EACF;AACF","ignoreList":[]}
|
|
@@ -46,26 +46,24 @@ export type HTMLConvertersAsync<T extends {
|
|
|
46
46
|
}>>;
|
|
47
47
|
} & {
|
|
48
48
|
blocks?: {
|
|
49
|
-
[K in Extract<
|
|
49
|
+
[K in Extract<T, {
|
|
50
50
|
type: 'block';
|
|
51
|
-
}>
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
}>['fields']['blockType']]?: HTMLConverterAsync<Extract<T, {
|
|
52
|
+
fields: {
|
|
53
|
+
blockType: K;
|
|
54
|
+
};
|
|
54
55
|
type: 'block';
|
|
55
|
-
}
|
|
56
|
-
blockType: K;
|
|
57
|
-
}>> : SerializedBlockNode>;
|
|
56
|
+
}>>;
|
|
58
57
|
};
|
|
59
58
|
inlineBlocks?: {
|
|
60
|
-
[K in Extract<
|
|
59
|
+
[K in Extract<T, {
|
|
61
60
|
type: 'inlineBlock';
|
|
62
|
-
}>
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
}>['fields']['blockType']]?: HTMLConverterAsync<Extract<T, {
|
|
62
|
+
fields: {
|
|
63
|
+
blockType: K;
|
|
64
|
+
};
|
|
65
65
|
type: 'inlineBlock';
|
|
66
|
-
}
|
|
67
|
-
blockType: K;
|
|
68
|
-
}>> : SerializedInlineBlockNode>;
|
|
66
|
+
}>>;
|
|
69
67
|
};
|
|
70
68
|
unknown?: HTMLConverterAsync<SerializedLexicalNode>;
|
|
71
69
|
};
|
|
@@ -79,6 +77,6 @@ export type HTMLConvertersFunctionAsync<T extends {
|
|
|
79
77
|
blockName?: null | string;
|
|
80
78
|
blockType: string;
|
|
81
79
|
}>> = (args: {
|
|
82
|
-
defaultConverters: HTMLConvertersAsync<
|
|
80
|
+
defaultConverters: HTMLConvertersAsync<T>;
|
|
83
81
|
}) => HTMLConvertersAsync<T>;
|
|
84
82
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/async/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AACzE,MAAM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,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,IAC7E;IACF,CAAC,GAAG,EAAE,MAAM,GACR;QACE,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;KAC7C,GACD,kBAAkB,CAAC,GAAG,CAAC,GACvB,SAAS,CAAA;CACd,GAAG;KACD,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,kBAAkB,CACzF,OAAO,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CAC/B;CACF,GAAG;IACF,MAAM,CAAC,EAAE;SACN,CAAC,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/async/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AACzE,MAAM,MAAM,qBAAqB,GAAG;IAClC,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,SAAS,MAAM,G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,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,IAC7E,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CAAE,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToHtml/async/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type { SelectType, TypeWithID } from 'payload'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\nexport type HTMLPopulateArguments = {\n collectionSlug: string\n id: number | string\n select?: SelectType\n}\n\nexport type HTMLPopulateFn = <TData extends object = TypeWithID>(\n args: HTMLPopulateArguments,\n) => Promise<TData | undefined>\n\nexport type HTMLConverterAsync<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: HTMLConvertersAsync\n node: T\n nodesToHTML: (args: {\n converters?: HTMLConvertersAsync\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => Promise<string[]>\n parent: SerializedLexicalNodeWithParent\n populate?: HTMLPopulateFn\n providedCSSString: string\n providedStyleTag: string\n }) => Promise<string> | string)\n | string\n\nexport type HTMLConvertersAsync<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: HTMLConverterAsync<any>\n }\n | HTMLConverterAsync<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: HTMLConverterAsync<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToHtml/async/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type { SelectType, TypeWithID } from 'payload'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\nexport type HTMLPopulateArguments = {\n collectionSlug: string\n id: number | string\n select?: SelectType\n}\n\nexport type HTMLPopulateFn = <TData extends object = TypeWithID>(\n args: HTMLPopulateArguments,\n) => Promise<TData | undefined>\n\nexport type HTMLConverterAsync<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: HTMLConvertersAsync\n node: T\n nodesToHTML: (args: {\n converters?: HTMLConvertersAsync\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => Promise<string[]>\n parent: SerializedLexicalNodeWithParent\n populate?: HTMLPopulateFn\n providedCSSString: string\n providedStyleTag: string\n }) => Promise<string> | string)\n | string\n\nexport type HTMLConvertersAsync<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: HTMLConverterAsync<any>\n }\n | HTMLConverterAsync<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: HTMLConverterAsync<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<T, { type: 'block' }>['fields']['blockType']]?: HTMLConverterAsync<\n Extract<T, { fields: { blockType: K }; type: 'block' }>\n >\n }\n inlineBlocks?: {\n [K in Extract<T, { type: 'inlineBlock' }>['fields']['blockType']]?: HTMLConverterAsync<\n Extract<T, { fields: { blockType: K }; type: 'inlineBlock' }>\n >\n }\n unknown?: HTMLConverterAsync<SerializedLexicalNode>\n}\n\nexport type HTMLConvertersFunctionAsync<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: HTMLConvertersAsync<T> }) => HTMLConvertersAsync<T>\n"],"mappings":"AAsEA","ignoreList":[]}
|
|
@@ -38,26 +38,24 @@ export type HTMLConverters<T extends {
|
|
|
38
38
|
}>>;
|
|
39
39
|
} & {
|
|
40
40
|
blocks?: {
|
|
41
|
-
[K in Extract<
|
|
41
|
+
[K in Extract<T, {
|
|
42
42
|
type: 'block';
|
|
43
|
-
}>
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}>['fields']['blockType']]?: HTMLConverter<Extract<T, {
|
|
44
|
+
fields: {
|
|
45
|
+
blockType: K;
|
|
46
|
+
};
|
|
46
47
|
type: 'block';
|
|
47
|
-
}
|
|
48
|
-
blockType: K;
|
|
49
|
-
}>> : SerializedBlockNode>;
|
|
48
|
+
}>>;
|
|
50
49
|
};
|
|
51
50
|
inlineBlocks?: {
|
|
52
|
-
[K in Extract<
|
|
51
|
+
[K in Extract<T, {
|
|
53
52
|
type: 'inlineBlock';
|
|
54
|
-
}>
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
}>['fields']['blockType']]?: HTMLConverter<Extract<T, {
|
|
54
|
+
fields: {
|
|
55
|
+
blockType: K;
|
|
56
|
+
};
|
|
57
57
|
type: 'inlineBlock';
|
|
58
|
-
}
|
|
59
|
-
blockType: K;
|
|
60
|
-
}>> : SerializedInlineBlockNode>;
|
|
58
|
+
}>>;
|
|
61
59
|
};
|
|
62
60
|
unknown?: HTMLConverter<SerializedLexicalNode>;
|
|
63
61
|
};
|
|
@@ -71,6 +69,6 @@ export type HTMLConvertersFunction<T extends {
|
|
|
71
69
|
blockName?: null | string;
|
|
72
70
|
blockType: string;
|
|
73
71
|
}>> = (args: {
|
|
74
|
-
defaultConverters: HTMLConverters<
|
|
72
|
+
defaultConverters: HTMLConverters<T>;
|
|
75
73
|
}) => HTMLConverters<T>;
|
|
76
74
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToHtml/sync/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AAEzE,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IAE3F,CAAC,CAAC,IAAI,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,cAAc,CAAA;IAC1B,IAAI,EAAE,CAAC,CAAA;IACP,WAAW,EAAE,CAAC,IAAI,EAAE;QAClB,UAAU,CAAC,EAA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,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,IAC7E,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC,CAAA;CAAE,KAAK,cAAc,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToHtml/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type HTMLConverter<T extends { [key: string]: any; type?: string } = SerializedLexicalNode> =\n\n | ((args: {\n childIndex: number\n converters: HTMLConverters\n node: T\n nodesToHTML: (args: {\n converters?: HTMLConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n providedCSSString: string\n providedStyleTag: string\n }) => string)\n | string\n\nexport type HTMLConverters<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: HTMLConverter<any>\n }\n | HTMLConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: HTMLConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToHtml/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type HTMLConverter<T extends { [key: string]: any; type?: string } = SerializedLexicalNode> =\n\n | ((args: {\n childIndex: number\n converters: HTMLConverters\n node: T\n nodesToHTML: (args: {\n converters?: HTMLConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n providedCSSString: string\n providedStyleTag: string\n }) => string)\n | string\n\nexport type HTMLConverters<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: HTMLConverter<any>\n }\n | HTMLConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: HTMLConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<T, { type: 'block' }>['fields']['blockType']]?: HTMLConverter<\n Extract<T, { fields: { blockType: K }; type: 'block' }>\n >\n }\n inlineBlocks?: {\n [K in Extract<T, { type: 'inlineBlock' }>['fields']['blockType']]?: HTMLConverter<\n Extract<T, { fields: { blockType: K }; type: 'inlineBlock' }>\n >\n }\n unknown?: HTMLConverter<SerializedLexicalNode>\n}\n\nexport type HTMLConvertersFunction<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: HTMLConverters<T> }) => HTMLConverters<T>\n"],"mappings":"AA0DA","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ export type JSXConvertersFunction<T extends SerializedNodeBase = DefaultNodeType
|
|
|
10
10
|
blockName?: null | string;
|
|
11
11
|
blockType: string;
|
|
12
12
|
}>> = (args: {
|
|
13
|
-
defaultConverters: JSXConverters<
|
|
13
|
+
defaultConverters: JSXConverters<T>;
|
|
14
14
|
}) => JSXConverters<T>;
|
|
15
15
|
type RichTextProps<TNodes extends SerializedNodeBase = SerializedNodeBase> = {
|
|
16
16
|
/**
|
|
@@ -20,7 +20,7 @@ type RichTextProps<TNodes extends SerializedNodeBase = SerializedNodeBase> = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Custom converters to transform your nodes to JSX. Can be an object or a function that receives the default converters.
|
|
22
22
|
*/
|
|
23
|
-
converters?: JSXConverters | JSXConvertersFunction
|
|
23
|
+
converters?: JSXConverters<TNodes> | JSXConvertersFunction<TNodes>;
|
|
24
24
|
/**
|
|
25
25
|
* If true, removes the container div wrapper.
|
|
26
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM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AAA;AAEvE,KAAK,aAAa,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC3E;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAElE;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAC,CAAA;AAEpG,wBAAgB,QAAQ,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,EAC/E,SAAS,EACT,UAAU,EACV,IAAI,EAAE,WAAW,EACjB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,OAAO,GACR,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAoCzC"}
|
|
@@ -14,14 +14,15 @@ export function RichText({
|
|
|
14
14
|
if (!editorState) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
|
+
const baseConverters = converters;
|
|
17
18
|
let finalConverters = {};
|
|
18
|
-
if (
|
|
19
|
-
if (typeof
|
|
20
|
-
finalConverters =
|
|
19
|
+
if (baseConverters) {
|
|
20
|
+
if (typeof baseConverters === 'function') {
|
|
21
|
+
finalConverters = baseConverters({
|
|
21
22
|
defaultConverters: defaultJSXConverters
|
|
22
23
|
});
|
|
23
24
|
} else {
|
|
24
|
-
finalConverters =
|
|
25
|
+
finalConverters = baseConverters;
|
|
25
26
|
}
|
|
26
27
|
} else {
|
|
27
28
|
finalConverters = defaultJSXConverters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","nodeMap","finalConverters","defaultConverters","content","Array","isArray","_jsx","_Fragment"],"sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SerializedNodeBase } from '../../../../types/index.js'\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../converter/types.js'\n\nimport { defaultJSXConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToJSX, type ConvertLexicalToJSXArgs } from '../converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends SerializedNodeBase =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: JSXConverters<
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","nodeMap","baseConverters","finalConverters","defaultConverters","content","Array","isArray","_jsx","_Fragment"],"sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SerializedNodeBase } from '../../../../types/index.js'\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../converter/types.js'\n\nimport { defaultJSXConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToJSX, type ConvertLexicalToJSXArgs } from '../converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends SerializedNodeBase =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }>\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,\n> = (args: { defaultConverters: JSXConverters<T> }) => JSXConverters<T>\n\ntype RichTextProps<TNodes extends SerializedNodeBase = SerializedNodeBase> = {\n /**\n * Override class names for the container.\n */\n className?: string\n /**\n * Custom converters to transform your nodes to JSX. Can be an object or a function that receives the default converters.\n */\n converters?: JSXConverters<TNodes> | JSXConvertersFunction<TNodes>\n\n /**\n * If true, removes the container div wrapper.\n */\n disableContainer?: boolean\n} & Pick<ConvertLexicalToJSXArgs<TNodes>, 'data' | 'disableIndent' | 'disableTextAlign' | 'nodeMap'>\n\nexport function RichText<TNodes extends SerializedNodeBase = SerializedNodeBase>({\n className,\n converters,\n data: editorState,\n disableContainer,\n disableIndent,\n disableTextAlign,\n nodeMap,\n}: RichTextProps<TNodes>): React.ReactNode {\n if (!editorState) {\n return null\n }\n\n const baseConverters = converters as JSXConverters | JSXConvertersFunction | undefined\n\n let finalConverters: JSXConverters = {}\n if (baseConverters) {\n if (typeof baseConverters === 'function') {\n finalConverters = baseConverters({ defaultConverters: defaultJSXConverters })\n } else {\n finalConverters = baseConverters\n }\n } else {\n finalConverters = defaultJSXConverters\n }\n\n const content =\n editorState &&\n !Array.isArray(editorState) &&\n typeof editorState === 'object' &&\n 'root' in editorState &&\n convertLexicalToJSX({\n converters: finalConverters,\n data: editorState,\n disableIndent,\n disableTextAlign,\n nodeMap,\n })\n\n if (disableContainer) {\n return <>{content}</>\n }\n\n return <div className={className ?? 'payload-richtext'}>{content}</div>\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAUlB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAsC;AAyBlE,OAAO,SAASC,SAAiE;EAC/EC,SAAS;EACTC,UAAU;EACVC,IAAA,EAAMC,WAAW;EACjBC,gBAAgB;EAChBC,aAAa;EACbC,gBAAgB;EAChBC;AAAO,CACe;EACtB,IAAI,CAACJ,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,MAAMK,cAAA,GAAiBP,UAAA;EAEvB,IAAIQ,eAAA,GAAiC,CAAC;EACtC,IAAID,cAAA,EAAgB;IAClB,IAAI,OAAOA,cAAA,KAAmB,YAAY;MACxCC,eAAA,GAAkBD,cAAA,CAAe;QAAEE,iBAAA,EAAmBb;MAAqB;IAC7E,OAAO;MACLY,eAAA,GAAkBD,cAAA;IACpB;EACF,OAAO;IACLC,eAAA,GAAkBZ,oBAAA;EACpB;EAEA,MAAMc,OAAA,GACJR,WAAA,IACA,CAACS,KAAA,CAAMC,OAAO,CAACV,WAAA,KACf,OAAOA,WAAA,KAAgB,YACvB,UAAUA,WAAA,IACVL,mBAAA,CAAoB;IAClBG,UAAA,EAAYQ,eAAA;IACZP,IAAA,EAAMC,WAAA;IACNE,aAAA;IACAC,gBAAA;IACAC;EACF;EAEF,IAAIH,gBAAA,EAAkB;IACpB,oBAAOU,IAAA,CAAAC,SAAA;gBAAGJ;;EACZ;EAEA,oBAAOG,IAAA,CAAC;IAAId,SAAA,EAAWA,SAAA,IAAa;cAAqBW;;AAC3D","ignoreList":[]}
|
|
@@ -39,26 +39,24 @@ export type JSXConverters<TNodes extends {
|
|
|
39
39
|
}>>;
|
|
40
40
|
} & {
|
|
41
41
|
blocks?: {
|
|
42
|
-
[K in Extract<
|
|
42
|
+
[K in Extract<TNodes, {
|
|
43
43
|
type: 'block';
|
|
44
|
-
}>
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
}>['fields']['blockType']]?: JSXConverter<Extract<TNodes, {
|
|
45
|
+
fields: {
|
|
46
|
+
blockType: K;
|
|
47
|
+
};
|
|
47
48
|
type: 'block';
|
|
48
|
-
}
|
|
49
|
-
blockType: K;
|
|
50
|
-
}>> : SerializedBlockNode>;
|
|
49
|
+
}>>;
|
|
51
50
|
};
|
|
52
51
|
inlineBlocks?: {
|
|
53
|
-
[K in Extract<
|
|
52
|
+
[K in Extract<TNodes, {
|
|
54
53
|
type: 'inlineBlock';
|
|
55
|
-
}>
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
}>['fields']['blockType']]?: JSXConverter<Extract<TNodes, {
|
|
55
|
+
fields: {
|
|
56
|
+
blockType: K;
|
|
57
|
+
};
|
|
58
58
|
type: 'inlineBlock';
|
|
59
|
-
}
|
|
60
|
-
blockType: K;
|
|
61
|
-
}>> : SerializedInlineBlockNode>;
|
|
59
|
+
}>>;
|
|
62
60
|
};
|
|
63
61
|
unknown?: JSXConverter<SerializedLexicalNode>;
|
|
64
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AAEvC,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IACzE;IACF,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,aAAa,CAAA;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,UAAU,EAAE,CAAC,IAAI,EAAE;QACjB,UAAU,CAAC,EAAE,aAAa,CAAA;QAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;QAC9B,MAAM,CAAC,EAAE,+BAA+B,CAAA;KACzC,KAAK,KAAK,CAAC,SAAS,EAAE,CAAA;IACvB,MAAM,EAAE,+BAA+B,CAAA;CACxC,CAAA;AACD,MAAM,MAAM,YAAY,CACtB,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IACzE,CAAC,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAA;AAE1E,MAAM,MAAM,aAAa,CACvB,MAAM,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,IAC7E;IACF,CAAC,GAAG,EAAE,MAAM,GACR;QACE,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;KACvC,GACD,YAAY,CAAC,GAAG,CAAC,GACjB,SAAS,CAAA;CACd,GAAG;KACD,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,CACxF,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CACpC;CACF,GAAG;IACF,MAAM,CAAC,EAAE;SACN,CAAC,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AAEvC,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IACzE;IACF,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,E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CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,YAAY,CACxF,OAAO,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CACpC;CACF,GAAG;IACF,MAAM,CAAC,EAAE;SACN,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,CAC7E,OAAO,CAAC,MAAM,EAAE;YAAE,MAAM,EAAE;gBAAE,SAAS,EAAE,CAAC,CAAA;aAAE,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC,CAC7D;KACF,CAAA;IACD,YAAY,CAAC,EAAE;SACZ,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,YAAY,CACnF,OAAO,CAAC,MAAM,EAAE;YAAE,MAAM,EAAE;gBAAE,SAAS,EAAE,CAAC,CAAA;aAAE,CAAC;YAAC,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,CACnE;KACF,CAAA;IACD,OAAO,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAA;CAC9C,CAAA;AACD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,CAAC,EAAE,qBAAqB,CAAA;CAC/B,GAAG,qBAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\n\nexport type JSXConverterArgs<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = {\n childIndex: number\n converters: JSXConverters\n node: TNode\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n}\nexport type JSXConverter<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = ((args: JSXConverterArgs<TNode>) => React.ReactNode) | React.ReactNode\n\nexport type JSXConverters<\n TNodes extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: JSXConverter<any>\n }\n | JSXConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<TNodes['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<\n Extract<TNodes, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\n\nexport type JSXConverterArgs<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = {\n childIndex: number\n converters: JSXConverters\n node: TNode\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n}\nexport type JSXConverter<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = ((args: JSXConverterArgs<TNode>) => React.ReactNode) | React.ReactNode\n\nexport type JSXConverters<\n TNodes extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: JSXConverter<any>\n }\n | JSXConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<TNodes['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<\n Extract<TNodes, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<TNodes, { type: 'block' }>['fields']['blockType']]?: JSXConverter<\n Extract<TNodes, { fields: { blockType: K }; type: 'block' }>\n >\n }\n inlineBlocks?: {\n [K in Extract<TNodes, { type: 'inlineBlock' }>['fields']['blockType']]?: JSXConverter<\n Extract<TNodes, { fields: { blockType: K }; type: 'inlineBlock' }>\n >\n }\n unknown?: JSXConverter<SerializedLexicalNode>\n}\nexport type SerializedLexicalNodeWithParent = {\n parent?: SerializedLexicalNode\n} & SerializedLexicalNode\n"],"mappings":"AAwDA","ignoreList":[]}
|
|
@@ -35,26 +35,24 @@ export type PlaintextConverters<T extends {
|
|
|
35
35
|
}>>;
|
|
36
36
|
} & {
|
|
37
37
|
blocks?: {
|
|
38
|
-
[K in Extract<
|
|
38
|
+
[K in Extract<T, {
|
|
39
39
|
type: 'block';
|
|
40
|
-
}>
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
}>['fields']['blockType']]?: PlaintextConverter<Extract<T, {
|
|
41
|
+
fields: {
|
|
42
|
+
blockType: K;
|
|
43
|
+
};
|
|
43
44
|
type: 'block';
|
|
44
|
-
}
|
|
45
|
-
blockType: K;
|
|
46
|
-
}>> : SerializedBlockNode>;
|
|
45
|
+
}>>;
|
|
47
46
|
};
|
|
48
47
|
inlineBlocks?: {
|
|
49
|
-
[K in Extract<
|
|
48
|
+
[K in Extract<T, {
|
|
50
49
|
type: 'inlineBlock';
|
|
51
|
-
}>
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
}>['fields']['blockType']]?: PlaintextConverter<Extract<T, {
|
|
51
|
+
fields: {
|
|
52
|
+
blockType: K;
|
|
53
|
+
};
|
|
54
54
|
type: 'inlineBlock';
|
|
55
|
-
}
|
|
56
|
-
blockType: K;
|
|
57
|
-
}>> : SerializedInlineBlockNode>;
|
|
55
|
+
}>>;
|
|
58
56
|
};
|
|
59
57
|
};
|
|
60
58
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AAEzE,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IAErE,CAAC,CAAC,IAAI,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,gBAAgB,EAAE,CAAC,IAAI,EAAE;QACvB,UAAU,CAAC,EAAE,mBAAmB,CAAA;QAChC,KAAK,EAAE,qBAAqB,EAAE,CAAA;QAC9B,MAAM,CAAC,EAAE,+BAA+B,CAAA;KACzC,KAAK,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,+BAA+B,CAAA;CACxC,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;AAEV,MAAM,MAAM,yBAAyB,GACjC,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GACrE,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE/E,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,yBAAyB,IACzE;IACF,CAAC,GAAG,EAAE,MAAM,GACR;QACE,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;KAC7C,GACD,kBAAkB,CAAC,GAAG,CAAC,GACvB,SAAS,CAAA;CACd,GAAG;KACD,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,EAAE,kBAAkB,CACzF,OAAO,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CAC/B;CACF,GAAG;IACF,MAAM,CAAC,EAAE;SACN,CAAC,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AAEzE,MAAM,MAAM,kBAAkB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,OAAO,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC,CAC/B;CACF,GAAG;IACF,MAAM,CAAC,EAAE;SACN,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAC9E,OAAO,CAAC,CAAC,EAAE;YAAE,MAAM,EAAE;gBAAE,SAAS,EAAE,CAAC,CAAA;aAAE,CAAC;YAAC,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC,CACxD;KACF,CAAA;IACD,YAAY,CAAC,EAAE;SACZ,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,kBAAkB,CACpF,OAAO,CAAC,CAAC,EAAE;YAAE,MAAM,EAAE;gBAAE,SAAS,EAAE,CAAC,CAAA;aAAE,CAAC;YAAC,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,CAC9D;KACF,CAAA;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type PlaintextConverter<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: PlaintextConverters\n node: T\n nodesToPlaintext: (args: {\n converters?: PlaintextConverters\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n }) => string)\n | string\n\nexport type DefaultPlaintextNodeTypes =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>\n\nexport type PlaintextConverters<\n T extends { [key: string]: any; type?: string } = DefaultPlaintextNodeTypes,\n> = {\n [key: string]:\n | {\n [blockSlug: string]: PlaintextConverter<any>\n }\n | PlaintextConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: PlaintextConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type PlaintextConverter<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: PlaintextConverters\n node: T\n nodesToPlaintext: (args: {\n converters?: PlaintextConverters\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n }) => string)\n | string\n\nexport type DefaultPlaintextNodeTypes =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>\n\nexport type PlaintextConverters<\n T extends { [key: string]: any; type?: string } = DefaultPlaintextNodeTypes,\n> = {\n [key: string]:\n | {\n [blockSlug: string]: PlaintextConverter<any>\n }\n | PlaintextConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: PlaintextConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<T, { type: 'block' }>['fields']['blockType']]?: PlaintextConverter<\n Extract<T, { fields: { blockType: K }; type: 'block' }>\n >\n }\n inlineBlocks?: {\n [K in Extract<T, { type: 'inlineBlock' }>['fields']['blockType']]?: PlaintextConverter<\n Extract<T, { fields: { blockType: K }; type: 'inlineBlock' }>\n >\n }\n}\n"],"mappings":"AA8BA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/experimental_table/server/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,uBAAuB,CACtC,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB,CAClC,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,OAAO,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SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,UAAU,CAAA;CACjB;AA2BD,eAAO,MAAM,mBAAmB,EAAE,YAgBjC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,YAuBrC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,YAWpC,CAAA"}
|
|
@@ -66,13 +66,16 @@ export const tableCellNodeJSONSchema = ({
|
|
|
66
66
|
}]
|
|
67
67
|
},
|
|
68
68
|
colSpan: {
|
|
69
|
-
type: 'integer'
|
|
69
|
+
type: 'integer',
|
|
70
|
+
description: 'How many columns this cell spans (default 1).'
|
|
70
71
|
},
|
|
71
72
|
headerState: {
|
|
72
|
-
type: 'integer'
|
|
73
|
+
type: 'integer',
|
|
74
|
+
description: 'Header bitmask: 0 = normal cell, 1 = row header, 2 = column header, 3 = both.'
|
|
73
75
|
},
|
|
74
76
|
rowSpan: {
|
|
75
|
-
type: 'integer'
|
|
77
|
+
type: 'integer',
|
|
78
|
+
description: 'How many rows this cell spans (default 1).'
|
|
76
79
|
},
|
|
77
80
|
verticalAlign: {
|
|
78
81
|
type: 'string'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","names":["TABLE_NODES_TS","tableNodeJSONSchema","elementNodeSchema","nodeUnionName","typeStringDefinitions","add","nodeType","properties","colWidths","type","items","frozenColumnCount","frozenRowCount","rowStriping","tsType","tableCellNodeJSONSchema","backgroundColor","oneOf","colSpan","headerState","rowSpan","verticalAlign","width","required","tableRowNodeJSONSchema","height"],"sources":["../../../../src/features/experimental_table/server/schema.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedLexicalElementBase } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\n\nexport interface SerializedTableCellNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n backgroundColor?: null | string\n colSpan?: number\n headerState: number\n rowSpan?: number\n type: 'tablecell'\n verticalAlign?: string\n width?: number\n}\n\nexport interface SerializedTableNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n colWidths?: number[]\n frozenColumnCount?: number\n frozenRowCount?: number\n rowStriping?: boolean\n type: 'table'\n}\n\nexport interface SerializedTableRowNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n height?: number\n type: 'tablerow'\n}\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedTableNode`,\n * `SerializedTableRowNode`, and `SerializedTableCellNode` declared above.\n */\nconst TABLE_NODES_TS = `export interface SerializedTableNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'table';\n colWidths?: number[];\n frozenColumnCount?: number;\n frozenRowCount?: number;\n rowStriping?: boolean;\n}\nexport interface SerializedTableRowNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablerow';\n height?: number;\n}\nexport interface SerializedTableCellNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablecell';\n backgroundColor?: string | null;\n colSpan?: number;\n headerState: number;\n rowSpan?: number;\n verticalAlign?: string;\n width?: number;\n}`\n\nexport const tableNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'table',\n properties: {\n colWidths: { type: 'array', items: { type: 'number' } },\n frozenColumnCount: { type: 'integer' },\n frozenRowCount: { type: 'integer' },\n rowStriping: { type: 'boolean' },\n },\n tsType: `SerializedTableNode<${nodeUnionName}>`,\n })\n}\n\nexport const tableCellNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'tablecell',\n properties: {\n backgroundColor: { oneOf: [{ type: 'string' }, { type: 'null' }] },\n colSpan: { type: 'integer' },\n headerState: {
|
|
1
|
+
{"version":3,"file":"schema.js","names":["TABLE_NODES_TS","tableNodeJSONSchema","elementNodeSchema","nodeUnionName","typeStringDefinitions","add","nodeType","properties","colWidths","type","items","frozenColumnCount","frozenRowCount","rowStriping","tsType","tableCellNodeJSONSchema","backgroundColor","oneOf","colSpan","description","headerState","rowSpan","verticalAlign","width","required","tableRowNodeJSONSchema","height"],"sources":["../../../../src/features/experimental_table/server/schema.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedLexicalElementBase } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\n\nexport interface SerializedTableCellNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n backgroundColor?: null | string\n colSpan?: number\n headerState: number\n rowSpan?: number\n type: 'tablecell'\n verticalAlign?: string\n width?: number\n}\n\nexport interface SerializedTableNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n colWidths?: number[]\n frozenColumnCount?: number\n frozenRowCount?: number\n rowStriping?: boolean\n type: 'table'\n}\n\nexport interface SerializedTableRowNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n height?: number\n type: 'tablerow'\n}\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedTableNode`,\n * `SerializedTableRowNode`, and `SerializedTableCellNode` declared above.\n */\nconst TABLE_NODES_TS = `export interface SerializedTableNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'table';\n colWidths?: number[];\n frozenColumnCount?: number;\n frozenRowCount?: number;\n rowStriping?: boolean;\n}\nexport interface SerializedTableRowNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablerow';\n height?: number;\n}\nexport interface SerializedTableCellNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablecell';\n backgroundColor?: string | null;\n colSpan?: number;\n headerState: number;\n rowSpan?: number;\n verticalAlign?: string;\n width?: number;\n}`\n\nexport const tableNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'table',\n properties: {\n colWidths: { type: 'array', items: { type: 'number' } },\n frozenColumnCount: { type: 'integer' },\n frozenRowCount: { type: 'integer' },\n rowStriping: { type: 'boolean' },\n },\n tsType: `SerializedTableNode<${nodeUnionName}>`,\n })\n}\n\nexport const tableCellNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'tablecell',\n properties: {\n backgroundColor: { oneOf: [{ type: 'string' }, { type: 'null' }] },\n colSpan: { type: 'integer', description: 'How many columns this cell spans (default 1).' },\n headerState: {\n type: 'integer',\n description:\n 'Header bitmask: 0 = normal cell, 1 = row header, 2 = column header, 3 = both.',\n },\n rowSpan: { type: 'integer', description: 'How many rows this cell spans (default 1).' },\n verticalAlign: { type: 'string' },\n width: { type: 'integer' },\n },\n required: ['headerState'],\n tsType: `SerializedTableCellNode<${nodeUnionName}>`,\n })\n}\n\nexport const tableRowNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'tablerow',\n properties: { height: { type: 'integer' } },\n tsType: `SerializedTableRowNode<${nodeUnionName}>`,\n })\n}\n"],"mappings":"AAkCA;;;GAIA,MAAMA,cAAA,GAAiB;;;;;;;;;;;;;;;;;;;EAmBrB;AAEF,OA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