@haklex/rich-ext-code-snippet 0.26.2 → 0.26.5

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.
@@ -2,7 +2,8 @@ import { C as modalSidebar, D as semanticClassNames, E as renameInput, O as side
2
2
  import { i as _defineProperty, n as $isCodeSnippetNode, r as CodeSnippetNode } from "./CodeSnippetNode-B2wZFBh6.js";
3
3
  import { $getNodeByKey, $insertNodes } from "lexical";
4
4
  import { FileCode, GripVertical, Pencil, Plus, Trash2, X } from "lucide-react";
5
- import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
5
+ import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
6
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
6
7
  import { useColorScheme } from "@haklex/rich-editor/static";
7
8
  import { presentDialog } from "@haklex/rich-editor-ui";
8
9
  import { usePortalTheme } from "@haklex/rich-style-token";
@@ -17,25 +18,6 @@ import { normalizeLanguage } from "@haklex/rich-renderer-codeblock/constants";
17
18
  import { FileIcon } from "@haklex/rich-renderer-codeblock/icons";
18
19
  import { createPortal } from "react-dom";
19
20
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
- //#region ../../node_modules/.pnpm/@lexical+react@0.45.0_react-dom@19.2.6_react@19.2.6__react@19.2.6_yjs@13.6.29/node_modules/@lexical/react/dist/LexicalComposerContext.prod.mjs
21
- /**
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- *
27
- */
28
- var r = createContext(null);
29
- function o() {
30
- const n = useContext(r);
31
- return n ?? function(n, ...e) {
32
- const r = new URL("https://lexical.dev/docs/error"), t = new URLSearchParams();
33
- t.append("code", n);
34
- for (const n of e) t.append("v", n);
35
- throw r.search = t.toString(), Error(`Minified Lexical error #${n}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
36
- }(8), n;
37
- }
38
- //#endregion
39
21
  //#region src/CodeEditorModal.tsx
40
22
  var SortableFileItem = ({ file, isActive, isEditing, editValue, canDelete, onSelect, onStartRename, onEditChange, onCommitRename, onCancelRename, onDelete }) => {
41
23
  const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({ id: file.filename });
@@ -353,7 +335,7 @@ var CodeSnippetEditRenderer = ({ files, onFilesChange }) => {
353
335
  //#endregion
354
336
  //#region src/CodeSnippetEditDecorator.tsx
355
337
  var CodeSnippetEditDecorator = ({ nodeKey, files }) => {
356
- const [editor] = o();
338
+ const [editor] = useLexicalComposerContext();
357
339
  return /* @__PURE__ */ jsx(CodeSnippetEditRenderer, {
358
340
  files,
359
341
  onFilesChange: useCallback((newFiles) => {
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-CCwT5iqK.js";
2
+ import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-2FpVWtrD.js";
3
3
  export { $createCodeSnippetEditNode, $isCodeSnippetEditNode, CodeSnippetEditNode, CodeSnippetEditRenderer, __augmentLoaded_code_snippet, codeSnippetEditNodes };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as __augmentLoaded_code_snippet } from "./augment-B79wHSjn.js";
2
2
  import { t as CodeSnippetRenderer } from "./CodeSnippetRenderer-B8BuxVDx.js";
3
- import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-CCwT5iqK.js";
3
+ import { a as CodeSnippetEditRenderer, i as CodeSnippetEditNode, n as $createCodeSnippetEditNode, r as $isCodeSnippetEditNode, t as codeSnippetEditNodes } from "./edit-2FpVWtrD.js";
4
4
  import { a as CODE_SNIPPET_NODE_KEY, n as $isCodeSnippetNode, r as CodeSnippetNode, t as $createCodeSnippetNode } from "./CodeSnippetNode-B2wZFBh6.js";
5
5
  import { n as CODE_SNIPPET_BLOCK_TRANSFORMER, t as codeSnippetNodes } from "./node-DpGd-RRA.js";
6
6
  import "./renderer.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-ext-code-snippet",
3
- "version": "0.26.2",
3
+ "version": "0.26.5",
4
4
  "description": "Multi-file code snippet extension",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,9 +43,9 @@
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.26.2",
47
- "@haklex/rich-renderer-codeblock": "0.26.2",
48
- "@haklex/rich-headless": "0.26.2"
46
+ "@haklex/cm-editor": "0.26.5",
47
+ "@haklex/rich-headless": "0.26.5",
48
+ "@haklex/rich-renderer-codeblock": "0.26.5"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@lexical/react": "^0.45.0",
@@ -63,13 +63,14 @@
63
63
  "vite": "^8.0.14"
64
64
  },
65
65
  "peerDependencies": {
66
+ "@lexical/react": "^0.45.0",
66
67
  "lexical": "^0.45.0",
67
68
  "lucide-react": "^1.0.0",
68
69
  "react": ">=19",
69
70
  "shiki": ">=4.0.0",
70
- "@haklex/rich-editor": "0.26.2",
71
- "@haklex/rich-editor-ui": "0.26.2",
72
- "@haklex/rich-style-token": "0.26.2"
71
+ "@haklex/rich-editor-ui": "^0.26.5",
72
+ "@haklex/rich-style-token": "^0.26.5",
73
+ "@haklex/rich-editor": "^0.26.5"
73
74
  },
74
75
  "publishConfig": {
75
76
  "access": "public"