@haklex/rich-ext-code-snippet 0.32.0 → 0.33.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.
- package/dist/{CodeSnippetNode-DO5bRB-H.js → CodeSnippetNode-CmjgIWmm.js} +4 -4
- package/dist/{CodeSnippetRenderer-aaIktveQ.js → CodeSnippetRenderer-CVcw3SRW.js} +1 -1
- package/dist/{edit-DIncLyO8.js → edit-BxlBj5vH.js} +9 -8
- package/dist/edit.mjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{node-DHW26S-e.js → node-o-rq-ZHb.js} +1 -1
- package/dist/node.mjs +2 -2
- package/dist/renderer.mjs +1 -1
- package/dist/static.mjs +3 -3
- package/package.json +18 -18
|
@@ -9,7 +9,7 @@ import { createRendererDecoration } from "@haklex/rich-editor/renderers";
|
|
|
9
9
|
*/
|
|
10
10
|
var CODE_SNIPPET_NODE_KEY = "CodeSnippet";
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region \0@oxc-project+runtime@0.
|
|
12
|
+
//#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
|
|
13
13
|
function _typeof(o) {
|
|
14
14
|
"@babel/helpers - typeof";
|
|
15
15
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -19,7 +19,7 @@ function _typeof(o) {
|
|
|
19
19
|
}, _typeof(o);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region \0@oxc-project+runtime@0.
|
|
22
|
+
//#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
|
|
23
23
|
function toPrimitive(t, r) {
|
|
24
24
|
if ("object" != _typeof(t) || !t) return t;
|
|
25
25
|
var e = t[Symbol.toPrimitive];
|
|
@@ -31,13 +31,13 @@ function toPrimitive(t, r) {
|
|
|
31
31
|
return ("string" === r ? String : Number)(t);
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region \0@oxc-project+runtime@0.
|
|
34
|
+
//#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
|
|
35
35
|
function toPropertyKey(t) {
|
|
36
36
|
var i = toPrimitive(t, "string");
|
|
37
37
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
|
-
//#region \0@oxc-project+runtime@0.
|
|
40
|
+
//#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
|
|
41
41
|
function _defineProperty(e, r, t) {
|
|
42
42
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
43
43
|
value: t,
|
|
@@ -4,7 +4,7 @@ import { normalizeLanguage } from "@haklex/rich-renderer-codeblock/constants";
|
|
|
4
4
|
import { FileIcon } from "@haklex/rich-renderer-codeblock/icons";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { SHIKI_DUAL_THEMES, getHighlighterWithLang } from "@haklex/rich-renderer-codeblock/shiki";
|
|
7
|
-
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.21.
|
|
7
|
+
//#region ../../node_modules/.pnpm/@vanilla-extract+recipes@0.5.7_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js
|
|
8
8
|
function toPrimitive(t, r) {
|
|
9
9
|
if ("object" != typeof t || !t) return t;
|
|
10
10
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as modalSidebar, D as semanticClassNames, E as renameInput, O as sidebarAddButton, S as modalIconButton, T as modalTitlebar, _ as fileList, a as breadcrumbLeft, b as modalBody, c as dragOverlay, d as editOverlay, f as editorContainer, g as fileItem, h as fileIcon, k as sidebarHeader, l as editContainer, m as fileDragHandle, n as getLanguageFromFilename, r as breadcrumb, s as codeSnippetDialogPopup, t as CodeSnippetRenderer, u as editLabel, v as fileName, w as modalTitle, x as modalEditor, y as modal } from "./CodeSnippetRenderer-
|
|
2
|
-
import { i as _defineProperty, n as $isCodeSnippetNode, r as CodeSnippetNode } from "./CodeSnippetNode-
|
|
1
|
+
import { C as modalSidebar, D as semanticClassNames, E as renameInput, O as sidebarAddButton, S as modalIconButton, T as modalTitlebar, _ as fileList, a as breadcrumbLeft, b as modalBody, c as dragOverlay, d as editOverlay, f as editorContainer, g as fileItem, h as fileIcon, k as sidebarHeader, l as editContainer, m as fileDragHandle, n as getLanguageFromFilename, r as breadcrumb, s as codeSnippetDialogPopup, t as CodeSnippetRenderer, u as editLabel, v as fileName, w as modalTitle, x as modalEditor, y as modal } from "./CodeSnippetRenderer-CVcw3SRW.js";
|
|
2
|
+
import { i as _defineProperty, n as $isCodeSnippetNode, r as CodeSnippetNode } from "./CodeSnippetNode-CmjgIWmm.js";
|
|
3
3
|
import { $getNodeByKey, $insertNodes } from "lexical";
|
|
4
4
|
import { FileCode, GripVertical, Pencil, Plus, Trash2, X } from "lucide-react";
|
|
5
5
|
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -336,14 +336,15 @@ var CodeSnippetEditRenderer = ({ files, onFilesChange }) => {
|
|
|
336
336
|
//#region src/CodeSnippetEditDecorator.tsx
|
|
337
337
|
var CodeSnippetEditDecorator = ({ nodeKey, files }) => {
|
|
338
338
|
const [editor] = useLexicalComposerContext();
|
|
339
|
+
const onFilesChange = useCallback((newFiles) => {
|
|
340
|
+
editor.update(() => {
|
|
341
|
+
const node = $getNodeByKey(nodeKey);
|
|
342
|
+
if ($isCodeSnippetNode(node)) node.setFiles(newFiles);
|
|
343
|
+
});
|
|
344
|
+
}, [editor, nodeKey]);
|
|
339
345
|
return /* @__PURE__ */ jsx(CodeSnippetEditRenderer, {
|
|
340
346
|
files,
|
|
341
|
-
onFilesChange
|
|
342
|
-
editor.update(() => {
|
|
343
|
-
const node = $getNodeByKey(nodeKey);
|
|
344
|
-
if ($isCodeSnippetNode(node)) node.setFiles(newFiles);
|
|
345
|
-
});
|
|
346
|
-
}, [editor, nodeKey])
|
|
347
|
+
onFilesChange
|
|
347
348
|
});
|
|
348
349
|
};
|
|
349
350
|
//#endregion
|
package/dist/edit.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
|
|
2
|
-
import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-
|
|
2
|
+
import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-BxlBj5vH.js";
|
|
3
3
|
export { $createCodeSnippetEditNode, $isCodeSnippetEditNode, CodeSnippetEditNode, CodeSnippetEditRenderer, __augmentLoaded_code_snippet, codeSnippetEditNodes };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
|
|
2
|
-
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-
|
|
3
|
-
import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-
|
|
4
|
-
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-
|
|
5
|
-
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-
|
|
2
|
+
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-CVcw3SRW.js";
|
|
3
|
+
import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-BxlBj5vH.js";
|
|
4
|
+
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-CmjgIWmm.js";
|
|
5
|
+
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-o-rq-ZHb.js";
|
|
6
6
|
import "./renderer.mjs";
|
|
7
7
|
export { $createCodeSnippetEditNode, $createCodeSnippetNode, $isCodeSnippetEditNode, $isCodeSnippetNode, CODE_SNIPPET_BLOCK_TRANSFORMER, CODE_SNIPPET_NODE_KEY, CodeSnippetEditNode, CodeSnippetEditRenderer, CodeSnippetNode, CodeSnippetRenderer, __augmentLoaded_code_snippet, codeSnippetEditNodes, codeSnippetNodes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CodeSnippetNode } from "./CodeSnippetNode-
|
|
1
|
+
import { r as CodeSnippetNode } from "./CodeSnippetNode-CmjgIWmm.js";
|
|
2
2
|
import { CODE_SNIPPET_BLOCK_TRANSFORMER } from "@haklex/rich-headless/transformers";
|
|
3
3
|
//#region src/node.ts
|
|
4
4
|
var codeSnippetNodes = [CodeSnippetNode];
|
package/dist/node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
|
|
2
|
-
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-
|
|
3
|
-
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-
|
|
2
|
+
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-CmjgIWmm.js";
|
|
3
|
+
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-o-rq-ZHb.js";
|
|
4
4
|
export { $createCodeSnippetNode, $isCodeSnippetNode, CODE_SNIPPET_BLOCK_TRANSFORMER, CODE_SNIPPET_NODE_KEY, CodeSnippetNode, __augmentLoaded_code_snippet, codeSnippetNodes };
|
package/dist/renderer.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
|
|
2
|
-
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-
|
|
2
|
+
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-CVcw3SRW.js";
|
|
3
3
|
//#region src/renderer.ts
|
|
4
4
|
var renderer_default = CodeSnippetRenderer;
|
|
5
5
|
//#endregion
|
package/dist/static.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
|
|
2
|
-
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-
|
|
3
|
-
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-
|
|
4
|
-
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-
|
|
2
|
+
import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-CVcw3SRW.js";
|
|
3
|
+
import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-CmjgIWmm.js";
|
|
4
|
+
import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-o-rq-ZHb.js";
|
|
5
5
|
import "./renderer.mjs";
|
|
6
6
|
export { $createCodeSnippetNode, $isCodeSnippetNode, CODE_SNIPPET_BLOCK_TRANSFORMER, CODE_SNIPPET_NODE_KEY, CodeSnippetNode, CodeSnippetRenderer, __augmentLoaded_code_snippet, codeSnippetNodes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-ext-code-snippet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Multi-file code snippet extension",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,38 +39,38 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@codemirror/commands": "^6.10.4",
|
|
41
41
|
"@codemirror/state": "^6.7.1",
|
|
42
|
-
"@codemirror/view": "^6.43.
|
|
42
|
+
"@codemirror/view": "^6.43.7",
|
|
43
43
|
"@dnd-kit/core": "^6.3.1",
|
|
44
44
|
"@dnd-kit/sortable": "^10.0.0",
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
|
46
|
-
"@haklex/cm-editor": "0.
|
|
47
|
-
"@haklex/rich-headless": "0.
|
|
48
|
-
"@haklex/rich-renderer-codeblock": "0.
|
|
46
|
+
"@haklex/cm-editor": "0.33.0",
|
|
47
|
+
"@haklex/rich-headless": "0.33.0",
|
|
48
|
+
"@haklex/rich-renderer-codeblock": "0.33.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@lexical/react": "^0.
|
|
52
|
-
"@types/react": "^19.2.
|
|
53
|
-
"@types/react-dom": "^19.2.
|
|
54
|
-
"@vanilla-extract/css": "^1.21.
|
|
51
|
+
"@lexical/react": "^0.49.0",
|
|
52
|
+
"@types/react": "^19.2.18",
|
|
53
|
+
"@types/react-dom": "^19.2.4",
|
|
54
|
+
"@vanilla-extract/css": "^1.21.2",
|
|
55
55
|
"@vanilla-extract/recipes": "^0.5.7",
|
|
56
|
-
"@vanilla-extract/vite-plugin": "^5.2.
|
|
57
|
-
"lexical": "^0.
|
|
56
|
+
"@vanilla-extract/vite-plugin": "^5.2.6",
|
|
57
|
+
"lexical": "^0.49.0",
|
|
58
58
|
"react": "^19.2.8",
|
|
59
59
|
"react-dom": "^19.2.8",
|
|
60
|
-
"shiki": "^4.
|
|
60
|
+
"shiki": "^4.4.1",
|
|
61
61
|
"typescript": "^7.0.2",
|
|
62
62
|
"unplugin-dts": "^1.0.3",
|
|
63
|
-
"vite": "^8.
|
|
63
|
+
"vite": "^8.2.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@lexical/react": "^0.
|
|
67
|
-
"lexical": "^0.
|
|
66
|
+
"@lexical/react": "^0.49.0",
|
|
67
|
+
"lexical": "^0.49.0",
|
|
68
68
|
"lucide-react": "^1.0.0",
|
|
69
69
|
"react": ">=19",
|
|
70
70
|
"shiki": ">=4.0.0",
|
|
71
|
-
"@haklex/rich-editor": "^0.
|
|
72
|
-
"@haklex/rich-style-token": "^0.
|
|
73
|
-
"@haklex/rich-editor-ui": "^0.
|
|
71
|
+
"@haklex/rich-editor": "^0.33.0",
|
|
72
|
+
"@haklex/rich-style-token": "^0.33.0",
|
|
73
|
+
"@haklex/rich-editor-ui": "^0.33.0"
|
|
74
74
|
},
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|