@haklex/rich-renderer-katex 0.0.110 → 0.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXInlineEditNode.d.ts","sourceRoot":"","sources":["../src/KaTeXInlineEditNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB;
|
|
1
|
+
{"version":3,"file":"KaTeXInlineEditNode.d.ts","sourceRoot":"","sources":["../src/KaTeXInlineEditNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,qBAAa,mBAAoB,SAAQ,eAAe;IACtD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,mBAAmB;IAS5D,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,yBAAyB,GAAG,mBAAmB;IAMjF,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAetE"}
|
package/dist/index.mjs
CHANGED
|
@@ -556,24 +556,29 @@ class KaTeXInlineEditNode extends KaTeXInlineNode {
|
|
|
556
556
|
return new KaTeXInlineEditNode(
|
|
557
557
|
node.__equation,
|
|
558
558
|
node.__key,
|
|
559
|
-
node.getShouldAutoOpenOnMount()
|
|
559
|
+
node.getShouldAutoOpenOnMount(),
|
|
560
|
+
node.__color
|
|
560
561
|
);
|
|
561
562
|
}
|
|
562
563
|
static importJSON(serializedNode) {
|
|
563
|
-
|
|
564
|
+
const node = new KaTeXInlineEditNode(serializedNode.equation);
|
|
565
|
+
if (serializedNode.color) node.setColor(serializedNode.color);
|
|
566
|
+
return node;
|
|
564
567
|
}
|
|
565
568
|
decorate(_editor, _config) {
|
|
566
569
|
const rendererEl = createRendererDecoration("KaTeX", KaTeXRenderer, {
|
|
567
570
|
equation: this.__equation,
|
|
568
571
|
displayMode: false
|
|
569
572
|
});
|
|
570
|
-
|
|
573
|
+
const decorator = createElement(KaTeXEditDecorator, {
|
|
571
574
|
nodeKey: this.__key,
|
|
572
575
|
equation: this.__equation,
|
|
573
576
|
displayMode: false,
|
|
574
577
|
autoOpenOnMount: this.getShouldAutoOpenOnMount(),
|
|
575
578
|
children: rendererEl
|
|
576
579
|
});
|
|
580
|
+
if (!this.__color) return decorator;
|
|
581
|
+
return createElement("span", { style: { color: this.__color } }, decorator);
|
|
577
582
|
}
|
|
578
583
|
}
|
|
579
584
|
const katexEditNodes = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-katex",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "KaTeX math renderer for haklex rich editor",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@haklex/rich-editor": "0.0
|
|
25
|
-
"@haklex/rich-
|
|
26
|
-
"@haklex/rich-
|
|
24
|
+
"@haklex/rich-editor": "0.1.0",
|
|
25
|
+
"@haklex/rich-style-token": "0.1.0",
|
|
26
|
+
"@haklex/rich-editor-ui": "0.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@lexical/react": "^0.43.0",
|