@webiny/app-headless-cms 6.4.0-beta.2 → 6.4.0-beta.3

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.
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { LexicalEditor as BaseLexicalEditor } from "@webiny/app-admin";
3
+ export type LexicalEditorProps = Omit<BaseLexicalEditor.Props, "theme">;
4
+ export declare const LexicalEditor: (props: LexicalEditorProps) => React.JSX.Element;
@@ -19,7 +19,7 @@ const styles = {
19
19
  maxHeight: 350
20
20
  };
21
21
  const toolbar = /*#__PURE__*/ react.createElement(StaticToolbar, null);
22
- const LexicalCmsEditor = (props)=>/*#__PURE__*/ react.createElement(LexicalEditor, {
22
+ const LexicalEditor_LexicalEditor = (props)=>/*#__PURE__*/ react.createElement(LexicalEditor, {
23
23
  ...props,
24
24
  focus: true,
25
25
  staticToolbar: toolbar,
@@ -29,6 +29,6 @@ const LexicalCmsEditor = (props)=>/*#__PURE__*/ react.createElement(LexicalEdito
29
29
  contentEditableStyles: contentEditableStyles,
30
30
  styles: styles
31
31
  });
32
- export { LexicalCmsEditor };
32
+ export { LexicalEditor_LexicalEditor as LexicalEditor };
33
33
 
34
- //# sourceMappingURL=LexicalCmsEditor.js.map
34
+ //# sourceMappingURL=LexicalEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin/components/LexicalCmsEditor/LexicalEditor.js","sources":["../../../../src/admin/components/LexicalCmsEditor/LexicalEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { StaticToolbar } from \"@webiny/lexical-editor\";\nimport { LexicalEditor as BaseLexicalEditor } from \"@webiny/app-admin\";\n\nconst placeholderStyles: React.CSSProperties = { position: \"absolute\", top: 40, left: 25 };\n\nconst contentEditableStyles: React.CSSProperties = {\n minHeight: 200,\n display: \"block\",\n padding: 10\n};\n\nconst styles: React.CSSProperties = {\n backgroundColor: \"#fff\",\n border: \"1px solid #e1e1e1\",\n padding: \"10px 14px\",\n minHeight: 200,\n maxHeight: 350\n};\n\nconst toolbar = <StaticToolbar />;\n\nexport type LexicalEditorProps = Omit<BaseLexicalEditor.Props, \"theme\">;\n\nexport const LexicalEditor = (props: LexicalEditorProps) => {\n return (\n <BaseLexicalEditor\n {...props}\n focus={true}\n staticToolbar={toolbar}\n tag={\"p\"}\n placeholder={props?.placeholder || \"Enter your text here...\"}\n placeholderStyles={placeholderStyles}\n contentEditableStyles={contentEditableStyles}\n styles={styles}\n />\n );\n};\n"],"names":["placeholderStyles","contentEditableStyles","styles","toolbar","StaticToolbar","LexicalEditor","props","BaseLexicalEditor"],"mappings":";;;AAIA,MAAMA,oBAAyC;IAAE,UAAU;IAAY,KAAK;IAAI,MAAM;AAAG;AAEzF,MAAMC,wBAA6C;IAC/C,WAAW;IACX,SAAS;IACT,SAAS;AACb;AAEA,MAAMC,SAA8B;IAChC,iBAAiB;IACjB,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;AACf;AAEA,MAAMC,UAAU,WAAHA,GAAG,oBAACC,eAAaA;AAIvB,MAAMC,8BAAgB,CAACC,QACnB,WAAP,GACI,oBAACC,eAAiBA;QACb,GAAGD,KAAK;QACT,OAAO;QACP,eAAeH;QACf,KAAK;QACL,aAAaG,OAAO,eAAe;QACnC,mBAAmBN;QACnB,uBAAuBC;QACvB,QAAQC"}
@@ -3,7 +3,7 @@ import get from "lodash/get.js";
3
3
  import { i18n } from "@webiny/app/i18n/index.js";
4
4
  import { FormComponentDescription, FormComponentLabel, FormComponentNote } from "@webiny/admin-ui";
5
5
  import { useForm } from "@webiny/form";
6
- import { LexicalCmsEditor } from "../../../components/LexicalCmsEditor/LexicalCmsEditor.js";
6
+ import { LexicalEditor } from "../../../components/LexicalCmsEditor/LexicalEditor.js";
7
7
  import { useFieldEffectiveRules, useModelField } from "@webiny/app-headless-cms-common";
8
8
  const t = i18n.ns("app-headless-cms/admin/fields/rich-text");
9
9
  const getKey = (id, field)=>{
@@ -37,7 +37,7 @@ const lexicalTextInput_plugin = {
37
37
  }), /*#__PURE__*/ react.createElement(FormComponentDescription, {
38
38
  text: field.description,
39
39
  disabled: disabled
40
- }), /*#__PURE__*/ react.createElement(LexicalCmsEditor, {
40
+ }), /*#__PURE__*/ react.createElement(LexicalEditor, {
41
41
  disabled: disabled,
42
42
  value: bind.value,
43
43
  onChange: bind.onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js","sources":["../../../../../src/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { FormComponentLabel } from \"@webiny/admin-ui\";\nimport { FormComponentNote } from \"@webiny/admin-ui\";\nimport { FormComponentDescription } from \"@webiny/admin-ui\";\nimport type { CmsModelFieldRendererPlugin, CmsModelField } from \"~/types.js\";\nimport { useForm } from \"@webiny/form\";\nimport { LexicalCmsEditor } from \"~/admin/components/LexicalCmsEditor/LexicalCmsEditor.js\";\nimport { useFieldEffectiveRules, useModelField } from \"@webiny/app-headless-cms-common\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/fields/rich-text\");\n\nconst getKey = (id: string | undefined, field: CmsModelField): string => {\n const formId = id || \"new\";\n return `${formId}.${field.fieldId}`;\n};\n\nconst plugin: CmsModelFieldRendererPlugin = {\n type: \"cms-editor-field-renderer\",\n name: \"cms-editor-field-renderer-lexical\",\n renderer: {\n rendererName: \"lexical-text-input\",\n name: t`Lexical Text Input`,\n description: t`Renders a lexical text editor.`,\n canUse({ field }) {\n return [\n field.type === \"rich-text\",\n !field.list,\n !get(field, \"predefinedValues.enabled\")\n ].every(Boolean);\n },\n render({ getBind }) {\n const { field } = useModelField();\n const rules = useFieldEffectiveRules(field);\n const form = useForm();\n\n const Bind = getBind();\n\n const disabled = !rules.canEdit || rules.disabled;\n\n return (\n <Bind>\n {bind => {\n return (\n <Bind.ValidationContainer>\n <FormComponentLabel\n text={field.label}\n hint={field.help}\n disabled={disabled}\n />\n <FormComponentDescription\n text={field.description}\n disabled={disabled}\n />\n <LexicalCmsEditor\n disabled={disabled}\n value={bind.value}\n onChange={bind.onChange}\n key={getKey(form.data.id, field)}\n placeholder={field.placeholder}\n data-testid={`fr.input.lexical.${field.label}`}\n />\n {field.note ? (\n <FormComponentNote text={field.note} disabled={disabled} />\n ) : null}\n </Bind.ValidationContainer>\n );\n }}\n </Bind>\n );\n }\n }\n};\n\nexport default plugin;\n"],"names":["t","i18n","getKey","id","field","formId","plugin","get","Boolean","getBind","useModelField","rules","useFieldEffectiveRules","form","useForm","Bind","disabled","bind","FormComponentLabel","FormComponentDescription","LexicalCmsEditor","FormComponentNote"],"mappings":";;;;;;;AAWA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,SAAS,CAACC,IAAwBC;IACpC,MAAMC,SAASF,MAAM;IACrB,OAAO,GAAGE,OAAO,CAAC,EAAED,MAAM,OAAO,EAAE;AACvC;AAEA,MAAME,0BAAsC;IACxC,MAAM;IACN,MAAM;IACN,UAAU;QACN,cAAc;QACd,MAAMN,CAAC,CAAC,kBAAkB,CAAC;QAC3B,aAAaA,CAAC,CAAC,8BAA8B,CAAC;QAC9C,QAAO,EAAEI,KAAK,EAAE;YACZ,OAAO;gBACY,gBAAfA,MAAM,IAAI;gBACV,CAACA,MAAM,IAAI;gBACX,CAACG,IAAIH,OAAO;aACf,CAAC,KAAK,CAACI;QACZ;QACA,QAAO,EAAEC,OAAO,EAAE;YACd,MAAM,EAAEL,KAAK,EAAE,GAAGM;YAClB,MAAMC,QAAQC,uBAAuBR;YACrC,MAAMS,OAAOC;YAEb,MAAMC,OAAON;YAEb,MAAMO,WAAW,CAACL,MAAM,OAAO,IAAIA,MAAM,QAAQ;YAEjD,OAAO,WAAP,GACI,oBAACI,MAAAA,MACIE,CAAAA,OACU,WAAP,GACI,oBAACF,KAAK,mBAAmB,sBACrB,oBAACG,oBAAkBA;oBACf,MAAMd,MAAM,KAAK;oBACjB,MAAMA,MAAM,IAAI;oBAChB,UAAUY;kCAEd,oBAACG,0BAAwBA;oBACrB,MAAMf,MAAM,WAAW;oBACvB,UAAUY;kCAEd,oBAACI,kBAAgBA;oBACb,UAAUJ;oBACV,OAAOC,KAAK,KAAK;oBACjB,UAAUA,KAAK,QAAQ;oBACvB,KAAKf,OAAOW,KAAK,IAAI,CAAC,EAAE,EAAET;oBAC1B,aAAaA,MAAM,WAAW;oBAC9B,eAAa,CAAC,iBAAiB,EAAEA,MAAM,KAAK,EAAE;oBAEjDA,MAAM,IAAI,GAAG,WAAH,GACP,oBAACiB,mBAAiBA;oBAAC,MAAMjB,MAAM,IAAI;oBAAE,UAAUY;qBAC/C;QAM5B;IACJ;AACJ;AAEA,yBAAeV"}
1
+ {"version":3,"file":"admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js","sources":["../../../../../src/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { FormComponentLabel } from \"@webiny/admin-ui\";\nimport { FormComponentNote } from \"@webiny/admin-ui\";\nimport { FormComponentDescription } from \"@webiny/admin-ui\";\nimport type { CmsModelFieldRendererPlugin, CmsModelField } from \"~/types.js\";\nimport { useForm } from \"@webiny/form\";\nimport { LexicalEditor } from \"~/admin/components/LexicalCmsEditor/LexicalEditor.js\";\nimport { useFieldEffectiveRules, useModelField } from \"@webiny/app-headless-cms-common\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/fields/rich-text\");\n\nconst getKey = (id: string | undefined, field: CmsModelField): string => {\n const formId = id || \"new\";\n return `${formId}.${field.fieldId}`;\n};\n\nconst plugin: CmsModelFieldRendererPlugin = {\n type: \"cms-editor-field-renderer\",\n name: \"cms-editor-field-renderer-lexical\",\n renderer: {\n rendererName: \"lexical-text-input\",\n name: t`Lexical Text Input`,\n description: t`Renders a lexical text editor.`,\n canUse({ field }) {\n return [\n field.type === \"rich-text\",\n !field.list,\n !get(field, \"predefinedValues.enabled\")\n ].every(Boolean);\n },\n render({ getBind }) {\n const { field } = useModelField();\n const rules = useFieldEffectiveRules(field);\n const form = useForm();\n\n const Bind = getBind();\n\n const disabled = !rules.canEdit || rules.disabled;\n\n return (\n <Bind>\n {bind => {\n return (\n <Bind.ValidationContainer>\n <FormComponentLabel\n text={field.label}\n hint={field.help}\n disabled={disabled}\n />\n <FormComponentDescription\n text={field.description}\n disabled={disabled}\n />\n <LexicalEditor\n disabled={disabled}\n value={bind.value}\n onChange={bind.onChange}\n key={getKey(form.data.id, field)}\n placeholder={field.placeholder}\n data-testid={`fr.input.lexical.${field.label}`}\n />\n {field.note ? (\n <FormComponentNote text={field.note} disabled={disabled} />\n ) : null}\n </Bind.ValidationContainer>\n );\n }}\n </Bind>\n );\n }\n }\n};\n\nexport default plugin;\n"],"names":["t","i18n","getKey","id","field","formId","plugin","get","Boolean","getBind","useModelField","rules","useFieldEffectiveRules","form","useForm","Bind","disabled","bind","FormComponentLabel","FormComponentDescription","LexicalEditor","FormComponentNote"],"mappings":";;;;;;;AAWA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,SAAS,CAACC,IAAwBC;IACpC,MAAMC,SAASF,MAAM;IACrB,OAAO,GAAGE,OAAO,CAAC,EAAED,MAAM,OAAO,EAAE;AACvC;AAEA,MAAME,0BAAsC;IACxC,MAAM;IACN,MAAM;IACN,UAAU;QACN,cAAc;QACd,MAAMN,CAAC,CAAC,kBAAkB,CAAC;QAC3B,aAAaA,CAAC,CAAC,8BAA8B,CAAC;QAC9C,QAAO,EAAEI,KAAK,EAAE;YACZ,OAAO;gBACY,gBAAfA,MAAM,IAAI;gBACV,CAACA,MAAM,IAAI;gBACX,CAACG,IAAIH,OAAO;aACf,CAAC,KAAK,CAACI;QACZ;QACA,QAAO,EAAEC,OAAO,EAAE;YACd,MAAM,EAAEL,KAAK,EAAE,GAAGM;YAClB,MAAMC,QAAQC,uBAAuBR;YACrC,MAAMS,OAAOC;YAEb,MAAMC,OAAON;YAEb,MAAMO,WAAW,CAACL,MAAM,OAAO,IAAIA,MAAM,QAAQ;YAEjD,OAAO,WAAP,GACI,oBAACI,MAAAA,MACIE,CAAAA,OACU,WAAP,GACI,oBAACF,KAAK,mBAAmB,sBACrB,oBAACG,oBAAkBA;oBACf,MAAMd,MAAM,KAAK;oBACjB,MAAMA,MAAM,IAAI;oBAChB,UAAUY;kCAEd,oBAACG,0BAAwBA;oBACrB,MAAMf,MAAM,WAAW;oBACvB,UAAUY;kCAEd,oBAACI,eAAaA;oBACV,UAAUJ;oBACV,OAAOC,KAAK,KAAK;oBACjB,UAAUA,KAAK,QAAQ;oBACvB,KAAKf,OAAOW,KAAK,IAAI,CAAC,EAAE,EAAET;oBAC1B,aAAaA,MAAM,WAAW;oBAC9B,eAAa,CAAC,iBAAiB,EAAEA,MAAM,KAAK,EAAE;oBAEjDA,MAAM,IAAI,GAAG,WAAH,GACP,oBAACiB,mBAAiBA;oBAAC,MAAMjB,MAAM,IAAI;oBAAE,UAAUY;qBAC/C;QAM5B;IACJ;AACJ;AAEA,yBAAeV"}
@@ -3,7 +3,7 @@ import get from "lodash/get.js";
3
3
  import { i18n } from "@webiny/app/i18n/index.js";
4
4
  import { ReactComponent } from "@webiny/icons/delete_outline.svg";
5
5
  import DynamicSection from "../DynamicSection.js";
6
- import { LexicalCmsEditor } from "../../../components/LexicalCmsEditor/LexicalCmsEditor.js";
6
+ import { LexicalEditor } from "../../../components/LexicalCmsEditor/LexicalEditor.js";
7
7
  import { useForm } from "@webiny/form";
8
8
  import { MultiValueRendererSettings } from "../MultiValueRendererSettings.js";
9
9
  import { IconButton } from "@webiny/admin-ui";
@@ -37,7 +37,7 @@ const lexicalTextInputs_plugin = {
37
37
  disabled: disabled
38
38
  }, ({ bind, index })=>/*#__PURE__*/ react.createElement("div", {
39
39
  className: "relative"
40
- }, /*#__PURE__*/ react.createElement(LexicalCmsEditor, {
40
+ }, /*#__PURE__*/ react.createElement(LexicalEditor, {
41
41
  disabled: disabled,
42
42
  value: bind.index.value,
43
43
  onChange: bind.index.onChange,
@@ -1 +1 @@
1
- {"version":3,"file":"admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js","sources":["../../../../../src/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport type { CmsModelField, CmsModelFieldRendererPlugin } from \"~/types.js\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport DynamicSection from \"../DynamicSection.js\";\nimport { LexicalCmsEditor } from \"~/admin/components/LexicalCmsEditor/LexicalCmsEditor.js\";\nimport { useForm } from \"@webiny/form\";\nimport { MultiValueRendererSettings } from \"~/admin/plugins/fieldRenderers/MultiValueRendererSettings.js\";\nimport { IconButton } from \"@webiny/admin-ui\";\nimport {\n CanEditField,\n useFieldEffectiveRules,\n useModelField\n} from \"@webiny/app-headless-cms-common\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/fields/rich-text\");\n\nconst getKey = (id: string | undefined, field: CmsModelField, index: number): string => {\n const formId = id || \"new\";\n return `${formId}.${field.fieldId}.${index}`;\n};\n\nconst plugin: CmsModelFieldRendererPlugin = {\n type: \"cms-editor-field-renderer\",\n name: \"cms-editor-field-renderer-lexical-inputs\",\n renderer: {\n rendererName: \"lexical-text-inputs\",\n name: t`Lexical Text Inputs`,\n description: t`Renders a list of lexical editors.`,\n canUse({ field }) {\n return [\n field.type === \"rich-text\",\n !!field.list,\n !get(field, \"predefinedValues.enabled\")\n ].every(Boolean);\n },\n render(props) {\n const { field } = useModelField();\n const rules = useFieldEffectiveRules(field);\n const form = useForm();\n\n const disabled = !rules.canEdit || rules.disabled;\n\n return (\n <DynamicSection {...props} disabled={disabled}>\n {({ bind, index }) => (\n <div className={\"relative\"}>\n <LexicalCmsEditor\n disabled={disabled}\n value={bind.index.value}\n onChange={bind.index.onChange}\n key={getKey(form.data.id, field, index)}\n placeholder={field.placeholder}\n />\n <CanEditField>\n <div className={\"absolute top-sm right-sm z-10\"}>\n <IconButton\n variant={\"ghost\"}\n size={\"md\"}\n icon={<DeleteIcon />}\n onClick={() => bind.field.removeValue(index)}\n />\n </div>\n </CanEditField>\n </div>\n )}\n </DynamicSection>\n );\n },\n renderSettings(props) {\n return <MultiValueRendererSettings {...props} />;\n }\n }\n};\n\nexport default plugin;\n"],"names":["t","i18n","getKey","id","field","index","formId","plugin","get","Boolean","props","useModelField","rules","useFieldEffectiveRules","form","useForm","disabled","DynamicSection","bind","LexicalCmsEditor","CanEditField","IconButton","DeleteIcon","MultiValueRendererSettings"],"mappings":";;;;;;;;;;AAgBA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,SAAS,CAACC,IAAwBC,OAAsBC;IAC1D,MAAMC,SAASH,MAAM;IACrB,OAAO,GAAGG,OAAO,CAAC,EAAEF,MAAM,OAAO,CAAC,CAAC,EAAEC,OAAO;AAChD;AAEA,MAAME,2BAAsC;IACxC,MAAM;IACN,MAAM;IACN,UAAU;QACN,cAAc;QACd,MAAMP,CAAC,CAAC,mBAAmB,CAAC;QAC5B,aAAaA,CAAC,CAAC,kCAAkC,CAAC;QAClD,QAAO,EAAEI,KAAK,EAAE;YACZ,OAAO;gBACY,gBAAfA,MAAM,IAAI;gBACV,CAAC,CAACA,MAAM,IAAI;gBACZ,CAACI,IAAIJ,OAAO;aACf,CAAC,KAAK,CAACK;QACZ;QACA,QAAOC,KAAK;YACR,MAAM,EAAEN,KAAK,EAAE,GAAGO;YAClB,MAAMC,QAAQC,uBAAuBT;YACrC,MAAMU,OAAOC;YAEb,MAAMC,WAAW,CAACJ,MAAM,OAAO,IAAIA,MAAM,QAAQ;YAEjD,OAAO,WAAP,GACI,oBAACK,gBAAcA;gBAAE,GAAGP,KAAK;gBAAE,UAAUM;eAChC,CAAC,EAAEE,IAAI,EAAEb,KAAK,EAAE,iBACb,oBAAC;oBAAI,WAAW;iCACZ,oBAACc,kBAAgBA;oBACb,UAAUH;oBACV,OAAOE,KAAK,KAAK,CAAC,KAAK;oBACvB,UAAUA,KAAK,KAAK,CAAC,QAAQ;oBAC7B,KAAKhB,OAAOY,KAAK,IAAI,CAAC,EAAE,EAAEV,OAAOC;oBACjC,aAAaD,MAAM,WAAW;kCAElC,oBAACgB,cAAYA,MAAAA,WAAAA,GACT,oBAAC;oBAAI,WAAW;iCACZ,oBAACC,YAAUA;oBACP,SAAS;oBACT,MAAM;oBACN,oBAAM,oBAACC,gBAAUA;oBACjB,SAAS,IAAMJ,KAAK,KAAK,CAAC,WAAW,CAACb;;QAQtE;QACA,gBAAeK,KAAK;YAChB,OAAO,WAAP,GAAO,oBAACa,4BAA+Bb;QAC3C;IACJ;AACJ;AAEA,0BAAeH"}
1
+ {"version":3,"file":"admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js","sources":["../../../../../src/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.tsx"],"sourcesContent":["import React from \"react\";\nimport get from \"lodash/get.js\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport type { CmsModelField, CmsModelFieldRendererPlugin } from \"~/types.js\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport DynamicSection from \"../DynamicSection.js\";\nimport { LexicalEditor } from \"~/admin/components/LexicalCmsEditor/LexicalEditor.js\";\nimport { useForm } from \"@webiny/form\";\nimport { MultiValueRendererSettings } from \"~/admin/plugins/fieldRenderers/MultiValueRendererSettings.js\";\nimport { IconButton } from \"@webiny/admin-ui\";\nimport {\n CanEditField,\n useFieldEffectiveRules,\n useModelField\n} from \"@webiny/app-headless-cms-common\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/fields/rich-text\");\n\nconst getKey = (id: string | undefined, field: CmsModelField, index: number): string => {\n const formId = id || \"new\";\n return `${formId}.${field.fieldId}.${index}`;\n};\n\nconst plugin: CmsModelFieldRendererPlugin = {\n type: \"cms-editor-field-renderer\",\n name: \"cms-editor-field-renderer-lexical-inputs\",\n renderer: {\n rendererName: \"lexical-text-inputs\",\n name: t`Lexical Text Inputs`,\n description: t`Renders a list of lexical editors.`,\n canUse({ field }) {\n return [\n field.type === \"rich-text\",\n !!field.list,\n !get(field, \"predefinedValues.enabled\")\n ].every(Boolean);\n },\n render(props) {\n const { field } = useModelField();\n const rules = useFieldEffectiveRules(field);\n const form = useForm();\n\n const disabled = !rules.canEdit || rules.disabled;\n\n return (\n <DynamicSection {...props} disabled={disabled}>\n {({ bind, index }) => (\n <div className={\"relative\"}>\n <LexicalEditor\n disabled={disabled}\n value={bind.index.value}\n onChange={bind.index.onChange}\n key={getKey(form.data.id, field, index)}\n placeholder={field.placeholder}\n />\n <CanEditField>\n <div className={\"absolute top-sm right-sm z-10\"}>\n <IconButton\n variant={\"ghost\"}\n size={\"md\"}\n icon={<DeleteIcon />}\n onClick={() => bind.field.removeValue(index)}\n />\n </div>\n </CanEditField>\n </div>\n )}\n </DynamicSection>\n );\n },\n renderSettings(props) {\n return <MultiValueRendererSettings {...props} />;\n }\n }\n};\n\nexport default plugin;\n"],"names":["t","i18n","getKey","id","field","index","formId","plugin","get","Boolean","props","useModelField","rules","useFieldEffectiveRules","form","useForm","disabled","DynamicSection","bind","LexicalEditor","CanEditField","IconButton","DeleteIcon","MultiValueRendererSettings"],"mappings":";;;;;;;;;;AAgBA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAElB,MAAMC,SAAS,CAACC,IAAwBC,OAAsBC;IAC1D,MAAMC,SAASH,MAAM;IACrB,OAAO,GAAGG,OAAO,CAAC,EAAEF,MAAM,OAAO,CAAC,CAAC,EAAEC,OAAO;AAChD;AAEA,MAAME,2BAAsC;IACxC,MAAM;IACN,MAAM;IACN,UAAU;QACN,cAAc;QACd,MAAMP,CAAC,CAAC,mBAAmB,CAAC;QAC5B,aAAaA,CAAC,CAAC,kCAAkC,CAAC;QAClD,QAAO,EAAEI,KAAK,EAAE;YACZ,OAAO;gBACY,gBAAfA,MAAM,IAAI;gBACV,CAAC,CAACA,MAAM,IAAI;gBACZ,CAACI,IAAIJ,OAAO;aACf,CAAC,KAAK,CAACK;QACZ;QACA,QAAOC,KAAK;YACR,MAAM,EAAEN,KAAK,EAAE,GAAGO;YAClB,MAAMC,QAAQC,uBAAuBT;YACrC,MAAMU,OAAOC;YAEb,MAAMC,WAAW,CAACJ,MAAM,OAAO,IAAIA,MAAM,QAAQ;YAEjD,OAAO,WAAP,GACI,oBAACK,gBAAcA;gBAAE,GAAGP,KAAK;gBAAE,UAAUM;eAChC,CAAC,EAAEE,IAAI,EAAEb,KAAK,EAAE,iBACb,oBAAC;oBAAI,WAAW;iCACZ,oBAACc,eAAaA;oBACV,UAAUH;oBACV,OAAOE,KAAK,KAAK,CAAC,KAAK;oBACvB,UAAUA,KAAK,KAAK,CAAC,QAAQ;oBAC7B,KAAKhB,OAAOY,KAAK,IAAI,CAAC,EAAE,EAAEV,OAAOC;oBACjC,aAAaD,MAAM,WAAW;kCAElC,oBAACgB,cAAYA,MAAAA,WAAAA,GACT,oBAAC;oBAAI,WAAW;iCACZ,oBAACC,YAAUA;oBACP,SAAS;oBACT,MAAM;oBACN,oBAAM,oBAACC,gBAAUA;oBACjB,SAAS,IAAMJ,KAAK,KAAK,CAAC,WAAW,CAACb;;QAQtE;QACA,gBAAeK,KAAK;YAChB,OAAO,WAAP,GAAO,oBAACa,4BAA+Bb;QAC3C;IACJ;AACJ;AAEA,0BAAeH"}
@@ -1,16 +1,18 @@
1
+ export { LexicalEditor } from "../../../admin/components/LexicalCmsEditor/LexicalEditor.js";
2
+ export type { LexicalEditorProps } from "../../../admin/components/LexicalCmsEditor/LexicalEditor.js";
1
3
  export { LexicalEditorConfig } from "../../../admin/lexicalConfig/LexicalEditorConfig.js";
2
- export { useLexicalEditorConfig } from "@webiny/lexical-editor/exports/admin/lexical.js";
3
- export { LexicalHtmlRenderer } from "@webiny/lexical-editor/exports/admin/lexical.js";
4
- export { getNodeFromSelection } from "@webiny/lexical-editor/exports/admin/lexical.js";
5
- export { useCurrentElement } from "@webiny/lexical-editor/exports/admin/lexical.js";
6
- export { useCurrentSelection } from "@webiny/lexical-editor/exports/admin/lexical.js";
7
- export { useDeriveValueFromSelection } from "@webiny/lexical-editor/exports/admin/lexical.js";
8
- export { useRichTextEditor } from "@webiny/lexical-editor/exports/admin/lexical.js";
9
- export { useFontColorPicker } from "@webiny/lexical-editor/exports/admin/lexical.js";
10
- export { useTextAlignmentAction } from "@webiny/lexical-editor/exports/admin/lexical.js";
11
- export { useTypographyAction } from "@webiny/lexical-editor/exports/admin/lexical.js";
12
- export { useIsMounted } from "@webiny/lexical-editor/exports/admin/lexical.js";
13
- export { Divider } from "@webiny/lexical-editor/exports/admin/lexical.js";
14
- export { DropDownItem } from "@webiny/lexical-editor/exports/admin/lexical.js";
15
- export { DropDown } from "@webiny/lexical-editor/exports/admin/lexical.js";
16
- export type { Klass, LexicalNode } from "@webiny/lexical-editor/exports/admin/lexical.js";
4
+ export { useLexicalEditorConfig } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
5
+ export { LexicalHtmlRenderer } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
6
+ export { getNodeFromSelection } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
7
+ export { useCurrentElement } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
8
+ export { useCurrentSelection } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
9
+ export { useDeriveValueFromSelection } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
10
+ export { useRichTextEditor } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
11
+ export { useFontColorPicker } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
12
+ export { useTextAlignmentAction } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
13
+ export { useTypographyAction } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
14
+ export { useIsMounted } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
15
+ export { Divider } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
16
+ export { DropDownItem } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
17
+ export { DropDown } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
18
+ export type { Klass, LexicalNode } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
@@ -1,2 +1,3 @@
1
+ export { LexicalEditor } from "../../../admin/components/LexicalCmsEditor/LexicalEditor.js";
1
2
  export { LexicalEditorConfig } from "../../../admin/lexicalConfig/LexicalEditorConfig.js";
2
- export { Divider, DropDown, DropDownItem, LexicalHtmlRenderer, getNodeFromSelection, useCurrentElement, useCurrentSelection, useDeriveValueFromSelection, useFontColorPicker, useIsMounted, useLexicalEditorConfig, useRichTextEditor, useTextAlignmentAction, useTypographyAction } from "@webiny/lexical-editor/exports/admin/lexical.js";
3
+ export { Divider, DropDown, DropDownItem, LexicalHtmlRenderer, getNodeFromSelection, useCurrentElement, useCurrentSelection, useDeriveValueFromSelection, useFontColorPicker, useIsMounted, useLexicalEditorConfig, useRichTextEditor, useTextAlignmentAction, useTypographyAction } from "@webiny/lexical-editor/exports/admin/ui/lexical.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms",
3
- "version": "6.4.0-beta.2",
3
+ "version": "6.4.0-beta.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -31,25 +31,25 @@
31
31
  "@lexical/utils": "0.44.0",
32
32
  "@svgr/webpack": "8.1.0",
33
33
  "@types/react": "18.3.28",
34
- "@webiny/admin-ui": "6.4.0-beta.2",
35
- "@webiny/app": "6.4.0-beta.2",
36
- "@webiny/app-aco": "6.4.0-beta.2",
37
- "@webiny/app-admin": "6.4.0-beta.2",
38
- "@webiny/app-graphql-playground": "6.4.0-beta.2",
39
- "@webiny/app-headless-cms-common": "6.4.0-beta.2",
40
- "@webiny/app-trash-bin": "6.4.0-beta.2",
41
- "@webiny/error": "6.4.0-beta.2",
42
- "@webiny/feature": "6.4.0-beta.2",
43
- "@webiny/form": "6.4.0-beta.2",
44
- "@webiny/icons": "6.4.0-beta.2",
45
- "@webiny/lexical-converter": "6.4.0-beta.2",
46
- "@webiny/lexical-editor": "6.4.0-beta.2",
47
- "@webiny/lexical-nodes": "6.4.0-beta.2",
48
- "@webiny/plugins": "6.4.0-beta.2",
49
- "@webiny/react-composition": "6.4.0-beta.2",
50
- "@webiny/react-properties": "6.4.0-beta.2",
51
- "@webiny/utils": "6.4.0-beta.2",
52
- "@webiny/validation": "6.4.0-beta.2",
34
+ "@webiny/admin-ui": "6.4.0-beta.3",
35
+ "@webiny/app": "6.4.0-beta.3",
36
+ "@webiny/app-aco": "6.4.0-beta.3",
37
+ "@webiny/app-admin": "6.4.0-beta.3",
38
+ "@webiny/app-graphql-playground": "6.4.0-beta.3",
39
+ "@webiny/app-headless-cms-common": "6.4.0-beta.3",
40
+ "@webiny/app-trash-bin": "6.4.0-beta.3",
41
+ "@webiny/error": "6.4.0-beta.3",
42
+ "@webiny/feature": "6.4.0-beta.3",
43
+ "@webiny/form": "6.4.0-beta.3",
44
+ "@webiny/icons": "6.4.0-beta.3",
45
+ "@webiny/lexical-converter": "6.4.0-beta.3",
46
+ "@webiny/lexical-editor": "6.4.0-beta.3",
47
+ "@webiny/lexical-nodes": "6.4.0-beta.3",
48
+ "@webiny/plugins": "6.4.0-beta.3",
49
+ "@webiny/react-composition": "6.4.0-beta.3",
50
+ "@webiny/react-properties": "6.4.0-beta.3",
51
+ "@webiny/utils": "6.4.0-beta.3",
52
+ "@webiny/validation": "6.4.0-beta.3",
53
53
  "apollo-cache": "1.3.5",
54
54
  "apollo-client": "2.6.10",
55
55
  "apollo-link": "1.2.14",
@@ -71,7 +71,7 @@
71
71
  "zod": "4.4.3"
72
72
  },
73
73
  "devDependencies": {
74
- "@webiny/build-tools": "6.4.0-beta.2",
74
+ "@webiny/build-tools": "6.4.0-beta.3",
75
75
  "rimraf": "6.1.3",
76
76
  "typescript": "6.0.3",
77
77
  "vitest": "4.1.6"
@@ -95,5 +95,5 @@
95
95
  ]
96
96
  }
97
97
  },
98
- "gitHead": "872f9f50baa1ff6915a5f338216f84bf0b6dfd24"
98
+ "gitHead": "2e58681d4344024bfb60e6180338e2f154ec87f0"
99
99
  }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { LexicalEditor } from "@webiny/app-admin";
3
- export declare const LexicalCmsEditor: (props: Omit<LexicalEditor.Props, "theme">) => React.JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"admin/components/LexicalCmsEditor/LexicalCmsEditor.js","sources":["../../../../src/admin/components/LexicalCmsEditor/LexicalCmsEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { StaticToolbar } from \"@webiny/lexical-editor\";\nimport { LexicalEditor } from \"@webiny/app-admin\";\n\nconst placeholderStyles: React.CSSProperties = { position: \"absolute\", top: 40, left: 25 };\n\nconst contentEditableStyles: React.CSSProperties = {\n minHeight: 200,\n display: \"block\",\n padding: 10\n};\n\nconst styles: React.CSSProperties = {\n backgroundColor: \"#fff\",\n border: \"1px solid #e1e1e1\",\n padding: \"10px 14px\",\n minHeight: 200,\n maxHeight: 350\n};\n\nconst toolbar = <StaticToolbar />;\n\nexport const LexicalCmsEditor = (props: Omit<LexicalEditor.Props, \"theme\">) => {\n return (\n <LexicalEditor\n {...props}\n focus={true}\n staticToolbar={toolbar}\n tag={\"p\"}\n placeholder={props?.placeholder || \"Enter your text here...\"}\n placeholderStyles={placeholderStyles}\n contentEditableStyles={contentEditableStyles}\n styles={styles}\n />\n );\n};\n"],"names":["placeholderStyles","contentEditableStyles","styles","toolbar","StaticToolbar","LexicalCmsEditor","props","LexicalEditor"],"mappings":";;;AAIA,MAAMA,oBAAyC;IAAE,UAAU;IAAY,KAAK;IAAI,MAAM;AAAG;AAEzF,MAAMC,wBAA6C;IAC/C,WAAW;IACX,SAAS;IACT,SAAS;AACb;AAEA,MAAMC,SAA8B;IAChC,iBAAiB;IACjB,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;AACf;AAEA,MAAMC,UAAU,WAAHA,GAAG,oBAACC,eAAaA;AAEvB,MAAMC,mBAAmB,CAACC,QACtB,WAAP,GACI,oBAACC,eAAaA;QACT,GAAGD,KAAK;QACT,OAAO;QACP,eAAeH;QACf,KAAK;QACL,aAAaG,OAAO,eAAe;QACnC,mBAAmBN;QACnB,uBAAuBC;QACvB,QAAQC"}