app-v3-scripts-editor 1.29.2 → 1.30.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.
@@ -0,0 +1,9 @@
1
+ import { ShortcutSettingsV1 } from '../../../../hooks/use-keyboard-shortcuts';
2
+ type ShortcutSettingsModalProps = {
3
+ open: boolean;
4
+ value: ShortcutSettingsV1;
5
+ onSave: (settings: ShortcutSettingsV1) => void;
6
+ onCancel: () => void;
7
+ };
8
+ export declare const ShortcutSettingsModal: ({ open, value, onSave, onCancel, }: ShortcutSettingsModalProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default ShortcutSettingsModal;
@@ -1,2 +1,17 @@
1
- declare const CustomFlowControlsContainer: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
1
+ import { InteractionMode } from '../../../hooks/use-interaction-mode/interactionMode.store';
2
+ type CustomFlowControlsContainerProps = {
3
+ canUndo: boolean;
4
+ canRedo: boolean;
5
+ onUndo: () => void;
6
+ onRedo: () => void;
7
+ onLayout: () => void;
8
+ onFitView: () => void;
9
+ onZoomOut: () => void;
10
+ onZoomIn: () => void;
11
+ interactionMode: InteractionMode;
12
+ onToggleInteractionMode: () => void;
13
+ isReadOnly: boolean;
14
+ onOpenShortcutSettings: () => void;
15
+ };
16
+ declare const CustomFlowControlsContainer: import('react').MemoExoticComponent<(props: CustomFlowControlsContainerProps) => import("react/jsx-runtime").JSX.Element>;
2
17
  export default CustomFlowControlsContainer;
@@ -0,0 +1,12 @@
1
+ import { InstanceContextProps } from '../../provider/instance-context';
2
+ import { ShortcutActionId, ShortcutBindings } from './shortcuts';
3
+ export type ShortcutActionHandlers = Partial<Record<ShortcutActionId, () => void>>;
4
+ type UseKeyboardShortcutsOptions = {
5
+ mode: InstanceContextProps["mode"];
6
+ bindings: ShortcutBindings;
7
+ handlers: ShortcutActionHandlers;
8
+ suspended?: boolean;
9
+ onReadonlyActionBlocked?: (actionId: ShortcutActionId) => void;
10
+ };
11
+ export declare const useKeyboardShortcuts: ({ mode, bindings, handlers, suspended, onReadonlyActionBlocked, }: UseKeyboardShortcutsOptions) => void;
12
+ export * from './shortcuts';
@@ -0,0 +1,40 @@
1
+ export type ShortcutActionId = "undo" | "redo" | "zoomIn" | "zoomOut" | "fitView" | "autoLayout" | "deleteSelection" | "toggleInteractionMode";
2
+ export type ShortcutBindings = Record<ShortcutActionId, string>;
3
+ export type ShortcutSettingsV1 = {
4
+ version: 1;
5
+ bindings: ShortcutBindings;
6
+ };
7
+ export type ShortcutActionMeta = {
8
+ id: ShortcutActionId;
9
+ label: string;
10
+ description: string;
11
+ };
12
+ export type ParsedShortcutBinding = {
13
+ mod: boolean;
14
+ shift: boolean;
15
+ alt: boolean;
16
+ key: string;
17
+ };
18
+ export type ShortcutValidationResult = {
19
+ isValid: boolean;
20
+ errors: Partial<Record<ShortcutActionId, string>>;
21
+ normalizedBindings: ShortcutBindings;
22
+ };
23
+ export declare const SHORTCUT_STORAGE_KEY = "scripts-editor.shortcuts.v1";
24
+ export declare const SHORTCUT_ACTIONS: ShortcutActionMeta[];
25
+ export declare const DEFAULT_SHORTCUT_BINDINGS: ShortcutBindings;
26
+ export declare const REPEATABLE_SHORTCUT_ACTIONS: Set<ShortcutActionId>;
27
+ export declare const INPUT_ALLOWED_SHORTCUT_ACTIONS: Set<ShortcutActionId>;
28
+ export declare const READONLY_BLOCKED_SHORTCUT_ACTIONS: Set<ShortcutActionId>;
29
+ export declare const parseShortcutBinding: (binding: string) => ParsedShortcutBinding | null;
30
+ export declare const hasRequiredShortcutModifier: (parsed: ParsedShortcutBinding) => boolean;
31
+ export declare const serializeShortcutBinding: (parsed: ParsedShortcutBinding) => string;
32
+ export declare const normalizeShortcutBinding: (binding: string) => string | null;
33
+ export declare const buildShortcutBindingFromKeyboardEvent: (event: KeyboardEvent) => string | null;
34
+ export declare const isShortcutEventMatch: (event: KeyboardEvent, binding: ParsedShortcutBinding) => boolean;
35
+ export declare const formatShortcutBinding: (binding: string) => string;
36
+ export declare const normalizeShortcutBindings: (bindings?: Partial<Record<ShortcutActionId, string>>) => ShortcutBindings;
37
+ export declare const validateShortcutBindings: (bindings: Partial<Record<ShortcutActionId, string>>) => ShortcutValidationResult;
38
+ export declare const getDefaultShortcutSettings: () => ShortcutSettingsV1;
39
+ export declare const loadShortcutSettings: () => ShortcutSettingsV1;
40
+ export declare const saveShortcutSettings: (settings: ShortcutSettingsV1) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "app-v3-scripts-editor",
3
3
  "private": false,
4
- "version": "1.29.2",
4
+ "version": "1.30.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ucall-asia/app-v3-scripts-editor.git"