@salesforce/ui-design-mode 10.2.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.
Files changed (60) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/protocol/domAttributes.cjs +6 -0
  3. package/dist/protocol/domAttributes.d.cts +18 -0
  4. package/dist/protocol/domAttributes.d.ts +18 -0
  5. package/dist/protocol/domAttributes.d.ts.map +1 -0
  6. package/dist/protocol/domAttributes.js +6 -0
  7. package/dist/protocol/index.cjs +14 -0
  8. package/dist/protocol/index.d.cts +8 -0
  9. package/dist/protocol/index.d.ts +8 -0
  10. package/dist/protocol/index.d.ts.map +1 -0
  11. package/dist/protocol/index.js +14 -0
  12. package/dist/protocol/messageTypes.cjs +18 -0
  13. package/dist/protocol/messageTypes.d.cts +83 -0
  14. package/dist/protocol/messageTypes.d.ts +83 -0
  15. package/dist/protocol/messageTypes.d.ts.map +1 -0
  16. package/dist/protocol/messageTypes.js +18 -0
  17. package/dist/runtime/design-mode-interactions.js +842 -0
  18. package/dist/runtime/index.cjs +15 -0
  19. package/dist/runtime/index.d.cts +11 -0
  20. package/dist/runtime/index.d.ts +11 -0
  21. package/dist/runtime/index.d.ts.map +1 -0
  22. package/dist/runtime/index.js +14 -0
  23. package/dist/runtime/interactions/communicationManager.d.cts +57 -0
  24. package/dist/runtime/interactions/communicationManager.d.ts +57 -0
  25. package/dist/runtime/interactions/communicationManager.d.ts.map +1 -0
  26. package/dist/runtime/interactions/componentMatcher.d.cts +39 -0
  27. package/dist/runtime/interactions/componentMatcher.d.ts +39 -0
  28. package/dist/runtime/interactions/componentMatcher.d.ts.map +1 -0
  29. package/dist/runtime/interactions/editableManager.d.cts +25 -0
  30. package/dist/runtime/interactions/editableManager.d.ts +25 -0
  31. package/dist/runtime/interactions/editableManager.d.ts.map +1 -0
  32. package/dist/runtime/interactions/eventHandlers.d.cts +40 -0
  33. package/dist/runtime/interactions/eventHandlers.d.ts +40 -0
  34. package/dist/runtime/interactions/eventHandlers.d.ts.map +1 -0
  35. package/dist/runtime/interactions/index.d.cts +7 -0
  36. package/dist/runtime/interactions/index.d.ts +7 -0
  37. package/dist/runtime/interactions/index.d.ts.map +1 -0
  38. package/dist/runtime/interactions/interactionsController.d.cts +53 -0
  39. package/dist/runtime/interactions/interactionsController.d.ts +53 -0
  40. package/dist/runtime/interactions/interactionsController.d.ts.map +1 -0
  41. package/dist/runtime/interactions/styleManager.d.cts +49 -0
  42. package/dist/runtime/interactions/styleManager.d.ts +49 -0
  43. package/dist/runtime/interactions/styleManager.d.ts.map +1 -0
  44. package/dist/runtime/interactions/utils/cssUtils.d.cts +54 -0
  45. package/dist/runtime/interactions/utils/cssUtils.d.ts +54 -0
  46. package/dist/runtime/interactions/utils/cssUtils.d.ts.map +1 -0
  47. package/dist/runtime/interactions/utils/sourceUtils.d.cts +28 -0
  48. package/dist/runtime/interactions/utils/sourceUtils.d.ts +28 -0
  49. package/dist/runtime/interactions/utils/sourceUtils.d.ts.map +1 -0
  50. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.cjs +90 -0
  51. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.d.cts +13 -0
  52. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.d.ts +13 -0
  53. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.d.ts.map +1 -0
  54. package/dist/source-locator/react/babel/reactDesignTimeLocatorBabelPlugin.js +90 -0
  55. package/dist/source-locator/react/index.cjs +5 -0
  56. package/dist/source-locator/react/index.d.cts +4 -0
  57. package/dist/source-locator/react/index.d.ts +4 -0
  58. package/dist/source-locator/react/index.d.ts.map +1 -0
  59. package/dist/source-locator/react/index.js +5 -0
  60. package/package.json +70 -0
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const node_fs = require("node:fs");
4
+ const node_path = require("node:path");
5
+ const node_url = require("node:url");
6
+ var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
7
+ const __dirname$1 = node_path.dirname(node_url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("runtime/index.cjs", document.baseURI).href));
8
+ const RUNTIME_IIFE_PATH = node_path.join(__dirname$1, "design-mode-interactions.js");
9
+ function getRuntimeScriptContent() {
10
+ if (!node_fs.existsSync(RUNTIME_IIFE_PATH)) {
11
+ return null;
12
+ }
13
+ return node_fs.readFileSync(RUNTIME_IIFE_PATH, "utf-8");
14
+ }
15
+ exports.getRuntimeScriptContent = getRuntimeScriptContent;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Read the bundled iframe-side runtime IIFE for injection into the customer's preview iframe.
8
+ * @returns The script contents, or null if the bundle has not been built yet.
9
+ */
10
+ export declare function getRuntimeScriptContent(): string | null;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Read the bundled iframe-side runtime IIFE for injection into the customer's preview iframe.
8
+ * @returns The script contents, or null if the bundle has not been built yet.
9
+ */
10
+ export declare function getRuntimeScriptContent(): string | null;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAKvD"}
@@ -0,0 +1,14 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const __dirname$1 = dirname(fileURLToPath(import.meta.url));
5
+ const RUNTIME_IIFE_PATH = join(__dirname$1, "design-mode-interactions.js");
6
+ function getRuntimeScriptContent() {
7
+ if (!existsSync(RUNTIME_IIFE_PATH)) {
8
+ return null;
9
+ }
10
+ return readFileSync(RUNTIME_IIFE_PATH, "utf-8");
11
+ }
12
+ export {
13
+ getRuntimeScriptContent
14
+ };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Editable attributes reported for an `<img>` element on selection. Strings
8
+ * mirror the raw HTML attribute values; missing attributes are reported as `""`.
9
+ *
10
+ * - `width` / `height` are unitless integer strings (px); `""` means the
11
+ * attribute is absent and the image renders at its intrinsic size.
12
+ */
13
+ interface ImageMediaInfo {
14
+ tag: "img";
15
+ src: string;
16
+ alt: string;
17
+ width: string;
18
+ height: string;
19
+ }
20
+ /**
21
+ * Discriminated union of media-element metadata, keyed by `tag`. To support a
22
+ * new media tag in future if required, add a variant here and a matching case
23
+ * in {@link getMediaInfo}.
24
+ */
25
+ export type MediaInfo = ImageMediaInfo;
26
+ /**
27
+ * Extract editable media metadata from a selected element.
28
+ *
29
+ * Switches on `element.tagName` and returns the variant matching the tag, or
30
+ * `undefined` for elements without a registered media tag (the caller then
31
+ * omits the `media` field from the `component-selected` payload).
32
+ *
33
+ * @param element - The selected DOM element.
34
+ * @returns The media info variant for the element's tag, or `undefined` if the tag is not media.
35
+ */
36
+ export declare function getMediaInfo(element: HTMLElement): MediaInfo | undefined;
37
+ export declare class CommunicationManager {
38
+ constructor();
39
+ /**
40
+ * Notify the extension about a selected component
41
+ * @param element - The selected element
42
+ */
43
+ notifyComponentSelected(element: HTMLElement): void;
44
+ /**
45
+ * Notify the extension about a text change
46
+ * @param element - The element that changed
47
+ * @param originalText - The original text
48
+ * @param newText - The new text
49
+ */
50
+ notifyTextChange(element: HTMLElement, originalText: string, newText: string): void;
51
+ /**
52
+ * Notify the parent window that interactions initialization is complete
53
+ */
54
+ notifyInitializationComplete(): void;
55
+ }
56
+ export {};
57
+ //# sourceMappingURL=communicationManager.d.ts.map
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Editable attributes reported for an `<img>` element on selection. Strings
8
+ * mirror the raw HTML attribute values; missing attributes are reported as `""`.
9
+ *
10
+ * - `width` / `height` are unitless integer strings (px); `""` means the
11
+ * attribute is absent and the image renders at its intrinsic size.
12
+ */
13
+ interface ImageMediaInfo {
14
+ tag: "img";
15
+ src: string;
16
+ alt: string;
17
+ width: string;
18
+ height: string;
19
+ }
20
+ /**
21
+ * Discriminated union of media-element metadata, keyed by `tag`. To support a
22
+ * new media tag in future if required, add a variant here and a matching case
23
+ * in {@link getMediaInfo}.
24
+ */
25
+ export type MediaInfo = ImageMediaInfo;
26
+ /**
27
+ * Extract editable media metadata from a selected element.
28
+ *
29
+ * Switches on `element.tagName` and returns the variant matching the tag, or
30
+ * `undefined` for elements without a registered media tag (the caller then
31
+ * omits the `media` field from the `component-selected` payload).
32
+ *
33
+ * @param element - The selected DOM element.
34
+ * @returns The media info variant for the element's tag, or `undefined` if the tag is not media.
35
+ */
36
+ export declare function getMediaInfo(element: HTMLElement): MediaInfo | undefined;
37
+ export declare class CommunicationManager {
38
+ constructor();
39
+ /**
40
+ * Notify the extension about a selected component
41
+ * @param element - The selected element
42
+ */
43
+ notifyComponentSelected(element: HTMLElement): void;
44
+ /**
45
+ * Notify the extension about a text change
46
+ * @param element - The element that changed
47
+ * @param originalText - The original text
48
+ * @param newText - The new text
49
+ */
50
+ notifyTextChange(element: HTMLElement, originalText: string, newText: string): void;
51
+ /**
52
+ * Notify the parent window that interactions initialization is complete
53
+ */
54
+ notifyInitializationComplete(): void;
55
+ }
56
+ export {};
57
+ //# sourceMappingURL=communicationManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communicationManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/communicationManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH;;;;;;GAMG;AACH,UAAU,cAAc;IACvB,GAAG,EAAE,KAAK,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC;AAEvC;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAexE;AAED,qBAAa,oBAAoB;;IAKhC;;;OAGG;IACH,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IA0DnD;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAyBnF;;OAEG;IACH,4BAA4B,IAAI,IAAI;CAepC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export interface ComponentMatcherOptions {
7
+ allowlist?: string[];
8
+ }
9
+ export declare class ComponentMatcher {
10
+ private allowlist;
11
+ constructor(options?: ComponentMatcherOptions);
12
+ /**
13
+ * Check whether an element contains compile-time source metadata attributes.
14
+ * @param element - The element to check
15
+ * @returns True if the data-source-file attribute is present
16
+ */
17
+ hasSourceMetadata(element: HTMLElement | null | undefined): boolean;
18
+ private matchesList;
19
+ /**
20
+ * Checks if a label represents a component name (not a fallback like tag name, ID, or text content)
21
+ * @param label - The label to check
22
+ * @param tagName - The element's tag name (lowercase)
23
+ * @returns True if the label is a component name
24
+ */
25
+ isComponentNameLabel(label: string, tagName: string): boolean;
26
+ /**
27
+ * Check if an element is highlightable.
28
+ * @param element - The element to check
29
+ * @returns True if the element should be highlighted
30
+ */
31
+ isHighlightableElement(element: HTMLElement | null | undefined): boolean;
32
+ /**
33
+ * Find the nearest highlightable element by walking up the DOM tree
34
+ * @param target - The target element
35
+ * @returns The highlightable element or null
36
+ */
37
+ findHighlightableElement(target: HTMLElement | null | undefined): HTMLElement | null;
38
+ }
39
+ //# sourceMappingURL=componentMatcher.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export interface ComponentMatcherOptions {
7
+ allowlist?: string[];
8
+ }
9
+ export declare class ComponentMatcher {
10
+ private allowlist;
11
+ constructor(options?: ComponentMatcherOptions);
12
+ /**
13
+ * Check whether an element contains compile-time source metadata attributes.
14
+ * @param element - The element to check
15
+ * @returns True if the data-source-file attribute is present
16
+ */
17
+ hasSourceMetadata(element: HTMLElement | null | undefined): boolean;
18
+ private matchesList;
19
+ /**
20
+ * Checks if a label represents a component name (not a fallback like tag name, ID, or text content)
21
+ * @param label - The label to check
22
+ * @param tagName - The element's tag name (lowercase)
23
+ * @returns True if the label is a component name
24
+ */
25
+ isComponentNameLabel(label: string, tagName: string): boolean;
26
+ /**
27
+ * Check if an element is highlightable.
28
+ * @param element - The element to check
29
+ * @returns True if the element should be highlighted
30
+ */
31
+ isHighlightableElement(element: HTMLElement | null | undefined): boolean;
32
+ /**
33
+ * Find the nearest highlightable element by walking up the DOM tree
34
+ * @param target - The target element
35
+ * @returns The highlightable element or null
36
+ */
37
+ findHighlightableElement(target: HTMLElement | null | undefined): HTMLElement | null;
38
+ }
39
+ //# sourceMappingURL=componentMatcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentMatcher.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/componentMatcher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,MAAM,WAAW,uBAAuB;IAEvC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,SAAS,CAAW;gBAEhB,OAAO,GAAE,uBAA4B;IAIjD;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;IAOnE,OAAO,CAAC,WAAW;IAInB;;;;;OAKG;IACH,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAM7D;;;;OAIG;IACH,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;IAgBxE;;;;OAIG;IACH,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,GAAG,IAAI;CA+BpF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ interface CommunicationManagerLike {
7
+ notifyTextChange: (element: HTMLElement, originalText: string, newText: string) => void;
8
+ }
9
+ export declare const TEXT_TAGS: string[];
10
+ export declare class EditableManager {
11
+ private communicationManager?;
12
+ private boundHandleBlur;
13
+ private boundHandleKeydown;
14
+ private boundHandleInput;
15
+ private editableGroup;
16
+ constructor(communicationManager?: CommunicationManagerLike);
17
+ makeEditableIfText(element: HTMLElement): void;
18
+ removeEditable(element: HTMLElement): void;
19
+ private _isTextElement;
20
+ private _handleInput;
21
+ private _handleBlur;
22
+ private _handleKeydown;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=editableManager.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ interface CommunicationManagerLike {
7
+ notifyTextChange: (element: HTMLElement, originalText: string, newText: string) => void;
8
+ }
9
+ export declare const TEXT_TAGS: string[];
10
+ export declare class EditableManager {
11
+ private communicationManager?;
12
+ private boundHandleBlur;
13
+ private boundHandleKeydown;
14
+ private boundHandleInput;
15
+ private editableGroup;
16
+ constructor(communicationManager?: CommunicationManagerLike);
17
+ makeEditableIfText(element: HTMLElement): void;
18
+ removeEditable(element: HTMLElement): void;
19
+ private _isTextElement;
20
+ private _handleInput;
21
+ private _handleBlur;
22
+ private _handleKeydown;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=editableManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editableManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/editableManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,UAAU,wBAAwB;IACjC,gBAAgB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACxF;AAED,eAAO,MAAM,SAAS,UAA4E,CAAC;AAEnG,qBAAa,eAAe;IAC3B,OAAO,CAAC,oBAAoB,CAAC,CAA2B;IACxD,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,aAAa,CAAgB;gBAEzB,oBAAoB,CAAC,EAAE,wBAAwB;IAQ3D,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAoB9C,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAe1C,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,cAAc;CAiBtB"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ interface ComponentMatcherLike {
7
+ findHighlightableElement: (target: HTMLElement) => HTMLElement | null;
8
+ }
9
+ interface StyleManagerLike {
10
+ highlightElements: (elements: HTMLElement[]) => void;
11
+ unhighlightElements: (elements: HTMLElement[]) => void;
12
+ selectElements: (elements: HTMLElement[]) => void;
13
+ deselectElements: (elements: HTMLElement[]) => void;
14
+ }
15
+ interface EditableManagerLike {
16
+ makeEditableIfText: (element: HTMLElement) => void;
17
+ removeEditable: (element: HTMLElement) => void;
18
+ }
19
+ interface CommunicationManagerLike {
20
+ notifyComponentSelected: (element: HTMLElement) => void;
21
+ }
22
+ export declare class EventHandlers {
23
+ private isInteractionsActive;
24
+ private componentMatcher;
25
+ private styleManager;
26
+ private editableManager;
27
+ private communicationManager;
28
+ private currentHighlightedElements;
29
+ private selectedElement;
30
+ private selectedElements;
31
+ constructor(isInteractionsActive: () => boolean, componentMatcher: ComponentMatcherLike, styleManager: StyleManagerLike, editableManager: EditableManagerLike, communicationManager: CommunicationManagerLike);
32
+ private _findHighlightableElement;
33
+ handleMouseOver(e: MouseEvent): void;
34
+ handleMouseLeave(): void;
35
+ handleClick(e: MouseEvent): void;
36
+ clearAll(): void;
37
+ getSelectedElement(): HTMLElement | null;
38
+ }
39
+ export {};
40
+ //# sourceMappingURL=eventHandlers.d.ts.map
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ interface ComponentMatcherLike {
7
+ findHighlightableElement: (target: HTMLElement) => HTMLElement | null;
8
+ }
9
+ interface StyleManagerLike {
10
+ highlightElements: (elements: HTMLElement[]) => void;
11
+ unhighlightElements: (elements: HTMLElement[]) => void;
12
+ selectElements: (elements: HTMLElement[]) => void;
13
+ deselectElements: (elements: HTMLElement[]) => void;
14
+ }
15
+ interface EditableManagerLike {
16
+ makeEditableIfText: (element: HTMLElement) => void;
17
+ removeEditable: (element: HTMLElement) => void;
18
+ }
19
+ interface CommunicationManagerLike {
20
+ notifyComponentSelected: (element: HTMLElement) => void;
21
+ }
22
+ export declare class EventHandlers {
23
+ private isInteractionsActive;
24
+ private componentMatcher;
25
+ private styleManager;
26
+ private editableManager;
27
+ private communicationManager;
28
+ private currentHighlightedElements;
29
+ private selectedElement;
30
+ private selectedElements;
31
+ constructor(isInteractionsActive: () => boolean, componentMatcher: ComponentMatcherLike, styleManager: StyleManagerLike, editableManager: EditableManagerLike, communicationManager: CommunicationManagerLike);
32
+ private _findHighlightableElement;
33
+ handleMouseOver(e: MouseEvent): void;
34
+ handleMouseLeave(): void;
35
+ handleClick(e: MouseEvent): void;
36
+ clearAll(): void;
37
+ getSelectedElement(): HTMLElement | null;
38
+ }
39
+ export {};
40
+ //# sourceMappingURL=eventHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventHandlers.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/eventHandlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,UAAU,oBAAoB;IAC7B,wBAAwB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAC;CACtE;AAED,UAAU,gBAAgB;IACzB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACrD,mBAAmB,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IACvD,cAAc,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAClD,gBAAgB,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CACpD;AAED,UAAU,mBAAmB;IAC5B,kBAAkB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,cAAc,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC/C;AAED,UAAU,wBAAwB;IACjC,uBAAuB,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CACxD;AAED,qBAAa,aAAa;IACzB,OAAO,CAAC,oBAAoB,CAAgB;IAC5C,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,eAAe,CAAsB;IAC7C,OAAO,CAAC,oBAAoB,CAA2B;IAEvD,OAAO,CAAC,0BAA0B,CAAgB;IAClD,OAAO,CAAC,eAAe,CAAqB;IAC5C,OAAO,CAAC,gBAAgB,CAAgB;gBAGvC,oBAAoB,EAAE,MAAM,OAAO,EACnC,gBAAgB,EAAE,oBAAoB,EACtC,YAAY,EAAE,gBAAgB,EAC9B,eAAe,EAAE,mBAAmB,EACpC,oBAAoB,EAAE,wBAAwB;IAkB/C,OAAO,CAAC,yBAAyB;IAIjC,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAqCpC,gBAAgB,IAAI,IAAI;IAcxB,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA+ChC,QAAQ,IAAI,IAAI;IAchB,kBAAkB,IAAI,WAAW,GAAG,IAAI;CAGxC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,53 @@
1
+ import { SourceLocation } from './utils/sourceUtils.cjs';
2
+ export declare class InteractionsController {
3
+ private enabled;
4
+ private isActive;
5
+ private componentMatcher;
6
+ private styleManager;
7
+ private communicationManager;
8
+ private editableManager;
9
+ private eventHandlers;
10
+ constructor(enabled?: boolean);
11
+ /**
12
+ * Initialize the design mode interactions
13
+ */
14
+ initialize(): void;
15
+ /**
16
+ * Enable the design mode interactions
17
+ */
18
+ enable(): void;
19
+ /**
20
+ * Disable the design mode interactions
21
+ */
22
+ disable(): void;
23
+ private resolveTargets;
24
+ /**
25
+ * Apply a style change to all elements at the given source location.
26
+ * When sourceLocation is provided (undo/redo), it is used directly.
27
+ * Otherwise the source location is read from the currently selected element.
28
+ */
29
+ applyStyleChange(property: string, value: string, sourceLocation?: SourceLocation): void;
30
+ applyTextChange(text: string, sourceLocation?: SourceLocation): void;
31
+ /**
32
+ * Apply attribute changes to all elements at the given source location whose
33
+ * `tagName` matches `tag` (case-insensitive). Per-tag appliers declare which
34
+ * attributes are valid and how empty-string values are handled (e.g. for
35
+ * `img`, an empty `width`/`height` clears the attribute).
36
+ *
37
+ * No-op if the tag has no registered applier. When `sourceLocation` is
38
+ * omitted (live edit), the source is read from the currently selected
39
+ * element; when provided (undo/redo replay), it is used directly.
40
+ *
41
+ * To support a new tag, add an entry to {@link mediaAppliers}.
42
+ *
43
+ * @param tag - The HTML tag the change targets (e.g. `"img"`).
44
+ * @param attributes - Sparse map of attribute names to their new string values; `undefined` values are skipped.
45
+ * @param sourceLocation - Explicit source location for undo/redo; falls back to the selected element when omitted.
46
+ */
47
+ applyMediaChange(tag: string, attributes: Record<string, string | undefined>, sourceLocation?: SourceLocation): void;
48
+ /**
49
+ * Cleanup and remove event listeners
50
+ */
51
+ destroy(): void;
52
+ }
53
+ //# sourceMappingURL=interactionsController.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { SourceLocation } from './utils/sourceUtils.js';
2
+ export declare class InteractionsController {
3
+ private enabled;
4
+ private isActive;
5
+ private componentMatcher;
6
+ private styleManager;
7
+ private communicationManager;
8
+ private editableManager;
9
+ private eventHandlers;
10
+ constructor(enabled?: boolean);
11
+ /**
12
+ * Initialize the design mode interactions
13
+ */
14
+ initialize(): void;
15
+ /**
16
+ * Enable the design mode interactions
17
+ */
18
+ enable(): void;
19
+ /**
20
+ * Disable the design mode interactions
21
+ */
22
+ disable(): void;
23
+ private resolveTargets;
24
+ /**
25
+ * Apply a style change to all elements at the given source location.
26
+ * When sourceLocation is provided (undo/redo), it is used directly.
27
+ * Otherwise the source location is read from the currently selected element.
28
+ */
29
+ applyStyleChange(property: string, value: string, sourceLocation?: SourceLocation): void;
30
+ applyTextChange(text: string, sourceLocation?: SourceLocation): void;
31
+ /**
32
+ * Apply attribute changes to all elements at the given source location whose
33
+ * `tagName` matches `tag` (case-insensitive). Per-tag appliers declare which
34
+ * attributes are valid and how empty-string values are handled (e.g. for
35
+ * `img`, an empty `width`/`height` clears the attribute).
36
+ *
37
+ * No-op if the tag has no registered applier. When `sourceLocation` is
38
+ * omitted (live edit), the source is read from the currently selected
39
+ * element; when provided (undo/redo replay), it is used directly.
40
+ *
41
+ * To support a new tag, add an entry to {@link mediaAppliers}.
42
+ *
43
+ * @param tag - The HTML tag the change targets (e.g. `"img"`).
44
+ * @param attributes - Sparse map of attribute names to their new string values; `undefined` values are skipped.
45
+ * @param sourceLocation - Explicit source location for undo/redo; falls back to the selected element when omitted.
46
+ */
47
+ applyMediaChange(tag: string, attributes: Record<string, string | undefined>, sourceLocation?: SourceLocation): void;
48
+ /**
49
+ * Cleanup and remove event listeners
50
+ */
51
+ destroy(): void;
52
+ }
53
+ //# sourceMappingURL=interactionsController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactionsController.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/interactionsController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAGN,KAAK,cAAc,EACnB,MAAM,qBAAqB,CAAC;AAmC7B,qBAAa,sBAAsB;IAClC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,OAAO,UAAO;IAwD1B;;OAEG;IACH,UAAU,IAAI,IAAI;IAiBlB;;OAEG;IACH,MAAM,IAAI,IAAI;IAKd;;OAEG;IACH,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,cAAc;IAWtB;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAMxF,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI;IAMpE;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CACf,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC9C,cAAc,CAAC,EAAE,cAAc,GAC7B,IAAI;IAUP;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Style Manager Module
8
+ * Handles CSS injection and style management for highlighting
9
+ */
10
+ export declare class StyleManager {
11
+ private styleId;
12
+ private stylesAdded;
13
+ constructor();
14
+ /**
15
+ * Add CSS styles for highlighting to the document
16
+ */
17
+ addHighlightStyles(): void;
18
+ /**
19
+ * Remove highlight styles from the document
20
+ */
21
+ removeHighlightStyles(): void;
22
+ /**
23
+ * Get the CSS styles for highlighting
24
+ * @private
25
+ * @returns CSS styles
26
+ */
27
+ private _getStyles;
28
+ /**
29
+ * Apply highlight class to one or more elements
30
+ * @param elements - The elements to highlight
31
+ */
32
+ highlightElements(elements: HTMLElement[]): void;
33
+ /**
34
+ * Remove highlight class from one or more elements
35
+ * @param elements - The elements to unhighlight
36
+ */
37
+ unhighlightElements(elements: HTMLElement[]): void;
38
+ /**
39
+ * Apply selected class to one or more elements
40
+ * @param elements - The elements to select
41
+ */
42
+ selectElements(elements: HTMLElement[]): void;
43
+ /**
44
+ * Remove selected class from one or more elements
45
+ * @param elements - The elements to deselect
46
+ */
47
+ deselectElements(elements: HTMLElement[]): void;
48
+ }
49
+ //# sourceMappingURL=styleManager.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ /**
7
+ * Style Manager Module
8
+ * Handles CSS injection and style management for highlighting
9
+ */
10
+ export declare class StyleManager {
11
+ private styleId;
12
+ private stylesAdded;
13
+ constructor();
14
+ /**
15
+ * Add CSS styles for highlighting to the document
16
+ */
17
+ addHighlightStyles(): void;
18
+ /**
19
+ * Remove highlight styles from the document
20
+ */
21
+ removeHighlightStyles(): void;
22
+ /**
23
+ * Get the CSS styles for highlighting
24
+ * @private
25
+ * @returns CSS styles
26
+ */
27
+ private _getStyles;
28
+ /**
29
+ * Apply highlight class to one or more elements
30
+ * @param elements - The elements to highlight
31
+ */
32
+ highlightElements(elements: HTMLElement[]): void;
33
+ /**
34
+ * Remove highlight class from one or more elements
35
+ * @param elements - The elements to unhighlight
36
+ */
37
+ unhighlightElements(elements: HTMLElement[]): void;
38
+ /**
39
+ * Apply selected class to one or more elements
40
+ * @param elements - The elements to select
41
+ */
42
+ selectElements(elements: HTMLElement[]): void;
43
+ /**
44
+ * Remove selected class from one or more elements
45
+ * @param elements - The elements to deselect
46
+ */
47
+ deselectElements(elements: HTMLElement[]): void;
48
+ }
49
+ //# sourceMappingURL=styleManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styleManager.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactions/styleManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AAEH,qBAAa,YAAY;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAU;;IAO7B;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAY1B;;OAEG;IACH,qBAAqB,IAAI,IAAI;IAQ7B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAiBlB;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAMhD;;;OAGG;IACH,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAMlD;;;OAGG;IACH,cAAc,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;IAM7C;;;OAGG;IACH,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;CAK/C"}