@haklex/rich-renderer-mention 0.69.1 → 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.
- package/dist/index.mjs +1 -12
- package/package.json +4 -4
- package/dist/history-shortcuts.d.ts +0 -13
- package/dist/history-shortcuts.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
import { a as platformMetaMap, c as handleControl, d as semanticClassNames, i as platformKeys, l as handleIcon, n as MentionRenderer, o as editPanel, r as useExtraPlatforms, s as editTrigger, t as MentionPlatformProvider, u as handleInput } from "./MentionRenderer-CJXX0ryS.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRendererMode } from "@haklex/rich-editor/static";
|
|
4
|
-
import { ActionBar, ActionButton, Field, Popover, PopoverPanel, PopoverTrigger, SegmentedControl, TextInput } from "@haklex/rich-editor-ui";
|
|
4
|
+
import { ActionBar, ActionButton, Field, Popover, PopoverPanel, PopoverTrigger, SegmentedControl, TextInput, getEditorHistoryShortcut } from "@haklex/rich-editor-ui";
|
|
5
5
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import { $getNearestNodeFromDOMNode, REDO_COMMAND, UNDO_COMMAND } from "lexical";
|
|
7
7
|
import { AtSign, ExternalLink, Trash2 } from "lucide-react";
|
|
8
8
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
9
|
-
//#region src/history-shortcuts.ts
|
|
10
|
-
function getEditorHistoryShortcut(event, options = {}) {
|
|
11
|
-
if (options.isDirty) return null;
|
|
12
|
-
if (event.altKey) return null;
|
|
13
|
-
if (!event.metaKey && !event.ctrlKey) return null;
|
|
14
|
-
const key = event.key.toLowerCase();
|
|
15
|
-
if (key === "z") return event.shiftKey ? "redo" : "undo";
|
|
16
|
-
if (key === "y" && event.ctrlKey && !event.metaKey && !event.shiftKey) return "redo";
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
9
|
//#region src/MentionEditRenderer.tsx
|
|
21
10
|
var LEADING_AT_RE = /^@+/;
|
|
22
11
|
function MentionEditRenderer(props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-mention",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
4
4
|
"description": "Social mention renderer with platform badges",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"vite": "^8.3.5"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@haklex/rich-editor": "^0.
|
|
43
|
-
"@haklex/rich-editor-ui": "^0.
|
|
44
|
-
"@haklex/rich-style-token": "^0.
|
|
42
|
+
"@haklex/rich-editor": "^0.70.0",
|
|
43
|
+
"@haklex/rich-editor-ui": "^0.70.0",
|
|
44
|
+
"@haklex/rich-style-token": "^0.70.0",
|
|
45
45
|
"@lexical/react": "^0.53.0",
|
|
46
46
|
"lexical": "^0.53.0",
|
|
47
47
|
"lucide-react": "^1.0.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"}
|