@webiny/lexical-editor-actions 5.37.8 → 5.38.0-beta.1
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/LexicalEditorActions.js +3 -1
- package/components/LexicalColorPicker/LexicalColorPicker.js +3 -1
- package/components/LexicalColorPickerDropdown.js +3 -1
- package/components/TextAlignmentDropdown.js +11 -6
- package/components/TextAlignmentDropdown.js.map +1 -1
- package/index.js +3 -1
- package/package.json +7 -6
package/LexicalEditorActions.js
CHANGED
|
@@ -19,4 +19,6 @@ var LexicalEditorActions = function LexicalEditorActions() {
|
|
|
19
19
|
element: /*#__PURE__*/_react.default.createElement(_TextAlignmentDropdown.TextAlignmentDropdown, null)
|
|
20
20
|
}));
|
|
21
21
|
};
|
|
22
|
-
exports.LexicalEditorActions = LexicalEditorActions;
|
|
22
|
+
exports.LexicalEditorActions = LexicalEditorActions;
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=LexicalEditorActions.js.map
|
|
@@ -200,4 +200,6 @@ var LexicalColorPicker = function LexicalColorPicker(_ref) {
|
|
|
200
200
|
onChangeComplete: onColorChangeComplete
|
|
201
201
|
}));
|
|
202
202
|
};
|
|
203
|
-
exports.LexicalColorPicker = LexicalColorPicker;
|
|
203
|
+
exports.LexicalColorPicker = LexicalColorPicker;
|
|
204
|
+
|
|
205
|
+
//# sourceMappingURL=LexicalColorPicker.js.map
|
|
@@ -24,4 +24,6 @@ var LexicalColorPickerDropdown = function LexicalColorPickerDropdown() {
|
|
|
24
24
|
onChangeComplete: applyColor
|
|
25
25
|
}));
|
|
26
26
|
};
|
|
27
|
-
exports.LexicalColorPickerDropdown = LexicalColorPickerDropdown;
|
|
27
|
+
exports.LexicalColorPickerDropdown = LexicalColorPickerDropdown;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=LexicalColorPickerDropdown.js.map
|
|
@@ -6,15 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.TextAlignmentDropdown = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _selection = require("@lexical/selection");
|
|
9
10
|
var _lexicalEditor = require("@webiny/lexical-editor");
|
|
11
|
+
var _useCurrentSelection = require("@webiny/lexical-editor/hooks/useCurrentSelection");
|
|
10
12
|
var TextAlignmentDropdown = function TextAlignmentDropdown() {
|
|
11
|
-
var _textBlockSelection$s, _textBlockSelection$s2;
|
|
12
|
-
var _useRichTextEditor = (0, _lexicalEditor.useRichTextEditor)(),
|
|
13
|
-
textBlockSelection = _useRichTextEditor.textBlockSelection;
|
|
14
13
|
var _useTextAlignmentActi = (0, _lexicalEditor.useTextAlignmentAction)(),
|
|
15
14
|
applyTextAlignment = _useTextAlignmentActi.applyTextAlignment,
|
|
16
15
|
outdentText = _useTextAlignmentActi.outdentText,
|
|
17
16
|
indentText = _useTextAlignmentActi.indentText;
|
|
17
|
+
var isRTL = (0, _useCurrentSelection.useDeriveValueFromSelection)(function (_ref) {
|
|
18
|
+
var rangeSelection = _ref.rangeSelection;
|
|
19
|
+
return rangeSelection ? (0, _selection.$isParentElementRTL)(rangeSelection) : false;
|
|
20
|
+
});
|
|
18
21
|
return /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDown, {
|
|
19
22
|
buttonLabel: "Align",
|
|
20
23
|
buttonIconClassName: "icon left-align",
|
|
@@ -62,7 +65,7 @@ var TextAlignmentDropdown = function TextAlignmentDropdown() {
|
|
|
62
65
|
},
|
|
63
66
|
className: "item"
|
|
64
67
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
65
|
-
className: "icon " + (
|
|
68
|
+
className: "icon " + (isRTL ? "indent" : "outdent")
|
|
66
69
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
67
70
|
className: "text"
|
|
68
71
|
}, "Outdent")), /*#__PURE__*/_react.default.createElement(_lexicalEditor.DropDownItem, {
|
|
@@ -71,9 +74,11 @@ var TextAlignmentDropdown = function TextAlignmentDropdown() {
|
|
|
71
74
|
},
|
|
72
75
|
className: "item"
|
|
73
76
|
}, /*#__PURE__*/_react.default.createElement("i", {
|
|
74
|
-
className: "icon " + (
|
|
77
|
+
className: "icon " + (isRTL ? "outdent" : "indent")
|
|
75
78
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
76
79
|
className: "text"
|
|
77
80
|
}, "Indent")));
|
|
78
81
|
};
|
|
79
|
-
exports.TextAlignmentDropdown = TextAlignmentDropdown;
|
|
82
|
+
exports.TextAlignmentDropdown = TextAlignmentDropdown;
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=TextAlignmentDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_lexicalEditor","TextAlignmentDropdown","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_selection","_lexicalEditor","_useCurrentSelection","TextAlignmentDropdown","_useTextAlignmentActi","useTextAlignmentAction","applyTextAlignment","outdentText","indentText","isRTL","useDeriveValueFromSelection","_ref","rangeSelection","$isParentElementRTL","default","createElement","DropDown","buttonLabel","buttonIconClassName","buttonClassName","buttonAriaLabel","DropDownItem","onClick","className","Divider","exports"],"sources":["TextAlignmentDropdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { $isParentElementRTL } from \"@lexical/selection\";\nimport { Divider, DropDown, DropDownItem, useTextAlignmentAction } from \"@webiny/lexical-editor\";\nimport { useDeriveValueFromSelection } from \"@webiny/lexical-editor/hooks/useCurrentSelection\";\n\nexport const TextAlignmentDropdown = () => {\n const { applyTextAlignment, outdentText, indentText } = useTextAlignmentAction();\n\n const isRTL = useDeriveValueFromSelection(({ rangeSelection }) => {\n return rangeSelection ? $isParentElementRTL(rangeSelection) : false;\n });\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 className={\"icon \" + (isRTL ? \"indent\" : \"outdent\")} />\n <span className=\"text\">Outdent</span>\n </DropDownItem>\n <DropDownItem\n onClick={() => {\n indentText();\n }}\n className=\"item\"\n >\n <i className={\"icon \" + (isRTL ? \"outdent\" : \"indent\")} />\n <span className=\"text\">Indent</span>\n </DropDownItem>\n </DropDown>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEO,IAAMI,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAA,EAAS;EACvC,IAAAC,qBAAA,GAAwD,IAAAC,qCAAsB,EAAC,CAAC;IAAxEC,kBAAkB,GAAAF,qBAAA,CAAlBE,kBAAkB;IAAEC,WAAW,GAAAH,qBAAA,CAAXG,WAAW;IAAEC,UAAU,GAAAJ,qBAAA,CAAVI,UAAU;EAEnD,IAAMC,KAAK,GAAG,IAAAC,gDAA2B,EAAC,UAAAC,IAAA,EAAwB;IAAA,IAArBC,cAAc,GAAAD,IAAA,CAAdC,c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1DZ,MAAA,CAAAiB,OAAA,CAAAC,aAAA;IAAMQ,SAAS,EAAC;EAAM,GAAC,QAAY,CACzB,CACR,CAAC;AAEnB,CAAC;AAACE,OAAA,CAAAtB,qBAAA,GAAAA,qBAAA"}
|
package/index.js
CHANGED
|
@@ -9,4 +9,6 @@ Object.defineProperty(exports, "LexicalEditorActions", {
|
|
|
9
9
|
return _LexicalEditorActions.LexicalEditorActions;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var _LexicalEditorActions = require("./LexicalEditorActions");
|
|
12
|
+
var _LexicalEditorActions = require("./LexicalEditorActions");
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/lexical-editor-actions",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.38.0-beta.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@emotion/styled": "11.10.6",
|
|
6
|
-
"@
|
|
7
|
-
"@webiny/
|
|
6
|
+
"@lexical/selection": "0.12.2",
|
|
7
|
+
"@webiny/app-page-builder-elements": "5.38.0-beta.1",
|
|
8
|
+
"@webiny/lexical-editor": "5.38.0-beta.1",
|
|
8
9
|
"classnames": "2.3.2",
|
|
9
10
|
"emotion": "10.0.27",
|
|
10
11
|
"react": "17.0.2",
|
|
@@ -12,8 +13,8 @@
|
|
|
12
13
|
"react-dom": "17.0.2"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
|
-
"@webiny/cli": "5.
|
|
16
|
-
"@webiny/project-utils": "5.
|
|
16
|
+
"@webiny/cli": "5.38.0-beta.1",
|
|
17
|
+
"@webiny/project-utils": "5.38.0-beta.1"
|
|
17
18
|
},
|
|
18
19
|
"publishConfig": {
|
|
19
20
|
"access": "public",
|
|
@@ -23,5 +24,5 @@
|
|
|
23
24
|
"build": "yarn webiny run build",
|
|
24
25
|
"watch": "yarn webiny run watch"
|
|
25
26
|
},
|
|
26
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "6daf38d3ed0c029a8fea005c2b6246e5b325a09c"
|
|
27
28
|
}
|