@payloadcms/richtext-lexical 3.55.0-internal.f8c92b5 → 3.56.0-internal.299316b
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-SOED2PIU.js +2 -0
- package/dist/exports/client/{Field-Q3PTZQ75.js.map → Field-SOED2PIU.js.map} +3 -3
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-FSKAVN4P.js +2 -0
- package/dist/exports/client/{chunk-CYLMY5ZJ.js.map → chunk-FSKAVN4P.js.map} +2 -2
- package/dist/exports/client/chunk-KZKGNMS3.js +12 -0
- package/dist/exports/client/{chunk-YCH4JNUH.js.map → chunk-KZKGNMS3.js.map} +2 -2
- package/dist/exports/client/{component-3PENNOM3.js → component-M3U253XK.js} +2 -2
- package/dist/exports/client/index.d.ts +0 -2
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +10 -10
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/rsc.d.ts +0 -1
- package/dist/exports/server/rsc.d.ts.map +1 -1
- package/dist/exports/server/rsc.js +0 -1
- package/dist/exports/server/rsc.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +10 -8
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +39 -124
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +8 -6
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +3 -3
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +37 -20
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +53 -28
- package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
- package/dist/features/textState/feature.client.js +3 -1
- package/dist/features/textState/feature.client.js.map +1 -1
- package/dist/features/textState/feature.server.d.ts.map +1 -1
- package/dist/features/textState/feature.server.js +3 -1
- package/dist/features/textState/feature.server.js.map +1 -1
- package/dist/features/textState/i18n.d.ts +3 -0
- package/dist/features/textState/i18n.d.ts.map +1 -0
- package/dist/features/textState/i18n.js +108 -0
- package/dist/features/textState/i18n.js.map +1 -0
- package/dist/features/toolbars/shared/ToolbarButton/index.js +37 -35
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +30 -20
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.js +35 -22
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +15 -7
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +15 -7
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +141 -75
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +3 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +11 -2
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- package/dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.js.map +1 -0
- package/dist/nodeTypes.d.ts +1 -13
- package/dist/nodeTypes.d.ts.map +1 -1
- package/dist/nodeTypes.js +1 -4
- package/dist/nodeTypes.js.map +1 -1
- package/package.json +27 -22
- package/dist/exports/client/Field-Q3PTZQ75.js +0 -2
- package/dist/exports/client/chunk-CYLMY5ZJ.js +0 -2
- package/dist/exports/client/chunk-YCH4JNUH.js +0 -12
- package/dist/field/RenderLexical/renderLexical.d.ts +0 -38
- package/dist/field/RenderLexical/renderLexical.d.ts.map +0 -1
- package/dist/field/RenderLexical/renderLexical.js +0 -96
- package/dist/field/RenderLexical/renderLexical.js.map +0 -1
- package/dist/field/RenderLexical/useRenderEditor.d.ts +0 -15
- package/dist/field/RenderLexical/useRenderEditor.d.ts.map +0 -1
- package/dist/field/RenderLexical/useRenderEditor.js +0 -159
- package/dist/field/RenderLexical/useRenderEditor.js.map +0 -1
- package/dist/utilities/buildEditorState.d.ts +0 -11
- package/dist/utilities/buildEditorState.d.ts.map +0 -1
- package/dist/utilities/buildEditorState.js +0 -76
- package/dist/utilities/buildEditorState.js.map +0 -1
- /package/dist/exports/client/{component-3PENNOM3.js.map → component-M3U253XK.js.map} +0 -0
|
@@ -11,7 +11,7 @@ import { RelationshipDrawer } from '../drawer/index.js';
|
|
|
11
11
|
import { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js';
|
|
12
12
|
export const INSERT_RELATIONSHIP_COMMAND = createCommand('INSERT_RELATIONSHIP_COMMAND');
|
|
13
13
|
export const RelationshipPlugin = t0 => {
|
|
14
|
-
const $ = _c(
|
|
14
|
+
const $ = _c(10);
|
|
15
15
|
const {
|
|
16
16
|
clientProps
|
|
17
17
|
} = t0;
|
|
@@ -28,24 +28,33 @@ export const RelationshipPlugin = t0 => {
|
|
|
28
28
|
} else {
|
|
29
29
|
if (clientProps?.disabledCollections) {
|
|
30
30
|
let t2;
|
|
31
|
-
if ($[0] !== clientProps?.disabledCollections) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
if ($[0] !== clientProps?.disabledCollections || $[1] !== collections) {
|
|
32
|
+
let t3;
|
|
33
|
+
if ($[3] !== clientProps?.disabledCollections) {
|
|
34
|
+
t3 = t4 => {
|
|
35
|
+
const {
|
|
36
|
+
slug
|
|
37
|
+
} = t4;
|
|
38
|
+
return !clientProps?.disabledCollections?.includes(slug);
|
|
39
|
+
};
|
|
40
|
+
$[3] = clientProps?.disabledCollections;
|
|
41
|
+
$[4] = t3;
|
|
42
|
+
} else {
|
|
43
|
+
t3 = $[4];
|
|
44
|
+
}
|
|
45
|
+
t2 = collections.filter(t3).map(_temp);
|
|
38
46
|
$[0] = clientProps?.disabledCollections;
|
|
39
|
-
$[1] =
|
|
47
|
+
$[1] = collections;
|
|
48
|
+
$[2] = t2;
|
|
40
49
|
} else {
|
|
41
|
-
t2 = $[
|
|
50
|
+
t2 = $[2];
|
|
42
51
|
}
|
|
43
|
-
enabledRelations =
|
|
52
|
+
enabledRelations = t2;
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
let t2;
|
|
47
56
|
let t3;
|
|
48
|
-
if ($[
|
|
57
|
+
if ($[5] !== editor) {
|
|
49
58
|
t2 = () => {
|
|
50
59
|
if (!editor.hasNodes([RelationshipNode])) {
|
|
51
60
|
throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");
|
|
@@ -53,17 +62,25 @@ export const RelationshipPlugin = t0 => {
|
|
|
53
62
|
return editor.registerCommand(INSERT_RELATIONSHIP_COMMAND, _temp2, COMMAND_PRIORITY_EDITOR);
|
|
54
63
|
};
|
|
55
64
|
t3 = [editor];
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
65
|
+
$[5] = editor;
|
|
66
|
+
$[6] = t2;
|
|
67
|
+
$[7] = t3;
|
|
59
68
|
} else {
|
|
60
|
-
t2 = $[
|
|
61
|
-
t3 = $[
|
|
69
|
+
t2 = $[6];
|
|
70
|
+
t3 = $[7];
|
|
62
71
|
}
|
|
63
72
|
useEffect(t2, t3);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
let t4;
|
|
74
|
+
if ($[8] !== enabledRelations) {
|
|
75
|
+
t4 = _jsx(RelationshipDrawer, {
|
|
76
|
+
enabledCollectionSlugs: enabledRelations
|
|
77
|
+
});
|
|
78
|
+
$[8] = enabledRelations;
|
|
79
|
+
$[9] = t4;
|
|
80
|
+
} else {
|
|
81
|
+
t4 = $[9];
|
|
82
|
+
}
|
|
83
|
+
return t4;
|
|
67
84
|
};
|
|
68
85
|
function _temp(t0) {
|
|
69
86
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","config","t1","collections","enabledRelations","enabledCollections","disabledCollections","t2","t3","slug","includes","filter","map","_temp","hasNodes","Error","registerCommand","_temp2","_jsx","enabledCollectionSlugs","slug_0","payload","selection","relationshipNode","focus","focusNode","getNode","__first","remove"],"sources":["../../../../../src/features/relationship/client/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../../typesClient.js'\nimport type { RelationshipFeatureProps } from '../../server/index.js'\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const {\n config: { collections },\n } = useConfig()\n\n let enabledRelations: null | string[] = null\n\n if (clientProps?.enabledCollections) {\n enabledRelations = clientProps?.enabledCollections\n } else if (clientProps?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !clientProps?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const relationshipNode = $createRelationshipNode(payload)\n // we need to get the focus node before inserting the block node, as $insertNodeToNearestRoot can change the focus node\n const { focus } = selection\n const focusNode = focus.getNode()\n // Insert relationship node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(relationshipNode)\n\n // Delete the node it it's an empty paragraph\n if ($isParagraphNode(focusNode) && !focusNode.__first) {\n focusNode.remove()\n }\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,wBAAwB,QAAQ;AACzC,SAASC,SAAS,QAAQ;AAC1B,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR;AACP,SAASC,SAAS,QAAQ;AAM1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ;AAE1D,OAAO,MAAMC,2BAAA,GAAgEL,aAAA,CAC3E;AAGF,OAAO,MAAMM,kBAAA,GAAgEC,EAAA;EAAA,MAAAC,CAAA,GAAAjB,EAAA;EAAC;IAAAkB;EAAA,IAAAF,EAAe;EAC3F,OAAAG,MAAA,IAAiBlB,yBAAA;EACjB;IAAAmB,MAAA,EAAAC;EAAA,IAEIlB,SAAA;EADM;IAAAmB;EAAA,IAAAD,EAAe;EAGzB,IAAAE,gBAAA;EAAwC,IAEpCL,WAAA,EAAAM,kBAAA;IACFD,gBAAA,CAAAA,CAAA,CAAmBL,WAAA,EAAAM,kBAAA;EAAnB;IAAA,IACSN,WAAA,EAAAO,mBAAA;MAAA,IAAAC,EAAA;MAAA,IAAAT,CAAA,QAAAC,WAAA,EAAAO,mBAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","t0","$","clientProps","editor","config","t1","collections","enabledRelations","enabledCollections","disabledCollections","t2","t3","t4","slug","includes","filter","map","_temp","hasNodes","Error","registerCommand","_temp2","_jsx","enabledCollectionSlugs","slug_0","payload","selection","relationshipNode","focus","focusNode","getNode","__first","remove"],"sources":["../../../../../src/features/relationship/client/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../../typesClient.js'\nimport type { RelationshipFeatureProps } from '../../server/index.js'\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const {\n config: { collections },\n } = useConfig()\n\n let enabledRelations: null | string[] = null\n\n if (clientProps?.enabledCollections) {\n enabledRelations = clientProps?.enabledCollections\n } else if (clientProps?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !clientProps?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const relationshipNode = $createRelationshipNode(payload)\n // we need to get the focus node before inserting the block node, as $insertNodeToNearestRoot can change the focus node\n const { focus } = selection\n const focusNode = focus.getNode()\n // Insert relationship node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(relationshipNode)\n\n // Delete the node it it's an empty paragraph\n if ($isParagraphNode(focusNode) && !focusNode.__first) {\n focusNode.remove()\n }\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,wBAAwB,QAAQ;AACzC,SAASC,SAAS,QAAQ;AAC1B,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR;AACP,SAASC,SAAS,QAAQ;AAM1B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ;AAE1D,OAAO,MAAMC,2BAAA,GAAgEL,aAAA,CAC3E;AAGF,OAAO,MAAMM,kBAAA,GAAgEC,EAAA;EAAA,MAAAC,CAAA,GAAAjB,EAAA;EAAC;IAAAkB;EAAA,IAAAF,EAAe;EAC3F,OAAAG,MAAA,IAAiBlB,yBAAA;EACjB;IAAAmB,MAAA,EAAAC;EAAA,IAEIlB,SAAA;EADM;IAAAmB;EAAA,IAAAD,EAAe;EAGzB,IAAAE,gBAAA;EAAwC,IAEpCL,WAAA,EAAAM,kBAAA;IACFD,gBAAA,CAAAA,CAAA,CAAmBL,WAAA,EAAAM,kBAAA;EAAnB;IAAA,IACSN,WAAA,EAAAO,mBAAA;MAAA,IAAAC,EAAA;MAAA,IAAAT,CAAA,QAAAC,WAAA,EAAAO,mBAAA,IAAAR,C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6E,SAAAK,MAAAjB,EAAA;EAajE;IAAAa,IAAA,EAAAW;EAAA,IAAAxB,EAAQ;EAAA,OAAKa,MAAA;AAAA;AAboD,SAAAQ,OAAAI,OAAA;EAwBrE,MAAAC,SAAA,GAAkBrC,aAAA,MAAmBD,qBAAA;EAAA,IAEjCG,iBAAA,CAAkBmC,SAAA;IACpB,MAAAC,gBAAA,GAAyB/B,uBAAA,CAAwB6B,OAAA;IAEjD;MAAAG;IAAA,IAAkBF,SAAA;IAClB,MAAAG,SAAA,GAAkBD,KAAA,CAAAE,OAAA,CAAa;IAE/B5C,wBAAA,CAAyByC,gBAAA;IAAA,IAGrBrC,gBAAA,CAAiBuC,SAAA,MAAeA,SAAA,CAAAE,OAAiB;MACnDF,SAAA,CAAAG,MAAA,CAAgB;IAAA;EAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -22,13 +22,29 @@ const filterRichTextCollections = (collections, options) => {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
export const EnabledRelationshipsCondition = props => {
|
|
25
|
-
const $ = _c(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const $ = _c(20);
|
|
26
|
+
let FallbackComponent;
|
|
27
|
+
let children;
|
|
28
|
+
let rest;
|
|
29
|
+
let t0;
|
|
30
|
+
if ($[0] !== props) {
|
|
31
|
+
({
|
|
32
|
+
children,
|
|
33
|
+
FallbackComponent,
|
|
34
|
+
uploads: t0,
|
|
35
|
+
...rest
|
|
36
|
+
} = props);
|
|
37
|
+
$[0] = props;
|
|
38
|
+
$[1] = FallbackComponent;
|
|
39
|
+
$[2] = children;
|
|
40
|
+
$[3] = rest;
|
|
41
|
+
$[4] = t0;
|
|
42
|
+
} else {
|
|
43
|
+
FallbackComponent = $[1];
|
|
44
|
+
children = $[2];
|
|
45
|
+
rest = $[3];
|
|
46
|
+
t0 = $[4];
|
|
47
|
+
}
|
|
32
48
|
const uploads = t0 === undefined ? false : t0;
|
|
33
49
|
const {
|
|
34
50
|
config: t1
|
|
@@ -43,47 +59,56 @@ export const EnabledRelationshipsCondition = props => {
|
|
|
43
59
|
visibleEntities
|
|
44
60
|
} = useEntityVisibility();
|
|
45
61
|
let t2;
|
|
46
|
-
if ($[
|
|
62
|
+
if ($[5] !== collections || $[6] !== uploads || $[7] !== user || $[8] !== visibleEntities) {
|
|
47
63
|
t2 = () => filterRichTextCollections(collections, {
|
|
48
64
|
uploads,
|
|
49
65
|
user,
|
|
50
66
|
visibleEntities
|
|
51
67
|
}).map(_temp);
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
68
|
+
$[5] = collections;
|
|
69
|
+
$[6] = uploads;
|
|
70
|
+
$[7] = user;
|
|
71
|
+
$[8] = visibleEntities;
|
|
72
|
+
$[9] = t2;
|
|
57
73
|
} else {
|
|
58
|
-
t2 = $[
|
|
74
|
+
t2 = $[9];
|
|
59
75
|
}
|
|
60
76
|
const [enabledCollectionSlugs] = React.useState(t2);
|
|
61
77
|
if (!enabledCollectionSlugs.length) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
78
|
+
let t3;
|
|
79
|
+
if ($[10] !== FallbackComponent || $[11] !== rest) {
|
|
80
|
+
t3 = FallbackComponent ? _jsx(FallbackComponent, {
|
|
81
|
+
...rest
|
|
82
|
+
}) : null;
|
|
83
|
+
$[10] = FallbackComponent;
|
|
84
|
+
$[11] = rest;
|
|
85
|
+
$[12] = t3;
|
|
86
|
+
} else {
|
|
87
|
+
t3 = $[12];
|
|
88
|
+
}
|
|
89
|
+
return t3;
|
|
65
90
|
}
|
|
66
91
|
let t3;
|
|
67
|
-
if ($[
|
|
92
|
+
if ($[13] !== children || $[14] !== enabledCollectionSlugs || $[15] !== rest) {
|
|
68
93
|
let t4;
|
|
69
|
-
if ($[
|
|
94
|
+
if ($[17] !== enabledCollectionSlugs || $[18] !== rest) {
|
|
70
95
|
t4 = {
|
|
71
96
|
...rest,
|
|
72
97
|
enabledCollectionSlugs
|
|
73
98
|
};
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
99
|
+
$[17] = enabledCollectionSlugs;
|
|
100
|
+
$[18] = rest;
|
|
101
|
+
$[19] = t4;
|
|
77
102
|
} else {
|
|
78
|
-
t4 = $[
|
|
103
|
+
t4 = $[19];
|
|
79
104
|
}
|
|
80
105
|
t3 = React.cloneElement(children, t4);
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
106
|
+
$[13] = children;
|
|
107
|
+
$[14] = enabledCollectionSlugs;
|
|
108
|
+
$[15] = rest;
|
|
109
|
+
$[16] = t3;
|
|
85
110
|
} else {
|
|
86
|
-
t3 = $[
|
|
111
|
+
t3 = $[16];
|
|
87
112
|
}
|
|
88
113
|
return t3;
|
|
89
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnabledRelationshipsCondition.js","names":["c","_c","useAuth","useConfig","useEntityVisibility","React","filterRichTextCollections","collections","options","filter","slug","admin","enableRichTextRelationship","upload","visibleEntities","includes","uploads","Boolean","EnabledRelationshipsCondition","props","$","
|
|
1
|
+
{"version":3,"file":"EnabledRelationshipsCondition.js","names":["c","_c","useAuth","useConfig","useEntityVisibility","React","filterRichTextCollections","collections","options","filter","slug","admin","enableRichTextRelationship","upload","visibleEntities","includes","uploads","Boolean","EnabledRelationshipsCondition","props","$","FallbackComponent","children","rest","t0","undefined","config","t1","user","t2","map","_temp","enabledCollectionSlugs","useState","length","t3","_jsx","t4","cloneElement"],"sources":["../../../../../src/features/relationship/client/utils/EnabledRelationshipsCondition.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities?: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options?.visibleEntities?.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<{\n children: any\n FallbackComponent?: React.FC\n uploads?: boolean\n}> = (props) => {\n const { children, FallbackComponent, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user: user!, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return FallbackComponent ? <FallbackComponent {...rest} /> : null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,OAAO,EAAEC,SAAS,EAAEC,mBAAmB,QAAQ;AACxD,YAAYC,KAAA,MAAW;AAavB,MAAMC,yBAAA,GAAkDA,CAACC,WAAA,EAAaC,OAAA;EACpE,OAAOD,WAAA,CAAYE,MAAM,CAAC,CAAC;IAAEC,IAAI;IAAEC,KAAA,EAAO;MAAEC;IAA0B,CAAE;IAAEC;EAAM,CAAE;IAChF,IAAI,CAACL,OAAA,EAASM,eAAA,EAAiBP,WAAA,CAAYQ,QAAA,CAASL,IAAA,GAAO;MACzD,OAAO;IACT;IAEA,IAAIF,OAAA,EAASQ,OAAA,EAAS;MACpB,OAAOJ,0BAAA,IAA8BK,OAAA,CAAQJ,MAAA,MAAY;IAC3D;IAEA,OAAOA,MAAA,GAAS,QAAQD,0B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|
key: `clear-style`,
|
|
30
|
-
label:
|
|
30
|
+
label: ({
|
|
31
|
+
i18n
|
|
32
|
+
}) => i18n.t('lexical:textState:defaultStyle'),
|
|
31
33
|
onSelect: ({
|
|
32
34
|
editor
|
|
33
35
|
}) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.client.js","names":["TextStateIcon","createClientFeature","registerTextStates","setTextState","StatePlugin","toolbarGroups","props","items","stateKey","state","key","stateValue","meta","push","ChildComponent","_jsx","css","label","onSelect","editor","clearStyle","undefined","order","type","color","TextStateFeatureClient","plugins","Component","position","toolbarFixed","groups","toolbarInline"],"sources":["../../../src/features/textState/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { ToolbarDropdownGroup, ToolbarGroup } from '../toolbars/types.js'\nimport type { TextStateFeatureProps } from './feature.server.js'\n\nimport { TextStateIcon } from '../../lexical/ui/icons/TextState/index.js'\nimport { createClientFeature } from '../../utilities/createClientFeature.js'\nimport { registerTextStates, setTextState, StatePlugin } from './textState.js'\n\nconst toolbarGroups = (props: TextStateFeatureProps): ToolbarGroup[] => {\n const items: ToolbarDropdownGroup['items'] = []\n\n for (const stateKey in props.state) {\n const key = props.state[stateKey]!\n for (const stateValue in key) {\n const meta = key[stateValue]!\n items.push({\n ChildComponent: () => <TextStateIcon css={meta.css} />,\n key: stateValue,\n label: meta.label,\n onSelect: ({ editor }) => {\n setTextState(editor, stateKey, stateValue)\n },\n })\n }\n }\n\n const clearStyle: ToolbarDropdownGroup['items'] = [\n {\n ChildComponent: () => <TextStateIcon />,\n key: `clear-style`,\n label:
|
|
1
|
+
{"version":3,"file":"feature.client.js","names":["TextStateIcon","createClientFeature","registerTextStates","setTextState","StatePlugin","toolbarGroups","props","items","stateKey","state","key","stateValue","meta","push","ChildComponent","_jsx","css","label","onSelect","editor","clearStyle","i18n","t","undefined","order","type","color","TextStateFeatureClient","plugins","Component","position","toolbarFixed","groups","toolbarInline"],"sources":["../../../src/features/textState/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { ToolbarDropdownGroup, ToolbarGroup } from '../toolbars/types.js'\nimport type { TextStateFeatureProps } from './feature.server.js'\n\nimport { TextStateIcon } from '../../lexical/ui/icons/TextState/index.js'\nimport { createClientFeature } from '../../utilities/createClientFeature.js'\nimport { registerTextStates, setTextState, StatePlugin } from './textState.js'\n\nconst toolbarGroups = (props: TextStateFeatureProps): ToolbarGroup[] => {\n const items: ToolbarDropdownGroup['items'] = []\n\n for (const stateKey in props.state) {\n const key = props.state[stateKey]!\n for (const stateValue in key) {\n const meta = key[stateValue]!\n items.push({\n ChildComponent: () => <TextStateIcon css={meta.css} />,\n key: stateValue,\n label: meta.label,\n onSelect: ({ editor }) => {\n setTextState(editor, stateKey, stateValue)\n },\n })\n }\n }\n\n const clearStyle: ToolbarDropdownGroup['items'] = [\n {\n ChildComponent: () => <TextStateIcon />,\n key: `clear-style`,\n label: ({ i18n }) => i18n.t('lexical:textState:defaultStyle'),\n onSelect: ({ editor }) => {\n for (const stateKey in props.state) {\n setTextState(editor, stateKey, undefined)\n }\n },\n order: 1,\n },\n ]\n\n return [\n {\n type: 'dropdown',\n ChildComponent: () => <TextStateIcon css={{ color: 'var(--theme-elevation-600)' }} />,\n items: [...clearStyle, ...items],\n key: 'textState',\n order: 30,\n },\n ]\n}\n\nexport const TextStateFeatureClient = createClientFeature<TextStateFeatureProps>(({ props }) => {\n registerTextStates(props.state)\n return {\n plugins: [\n {\n Component: StatePlugin,\n position: 'normal',\n },\n ],\n toolbarFixed: {\n groups: toolbarGroups(props),\n },\n toolbarInline: {\n groups: toolbarGroups(props),\n },\n }\n})\n"],"mappings":"AAAA;;;AAKA,SAASA,aAAa,QAAQ;AAC9B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,kBAAkB,EAAEC,YAAY,EAAEC,WAAW,QAAQ;AAE9D,MAAMC,aAAA,GAAiBC,KAAA;EACrB,MAAMC,KAAA,GAAuC,EAAE;EAE/C,KAAK,MAAMC,QAAA,I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,KAAA,CAAMG,KAAK;EAC9B,OAAO;IACLmB,OAAA,EAAS,CACP;MACEC,SAAA,EAAWzB,WAAA;MACX0B,QAAA,EAAU;IACZ,EACD;IACDC,YAAA,EAAc;MACZC,MAAA,EAAQ3B,aAAA,CAAcC,KAAA;IACxB;IACA2B,aAAA,EAAe;MACbD,MAAA,EAAQ3B,aAAA,CAAcC,KAAA;IACxB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/textState/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/textState/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAM7C,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;KAChC,CAAC,IAAI,MAAM,wBAAwB,CAAC,CAAC,EAClC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,GAG5C,SAAS;CACd,CAAC,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,UAAU,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAA;AAEvF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,CAAA;CAC3C,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,gIAe3B,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createServerFeature } from '../../utilities/createServerFeature.js';
|
|
2
|
+
import { i18n } from './i18n.js';
|
|
2
3
|
/**
|
|
3
4
|
* Allows you to store key-value attributes within TextNodes and define inline styles for each combination.
|
|
4
5
|
* Inline styles are not part of the editorState, reducing the JSON size and allowing you to easily migrate or adapt styles later.
|
|
@@ -17,7 +18,8 @@ export const TextStateFeature = createServerFeature({
|
|
|
17
18
|
ClientFeature: '@payloadcms/richtext-lexical/client#TextStateFeatureClient',
|
|
18
19
|
clientFeatureProps: {
|
|
19
20
|
state: props?.state
|
|
20
|
-
}
|
|
21
|
+
},
|
|
22
|
+
i18n
|
|
21
23
|
};
|
|
22
24
|
},
|
|
23
25
|
key: 'textState'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.server.js","names":["createServerFeature","TextStateFeature","feature","props","ClientFeature","clientFeatureProps","state","key"],"sources":["../../../src/features/textState/feature.server.ts"],"sourcesContent":["import type { PropertiesHyphenFallback } from 'csstype'\nimport type { Prettify } from 'ts-essentials'\n\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\n\n// extracted from https://github.com/facebook/lexical/pull/7294\nexport type StyleObject = Prettify<{\n [K in keyof PropertiesHyphenFallback]?:\n | Extract<PropertiesHyphenFallback[K], string>\n // This is simplified to not deal with arrays or numbers.\n // This is an example after all!\n | undefined\n}>\n\nexport type StateValues = { [stateValue: string]: { css: StyleObject; label: string } }\n\nexport type TextStateFeatureProps = {\n /**\n * The keys of the top-level object (stateKeys) represent the attributes that the textNode can have (e.g., color).\n * The values of the top-level object (stateValues) represent the values that the attribute can have (e.g., red, blue, etc.).\n * Within the stateValue, you can define inline styles and labels.\n *\n * @note Because this is a common use case, we provide a defaultColors object with colors that\n * look good in both dark and light mode, which you can use or adapt to your liking.\n *\n *\n *\n * @example\n * import { defaultColors } from '@payloadcms/richtext-lexical'\n *\n * state: {\n * color: {\n * ...defaultColors.background,\n * ...defaultColors.text,\n * // fancy gradients!\n * galaxy: { label: 'Galaxy', css: { background: 'linear-gradient(to right, #0000ff, #ff0000)', color: 'white' } },\n * sunset: { label: 'Sunset', css: { background: 'linear-gradient(to top, #ff5f6d, #6a3093)' } },\n * },\n * // You can have both colored and underlined text at the same time.\n * // If you don't want that, you should group them within the same key.\n * // (just like I did with defaultColors and my fancy gradients)\n * underline: {\n * 'solid': { label: 'Solid', css: { 'text-decoration': 'underline', 'text-underline-offset': '4px' } },\n * // You'll probably want to use the CSS light-dark() utility.\n * 'yellow-dashed': { label: 'Yellow Dashed', css: { 'text-decoration': 'underline dashed', 'text-decoration-color': 'light-dark(#EAB308,yellow)', 'text-underline-offset': '4px' } },\n * },\n * }\n *\n */\n state: { [stateKey: string]: StateValues }\n}\n\n/**\n * Allows you to store key-value attributes within TextNodes and define inline styles for each combination.\n * Inline styles are not part of the editorState, reducing the JSON size and allowing you to easily migrate or adapt styles later.\n *\n * This feature can be used, among other things, to add colors to text.\n *\n * For more information and examples, see the JSdocs for the \"state\" property that this feature receives as a parameter.\n *\n * @experimental There may be breaking changes to this API\n */\nexport const TextStateFeature = createServerFeature<\n TextStateFeatureProps,\n TextStateFeatureProps,\n TextStateFeatureProps\n>({\n feature: ({ props }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#TextStateFeatureClient',\n clientFeatureProps: {\n state: props?.state,\n },\n }\n },\n key: 'textState',\n})\n"],"mappings":"AAGA,SAASA,mBAAmB,QAAQ;
|
|
1
|
+
{"version":3,"file":"feature.server.js","names":["createServerFeature","i18n","TextStateFeature","feature","props","ClientFeature","clientFeatureProps","state","key"],"sources":["../../../src/features/textState/feature.server.ts"],"sourcesContent":["import type { PropertiesHyphenFallback } from 'csstype'\nimport type { Prettify } from 'ts-essentials'\n\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\nimport { i18n } from './i18n.js'\n\n// extracted from https://github.com/facebook/lexical/pull/7294\nexport type StyleObject = Prettify<{\n [K in keyof PropertiesHyphenFallback]?:\n | Extract<PropertiesHyphenFallback[K], string>\n // This is simplified to not deal with arrays or numbers.\n // This is an example after all!\n | undefined\n}>\n\nexport type StateValues = { [stateValue: string]: { css: StyleObject; label: string } }\n\nexport type TextStateFeatureProps = {\n /**\n * The keys of the top-level object (stateKeys) represent the attributes that the textNode can have (e.g., color).\n * The values of the top-level object (stateValues) represent the values that the attribute can have (e.g., red, blue, etc.).\n * Within the stateValue, you can define inline styles and labels.\n *\n * @note Because this is a common use case, we provide a defaultColors object with colors that\n * look good in both dark and light mode, which you can use or adapt to your liking.\n *\n *\n *\n * @example\n * import { defaultColors } from '@payloadcms/richtext-lexical'\n *\n * state: {\n * color: {\n * ...defaultColors.background,\n * ...defaultColors.text,\n * // fancy gradients!\n * galaxy: { label: 'Galaxy', css: { background: 'linear-gradient(to right, #0000ff, #ff0000)', color: 'white' } },\n * sunset: { label: 'Sunset', css: { background: 'linear-gradient(to top, #ff5f6d, #6a3093)' } },\n * },\n * // You can have both colored and underlined text at the same time.\n * // If you don't want that, you should group them within the same key.\n * // (just like I did with defaultColors and my fancy gradients)\n * underline: {\n * 'solid': { label: 'Solid', css: { 'text-decoration': 'underline', 'text-underline-offset': '4px' } },\n * // You'll probably want to use the CSS light-dark() utility.\n * 'yellow-dashed': { label: 'Yellow Dashed', css: { 'text-decoration': 'underline dashed', 'text-decoration-color': 'light-dark(#EAB308,yellow)', 'text-underline-offset': '4px' } },\n * },\n * }\n *\n */\n state: { [stateKey: string]: StateValues }\n}\n\n/**\n * Allows you to store key-value attributes within TextNodes and define inline styles for each combination.\n * Inline styles are not part of the editorState, reducing the JSON size and allowing you to easily migrate or adapt styles later.\n *\n * This feature can be used, among other things, to add colors to text.\n *\n * For more information and examples, see the JSdocs for the \"state\" property that this feature receives as a parameter.\n *\n * @experimental There may be breaking changes to this API\n */\nexport const TextStateFeature = createServerFeature<\n TextStateFeatureProps,\n TextStateFeatureProps,\n TextStateFeatureProps\n>({\n feature: ({ props }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#TextStateFeatureClient',\n clientFeatureProps: {\n state: props?.state,\n },\n i18n,\n }\n },\n key: 'textState',\n})\n"],"mappings":"AAGA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAiDrB;;;;;;;;;;AAUA,OAAO,MAAMC,gBAAA,GAAmBF,mBAAA,CAI9B;EACAG,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoB;QAClBC,KAAA,EAAOH,KAAA,EAAOG;MAChB;MACAN;IACF;EACF;EACAO,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/features/textState/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAoC1C,CAAA"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export const i18n = {
|
|
2
|
+
ar: {
|
|
3
|
+
defaultStyle: 'النمط الافتراضي'
|
|
4
|
+
},
|
|
5
|
+
az: {
|
|
6
|
+
defaultStyle: 'Defolt üslub'
|
|
7
|
+
},
|
|
8
|
+
bg: {
|
|
9
|
+
defaultStyle: 'Стандартен стил'
|
|
10
|
+
},
|
|
11
|
+
cs: {
|
|
12
|
+
defaultStyle: 'Výchozí styl'
|
|
13
|
+
},
|
|
14
|
+
da: {
|
|
15
|
+
defaultStyle: 'Standardstil'
|
|
16
|
+
},
|
|
17
|
+
de: {
|
|
18
|
+
defaultStyle: 'Standardstil'
|
|
19
|
+
},
|
|
20
|
+
en: {
|
|
21
|
+
defaultStyle: 'Default style'
|
|
22
|
+
},
|
|
23
|
+
es: {
|
|
24
|
+
defaultStyle: 'Estilo predeterminado'
|
|
25
|
+
},
|
|
26
|
+
et: {
|
|
27
|
+
defaultStyle: 'Vaikimisi stiil'
|
|
28
|
+
},
|
|
29
|
+
fa: {
|
|
30
|
+
defaultStyle: 'سبک پیشفرض'
|
|
31
|
+
},
|
|
32
|
+
fr: {
|
|
33
|
+
defaultStyle: 'Style par défaut'
|
|
34
|
+
},
|
|
35
|
+
he: {
|
|
36
|
+
defaultStyle: 'סגנון ברירת מחדל'
|
|
37
|
+
},
|
|
38
|
+
hr: {
|
|
39
|
+
defaultStyle: 'Zadani stil'
|
|
40
|
+
},
|
|
41
|
+
hu: {
|
|
42
|
+
defaultStyle: 'Alapértelmezett stílus'
|
|
43
|
+
},
|
|
44
|
+
it: {
|
|
45
|
+
defaultStyle: 'Stile predefinito'
|
|
46
|
+
},
|
|
47
|
+
ja: {
|
|
48
|
+
defaultStyle: 'デフォルトスタイル'
|
|
49
|
+
},
|
|
50
|
+
ko: {
|
|
51
|
+
defaultStyle: '기본 스타일'
|
|
52
|
+
},
|
|
53
|
+
my: {
|
|
54
|
+
defaultStyle: 'Gaya lalai'
|
|
55
|
+
},
|
|
56
|
+
nb: {
|
|
57
|
+
defaultStyle: 'Standardstil'
|
|
58
|
+
},
|
|
59
|
+
nl: {
|
|
60
|
+
defaultStyle: 'Standaardstijl'
|
|
61
|
+
},
|
|
62
|
+
pl: {
|
|
63
|
+
defaultStyle: 'Domyślny styl'
|
|
64
|
+
},
|
|
65
|
+
pt: {
|
|
66
|
+
defaultStyle: 'Estilo padrão'
|
|
67
|
+
},
|
|
68
|
+
ro: {
|
|
69
|
+
defaultStyle: 'Stil implicit'
|
|
70
|
+
},
|
|
71
|
+
rs: {
|
|
72
|
+
defaultStyle: 'Подразумевани стил'
|
|
73
|
+
},
|
|
74
|
+
'rs-latin': {
|
|
75
|
+
defaultStyle: 'Podrazumevani stil'
|
|
76
|
+
},
|
|
77
|
+
ru: {
|
|
78
|
+
defaultStyle: 'Стиль по умолчанию'
|
|
79
|
+
},
|
|
80
|
+
sk: {
|
|
81
|
+
defaultStyle: 'Predvolený štýl'
|
|
82
|
+
},
|
|
83
|
+
sl: {
|
|
84
|
+
defaultStyle: 'Privzeti slog'
|
|
85
|
+
},
|
|
86
|
+
sv: {
|
|
87
|
+
defaultStyle: 'Standardstil'
|
|
88
|
+
},
|
|
89
|
+
th: {
|
|
90
|
+
defaultStyle: 'สไตล์เริ่มต้น'
|
|
91
|
+
},
|
|
92
|
+
tr: {
|
|
93
|
+
defaultStyle: 'Varsayılan stil'
|
|
94
|
+
},
|
|
95
|
+
uk: {
|
|
96
|
+
defaultStyle: 'Стиль за замовчуванням'
|
|
97
|
+
},
|
|
98
|
+
vi: {
|
|
99
|
+
defaultStyle: 'Kiểu mặc định'
|
|
100
|
+
},
|
|
101
|
+
zh: {
|
|
102
|
+
defaultStyle: '默认样式'
|
|
103
|
+
},
|
|
104
|
+
'zh-TW': {
|
|
105
|
+
defaultStyle: '預設樣式'
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["i18n","ar","defaultStyle","az","bg","cs","da","de","en","es","et","fa","fr","he","hr","hu","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sl","sv","th","tr","uk","vi","zh"],"sources":["../../../src/features/textState/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: { defaultStyle: 'النمط الافتراضي' },\n az: { defaultStyle: 'Defolt üslub' },\n bg: { defaultStyle: 'Стандартен стил' },\n cs: { defaultStyle: 'Výchozí styl' },\n da: { defaultStyle: 'Standardstil' },\n de: { defaultStyle: 'Standardstil' },\n en: { defaultStyle: 'Default style' },\n es: { defaultStyle: 'Estilo predeterminado' },\n et: { defaultStyle: 'Vaikimisi stiil' },\n fa: { defaultStyle: 'سبک پیشفرض' },\n fr: { defaultStyle: 'Style par défaut' },\n he: { defaultStyle: 'סגנון ברירת מחדל' },\n hr: { defaultStyle: 'Zadani stil' },\n hu: { defaultStyle: 'Alapértelmezett stílus' },\n it: { defaultStyle: 'Stile predefinito' },\n ja: { defaultStyle: 'デフォルトスタイル' },\n ko: { defaultStyle: '기본 스타일' },\n my: { defaultStyle: 'Gaya lalai' },\n nb: { defaultStyle: 'Standardstil' },\n nl: { defaultStyle: 'Standaardstijl' },\n pl: { defaultStyle: 'Domyślny styl' },\n pt: { defaultStyle: 'Estilo padrão' },\n ro: { defaultStyle: 'Stil implicit' },\n rs: { defaultStyle: 'Подразумевани стил' },\n 'rs-latin': { defaultStyle: 'Podrazumevani stil' },\n ru: { defaultStyle: 'Стиль по умолчанию' },\n sk: { defaultStyle: 'Predvolený štýl' },\n sl: { defaultStyle: 'Privzeti slog' },\n sv: { defaultStyle: 'Standardstil' },\n th: { defaultStyle: 'สไตล์เริ่มต้น' },\n tr: { defaultStyle: 'Varsayılan stil' },\n uk: { defaultStyle: 'Стиль за замовчуванням' },\n vi: { defaultStyle: 'Kiểu mặc định' },\n zh: { defaultStyle: '默认样式' },\n 'zh-TW': { defaultStyle: '預設樣式' },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,IAAA,GAAkC;EAC7CC,EAAA,EAAI;IAAEC,YAAA,EAAc;EAAkB;EACtCC,EAAA,EAAI;IAAED,YAAA,EAAc;EAAe;EACnCE,EAAA,EAAI;IAAEF,YAAA,EAAc;EAAkB;EACtCG,EAAA,EAAI;IAAEH,YAAA,EAAc;EAAe;EACnCI,EAAA,EAAI;IAAEJ,YAAA,EAAc;EAAe;EACnCK,EAAA,EAAI;IAAEL,YAAA,EAAc;EAAe;EACnCM,EAAA,EAAI;IAAEN,YAAA,EAAc;EAAgB;EACpCO,EAAA,EAAI;IAAEP,YAAA,EAAc;EAAwB;EAC5CQ,EAAA,EAAI;IAAER,YAAA,EAAc;EAAkB;EACtCS,EAAA,EAAI;IAAET,YAAA,EAAc;EAAc;EAClCU,EAAA,EAAI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useState(t1);
|
|
29
29
|
const deferredState = useDeferredValue(_state);
|
|
30
30
|
const editorConfigContext = useEditorConfigContext();
|
|
31
|
-
|
|
32
|
-
const t3 = deferredState.
|
|
33
|
-
const t4 =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
$[
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
31
|
+
let t2;
|
|
32
|
+
const t3 = !deferredState.enabled ? "disabled" : "";
|
|
33
|
+
const t4 = deferredState.active ? "active" : "";
|
|
34
|
+
const t5 = item.key ? `${baseClass}-${item.key}` : "";
|
|
35
|
+
let t6;
|
|
36
|
+
if ($[1] !== t3 || $[2] !== t4 || $[3] !== t5) {
|
|
37
|
+
t6 = [baseClass, t3, t4, t5].filter(Boolean);
|
|
38
|
+
$[1] = t3;
|
|
39
|
+
$[2] = t4;
|
|
40
|
+
$[3] = t5;
|
|
41
|
+
$[4] = t6;
|
|
41
42
|
} else {
|
|
42
|
-
|
|
43
|
+
t6 = $[4];
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
t2 = t6.join(" ");
|
|
46
|
+
const className = t2;
|
|
47
|
+
let t7;
|
|
46
48
|
if ($[5] !== editor || $[6] !== editorConfigContext || $[7] !== item) {
|
|
47
|
-
|
|
49
|
+
t7 = () => {
|
|
48
50
|
editor.getEditorState().read(() => {
|
|
49
51
|
const selection = $getSelection();
|
|
50
52
|
if (!selection) {
|
|
@@ -74,16 +76,16 @@ export const ToolbarButton = t0 => {
|
|
|
74
76
|
$[5] = editor;
|
|
75
77
|
$[6] = editorConfigContext;
|
|
76
78
|
$[7] = item;
|
|
77
|
-
$[8] =
|
|
79
|
+
$[8] = t7;
|
|
78
80
|
} else {
|
|
79
|
-
|
|
81
|
+
t7 = $[8];
|
|
80
82
|
}
|
|
81
|
-
const updateStates =
|
|
83
|
+
const updateStates = t7;
|
|
82
84
|
const runDeprioritized = useRunDeprioritized();
|
|
83
|
-
let t7;
|
|
84
85
|
let t8;
|
|
86
|
+
let t9;
|
|
85
87
|
if ($[9] !== editor || $[10] !== runDeprioritized || $[11] !== updateStates) {
|
|
86
|
-
|
|
88
|
+
t8 = () => {
|
|
87
89
|
runDeprioritized(updateStates);
|
|
88
90
|
const listener = () => runDeprioritized(updateStates);
|
|
89
91
|
const cleanup = mergeRegister(editor.registerUpdateListener(listener));
|
|
@@ -93,20 +95,20 @@ export const ToolbarButton = t0 => {
|
|
|
93
95
|
document.removeEventListener("mouseup", listener);
|
|
94
96
|
};
|
|
95
97
|
};
|
|
96
|
-
|
|
98
|
+
t9 = [editor, runDeprioritized, updateStates];
|
|
97
99
|
$[9] = editor;
|
|
98
100
|
$[10] = runDeprioritized;
|
|
99
101
|
$[11] = updateStates;
|
|
100
|
-
$[12] =
|
|
101
|
-
$[13] =
|
|
102
|
+
$[12] = t8;
|
|
103
|
+
$[13] = t9;
|
|
102
104
|
} else {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
t8 = $[12];
|
|
106
|
+
t9 = $[13];
|
|
105
107
|
}
|
|
106
|
-
useEffect(
|
|
107
|
-
let
|
|
108
|
+
useEffect(t8, t9);
|
|
109
|
+
let t10;
|
|
108
110
|
if ($[14] !== _state || $[15] !== editor || $[16] !== item) {
|
|
109
|
-
|
|
111
|
+
t10 = () => {
|
|
110
112
|
if (!_state.enabled) {
|
|
111
113
|
return;
|
|
112
114
|
}
|
|
@@ -121,15 +123,15 @@ export const ToolbarButton = t0 => {
|
|
|
121
123
|
$[14] = _state;
|
|
122
124
|
$[15] = editor;
|
|
123
125
|
$[16] = item;
|
|
124
|
-
$[17] =
|
|
126
|
+
$[17] = t10;
|
|
125
127
|
} else {
|
|
126
|
-
|
|
128
|
+
t10 = $[17];
|
|
127
129
|
}
|
|
128
|
-
const handleClick =
|
|
130
|
+
const handleClick = t10;
|
|
129
131
|
const handleMouseDown = _temp2;
|
|
130
|
-
let
|
|
132
|
+
let t11;
|
|
131
133
|
if ($[18] !== children || $[19] !== className || $[20] !== handleClick || $[21] !== item.key) {
|
|
132
|
-
|
|
134
|
+
t11 = _jsx("button", {
|
|
133
135
|
className,
|
|
134
136
|
"data-button-key": item.key,
|
|
135
137
|
onClick: handleClick,
|
|
@@ -141,11 +143,11 @@ export const ToolbarButton = t0 => {
|
|
|
141
143
|
$[19] = className;
|
|
142
144
|
$[20] = handleClick;
|
|
143
145
|
$[21] = item.key;
|
|
144
|
-
$[22] =
|
|
146
|
+
$[22] = t11;
|
|
145
147
|
} else {
|
|
146
|
-
|
|
148
|
+
t11 = $[22];
|
|
147
149
|
}
|
|
148
|
-
return
|
|
150
|
+
return t11;
|
|
149
151
|
};
|
|
150
152
|
function _temp() {
|
|
151
153
|
$addUpdateTag("toolbar");
|