@haklex/rich-renderer-katex 0.0.2 → 0.0.4
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/dist/KaTeXEditDecorator.d.ts.map +1 -1
- package/dist/index.mjs +13 -21
- package/dist/rich-renderer-katex.css +0 -24
- package/package.json +7 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXEditDecorator.d.ts","sourceRoot":"","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KaTeXEditDecorator.d.ts","sourceRoot":"","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGzC,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,YAAY,CAAA;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,QAAQ,GACT,EAAE,uBAAuB,2CA8NzB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $isKaTeXInlineNode, $isKaTeXBlockNode, KaTeXRenderer, KaTeXBlockNode, createRendererDecoration, KaTeXInlineNode } from "@haklex/rich-editor";
|
|
2
2
|
import { useState, useRef, useEffect, useCallback, createElement } from "react";
|
|
3
3
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
-
import { Popover, PopoverTrigger, PopoverPanel } from "@haklex/rich-editor-ui";
|
|
4
|
+
import { Popover, PopoverTrigger, PopoverPanel, AnimatedTabs } from "@haklex/rich-editor-ui";
|
|
5
5
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import { $getNodeByKey } from "lexical";
|
|
7
7
|
import { Terminal, Trash2, Check, Copy, RotateCcw } from "lucide-react";
|
|
@@ -111,26 +111,18 @@ function KaTeXEditDecorator({
|
|
|
111
111
|
)
|
|
112
112
|
] })
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
type: "button",
|
|
128
|
-
className: `rich-katex-editor-tab ${activeTab === "snippets" ? "rich-katex-editor-tab-active" : ""}`,
|
|
129
|
-
onClick: () => setActiveTab("snippets"),
|
|
130
|
-
children: "Snippets"
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
] }),
|
|
114
|
+
/* @__PURE__ */ jsx(
|
|
115
|
+
AnimatedTabs,
|
|
116
|
+
{
|
|
117
|
+
tabs: [
|
|
118
|
+
{ id: "editor", label: "Editor" },
|
|
119
|
+
{ id: "snippets", label: "Snippets" }
|
|
120
|
+
],
|
|
121
|
+
value: activeTab,
|
|
122
|
+
onChange: (id) => setActiveTab(id),
|
|
123
|
+
className: "rich-katex-editor-tabs"
|
|
124
|
+
}
|
|
125
|
+
),
|
|
134
126
|
activeTab === "editor" && /* @__PURE__ */ jsxs("div", { className: "rich-katex-editor-body", children: [
|
|
135
127
|
/* @__PURE__ */ jsxs("div", { className: "rich-katex-editor-field", children: [
|
|
136
128
|
/* @__PURE__ */ jsx("label", { className: "rich-katex-editor-label", children: "LaTeX Input" }),
|
|
@@ -75,31 +75,7 @@
|
|
|
75
75
|
background-color: color-mix(in srgb, var(--rc-alert-caution) 10%, transparent);
|
|
76
76
|
}
|
|
77
77
|
.rich-katex-editor-tabs {
|
|
78
|
-
display: flex;
|
|
79
78
|
padding: 0 16px;
|
|
80
|
-
border-bottom: 1px solid color-mix(in srgb, var(--rc-border) 60%, transparent);
|
|
81
|
-
gap: 0;
|
|
82
|
-
}
|
|
83
|
-
.rich-katex-editor-tab {
|
|
84
|
-
position: relative;
|
|
85
|
-
appearance: none;
|
|
86
|
-
border: none;
|
|
87
|
-
border-bottom: 2px solid transparent;
|
|
88
|
-
background: none;
|
|
89
|
-
color: var(--rc-text-secondary);
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
padding: 0 12px;
|
|
92
|
-
height: 36px;
|
|
93
|
-
font-size: 12px;
|
|
94
|
-
font-weight: 500;
|
|
95
|
-
transition: color 0.15s ease;
|
|
96
|
-
}
|
|
97
|
-
.rich-katex-editor-tab:hover {
|
|
98
|
-
color: var(--rc-text);
|
|
99
|
-
}
|
|
100
|
-
.rich-katex-editor-tab-active {
|
|
101
|
-
color: var(--rc-accent);
|
|
102
|
-
border-bottom-color: var(--rc-accent);
|
|
103
79
|
}
|
|
104
80
|
.rich-katex-editor-body {
|
|
105
81
|
padding: 12px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-katex",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "KaTeX math renderer for haklex rich editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"lucide-react": "^0.574.0"
|
|
19
|
+
"lucide-react": "^0.574.0",
|
|
20
|
+
"@haklex/rich-editor": "0.0.4",
|
|
21
|
+
"@haklex/rich-editor-ui": "0.0.4",
|
|
22
|
+
"@haklex/rich-style-token": "0.0.4"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
22
25
|
"@lexical/react": "^0.39.0",
|
|
@@ -30,20 +33,14 @@
|
|
|
30
33
|
"react-dom": ">=19",
|
|
31
34
|
"typescript": "^5.9.0",
|
|
32
35
|
"vite": "^7.3.1",
|
|
33
|
-
"vite-plugin-dts": "^4.5.0"
|
|
34
|
-
"@haklex/rich-editor": "0.0.2",
|
|
35
|
-
"@haklex/rich-editor-ui": "0.0.2",
|
|
36
|
-
"@haklex/rich-style-token": "0.0.2"
|
|
36
|
+
"vite-plugin-dts": "^4.5.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@lexical/react": "^0.39.0",
|
|
40
40
|
"katex": ">=0.16.0",
|
|
41
41
|
"lexical": "^0.39.0",
|
|
42
42
|
"react": ">=19",
|
|
43
|
-
"react-dom": ">=19"
|
|
44
|
-
"@haklex/rich-editor": "0.0.2",
|
|
45
|
-
"@haklex/rich-editor-ui": "0.0.2",
|
|
46
|
-
"@haklex/rich-style-token": "0.0.2"
|
|
43
|
+
"react-dom": ">=19"
|
|
47
44
|
},
|
|
48
45
|
"peerDependenciesMeta": {
|
|
49
46
|
"katex": {
|