@base44-preview/vite-plugin 0.2.22-pr.36.db00ef7 → 0.2.22-pr.37.466ee63

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 (119) hide show
  1. package/dist/injections/utils.d.ts +0 -6
  2. package/dist/injections/utils.d.ts.map +1 -1
  3. package/dist/injections/utils.js +0 -25
  4. package/dist/injections/utils.js.map +1 -1
  5. package/dist/injections/visual-edit-agent/capabilities/inline-editing/core.d.ts +25 -0
  6. package/dist/injections/visual-edit-agent/capabilities/inline-editing/core.d.ts.map +1 -0
  7. package/dist/injections/visual-edit-agent/capabilities/inline-editing/core.js +78 -0
  8. package/dist/injections/visual-edit-agent/capabilities/inline-editing/core.js.map +1 -0
  9. package/dist/injections/visual-edit-agent/capabilities/inline-editing/index.d.ts +4 -0
  10. package/dist/injections/visual-edit-agent/capabilities/inline-editing/index.d.ts.map +1 -0
  11. package/dist/injections/visual-edit-agent/capabilities/inline-editing/index.js +4 -0
  12. package/dist/injections/visual-edit-agent/capabilities/inline-editing/index.js.map +1 -0
  13. package/dist/injections/visual-edit-agent/capabilities/inline-editing/styles.d.ts +9 -0
  14. package/dist/injections/visual-edit-agent/capabilities/inline-editing/styles.d.ts.map +1 -0
  15. package/dist/injections/visual-edit-agent/capabilities/inline-editing/styles.js +26 -0
  16. package/dist/injections/visual-edit-agent/capabilities/inline-editing/styles.js.map +1 -0
  17. package/dist/injections/visual-edit-agent/capabilities/inline-editing/validation.d.ts +10 -0
  18. package/dist/injections/visual-edit-agent/capabilities/inline-editing/validation.d.ts.map +1 -0
  19. package/dist/injections/visual-edit-agent/capabilities/inline-editing/validation.js +60 -0
  20. package/dist/injections/visual-edit-agent/capabilities/inline-editing/validation.js.map +1 -0
  21. package/dist/injections/visual-edit-agent/constants.d.ts +10 -0
  22. package/dist/injections/visual-edit-agent/constants.d.ts.map +1 -0
  23. package/dist/injections/visual-edit-agent/constants.js +10 -0
  24. package/dist/injections/visual-edit-agent/constants.js.map +1 -0
  25. package/dist/injections/visual-edit-agent/handlers/click-handlers.d.ts +10 -0
  26. package/dist/injections/visual-edit-agent/handlers/click-handlers.d.ts.map +1 -0
  27. package/dist/injections/visual-edit-agent/handlers/click-handlers.js +109 -0
  28. package/dist/injections/visual-edit-agent/handlers/click-handlers.js.map +1 -0
  29. package/dist/injections/visual-edit-agent/handlers/hover-handlers.d.ts +14 -0
  30. package/dist/injections/visual-edit-agent/handlers/hover-handlers.d.ts.map +1 -0
  31. package/dist/injections/visual-edit-agent/handlers/hover-handlers.js +64 -0
  32. package/dist/injections/visual-edit-agent/handlers/hover-handlers.js.map +1 -0
  33. package/dist/injections/visual-edit-agent/handlers/inline-edit-handlers.d.ts +14 -0
  34. package/dist/injections/visual-edit-agent/handlers/inline-edit-handlers.d.ts.map +1 -0
  35. package/dist/injections/visual-edit-agent/handlers/inline-edit-handlers.js +99 -0
  36. package/dist/injections/visual-edit-agent/handlers/inline-edit-handlers.js.map +1 -0
  37. package/dist/injections/visual-edit-agent/handlers/message-handlers.d.ts +26 -0
  38. package/dist/injections/visual-edit-agent/handlers/message-handlers.d.ts.map +1 -0
  39. package/dist/injections/visual-edit-agent/handlers/message-handlers.js +145 -0
  40. package/dist/injections/visual-edit-agent/handlers/message-handlers.js.map +1 -0
  41. package/dist/injections/visual-edit-agent/handlers/messages/toggle-inline-edit-mode.d.ts +7 -0
  42. package/dist/injections/visual-edit-agent/handlers/messages/toggle-inline-edit-mode.d.ts.map +1 -0
  43. package/dist/injections/visual-edit-agent/handlers/messages/toggle-inline-edit-mode.js +42 -0
  44. package/dist/injections/visual-edit-agent/handlers/messages/toggle-inline-edit-mode.js.map +1 -0
  45. package/dist/injections/visual-edit-agent/handlers/messages/toggle-visual-edit-mode.d.ts +11 -0
  46. package/dist/injections/visual-edit-agent/handlers/messages/toggle-visual-edit-mode.d.ts.map +1 -0
  47. package/dist/injections/visual-edit-agent/handlers/messages/toggle-visual-edit-mode.js +33 -0
  48. package/dist/injections/visual-edit-agent/handlers/messages/toggle-visual-edit-mode.js.map +1 -0
  49. package/dist/injections/visual-edit-agent/handlers/messages/types.d.ts +86 -0
  50. package/dist/injections/visual-edit-agent/handlers/messages/types.d.ts.map +1 -0
  51. package/dist/injections/visual-edit-agent/handlers/messages/types.js +28 -0
  52. package/dist/injections/visual-edit-agent/handlers/messages/types.js.map +1 -0
  53. package/dist/injections/visual-edit-agent/index.d.ts +5 -0
  54. package/dist/injections/visual-edit-agent/index.d.ts.map +1 -0
  55. package/dist/injections/visual-edit-agent/index.js +100 -0
  56. package/dist/injections/visual-edit-agent/index.js.map +1 -0
  57. package/dist/injections/visual-edit-agent/state/agent-state.d.ts +17 -0
  58. package/dist/injections/visual-edit-agent/state/agent-state.d.ts.map +1 -0
  59. package/dist/injections/visual-edit-agent/state/agent-state.js +18 -0
  60. package/dist/injections/visual-edit-agent/state/agent-state.js.map +1 -0
  61. package/dist/injections/visual-edit-agent/ui/overlay.d.ts +26 -0
  62. package/dist/injections/visual-edit-agent/ui/overlay.d.ts.map +1 -0
  63. package/dist/injections/visual-edit-agent/ui/overlay.js +103 -0
  64. package/dist/injections/visual-edit-agent/ui/overlay.js.map +1 -0
  65. package/dist/injections/visual-edit-agent/utils/dom-utils.d.ts +14 -0
  66. package/dist/injections/visual-edit-agent/utils/dom-utils.d.ts.map +1 -0
  67. package/dist/injections/visual-edit-agent/utils/dom-utils.js +34 -0
  68. package/dist/injections/visual-edit-agent/utils/dom-utils.js.map +1 -0
  69. package/dist/injections/visual-edit-agent.d.ts +1 -1
  70. package/dist/injections/visual-edit-agent.d.ts.map +1 -1
  71. package/dist/injections/visual-edit-agent.js +1 -474
  72. package/dist/injections/visual-edit-agent.js.map +1 -1
  73. package/dist/statics/index.mjs +5 -1
  74. package/dist/statics/index.mjs.map +1 -1
  75. package/package.json +1 -1
  76. package/src/injections/utils.ts +0 -34
  77. package/src/injections/visual-edit-agent/README.md +222 -0
  78. package/src/injections/visual-edit-agent/capabilities/inline-editing/core.ts +100 -0
  79. package/src/injections/visual-edit-agent/capabilities/inline-editing/index.ts +10 -0
  80. package/src/injections/visual-edit-agent/capabilities/inline-editing/styles.ts +26 -0
  81. package/src/injections/visual-edit-agent/capabilities/inline-editing/validation.ts +67 -0
  82. package/src/injections/visual-edit-agent/constants.ts +9 -0
  83. package/src/injections/visual-edit-agent/handlers/click-handlers.ts +135 -0
  84. package/src/injections/visual-edit-agent/handlers/hover-handlers.ts +78 -0
  85. package/src/injections/visual-edit-agent/handlers/inline-edit-handlers.ts +130 -0
  86. package/src/injections/visual-edit-agent/handlers/message-handlers.ts +191 -0
  87. package/src/injections/visual-edit-agent/handlers/messages/toggle-inline-edit-mode.ts +51 -0
  88. package/src/injections/visual-edit-agent/handlers/messages/toggle-visual-edit-mode.ts +41 -0
  89. package/src/injections/visual-edit-agent/handlers/messages/types.ts +112 -0
  90. package/src/injections/visual-edit-agent/index.ts +116 -0
  91. package/src/injections/visual-edit-agent/state/agent-state.ts +31 -0
  92. package/src/injections/visual-edit-agent/ui/overlay.ts +125 -0
  93. package/src/injections/visual-edit-agent/utils/dom-utils.ts +39 -0
  94. package/src/injections/visual-edit-agent.ts +1 -577
  95. package/dist/injections/layer-dropdown/consts.d.ts +0 -15
  96. package/dist/injections/layer-dropdown/consts.d.ts.map +0 -1
  97. package/dist/injections/layer-dropdown/consts.js +0 -36
  98. package/dist/injections/layer-dropdown/consts.js.map +0 -1
  99. package/dist/injections/layer-dropdown/controller.d.ts +0 -4
  100. package/dist/injections/layer-dropdown/controller.d.ts.map +0 -1
  101. package/dist/injections/layer-dropdown/controller.js +0 -85
  102. package/dist/injections/layer-dropdown/controller.js.map +0 -1
  103. package/dist/injections/layer-dropdown/dropdown-ui.d.ts +0 -13
  104. package/dist/injections/layer-dropdown/dropdown-ui.d.ts.map +0 -1
  105. package/dist/injections/layer-dropdown/dropdown-ui.js +0 -158
  106. package/dist/injections/layer-dropdown/dropdown-ui.js.map +0 -1
  107. package/dist/injections/layer-dropdown/types.d.ts +0 -21
  108. package/dist/injections/layer-dropdown/types.d.ts.map +0 -1
  109. package/dist/injections/layer-dropdown/types.js +0 -3
  110. package/dist/injections/layer-dropdown/types.js.map +0 -1
  111. package/dist/injections/layer-dropdown/utils.d.ts +0 -23
  112. package/dist/injections/layer-dropdown/utils.d.ts.map +0 -1
  113. package/dist/injections/layer-dropdown/utils.js +0 -119
  114. package/dist/injections/layer-dropdown/utils.js.map +0 -1
  115. package/src/injections/layer-dropdown/consts.ts +0 -44
  116. package/src/injections/layer-dropdown/controller.ts +0 -105
  117. package/src/injections/layer-dropdown/dropdown-ui.ts +0 -221
  118. package/src/injections/layer-dropdown/types.ts +0 -24
  119. package/src/injections/layer-dropdown/utils.ts +0 -148
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/injections/visual-edit-agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,SAAS,oBAAoB;IAC3B,MAAM,sBAAsB,GAAG,QAAQ,CAAC,gBAAgB,CACtD,kDAAkD,CACnD,CAAC;IACF,sBAAsB,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,EAAiB,CAAC;QACjC,MAAM,EAAE,GAAG,aAAa,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,KAAK,EAAE,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C,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IACzE,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,oBAAoB,EAAE,CAAC;IACvB,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAC/B,uBAAuB,EAAE,CAAC;IAC1B,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAE3B,qCAAqC;IACrC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE;QACtC,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;KACvD,CAAC,CAAC;IAEH,+BAA+B;IAC/B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,mBAAmB,CAAC,uBAAuB,EAAE,EAAE,GAAG,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Central state management for the visual edit agent
3
+ */
4
+ export interface AgentState {
5
+ isVisualEditMode: boolean;
6
+ isPopoverDragging: boolean;
7
+ isDropdownOpen: boolean;
8
+ hoverOverlays: HTMLDivElement[];
9
+ selectedOverlays: HTMLDivElement[];
10
+ currentHighlightedElements: Element[];
11
+ selectedElementId: string | null;
12
+ currentEditingElement: HTMLElement | null;
13
+ debouncedSendTimeout: ReturnType<typeof setTimeout> | null;
14
+ isInlineEditExperimentEnabled: boolean;
15
+ }
16
+ export declare function createAgentState(): AgentState;
17
+ //# sourceMappingURL=agent-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-state.d.ts","sourceRoot":"","sources":["../../../../src/injections/visual-edit-agent/state/agent-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,cAAc,EAAE,CAAC;IAChC,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,0BAA0B,EAAE,OAAO,EAAE,CAAC;IACtC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,qBAAqB,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1C,oBAAoB,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IAC3D,6BAA6B,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,gBAAgB,IAAI,UAAU,CAa7C"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Central state management for the visual edit agent
3
+ */
4
+ export function createAgentState() {
5
+ return {
6
+ isVisualEditMode: false,
7
+ isPopoverDragging: false,
8
+ isDropdownOpen: false,
9
+ hoverOverlays: [],
10
+ selectedOverlays: [],
11
+ currentHighlightedElements: [],
12
+ selectedElementId: null,
13
+ currentEditingElement: null,
14
+ debouncedSendTimeout: null,
15
+ isInlineEditExperimentEnabled: false,
16
+ };
17
+ }
18
+ //# sourceMappingURL=agent-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-state.js","sourceRoot":"","sources":["../../../../src/injections/visual-edit-agent/state/agent-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,gBAAgB,EAAE,KAAK;QACvB,iBAAiB,EAAE,KAAK;QACxB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,EAAE;QACjB,gBAAgB,EAAE,EAAE;QACpB,0BAA0B,EAAE,EAAE;QAC9B,iBAAiB,EAAE,IAAI;QACvB,qBAAqB,EAAE,IAAI;QAC3B,oBAAoB,EAAE,IAAI;QAC1B,6BAA6B,EAAE,KAAK;KACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { AgentState } from "../state/agent-state.js";
2
+ /**
3
+ * Create an overlay element for highlighting
4
+ */
5
+ export declare function createOverlay(isSelected?: boolean): HTMLDivElement;
6
+ /**
7
+ * Position overlay relative to element
8
+ */
9
+ export declare function positionOverlay(overlay: HTMLDivElement, element: Element, isSelected?: boolean, isVisualEditMode?: boolean): void;
10
+ /**
11
+ * Clear all overlays from DOM
12
+ */
13
+ export declare function clearOverlays(overlays: HTMLDivElement[]): void;
14
+ /**
15
+ * Remove data-selected attribute, clear selected overlays, and reset selection state
16
+ */
17
+ export declare function clearSelection(state: AgentState): void;
18
+ /**
19
+ * Reposition selected overlays to match current element bounds
20
+ */
21
+ export declare function repositionSelectedOverlays(state: AgentState): void;
22
+ /**
23
+ * Reposition hover overlays to match current element bounds
24
+ */
25
+ export declare function repositionHoverOverlays(state: AgentState): void;
26
+ //# sourceMappingURL=overlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/injections/visual-edit-agent/ui/overlay.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAG1D;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,UAAQ,GAAG,cAAc,CAehE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,OAAO,EAChB,UAAU,UAAQ,EAClB,gBAAgB,UAAO,GACtB,IAAI,CAgCN;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAM9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAYtD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAQlE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAM/D"}
@@ -0,0 +1,103 @@
1
+ import { OVERLAY_TRANSITION, OVERLAY_Z_INDEX, SELECTED_BORDER_COLOR, HOVER_BORDER_COLOR, HOVER_BACKGROUND_COLOR, LABEL_TOP_OFFSET, LABEL_LEFT_OFFSET, } from "../constants.js";
2
+ import { findElementsById } from "../../utils.js";
3
+ /**
4
+ * Create an overlay element for highlighting
5
+ */
6
+ export function createOverlay(isSelected = false) {
7
+ const overlay = document.createElement("div");
8
+ overlay.style.position = "absolute";
9
+ overlay.style.pointerEvents = "none";
10
+ overlay.style.transition = OVERLAY_TRANSITION;
11
+ overlay.style.zIndex = OVERLAY_Z_INDEX;
12
+ if (isSelected) {
13
+ overlay.style.border = `2px solid ${SELECTED_BORDER_COLOR}`;
14
+ }
15
+ else {
16
+ overlay.style.border = `2px solid ${HOVER_BORDER_COLOR}`;
17
+ overlay.style.backgroundColor = HOVER_BACKGROUND_COLOR;
18
+ }
19
+ return overlay;
20
+ }
21
+ /**
22
+ * Position overlay relative to element
23
+ */
24
+ export function positionOverlay(overlay, element, isSelected = false, isVisualEditMode = true) {
25
+ if (!element || !isVisualEditMode)
26
+ return;
27
+ const htmlElement = element;
28
+ // Force layout recalculation
29
+ void htmlElement.offsetWidth;
30
+ const rect = element.getBoundingClientRect();
31
+ overlay.style.top = `${rect.top + window.scrollY}px`;
32
+ overlay.style.left = `${rect.left + window.scrollX}px`;
33
+ overlay.style.width = `${rect.width}px`;
34
+ overlay.style.height = `${rect.height}px`;
35
+ // Check if label already exists in overlay
36
+ let label = overlay.querySelector("div");
37
+ if (!label) {
38
+ label = document.createElement("div");
39
+ label.textContent = element.tagName.toLowerCase();
40
+ label.style.position = "absolute";
41
+ label.style.top = LABEL_TOP_OFFSET;
42
+ label.style.left = LABEL_LEFT_OFFSET;
43
+ label.style.padding = "2px 8px";
44
+ label.style.fontSize = "11px";
45
+ label.style.fontWeight = isSelected ? "500" : "400";
46
+ label.style.color = isSelected ? "#ffffff" : "#526cff";
47
+ label.style.backgroundColor = isSelected ? "#526cff" : "#DBEAFE";
48
+ label.style.borderRadius = "3px";
49
+ label.style.minWidth = "24px";
50
+ label.style.textAlign = "center";
51
+ overlay.appendChild(label);
52
+ }
53
+ }
54
+ /**
55
+ * Clear all overlays from DOM
56
+ */
57
+ export function clearOverlays(overlays) {
58
+ overlays.forEach((overlay) => {
59
+ if (overlay && overlay.parentNode) {
60
+ overlay.remove();
61
+ }
62
+ });
63
+ }
64
+ /**
65
+ * Remove data-selected attribute, clear selected overlays, and reset selection state
66
+ */
67
+ export function clearSelection(state) {
68
+ if (state.selectedElementId) {
69
+ const elements = findElementsById(state.selectedElementId);
70
+ elements.forEach((el) => {
71
+ if (el instanceof HTMLElement) {
72
+ delete el.dataset.selected;
73
+ }
74
+ });
75
+ }
76
+ clearOverlays(state.selectedOverlays);
77
+ state.selectedOverlays = [];
78
+ state.selectedElementId = null;
79
+ }
80
+ /**
81
+ * Reposition selected overlays to match current element bounds
82
+ */
83
+ export function repositionSelectedOverlays(state) {
84
+ if (!state.selectedElementId)
85
+ return;
86
+ const elements = findElementsById(state.selectedElementId);
87
+ state.selectedOverlays.forEach((overlay, index) => {
88
+ if (index < elements.length) {
89
+ positionOverlay(overlay, elements[index], true, state.isVisualEditMode);
90
+ }
91
+ });
92
+ }
93
+ /**
94
+ * Reposition hover overlays to match current element bounds
95
+ */
96
+ export function repositionHoverOverlays(state) {
97
+ state.hoverOverlays.forEach((overlay, index) => {
98
+ if (index < state.currentHighlightedElements.length) {
99
+ positionOverlay(overlay, state.currentHighlightedElements[index], false, state.isVisualEditMode);
100
+ }
101
+ });
102
+ }
103
+ //# sourceMappingURL=overlay.js.map
@@ -0,0 +1 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E;QAChD,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC5B,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAE,EAAE,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAiB;IACvD,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAC7C,IAAI,KAAK,GAAG,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE,CAAC;YACpD,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,0BAA0B,CAAC,KAAK,CAAE,EAAE,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACpG,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ElementPosition } from "../handlers/messages/types.js";
2
+ /**
3
+ * Calculate element position from bounding rect
4
+ */
5
+ export declare function getElementPosition(rect: DOMRect): ElementPosition;
6
+ /**
7
+ * Check if element rect is in viewport
8
+ */
9
+ export declare function isElementInViewport(rect: DOMRect): boolean;
10
+ /**
11
+ * Get element classes (handles both HTML and SVG)
12
+ */
13
+ export declare function getElementClasses(element: Element): string;
14
+ //# sourceMappingURL=dom-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-utils.d.ts","sourceRoot":"","sources":["../../../../src/injections/visual-edit-agent/utils/dom-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAWjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAO1D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAK1D"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Calculate element position from bounding rect
3
+ */
4
+ export function getElementPosition(rect) {
5
+ return {
6
+ top: rect.top,
7
+ left: rect.left,
8
+ right: rect.right,
9
+ bottom: rect.bottom,
10
+ width: rect.width,
11
+ height: rect.height,
12
+ centerX: rect.left + rect.width / 2,
13
+ centerY: rect.top + rect.height / 2,
14
+ };
15
+ }
16
+ /**
17
+ * Check if element rect is in viewport
18
+ */
19
+ export function isElementInViewport(rect) {
20
+ return (rect.top < window.innerHeight &&
21
+ rect.bottom > 0 &&
22
+ rect.left < window.innerWidth &&
23
+ rect.right > 0);
24
+ }
25
+ /**
26
+ * Get element classes (handles both HTML and SVG)
27
+ */
28
+ export function getElementClasses(element) {
29
+ if (element instanceof SVGElement) {
30
+ return element.className?.baseVal || "";
31
+ }
32
+ return element.className || "";
33
+ }
34
+ //# sourceMappingURL=dom-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-utils.js","sourceRoot":"","sources":["../../../../src/injections/visual-edit-agent/utils/dom-utils.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAa;IAC9C,OAAO;QACL,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC;QACnC,OAAO,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,OAAO,CACL,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,WAAW;QAC7B,IAAI,CAAC,MAAM,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU;QAC7B,IAAI,CAAC,KAAK,GAAG,CAAC,CACf,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,IAAI,OAAO,YAAY,UAAU,EAAE,CAAC;QAClC,OAAQ,OAAO,CAAC,SAA0C,EAAE,OAAO,IAAI,EAAE,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AACjC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function setupVisualEditAgent(): void;
1
+ export { setupVisualEditAgent } from "./visual-edit-agent/index.js";
2
2
  //# sourceMappingURL=visual-edit-agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"visual-edit-agent.d.ts","sourceRoot":"","sources":["../../src/injections/visual-edit-agent.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,SA4jBnC"}
1
+ {"version":3,"file":"visual-edit-agent.d.ts","sourceRoot":"","sources":["../../src/injections/visual-edit-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}