@payloadcms/richtext-lexical 3.73.0 → 3.74.0-internal.097fb57
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/exports/client/Field-OX545XLB.js +2 -0
- package/dist/exports/client/Field-OX545XLB.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-3KBZSLPR.js +12 -0
- package/dist/exports/client/chunk-3KBZSLPR.js.map +7 -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 +20 -20
- package/dist/exports/client/index.js.map +3 -3
- package/dist/exports/client/internal-client.d.ts +3 -0
- package/dist/exports/client/internal-client.d.ts.map +1 -0
- package/dist/exports/react/index.d.ts +1 -1
- package/dist/exports/react/index.d.ts.map +1 -1
- package/dist/exports/react/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts +2 -14
- package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/Component/index.js +4 -2
- package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts +16 -1
- package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/index.js +76 -4
- package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/types.d.ts +14 -10
- 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/debug/jsxConverter/client/plugin/index.js +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +11 -6
- package/dist/field/Field.js.map +1 -1
- package/dist/field/RichTextViewProvider.d.ts +83 -0
- package/dist/field/RichTextViewProvider.d.ts.map +1 -0
- package/dist/field/RichTextViewProvider.js +87 -0
- package/dist/field/RichTextViewProvider.js.map +1 -0
- package/dist/field/ViewSelector.d.ts +4 -0
- package/dist/field/ViewSelector.d.ts.map +1 -0
- package/dist/field/ViewSelector.js +89 -0
- package/dist/field/ViewSelector.js.map +1 -0
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts +1 -0
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +47 -29
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js +12 -0
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +2 -1
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +12 -3
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js +3 -2
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/types.d.ts +4 -0
- package/dist/lexical/config/types.d.ts.map +1 -1
- package/dist/lexical/config/types.js.map +1 -1
- package/dist/lexical/nodes/index.d.ts +12 -2
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js +195 -2
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts +2 -0
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -0
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +48 -0
- package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -0
- package/dist/types.d.ts +152 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.js +1 -0
- package/dist/utilities/generateImportMap.js.map +1 -1
- package/dist/validate/hasText.d.ts +6 -1
- package/dist/validate/hasText.d.ts.map +1 -1
- package/dist/validate/hasText.js +10 -4
- package/dist/validate/hasText.js.map +1 -1
- package/package.json +11 -6
- package/dist/exports/client/Field-HJGV32KA.js +0 -2
- package/dist/exports/client/Field-HJGV32KA.js.map +0 -7
- package/dist/exports/client/chunk-EZX4YW7S.js +0 -12
- package/dist/exports/client/chunk-EZX4YW7S.js.map +0 -7
package/dist/field/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LexicalRichTextFieldProps } from '../types.js';
|
|
3
3
|
export declare const RichTextField: React.FC<LexicalRichTextFieldProps>;
|
|
4
|
+
export declare const RichTextFieldImpl: React.FC<LexicalRichTextFieldProps>;
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAIlE,OAAO,KAAK,EAAgC,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAW1F,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAM7D,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAgFjE,CAAA"}
|
package/dist/field/index.js
CHANGED
|
@@ -2,16 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
import { createElement as _createElement } from "react";
|
|
5
6
|
import { ShimmerEffect, useConfig } from '@payloadcms/ui';
|
|
6
7
|
import React, { lazy, Suspense, useEffect, useState } from 'react';
|
|
7
8
|
import { defaultEditorLexicalConfig } from '../lexical/config/client/default.js';
|
|
8
9
|
import { loadClientFeatures } from '../lexical/config/client/loader.js';
|
|
9
10
|
import { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js';
|
|
11
|
+
import { RichTextViewProvider, useRichTextView } from './RichTextViewProvider.js';
|
|
10
12
|
const RichTextEditor = /*#__PURE__*/lazy(() => import('./Field.js').then(module => ({
|
|
11
13
|
default: module.RichText
|
|
12
14
|
})));
|
|
13
15
|
export const RichTextField = props => {
|
|
14
|
-
|
|
16
|
+
return /*#__PURE__*/_jsx(RichTextViewProvider, {
|
|
17
|
+
views: props.views,
|
|
18
|
+
children: /*#__PURE__*/_jsx(RichTextFieldImpl, {
|
|
19
|
+
...props
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export const RichTextFieldImpl = props => {
|
|
24
|
+
const $ = _c(19);
|
|
15
25
|
const {
|
|
16
26
|
admin: t0,
|
|
17
27
|
clientFeatures,
|
|
@@ -19,7 +29,8 @@ export const RichTextField = props => {
|
|
|
19
29
|
featureClientSchemaMap,
|
|
20
30
|
field,
|
|
21
31
|
lexicalEditorConfig: t2,
|
|
22
|
-
schemaPath
|
|
32
|
+
schemaPath,
|
|
33
|
+
views
|
|
23
34
|
} = props;
|
|
24
35
|
let t3;
|
|
25
36
|
if ($[0] !== t0) {
|
|
@@ -29,7 +40,7 @@ export const RichTextField = props => {
|
|
|
29
40
|
} else {
|
|
30
41
|
t3 = $[1];
|
|
31
42
|
}
|
|
32
|
-
const
|
|
43
|
+
const _admin = t3;
|
|
33
44
|
let t4;
|
|
34
45
|
if ($[2] !== t1) {
|
|
35
46
|
t4 = t1 === undefined ? {} : t1;
|
|
@@ -39,16 +50,21 @@ export const RichTextField = props => {
|
|
|
39
50
|
t4 = $[3];
|
|
40
51
|
}
|
|
41
52
|
const featureClientImportMap = t4;
|
|
42
|
-
const
|
|
53
|
+
const _lexicalEditorConfig = t2 === undefined ? defaultEditorLexicalConfig : t2;
|
|
54
|
+
const {
|
|
55
|
+
currentView
|
|
56
|
+
} = useRichTextView();
|
|
57
|
+
const currentViewAdminConfig = views?.[currentView]?.admin ?? _admin;
|
|
58
|
+
const currentViewLexicalEditorConfig = views?.[currentView]?.lexical ?? _lexicalEditorConfig;
|
|
43
59
|
const {
|
|
44
60
|
config
|
|
45
61
|
} = useConfig();
|
|
46
62
|
const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] = useState(null);
|
|
47
63
|
let t5;
|
|
48
64
|
let t6;
|
|
49
|
-
if ($[4] !==
|
|
65
|
+
if ($[4] !== clientFeatures || $[5] !== config || $[6] !== currentView || $[7] !== currentViewAdminConfig || $[8] !== currentViewLexicalEditorConfig || $[9] !== featureClientImportMap || $[10] !== featureClientSchemaMap || $[11] !== field || $[12] !== finalSanitizedEditorConfig || $[13] !== schemaPath) {
|
|
50
66
|
t5 = () => {
|
|
51
|
-
if (finalSanitizedEditorConfig) {
|
|
67
|
+
if (finalSanitizedEditorConfig && finalSanitizedEditorConfig.view === currentView) {
|
|
52
68
|
return;
|
|
53
69
|
}
|
|
54
70
|
const featureProvidersLocal = [];
|
|
@@ -66,44 +82,46 @@ export const RichTextField = props => {
|
|
|
66
82
|
schemaPath: schemaPath ?? field.name,
|
|
67
83
|
unSanitizedEditorConfig: {
|
|
68
84
|
features: featureProvidersLocal,
|
|
69
|
-
lexical:
|
|
85
|
+
lexical: currentViewLexicalEditorConfig
|
|
70
86
|
}
|
|
71
87
|
});
|
|
72
|
-
setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(resolvedClientFeatures,
|
|
88
|
+
setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(resolvedClientFeatures, currentViewLexicalEditorConfig, currentViewAdminConfig, currentView));
|
|
73
89
|
};
|
|
74
|
-
t6 = [
|
|
75
|
-
$[4] =
|
|
76
|
-
$[5] =
|
|
77
|
-
$[6] =
|
|
78
|
-
$[7] =
|
|
79
|
-
$[8] =
|
|
80
|
-
$[9] =
|
|
81
|
-
$[10] =
|
|
82
|
-
$[11] =
|
|
83
|
-
$[12] =
|
|
84
|
-
$[13] =
|
|
85
|
-
$[14] =
|
|
90
|
+
t6 = [currentViewAdminConfig, clientFeatures, config, featureClientImportMap, featureClientSchemaMap, field, finalSanitizedEditorConfig, currentViewLexicalEditorConfig, schemaPath, currentView];
|
|
91
|
+
$[4] = clientFeatures;
|
|
92
|
+
$[5] = config;
|
|
93
|
+
$[6] = currentView;
|
|
94
|
+
$[7] = currentViewAdminConfig;
|
|
95
|
+
$[8] = currentViewLexicalEditorConfig;
|
|
96
|
+
$[9] = featureClientImportMap;
|
|
97
|
+
$[10] = featureClientSchemaMap;
|
|
98
|
+
$[11] = field;
|
|
99
|
+
$[12] = finalSanitizedEditorConfig;
|
|
100
|
+
$[13] = schemaPath;
|
|
101
|
+
$[14] = t5;
|
|
102
|
+
$[15] = t6;
|
|
86
103
|
} else {
|
|
87
|
-
t5 = $[
|
|
88
|
-
t6 = $[
|
|
104
|
+
t5 = $[14];
|
|
105
|
+
t6 = $[15];
|
|
89
106
|
}
|
|
90
107
|
useEffect(t5, t6);
|
|
91
108
|
let t7;
|
|
92
|
-
if ($[
|
|
109
|
+
if ($[16] !== finalSanitizedEditorConfig || $[17] !== props) {
|
|
93
110
|
t7 = _jsx(Suspense, {
|
|
94
111
|
fallback: _jsx(ShimmerEffect, {
|
|
95
112
|
height: "35vh"
|
|
96
113
|
}),
|
|
97
|
-
children: finalSanitizedEditorConfig &&
|
|
114
|
+
children: finalSanitizedEditorConfig && _createElement(RichTextEditor, {
|
|
98
115
|
...props,
|
|
99
|
-
editorConfig: finalSanitizedEditorConfig
|
|
116
|
+
editorConfig: finalSanitizedEditorConfig,
|
|
117
|
+
key: finalSanitizedEditorConfig.view
|
|
100
118
|
})
|
|
101
119
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
120
|
+
$[16] = finalSanitizedEditorConfig;
|
|
121
|
+
$[17] = props;
|
|
122
|
+
$[18] = t7;
|
|
105
123
|
} else {
|
|
106
|
-
t7 = $[
|
|
124
|
+
t7 = $[18];
|
|
107
125
|
}
|
|
108
126
|
return t7;
|
|
109
127
|
};
|
package/dist/field/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useConfig","React","lazy","Suspense","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextEditor","then","module","default","RichText","RichTextField","props","$","admin","t0","clientFeatures","featureClientImportMap","t1","featureClientSchemaMap","field","lexicalEditorConfig","t2","schemaPath","t3","undefined","t4","config","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","t5","t6","featureProvidersLocal","clientFeature","Object","values","clientFeatureProvider","push","clientFeatureProps","resolvedClientFeatures","name","unSanitizedEditorConfig","features","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","ShimmerEffect","useConfig","React","lazy","Suspense","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextViewProvider","useRichTextView","RichTextEditor","then","module","default","RichText","RichTextField","props","_jsx","views","RichTextFieldImpl","$","admin","t0","clientFeatures","featureClientImportMap","t1","featureClientSchemaMap","field","lexicalEditorConfig","t2","schemaPath","t3","undefined","_admin","t4","_lexicalEditorConfig","currentView","currentViewAdminConfig","currentViewLexicalEditorConfig","lexical","config","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","t5","t6","view","featureProvidersLocal","clientFeature","Object","values","clientFeatureProvider","push","clientFeatureProps","resolvedClientFeatures","name","unSanitizedEditorConfig","features","t7","fallback","height","_createElement","editorConfig","key"],"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextFieldClient } from 'payload'\n\nimport { ShimmerEffect, useConfig } from '@payloadcms/ui'\nimport React, { lazy, Suspense, useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalFieldAdminClientProps, LexicalRichTextFieldProps } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../lexical/config/client/default.js'\nimport { loadClientFeatures } from '../lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js'\nimport { RichTextViewProvider, useRichTextView } from './RichTextViewProvider.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<LexicalRichTextFieldProps> = (props) => {\n return (\n <RichTextViewProvider views={props.views}>\n <RichTextFieldImpl {...props} />\n </RichTextViewProvider>\n )\n}\n\nexport const RichTextFieldImpl: React.FC<LexicalRichTextFieldProps> = (props) => {\n const {\n admin: _admin = {},\n clientFeatures,\n featureClientImportMap = {},\n featureClientSchemaMap,\n field,\n lexicalEditorConfig: _lexicalEditorConfig = defaultEditorLexicalConfig,\n schemaPath,\n views,\n } = props\n const { currentView } = useRichTextView()\n const currentViewAdminConfig: LexicalFieldAdminClientProps = views?.[currentView]?.admin ?? _admin\n const currentViewLexicalEditorConfig: LexicalEditorConfig =\n views?.[currentView]?.lexical ?? _lexicalEditorConfig\n\n const { config } = useConfig()\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<null | SanitizedClientEditorConfig>(null)\n\n useEffect(() => {\n if (finalSanitizedEditorConfig && finalSanitizedEditorConfig.view === currentView) {\n return\n }\n\n const featureProvidersLocal: FeatureProviderClient<any, any>[] = []\n for (const clientFeature of Object.values(clientFeatures)) {\n if (!clientFeature.clientFeatureProvider) {\n continue\n }\n featureProvidersLocal.push(\n clientFeature.clientFeatureProvider(clientFeature.clientFeatureProps),\n ) // Execute the clientFeatureProvider function here, as the server cannot execute functions imported from use client files\n }\n\n const resolvedClientFeatures = loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field: field as RichTextFieldClient,\n schemaPath: schemaPath ?? field.name,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: currentViewLexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n resolvedClientFeatures,\n currentViewLexicalEditorConfig,\n currentViewAdminConfig,\n currentView,\n ),\n )\n }, [\n currentViewAdminConfig,\n clientFeatures,\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n finalSanitizedEditorConfig,\n currentViewLexicalEditorConfig,\n schemaPath,\n currentView,\n ]) // TODO: Optimize this and use useMemo for this in the future. This might break sub-richtext-blocks from the blocks feature. Need to investigate\n\n return (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor\n {...props}\n editorConfig={finalSanitizedEditorConfig}\n key={finalSanitizedEditorConfig.view}\n />\n )}\n </Suspense>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;;AAKA,SAASC,aAAa,EAAEC,SAAS,QAAQ;AACzC,OAAOC,KAAA,IAASC,IAAI,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,QAAQ,QAAQ;AAM3D,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,oBAAoB,EAAEC,eAAe,QAAQ;AAEtD,MAAMC,cAAA,gBAAiBT,IAAA,CAAK,MAC1B,MAAM,CAAC,cAAcU,IAAI,CAAEC,MAAA,KAAY;EAAEC,OAAA,EAASD,MAAA,CAAOE;AAAS;AAGpE,OAAO,MAAMC,aAAA,GAAsDC,KAAA;EACjE,oBACEC,IAAA,CAACT,oBAAA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A;IAAAJ,CAAA,OAAAM,sBAAA;IAAAN,CAAA,OAAAO,KAAA;IAAAP,CAAA,OAAAqB,0BAAA;IAAArB,CAAA,OAAAU,UAAA;IAAAV,CAAA,OAAAuB,EAAA;IAAAvB,CAAA,OAAAwB,EAAA;EAAA;IAAAD,EAAA,GAAAvB,CAAA;IAAAwB,EAAA,GAAAxB,CAAA;EAAA;EA9CDjB,SAAA,CAAUwC,EAmCV,EAAGC,EAWF;EAAA,IAAAa,EAAA;EAAA,IAAArC,CAAA,SAAAqB,0BAAA,IAAArB,CAAA,SAAAJ,KAAA;IAGCyC,EAAA,GAAAxC,IAAA,CAAAf,QAAA;MAAAwD,QAAA,EAAoBzC,IAAA,CAAAnB,aAAA;QAAA6D,MAAA,EAAsB;MAAA,C;gBACvClB,0BAAA,IACCmB,cAAA,CAAAlD,cAAA;QAAA,GACMM,KAAK;QAAA6C,YAAA,EACKpB,0BAAA;QAAAqB,GAAA,EACTrB,0BAAA,CAAAI;MAAA,C;;;;;;;;SALXY,E;CAUJ","ignoreList":[]}
|
package/dist/field/rscEntry.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
|
|
|
4
4
|
import type { LexicalEditorProps } from '../types.js';
|
|
5
5
|
export declare const RscEntryLexicalField: React.FC<{
|
|
6
6
|
sanitizedEditorConfig: SanitizedServerEditorConfig;
|
|
7
|
-
} & ClientComponentProps & Pick<FieldPaths, 'path'> & Pick<LexicalEditorProps, 'admin'> & ServerComponentProps>;
|
|
7
|
+
} & ClientComponentProps & Pick<FieldPaths, 'path'> & Pick<LexicalEditorProps, 'admin' | 'views'> & ServerComponentProps>;
|
|
8
8
|
//# sourceMappingURL=rscEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"rscEntry.d.ts","sourceRoot":"","sources":["../../src/field/rscEntry.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,UAAU,EAGV,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,aAAa,CAAA;AAOpB,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CACzC;IACE,qBAAqB,EAAE,2BAA2B,CAAA;CACnD,GAAG,oBAAoB,GACtB,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GACxB,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,GAC3C,oBAAoB,CAyGvB,CAAA"}
|
package/dist/field/rscEntry.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getTranslation } from '@payloadcms/translations';
|
|
3
3
|
import { renderField } from '@payloadcms/ui/forms/renderField';
|
|
4
|
+
import { getFromImportMap } from 'payload/shared';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
// eslint-disable-next-line payload/no-imports-from-exports-dir
|
|
6
7
|
import { RichTextField } from '../exports/client/index.js';
|
|
@@ -79,6 +80,17 @@ export const RscEntryLexicalField = async args => {
|
|
|
79
80
|
renderedBlocks: args.renderedBlocks,
|
|
80
81
|
schemaPath
|
|
81
82
|
};
|
|
83
|
+
if (args?.views) {
|
|
84
|
+
const viewMap = getFromImportMap({
|
|
85
|
+
importMap: args.payload.importMap,
|
|
86
|
+
PayloadComponent: args.views,
|
|
87
|
+
schemaPath: 'lexical-viewMap',
|
|
88
|
+
silent: true
|
|
89
|
+
});
|
|
90
|
+
if (viewMap) {
|
|
91
|
+
props.views = viewMap;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
82
94
|
if (Object.keys(admin).length) {
|
|
83
95
|
props.admin = admin;
|
|
84
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rscEntry.js","names":["getTranslation","renderField","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","disabled","readOnly","admin","Error","clientFeatures","featureClientImportMap","featureClientSchemaMap","clientFieldSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","siblingData","root","children","length","context","id","collectionSlug","documentData","data","lexicalFieldSchemaPath","operation","permissions","preferences","renderFieldFn","req","nodeData","placeholderFromArgs","placeholder","undefined","hideGutter","hideInsertParagraphAtEnd","hideAddBlockButton","hideDraggableBlockElement","props","forceRender","lexicalEditorConfig","lexical","renderedBlocks","Object","keys","key","_jsx"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n LexicalEditorProps,\n LexicalFieldAdminClientProps,\n LexicalRichTextFieldProps,\n} from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n Pick<LexicalEditorProps, 'admin'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n\n const disabled = args?.readOnly || field?.admin?.readOnly\n\n if (!(args?.clientField as RichTextFieldClient)?.name) {\n throw new Error('Initialized lexical RSC field without a field name')\n }\n\n const { clientFeatures, featureClientImportMap, featureClientSchemaMap } = initLexicalFeatures({\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.siblingData?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n collectionSlug: args.collectionSlug,\n disabled,\n documentData: args.data,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.siblingData?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n const placeholderFromArgs = args.admin?.placeholder\n const placeholder = placeholderFromArgs\n ? getTranslation(placeholderFromArgs, args.i18n)\n : undefined\n\n const admin: LexicalFieldAdminClientProps = {}\n if (placeholder) {\n admin.placeholder = placeholder\n }\n if (args.admin?.hideGutter) {\n admin.hideGutter = true\n }\n if (args.admin?.hideInsertParagraphAtEnd) {\n admin.hideInsertParagraphAtEnd = true\n }\n if (args.admin?.hideAddBlockButton) {\n admin.hideAddBlockButton = true\n }\n if (args.admin?.hideDraggableBlockElement) {\n admin.hideDraggableBlockElement = true\n }\n\n const props: LexicalRichTextFieldProps = {\n clientFeatures,\n featureClientSchemaMap, // TODO: Does client need this? Why cant this just live in the server\n field: args.clientField as RichTextFieldClient,\n forceRender: args.forceRender,\n initialLexicalFormState,\n lexicalEditorConfig: args.sanitizedEditorConfig.lexical,\n path,\n permissions: args.permissions,\n readOnly: args.readOnly,\n renderedBlocks: args.renderedBlocks,\n schemaPath,\n }\n if (Object.keys(admin).length) {\n props.admin = admin\n }\n if (Object.keys(featureClientImportMap).length) {\n props.featureClientImportMap = featureClientImportMap\n }\n\n for (const key in props) {\n if (props[key as keyof LexicalRichTextFieldProps] === undefined) {\n delete props[key as keyof LexicalRichTextFieldProps]\n }\n }\n\n return <RichTextField {...props} />\n}\n"],"mappings":";AASA,SAASA,cAAc,QAAQ;AAC/B,SAASC,WAAW,QAAQ;AAC5B,OAAOC,KAAA,MAAW;
|
|
1
|
+
{"version":3,"file":"rscEntry.js","names":["getTranslation","renderField","getFromImportMap","React","RichTextField","buildInitialState","initLexicalFeatures","RscEntryLexicalField","args","field","path","clientField","name","schemaPath","disabled","readOnly","admin","Error","clientFeatures","featureClientImportMap","featureClientSchemaMap","clientFieldSchemaMap","fieldSchemaMap","i18n","payload","sanitizedEditorConfig","initialLexicalFormState","siblingData","root","children","length","context","id","collectionSlug","documentData","data","lexicalFieldSchemaPath","operation","permissions","preferences","renderFieldFn","req","nodeData","placeholderFromArgs","placeholder","undefined","hideGutter","hideInsertParagraphAtEnd","hideAddBlockButton","hideDraggableBlockElement","props","forceRender","lexicalEditorConfig","lexical","renderedBlocks","views","viewMap","importMap","PayloadComponent","silent","Object","keys","key","_jsx"],"sources":["../../src/field/rscEntry.tsx"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\nimport type {\n ClientComponentProps,\n FieldPaths,\n RichTextFieldClient,\n RichTextField as RichTextFieldType,\n ServerComponentProps,\n} from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { renderField } from '@payloadcms/ui/forms/renderField'\nimport { getFromImportMap } from 'payload/shared'\nimport React from 'react'\n\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n LexicalEditorProps,\n LexicalEditorViewMap,\n LexicalFieldAdminClientProps,\n LexicalRichTextFieldProps,\n} from '../types.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { RichTextField } from '../exports/client/index.js'\nimport { buildInitialState } from '../utilities/buildInitialState.js'\nimport { initLexicalFeatures } from '../utilities/initLexicalFeatures.js'\n\nexport const RscEntryLexicalField: React.FC<\n {\n sanitizedEditorConfig: SanitizedServerEditorConfig\n } & ClientComponentProps &\n Pick<FieldPaths, 'path'> &\n Pick<LexicalEditorProps, 'admin' | 'views'> &\n ServerComponentProps\n> = async (args) => {\n const field: RichTextFieldType = args.field as RichTextFieldType\n const path = args.path ?? (args.clientField as RichTextFieldClient).name\n const schemaPath = args.schemaPath ?? path\n\n const disabled = args?.readOnly || field?.admin?.readOnly\n\n if (!(args?.clientField as RichTextFieldClient)?.name) {\n throw new Error('Initialized lexical RSC field without a field name')\n }\n\n const { clientFeatures, featureClientImportMap, featureClientSchemaMap } = initLexicalFeatures({\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n fieldSchemaMap: args.fieldSchemaMap,\n i18n: args.i18n,\n path,\n payload: args.payload,\n sanitizedEditorConfig: args.sanitizedEditorConfig,\n schemaPath,\n })\n\n let initialLexicalFormState = {}\n if (args.siblingData?.[field.name]?.root?.children?.length) {\n initialLexicalFormState = await buildInitialState({\n context: {\n id: args.id,\n clientFieldSchemaMap: args.clientFieldSchemaMap,\n collectionSlug: args.collectionSlug,\n disabled,\n documentData: args.data,\n field,\n fieldSchemaMap: args.fieldSchemaMap,\n lexicalFieldSchemaPath: schemaPath,\n operation: args.operation,\n permissions: args.permissions,\n preferences: args.preferences,\n renderFieldFn: renderField,\n req: args.req,\n },\n nodeData: args.siblingData?.[field.name]?.root?.children as SerializedLexicalNode[],\n })\n }\n\n const placeholderFromArgs = args.admin?.placeholder\n const placeholder = placeholderFromArgs\n ? getTranslation(placeholderFromArgs, args.i18n)\n : undefined\n\n const admin: LexicalFieldAdminClientProps = {}\n if (placeholder) {\n admin.placeholder = placeholder\n }\n if (args.admin?.hideGutter) {\n admin.hideGutter = true\n }\n if (args.admin?.hideInsertParagraphAtEnd) {\n admin.hideInsertParagraphAtEnd = true\n }\n if (args.admin?.hideAddBlockButton) {\n admin.hideAddBlockButton = true\n }\n if (args.admin?.hideDraggableBlockElement) {\n admin.hideDraggableBlockElement = true\n }\n\n const props: LexicalRichTextFieldProps = {\n clientFeatures,\n featureClientSchemaMap, // TODO: Does client need this? Why cant this just live in the server\n field: args.clientField as RichTextFieldClient,\n forceRender: args.forceRender,\n initialLexicalFormState,\n lexicalEditorConfig: args.sanitizedEditorConfig.lexical,\n path,\n permissions: args.permissions,\n readOnly: args.readOnly,\n renderedBlocks: args.renderedBlocks,\n schemaPath,\n }\n if (args?.views) {\n const viewMap = getFromImportMap<LexicalEditorViewMap>({\n importMap: args.payload.importMap,\n PayloadComponent: args.views,\n schemaPath: 'lexical-viewMap',\n silent: true,\n })\n if (viewMap) {\n props.views = viewMap\n }\n }\n\n if (Object.keys(admin).length) {\n props.admin = admin\n }\n if (Object.keys(featureClientImportMap).length) {\n props.featureClientImportMap = featureClientImportMap\n }\n\n for (const key in props) {\n if (props[key as keyof LexicalRichTextFieldProps] === undefined) {\n delete props[key as keyof LexicalRichTextFieldProps]\n }\n }\n\n return <RichTextField {...props} />\n}\n"],"mappings":";AASA,SAASA,cAAc,QAAQ;AAC/B,SAASC,WAAW,QAAQ;AAC5B,SAASC,gBAAgB,QAAQ;AACjC,OAAOC,KAAA,MAAW;AAUlB;AACA,SAASC,aAAa,QAAQ;AAC9B,SAASC,iBAAiB,QAAQ;AAClC,SAASC,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,oBAAA,GAOT,MAAOC,IAAA;EACT,MAAMC,KAAA,GAA2BD,IAAA,CAAKC,KAAK;EAC3C,MAAMC,IAAA,GAAOF,IAAA,CAAKE,IAAI,IAAIF,IAAC,CAAKG,WAAW,CAAyBC,IAAI;EACxE,MAAMC,UAAA,GAAaL,IAAA,CAAKK,UAAU,IAAIH,IAAA;EAEtC,MAAMI,QAAA,GAAWN,IAAA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AA,EAAkBlD,IAAA,CAAK+C,KAAK;MAC5B1C,UAAA,EAAY;MACZ8C,MAAA,EAAQ;IACV;IACA,IAAIH,OAAA,EAAS;MACXN,KAAA,CAAMK,KAAK,GAAGC,OAAA;IAChB;EACF;EAEA,IAAII,MAAA,CAAOC,IAAI,CAAC7C,KAAA,EAAOc,MAAM,EAAE;IAC7BoB,KAAA,CAAMlC,KAAK,GAAGA,KAAA;EAChB;EACA,IAAI4C,MAAA,CAAOC,IAAI,CAAC1C,sBAAA,EAAwBW,MAAM,EAAE;IAC9CoB,KAAA,CAAM/B,sBAAsB,GAAGA,sBAAA;EACjC;EAEA,KAAK,MAAM2C,GAAA,IAAOZ,KAAA,EAAO;IACvB,IAAIA,KAAK,CAACY,GAAA,CAAuC,KAAKjB,SAAA,EAAW;MAC/D,OAAOK,KAAK,CAACY,GAAA,CAAuC;IACtD;EACF;EAEA,oBAAOC,IAAA,CAAC3D,aAAA;IAAe,GAAG8C;;AAC5B","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export type * from './nodeTypes.js';
|
|
|
73
73
|
export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js';
|
|
74
74
|
export { defaultRichTextValue } from './populateGraphQL/defaultValue.js';
|
|
75
75
|
export { populate } from './populateGraphQL/populate.js';
|
|
76
|
-
export type { LexicalEditorProps, LexicalFieldAdminProps, LexicalRichTextAdapter } from './types.js';
|
|
76
|
+
export type { LexicalEditorNodeMap, LexicalEditorProps, LexicalEditorViewMap, LexicalFieldAdminProps, LexicalRichTextAdapter, NodeMapValue, } from './types.js';
|
|
77
77
|
export { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js';
|
|
78
78
|
export { createServerFeature } from './utilities/createServerFeature.js';
|
|
79
79
|
export { editorConfigFactory } from './utilities/editorConfigFactory.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","s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AW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEjE,mBAAmB,gBAAgB,CAAA;AAEnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAExD,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,GACb,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAExE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAE3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAElG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -64,10 +64,12 @@ export function lexicalEditor(args) {
|
|
|
64
64
|
FieldComponent: {
|
|
65
65
|
path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',
|
|
66
66
|
serverProps: {
|
|
67
|
-
admin: args?.admin
|
|
67
|
+
admin: args?.admin,
|
|
68
|
+
views: args?.views
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
generateImportMap: getGenerateImportMap({
|
|
72
|
+
lexicalEditorArgs: args,
|
|
71
73
|
resolvedFeatureMap
|
|
72
74
|
}),
|
|
73
75
|
generateSchemaMap: getGenerateSchemaMap({
|