@webiny/lexical-nodes 5.43.0-beta.0 → 5.43.0-beta.2
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/FontColorNode.d.ts +1 -1
- package/FontColorNode.js.map +1 -1
- package/package.json +15 -15
package/FontColorNode.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare class FontColorNode extends TextNode {
|
|
|
31
31
|
splitText(...splitOffsets: Array<number>): Array<FontColorNode>;
|
|
32
32
|
exportJSON(): SerializedFontColorNode;
|
|
33
33
|
private addColorValueToHTMLElement;
|
|
34
|
-
updateDOM(prevNode:
|
|
34
|
+
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
|
|
35
35
|
getColorStyle(): {
|
|
36
36
|
color: string;
|
|
37
37
|
themeColor: string;
|
package/FontColorNode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_lexical","require","ThemeColorValue","exports","value","name","_classCallCheck2","default","_createClass2","key","getValue","getName","updateFromTheme","theme","styles","colors","ADD_FONT_COLOR_COMMAND","createCommand","FontColorNodeAttrName","FontColorNode","_TextNode","text","color","_this","_callSuper2","__color","_inherits2","splitText","_this2","_len","arguments","length","splitOffsets","Array","_key","newNodes","_superPropGet2","selection","$getSelection","fontColorNodes","map","node","fontColorNode","$createFontColorNode","getTextContent","$applyStylesToNode","newNode","replace","$isRangeSelection","anchor","focus","getKey","exportJSON","_objectSpread2","themeColor","type","version","addColorValueToHTMLElement","element","setAttribute","style","updateDOM","prevNode","dom","config","isUpdated","getColorStyle","createDOM","getType","clone","__text","__key","importJSON","serializedNode","setTextContent","setFormat","format","setDetail","detail","setMode","mode","setStyle","TextNode","$isFontColorNode","source","getFormat","getStyle"],"sources":["FontColorNode.ts"],"sourcesContent":["import {\n $getSelection,\n $isRangeSelection,\n createCommand,\n EditorConfig,\n LexicalNode,\n SerializedTextNode,\n Spread,\n TextNode\n} from \"lexical\";\nimport { EditorTheme } from \"@webiny/lexical-theme\";\n\nexport class ThemeColorValue {\n // Webiny theme color variable, like color1, color2, etc.\n private readonly name: string;\n // This can be a HEX value or a CSS variable.\n private value: string;\n\n constructor(value: string, name?: string) {\n this.value = value;\n this.name = name ?? \"custom\";\n }\n\n getValue() {\n return this.value;\n }\n\n getName() {\n return this.name;\n }\n\n updateFromTheme(theme: EditorTheme) {\n if (theme?.styles?.colors && this.name !== \"custom\") {\n this.value = theme.styles?.colors[this.name];\n }\n }\n}\n\nexport const ADD_FONT_COLOR_COMMAND = createCommand<FontColorPayload>(\"ADD_FONT_COLOR_COMMAND\");\n\nconst FontColorNodeAttrName = \"data-theme-font-color-name\";\n\nexport interface FontColorPayload {\n color: ThemeColorValue;\n}\n\nexport type SerializedFontColorNode = Spread<\n {\n themeColor: string;\n color: string;\n type: \"font-color-node\";\n version: 1;\n },\n SerializedTextNode\n>;\n\n/**\n * Main responsibility of this node is to apply custom or Webiny theme color to selected text.\n * Extends the original TextNode node to add additional transformation and support for webiny theme font color.\n */\nexport class FontColorNode extends TextNode {\n private readonly __color: ThemeColorValue;\n\n constructor(text: string, color: ThemeColorValue, key?: string) {\n super(text, key);\n this.__color = color;\n }\n\n static override getType(): string {\n return \"font-color-node\";\n }\n\n static override clone(node: FontColorNode): FontColorNode {\n return new FontColorNode(node.__text, node.__color, node.__key);\n }\n\n static override importJSON(serializedNode: SerializedFontColorNode): TextNode {\n const node = new FontColorNode(\n serializedNode.text,\n new ThemeColorValue(serializedNode.color, serializedNode.themeColor)\n );\n node.setTextContent(serializedNode.text);\n node.setFormat(serializedNode.format);\n node.setDetail(serializedNode.detail);\n node.setMode(serializedNode.mode);\n node.setStyle(serializedNode.style);\n return node;\n }\n\n override splitText(...splitOffsets: Array<number>): Array<FontColorNode> {\n const newNodes = super.splitText(...splitOffsets);\n\n const selection = $getSelection();\n\n // After splitting, we need to re-apply styling to the new TextNodes.\n const fontColorNodes = newNodes.map(node => {\n if (node instanceof FontColorNode) {\n return node;\n }\n\n const fontColorNode = $createFontColorNode(node.getTextContent(), this.__color);\n $applyStylesToNode(fontColorNode, this);\n\n const newNode = node.replace(fontColorNode);\n\n // Since we're replacing the existing node, we need to update the selection keys.\n // This is very important to not break the editor functionality!\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const focus = selection.focus;\n\n if (anchor.key === node.getKey()) {\n anchor.key = newNode.getKey();\n }\n\n if (focus.key === node.getKey()) {\n focus.key = newNode.getKey();\n }\n }\n\n return newNode;\n });\n\n return fontColorNodes as Array<FontColorNode>;\n }\n\n override exportJSON(): SerializedFontColorNode {\n return {\n ...super.exportJSON(),\n themeColor: this.__color.getName(),\n color: this.__color.getValue(),\n type: \"font-color-node\",\n version: 1\n };\n }\n\n private addColorValueToHTMLElement(element: HTMLElement, theme: EditorTheme): HTMLElement {\n // Update color from webiny theme\n this.__color.updateFromTheme(theme);\n element.setAttribute(FontColorNodeAttrName, this.__color.getName());\n element.style.color = this.__color.getValue();\n return element;\n }\n\n override updateDOM(prevNode: FontColorNode, dom: HTMLElement, config: EditorConfig): boolean {\n const isUpdated = super.updateDOM(prevNode, dom, config);\n this.__color.updateFromTheme(config.theme as EditorTheme);\n\n dom.setAttribute(FontColorNodeAttrName, this.__color.getName());\n dom.style.color = this.__color.getValue();\n return isUpdated;\n }\n\n getColorStyle() {\n return {\n color: this.__color.getValue(),\n themeColor: this.__color.getName()\n };\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = super.createDOM(config);\n return this.addColorValueToHTMLElement(element, config.theme as EditorTheme);\n }\n}\n\nexport const $createFontColorNode = (text: string, color: ThemeColorValue): FontColorNode => {\n return new FontColorNode(text, color);\n};\n\nexport const $isFontColorNode = (node: LexicalNode): node is FontColorNode => {\n return node instanceof FontColorNode;\n};\n\nexport function $applyStylesToNode(node: TextNode, source: TextNode) {\n node.setFormat(source.getFormat());\n node.setStyle(source.getStyle());\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC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AC;MACxCoB,IAAI,CAACkC,SAAS,CAACF,cAAc,CAACG,MAAM,CAAC;MACrCnC,IAAI,CAACoC,SAAS,CAACJ,cAAc,CAACK,MAAM,CAAC;MACrCrC,IAAI,CAACsC,OAAO,CAACN,cAAc,CAACO,IAAI,CAAC;MACjCvC,IAAI,CAACwC,QAAQ,CAACR,cAAc,CAACb,KAAK,CAAC;MACnC,OAAOnB,IAAI;IACf;EAAC;AAAA,EA3B8ByC,iBAAQ;AA0GpC,IAAMvC,oBAAoB,GAAAxC,OAAA,CAAAwC,oBAAA,GAAG,SAAvBA,oBAAoBA,CAAItB,IAAY,EAAEC,KAAsB,EAAoB;EACzF,OAAO,IAAIH,aAAa,CAACE,IAAI,EAAEC,KAAK,CAAC;AACzC,CAAC;AAEM,IAAM6D,gBAAgB,GAAAhF,OAAA,CAAAgF,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAI1C,IAAiB,EAA4B;EAC1E,OAAOA,IAAI,YAAYtB,aAAa;AACxC,CAAC;AAEM,SAAS0B,kBAAkBA,CAACJ,IAAc,EAAE2C,MAAgB,EAAE;EACjE3C,IAAI,CAACkC,SAAS,CAACS,MAAM,CAACC,SAAS,CAAC,CAAC,CAAC;EAClC5C,IAAI,CAACwC,QAAQ,CAACG,MAAM,CAACE,QAAQ,CAAC,CAAC,CAAC;AACpC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_lexical","require","ThemeColorValue","exports","value","name","_classCallCheck2","default","_createClass2","key","getValue","getName","updateFromTheme","theme","styles","colors","ADD_FONT_COLOR_COMMAND","createCommand","FontColorNodeAttrName","FontColorNode","_TextNode","text","color","_this","_callSuper2","__color","_inherits2","splitText","_this2","_len","arguments","length","splitOffsets","Array","_key","newNodes","_superPropGet2","selection","$getSelection","fontColorNodes","map","node","fontColorNode","$createFontColorNode","getTextContent","$applyStylesToNode","newNode","replace","$isRangeSelection","anchor","focus","getKey","exportJSON","_objectSpread2","themeColor","type","version","addColorValueToHTMLElement","element","setAttribute","style","updateDOM","prevNode","dom","config","isUpdated","getColorStyle","createDOM","getType","clone","__text","__key","importJSON","serializedNode","setTextContent","setFormat","format","setDetail","detail","setMode","mode","setStyle","TextNode","$isFontColorNode","source","getFormat","getStyle"],"sources":["FontColorNode.ts"],"sourcesContent":["import {\n $getSelection,\n $isRangeSelection,\n createCommand,\n EditorConfig,\n LexicalNode,\n SerializedTextNode,\n Spread,\n TextNode\n} from \"lexical\";\nimport { EditorTheme } from \"@webiny/lexical-theme\";\n\nexport class ThemeColorValue {\n // Webiny theme color variable, like color1, color2, etc.\n private readonly name: string;\n // This can be a HEX value or a CSS variable.\n private value: string;\n\n constructor(value: string, name?: string) {\n this.value = value;\n this.name = name ?? \"custom\";\n }\n\n getValue() {\n return this.value;\n }\n\n getName() {\n return this.name;\n }\n\n updateFromTheme(theme: EditorTheme) {\n if (theme?.styles?.colors && this.name !== \"custom\") {\n this.value = theme.styles?.colors[this.name];\n }\n }\n}\n\nexport const ADD_FONT_COLOR_COMMAND = createCommand<FontColorPayload>(\"ADD_FONT_COLOR_COMMAND\");\n\nconst FontColorNodeAttrName = \"data-theme-font-color-name\";\n\nexport interface FontColorPayload {\n color: ThemeColorValue;\n}\n\nexport type SerializedFontColorNode = Spread<\n {\n themeColor: string;\n color: string;\n type: \"font-color-node\";\n version: 1;\n },\n SerializedTextNode\n>;\n\n/**\n * Main responsibility of this node is to apply custom or Webiny theme color to selected text.\n * Extends the original TextNode node to add additional transformation and support for webiny theme font color.\n */\nexport class FontColorNode extends TextNode {\n private readonly __color: ThemeColorValue;\n\n constructor(text: string, color: ThemeColorValue, key?: string) {\n super(text, key);\n this.__color = color;\n }\n\n static override getType(): string {\n return \"font-color-node\";\n }\n\n static override clone(node: FontColorNode): FontColorNode {\n return new FontColorNode(node.__text, node.__color, node.__key);\n }\n\n static override importJSON(serializedNode: SerializedFontColorNode): TextNode {\n const node = new FontColorNode(\n serializedNode.text,\n new ThemeColorValue(serializedNode.color, serializedNode.themeColor)\n );\n node.setTextContent(serializedNode.text);\n node.setFormat(serializedNode.format);\n node.setDetail(serializedNode.detail);\n node.setMode(serializedNode.mode);\n node.setStyle(serializedNode.style);\n return node;\n }\n\n override splitText(...splitOffsets: Array<number>): Array<FontColorNode> {\n const newNodes = super.splitText(...splitOffsets);\n\n const selection = $getSelection();\n\n // After splitting, we need to re-apply styling to the new TextNodes.\n const fontColorNodes = newNodes.map(node => {\n if (node instanceof FontColorNode) {\n return node;\n }\n\n const fontColorNode = $createFontColorNode(node.getTextContent(), this.__color);\n $applyStylesToNode(fontColorNode, this);\n\n const newNode = node.replace(fontColorNode);\n\n // Since we're replacing the existing node, we need to update the selection keys.\n // This is very important to not break the editor functionality!\n if ($isRangeSelection(selection)) {\n const anchor = selection.anchor;\n const focus = selection.focus;\n\n if (anchor.key === node.getKey()) {\n anchor.key = newNode.getKey();\n }\n\n if (focus.key === node.getKey()) {\n focus.key = newNode.getKey();\n }\n }\n\n return newNode;\n });\n\n return fontColorNodes as Array<FontColorNode>;\n }\n\n override exportJSON(): SerializedFontColorNode {\n return {\n ...super.exportJSON(),\n themeColor: this.__color.getName(),\n color: this.__color.getValue(),\n type: \"font-color-node\",\n version: 1\n };\n }\n\n private addColorValueToHTMLElement(element: HTMLElement, theme: EditorTheme): HTMLElement {\n // Update color from webiny theme\n this.__color.updateFromTheme(theme);\n element.setAttribute(FontColorNodeAttrName, this.__color.getName());\n element.style.color = this.__color.getValue();\n return element;\n }\n\n override updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean {\n const isUpdated = super.updateDOM(prevNode, dom, config);\n this.__color.updateFromTheme(config.theme as EditorTheme);\n\n dom.setAttribute(FontColorNodeAttrName, this.__color.getName());\n dom.style.color = this.__color.getValue();\n return isUpdated;\n }\n\n getColorStyle() {\n return {\n color: this.__color.getValue(),\n themeColor: this.__color.getName()\n };\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = super.createDOM(config);\n return this.addColorValueToHTMLElement(element, config.theme as EditorTheme);\n }\n}\n\nexport const $createFontColorNode = (text: string, color: ThemeColorValue): FontColorNode => {\n return new FontColorNode(text, color);\n};\n\nexport const $isFontColorNode = (node: LexicalNode): node is FontColorNode => {\n return node instanceof FontColorNode;\n};\n\nexport function $applyStylesToNode(node: TextNode, source: TextNode) {\n node.setFormat(source.getFormat());\n node.setStyle(source.getStyle());\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASiB,IAGJC,eAAe,GAAAC,OAAA,CAAAD,eAAA;EACxB;;EAEA;;EAGA,SAAAA,gBAAYE,KAAa,EAAEC,IAAa,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAL,eAAA;IACtC,IAAI,CAACE,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAGA,IAAI,IAAI,QAAQ;EAChC;EAAC,WAAAG,aAAA,CAAAD,OAAA,EAAAL,eAAA;IAAAO,GAAA;IAAAL,KAAA,EAED,SAAAM,QAAQA,CAAA,EAAG;MACP,OAAO,IAAI,CAACN,KAAK;IACrB;EAAC;IAAAK,GAAA;IAAAL,KAAA,EAED,SAAAO,OAAOA,CAAA,EAAG;MACN,OAAO,IAAI,CAACN,IAAI;IACpB;EAAC;IAAAI,GAAA;IAAAL,KAAA,EAED,SAAAQ,eAAeA,CAACC,KAAkB,EAAE;MAChC,IAAIA,KAAK,EAAEC,MAAM,EAAEC,MAAM,IAAI,IAAI,CAACV,IAAI,KAAK,QAAQ,EAAE;QACjD,IAAI,CAACD,KAAK,GAAGS,KAAK,CAACC,MAAM,EAAEC,MAAM,CAAC,IAAI,CAACV,IAAI,CAAC;MAChD;IACJ;EAAC;AAAA;AAGE,IAAMW,sBAAsB,GAAAb,OAAA,CAAAa,sBAAA,GAAG,IAAAC,sBAAa,EAAmB,wBAAwB,CAAC;AAE/F,IAAMC,qBAAqB,GAAG,4BAA4B;AAgB1D;AACA;AACA;AACA;AAHA,IAIaC,aAAa,GAAAhB,OAAA,CAA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|
|
3
|
+
"version": "5.43.0-beta.2",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@lexical/code": "0.
|
|
6
|
-
"@lexical/hashtag": "0.
|
|
7
|
-
"@lexical/history": "0.
|
|
8
|
-
"@lexical/list": "0.
|
|
9
|
-
"@lexical/mark": "0.
|
|
10
|
-
"@lexical/overflow": "0.
|
|
11
|
-
"@lexical/react": "0.
|
|
12
|
-
"@lexical/rich-text": "0.
|
|
13
|
-
"@lexical/selection": "0.
|
|
14
|
-
"@lexical/utils": "0.
|
|
5
|
+
"@lexical/code": "0.23.1",
|
|
6
|
+
"@lexical/hashtag": "0.23.1",
|
|
7
|
+
"@lexical/history": "0.23.1",
|
|
8
|
+
"@lexical/list": "0.23.1",
|
|
9
|
+
"@lexical/mark": "0.23.1",
|
|
10
|
+
"@lexical/overflow": "0.23.1",
|
|
11
|
+
"@lexical/react": "0.23.1",
|
|
12
|
+
"@lexical/rich-text": "0.23.1",
|
|
13
|
+
"@lexical/selection": "0.23.1",
|
|
14
|
+
"@lexical/utils": "0.23.1",
|
|
15
15
|
"@types/prismjs": "1.26.4",
|
|
16
|
-
"@webiny/lexical-theme": "5.43.0-beta.
|
|
17
|
-
"lexical": "0.
|
|
16
|
+
"@webiny/lexical-theme": "5.43.0-beta.2",
|
|
17
|
+
"lexical": "0.23.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@webiny/project-utils": "5.43.0-beta.
|
|
20
|
+
"@webiny/project-utils": "5.43.0-beta.2",
|
|
21
21
|
"react": "18.2.0"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "dbed8c263df662358aca18c3cf452cd280f2dfd9"
|
|
39
39
|
}
|