@haklex/rich-plugin-slash-menu 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/index.mjs +2 -12
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -8,9 +8,10 @@ import { $setBlocksType } from "@lexical/selection";
|
|
|
8
8
|
import { INSERT_TABLE_COMMAND } from "@lexical/table";
|
|
9
9
|
import { $getSelection, $isRangeSelection, $createParagraphNode } from "lexical";
|
|
10
10
|
import { Type, Heading1, Heading2, Heading3, TextQuote, Minus, Table, List, ListOrdered, ListChecks } from "lucide-react";
|
|
11
|
-
import { createElement, useMemo,
|
|
11
|
+
import { createElement, useMemo, useState, useCallback } from "react";
|
|
12
12
|
import { MenuOption, useBasicTypeaheadTriggerMatch, LexicalTypeaheadMenuPlugin } from "@lexical/react/LexicalTypeaheadMenuPlugin";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { PortalThemeWrapper } from "@haklex/rich-style-token";
|
|
14
15
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
15
16
|
import { createPortal } from "react-dom";
|
|
16
17
|
class SlashMenuItem extends MenuOption {
|
|
@@ -213,17 +214,6 @@ function SlashMenuList({
|
|
|
213
214
|
)) })
|
|
214
215
|
] }, section.label)) });
|
|
215
216
|
}
|
|
216
|
-
const PortalThemeContext = createContext({
|
|
217
|
-
className: ""
|
|
218
|
-
});
|
|
219
|
-
function usePortalTheme() {
|
|
220
|
-
return use(PortalThemeContext);
|
|
221
|
-
}
|
|
222
|
-
function PortalThemeWrapper({ children }) {
|
|
223
|
-
const { className } = usePortalTheme();
|
|
224
|
-
if (!className) return children;
|
|
225
|
-
return /* @__PURE__ */ jsx("div", { style: { display: "contents" }, className, children });
|
|
226
|
-
}
|
|
227
217
|
function collectNodeSlashItems(editor) {
|
|
228
218
|
const items = [];
|
|
229
219
|
const nodes = editor._nodes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-plugin-slash-menu",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Slash command menu plugin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@haklex/rich-style-token": "0.0.4"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
22
|
"@lexical/list": "^0.39.0",
|
|
20
23
|
"@lexical/react": "^0.39.0",
|
|
@@ -31,8 +34,7 @@
|
|
|
31
34
|
"react-dom": "19.2.4",
|
|
32
35
|
"typescript": "^5.9.0",
|
|
33
36
|
"vite": "^7.3.1",
|
|
34
|
-
"vite-plugin-dts": "^4.5.0"
|
|
35
|
-
"@haklex/rich-style-token": "0.0.2"
|
|
37
|
+
"vite-plugin-dts": "^4.5.0"
|
|
36
38
|
},
|
|
37
39
|
"peerDependencies": {
|
|
38
40
|
"@lexical/list": "^0.39.0",
|
|
@@ -43,8 +45,7 @@
|
|
|
43
45
|
"lexical": "^0.39.0",
|
|
44
46
|
"lucide-react": "^0.574.0",
|
|
45
47
|
"react": ">=19",
|
|
46
|
-
"react-dom": ">=19"
|
|
47
|
-
"@haklex/rich-style-token": "0.0.2"
|
|
48
|
+
"react-dom": ">=19"
|
|
48
49
|
},
|
|
49
50
|
"publishConfig": {
|
|
50
51
|
"access": "public"
|