@haklex/rich-renderer-katex 0.69.2 → 0.70.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":"KaTeXEditDecorator.d.ts","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,UAAU,uBAAuB;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAWD,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,uBAAuB,+BA6XzB"}
1
+ {"version":3,"file":"KaTeXEditDecorator.d.ts","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,UAAU,uBAAuB;IAC/B,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAWD,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,uBAAuB,+BA6XzB"}
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { $isKaTeXBlockNode, $isKaTeXInlineNode, KaTeXBlockNode, KaTeXInlineNode } from "@haklex/rich-editor/nodes";
2
2
  import { KaTeXRenderer, createRendererDecoration } from "@haklex/rich-editor/renderers";
3
3
  import { createElement, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
4
- import { ActionButton, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, Field, Kbd, Popover, PopoverBody, PopoverFooter, PopoverHeader, PopoverPanel, PopoverTrigger, SegmentedControl, TextInput, confirmDiscardChanges, toast } from "@haklex/rich-editor-ui";
4
+ import { ActionButton, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, Field, Kbd, Popover, PopoverBody, PopoverFooter, PopoverHeader, PopoverPanel, PopoverTrigger, SegmentedControl, TextInput, confirmDiscardChanges, getEditorHistoryShortcut, toast } from "@haklex/rich-editor-ui";
5
5
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
6
6
  import { $getNodeByKey, REDO_COMMAND, UNDO_COMMAND } from "lexical";
7
7
  import { Copy, Ellipsis, Sigma, Trash2 } from "lucide-react";
@@ -35,17 +35,6 @@ var panel = "mkenhu1";
35
35
  var tabs = "mkenhu2";
36
36
  var bodyScrollArea = "mkenhu3";
37
37
  //#endregion
38
- //#region src/history-shortcuts.ts
39
- function getEditorHistoryShortcut(event, options = {}) {
40
- if (options.isDirty) return null;
41
- if (event.altKey) return null;
42
- if (!event.metaKey && !event.ctrlKey) return null;
43
- const key = event.key.toLowerCase();
44
- if (key === "z") return event.shiftKey ? "redo" : "undo";
45
- if (key === "y" && event.ctrlKey && !event.metaKey && !event.shiftKey) return "redo";
46
- return null;
47
- }
48
- //#endregion
49
38
  //#region src/snippets.ts
50
39
  var CURSOR_TOKEN = "__cursor__";
51
40
  var katexSnippets = [
@@ -12,7 +12,6 @@ export interface SnippetInsertionResult {
12
12
  selectionStart: number;
13
13
  value: string;
14
14
  }
15
- export declare const katexSnippets: KaTeXSnippet[];
16
15
  export declare function filterKaTeXSnippets(query: string): KaTeXSnippet[];
17
16
  export declare function insertSnippetAtSelection(value: string, template: string, selectionStart: number | null, selectionEnd: number | null): SnippetInsertionResult;
18
17
  //# sourceMappingURL=snippets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"snippets.d.ts","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,YAAY,EAiEvC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAoBjE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,GAC1B,sBAAsB,CAexB"}
1
+ {"version":3,"file":"snippets.d.ts","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,eAAe,CAAC;AAEzC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAqED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAoBjE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,GAC1B,sBAAsB,CAexB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-renderer-katex",
3
- "version": "0.69.2",
3
+ "version": "0.70.0",
4
4
  "description": "KaTeX math renderer for haklex rich editor",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,9 +34,9 @@
34
34
  "vite": "^8.3.5"
35
35
  },
36
36
  "peerDependencies": {
37
- "@haklex/rich-editor": "^0.69.2",
38
- "@haklex/rich-editor-ui": "^0.69.2",
39
- "@haklex/rich-style-token": "^0.69.2",
37
+ "@haklex/rich-editor": "^0.70.0",
38
+ "@haklex/rich-editor-ui": "^0.70.0",
39
+ "@haklex/rich-style-token": "^0.70.0",
40
40
  "@lexical/react": "^0.53.0",
41
41
  "katex": ">=0.16.0",
42
42
  "lexical": "^0.53.0",
@@ -1,13 +0,0 @@
1
- export type EditorHistoryShortcut = 'redo' | 'undo';
2
- export interface EditorHistoryShortcutEvent {
3
- altKey?: boolean;
4
- ctrlKey: boolean;
5
- key: string;
6
- metaKey: boolean;
7
- shiftKey: boolean;
8
- }
9
- export interface EditorHistoryShortcutOptions {
10
- isDirty?: boolean;
11
- }
12
- export declare function getEditorHistoryShortcut(event: EditorHistoryShortcutEvent, options?: EditorHistoryShortcutOptions): EditorHistoryShortcut | null;
13
- //# sourceMappingURL=history-shortcuts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"history-shortcuts.d.ts","sources":["../src/history-shortcuts.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,0BAA0B,EACjC,OAAO,GAAE,4BAAiC,GACzC,qBAAqB,GAAG,IAAI,CAgB9B"}