@payloadcms/richtext-lexical 4.0.0-beta.0 → 4.0.0-beta.2
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-MT4FK3IP.js → Field-W2ABOM7M.js} +2 -2
- package/dist/exports/client/{Field-MT4FK3IP.js.map → Field-W2ABOM7M.js.map} +3 -3
- package/dist/exports/client/index.js +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +16 -9
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAQhC,OAAO,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAIrE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,EACZ,cAAc,GACf,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;IACzC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,GAAG,CAAC,OAAO,CAwBd"}
|
|
@@ -4,13 +4,14 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
6
6
|
import { ContentEditable } from '@lexical/react/LexicalContentEditable.js';
|
|
7
|
+
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
7
8
|
import { getTranslation } from '@payloadcms/translations';
|
|
8
9
|
import { useTranslation } from '@payloadcms/ui';
|
|
9
10
|
import './ContentEditable.css';
|
|
10
11
|
import * as React from 'react';
|
|
11
12
|
import { useEditorConfigContext } from '../config/client/EditorConfigProvider.js';
|
|
12
13
|
export function LexicalContentEditable(t0) {
|
|
13
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(10);
|
|
14
15
|
const {
|
|
15
16
|
className,
|
|
16
17
|
editorConfig,
|
|
@@ -27,18 +28,23 @@ export function LexicalContentEditable(t0) {
|
|
|
27
28
|
const {
|
|
28
29
|
getTheme
|
|
29
30
|
} = t1;
|
|
31
|
+
const isEditable = useLexicalEditable();
|
|
30
32
|
let t2;
|
|
31
|
-
if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== fieldProps.field.label || $[3] !== fieldProps.field.required || $[4] !== getTheme || $[5] !== i18n || $[6] !== instructionsID || $[7] !== t) {
|
|
33
|
+
if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== fieldProps.field.label || $[3] !== fieldProps.field.required || $[4] !== getTheme || $[5] !== i18n || $[6] !== instructionsID || $[7] !== isEditable || $[8] !== t) {
|
|
32
34
|
const theme = getTheme();
|
|
33
35
|
t2 = _jsx(ContentEditable, {
|
|
34
36
|
"aria-describedby": instructionsID,
|
|
35
37
|
"aria-label": getTranslation(fieldProps.field.label || "", i18n),
|
|
36
|
-
"aria-placeholder": t("lexical:general:placeholder"),
|
|
37
38
|
"aria-required": fieldProps.field.required || undefined,
|
|
38
39
|
className: className ?? "ContentEditable__root",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
...(isEditable ? {
|
|
41
|
+
"aria-placeholder": t("lexical:general:placeholder"),
|
|
42
|
+
placeholder: _jsx("p", {
|
|
43
|
+
className: theme?.placeholder,
|
|
44
|
+
children: editorConfig?.admin?.placeholder ?? t("lexical:general:placeholder")
|
|
45
|
+
})
|
|
46
|
+
} : {
|
|
47
|
+
placeholder: null
|
|
42
48
|
})
|
|
43
49
|
});
|
|
44
50
|
$[0] = className;
|
|
@@ -48,10 +54,11 @@ export function LexicalContentEditable(t0) {
|
|
|
48
54
|
$[4] = getTheme;
|
|
49
55
|
$[5] = i18n;
|
|
50
56
|
$[6] = instructionsID;
|
|
51
|
-
$[7] =
|
|
52
|
-
$[8] =
|
|
57
|
+
$[7] = isEditable;
|
|
58
|
+
$[8] = t;
|
|
59
|
+
$[9] = t2;
|
|
53
60
|
} else {
|
|
54
|
-
t2 = $[
|
|
61
|
+
t2 = $[9];
|
|
55
62
|
}
|
|
56
63
|
return t2;
|
|
57
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","getTranslation","useTranslation","React","useEditorConfigContext","LexicalContentEditable","t0","$","className","editorConfig","instructionsID","fieldProps","i18n","t","t1","getTheme","t2","admin","placeholder","field","label","required","theme","_jsx","undefined","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nimport { useEditorConfigContext } from '../config/client/EditorConfigProvider.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n instructionsID,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n instructionsID?: string\n}): JSX.Element {\n const { fieldProps } = useEditorConfigContext()\n const { i18n, t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const theme = getTheme()\n return (\n <ContentEditable\n aria-describedby={instructionsID}\n aria-label={getTranslation(fieldProps.field.label || '', i18n)}\n aria-
|
|
1
|
+
{"version":3,"file":"ContentEditable.js","names":["c","_c","useLexicalComposerContext","ContentEditable","useLexicalEditable","getTranslation","useTranslation","React","useEditorConfigContext","LexicalContentEditable","t0","$","className","editorConfig","instructionsID","fieldProps","i18n","t","t1","getTheme","isEditable","t2","admin","placeholder","field","label","required","theme","_jsx","undefined","children"],"sources":["../../../src/lexical/ui/ContentEditable.tsx"],"sourcesContent":["'use client'\nimport type { JSX } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useTranslation } from '@payloadcms/ui'\n\nimport './ContentEditable.css'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../config/types.js'\n\nimport { useEditorConfigContext } from '../config/client/EditorConfigProvider.js'\n\nexport function LexicalContentEditable({\n className,\n editorConfig,\n instructionsID,\n}: {\n className?: string\n editorConfig: SanitizedClientEditorConfig\n instructionsID?: string\n}): JSX.Element {\n const { fieldProps } = useEditorConfigContext()\n const { i18n, t } = useTranslation<{}, string>()\n const [_, { getTheme }] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const theme = getTheme()\n return (\n <ContentEditable\n aria-describedby={instructionsID}\n aria-label={getTranslation(fieldProps.field.label || '', i18n)}\n aria-required={fieldProps.field.required || undefined}\n className={className ?? 'ContentEditable__root'}\n {...(isEditable\n ? {\n 'aria-placeholder': t('lexical:general:placeholder'),\n placeholder: (\n <p className={theme?.placeholder}>\n {editorConfig?.admin?.placeholder ?? t('lexical:general:placeholder')}\n </p>\n ),\n }\n : { placeholder: null })}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,eAAe,QAAQ;A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AS,KAAA,EAAAC,WAAA,IAAoCN,CAAA,CAAE;QAAA,C;;;OAIxB;IAAA,C;;;;;;;;;;;;;;SAd3BI,E","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -443,8 +443,8 @@
|
|
|
443
443
|
"react-error-boundary": "6.1.1",
|
|
444
444
|
"ts-essentials": "10.0.3",
|
|
445
445
|
"uuid": "14.0.0",
|
|
446
|
-
"@payloadcms/
|
|
447
|
-
"@payloadcms/
|
|
446
|
+
"@payloadcms/translations": "4.0.0-beta.2",
|
|
447
|
+
"@payloadcms/ui": "4.0.0-beta.2"
|
|
448
448
|
},
|
|
449
449
|
"devDependencies": {
|
|
450
450
|
"@babel/cli": "7.27.2",
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
"esbuild": "0.27.1",
|
|
464
464
|
"esbuild-sass-plugin": "3.3.1",
|
|
465
465
|
"swc-plugin-transform-remove-imports": "8.3.0",
|
|
466
|
-
"payload": "4.0.0-beta.
|
|
466
|
+
"payload": "4.0.0-beta.2",
|
|
467
467
|
"@payloadcms/eslint-config": "3.28.0"
|
|
468
468
|
},
|
|
469
469
|
"peerDependencies": {
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
"@faceless-ui/scroll-info": "2.0.0",
|
|
472
472
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
473
473
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
474
|
-
"payload": "4.0.0-beta.
|
|
474
|
+
"payload": "4.0.0-beta.2"
|
|
475
475
|
},
|
|
476
476
|
"engines": {
|
|
477
477
|
"node": ">=24.15.0"
|