@salesforce/ui-design-mode 10.2.1 → 10.3.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/authoring/core/DesignPropertyPanelRoot.d.cts +52 -0
- package/dist/authoring/core/DesignPropertyPanelRoot.d.ts +52 -0
- package/dist/authoring/core/DesignPropertyPanelRoot.d.ts.map +1 -0
- package/dist/authoring/core/DesignPropertyPanelSection.d.cts +8 -0
- package/dist/authoring/core/DesignPropertyPanelSection.d.ts +8 -0
- package/dist/authoring/core/DesignPropertyPanelSection.d.ts.map +1 -0
- package/dist/authoring/core/editors/BaseEditorContainer.d.cts +16 -0
- package/dist/authoring/core/editors/BaseEditorContainer.d.ts +16 -0
- package/dist/authoring/core/editors/BaseEditorContainer.d.ts.map +1 -0
- package/dist/authoring/core/editors/BorderStyleEditor.d.cts +8 -0
- package/dist/authoring/core/editors/BorderStyleEditor.d.ts +8 -0
- package/dist/authoring/core/editors/BorderStyleEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/BoxDimensionEditor.d.cts +34 -0
- package/dist/authoring/core/editors/BoxDimensionEditor.d.ts +34 -0
- package/dist/authoring/core/editors/BoxDimensionEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/ColorEditor.d.cts +15 -0
- package/dist/authoring/core/editors/ColorEditor.d.ts +15 -0
- package/dist/authoring/core/editors/ColorEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/DimensionEditor.d.cts +31 -0
- package/dist/authoring/core/editors/DimensionEditor.d.ts +31 -0
- package/dist/authoring/core/editors/DimensionEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/FontFamilyEditor.d.cts +11 -0
- package/dist/authoring/core/editors/FontFamilyEditor.d.ts +11 -0
- package/dist/authoring/core/editors/FontFamilyEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/FontStyleEditor.d.cts +8 -0
- package/dist/authoring/core/editors/FontStyleEditor.d.ts +8 -0
- package/dist/authoring/core/editors/FontStyleEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/FontWeightEditor.d.cts +11 -0
- package/dist/authoring/core/editors/FontWeightEditor.d.ts +11 -0
- package/dist/authoring/core/editors/FontWeightEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/OverflowEditor.d.cts +8 -0
- package/dist/authoring/core/editors/OverflowEditor.d.ts +8 -0
- package/dist/authoring/core/editors/OverflowEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/PicklistEditor.d.cts +26 -0
- package/dist/authoring/core/editors/PicklistEditor.d.ts +26 -0
- package/dist/authoring/core/editors/PicklistEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/RadioGroupEditor.d.cts +26 -0
- package/dist/authoring/core/editors/RadioGroupEditor.d.ts +26 -0
- package/dist/authoring/core/editors/RadioGroupEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/TextAlignmentEditor.d.cts +8 -0
- package/dist/authoring/core/editors/TextAlignmentEditor.d.ts +8 -0
- package/dist/authoring/core/editors/TextAlignmentEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/TextDecorationEditor.d.cts +8 -0
- package/dist/authoring/core/editors/TextDecorationEditor.d.ts +8 -0
- package/dist/authoring/core/editors/TextDecorationEditor.d.ts.map +1 -0
- package/dist/authoring/core/editors/TextTransformEditor.d.cts +8 -0
- package/dist/authoring/core/editors/TextTransformEditor.d.ts +8 -0
- package/dist/authoring/core/editors/TextTransformEditor.d.ts.map +1 -0
- package/dist/authoring/core/history/commandExecutor.d.cts +29 -0
- package/dist/authoring/core/history/commandExecutor.d.ts +29 -0
- package/dist/authoring/core/history/commandExecutor.d.ts.map +1 -0
- package/dist/authoring/core/history/historyManager.d.cts +77 -0
- package/dist/authoring/core/history/historyManager.d.ts +77 -0
- package/dist/authoring/core/history/historyManager.d.ts.map +1 -0
- package/dist/authoring/core/history/historyService.d.cts +37 -0
- package/dist/authoring/core/history/historyService.d.ts +37 -0
- package/dist/authoring/core/history/historyService.d.ts.map +1 -0
- package/dist/authoring/core/history/iframeCommandExecutor.d.cts +10 -0
- package/dist/authoring/core/history/iframeCommandExecutor.d.ts +10 -0
- package/dist/authoring/core/history/iframeCommandExecutor.d.ts.map +1 -0
- package/dist/authoring/core/history/targetResolver.d.cts +59 -0
- package/dist/authoring/core/history/targetResolver.d.ts +59 -0
- package/dist/authoring/core/history/targetResolver.d.ts.map +1 -0
- package/dist/authoring/core/hooks/usePopover.d.cts +26 -0
- package/dist/authoring/core/hooks/usePopover.d.ts +26 -0
- package/dist/authoring/core/hooks/usePopover.d.ts.map +1 -0
- package/dist/authoring/core/utils/colorUtils.d.cts +73 -0
- package/dist/authoring/core/utils/colorUtils.d.ts +73 -0
- package/dist/authoring/core/utils/colorUtils.d.ts.map +1 -0
- package/dist/authoring/core/utils/dimensionUtils.d.cts +81 -0
- package/dist/authoring/core/utils/dimensionUtils.d.ts +81 -0
- package/dist/authoring/core/utils/dimensionUtils.d.ts.map +1 -0
- package/dist/authoring/core/utils/domUtils.d.cts +7 -0
- package/dist/authoring/core/utils/domUtils.d.ts +7 -0
- package/dist/authoring/core/utils/domUtils.d.ts.map +1 -0
- package/dist/authoring/react/index.d.cts +14 -0
- package/dist/authoring/react/index.d.ts +14 -0
- package/dist/authoring/react/index.d.ts.map +1 -0
- package/dist/authoring/react/index.js +119 -0
- package/dist/authoring/web-component/index.d.cts +18 -0
- package/dist/authoring/web-component/index.d.ts +18 -0
- package/dist/authoring/web-component/index.d.ts.map +1 -0
- package/dist/authoring/web-component/index.js +1229 -0
- package/dist/protocol/editableElementTags.cjs +16 -0
- package/dist/protocol/editableElementTags.d.cts +14 -0
- package/dist/protocol/editableElementTags.d.ts +14 -0
- package/dist/protocol/editableElementTags.d.ts.map +1 -0
- package/dist/protocol/editableElementTags.js +16 -0
- package/dist/protocol/index.cjs +2 -0
- package/dist/protocol/index.d.cts +1 -0
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +2 -0
- package/dist/protocol/messageTypes.d.cts +49 -6
- package/dist/protocol/messageTypes.d.ts +49 -6
- package/dist/protocol/messageTypes.d.ts.map +1 -1
- package/dist/runtime/design-mode-interactions.js +44 -21
- package/dist/runtime/interactions/communicationManager.d.cts +2 -26
- package/dist/runtime/interactions/communicationManager.d.ts +2 -26
- package/dist/runtime/interactions/communicationManager.d.ts.map +1 -1
- package/dist/runtime/interactions/componentMatcher.d.cts +6 -2
- package/dist/runtime/interactions/componentMatcher.d.ts +6 -2
- package/dist/runtime/interactions/componentMatcher.d.ts.map +1 -1
- package/dist/runtime/interactions/editableManager.d.cts +2 -1
- package/dist/runtime/interactions/editableManager.d.ts +2 -1
- package/dist/runtime/interactions/editableManager.d.ts.map +1 -1
- package/dist/runtime/interactions/utils/sourceUtils.d.cts +4 -1
- package/dist/runtime/interactions/utils/sourceUtils.d.ts +4 -1
- package/dist/runtime/interactions/utils/sourceUtils.d.ts.map +1 -1
- package/package.json +27 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextAlignmentEditor.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/editors/TextAlignmentEditor.tsx"],"names":[],"mappings":"AAuBA,MAAM,WAAW,wBAAwB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,EACnC,KAAoB,EACpB,KAAK,EACL,QAAQ,EACR,EAAiB,GACjB,EAAE,wBAAwB,2CAW1B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TextDecorationEditorProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextDecorationEditor({ label, value, onChange, id, }: TextDecorationEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TextDecorationEditor.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TextDecorationEditorProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextDecorationEditor({ label, value, onChange, id, }: TextDecorationEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TextDecorationEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextDecorationEditor.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/editors/TextDecorationEditor.tsx"],"names":[],"mappings":"AA+BA,MAAM,WAAW,yBAAyB;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,oBAAoB,CAAC,EACpC,KAAyB,EACzB,KAAK,EACL,QAAQ,EACR,EAAsB,GACtB,EAAE,yBAAyB,2CAU3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TextTransformEditorProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextTransformEditor({ label, value, onChange, id, }: TextTransformEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TextTransformEditor.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TextTransformEditorProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextTransformEditor({ label, value, onChange, id, }: TextTransformEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=TextTransformEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextTransformEditor.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/editors/TextTransformEditor.tsx"],"names":[],"mappings":"AAiCA,MAAM,WAAW,wBAAwB;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,EACnC,KAAwB,EACxB,KAAK,EACL,QAAQ,EACR,EAAqB,GACrB,EAAE,wBAAwB,2CAU1B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from './historyManager.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* Executors are responsible for getting the target from the command
|
|
4
|
+
*/
|
|
5
|
+
export interface CommandExecutor {
|
|
6
|
+
/**
|
|
7
|
+
* Execute a command on its target
|
|
8
|
+
* The executor gets the target from the command internally
|
|
9
|
+
* @param command - The command to execute
|
|
10
|
+
* @param isUndo - True if this is an undo operation (apply oldValue), false for redo (apply newValue)
|
|
11
|
+
* @returns True if execution was successful
|
|
12
|
+
*/
|
|
13
|
+
execute(command: Command, isUndo: boolean): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Get the current value from the target for a command
|
|
16
|
+
* Used when creating inverse commands
|
|
17
|
+
* The executor gets the target from the command internally
|
|
18
|
+
* @param command - The command to get the value for
|
|
19
|
+
* @returns Current value (can be any type)
|
|
20
|
+
*/
|
|
21
|
+
getCurrentValue(command: Command): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Check if this executor can handle the given command type
|
|
24
|
+
* @param commandType - Command type to check
|
|
25
|
+
* @returns True if this executor can handle the command type
|
|
26
|
+
*/
|
|
27
|
+
canHandle(commandType: string): boolean;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=commandExecutor.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from './historyManager.js';
|
|
2
|
+
/**
|
|
3
|
+
* Executors are responsible for getting the target from the command
|
|
4
|
+
*/
|
|
5
|
+
export interface CommandExecutor {
|
|
6
|
+
/**
|
|
7
|
+
* Execute a command on its target
|
|
8
|
+
* The executor gets the target from the command internally
|
|
9
|
+
* @param command - The command to execute
|
|
10
|
+
* @param isUndo - True if this is an undo operation (apply oldValue), false for redo (apply newValue)
|
|
11
|
+
* @returns True if execution was successful
|
|
12
|
+
*/
|
|
13
|
+
execute(command: Command, isUndo: boolean): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Get the current value from the target for a command
|
|
16
|
+
* Used when creating inverse commands
|
|
17
|
+
* The executor gets the target from the command internally
|
|
18
|
+
* @param command - The command to get the value for
|
|
19
|
+
* @returns Current value (can be any type)
|
|
20
|
+
*/
|
|
21
|
+
getCurrentValue(command: Command): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Check if this executor can handle the given command type
|
|
24
|
+
* @param commandType - Command type to check
|
|
25
|
+
* @returns True if this executor can handle the command type
|
|
26
|
+
*/
|
|
27
|
+
canHandle(commandType: string): boolean;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=commandExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandExecutor.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/history/commandExecutor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;IAEpD;;;;;;OAMG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAE3C;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;CACxC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CommandExecutor } from './commandExecutor.cjs';
|
|
2
|
+
/** Event types */
|
|
3
|
+
export declare const HistoryEventType: {
|
|
4
|
+
readonly CHANGED: "history-changed";
|
|
5
|
+
readonly COMMAND_PUSHED: "command-pushed";
|
|
6
|
+
readonly COMMAND_UNDONE: "command-undone";
|
|
7
|
+
readonly COMMAND_REDONE: "command-redone";
|
|
8
|
+
readonly CLEARED: "history-cleared";
|
|
9
|
+
};
|
|
10
|
+
export type HistoryEventType = (typeof HistoryEventType)[keyof typeof HistoryEventType];
|
|
11
|
+
/** Command: the unit of work stored on the undo/redo stacks. */
|
|
12
|
+
export interface Command {
|
|
13
|
+
id: string;
|
|
14
|
+
/** Domain-specific type (e.g. 'style', 'file-edit', 'config-change') */
|
|
15
|
+
type: string;
|
|
16
|
+
/** Old value (for undo) */
|
|
17
|
+
oldValue: unknown;
|
|
18
|
+
/** New value (for redo) */
|
|
19
|
+
newValue: unknown;
|
|
20
|
+
/** Additional command-specific data */
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface HistoryEvent {
|
|
24
|
+
type: HistoryEventType;
|
|
25
|
+
timestamp: number;
|
|
26
|
+
canUndo: boolean;
|
|
27
|
+
canRedo: boolean;
|
|
28
|
+
undoCount: number;
|
|
29
|
+
redoCount: number;
|
|
30
|
+
command?: Command;
|
|
31
|
+
appliedValue?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface HistoryManagerOptions {
|
|
34
|
+
maxHistorySize?: number;
|
|
35
|
+
commandExecutor?: CommandExecutor;
|
|
36
|
+
}
|
|
37
|
+
export type HistoryListener = (event: HistoryEvent) => void;
|
|
38
|
+
/**
|
|
39
|
+
* History Manager
|
|
40
|
+
* Manages undo/redo operations for any type of command
|
|
41
|
+
*/
|
|
42
|
+
export declare class HistoryManager {
|
|
43
|
+
private undoStack;
|
|
44
|
+
private redoStack;
|
|
45
|
+
private maxHistorySize;
|
|
46
|
+
private listeners;
|
|
47
|
+
private _isProcessing;
|
|
48
|
+
private commandExecutor;
|
|
49
|
+
constructor(options?: HistoryManagerOptions);
|
|
50
|
+
/** Create an immutable command. */
|
|
51
|
+
createCommand(type: string, oldValue: unknown, newValue: unknown, data?: Record<string, unknown>): Command;
|
|
52
|
+
private _generateCommandId;
|
|
53
|
+
subscribe(listener: HistoryListener): () => void;
|
|
54
|
+
private _notify;
|
|
55
|
+
pushCommand(command: Command): void;
|
|
56
|
+
private _trimStack;
|
|
57
|
+
private _applyCommand;
|
|
58
|
+
private _createInverseCommand;
|
|
59
|
+
undo(): boolean;
|
|
60
|
+
redo(): boolean;
|
|
61
|
+
canUndo(): boolean;
|
|
62
|
+
canRedo(): boolean;
|
|
63
|
+
clear(): void;
|
|
64
|
+
getUndoCount(): number;
|
|
65
|
+
getRedoCount(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Returns a serializable snapshot of the undo stack for building prompts (e.g. for Agentforce Vibes).
|
|
68
|
+
* Order is oldest-first (first applied change first).
|
|
69
|
+
*/
|
|
70
|
+
getUndoStackSnapshot(): {
|
|
71
|
+
type: string;
|
|
72
|
+
oldValue: unknown;
|
|
73
|
+
newValue: unknown;
|
|
74
|
+
data?: Record<string, unknown>;
|
|
75
|
+
}[];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=historyManager.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { CommandExecutor } from './commandExecutor.js';
|
|
2
|
+
/** Event types */
|
|
3
|
+
export declare const HistoryEventType: {
|
|
4
|
+
readonly CHANGED: "history-changed";
|
|
5
|
+
readonly COMMAND_PUSHED: "command-pushed";
|
|
6
|
+
readonly COMMAND_UNDONE: "command-undone";
|
|
7
|
+
readonly COMMAND_REDONE: "command-redone";
|
|
8
|
+
readonly CLEARED: "history-cleared";
|
|
9
|
+
};
|
|
10
|
+
export type HistoryEventType = (typeof HistoryEventType)[keyof typeof HistoryEventType];
|
|
11
|
+
/** Command: the unit of work stored on the undo/redo stacks. */
|
|
12
|
+
export interface Command {
|
|
13
|
+
id: string;
|
|
14
|
+
/** Domain-specific type (e.g. 'style', 'file-edit', 'config-change') */
|
|
15
|
+
type: string;
|
|
16
|
+
/** Old value (for undo) */
|
|
17
|
+
oldValue: unknown;
|
|
18
|
+
/** New value (for redo) */
|
|
19
|
+
newValue: unknown;
|
|
20
|
+
/** Additional command-specific data */
|
|
21
|
+
data?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface HistoryEvent {
|
|
24
|
+
type: HistoryEventType;
|
|
25
|
+
timestamp: number;
|
|
26
|
+
canUndo: boolean;
|
|
27
|
+
canRedo: boolean;
|
|
28
|
+
undoCount: number;
|
|
29
|
+
redoCount: number;
|
|
30
|
+
command?: Command;
|
|
31
|
+
appliedValue?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface HistoryManagerOptions {
|
|
34
|
+
maxHistorySize?: number;
|
|
35
|
+
commandExecutor?: CommandExecutor;
|
|
36
|
+
}
|
|
37
|
+
export type HistoryListener = (event: HistoryEvent) => void;
|
|
38
|
+
/**
|
|
39
|
+
* History Manager
|
|
40
|
+
* Manages undo/redo operations for any type of command
|
|
41
|
+
*/
|
|
42
|
+
export declare class HistoryManager {
|
|
43
|
+
private undoStack;
|
|
44
|
+
private redoStack;
|
|
45
|
+
private maxHistorySize;
|
|
46
|
+
private listeners;
|
|
47
|
+
private _isProcessing;
|
|
48
|
+
private commandExecutor;
|
|
49
|
+
constructor(options?: HistoryManagerOptions);
|
|
50
|
+
/** Create an immutable command. */
|
|
51
|
+
createCommand(type: string, oldValue: unknown, newValue: unknown, data?: Record<string, unknown>): Command;
|
|
52
|
+
private _generateCommandId;
|
|
53
|
+
subscribe(listener: HistoryListener): () => void;
|
|
54
|
+
private _notify;
|
|
55
|
+
pushCommand(command: Command): void;
|
|
56
|
+
private _trimStack;
|
|
57
|
+
private _applyCommand;
|
|
58
|
+
private _createInverseCommand;
|
|
59
|
+
undo(): boolean;
|
|
60
|
+
redo(): boolean;
|
|
61
|
+
canUndo(): boolean;
|
|
62
|
+
canRedo(): boolean;
|
|
63
|
+
clear(): void;
|
|
64
|
+
getUndoCount(): number;
|
|
65
|
+
getRedoCount(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Returns a serializable snapshot of the undo stack for building prompts (e.g. for Agentforce Vibes).
|
|
68
|
+
* Order is oldest-first (first applied change first).
|
|
69
|
+
*/
|
|
70
|
+
getUndoStackSnapshot(): {
|
|
71
|
+
type: string;
|
|
72
|
+
oldValue: unknown;
|
|
73
|
+
newValue: unknown;
|
|
74
|
+
data?: Record<string, unknown>;
|
|
75
|
+
}[];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=historyManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historyManager.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/history/historyManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,kBAAkB;AAClB,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAExF,gEAAgE;AAChE,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,gBAAgB,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;AAE5D;;;GAGG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO,CAAC,eAAe,CAAkB;gBAE7B,OAAO,GAAE,qBAA0B;IAU/C,mCAAmC;IAC5B,aAAa,CACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,EACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO;IAUV,OAAO,CAAC,kBAAkB;IAInB,SAAS,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,IAAI;IAUvD,OAAO,CAAC,OAAO;IAyBR,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAsB1C,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,qBAAqB;IAYtB,IAAI,IAAI,OAAO;IAqCf,IAAI,IAAI,OAAO;IA2Cf,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,OAAO;IAIlB,KAAK,IAAI,IAAI;IAQb,YAAY,IAAI,MAAM;IAItB,YAAY,IAAI,MAAM;IAI7B;;;OAGG;IACI,oBAAoB,IAAI;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,QAAQ,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,EAAE;CAQH"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HistoryEvent } from './historyManager.cjs';
|
|
2
|
+
import { SourceLocation } from '../../../protocol.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Context for a recorded change: the selected component at the time of the edit.
|
|
5
|
+
* Used so Apply prompts can reference the changed component by source location.
|
|
6
|
+
*
|
|
7
|
+
* Present-means-complete: a change is only ever recorded for a *selected*
|
|
8
|
+
* element, and an element isn't selectable without a full, valid source
|
|
9
|
+
* location (see the protocol's `SourceLocation` invariant). So every field is
|
|
10
|
+
* required — `getComponentContext` returns `ChangeContext | undefined`
|
|
11
|
+
* (undefined when there's no selection), never a partially-filled object.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChangeContext {
|
|
14
|
+
sourceFile: string;
|
|
15
|
+
lineNumber: number;
|
|
16
|
+
columnNumber: number;
|
|
17
|
+
componentName: string;
|
|
18
|
+
}
|
|
19
|
+
export interface HistoryService {
|
|
20
|
+
recordStyleChange(property: string, oldValue: string, newValue: string, context?: ChangeContext): void;
|
|
21
|
+
recordTextChange(originalText: string, newText: string, context?: ChangeContext): void;
|
|
22
|
+
undo(): void;
|
|
23
|
+
redo(): void;
|
|
24
|
+
canUndo(): boolean;
|
|
25
|
+
canRedo(): boolean;
|
|
26
|
+
subscribe(listener: (state: HistoryEvent) => void): () => void;
|
|
27
|
+
getHistoryStack(): unknown[];
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a history service for the design property panel (host). Applies changes via postMessage to the iframe.
|
|
32
|
+
* @param sendStyleChange - Send (property, value) to the iframe
|
|
33
|
+
* @param sendTextChange - Send (text, sourceLocation?) to the iframe
|
|
34
|
+
* @returns Service with recordStyleChange, recordTextChange, undo(), redo(), subscribe(listener)
|
|
35
|
+
*/
|
|
36
|
+
export declare function createHistoryService(sendStyleChange: (property: string, value: string, sourceLocation?: SourceLocation) => void, sendTextChange: (text: string, sourceLocation?: SourceLocation) => void): HistoryService;
|
|
37
|
+
//# sourceMappingURL=historyService.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HistoryEvent } from './historyManager.js';
|
|
2
|
+
import { SourceLocation } from '../../../protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* Context for a recorded change: the selected component at the time of the edit.
|
|
5
|
+
* Used so Apply prompts can reference the changed component by source location.
|
|
6
|
+
*
|
|
7
|
+
* Present-means-complete: a change is only ever recorded for a *selected*
|
|
8
|
+
* element, and an element isn't selectable without a full, valid source
|
|
9
|
+
* location (see the protocol's `SourceLocation` invariant). So every field is
|
|
10
|
+
* required — `getComponentContext` returns `ChangeContext | undefined`
|
|
11
|
+
* (undefined when there's no selection), never a partially-filled object.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChangeContext {
|
|
14
|
+
sourceFile: string;
|
|
15
|
+
lineNumber: number;
|
|
16
|
+
columnNumber: number;
|
|
17
|
+
componentName: string;
|
|
18
|
+
}
|
|
19
|
+
export interface HistoryService {
|
|
20
|
+
recordStyleChange(property: string, oldValue: string, newValue: string, context?: ChangeContext): void;
|
|
21
|
+
recordTextChange(originalText: string, newText: string, context?: ChangeContext): void;
|
|
22
|
+
undo(): void;
|
|
23
|
+
redo(): void;
|
|
24
|
+
canUndo(): boolean;
|
|
25
|
+
canRedo(): boolean;
|
|
26
|
+
subscribe(listener: (state: HistoryEvent) => void): () => void;
|
|
27
|
+
getHistoryStack(): unknown[];
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a history service for the design property panel (host). Applies changes via postMessage to the iframe.
|
|
32
|
+
* @param sendStyleChange - Send (property, value) to the iframe
|
|
33
|
+
* @param sendTextChange - Send (text, sourceLocation?) to the iframe
|
|
34
|
+
* @returns Service with recordStyleChange, recordTextChange, undo(), redo(), subscribe(listener)
|
|
35
|
+
*/
|
|
36
|
+
export declare function createHistoryService(sendStyleChange: (property: string, value: string, sourceLocation?: SourceLocation) => void, sendTextChange: (text: string, sourceLocation?: SourceLocation) => void): HistoryService;
|
|
37
|
+
//# sourceMappingURL=historyService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historyService.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/history/historyService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;GAGG;AAEH,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,WAAW,aAAa;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC9B,iBAAiB,CAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,IAAI,CAAC;IACR,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACvF,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,OAAO,CAAC;IACnB,OAAO,IAAI,OAAO,CAAC;IACnB,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC/D,eAAe,IAAI,OAAO,EAAE,CAAC;IAC7B,KAAK,IAAI,IAAI,CAAC;CACd;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CACnC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,KAAK,IAAI,EAC3F,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,KAAK,IAAI,GACrE,cAAc,CAgChB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommandExecutor } from './commandExecutor.cjs';
|
|
2
|
+
import { SourceLocation } from '../../../protocol.cjs';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an iframe command executor for applying style and text changes via postMessage
|
|
5
|
+
* @param sendStyleChange - Called to apply a style in the iframe
|
|
6
|
+
* @param sendTextChange - Called to apply a text change in the iframe
|
|
7
|
+
* @returns Executor implementing CommandExecutor interface
|
|
8
|
+
*/
|
|
9
|
+
export declare const createIframeCommandExecutor: (sendStyleChange: (property: string, value: string, sourceLocation?: SourceLocation) => void, sendTextChange: (text: string, sourceLocation?: SourceLocation) => void) => CommandExecutor;
|
|
10
|
+
//# sourceMappingURL=iframeCommandExecutor.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommandExecutor } from './commandExecutor.js';
|
|
2
|
+
import { SourceLocation } from '../../../protocol.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an iframe command executor for applying style and text changes via postMessage
|
|
5
|
+
* @param sendStyleChange - Called to apply a style in the iframe
|
|
6
|
+
* @param sendTextChange - Called to apply a text change in the iframe
|
|
7
|
+
* @returns Executor implementing CommandExecutor interface
|
|
8
|
+
*/
|
|
9
|
+
export declare const createIframeCommandExecutor: (sendStyleChange: (property: string, value: string, sourceLocation?: SourceLocation) => void, sendTextChange: (text: string, sourceLocation?: SourceLocation) => void) => CommandExecutor;
|
|
10
|
+
//# sourceMappingURL=iframeCommandExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iframeCommandExecutor.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/history/iframeCommandExecutor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA0CxD;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACvC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,KAAK,IAAI,EAC3F,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,KAAK,IAAI,KACrE,eA6BF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Target Resolver Module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Represents a target that can be modified by commands
|
|
11
|
+
* This abstraction allows HistoryManager to work with any target type
|
|
12
|
+
*/
|
|
13
|
+
export interface Target {
|
|
14
|
+
/**
|
|
15
|
+
* Get a unique identifier for this target
|
|
16
|
+
* Used to find the target later (e.g., CSS selector, file path, config key)
|
|
17
|
+
*/
|
|
18
|
+
getIdentifier(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Check if the target is still valid/accessible
|
|
21
|
+
*/
|
|
22
|
+
isValid(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get the raw target object (for fallback scenarios)
|
|
25
|
+
*/
|
|
26
|
+
getRawTarget(): unknown;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve this target from its identifier (for cases where target becomes stale)
|
|
29
|
+
* @param identifier - The identifier to resolve from
|
|
30
|
+
* @param fallbackTarget - Optional fallback target if available
|
|
31
|
+
* @returns Resolved target or null if not found
|
|
32
|
+
*/
|
|
33
|
+
resolveFromIdentifier?(identifier: string, fallbackTarget: Target | null): Target | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Strategy interface for resolving targets by identifier
|
|
37
|
+
*/
|
|
38
|
+
export interface TargetResolver {
|
|
39
|
+
/**
|
|
40
|
+
* Resolve a target by its identifier
|
|
41
|
+
* @param identifier - Unique identifier for the target (e.g., CSS selector, file path)
|
|
42
|
+
* @param fallbackTarget - Optional fallback target if identifier resolution fails
|
|
43
|
+
* @returns Resolved target or null if not found
|
|
44
|
+
*/
|
|
45
|
+
resolveTarget(identifier: string | undefined, fallbackTarget: Target | null): Target | null;
|
|
46
|
+
/**
|
|
47
|
+
* Generate an identifier for a target
|
|
48
|
+
* @param target - The target to generate an identifier for
|
|
49
|
+
* @returns Unique identifier or null if generation fails
|
|
50
|
+
*/
|
|
51
|
+
generateIdentifier(target: Target): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Check if this resolver can handle the given target type
|
|
54
|
+
* @param target - Target to check
|
|
55
|
+
* @returns True if this resolver can handle the target
|
|
56
|
+
*/
|
|
57
|
+
canHandle(target: Target): boolean;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=targetResolver.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Target Resolver Module
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Represents a target that can be modified by commands
|
|
11
|
+
* This abstraction allows HistoryManager to work with any target type
|
|
12
|
+
*/
|
|
13
|
+
export interface Target {
|
|
14
|
+
/**
|
|
15
|
+
* Get a unique identifier for this target
|
|
16
|
+
* Used to find the target later (e.g., CSS selector, file path, config key)
|
|
17
|
+
*/
|
|
18
|
+
getIdentifier(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Check if the target is still valid/accessible
|
|
21
|
+
*/
|
|
22
|
+
isValid(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get the raw target object (for fallback scenarios)
|
|
25
|
+
*/
|
|
26
|
+
getRawTarget(): unknown;
|
|
27
|
+
/**
|
|
28
|
+
* Resolve this target from its identifier (for cases where target becomes stale)
|
|
29
|
+
* @param identifier - The identifier to resolve from
|
|
30
|
+
* @param fallbackTarget - Optional fallback target if available
|
|
31
|
+
* @returns Resolved target or null if not found
|
|
32
|
+
*/
|
|
33
|
+
resolveFromIdentifier?(identifier: string, fallbackTarget: Target | null): Target | null;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Strategy interface for resolving targets by identifier
|
|
37
|
+
*/
|
|
38
|
+
export interface TargetResolver {
|
|
39
|
+
/**
|
|
40
|
+
* Resolve a target by its identifier
|
|
41
|
+
* @param identifier - Unique identifier for the target (e.g., CSS selector, file path)
|
|
42
|
+
* @param fallbackTarget - Optional fallback target if identifier resolution fails
|
|
43
|
+
* @returns Resolved target or null if not found
|
|
44
|
+
*/
|
|
45
|
+
resolveTarget(identifier: string | undefined, fallbackTarget: Target | null): Target | null;
|
|
46
|
+
/**
|
|
47
|
+
* Generate an identifier for a target
|
|
48
|
+
* @param target - The target to generate an identifier for
|
|
49
|
+
* @returns Unique identifier or null if generation fails
|
|
50
|
+
*/
|
|
51
|
+
generateIdentifier(target: Target): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Check if this resolver can handle the given target type
|
|
54
|
+
* @param target - Target to check
|
|
55
|
+
* @returns True if this resolver can handle the target
|
|
56
|
+
*/
|
|
57
|
+
canHandle(target: Target): boolean;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=targetResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targetResolver.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/history/targetResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;OAGG;IACH,aAAa,IAAI,MAAM,CAAC;IAExB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC;IAExB;;;;;OAKG;IACH,qBAAqB,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CACzF;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;;;;OAKG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAE5F;;;;OAIG;IACH,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAElD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACnC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PopoverPosition {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
}
|
|
6
|
+
export interface UsePopoverOptions {
|
|
7
|
+
computePosition?: (triggerEl: HTMLElement, ...args: any[]) => PopoverPosition;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
trapFocus?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UsePopoverReturn {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
open: () => void;
|
|
15
|
+
close: () => void;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
18
|
+
popoverRef: React.RefObject<HTMLElement | null>;
|
|
19
|
+
position: PopoverPosition;
|
|
20
|
+
reposition: (...args: any[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Popover hook (state, positioning, dismiss, and focus management).
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePopover({ computePosition, onClose, autoFocus, trapFocus, }?: UsePopoverOptions): UsePopoverReturn;
|
|
26
|
+
//# sourceMappingURL=usePopover.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PopoverPosition {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
}
|
|
6
|
+
export interface UsePopoverOptions {
|
|
7
|
+
computePosition?: (triggerEl: HTMLElement, ...args: any[]) => PopoverPosition;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
trapFocus?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface UsePopoverReturn {
|
|
13
|
+
isOpen: boolean;
|
|
14
|
+
open: () => void;
|
|
15
|
+
close: () => void;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
triggerRef: React.RefObject<HTMLElement | null>;
|
|
18
|
+
popoverRef: React.RefObject<HTMLElement | null>;
|
|
19
|
+
position: PopoverPosition;
|
|
20
|
+
reposition: (...args: any[]) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Popover hook (state, positioning, dismiss, and focus management).
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePopover({ computePosition, onClose, autoFocus, trapFocus, }?: UsePopoverOptions): UsePopoverReturn;
|
|
26
|
+
//# sourceMappingURL=usePopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../../../src/authoring/core/hooks/usePopover.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAIjC,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,eAAe,CAAC;IAC9E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,QAAQ,EAAE,eAAe,CAAC;IAE1B,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAC1B,eAAe,EACf,OAAO,EACP,SAAgB,EAChB,SAAiB,GACjB,GAAE,iBAAsB,GAAG,gBAAgB,CA6G3C"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Color, Oklch, Oklab, Lch, Lab, Rgb, Hsl } from 'culori';
|
|
2
|
+
export interface RgbaColor {
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
a: number;
|
|
7
|
+
}
|
|
8
|
+
export type { Oklch, Oklab, Lch, Lab, Rgb, Hsl };
|
|
9
|
+
/**
|
|
10
|
+
* Check if a string is a valid CSS color value.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isValidColor(value: string | null | undefined): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Parse any CSS color string to { r, g, b, a }.
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseColorToRgba(value: string | null | undefined): RgbaColor;
|
|
17
|
+
/**
|
|
18
|
+
* Convert RGBA object to CSS string.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rgbaToString(rgba: RgbaColor): string;
|
|
21
|
+
/**
|
|
22
|
+
* Check if string is a valid hex color.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isValidHexColor(color: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Convert RGBA object to hex string.
|
|
27
|
+
*/
|
|
28
|
+
export declare function rgbaToHex(rgba: RgbaColor): string;
|
|
29
|
+
/**
|
|
30
|
+
* Detect the color space mode from a color string.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getColorMode(value: string | null | undefined): string;
|
|
33
|
+
/**
|
|
34
|
+
* Convert RGBA to a specific color space.
|
|
35
|
+
*/
|
|
36
|
+
export declare function rgbaToColorSpace(rgba: RgbaColor, mode: "oklch"): Oklch;
|
|
37
|
+
export declare function rgbaToColorSpace(rgba: RgbaColor, mode: "oklab"): Oklab;
|
|
38
|
+
export declare function rgbaToColorSpace(rgba: RgbaColor, mode: "lch"): Lch;
|
|
39
|
+
export declare function rgbaToColorSpace(rgba: RgbaColor, mode: "lab"): Lab;
|
|
40
|
+
export declare function rgbaToColorSpace(rgba: RgbaColor, mode: string): Color | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Convert color from any space back to RGBA.
|
|
43
|
+
*/
|
|
44
|
+
export declare function colorSpaceToRgba(color: Color | undefined): RgbaColor;
|
|
45
|
+
/**
|
|
46
|
+
* Format color object to CSS string.
|
|
47
|
+
*/
|
|
48
|
+
export declare function formatColorSpace(color: Color | undefined): string;
|
|
49
|
+
/**
|
|
50
|
+
* Convert RGB (0-255) to HSL.
|
|
51
|
+
*/
|
|
52
|
+
export declare function rgbToHsl(rgb: {
|
|
53
|
+
r: number;
|
|
54
|
+
g: number;
|
|
55
|
+
b: number;
|
|
56
|
+
}): {
|
|
57
|
+
h: number;
|
|
58
|
+
s: number;
|
|
59
|
+
l: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Convert HSL to RGB (0-255).
|
|
63
|
+
*/
|
|
64
|
+
export declare function hslToRgb(hsl: {
|
|
65
|
+
h: number;
|
|
66
|
+
s: number;
|
|
67
|
+
l: number;
|
|
68
|
+
}): {
|
|
69
|
+
r: number;
|
|
70
|
+
g: number;
|
|
71
|
+
b: number;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=colorUtils.d.ts.map
|