@webiny/lexical-editor-actions 0.0.0-unstable.c2780f51fe → 0.0.0-unstable.c7dec08bb0

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.
@@ -8,9 +8,15 @@ exports.LexicalEditorActions = void 0;
8
8
  var _lexicalEditor = require("@webiny/lexical-editor");
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _LexicalColorPickerDropdown = require("./components/LexicalColorPickerDropdown");
11
+ var _TextAlignmentDropdown = require("./components/TextAlignmentDropdown");
12
+ /*
13
+ * Lexical editor configuration and components with global composition scope
14
+ */
11
15
  var LexicalEditorActions = function LexicalEditorActions() {
12
- return /*#__PURE__*/_react.default.createElement(_lexicalEditor.LexicalEditorConfig, null, /*#__PURE__*/_react.default.createElement(_lexicalEditor.FontColorAction.ColorPicker, {
16
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_lexicalEditor.FontColorAction.ColorPicker, {
13
17
  element: /*#__PURE__*/_react.default.createElement(_LexicalColorPickerDropdown.LexicalColorPickerDropdown, null)
18
+ }), /*#__PURE__*/_react.default.createElement(_lexicalEditor.TextAlignmentAction.TextAlignmentDropDown, {
19
+ element: /*#__PURE__*/_react.default.createElement(_TextAlignmentDropdown.TextAlignmentDropdown, null)
14
20
  }));
15
21
  };
16
22
  exports.LexicalEditorActions = LexicalEditorActions;
@@ -1 +1 @@
1
- {"version":3,"names":["LexicalEditorActions"],"sources":["LexicalEditorActions.tsx"],"sourcesContent":["import { LexicalEditorConfig } from \"@webiny/lexical-editor\";\nimport React from \"react\";\nimport { LexicalColorPickerDropdown } from \"~/components/LexicalColorPickerDropdown\";\nimport { FontColorAction } from \"@webiny/lexical-editor\";\n\nexport const LexicalEditorActions = () => {\n return (\n <LexicalEditorConfig>\n <FontColorAction.ColorPicker element={<LexicalColorPickerDropdown />} />\n </LexicalEditorConfig>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAGO,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoB,GAAS;EACtC,oBACI,6BAAC,kCAAmB,qBAChB,6BAAC,8BAAe,CAAC,WAAW;IAAC,OAAO,eAAE,6BAAC,sDAA0B;EAAI,EAAG,CACtD;AAE9B,CAAC;AAAC"}
1
+ {"version":3,"names":["LexicalEditorActions"],"sources":["LexicalEditorActions.tsx"],"sourcesContent":["import { TextAlignmentAction } from \"@webiny/lexical-editor\";\nimport React from \"react\";\nimport { LexicalColorPickerDropdown } from \"~/components/LexicalColorPickerDropdown\";\nimport { FontColorAction } from \"@webiny/lexical-editor\";\nimport { TextAlignmentDropdown } from \"~/components/TextAlignmentDropdown\";\n\n/*\n * Lexical editor configuration and components with global composition scope\n */\nexport const LexicalEditorActions = () => {\n return (\n <>\n <FontColorAction.ColorPicker element={<LexicalColorPickerDropdown />} />\n <TextAlignmentAction.TextAlignmentDropDown element={<TextAlignmentDropdown />} />\n </>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACO,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoB,GAAS;EACtC,oBACI,yEACI,6BAAC,8BAAe,CAAC,WAAW;IAAC,OAAO,eAAE,6BAAC,sDAA0B;EAAI,EAAG,eACxE,6BAAC,kCAAmB,CAAC,qBAAqB;IAAC,OAAO,eAAE,6BAAC,4CAAqB;EAAI,EAAG,CAClF;AAEX,CAAC;AAAC"}
@@ -14,7 +14,7 @@ var LexicalColorPickerDropdown = function LexicalColorPickerDropdown() {
14
14
  applyColor = _useFontColorPicker.applyColor;
15
15
  return /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDown, {
16
16
  buttonClassName: "toolbar-item color-picker",
17
- buttonAriaLabel: "Formatting options for font size",
17
+ buttonAriaLabel: "Formatting options for text color",
18
18
  buttonIconClassName: "icon font-color",
19
19
  stopCloseOnClickSelf: true,
20
20
  disabled: false,
@@ -1 +1 @@
1
- {"version":3,"names":["LexicalColorPickerDropdown","useFontColorPicker","value","applyColor"],"sources":["LexicalColorPickerDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFontColorPicker, DropDown } from \"@webiny/lexical-editor\";\nimport { LexicalColorPicker } from \"~/components/LexicalColorPicker/LexicalColorPicker\";\n\nexport const LexicalColorPickerDropdown = () => {\n const { value, applyColor } = useFontColorPicker();\n\n return (\n <DropDown\n buttonClassName=\"toolbar-item color-picker\"\n buttonAriaLabel={\"Formatting options for font size\"}\n buttonIconClassName=\"icon font-color\"\n stopCloseOnClickSelf={true}\n disabled={false}\n showScroll={false}\n >\n <LexicalColorPicker value={value} onChangeComplete={applyColor} />\n </DropDown>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEO,IAAMA,0BAA0B,GAAG,SAA7BA,0BAA0B,GAAS;EAC5C,0BAA8B,IAAAC,iCAAkB,GAAE;IAA1CC,KAAK,uBAALA,KAAK;IAAEC,UAAU,uBAAVA,UAAU;EAEzB,oBACI,6BAAC,uBAAQ;IACL,eAAe,EAAC,2BAA2B;IAC3C,eAAe,EAAE,kCAAmC;IACpD,mBAAmB,EAAC,iBAAiB;IACrC,oBAAoB,EAAE,IAAK;IAC3B,QAAQ,EAAE,KAAM;IAChB,UAAU,EAAE;EAAM,gBAElB,6BAAC,sCAAkB;IAAC,KAAK,EAAED,KAAM;IAAC,gBAAgB,EAAEC;EAAW,EAAG,CAC3D;AAEnB,CAAC;AAAC"}
1
+ {"version":3,"names":["LexicalColorPickerDropdown","useFontColorPicker","value","applyColor"],"sources":["LexicalColorPickerDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { useFontColorPicker, DropDown } from \"@webiny/lexical-editor\";\nimport { LexicalColorPicker } from \"~/components/LexicalColorPicker/LexicalColorPicker\";\n\nexport const LexicalColorPickerDropdown = () => {\n const { value, applyColor } = useFontColorPicker();\n\n return (\n <DropDown\n buttonClassName=\"toolbar-item color-picker\"\n buttonAriaLabel={\"Formatting options for text color\"}\n buttonIconClassName=\"icon font-color\"\n stopCloseOnClickSelf={true}\n disabled={false}\n showScroll={false}\n >\n <LexicalColorPicker value={value} onChangeComplete={applyColor} />\n </DropDown>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEO,IAAMA,0BAA0B,GAAG,SAA7BA,0BAA0B,GAAS;EAC5C,0BAA8B,IAAAC,iCAAkB,GAAE;IAA1CC,KAAK,uBAALA,KAAK;IAAEC,UAAU,uBAAVA,UAAU;EAEzB,oBACI,6BAAC,uBAAQ;IACL,eAAe,EAAC,2BAA2B;IAC3C,eAAe,EAAE,mCAAoC;IACrD,mBAAmB,EAAC,iBAAiB;IACrC,oBAAoB,EAAE,IAAK;IAC3B,QAAQ,EAAE,KAAM;IAChB,UAAU,EAAE;EAAM,gBAElB,6BAAC,sCAAkB;IAAC,KAAK,EAAED,KAAM;IAAC,gBAAgB,EAAEC;EAAW,EAAG,CAC3D;AAEnB,CAAC;AAAC"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const TextAlignmentDropdown: () => JSX.Element;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.TextAlignmentDropdown = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _lexicalEditor = require("@webiny/lexical-editor");
10
+ var TextAlignmentDropdown = function TextAlignmentDropdown() {
11
+ var _textBlockSelection$s, _textBlockSelection$s2;
12
+ var _useRichTextEditor = (0, _lexicalEditor.useRichTextEditor)(),
13
+ textBlockSelection = _useRichTextEditor.textBlockSelection;
14
+ var _useTextAlignmentActi = (0, _lexicalEditor.useTextAlignmentAction)(),
15
+ applyTextAlignment = _useTextAlignmentActi.applyTextAlignment,
16
+ outdentText = _useTextAlignmentActi.outdentText,
17
+ indentText = _useTextAlignmentActi.indentText;
18
+ return /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDown, {
19
+ buttonLabel: "Align",
20
+ buttonIconClassName: "icon left-align",
21
+ buttonClassName: "toolbar-item spaced alignment",
22
+ buttonAriaLabel: "Formatting options for text alignment"
23
+ }, /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
24
+ onClick: function onClick() {
25
+ applyTextAlignment("left");
26
+ },
27
+ className: "item"
28
+ }, /*#__PURE__*/_react.default.createElement("i", {
29
+ className: "icon left-align"
30
+ }), /*#__PURE__*/_react.default.createElement("span", {
31
+ className: "text"
32
+ }, "Left Align")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
33
+ onClick: function onClick() {
34
+ applyTextAlignment("center");
35
+ },
36
+ className: "item"
37
+ }, /*#__PURE__*/_react.default.createElement("i", {
38
+ className: "icon center-align"
39
+ }), /*#__PURE__*/_react.default.createElement("span", {
40
+ className: "text"
41
+ }, "Center Align")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
42
+ onClick: function onClick() {
43
+ applyTextAlignment("right");
44
+ },
45
+ className: "item"
46
+ }, /*#__PURE__*/_react.default.createElement("i", {
47
+ className: "icon right-align"
48
+ }), /*#__PURE__*/_react.default.createElement("span", {
49
+ className: "text"
50
+ }, "Right Align")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
51
+ onClick: function onClick() {
52
+ applyTextAlignment("justify");
53
+ },
54
+ className: "item"
55
+ }, /*#__PURE__*/_react.default.createElement("i", {
56
+ className: "icon justify-align"
57
+ }), /*#__PURE__*/_react.default.createElement("span", {
58
+ className: "text"
59
+ }, "Justify Align")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.Divider, null), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
60
+ onClick: function onClick() {
61
+ outdentText();
62
+ },
63
+ className: "item"
64
+ }, /*#__PURE__*/_react.default.createElement("i", {
65
+ className: "icon " + (textBlockSelection !== null && textBlockSelection !== void 0 && (_textBlockSelection$s = textBlockSelection.state) !== null && _textBlockSelection$s !== void 0 && _textBlockSelection$s.isRTL ? "indent" : "outdent")
66
+ }), /*#__PURE__*/_react.default.createElement("span", {
67
+ className: "text"
68
+ }, "Outdent")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
69
+ onClick: function onClick() {
70
+ indentText();
71
+ },
72
+ className: "item"
73
+ }, /*#__PURE__*/_react.default.createElement("i", {
74
+ className: "icon " + (textBlockSelection !== null && textBlockSelection !== void 0 && (_textBlockSelection$s2 = textBlockSelection.state) !== null && _textBlockSelection$s2 !== void 0 && _textBlockSelection$s2.isRTL ? "outdent" : "indent")
75
+ }), /*#__PURE__*/_react.default.createElement("span", {
76
+ className: "text"
77
+ }, "Indent")));
78
+ };
79
+ exports.TextAlignmentDropdown = TextAlignmentDropdown;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TextAlignmentDropdown","useRichTextEditor","textBlockSelection","useTextAlignmentAction","applyTextAlignment","outdentText","indentText","state","isRTL"],"sources":["TextAlignmentDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n Divider,\n DropDown,\n DropDownItem,\n useRichTextEditor,\n useTextAlignmentAction\n} from \"@webiny/lexical-editor\";\n\nexport const TextAlignmentDropdown = () => {\n const { textBlockSelection } = useRichTextEditor();\n const { applyTextAlignment, outdentText, indentText } = useTextAlignmentAction();\n\n return (\n <DropDown\n buttonLabel=\"Align\"\n buttonIconClassName=\"icon left-align\"\n buttonClassName=\"toolbar-item spaced alignment\"\n buttonAriaLabel=\"Formatting options for text alignment\"\n >\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"left\");\n }}\n className=\"item\"\n >\n <i className=\"icon left-align\" />\n <span className=\"text\">Left Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"center\");\n }}\n className=\"item\"\n >\n <i className=\"icon center-align\" />\n <span className=\"text\">Center Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"right\");\n }}\n className=\"item\"\n >\n <i className=\"icon right-align\" />\n <span className=\"text\">Right Align</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n applyTextAlignment(\"justify\");\n }}\n className=\"item\"\n >\n <i className=\"icon justify-align\" />\n <span className=\"text\">Justify Align</span>\n </DropDownItem>\n <Divider />\n <DropDownItem\n onClick={() => {\n outdentText();\n }}\n className=\"item\"\n >\n <i\n className={\"icon \" + (textBlockSelection?.state?.isRTL ? \"indent\" : \"outdent\")}\n />\n <span className=\"text\">Outdent</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n indentText();\n }}\n className=\"item\"\n >\n <i\n className={\"icon \" + (textBlockSelection?.state?.isRTL ? \"outdent\" : \"indent\")}\n />\n <span className=\"text\">Indent</span>\n </DropDownItem>\n </DropDown>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAQO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqB,GAAS;EAAA;EACvC,yBAA+B,IAAAC,gCAAiB,GAAE;IAA1CC,kBAAkB,sBAAlBA,kBAAkB;EAC1B,4BAAwD,IAAAC,qCAAsB,GAAE;IAAxEC,kBAAkB,yBAAlBA,kBAAkB;IAAEC,WAAW,yBAAXA,WAAW;IAAEC,UAAU,yBAAVA,UAAU;EAEnD,oBACI,6BAAC,uBAAQ;IACL,WAAW,EAAC,OAAO;IACnB,mBAAmB,EAAC,iBAAiB;IACrC,eAAe,EAAC,+BAA+B;IAC/C,eAAe,EAAC;EAAuC,gBAEvD,6BAAC,2BAAY;IACT,OAAO,EAAE,mBAAM;MACXF,kBAAkB,CAAC,MAAM,CAAC;IAC9B,CAAE;IACF,SAAS,EAAC;EAAM,gBAEhB;IAAG,SAAS,EAAC;EAAiB,EAAG,eACjC;IAAM,SAAS,EAAC;EAAM,GAAC,YAAU,CAAO,CAC7B,eACf,6BAAC,2BAAY;IACT,OAAO,EAAE,mBAAM;MACXA,kBAAkB,CAAC,QAAQ,CAAC;IAChC,CAAE;IACF,SAAS,EA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"@webiny/lexical-editor-actions",
3
- "version": "0.0.0-unstable.c2780f51fe",
3
+ "version": "0.0.0-unstable.c7dec08bb0",
4
4
  "dependencies": {
5
5
  "@emotion/styled": "11.10.6",
6
- "@webiny/app-page-builder": "0.0.0-unstable.c2780f51fe",
7
- "@webiny/app-page-builder-elements": "0.0.0-unstable.c2780f51fe",
8
- "@webiny/lexical-editor": "0.0.0-unstable.c2780f51fe",
6
+ "@webiny/app-page-builder": "0.0.0-unstable.c7dec08bb0",
7
+ "@webiny/app-page-builder-elements": "0.0.0-unstable.c7dec08bb0",
8
+ "@webiny/lexical-editor": "0.0.0-unstable.c7dec08bb0",
9
9
  "classnames": "2.3.2",
10
10
  "emotion": "10.0.27",
11
11
  "react": "17.0.2",
@@ -13,8 +13,8 @@
13
13
  "react-dom": "17.0.2"
14
14
  },
15
15
  "devDependencies": {
16
- "@webiny/cli": "^0.0.0-unstable.c2780f51fe",
17
- "@webiny/project-utils": "^0.0.0-unstable.c2780f51fe"
16
+ "@webiny/cli": "0.0.0-unstable.c7dec08bb0",
17
+ "@webiny/project-utils": "0.0.0-unstable.c7dec08bb0"
18
18
  },
19
19
  "publishConfig": {
20
20
  "access": "public",
@@ -24,5 +24,5 @@
24
24
  "build": "yarn webiny run build",
25
25
  "watch": "yarn webiny run watch"
26
26
  },
27
- "gitHead": "c2780f51fe628e1ef0f6b55c2bce9b74d3470d79"
27
+ "gitHead": "c7dec08bb095467cca6a61381bd399d66b7bb147"
28
28
  }