@payloadcms/richtext-lexical 3.10.0 → 3.11.1-canary.053fca8
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/index.js +8 -8
- package/dist/exports/client/index.js.map +3 -3
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +3 -6
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +12 -2
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts.map +1 -1
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js +7 -4
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js.map +1 -1
- package/dist/utilities/jsx/jsx.spec.js +10 -0
- package/dist/utilities/jsx/jsx.spec.js.map +1 -1
- package/package.json +9 -8
|
@@ -104,6 +104,16 @@ describe('jsx', () => {
|
|
|
104
104
|
uniqueId: 'some unique id!',
|
|
105
105
|
update: true
|
|
106
106
|
}
|
|
107
|
+
}, {
|
|
108
|
+
// Test if unquoted property keys in objects within arrays are supprted. This is
|
|
109
|
+
// supported through the more lenient json5 parser, instead of using JSON.parse()
|
|
110
|
+
input: 'key={[1, 2, { hello: "there" }]}',
|
|
111
|
+
inputFromOutput: 'key={[1, 2, { "hello": "there" }]}',
|
|
112
|
+
output: {
|
|
113
|
+
key: [1, 2, {
|
|
114
|
+
hello: 'there'
|
|
115
|
+
}]
|
|
116
|
+
}
|
|
107
117
|
}];
|
|
108
118
|
for (const {
|
|
109
119
|
input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsx.spec.js","names":["extractPropsFromJSXPropsString","propsToJSXString","describe","INPUT_AND_OUTPUT","input","output","key","object","test","inputFromOutput","global","packageId","uniqueId","update","hello","something","nested","it","replace","propsObject","propsString","console","log","expect","toStrictEqual","originalInput","props","replaceAll","toBe"],"sources":["../../../src/utilities/jsx/jsx.spec.ts"],"sourcesContent":["import { extractPropsFromJSXPropsString } from './extractPropsFromJSXPropsString.js'\nimport { propsToJSXString } from './jsx.js'\n\ndescribe('jsx', () => {\n describe('prop string to object', () => {\n const INPUT_AND_OUTPUT = [\n {\n input: 'key=\"value\"',\n output: {\n key: 'value',\n },\n },\n {\n input: 'key={[1, 2, 3]}',\n output: {\n key: [1, 2, 3],\n },\n },\n {\n input: 'key={[1, 2, 3, [1, 2]]}',\n output: {\n key: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={4}',\n output: {\n object: 4,\n },\n },\n {\n input: 'object={{\"test\": 1}}',\n output: {\n object: { test: 1 },\n },\n },\n {\n input: 'object={[1, 2, 3, [1, 2]]}',\n output: {\n object: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={[1, 2]}',\n output: {\n object: [1, 2],\n },\n },\n {\n input: 'key=\"value\" object={{key: \"value\"}}',\n inputFromOutput: 'key=\"value\" object={{\"key\": \"value\"}}',\n output: {\n key: 'value',\n object: { key: 'value' },\n },\n },\n {\n input: 'global packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'global key=\"value\" object={{key: \"value\", something: \"test\", hello: 1}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"something\": \"test\"}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: { hello: 1, key: 'value', something: 'test' },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}}',\n inputFromOutput:\n 'object={{\"hello\": 1, \"key\": \"value\", \"nested\": {\"key\": \"value\"}, \"something\": \"test\", \"test\": [1, 2, 3]}}',\n output: {\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n },\n },\n {\n input:\n 'global key=\"value\" object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"nested\": { \"key\": \"value\" }, \"something\": \"test\", \"test\": [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n ]\n\n for (const { input, output } of INPUT_AND_OUTPUT) {\n it(`can correctly convert to object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsObject = extractPropsFromJSXPropsString({ propsString: input })\n console.log({ output, propsObject })\n\n expect(propsObject).toStrictEqual(output)\n })\n }\n\n for (const { input: originalInput, inputFromOutput, output } of INPUT_AND_OUTPUT) {\n const input = inputFromOutput || originalInput\n it(`can correctly convert from object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsString = propsToJSXString({ props: output })\n console.log({ input, propsString })\n\n expect(propsString.replaceAll(' ', '')).toBe(input.replaceAll(' ', ''))\n })\n }\n })\n})\n"],"mappings":"AAAA,SAASA,8BAA8B,QAAQ;AAC/C,SAASC,gBAAgB,QAAQ;AAEjCC,QAAA,CAAS,OAAO;EACdA,QAAA,CAAS,yBAAyB;IAChC,MAAMC,gBAAA,
|
|
1
|
+
{"version":3,"file":"jsx.spec.js","names":["extractPropsFromJSXPropsString","propsToJSXString","describe","INPUT_AND_OUTPUT","input","output","key","object","test","inputFromOutput","global","packageId","uniqueId","update","hello","something","nested","it","replace","propsObject","propsString","console","log","expect","toStrictEqual","originalInput","props","replaceAll","toBe"],"sources":["../../../src/utilities/jsx/jsx.spec.ts"],"sourcesContent":["import { extractPropsFromJSXPropsString } from './extractPropsFromJSXPropsString.js'\nimport { propsToJSXString } from './jsx.js'\n\ndescribe('jsx', () => {\n describe('prop string to object', () => {\n const INPUT_AND_OUTPUT: {\n input: string\n inputFromOutput?: string\n output: Record<string, any>\n }[] = [\n {\n input: 'key=\"value\"',\n output: {\n key: 'value',\n },\n },\n {\n input: 'key={[1, 2, 3]}',\n output: {\n key: [1, 2, 3],\n },\n },\n {\n input: 'key={[1, 2, 3, [1, 2]]}',\n output: {\n key: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={4}',\n output: {\n object: 4,\n },\n },\n {\n input: 'object={{\"test\": 1}}',\n output: {\n object: { test: 1 },\n },\n },\n {\n input: 'object={[1, 2, 3, [1, 2]]}',\n output: {\n object: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={[1, 2]}',\n output: {\n object: [1, 2],\n },\n },\n {\n input: 'key=\"value\" object={{key: \"value\"}}',\n inputFromOutput: 'key=\"value\" object={{\"key\": \"value\"}}',\n output: {\n key: 'value',\n object: { key: 'value' },\n },\n },\n {\n input: 'global packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'global key=\"value\" object={{key: \"value\", something: \"test\", hello: 1}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"something\": \"test\"}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: { hello: 1, key: 'value', something: 'test' },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}}',\n inputFromOutput:\n 'object={{\"hello\": 1, \"key\": \"value\", \"nested\": {\"key\": \"value\"}, \"something\": \"test\", \"test\": [1, 2, 3]}}',\n output: {\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n },\n },\n {\n input:\n 'global key=\"value\" object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"nested\": { \"key\": \"value\" }, \"something\": \"test\", \"test\": [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n // Test if unquoted property keys in objects within arrays are supprted. This is\n // supported through the more lenient json5 parser, instead of using JSON.parse()\n input: 'key={[1, 2, { hello: \"there\" }]}',\n inputFromOutput: 'key={[1, 2, { \"hello\": \"there\" }]}',\n output: {\n key: [1, 2, { hello: 'there' }],\n },\n },\n ]\n\n for (const { input, output } of INPUT_AND_OUTPUT) {\n it(`can correctly convert to object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsObject = extractPropsFromJSXPropsString({ propsString: input })\n console.log({ output, propsObject })\n\n expect(propsObject).toStrictEqual(output)\n })\n }\n\n for (const { input: originalInput, inputFromOutput, output } of INPUT_AND_OUTPUT) {\n const input = inputFromOutput || originalInput\n it(`can correctly convert from object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsString = propsToJSXString({ props: output })\n console.log({ input, propsString })\n\n expect(propsString.replaceAll(' ', '')).toBe(input.replaceAll(' ', ''))\n })\n }\n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AAA,GAAQK,eAAA,IAAmBgB,aAAA;MACjCR,EAAA,CAAG,uCAAuCb,KAAA,CAAMc,OAAO,CAAC,OAAO,SAAS,EAAE;QACxE,MAAME,WAAA,GAAcnB,gBAAA,CAAiB;UAAEyB,KAAA,EAAOrB;QAAO;QACrDgB,OAAA,CAAQC,GAAG,CAAC;UAAElB,KAAA;UAAOgB;QAAY;QAEjCG,MAAA,CAAOH,WAAA,CAAYO,UAAU,CAAC,KAAK,KAAKC,IAAI,CAACxB,KAAA,CAAMuB,UAAU,CAAC,KAAK;MACrE;IACF;EACF;AACF","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.1-canary.053fca8",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -344,6 +344,7 @@
|
|
|
344
344
|
"bson-objectid": "2.0.4",
|
|
345
345
|
"dequal": "2.0.3",
|
|
346
346
|
"escape-html": "1.0.3",
|
|
347
|
+
"json5": "^2.2.3",
|
|
347
348
|
"lexical": "0.20.0",
|
|
348
349
|
"mdast-util-from-markdown": "2.0.2",
|
|
349
350
|
"mdast-util-mdx-jsx": "3.1.3",
|
|
@@ -351,8 +352,8 @@
|
|
|
351
352
|
"react-error-boundary": "4.1.2",
|
|
352
353
|
"ts-essentials": "10.0.3",
|
|
353
354
|
"uuid": "10.0.0",
|
|
354
|
-
"@payloadcms/
|
|
355
|
-
"@payloadcms/
|
|
355
|
+
"@payloadcms/ui": "3.11.1-canary.053fca8",
|
|
356
|
+
"@payloadcms/translations": "3.11.1-canary.053fca8"
|
|
356
357
|
},
|
|
357
358
|
"devDependencies": {
|
|
358
359
|
"@babel/cli": "7.25.9",
|
|
@@ -372,8 +373,8 @@
|
|
|
372
373
|
"esbuild-sass-plugin": "3.3.1",
|
|
373
374
|
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
|
|
374
375
|
"swc-plugin-transform-remove-imports": "2.0.0",
|
|
375
|
-
"
|
|
376
|
-
"
|
|
376
|
+
"payload": "3.11.1-canary.053fca8",
|
|
377
|
+
"@payloadcms/eslint-config": "3.9.0"
|
|
377
378
|
},
|
|
378
379
|
"peerDependencies": {
|
|
379
380
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
|
@@ -391,8 +392,8 @@
|
|
|
391
392
|
"lexical": "0.20.0",
|
|
392
393
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
393
394
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
394
|
-
"@payloadcms/next": "3.
|
|
395
|
-
"payload": "3.
|
|
395
|
+
"@payloadcms/next": "3.11.1-canary.053fca8",
|
|
396
|
+
"payload": "3.11.1-canary.053fca8"
|
|
396
397
|
},
|
|
397
398
|
"engines": {
|
|
398
399
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -409,7 +410,7 @@
|
|
|
409
410
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
410
411
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
411
412
|
"build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:esbuild && rm -rf dist/exports/client && mv dist/exports/client_unoptimized dist/exports/client",
|
|
412
|
-
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
413
|
+
"clean": "rimraf -g {dist,*.tsbuildinfo}",
|
|
413
414
|
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
414
415
|
"lint": "eslint .",
|
|
415
416
|
"lint:fix": "eslint . --fix",
|