@webiny/lexical-nodes 6.0.0-beta.0 β†’ 6.0.0-rc.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.
Files changed (83) hide show
  1. package/FontColorNode.d.ts +24 -22
  2. package/FontColorNode.js +114 -103
  3. package/FontColorNode.js.map +1 -1
  4. package/HeadingNode.d.ts +30 -20
  5. package/HeadingNode.js +185 -176
  6. package/HeadingNode.js.map +1 -1
  7. package/ImageNode.d.ts +2 -12
  8. package/ImageNode.js +119 -193
  9. package/ImageNode.js.map +1 -1
  10. package/LinkNode.d.ts +6 -6
  11. package/LinkNode.js +249 -347
  12. package/LinkNode.js.map +1 -1
  13. package/ListItemNode.d.ts +6 -5
  14. package/ListItemNode.js +275 -352
  15. package/ListItemNode.js.map +1 -1
  16. package/ListNode.d.ts +32 -19
  17. package/ListNode.js +170 -210
  18. package/ListNode.js.map +1 -1
  19. package/ParagraphNode.d.ts +30 -20
  20. package/ParagraphNode.js +144 -201
  21. package/ParagraphNode.js.map +1 -1
  22. package/QuoteNode.d.ts +27 -20
  23. package/QuoteNode.js +102 -208
  24. package/QuoteNode.js.map +1 -1
  25. package/README.md +9 -4
  26. package/components/ImageNode/ImageComponent.d.ts +2 -7
  27. package/components/ImageNode/ImageComponent.js +72 -166
  28. package/components/ImageNode/ImageComponent.js.map +1 -1
  29. package/components/ImageNode/ImageResizer.d.ts +1 -8
  30. package/components/ImageNode/ImageResizer.js +80 -95
  31. package/components/ImageNode/ImageResizer.js.map +1 -1
  32. package/generateInitialLexicalValue.d.ts +4 -0
  33. package/generateInitialLexicalValue.js +27 -0
  34. package/generateInitialLexicalValue.js.map +1 -0
  35. package/index.d.ts +19 -23
  36. package/index.js +50 -233
  37. package/index.js.map +1 -1
  38. package/package.json +22 -19
  39. package/prepareLexicalState.d.ts +2 -0
  40. package/prepareLexicalState.js +53 -0
  41. package/prepareLexicalState.js.map +1 -0
  42. package/types.d.ts +5 -9
  43. package/types.js +1 -5
  44. package/types.js.map +1 -1
  45. package/utils/clearNodeFormating.d.ts +2 -2
  46. package/utils/clearNodeFormating.js +12 -18
  47. package/utils/clearNodeFormating.js.map +1 -1
  48. package/utils/formatList.d.ts +4 -4
  49. package/utils/formatList.js +171 -208
  50. package/utils/formatList.js.map +1 -1
  51. package/utils/formatToHeading.d.ts +2 -2
  52. package/utils/formatToHeading.js +8 -15
  53. package/utils/formatToHeading.js.map +1 -1
  54. package/utils/formatToParagraph.d.ts +1 -1
  55. package/utils/formatToParagraph.js +8 -16
  56. package/utils/formatToParagraph.js.map +1 -1
  57. package/utils/formatToQuote.d.ts +1 -1
  58. package/utils/formatToQuote.js +10 -17
  59. package/utils/formatToQuote.js.map +1 -1
  60. package/utils/getStyleId.d.ts +11 -0
  61. package/utils/getStyleId.js +14 -0
  62. package/utils/getStyleId.js.map +1 -0
  63. package/utils/listNode.d.ts +14 -4
  64. package/utils/listNode.js +43 -49
  65. package/utils/listNode.js.map +1 -1
  66. package/utils/toggleLink.d.ts +1 -1
  67. package/utils/toggleLink.js +41 -45
  68. package/utils/toggleLink.js.map +1 -1
  69. package/TypographyNode.d.ts +0 -39
  70. package/TypographyNode.js +0 -147
  71. package/TypographyNode.js.map +0 -1
  72. package/components/ImageNode/ContentEditable.css +0 -22
  73. package/components/ImageNode/ContentEditable.d.ts +0 -12
  74. package/components/ImageNode/ContentEditable.js +0 -26
  75. package/components/ImageNode/ContentEditable.js.map +0 -1
  76. package/components/ImageNode/ImageComponent.css +0 -43
  77. package/components/ImageNode/Placeholder.css +0 -20
  78. package/components/ImageNode/Placeholder.d.ts +0 -15
  79. package/components/ImageNode/Placeholder.js +0 -30
  80. package/components/ImageNode/Placeholder.js.map +0 -1
  81. package/components/ImageNode/SharedHistoryContext.d.ts +0 -10
  82. package/components/ImageNode/SharedHistoryContext.js +0 -27
  83. package/components/ImageNode/SharedHistoryContext.js.map +0 -1
package/QuoteNode.js CHANGED
@@ -1,221 +1,115 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.$createQuoteNode = $createQuoteNode;
8
- exports.$isQuoteNode = $isQuoteNode;
9
- exports.QuoteNode = void 0;
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
14
- var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
- var _lexicalTheme = require("@webiny/lexical-theme");
20
- var _utils = require("@lexical/utils");
21
- var _richText = require("@lexical/rich-text");
22
- var QuoteNode = exports.QuoteNode = /*#__PURE__*/function (_BaseQuoteNode) {
23
- function QuoteNode(themeStyleId, key) {
24
- var _this;
25
- (0, _classCallCheck2.default)(this, QuoteNode);
26
- _this = (0, _callSuper2.default)(this, QuoteNode, [key]);
27
- (0, _defineProperty2.default)(_this, "__styles", []);
28
- if (themeStyleId) {
29
- _this.__styles.push({
30
- styleId: themeStyleId,
31
- type: "typography"
32
- });
33
- }
34
- return _this;
1
+ import { $applyNodeReplacement, addClassNamesToElement } from "lexical";
2
+ import { Theme } from "@webiny/lexical-theme";
3
+ import { QuoteNode as BaseQuoteNode } from "@lexical/rich-text";
4
+ import { getStyleId } from "./utils/getStyleId.js";
5
+ export class QuoteNode extends BaseQuoteNode {
6
+ constructor(options = {}) {
7
+ super(options.key);
8
+ this.__styleId = options?.styleId;
9
+ this.__className = options?.className;
35
10
  }
36
-
37
- /*
38
- * Find the first occurrence of the quoteblock in the theme styles and set as default.
39
- */
40
- (0, _inherits2.default)(QuoteNode, _BaseQuoteNode);
41
- return (0, _createClass2.default)(QuoteNode, [{
42
- key: "setDefaultTypography",
43
- value: function setDefaultTypography(themeEmotionMap) {
44
- var typographyStyle = (0, _lexicalTheme.findTypographyStyleByHtmlTag)("quoteblock", themeEmotionMap);
45
- if (typographyStyle) {
46
- this.__styles.push({
47
- styleId: typographyStyle.id,
48
- type: "typography"
49
- });
50
- }
51
- }
52
- }, {
53
- key: "typographyStyleExist",
54
- value: function typographyStyleExist(themeEmotionMap) {
55
- var styleId = this.getTypographyStyleId();
56
- if (!styleId) {
57
- return false;
58
- }
59
- var style = themeEmotionMap[styleId];
60
- return !!style;
61
- }
62
- }, {
63
- key: "setTypography",
64
- value: function setTypography(typographyStyleId) {
65
- var self = (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "getWritable", this).call(this);
66
- if (!typographyStyleId) {
67
- return self;
68
- }
69
- if (!this.hasTypographyStyle()) {
70
- var themeStyle = {
71
- styleId: typographyStyleId,
72
- type: "typography"
73
- };
74
- self.__styles.push(themeStyle);
75
- }
76
- return self;
77
- }
78
- }, {
79
- key: "getTypographyStyleId",
80
- value: function getTypographyStyleId() {
81
- var style = this.__styles.find(function (x) {
82
- return x.type === "typography";
83
- });
84
- return style?.styleId || undefined;
85
- }
86
- }, {
87
- key: "clearTypographyStyle",
88
- value: function clearTypographyStyle() {
89
- var self = (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "getWritable", this).call(this);
90
- self.__styles = self.__styles.filter(function (s) {
91
- return s.type !== "typography";
92
- });
93
- return self;
94
- }
95
- }, {
96
- key: "hasTypographyStyle",
97
- value: function hasTypographyStyle() {
98
- return !!this.getTypographyStyleId();
99
- }
100
- }, {
101
- key: "getThemeStyles",
102
- value: function getThemeStyles() {
103
- var self = (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "getLatest", this).call(this);
104
- return self.__styles;
105
- }
106
- }, {
107
- key: "setThemeStyles",
108
- value: function setThemeStyles(styles) {
109
- var self = (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "getWritable", this).call(this);
110
- self.__styles = (0, _toConsumableArray2.default)(styles);
111
- return self;
112
- }
113
- }, {
114
- key: "addThemeStylesToHTMLElement",
115
- value: function addThemeStylesToHTMLElement(element, theme) {
116
- var themeEmotionMap = theme?.emotionMap;
117
- if (!themeEmotionMap) {
118
- return element;
119
- }
120
-
121
- // style exist and is in active use
122
- if (this.hasTypographyStyle() && this.typographyStyleExist(themeEmotionMap)) {
123
- var styleId = this.getTypographyStyleId();
124
- if (styleId) {
125
- var typographyValue = themeEmotionMap[styleId];
126
- (0, _utils.addClassNamesToElement)(element, typographyValue?.className);
127
- return element;
128
- }
129
- }
130
- return element;
11
+ getStyleId() {
12
+ return this.__styleId;
13
+ }
14
+ setStyleId(styleId) {
15
+ this.__styleId = styleId;
16
+ }
17
+ setClassName(className) {
18
+ this.__className = className;
19
+ }
20
+ getClassName() {
21
+ return this.__className;
22
+ }
23
+ setDefaultTypography(theme) {
24
+ // For some time in v5 we had `quoteblock` as tag name :facepalm: We must not break it.
25
+ const typographyStyle = theme.getTypographyByTag(["blockquote", "quoteblock"]);
26
+ if (typographyStyle) {
27
+ this.__styleId = typographyStyle.id;
28
+ this.__className = typographyStyle.className;
131
29
  }
132
- }, {
133
- key: "createDOM",
134
- value: function createDOM(config) {
135
- var element = (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "createDOM", this).call(this, config);
136
- var wTheme = config.theme;
137
- var emotionThemeMap = wTheme?.emotionMap;
138
- if (!emotionThemeMap) {
139
- return element;
140
- }
141
-
142
- // if styleId is not set or user removed the style from theme, set default style
143
- if (!this.hasTypographyStyle() || !this.typographyStyleExist(emotionThemeMap)) {
144
- this.setDefaultTypography(emotionThemeMap);
30
+ }
31
+ static getType() {
32
+ return "wby-quote";
33
+ }
34
+ static clone(node) {
35
+ return new QuoteNode({
36
+ styleId: node.getStyleId(),
37
+ className: node.getClassName(),
38
+ key: node.getKey()
39
+ });
40
+ }
41
+ createDOM(config) {
42
+ const element = super.createDOM(config);
43
+ return this.updateElementWithThemeClasses(element, Theme.from(config.theme));
44
+ }
45
+ exportDOM(editor) {
46
+ const base = super.exportDOM(editor);
47
+ const element = base.element;
48
+ if (element && this.__className) {
49
+ element.classList.add(this.__className);
50
+ }
51
+ return {
52
+ ...base,
53
+ element
54
+ };
55
+ }
56
+ static importDomConversionMap() {
57
+ return {
58
+ conversion: convertBlockquoteElement,
59
+ priority: 0
60
+ };
61
+ }
62
+ static importDOM() {
63
+ return {
64
+ blockquote: () => {
65
+ return this.importDomConversionMap();
145
66
  }
146
- this.addThemeStylesToHTMLElement(element, config.theme);
147
- return element;
148
- }
149
- }, {
150
- key: "exportJSON",
151
- value: function exportJSON() {
152
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _get2.default)((0, _getPrototypeOf2.default)(QuoteNode.prototype), "exportJSON", this).call(this)), {}, {
153
- type: "webiny-quote",
154
- styles: this.__styles,
155
- styleId: this.getTypographyStyleId()
156
- });
157
- }
158
- }], [{
159
- key: "getType",
160
- value: function getType() {
161
- return "webiny-quote";
162
- }
163
- }, {
164
- key: "clone",
165
- value: function clone(node) {
166
- return new QuoteNode(node.getTypographyStyleId(), node.__key);
167
- }
168
- }, {
169
- key: "importDomConversionMap",
170
- value: function importDomConversionMap() {
171
- return {
172
- conversion: convertBlockquoteElement,
173
- priority: 0
174
- };
175
- }
176
- }, {
177
- key: "importDOM",
178
- value: function importDOM() {
179
- var _this2 = this;
180
- return {
181
- blockquote: function blockquote() {
182
- return _this2.importDomConversionMap();
183
- }
184
- };
67
+ };
68
+ }
69
+ static importJSON(serializedNode) {
70
+ const node = $createQuoteNode();
71
+ node.setFormat(serializedNode.format);
72
+ node.setIndent(serializedNode.indent);
73
+ node.setDirection(serializedNode.direction);
74
+ const styleId = getStyleId({
75
+ styleId: serializedNode.styleId,
76
+ styles: serializedNode.styles
77
+ });
78
+ node.setStyleId(styleId);
79
+ node.setClassName(serializedNode.className);
80
+ return node;
81
+ }
82
+ exportJSON() {
83
+ return {
84
+ ...super.exportJSON(),
85
+ type: "wby-quote",
86
+ className: this.__className,
87
+ styleId: this.__styleId
88
+ };
89
+ }
90
+ updateElementWithThemeClasses(element, theme) {
91
+ if (!this.__styleId || !this.__className) {
92
+ this.setDefaultTypography(theme);
185
93
  }
186
- }, {
187
- key: "importJSON",
188
- value: function importJSON(serializedNode) {
189
- var node = $createQuoteNode();
190
- node.setFormat(serializedNode.format);
191
- node.setIndent(serializedNode.indent);
192
- node.setDirection(serializedNode.direction);
193
- if (!!serializedNode?.styles?.length) {
194
- node.setThemeStyles(serializedNode.styles);
195
- return node;
196
- }
197
- // for old nodes data migrate the style id into the list
198
- if (!!serializedNode?.styleId) {
199
- var styles = [{
200
- styleId: serializedNode.styleId,
201
- type: "typography"
202
- }];
203
- node.setThemeStyles(styles);
204
- }
205
- return node;
94
+ if (this.__className) {
95
+ addClassNamesToElement(element, this.__className);
206
96
  }
207
- }]);
208
- }(_richText.QuoteNode);
97
+ return element;
98
+ }
99
+ }
209
100
  function convertBlockquoteElement() {
210
- var node = $createQuoteNode();
101
+ const node = $createQuoteNode();
211
102
  return {
212
- node: node
103
+ node
213
104
  };
214
105
  }
215
- function $createQuoteNode(themeStyleId, key) {
216
- return new QuoteNode(themeStyleId, key);
106
+ export function $createQuoteNode(styleId, key) {
107
+ return $applyNodeReplacement(new QuoteNode({
108
+ styleId,
109
+ key
110
+ }));
217
111
  }
218
- function $isQuoteNode(node) {
112
+ export function $isQuoteNode(node) {
219
113
  return node instanceof QuoteNode;
220
114
  }
221
115
 
package/QuoteNode.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_lexicalTheme","require","_utils","_richText","QuoteNode","exports","_BaseQuoteNode","themeStyleId","key","_this","_classCallCheck2","default","_callSuper2","_defineProperty2","__styles","push","styleId","type","_inherits2","_createClass2","value","setDefaultTypography","themeEmotionMap","typographyStyle","findTypographyStyleByHtmlTag","id","typographyStyleExist","getTypographyStyleId","style","setTypography","typographyStyleId","self","_get2","_getPrototypeOf2","prototype","call","hasTypographyStyle","themeStyle","find","x","undefined","clearTypographyStyle","filter","s","getThemeStyles","setThemeStyles","styles","_toConsumableArray2","addThemeStylesToHTMLElement","element","theme","emotionMap","typographyValue","addClassNamesToElement","className","createDOM","config","wTheme","emotionThemeMap","exportJSON","_objectSpread2","getType","clone","node","__key","importDomConversionMap","conversion","convertBlockquoteElement","priority","importDOM","_this2","blockquote","importJSON","serializedNode","$createQuoteNode","setFormat","format","setIndent","indent","setDirection","direction","length","BaseQuoteNode","$isQuoteNode"],"sources":["QuoteNode.ts"],"sourcesContent":["import {\n DOMConversion,\n DOMConversionMap,\n EditorConfig,\n LexicalNode,\n NodeKey,\n Spread\n} from \"lexical\";\nimport {\n EditorTheme,\n ThemeEmotionMap,\n WebinyTheme,\n findTypographyStyleByHtmlTag\n} from \"@webiny/lexical-theme\";\nimport { addClassNamesToElement } from \"@lexical/utils\";\nimport {\n QuoteNode as BaseQuoteNode,\n SerializedQuoteNode as BaseSerializedQuoteNode\n} from \"@lexical/rich-text\";\nimport { TextNodeThemeStyles, ThemeStyleValue, TypographyStylesNode } from \"~/types\";\n\nexport type SerializedQuoteNode = Spread<\n {\n styleId?: string;\n styles: ThemeStyleValue[];\n type: \"webiny-quote\";\n },\n BaseSerializedQuoteNode\n>;\n\nexport class QuoteNode extends BaseQuoteNode implements TextNodeThemeStyles, TypographyStylesNode {\n __styles: ThemeStyleValue[] = [];\n\n constructor(themeStyleId?: string, key?: NodeKey) {\n super(key);\n if (themeStyleId) {\n this.__styles.push({ styleId: themeStyleId, type: \"typography\" });\n }\n }\n\n /*\n * Find the first occurrence of the quoteblock in the theme styles and set as default.\n */\n protected setDefaultTypography(themeEmotionMap: ThemeEmotionMap) {\n const typographyStyle = findTypographyStyleByHtmlTag(\"quoteblock\", themeEmotionMap);\n if (typographyStyle) {\n this.__styles.push({ styleId: typographyStyle.id, type: \"typography\" });\n }\n }\n\n protected typographyStyleExist(themeEmotionMap: ThemeEmotionMap): boolean {\n const styleId = this.getTypographyStyleId();\n if (!styleId) {\n return false;\n }\n const style = themeEmotionMap[styleId];\n return !!style;\n }\n\n setTypography(typographyStyleId: string): this {\n const self = super.getWritable();\n if (!typographyStyleId) {\n return self;\n }\n\n if (!this.hasTypographyStyle()) {\n const themeStyle = {\n styleId: typographyStyleId,\n type: \"typography\"\n } as ThemeStyleValue;\n self.__styles.push(themeStyle);\n }\n return self;\n }\n\n getTypographyStyleId(): string | undefined {\n const style = this.__styles.find(x => x.type === \"typography\");\n return style?.styleId || undefined;\n }\n\n clearTypographyStyle(): this {\n const self = super.getWritable();\n self.__styles = self.__styles.filter(s => s.type !== \"typography\");\n return self;\n }\n\n hasTypographyStyle(): boolean {\n return !!this.getTypographyStyleId();\n }\n\n getThemeStyles(): ThemeStyleValue[] {\n const self = super.getLatest();\n return self.__styles;\n }\n\n setThemeStyles(styles: ThemeStyleValue[]) {\n const self = super.getWritable();\n self.__styles = [...styles];\n return self;\n }\n\n static override getType(): string {\n return \"webiny-quote\";\n }\n\n static override clone(node: QuoteNode): QuoteNode {\n return new QuoteNode(node.getTypographyStyleId(), node.__key);\n }\n\n addThemeStylesToHTMLElement(element: HTMLElement, theme: EditorTheme): HTMLElement {\n const themeEmotionMap = theme?.emotionMap;\n\n if (!themeEmotionMap) {\n return element;\n }\n\n // style exist and is in active use\n if (this.hasTypographyStyle() && this.typographyStyleExist(themeEmotionMap)) {\n const styleId = this.getTypographyStyleId();\n if (styleId) {\n const typographyValue = themeEmotionMap[styleId];\n addClassNamesToElement(element, typographyValue?.className);\n return element;\n }\n }\n\n return element;\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = super.createDOM(config);\n const wTheme = config.theme as WebinyTheme;\n const emotionThemeMap = wTheme?.emotionMap;\n\n if (!emotionThemeMap) {\n return element;\n }\n\n // if styleId is not set or user removed the style from theme, set default style\n if (!this.hasTypographyStyle() || !this.typographyStyleExist(emotionThemeMap)) {\n this.setDefaultTypography(emotionThemeMap);\n }\n\n this.addThemeStylesToHTMLElement(element, config.theme);\n return element;\n }\n\n static importDomConversionMap(): DOMConversion<HTMLElement> | null {\n return {\n conversion: convertBlockquoteElement,\n priority: 0\n };\n }\n\n static override importDOM(): DOMConversionMap | null {\n return {\n blockquote: () => {\n return this.importDomConversionMap();\n }\n };\n }\n\n static override importJSON(serializedNode: SerializedQuoteNode): QuoteNode {\n const node = $createQuoteNode();\n node.setFormat(serializedNode.format);\n node.setIndent(serializedNode.indent);\n node.setDirection(serializedNode.direction);\n if (!!serializedNode?.styles?.length) {\n node.setThemeStyles(serializedNode.styles);\n return node;\n }\n // for old nodes data migrate the style id into the list\n if (!!serializedNode?.styleId) {\n const styles = [\n { styleId: serializedNode.styleId, type: \"typography\" }\n ] as ThemeStyleValue[];\n node.setThemeStyles(styles);\n }\n return node;\n }\n\n override exportJSON(): SerializedQuoteNode {\n return {\n ...super.exportJSON(),\n type: \"webiny-quote\",\n styles: this.__styles,\n styleId: this.getTypographyStyleId()\n };\n }\n}\n\nfunction convertBlockquoteElement() {\n const node = $createQuoteNode();\n return {\n node\n };\n}\n\nexport function $createQuoteNode(themeStyleId?: string, key?: NodeKey): QuoteNode {\n return new QuoteNode(themeStyleId, key);\n}\n\nexport function $isQuoteNode(node: LexicalNode | null | undefined): node is QuoteNode {\n return node instanceof QuoteNode;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,IAAAA,aAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAG4B,IAYfG,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAAAE,cAAA;EAGlB,SAAAF,UAAYG,YAAqB,EAAEC,GAAa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zD,GAAA;IAAAY,KAAA,EAED,SAAAoD,WAA2BC,cAAmC,EAAa;MACvE,IAAMV,IAAI,GAAGW,gBAAgB,CAAC,CAAC;MAC/BX,IAAI,CAACY,SAAS,CAACF,cAAc,CAACG,MAAM,CAAC;MACrCb,IAAI,CAACc,SAAS,CAACJ,cAAc,CAACK,MAAM,CAAC;MACrCf,IAAI,CAACgB,YAAY,CAACN,cAAc,CAACO,SAAS,CAAC;MAC3C,IAAI,CAAC,CAACP,cAAc,EAAE3B,MAAM,EAAEmC,MAAM,EAAE;QAClClB,IAAI,CAAClB,cAAc,CAAC4B,cAAc,CAAC3B,MAAM,CAAC;QAC1C,OAAOiB,IAAI;MACf;MACA;MACA,IAAI,CAAC,CAACU,cAAc,EAAEzD,OAAO,EAAE;QAC3B,IAAM8B,MAAM,GAAG,CACX;UAAE9B,OAAO,EAAEyD,cAAc,CAACzD,OAAO;UAAEC,IAAI,EAAE;QAAa,CAAC,CACrC;QACtB8C,IAAI,CAAClB,cAAc,CAACC,MAAM,CAAC;MAC/B;MACA,OAAOiB,IAAI;IACf;EAAC;AAAA,EArJ0BmB,mBAAa;AAiK5C,SAASf,wBAAwBA,CAAA,EAAG;EAChC,IAAMJ,IAAI,GAAGW,gBAAgB,CAAC,CAAC;EAC/B,OAAO;IACHX,IAAI,EAAJA;EACJ,CAAC;AACL;AAEO,SAASW,gBAAgBA,CAACnE,YAAqB,EAAEC,GAAa,EAAa;EAC9E,OAAO,IAAIJ,SAAS,CAACG,YAAY,EAAEC,GAAG,CAAC;AAC3C;AAEO,SAAS2E,YAAYA,CAACpB,IAAoC,EAAqB;EAClF,OAAOA,IAAI,YAAY3D,SAAS;AACpC","ignoreList":[]}
1
+ {"version":3,"names":["$applyNodeReplacement","addClassNamesToElement","Theme","QuoteNode","BaseQuoteNode","getStyleId","constructor","options","key","__styleId","styleId","__className","className","setStyleId","setClassName","getClassName","setDefaultTypography","theme","typographyStyle","getTypographyByTag","id","getType","clone","node","getKey","createDOM","config","element","updateElementWithThemeClasses","from","exportDOM","editor","base","classList","add","importDomConversionMap","conversion","convertBlockquoteElement","priority","importDOM","blockquote","importJSON","serializedNode","$createQuoteNode","setFormat","format","setIndent","indent","setDirection","direction","styles","exportJSON","type","$isQuoteNode"],"sources":["QuoteNode.ts"],"sourcesContent":["import type {\n DOMConversion,\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread\n} from \"lexical\";\nimport { $applyNodeReplacement, addClassNamesToElement } from \"lexical\";\nimport { Theme } from \"@webiny/lexical-theme\";\nimport type { SerializedQuoteNode as BaseSerializedQuoteNode } from \"@lexical/rich-text\";\nimport { QuoteNode as BaseQuoteNode } from \"@lexical/rich-text\";\nimport type { ThemeStyleValue, TypographyStylesNode } from \"~/types.js\";\nimport { getStyleId } from \"~/utils/getStyleId.js\";\n\nexport type SerializedQuoteNode = Spread<\n {\n styleId?: string;\n styles?: ThemeStyleValue[];\n className?: string;\n type: \"wby-quote\";\n },\n BaseSerializedQuoteNode\n>;\n\ninterface QuoteNodeOptions {\n className?: string;\n styleId?: string;\n key?: NodeKey;\n}\n\nexport class QuoteNode extends BaseQuoteNode implements TypographyStylesNode {\n private __styleId: string | undefined;\n private __className: string | undefined;\n\n constructor(options: QuoteNodeOptions = {}) {\n super(options.key);\n this.__styleId = options?.styleId;\n this.__className = options?.className;\n }\n\n getStyleId(): string | undefined {\n return this.__styleId;\n }\n\n setStyleId(styleId: string | undefined) {\n this.__styleId = styleId;\n }\n\n setClassName(className: string | undefined) {\n this.__className = className;\n }\n\n getClassName(): string | undefined {\n return this.__className;\n }\n\n private setDefaultTypography(theme: Theme) {\n // For some time in v5 we had `quoteblock` as tag name :facepalm: We must not break it.\n const typographyStyle = theme.getTypographyByTag([\"blockquote\", \"quoteblock\"]);\n\n if (typographyStyle) {\n this.__styleId = typographyStyle.id;\n this.__className = typographyStyle.className;\n }\n }\n\n static override getType(): string {\n return \"wby-quote\";\n }\n\n static override clone(node: QuoteNode): QuoteNode {\n return new QuoteNode({\n styleId: node.getStyleId(),\n className: node.getClassName(),\n key: node.getKey()\n });\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = super.createDOM(config);\n return this.updateElementWithThemeClasses(element, Theme.from(config.theme));\n }\n\n override exportDOM(editor: LexicalEditor): DOMExportOutput {\n const base = super.exportDOM(editor);\n\n const element = base.element as HTMLElement;\n if (element && this.__className) {\n element.classList.add(this.__className);\n }\n\n return { ...base, element };\n }\n\n static importDomConversionMap(): DOMConversion<HTMLElement> | null {\n return {\n conversion: convertBlockquoteElement,\n priority: 0\n };\n }\n\n static override importDOM(): DOMConversionMap | null {\n return {\n blockquote: () => {\n return this.importDomConversionMap();\n }\n };\n }\n\n static override importJSON(serializedNode: SerializedQuoteNode): QuoteNode {\n const node = $createQuoteNode();\n node.setFormat(serializedNode.format);\n node.setIndent(serializedNode.indent);\n node.setDirection(serializedNode.direction);\n\n const styleId = getStyleId({\n styleId: serializedNode.styleId,\n styles: serializedNode.styles\n });\n\n node.setStyleId(styleId);\n node.setClassName(serializedNode.className);\n\n return node;\n }\n\n override exportJSON(): SerializedQuoteNode {\n return {\n ...super.exportJSON(),\n type: \"wby-quote\",\n className: this.__className,\n styleId: this.__styleId\n };\n }\n\n protected updateElementWithThemeClasses(element: HTMLElement, theme: Theme): HTMLElement {\n if (!this.__styleId || !this.__className) {\n this.setDefaultTypography(theme);\n }\n\n if (this.__className) {\n addClassNamesToElement(element, this.__className);\n }\n\n return element;\n }\n}\n\nfunction convertBlockquoteElement() {\n const node = $createQuoteNode();\n return {\n node\n };\n}\n\nexport function $createQuoteNode(styleId?: string, key?: NodeKey): QuoteNode {\n return $applyNodeReplacement(new QuoteNode({ styleId, key }));\n}\n\nexport function $isQuoteNode(node: LexicalNode | null | undefined): node is QuoteNode {\n return node instanceof QuoteNode;\n}\n"],"mappings":"AAUA,SAASA,qBAAqB,EAAEC,sBAAsB,QAAQ,SAAS;AACvE,SAASC,KAAK,Q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B,cAAc,CAAC9B,SAAS,CAAC;IAE3C,OAAOW,IAAI;EACf;EAES4B,UAAUA,CAAA,EAAwB;IACvC,OAAO;MACH,GAAG,KAAK,CAACA,UAAU,CAAC,CAAC;MACrBC,IAAI,EAAE,WAAW;MACjBxC,SAAS,EAAE,IAAI,CAACD,WAAW;MAC3BD,OAAO,EAAE,IAAI,CAACD;IAClB,CAAC;EACL;EAEUmB,6BAA6BA,CAACD,OAAoB,EAAEV,KAAY,EAAe;IACrF,IAAI,CAAC,IAAI,CAACR,SAAS,IAAI,CAAC,IAAI,CAACE,WAAW,EAAE;MACtC,IAAI,CAACK,oBAAoB,CAACC,KAAK,CAAC;IACpC;IAEA,IAAI,IAAI,CAACN,WAAW,EAAE;MAClBV,sBAAsB,CAAC0B,OAAO,EAAE,IAAI,CAAChB,WAAW,CAAC;IACrD;IAEA,OAAOgB,OAAO;EAClB;AACJ;AAEA,SAASU,wBAAwBA,CAAA,EAAG;EAChC,MAAMd,IAAI,GAAGoB,gBAAgB,CAAC,CAAC;EAC/B,OAAO;IACHpB;EACJ,CAAC;AACL;AAEA,OAAO,SAASoB,gBAAgBA,CAACjC,OAAgB,EAAEF,GAAa,EAAa;EACzE,OAAOR,qBAAqB,CAAC,IAAIG,SAAS,CAAC;IAAEO,OAAO;IAAEF;EAAI,CAAC,CAAC,CAAC;AACjE;AAEA,OAAO,SAAS6C,YAAYA,CAAC9B,IAAoC,EAAqB;EAClF,OAAOA,IAAI,YAAYpB,SAAS;AACpC","ignoreList":[]}
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # @webiny/lexical-nodes
2
2
 
3
- [![](https://img.shields.io/npm/dw/@webiny/lexical-nodes.svg)](https://www.npmjs.com/package/@webiny/llexical-lexical-nodes)
4
- [![](https://img.shields.io/npm/v/@webiny/lexical-nodes.svg)](https://www.npmjs.com/package/@webiny/lexical-nodes)
5
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
6
+
7
+ πŸ“˜ **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
8
+
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -1,18 +1,13 @@
1
- /// <reference types="react" />
2
- import type { LexicalEditor, NodeKey } from "lexical";
3
- import "./ImageComponent.css";
1
+ import type { NodeKey } from "lexical";
4
2
  interface ImageComponentProps {
5
3
  id: string;
6
4
  altText: string;
7
- caption: LexicalEditor;
8
5
  height: "inherit" | number;
9
6
  maxWidth: number;
10
7
  nodeKey: NodeKey;
11
8
  resizable: boolean;
12
- showCaption: boolean;
13
9
  src: string;
14
10
  width: "inherit" | number;
15
- captionsEnabled: boolean;
16
11
  }
17
- export default function ImageComponent({ id, src, altText, nodeKey, width, height, maxWidth, resizable, showCaption, caption, captionsEnabled }: ImageComponentProps): JSX.Element;
12
+ export default function ImageComponent({ id, src, altText, nodeKey, width, height, maxWidth, resizable }: ImageComponentProps): JSX.Element;
18
13
  export {};