@webiny/lexical-editor 0.0.0-unstable.ecd8734205 → 5.35.0-beta.0
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/commands/webiny-list.d.ts +7 -0
- package/commands/webiny-list.js +13 -0
- package/commands/webiny-list.js.map +1 -0
- package/commands/webiny-quote.d.ts +5 -0
- package/commands/webiny-quote.js +9 -0
- package/commands/webiny-quote.js.map +1 -0
- package/components/AddRichTextEditorNodeType.js.map +1 -1
- package/components/AddRichTextEditorPlugin.d.ts +2 -0
- package/components/AddRichTextEditorPlugin.js +4 -2
- package/components/AddRichTextEditorPlugin.js.map +1 -1
- package/components/AddToolbarAction.js.map +1 -1
- package/components/Editor/HeadingEditor.js +2 -1
- package/components/Editor/HeadingEditor.js.map +1 -1
- package/components/Editor/ParagraphEditor.js +3 -3
- package/components/Editor/ParagraphEditor.js.map +1 -1
- package/components/Editor/RichTextEditor.d.ts +4 -1
- package/components/Editor/RichTextEditor.js +37 -6
- package/components/Editor/RichTextEditor.js.map +1 -1
- package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +9 -0
- package/components/LexicalEditorConfig/LexicalEditorConfig.js +17 -0
- package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -0
- package/components/LexicalHtmlRenderer.d.ts +8 -1
- package/components/LexicalHtmlRenderer.js +29 -6
- package/components/LexicalHtmlRenderer.js.map +1 -1
- package/components/Toolbar/HeadingToolbar.js.map +1 -1
- package/components/Toolbar/ParagraphToolbar.js.map +1 -1
- package/components/Toolbar/Toolbar.css +9 -0
- package/components/Toolbar/Toolbar.js +25 -5
- package/components/Toolbar/Toolbar.js.map +1 -1
- package/components/ToolbarActions/BoldAction.d.ts +0 -3
- package/components/ToolbarActions/BoldAction.js +8 -3
- package/components/ToolbarActions/BoldAction.js.map +1 -1
- package/components/ToolbarActions/BulletListAction.d.ts +0 -3
- package/components/ToolbarActions/BulletListAction.js +17 -55
- package/components/ToolbarActions/BulletListAction.js.map +1 -1
- package/components/ToolbarActions/CodeHighlightAction.d.ts +0 -4
- package/components/ToolbarActions/CodeHighlightAction.js +8 -4
- package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
- package/components/ToolbarActions/FontColorAction.d.ts +11 -0
- package/components/ToolbarActions/FontColorAction.js +83 -0
- package/components/ToolbarActions/FontColorAction.js.map +1 -0
- package/components/ToolbarActions/FontSizeAction.js +0 -3
- package/components/ToolbarActions/FontSizeAction.js.map +1 -1
- package/components/ToolbarActions/ItalicAction.d.ts +0 -3
- package/components/ToolbarActions/ItalicAction.js +8 -3
- package/components/ToolbarActions/ItalicAction.js.map +1 -1
- package/components/ToolbarActions/LinkAction.d.ts +0 -5
- package/components/ToolbarActions/LinkAction.js +0 -5
- package/components/ToolbarActions/LinkAction.js.map +1 -1
- package/components/ToolbarActions/NumberedListAction.d.ts +0 -3
- package/components/ToolbarActions/NumberedListAction.js +17 -53
- package/components/ToolbarActions/NumberedListAction.js.map +1 -1
- package/components/ToolbarActions/QuoteAction.d.ts +0 -2
- package/components/ToolbarActions/QuoteAction.js +16 -29
- package/components/ToolbarActions/QuoteAction.js.map +1 -1
- package/components/ToolbarActions/TypographyAction.d.ts +11 -0
- package/components/ToolbarActions/TypographyAction.js +118 -0
- package/components/ToolbarActions/TypographyAction.js.map +1 -0
- package/components/ToolbarActions/UnderlineAction.d.ts +0 -3
- package/components/ToolbarActions/UnderlineAction.js +8 -3
- package/components/ToolbarActions/UnderlineAction.js.map +1 -1
- package/components/ToolbarPresets/HeadingToolbarPreset.js +8 -0
- package/components/ToolbarPresets/HeadingToolbarPreset.js.map +1 -1
- package/components/ToolbarPresets/ParagraphToolbarPreset.js +8 -0
- package/components/ToolbarPresets/ParagraphToolbarPreset.js.map +1 -1
- package/context/FontColorActionContext.d.ts +6 -0
- package/context/FontColorActionContext.js +10 -0
- package/context/FontColorActionContext.js.map +1 -0
- package/context/RichTextEditorContext.d.ts +10 -0
- package/context/RichTextEditorContext.js +28 -1
- package/context/RichTextEditorContext.js.map +1 -1
- package/context/SharedHistoryContext.d.ts +11 -0
- package/context/SharedHistoryContext.js +26 -0
- package/context/SharedHistoryContext.js.map +1 -0
- package/context/TypographyActionContext.d.ts +7 -0
- package/context/TypographyActionContext.js +10 -0
- package/context/TypographyActionContext.js.map +1 -0
- package/hooks/useFontColorPicker.d.ts +2 -0
- package/hooks/useFontColorPicker.js +15 -0
- package/hooks/useFontColorPicker.js.map +1 -0
- package/hooks/useRichTextEditor.js.map +1 -1
- package/hooks/useTypographyAction.d.ts +1 -0
- package/hooks/useTypographyAction.js +15 -0
- package/hooks/useTypographyAction.js.map +1 -0
- package/hooks/useWebinyList.d.ts +2 -0
- package/hooks/useWebinyList.js +39 -0
- package/hooks/useWebinyList.js.map +1 -0
- package/hooks/useWebinyQuote.d.ts +2 -0
- package/hooks/useWebinyQuote.js +20 -0
- package/hooks/useWebinyQuote.js.map +1 -0
- package/images/icons/font-color.svg +1 -0
- package/index.d.ts +7 -1
- package/index.js +44 -2
- package/index.js.map +1 -1
- package/nodes/FontColorNode.d.ts +43 -0
- package/nodes/FontColorNode.js +127 -0
- package/nodes/FontColorNode.js.map +1 -0
- package/nodes/TypographyElementNode.d.ts +42 -0
- package/nodes/TypographyElementNode.js +154 -0
- package/nodes/TypographyElementNode.js.map +1 -0
- package/nodes/WebinyQuoteNode.d.ts +29 -0
- package/nodes/WebinyQuoteNode.js +148 -0
- package/nodes/WebinyQuoteNode.js.map +1 -0
- package/nodes/list-node/WebinyListItemNode.d.ts +46 -0
- package/nodes/list-node/WebinyListItemNode.js +441 -0
- package/nodes/list-node/WebinyListItemNode.js.map +1 -0
- package/nodes/list-node/WebinyListNode.d.ts +38 -0
- package/nodes/list-node/WebinyListNode.js +253 -0
- package/nodes/list-node/WebinyListNode.js.map +1 -0
- package/nodes/list-node/formatList.d.ts +12 -0
- package/nodes/list-node/formatList.js +423 -0
- package/nodes/list-node/formatList.js.map +1 -0
- package/nodes/webinyNodes.d.ts +6 -1
- package/nodes/webinyNodes.js +8 -2
- package/nodes/webinyNodes.js.map +1 -1
- package/package.json +9 -6
- package/plugins/AutoLinkPlugin/AutoLinkPlugin.js.map +1 -1
- package/plugins/AutoLinkPlugin/index.js.map +1 -1
- package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
- package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.js.map +1 -1
- package/plugins/ClickableLinkPlugin/index.js.map +1 -1
- package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
- package/plugins/CodeHighlightPlugin/index.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
- package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
- package/plugins/FontColorPlugin/FontColorPlugin.d.ts +2 -0
- package/plugins/FontColorPlugin/FontColorPlugin.js +38 -0
- package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -0
- package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +1 -1
- package/plugins/LexicalUpdateStatePlugin/index.js.map +1 -1
- package/plugins/TypographyPlugin/TypographyPlugin.d.ts +2 -0
- package/plugins/TypographyPlugin/TypographyPlugin.js +31 -0
- package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -0
- package/plugins/WebinyListPLugin/WebinyListPlugin.d.ts +1 -0
- package/plugins/WebinyListPLugin/WebinyListPlugin.js +25 -0
- package/plugins/WebinyListPLugin/WebinyListPlugin.js.map +1 -0
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.d.ts +1 -0
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +24 -0
- package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +1 -0
- package/themes/webinyLexicalTheme.css +0 -2
- package/themes/webinyLexicalTheme.d.ts +7 -8
- package/themes/webinyLexicalTheme.js +7 -27
- package/themes/webinyLexicalTheme.js.map +1 -1
- package/types.d.ts +59 -0
- package/types.js +8 -1
- package/types.js.map +1 -1
- package/ui/Divider.js.map +1 -1
- package/ui/DropDown.d.ts +2 -1
- package/ui/DropDown.js +7 -2
- package/ui/DropDown.js.map +1 -1
- package/ui/LinkPreview.js.map +1 -1
- package/ui/Placeholder.js.map +1 -1
- package/ui/TextInput.js.map +1 -1
- package/ui/ToolbarActionDialog.d.ts +12 -0
- package/ui/ToolbarActionDialog.js +106 -0
- package/ui/ToolbarActionDialog.js.map +1 -0
- package/utils/generateInitialLexicalValue.js.map +1 -1
- package/utils/getDOMRangeRect.js.map +1 -1
- package/utils/getLexicalTextSelectionState.d.ts +5 -0
- package/utils/getLexicalTextSelectionState.js +141 -0
- package/utils/getLexicalTextSelectionState.js.map +1 -0
- package/utils/getSelectedNode.js.map +1 -1
- package/utils/isValidJSON.js.map +1 -1
- package/utils/isValidLexicalData.js.map +1 -1
- package/utils/nodes/clearNodeFormating.d.ts +2 -0
- package/utils/nodes/clearNodeFormating.js +28 -0
- package/utils/nodes/clearNodeFormating.js.map +1 -0
- package/utils/nodes/formatToParagraph.d.ts +2 -0
- package/utils/nodes/formatToParagraph.js +19 -0
- package/utils/nodes/formatToParagraph.js.map +1 -0
- package/utils/nodes/formatToQuote.d.ts +2 -0
- package/utils/nodes/formatToQuote.js +20 -0
- package/utils/nodes/formatToQuote.js.map +1 -0
- package/utils/nodes/list-node.d.ts +11 -0
- package/utils/nodes/list-node.js +107 -0
- package/utils/nodes/list-node.js.map +1 -0
- package/utils/point.js.map +1 -1
- package/utils/rect.js.map +1 -1
- package/utils/sanitizeUrl.js.map +1 -1
- package/utils/setFloatingElemPosition.js.map +1 -1
- package/utils/styleObjectToString.d.ts +2 -0
- package/utils/styleObjectToString.js +22 -0
- package/utils/styleObjectToString.js.map +1 -0
- package/utils/toTypographyEmotionMap.d.ts +3 -0
- package/utils/toTypographyEmotionMap.js +36 -0
- package/utils/toTypographyEmotionMap.js.map +1 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.$createWebinyListNode = $createWebinyListNode;
|
|
8
|
+
exports.$isWebinyListNode = $isWebinyListNode;
|
|
9
|
+
exports.WebinyListNode = void 0;
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
16
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
18
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
|
+
var _lexical = require("lexical");
|
|
21
|
+
var _utils = require("@lexical/utils");
|
|
22
|
+
var _listNode = require("../../utils/nodes/list-node");
|
|
23
|
+
var _WebinyListItemNode = require("./WebinyListItemNode");
|
|
24
|
+
var TypographyStyleAttrName = "data-theme-list-style-id";
|
|
25
|
+
var WebinyListNode = /*#__PURE__*/function (_ElementNode) {
|
|
26
|
+
(0, _inherits2.default)(WebinyListNode, _ElementNode);
|
|
27
|
+
var _super = (0, _createSuper2.default)(WebinyListNode);
|
|
28
|
+
/** @internal */
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
|
|
34
|
+
function WebinyListNode(listType, themeStyleId, start, key) {
|
|
35
|
+
var _this;
|
|
36
|
+
(0, _classCallCheck2.default)(this, WebinyListNode);
|
|
37
|
+
_this = _super.call(this, key);
|
|
38
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__tag", void 0);
|
|
39
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__start", void 0);
|
|
40
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__listType", void 0);
|
|
41
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "__themeStyleId", void 0);
|
|
42
|
+
_this.__themeStyleId = themeStyleId;
|
|
43
|
+
var _listType = TAG_TO_WEBINY_LIST_TYPE[listType] || listType;
|
|
44
|
+
_this.__listType = _listType;
|
|
45
|
+
_this.__tag = _listType === "number" ? "ol" : "ul";
|
|
46
|
+
_this.__start = start;
|
|
47
|
+
return _this;
|
|
48
|
+
}
|
|
49
|
+
(0, _createClass2.default)(WebinyListNode, [{
|
|
50
|
+
key: "createDOM",
|
|
51
|
+
value: function createDOM(config) {
|
|
52
|
+
var tag = this.__tag;
|
|
53
|
+
var dom = document.createElement(tag);
|
|
54
|
+
if (this.__start !== 1) {
|
|
55
|
+
dom.setAttribute("start", String(this.__start));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// @ts-expect-error Internal field.
|
|
59
|
+
dom.__lexicalListType = this.__listType;
|
|
60
|
+
var theme = config.theme;
|
|
61
|
+
setListThemeClassNames(dom, theme, this, this.__themeStyleId);
|
|
62
|
+
dom.setAttribute(TypographyStyleAttrName, this.__themeStyleId);
|
|
63
|
+
return dom;
|
|
64
|
+
}
|
|
65
|
+
}, {
|
|
66
|
+
key: "getTag",
|
|
67
|
+
value: function getTag() {
|
|
68
|
+
return this.__tag;
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
key: "getListType",
|
|
72
|
+
value: function getListType() {
|
|
73
|
+
return this.__listType;
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "getStart",
|
|
77
|
+
value: function getStart() {
|
|
78
|
+
return this.__start;
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
key: "getStyleId",
|
|
82
|
+
value: function getStyleId() {
|
|
83
|
+
return this.__themeStyleId;
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
key: "exportJSON",
|
|
87
|
+
value:
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
function exportJSON() {
|
|
90
|
+
var _this$__themeStyleId;
|
|
91
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _get2.default)((0, _getPrototypeOf2.default)(WebinyListNode.prototype), "exportJSON", this).call(this)), {}, {
|
|
92
|
+
themeStyleId: (_this$__themeStyleId = this.__themeStyleId) !== null && _this$__themeStyleId !== void 0 ? _this$__themeStyleId : "",
|
|
93
|
+
listType: this.getListType(),
|
|
94
|
+
start: this.getStart(),
|
|
95
|
+
tag: this.getTag(),
|
|
96
|
+
type: "webiny-list",
|
|
97
|
+
version: 1
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "updateDOM",
|
|
102
|
+
value: function updateDOM(prevNode, dom, config) {
|
|
103
|
+
if (prevNode.__tag !== this.__tag) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
// update styles for different tag styles
|
|
107
|
+
setListThemeClassNames(dom, config.theme, this, this.__themeStyleId);
|
|
108
|
+
dom.setAttribute(TypographyStyleAttrName, this.__themeStyleId);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "extractWithChild",
|
|
113
|
+
value: function extractWithChild(child) {
|
|
114
|
+
return (0, _WebinyListItemNode.$isWebinyListItemNode)(child);
|
|
115
|
+
}
|
|
116
|
+
}], [{
|
|
117
|
+
key: "getType",
|
|
118
|
+
value: function getType() {
|
|
119
|
+
return "webiny-list";
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "clone",
|
|
123
|
+
value: function clone(node) {
|
|
124
|
+
return new WebinyListNode(node.getListType(), node.getStyleId(), node.getStart(), node.__key);
|
|
125
|
+
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "importJSON",
|
|
128
|
+
value: function importJSON(serializedNode) {
|
|
129
|
+
var node = $createWebinyListNode(serializedNode.listType, serializedNode.themeStyleId, serializedNode.start);
|
|
130
|
+
node.setFormat(serializedNode.format);
|
|
131
|
+
node.setIndent(serializedNode.indent);
|
|
132
|
+
node.setDirection(serializedNode.direction);
|
|
133
|
+
return node;
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "importDomConversionMap",
|
|
137
|
+
value: function importDomConversionMap() {
|
|
138
|
+
return {
|
|
139
|
+
conversion: convertWebinyListNode,
|
|
140
|
+
priority: 0
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}, {
|
|
144
|
+
key: "importDOM",
|
|
145
|
+
value: function importDOM() {
|
|
146
|
+
var _this2 = this;
|
|
147
|
+
return {
|
|
148
|
+
ol: function ol() {
|
|
149
|
+
return _this2.importDomConversionMap();
|
|
150
|
+
},
|
|
151
|
+
ul: function ul() {
|
|
152
|
+
return _this2.importDomConversionMap();
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
return WebinyListNode;
|
|
158
|
+
}(_lexical.ElementNode);
|
|
159
|
+
exports.WebinyListNode = WebinyListNode;
|
|
160
|
+
function setListThemeClassNames(dom, editorTheme, node, themeStyleId) {
|
|
161
|
+
var editorThemeClasses = editorTheme;
|
|
162
|
+
var classesToAdd = [];
|
|
163
|
+
var classesToRemove = [];
|
|
164
|
+
var listTheme = editorThemeClasses.list;
|
|
165
|
+
var emotionMap = (editorTheme === null || editorTheme === void 0 ? void 0 : editorTheme.emotionMap) || {};
|
|
166
|
+
if (listTheme !== undefined) {
|
|
167
|
+
var _emotionMap$themeStyl, _emotionMap$themeStyl2;
|
|
168
|
+
var listLevelsClassNames = listTheme["".concat(node.__tag, "Depth")] || [];
|
|
169
|
+
var listDepth = (0, _listNode.$getListDepth)(node) - 1;
|
|
170
|
+
var normalizedListDepth = listDepth % listLevelsClassNames.length;
|
|
171
|
+
var listLevelClassName = listLevelsClassNames[normalizedListDepth];
|
|
172
|
+
var listClassName = "".concat(listTheme[node.__tag], " ").concat((_emotionMap$themeStyl = (_emotionMap$themeStyl2 = emotionMap[themeStyleId]) === null || _emotionMap$themeStyl2 === void 0 ? void 0 : _emotionMap$themeStyl2.className) !== null && _emotionMap$themeStyl !== void 0 ? _emotionMap$themeStyl : "");
|
|
173
|
+
var nestedListClassName;
|
|
174
|
+
var nestedListTheme = listTheme.nested;
|
|
175
|
+
if (nestedListTheme !== undefined && nestedListTheme.list) {
|
|
176
|
+
nestedListClassName = nestedListTheme.list;
|
|
177
|
+
}
|
|
178
|
+
if (listClassName !== undefined) {
|
|
179
|
+
classesToAdd.push(listClassName);
|
|
180
|
+
}
|
|
181
|
+
if (listLevelClassName !== undefined) {
|
|
182
|
+
var listItemClasses = listLevelClassName.split(" ");
|
|
183
|
+
classesToAdd.push.apply(classesToAdd, (0, _toConsumableArray2.default)(listItemClasses));
|
|
184
|
+
for (var i = 0; i < listLevelsClassNames.length; i++) {
|
|
185
|
+
if (i !== normalizedListDepth) {
|
|
186
|
+
classesToRemove.push(node.__tag + i);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (nestedListClassName !== undefined) {
|
|
191
|
+
var nestedListItemClasses = nestedListClassName.split(" ");
|
|
192
|
+
if (listDepth > 1) {
|
|
193
|
+
classesToAdd.push.apply(classesToAdd, (0, _toConsumableArray2.default)(nestedListItemClasses));
|
|
194
|
+
} else {
|
|
195
|
+
classesToRemove.push.apply(classesToRemove, (0, _toConsumableArray2.default)(nestedListItemClasses));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (classesToRemove.length > 0) {
|
|
200
|
+
_utils.removeClassNamesFromElement.apply(void 0, [dom].concat(classesToRemove));
|
|
201
|
+
}
|
|
202
|
+
if (classesToAdd.length > 0) {
|
|
203
|
+
_utils.addClassNamesToElement.apply(void 0, [dom].concat(classesToAdd));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/*
|
|
208
|
+
* This function normalizes the children of a ListNode after the conversion from HTML,
|
|
209
|
+
* ensuring that they are all ListItemNodes and contain either a single nested ListNode
|
|
210
|
+
* or some other inline content.
|
|
211
|
+
*/
|
|
212
|
+
function normalizeChildren(nodes) {
|
|
213
|
+
var normalizedListItems = [];
|
|
214
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
215
|
+
var node = nodes[i];
|
|
216
|
+
if ((0, _WebinyListItemNode.$isWebinyListItemNode)(node)) {
|
|
217
|
+
normalizedListItems.push(node);
|
|
218
|
+
node.getChildren().forEach(function (child) {
|
|
219
|
+
if ($isWebinyListNode(child)) {
|
|
220
|
+
normalizedListItems.push((0, _listNode.wrapInListItem)(child));
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
} else {
|
|
224
|
+
normalizedListItems.push((0, _listNode.wrapInListItem)(node));
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return normalizedListItems;
|
|
228
|
+
}
|
|
229
|
+
function convertWebinyListNode(domNode) {
|
|
230
|
+
var nodeName = domNode.nodeName.toLowerCase();
|
|
231
|
+
var node = null;
|
|
232
|
+
if (nodeName === "ol") {
|
|
233
|
+
node = $createWebinyListNode("number", "");
|
|
234
|
+
} else if (nodeName === "ul") {
|
|
235
|
+
node = $createWebinyListNode("bullet", "");
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
// @ts-ignore
|
|
239
|
+
after: normalizeChildren,
|
|
240
|
+
node: node
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
var TAG_TO_WEBINY_LIST_TYPE = {
|
|
244
|
+
ol: "number",
|
|
245
|
+
ul: "bullet"
|
|
246
|
+
};
|
|
247
|
+
function $createWebinyListNode(listType, themeStyleId) {
|
|
248
|
+
var start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
249
|
+
return new WebinyListNode(listType, themeStyleId, start);
|
|
250
|
+
}
|
|
251
|
+
function $isWebinyListNode(node) {
|
|
252
|
+
return node instanceof WebinyListNode;
|
|
253
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TypographyStyleAttrName","WebinyListNode","listType","themeStyleId","start","key","__themeStyleId","_listType","TAG_TO_WEBINY_LIST_TYPE","__listType","__tag","__start","config","tag","dom","document","createElement","setAttribute","String","__lexicalListType","theme","setListThemeClassNames","getListType","getStart","getTag","type","version","prevNode","child","$isWebinyListItemNode","node","getStyleId","__key","serializedNode","$createWebinyListNode","setFormat","format","setIndent","indent","setDirection","direction","conversion","convertWebinyListNode","priority","ol","importDomConversionMap","ul","ElementNode","editorTheme","editorThemeClasses","classesToAdd","classesToRemove","listTheme","list","emotionMap","undefined","listLevelsClassNames","listDepth","$getListDepth","normalizedListDepth","length","listLevelClassName","listClassName","className","nestedListClassName","nestedListTheme","nested","push","listItemClasses","split","i","nestedListItemClasses","removeClassNamesFromElement","addClassNamesToElement","normalizeChildren","nodes","normalizedListItems","getChildren","forEach","$isWebinyListNode","wrapInListItem","domNode","nodeName","toLowerCase","after"],"sources":["WebinyListNode.ts"],"sourcesContent":["import {\n DOMConversion,\n DOMConversionMap,\n DOMConversionOutput,\n EditorConfig,\n ElementNode,\n LexicalNode,\n NodeKey,\n SerializedElementNode,\n Spread\n} from \"lexical\";\nimport { WebinyEditorTheme } from \"~/themes/webinyLexicalTheme\";\nimport { addClassNamesToElement, removeClassNamesFromElement } from \"@lexical/utils\";\nimport { ListNodeTagType } from \"@lexical/list/LexicalListNode\";\nimport { $getListDepth, wrapInListItem } from \"~/utils/nodes/list-node\";\nimport { ListType } from \"@lexical/list\";\nimport { $isWebinyListItemNode, WebinyListItemNode } from \"~/nodes/list-node/WebinyListItemNode\";\n\nconst TypographyStyleAttrName = \"data-theme-list-style-id\";\n\nexport type SerializedWebinyListNode = Spread<\n {\n themeStyleId: string;\n listType: ListType;\n start: number;\n tag: ListNodeTagType;\n type: \"webiny-list\";\n version: 1;\n },\n SerializedElementNode\n>;\n\nexport class WebinyListNode extends ElementNode {\n /** @internal */\n __tag: ListNodeTagType;\n /** @internal */\n __start: number;\n /** @internal */\n __listType: ListType;\n\n __themeStyleId: string;\n\n constructor(listType: ListType, themeStyleId: string, start: number, key?: NodeKey) {\n super(key);\n this.__themeStyleId = themeStyleId;\n const _listType = TAG_TO_WEBINY_LIST_TYPE[listType] || listType;\n this.__listType = _listType;\n this.__tag = _listType === \"number\" ? \"ol\" : \"ul\";\n this.__start = start;\n }\n\n static override getType() {\n return \"webiny-list\";\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const tag = this.__tag;\n const dom = document.createElement(tag);\n\n if (this.__start !== 1) {\n dom.setAttribute(\"start\", String(this.__start));\n }\n\n // @ts-expect-error Internal field.\n dom.__lexicalListType = this.__listType;\n const theme = config.theme as WebinyEditorTheme;\n setListThemeClassNames(dom, theme, this, this.__themeStyleId);\n dom.setAttribute(TypographyStyleAttrName, this.__themeStyleId);\n return dom;\n }\n\n static override clone(node: WebinyListNode): WebinyListNode {\n return new WebinyListNode(\n node.getListType(),\n node.getStyleId(),\n node.getStart(),\n node.__key\n );\n }\n\n getTag(): ListNodeTagType {\n return this.__tag;\n }\n\n getListType(): ListType {\n return this.__listType;\n }\n\n getStart(): number {\n return this.__start;\n }\n\n getStyleId(): string {\n return this.__themeStyleId;\n }\n\n static override importJSON(serializedNode: SerializedWebinyListNode): WebinyListNode {\n const node = $createWebinyListNode(\n serializedNode.listType,\n serializedNode.themeStyleId,\n serializedNode.start\n );\n node.setFormat(serializedNode.format);\n node.setIndent(serializedNode.indent);\n node.setDirection(serializedNode.direction);\n return node;\n }\n\n // @ts-ignore\n override exportJSON(): SerializedWebinyListNode {\n return {\n ...super.exportJSON(),\n themeStyleId: this.__themeStyleId ?? \"\",\n listType: this.getListType(),\n start: this.getStart(),\n tag: this.getTag(),\n type: \"webiny-list\",\n version: 1\n };\n }\n\n static importDomConversionMap(): DOMConversion<HTMLElement> | null {\n return {\n conversion: convertWebinyListNode,\n priority: 0\n };\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n ol: () => {\n return this.importDomConversionMap();\n },\n ul: () => {\n return this.importDomConversionMap();\n }\n };\n }\n\n override updateDOM(prevNode: WebinyListNode, dom: HTMLElement, config: EditorConfig): boolean {\n if (prevNode.__tag !== this.__tag) {\n return true;\n }\n // update styles for different tag styles\n setListThemeClassNames(dom, config.theme, this, this.__themeStyleId);\n dom.setAttribute(TypographyStyleAttrName, this.__themeStyleId);\n return false;\n }\n\n override extractWithChild(child: LexicalNode): boolean {\n return $isWebinyListItemNode(child);\n }\n}\n\nfunction setListThemeClassNames(\n dom: HTMLElement,\n editorTheme: WebinyEditorTheme,\n node: WebinyListNode,\n themeStyleId: string\n): void {\n const editorThemeClasses = editorTheme;\n const classesToAdd = [];\n const classesToRemove = [];\n const listTheme = editorThemeClasses.list;\n const emotionMap = editorTheme?.emotionMap || {};\n if (listTheme !== undefined) {\n const listLevelsClassNames = listTheme[`${node.__tag}Depth`] || [];\n const listDepth = $getListDepth(node) - 1;\n const normalizedListDepth = listDepth % listLevelsClassNames.length;\n const listLevelClassName = listLevelsClassNames[normalizedListDepth];\n const listClassName = `${listTheme[node.__tag]} ${\n emotionMap[themeStyleId]?.className ?? \"\"\n }`;\n let nestedListClassName;\n const nestedListTheme = listTheme.nested;\n\n if (nestedListTheme !== undefined && nestedListTheme.list) {\n nestedListClassName = nestedListTheme.list;\n }\n\n if (listClassName !== undefined) {\n classesToAdd.push(listClassName);\n }\n\n if (listLevelClassName !== undefined) {\n const listItemClasses = listLevelClassName.split(\" \");\n classesToAdd.push(...listItemClasses);\n for (let i = 0; i < listLevelsClassNames.length; i++) {\n if (i !== normalizedListDepth) {\n classesToRemove.push(node.__tag + i);\n }\n }\n }\n\n if (nestedListClassName !== undefined) {\n const nestedListItemClasses = nestedListClassName.split(\" \");\n\n if (listDepth > 1) {\n classesToAdd.push(...nestedListItemClasses);\n } else {\n classesToRemove.push(...nestedListItemClasses);\n }\n }\n }\n\n if (classesToRemove.length > 0) {\n removeClassNamesFromElement(dom, ...classesToRemove);\n }\n\n if (classesToAdd.length > 0) {\n addClassNamesToElement(dom, ...classesToAdd);\n }\n}\n\n/*\n * This function normalizes the children of a ListNode after the conversion from HTML,\n * ensuring that they are all ListItemNodes and contain either a single nested ListNode\n * or some other inline content.\n */\nfunction normalizeChildren(nodes: Array<WebinyListNode>): Array<WebinyListItemNode> {\n const normalizedListItems: Array<WebinyListItemNode> = [];\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if ($isWebinyListItemNode(node)) {\n normalizedListItems.push(node);\n node.getChildren().forEach(child => {\n if ($isWebinyListNode(child)) {\n normalizedListItems.push(wrapInListItem(child));\n }\n });\n } else {\n normalizedListItems.push(wrapInListItem(node));\n }\n }\n return normalizedListItems;\n}\n\nfunction convertWebinyListNode(domNode: Node): DOMConversionOutput {\n const nodeName = domNode.nodeName.toLowerCase();\n let node = null;\n\n if (nodeName === \"ol\") {\n node = $createWebinyListNode(\"number\", \"\");\n } else if (nodeName === \"ul\") {\n node = $createWebinyListNode(\"bullet\", \"\");\n }\n\n return {\n // @ts-ignore\n after: normalizeChildren,\n node\n };\n}\n\nconst TAG_TO_WEBINY_LIST_TYPE: Record<string, ListType> = {\n ol: \"number\",\n ul: \"bullet\"\n};\n\nexport function $createWebinyListNode(\n listType: ListType,\n themeStyleId: string,\n start = 1\n): WebinyListNode {\n return new WebinyListNode(listType, themeStyleId, start);\n}\n\nexport function $isWebinyListNode(node: LexicalNode | null | undefined): node is Webiny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,KAAK,IAAI,EAAE;IAC1BpD,IAAI,GAAGI,qBAAqB,CAAC,QAAQ,EAAE,EAAE,CAAC;EAC9C;EAEA,OAAO;IACH;IACAkD,KAAK,EAAEV,iBAAiB;IACxB5C,IAAI,EAAJA;EACJ,CAAC;AACL;AAEA,IAAMtB,uBAAiD,GAAG;EACtDoC,EAAE,EAAE,QAAQ;EACZE,EAAE,EAAE;AACR,CAAC;AAEM,SAASZ,qBAAqB,CACjChC,QAAkB,EAClBC,YAAoB,EAEN;EAAA,IADdC,KAAK,uEAAG,CAAC;EAET,OAAO,IAAIH,cAAc,CAACC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,CAAC;AAC5D;AAEO,SAAS2E,iBAAiB,CAACjD,IAAoC,EAA0B;EAC5F,OAAOA,IAAI,YAAY7B,cAAc;AACzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LexicalEditor, LexicalNode } from "lexical";
|
|
2
|
+
import { WebinyListNode } from "./WebinyListNode";
|
|
3
|
+
import { WebinyListItemNode } from "./WebinyListItemNode";
|
|
4
|
+
import { ListType } from "@lexical/list";
|
|
5
|
+
export declare function insertList(editor: LexicalEditor, listType: ListType, styleId: string): void;
|
|
6
|
+
export declare function removeList(editor: LexicalEditor): void;
|
|
7
|
+
export declare function updateChildrenListItemValue(list: WebinyListNode, children?: Array<LexicalNode>): void;
|
|
8
|
+
export declare function $handleIndent(WebinyListItemNodes: Array<WebinyListItemNode>): void;
|
|
9
|
+
export declare function $handleOutdent(WebinyListItemNodes: Array<WebinyListItemNode>): void;
|
|
10
|
+
export declare function indentList(): void;
|
|
11
|
+
export declare function outdentList(): void;
|
|
12
|
+
export declare function $handleListInsertParagraph(): boolean;
|