@base44-preview/vite-plugin 0.2.19-pr.32.ed8900e → 0.2.20-pr.27.c07198f
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/README.md +93 -0
- package/dist/ErrorOverlay.d.ts.map +1 -0
- package/dist/ErrorOverlay.js.map +1 -0
- package/dist/bridge.d.ts +20 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +33 -0
- package/dist/bridge.js.map +1 -0
- package/dist/error-overlay-plugin.d.ts.map +1 -0
- package/dist/error-overlay-plugin.js.map +1 -0
- package/dist/{src/html-injections-plugin.d.ts → html-injections-plugin.d.ts} +4 -2
- package/dist/html-injections-plugin.d.ts.map +1 -0
- package/dist/html-injections-plugin.js +39 -0
- package/dist/html-injections-plugin.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/injections/navigation-notifier.d.ts +3 -0
- package/dist/injections/navigation-notifier.d.ts.map +1 -0
- package/dist/{src/injections → injections}/navigation-notifier.js +2 -2
- package/dist/injections/navigation-notifier.js.map +1 -0
- package/dist/injections/sandbox-hmr-notifier.d.ts +5 -0
- package/dist/injections/sandbox-hmr-notifier.d.ts.map +1 -0
- package/dist/injections/sandbox-hmr-notifier.js +10 -0
- package/dist/injections/sandbox-hmr-notifier.js.map +1 -0
- package/dist/injections/sandbox-mount-observer.d.ts +3 -0
- package/dist/injections/sandbox-mount-observer.d.ts.map +1 -0
- package/dist/{src/injections → injections}/sandbox-mount-observer.js +2 -2
- package/dist/injections/sandbox-mount-observer.js.map +1 -0
- package/dist/injections/unhandled-errors-handlers.d.ts +5 -0
- package/dist/injections/unhandled-errors-handlers.d.ts.map +1 -0
- package/dist/injections/unhandled-errors-handlers.js +74 -0
- package/dist/injections/unhandled-errors-handlers.js.map +1 -0
- package/dist/injections/utils.d.ts.map +1 -0
- package/dist/injections/utils.js.map +1 -0
- package/dist/injections/visual-edit-agent.d.ts +2 -0
- package/dist/injections/visual-edit-agent.d.ts.map +1 -0
- package/dist/{src/injections → injections}/visual-edit-agent.js +1 -1
- package/dist/injections/visual-edit-agent.js.map +1 -0
- package/dist/statics/index.mjs +2 -0
- package/dist/statics/index.mjs.map +1 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js.map +1 -0
- package/dist/visual-edit-plugin.d.ts.map +1 -0
- package/dist/visual-edit-plugin.js.map +1 -0
- package/package.json +13 -8
- package/src/bridge.ts +37 -0
- package/src/html-injections-plugin.ts +33 -54
- package/src/injections/navigation-notifier.ts +2 -1
- package/src/injections/sandbox-hmr-notifier.ts +4 -3
- package/src/injections/sandbox-mount-observer.ts +2 -2
- package/src/injections/unhandled-errors-handlers.ts +84 -80
- package/src/injections/visual-edit-agent.ts +2 -2
- package/dist/src/ErrorOverlay.d.ts.map +0 -1
- package/dist/src/ErrorOverlay.js.map +0 -1
- package/dist/src/error-overlay-plugin.d.ts.map +0 -1
- package/dist/src/error-overlay-plugin.js.map +0 -1
- package/dist/src/html-injections-plugin.d.ts.map +0 -1
- package/dist/src/html-injections-plugin.js +0 -63
- package/dist/src/html-injections-plugin.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/injections/navigation-notifier.d.ts +0 -2
- package/dist/src/injections/navigation-notifier.d.ts.map +0 -1
- package/dist/src/injections/navigation-notifier.js.map +0 -1
- package/dist/src/injections/sandbox-hmr-notifier.d.ts +0 -2
- package/dist/src/injections/sandbox-hmr-notifier.d.ts.map +0 -1
- package/dist/src/injections/sandbox-hmr-notifier.js +0 -10
- package/dist/src/injections/sandbox-hmr-notifier.js.map +0 -1
- package/dist/src/injections/sandbox-mount-observer.d.ts +0 -2
- package/dist/src/injections/sandbox-mount-observer.d.ts.map +0 -1
- package/dist/src/injections/sandbox-mount-observer.js.map +0 -1
- package/dist/src/injections/unhandled-errors-handlers.d.ts +0 -2
- package/dist/src/injections/unhandled-errors-handlers.d.ts.map +0 -1
- package/dist/src/injections/unhandled-errors-handlers.js +0 -72
- package/dist/src/injections/unhandled-errors-handlers.js.map +0 -1
- package/dist/src/injections/utils.d.ts.map +0 -1
- package/dist/src/injections/utils.js.map +0 -1
- package/dist/src/injections/visual-edit-agent.d.ts +0 -2
- package/dist/src/injections/visual-edit-agent.d.ts.map +0 -1
- package/dist/src/injections/visual-edit-agent.js.map +0 -1
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js.map +0 -1
- package/dist/src/visual-edit-plugin.d.ts.map +0 -1
- package/dist/src/visual-edit-plugin.js.map +0 -1
- package/dist/tests/visual-edit-agent.test.d.ts +0 -2
- package/dist/tests/visual-edit-agent.test.d.ts.map +0 -1
- package/dist/tests/visual-edit-agent.test.js +0 -82
- package/dist/tests/visual-edit-agent.test.js.map +0 -1
- /package/dist/{src/ErrorOverlay.d.ts → ErrorOverlay.d.ts} +0 -0
- /package/dist/{src/ErrorOverlay.js → ErrorOverlay.js} +0 -0
- /package/dist/{src/error-overlay-plugin.d.ts → error-overlay-plugin.d.ts} +0 -0
- /package/dist/{src/error-overlay-plugin.js → error-overlay-plugin.js} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/injections → injections}/utils.d.ts +0 -0
- /package/dist/{src/injections → injections}/utils.js +0 -0
- /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
- /package/dist/{src/utils.js → utils.js} +0 -0
- /package/dist/{src/visual-edit-plugin.d.ts → visual-edit-plugin.d.ts} +0 -0
- /package/dist/{src/visual-edit-plugin.js → visual-edit-plugin.js} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @base44/vite-plugin
|
|
2
|
+
|
|
3
|
+
Vite plugin for Base44 applications running in sandboxed iframes. Provides error tracking, HMR notifications, visual editing, navigation tracking, and legacy SDK compatibility.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @base44/vite-plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// vite.config.ts
|
|
15
|
+
import base44 from "@base44/vite-plugin";
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
plugins: [
|
|
19
|
+
base44({
|
|
20
|
+
legacySDKImports: false,
|
|
21
|
+
hmrNotifier: true,
|
|
22
|
+
navigationNotifier: true,
|
|
23
|
+
visualEditAgent: true,
|
|
24
|
+
}),
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Options
|
|
30
|
+
|
|
31
|
+
| Option | Type | Default | Description |
|
|
32
|
+
| -------------------- | --------- | ------- | --------------------------------------------------- |
|
|
33
|
+
| `legacySDKImports` | `boolean` | `false` | Enable legacy SDK import resolution via compat layer |
|
|
34
|
+
| `hmrNotifier` | `boolean` | `false` | Notify parent window of HMR update lifecycle |
|
|
35
|
+
| `navigationNotifier` | `boolean` | `false` | Track URL changes and notify parent window |
|
|
36
|
+
| `visualEditAgent` | `boolean` | `false` | Enable interactive visual element editing |
|
|
37
|
+
|
|
38
|
+
## Architecture
|
|
39
|
+
|
|
40
|
+
### Plugin Composition
|
|
41
|
+
|
|
42
|
+
The plugin registers four sub-plugins when running in a sandbox (`MODAL_SANDBOX_ID` is set):
|
|
43
|
+
|
|
44
|
+
1. **base44** — Core configuration: path aliases (`@/` → `/src/`), environment variables, dependency optimization, and legacy SDK import resolution.
|
|
45
|
+
2. **iframe-hmr** — Sets CORS and `frame-ancestors` headers to allow iframe embedding.
|
|
46
|
+
3. **error-overlay** — Replaces Vite's default error overlay with a custom one that reports errors to the parent window.
|
|
47
|
+
4. **html-injections** — Injects the sandbox bridge script into the HTML.
|
|
48
|
+
|
|
49
|
+
Outside a sandbox, only the core plugin runs (with optional API proxy support via `VITE_BASE44_APP_BASE_URL`).
|
|
50
|
+
|
|
51
|
+
### Sandbox Bridge
|
|
52
|
+
|
|
53
|
+
The bridge (`src/bridge.ts`) is a single ES module that consolidates all sandbox-side features. Instead of injecting multiple individual `<script>` tags, the HTML injections plugin injects one inline script that dynamically imports the bridge and calls `init()` with the configured options.
|
|
54
|
+
|
|
55
|
+
The bridge conditionally sets up:
|
|
56
|
+
|
|
57
|
+
- **Error handlers** — Global `error` and `unhandledrejection` listeners that report to the parent via `postMessage`.
|
|
58
|
+
- **Mount observer** — `MutationObserver` that detects when instrumented elements (`data-source-location`) are rendered.
|
|
59
|
+
- **HMR notifier** — Forwards Vite's `beforeUpdate`/`afterUpdate` events to the parent.
|
|
60
|
+
- **Navigation notifier** — Intercepts `pushState`, `replaceState`, and `popstate` to track URL changes.
|
|
61
|
+
- **Visual edit agent** — Overlay system for selecting and editing elements with source location awareness.
|
|
62
|
+
|
|
63
|
+
### Local Development
|
|
64
|
+
|
|
65
|
+
For developing the bridge itself, you can load it from a local dev server instead of the installed package:
|
|
66
|
+
|
|
67
|
+
1. Generate local HTTPS certificates:
|
|
68
|
+
```bash
|
|
69
|
+
mkcert localhost
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
2. Start the dev server (with optional watch mode):
|
|
73
|
+
```bash
|
|
74
|
+
npm run dev # serve dist/statics/ on https://localhost:3201
|
|
75
|
+
npm run dev -- -w # same, with auto-rebuild on changes
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
3. Add `?sandbox-bridge=local` to your app's URL to load the bridge from `localhost:3201` instead of `node_modules`.
|
|
79
|
+
|
|
80
|
+
### Legacy SDK Compatibility
|
|
81
|
+
|
|
82
|
+
When `legacySDKImports` is enabled, imports of `/entities`, `/functions`, `/integrations`, and `/agents` are resolved to compatibility modules in `compat/`. These use `Proxy` objects to route calls to the Base44 SDK client.
|
|
83
|
+
|
|
84
|
+
## Building
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run build # TypeScript compilation (plugin)
|
|
88
|
+
npm run build:bridge # tsup bundle (bridge ES module for browsers)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorOverlay.d.ts","sourceRoot":"","sources":["../src/ErrorOverlay.ts"],"names":[],"mappings":"AAGA,QAAA,MAAQ,WAAW;;CAA0B,CAAC;AAE9C,qBAAa,YAAa,SAAQ,WAAW;IAC3C,MAAM,CAAC,cAAc;IAMrB,KAAK;IAIL,MAAM,CAAC,iBAAiB,CACtB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,aAAa,EAAE,MAAM,GAAG,SAAS;gBAqBvB,KAAK,EAAE,KAAK;CAuBzB;AAGD,eAAO,MAAM,gBAAgB,QAG5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorOverlay.js","sourceRoot":"","sources":["../src/ErrorOverlay.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAE3B,yDAAyD;AACzD,MAAM,EAAE,WAAW,GAAG;CAAQ,EAAE,GAAG,UAAU,CAAC;AAE9C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,MAAM,CAAC,cAAc;QACnB,OAAO;;;KAGN,CAAC;IACJ,CAAC;IACD,KAAK;QACF,IAAY,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,iBAAiB,CACtB,KAAY,EACZ,KAAa,EACb,OAA2B,EAC3B,aAAiC;QAEjC,uCAAuC;QACvC,IAAI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC;gBACH,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CACnC;oBACE,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,a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@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox bridge entry point — dynamically imported by the inline script
|
|
3
|
+
* injected via html-injections-plugin. Conditionally initialises each
|
|
4
|
+
* sandbox-side feature based on the supplied options.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Initialise the sandbox bridge. Called once from the injected inline script.
|
|
8
|
+
* @param options Feature flags — each defaults to enabled unless explicitly disabled.
|
|
9
|
+
* @param hmr Vite's HMR client (`import.meta.hot`), passed only in dev mode.
|
|
10
|
+
*/
|
|
11
|
+
export declare function init(options?: {
|
|
12
|
+
unhandledErrors?: boolean;
|
|
13
|
+
mountObserver?: boolean;
|
|
14
|
+
hmrNotifier?: boolean;
|
|
15
|
+
navigationNotifier?: boolean;
|
|
16
|
+
visualEditAgent?: boolean;
|
|
17
|
+
}, hmr?: {
|
|
18
|
+
on(event: string, cb: (...args: any[]) => void): void;
|
|
19
|
+
}): void;
|
|
20
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;;;GAIG;AACH,wBAAgB,IAAI,CAClB,OAAO,GAAE;IACP,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,EACN,GAAG,CAAC,EAAE;IAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;CAAE,QAWhE"}
|
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sandbox bridge entry point — dynamically imported by the inline script
|
|
3
|
+
* injected via html-injections-plugin. Conditionally initialises each
|
|
4
|
+
* sandbox-side feature based on the supplied options.
|
|
5
|
+
*/
|
|
6
|
+
import { setupUnhandledErrors } from "./injections/unhandled-errors-handlers.js";
|
|
7
|
+
import { setupHmrNotifier } from "./injections/sandbox-hmr-notifier.js";
|
|
8
|
+
import { setupMountObserver } from "./injections/sandbox-mount-observer.js";
|
|
9
|
+
import { setupNavigationNotifier } from "./injections/navigation-notifier.js";
|
|
10
|
+
import { setupVisualEditAgent } from "./injections/visual-edit-agent.js";
|
|
11
|
+
/**
|
|
12
|
+
* Initialise the sandbox bridge. Called once from the injected inline script.
|
|
13
|
+
* @param options Feature flags — each defaults to enabled unless explicitly disabled.
|
|
14
|
+
* @param hmr Vite's HMR client (`import.meta.hot`), passed only in dev mode.
|
|
15
|
+
*/
|
|
16
|
+
export function init(options = {}, hmr) {
|
|
17
|
+
if (window.self === window.top)
|
|
18
|
+
return;
|
|
19
|
+
if (globalThis.__sandboxBridgeInitialized)
|
|
20
|
+
return;
|
|
21
|
+
globalThis.__sandboxBridgeInitialized = true;
|
|
22
|
+
if (options.unhandledErrors !== false)
|
|
23
|
+
setupUnhandledErrors(hmr);
|
|
24
|
+
if (options.mountObserver !== false)
|
|
25
|
+
setupMountObserver();
|
|
26
|
+
if (options.hmrNotifier && hmr)
|
|
27
|
+
setupHmrNotifier(hmr);
|
|
28
|
+
if (options.navigationNotifier)
|
|
29
|
+
setupNavigationNotifier();
|
|
30
|
+
if (options.visualEditAgent)
|
|
31
|
+
setupVisualEditAgent();
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAClB,UAMI,EAAE,EACN,GAA+D;IAE/D,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG;QAAE,OAAO;IACvC,IAAK,UAAkB,CAAC,0BAA0B;QAAE,OAAO;IAC1D,UAAkB,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAEtD,IAAI,OAAO,CAAC,eAAe,KAAK,KAAK;QAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,aAAa,KAAK,KAAK;QAAE,kBAAkB,EAAE,CAAC;IAC1D,IAAI,OAAO,CAAC,WAAW,IAAI,GAAG;QAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACtD,IAAI,OAAO,CAAC,kBAAkB;QAAE,uBAAuB,EAAE,CAAC;IAC1D,IAAI,OAAO,CAAC,eAAe;QAAE,oBAAoB,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-overlay-plugin.d.ts","sourceRoot":"","sources":["../src/error-overlay-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,wBAAgB,kBAAkB,IAc3B,MAAM,CACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-overlay-plugin.js","sourceRoot":"","sources":["../src/error-overlay-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa;QAChD,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE;YAC3B,IAAI,IAAI,EAAE,GAAG;gBAAE,OAAO;YAEtB,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;gBAAE,OAAO;YAExD,OAAO,IAAI,CAAC,OAAO,CACjB,oBAAoB,EACpB,gBAAgB,GAAG,yBAAyB,CAC7C,CAAC;QACJ,CAAC;KACQ,CAAC;AACd,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
-
|
|
2
|
+
interface HtmlInjectionOptions {
|
|
3
3
|
hmrNotifier: boolean;
|
|
4
4
|
navigationNotifier: boolean;
|
|
5
5
|
visualEditAgent: boolean;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export declare function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, }: HtmlInjectionOptions): Plugin;
|
|
8
|
+
export {};
|
|
7
9
|
//# sourceMappingURL=html-injections-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.d.ts","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,UAAU,oBAAoB;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,EACnC,WAAW,EACX,kBAAkB,EAClB,eAAe,GAChB,EAAE,oBAAoB,GAAG,MAAM,CAsC/B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function htmlInjectionsPlugin({ hmrNotifier, navigationNotifier, visualEditAgent, }) {
|
|
2
|
+
return {
|
|
3
|
+
name: "html-injections",
|
|
4
|
+
apply: (config) => config.mode !== "production",
|
|
5
|
+
transformIndexHtml() {
|
|
6
|
+
const options = JSON.stringify({
|
|
7
|
+
hmrNotifier,
|
|
8
|
+
navigationNotifier,
|
|
9
|
+
visualEditAgent,
|
|
10
|
+
unhandledErrors: true,
|
|
11
|
+
mountObserver: true,
|
|
12
|
+
});
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
tag: "script",
|
|
16
|
+
attrs: { type: "module" },
|
|
17
|
+
children: [
|
|
18
|
+
`if (window.self !== window.top) {`,
|
|
19
|
+
` (async () => {`,
|
|
20
|
+
` try {`,
|
|
21
|
+
` const mode = new URLSearchParams(location.search).get("sandbox-bridge");`,
|
|
22
|
+
` const url = mode === "local"`,
|
|
23
|
+
` ? "https://localhost:3201/index.mjs"`,
|
|
24
|
+
` : "/node_modules/@base44/vite-plugin/dist/statics/index.mjs";`,
|
|
25
|
+
` const mod = await import(url);`,
|
|
26
|
+
` if (typeof mod.init === "function") mod.init(${options}, import.meta.hot);`,
|
|
27
|
+
` } catch (e) {`,
|
|
28
|
+
` console.error("[sandbox-bridge] Failed to load:", e);`,
|
|
29
|
+
` }`,
|
|
30
|
+
` })();`,
|
|
31
|
+
`}`,
|
|
32
|
+
].join("\n"),
|
|
33
|
+
injectTo: "head",
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=html-injections-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-injections-plugin.js","sourceRoot":"","sources":["../src/html-injections-plugin.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,oBAAoB,CAAC,EACnC,WAAW,EACX,kBAAkB,EAClB,eAAe,GACM;IACrB,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY;QAE/C,kBAAkB;YAChB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;gBAC7B,WAAW;gBACX,kBAAkB;gBAClB,eAAe;gBACf,eAAe,EAAE,IAAI;gBACrB,aAAa,EAAE,IAAI;aACpB,CAAC,CAAC;YACH,OAAO;gBACL;oBACE,GAAG,EAAE,QAAQ;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,QAAQ,EAAE;wBACR,mCAAmC;wBACnC,kBAAkB;wBAClB,WAAW;wBACX,gFAAgF;wBAChF,oCAAoC;wBACpC,8CAA8C;wBAC9C,uEAAuE;wBACvE,sCAAsC;wBACtC,sDAAsD,OAAO,qBAAqB;wBAClF,mBAAmB;wBACnB,6DAA6D;wBAC7D,OAAO;wBACP,SAAS;wBACT,GAAG;qBACJ,CAAC,IAAI,CAAC,IAAI,CAAC;oBACZ,QAAQ,EAAE,MAAM;iBACjB;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAC;AAS/C,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,IAAI,GAAE;IACJ,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;CACtB,iBA8MP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAA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O,CACjB,0CAA0C,EAC1C,QAAQ,EACR,OAAO,CACR,CAAC;oBACJ,CAAC;oBAED,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;wBACrC,OAAO,IAAI,CAAC,OAAO,CACjB,6CAA6C,EAC7C,QAAQ,EACR,OAAO,CACR,CAAC;oBACJ,CAAC;oBAED,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;wBAC/B,OAAO,IAAI,CAAC,OAAO,CACjB,uCAAuC,EACvC,QAAQ,EACR,OAAO,CACR,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAED,OAAO,IAAI,CAAC;YACd,CAAC;SACQ;QACX,GAAG,CAAC,kBAAkB;YACpB,CAAC,CAAC;gBACE;oBACE,IAAI,EAAE,YAAY;oBAClB,eAAe,CAAC,MAAM;wBACpB,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;4BACxC,yBAAyB;4BACzB,GAAG,CAAC,SAAS,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;4BAC7C,GAAG,CAAC,SAAS,CAAC,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;4BAC/D,IAAI,EAAE,CAAC;wBACT,CAAC,CAAC,CAAC;oBACL,CAAC;iBACQ;gBACX,kBAAkB,EAAE;gBACpB,gBAAgB,EAAE;gBAClB,oBAAoB,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC;aAC3E;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-notifier.d.ts","sourceRoot":"","sources":["../../src/injections/navigation-notifier.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,wBAAgB,uBAAuB,SA0CtC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** Intercept pushState / replaceState / popstate and notify the parent of URL changes. */
|
|
2
|
+
export function setupNavigationNotifier() {
|
|
2
3
|
let lastUrl = window.location.href;
|
|
3
4
|
function notifyNavigation() {
|
|
4
5
|
const currentUrl = window.location.href;
|
|
@@ -30,5 +31,4 @@ if (window.self !== window.top) {
|
|
|
30
31
|
url: window.location.href,
|
|
31
32
|
}, "*");
|
|
32
33
|
}
|
|
33
|
-
export {};
|
|
34
34
|
//# sourceMappingURL=navigation-notifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-notifier.js","sourceRoot":"","sources":["../../src/injections/navigation-notifier.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,UAAU,uBAAuB;IACrC,IAAI,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEnC,SAAS,gBAAgB;QACvB,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QACxC,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;YAC3B,OAAO,GAAG,UAAU,CAAC;YACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CACxB;gBACE,IAAI,EAAE,iBAAiB;gBACvB,GAAG,EAAE,UAAU;aAChB,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1D,OAAO,CAAC,SAAS,GAAG,UAAU,GAAG,IAAI;QACnC,iBAAiB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,gBAAgB,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,iCAAiC;IACjC,MAAM,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChE,OAAO,CAAC,YAAY,GAAG,UAAU,GAAG,IAAI;QACtC,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;QAC9B,gBAAgB,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,yCAAyC;IACzC,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAEtD,6BAA6B;IAC7B,MAAM,CAAC,MAAM,EAAE,WAAW,CACxB;QACE,IAAI,EAAE,iBAAiB;QACvB,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;KAC1B,EACD,GAAG,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-hmr-notifier.d.ts","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-notifier.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;CAAE,QAO9F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Forward Vite HMR lifecycle events (beforeUpdate / afterUpdate) to the parent window. */
|
|
2
|
+
export function setupHmrNotifier(hmr) {
|
|
3
|
+
hmr.on("vite:beforeUpdate", () => {
|
|
4
|
+
window.parent?.postMessage({ type: "sandbox:beforeUpdate" }, "*");
|
|
5
|
+
});
|
|
6
|
+
hmr.on("vite:afterUpdate", () => {
|
|
7
|
+
window.parent?.postMessage({ type: "sandbox:afterUpdate" }, "*");
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=sandbox-hmr-notifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-hmr-notifier.js","sourceRoot":"","sources":["../../src/injections/sandbox-hmr-notifier.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,UAAU,gBAAgB,CAAC,GAA8D;IAC7F,GAAG,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,GAAG,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-mount-observer.d.ts","sourceRoot":"","sources":["../../src/injections/sandbox-mount-observer.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,wBAAgB,kBAAkB,SAuBjC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/** Observe DOM mutations and notify the parent when instrumented elements are mounted or unmounted. */
|
|
2
|
+
export function setupMountObserver() {
|
|
2
3
|
const observer = new MutationObserver((mutations) => {
|
|
3
4
|
const nodesAdded = mutations.some((mutation) => mutation.addedNodes.length > 0);
|
|
4
5
|
const nodesRemoved = mutations.some((mutation) => mutation.removedNodes.length > 0);
|
|
@@ -14,5 +15,4 @@ if (window.self !== window.top) {
|
|
|
14
15
|
});
|
|
15
16
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
16
17
|
}
|
|
17
|
-
export {};
|
|
18
18
|
//# sourceMappingURL=sandbox-mount-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox-mount-observer.js","sourceRoot":"","sources":["../../src/injections/sandbox-mount-observer.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,UAAU,kBAAkB;IAChC,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,EAAE,EAAE;QAClD,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAC/B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAC7C,CAAC;QACF,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CACjC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAC/C,CAAC;QACF,IAAI,UAAU,IAAI,YAAY,EAAE,CAAC;YAC/B,MAAM,yBAAyB,GAC7B,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAC5B,gDAAgD,CACjD,CAAC,MAAM,GAAG,CAAC,CAAC;YAEf,IAAI,yBAAyB,EAAE,CAAC;gBAC9B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,GAAG,CAAC,CAAC;YACjE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,GAAG,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Register global error and unhandled-rejection listeners that report to the parent window. */
|
|
2
|
+
export declare function setupUnhandledErrors(hmr?: {
|
|
3
|
+
on(event: string, cb: (...args: any[]) => void): void;
|
|
4
|
+
}): void;
|
|
5
|
+
//# sourceMappingURL=unhandled-errors-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-errors-handlers.d.ts","sourceRoot":"","sources":["../../src/injections/unhandled-errors-handlers.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAIhG,wBAAgB,oBAAoB,CAAC,GAAG,CAAC,EAAE;IAAE,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,IAAI,CAAA;CAAE,QA4FnG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Register global error and unhandled-rejection listeners that report to the parent window. */
|
|
2
|
+
const ERROR_SUPPRESSION_TIMEOUT = 10000;
|
|
3
|
+
export function setupUnhandledErrors(hmr) {
|
|
4
|
+
window.removeEventListener("unhandledrejection", handleUnhandledRejection);
|
|
5
|
+
window.removeEventListener("error", handleWindowError);
|
|
6
|
+
window.addEventListener("unhandledrejection", handleUnhandledRejection);
|
|
7
|
+
window.addEventListener("error", handleWindowError);
|
|
8
|
+
let shouldPropagateErrors = true;
|
|
9
|
+
let suppressionTimer = null;
|
|
10
|
+
if (hmr) {
|
|
11
|
+
hmr.on("vite:beforeUpdate", () => {
|
|
12
|
+
shouldPropagateErrors = false;
|
|
13
|
+
if (suppressionTimer) {
|
|
14
|
+
clearTimeout(suppressionTimer);
|
|
15
|
+
}
|
|
16
|
+
suppressionTimer = setTimeout(() => {
|
|
17
|
+
shouldPropagateErrors = true;
|
|
18
|
+
suppressionTimer = null;
|
|
19
|
+
}, ERROR_SUPPRESSION_TIMEOUT);
|
|
20
|
+
});
|
|
21
|
+
hmr.on("vite:beforeFullReload", () => {
|
|
22
|
+
shouldPropagateErrors = false;
|
|
23
|
+
if (suppressionTimer) {
|
|
24
|
+
clearTimeout(suppressionTimer);
|
|
25
|
+
suppressionTimer = null;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function onAppError({ title, details, componentName, originalError, }) {
|
|
30
|
+
if (originalError?.response?.status === 402 || !shouldPropagateErrors) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
window.parent?.postMessage({
|
|
34
|
+
type: "app_error",
|
|
35
|
+
error: {
|
|
36
|
+
title: title.toString(),
|
|
37
|
+
details: details?.toString(),
|
|
38
|
+
componentName: componentName?.toString(),
|
|
39
|
+
stack: originalError?.stack?.toString(),
|
|
40
|
+
},
|
|
41
|
+
}, "*");
|
|
42
|
+
}
|
|
43
|
+
function handleUnhandledRejection(event) {
|
|
44
|
+
const stack = event.reason.stack;
|
|
45
|
+
// extract function name from "at X (eval" where x is the function name
|
|
46
|
+
const functionName = stack.match(/at\s+(\w+)\s+\(eval/)?.[1];
|
|
47
|
+
const msg = functionName
|
|
48
|
+
? `Error in ${functionName}: ${event.reason.toString()}`
|
|
49
|
+
: event.reason.toString();
|
|
50
|
+
onAppError({
|
|
51
|
+
title: msg,
|
|
52
|
+
details: event.reason.toString(),
|
|
53
|
+
componentName: functionName,
|
|
54
|
+
originalError: event.reason,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function handleWindowError(event) {
|
|
58
|
+
const stack = event.error?.stack;
|
|
59
|
+
let functionName = stack.match(/at\s+(\w+)\s+\(eval/)?.[1];
|
|
60
|
+
if (functionName === "eval") {
|
|
61
|
+
functionName = null;
|
|
62
|
+
}
|
|
63
|
+
const msg = functionName
|
|
64
|
+
? `in ${functionName}: ${event.error.toString()}`
|
|
65
|
+
: event.error.toString();
|
|
66
|
+
onAppError({
|
|
67
|
+
title: msg,
|
|
68
|
+
details: event.error.toString(),
|
|
69
|
+
componentName: functionName,
|
|
70
|
+
originalError: event.error,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=unhandled-errors-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unhandled-errors-handlers.js","sourceRoot":"","sources":["../../src/injections/unhandled-errors-handlers.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,MAAM,yBAAyB,GAAG,KAAK,CAAC;AAExC,MAAM,UAAU,oBAAoB,CAAC,GAA+D;IAClG,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC;IAC3E,MAAM,CAAC,m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,QAAQ,EAAE;YAC/B,aAAa,EAAE,YAAY;YAC3B,aAAa,EAAE,KAAK,CAAC,KAAK;SAC3B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/injections/utils.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,EAAE,CAW7D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/injections/utils.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,UAAU,gBAAgB,CAAC,EAAiB;IAChD,IAAI,CAAC,EAAE;QAAE,OAAO,EAAE,CAAC;IACnB,MAAM,cAAc,GAAG,KAAK,CAAC,IAAI,CAC/B,QAAQ,CAAC,gBAAgB,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAC5D,CAAC;IACF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CACf,QAAQ,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,IAAI,CAAC,CAC/D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAmB,EAAE,OAAe;IACvE,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-edit-agent.d.ts","sourceRoot":"","sources":["../../src/injections/visual-edit-agent.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,SA8iBnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visual-edit-agent.js","sourceRoot":"","sources":["../../src/injections/visual-edit-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,UAAU,oBAAoB;IAClC,oDAAoD;IACpD,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAC9B,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,IAAI,aAAa,GAAqB,EAAE,CAAC;IACzC,IAAI,gBAAgB,GAAqB,EAAE,CAAC;IAC5C,IAAI,0BAA0B,GAAc,EAAE,CAAC;IAC/C,IAAI,iBAAiB,GAAkB,IAAI,CAAC;IAE5C,yBAAyB;IACzB,MAAM,aAAa,GAAG,CAAC,UAAU,GAAG,KAAK,EAAkB,EAAE;QAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;QACrC,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,sBAAsB,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAE9B,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,mBAAmB,CAAC;YAC3C,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,0BAA0B,CAAC;QAC7D,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC,C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CAAC,CAAC;IACtD,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEhD,gCAAgC;IAChC,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,yBAAyB,EAAE,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function I(r){window.removeEventListener("unhandledrejection",a),window.removeEventListener("error",f),window.addEventListener("unhandledrejection",a),window.addEventListener("error",f);let d=!0,p=null;r&&(r.on("vite:beforeUpdate",()=>{d=!1,p&&clearTimeout(p),p=setTimeout(()=>{d=!0,p=null},1e4)}),r.on("vite:beforeFullReload",()=>{d=!1,p&&(clearTimeout(p),p=null)}));function g({title:s,details:w,componentName:u,originalError:m}){m?.response?.status===402||!d||window.parent?.postMessage({type:"app_error",error:{title:s.toString(),details:w?.toString(),componentName:u?.toString(),stack:m?.stack?.toString()}},"*")}function a(s){let u=s.reason.stack.match(/at\s+(\w+)\s+\(eval/)?.[1],m=u?`Error in ${u}: ${s.reason.toString()}`:s.reason.toString();g({title:m,details:s.reason.toString(),componentName:u,originalError:s.reason})}function f(s){let u=(s.error?.stack).match(/at\s+(\w+)\s+\(eval/)?.[1];u==="eval"&&(u=null);let m=u?`in ${u}: ${s.error.toString()}`:s.error.toString();g({title:m,details:s.error.toString(),componentName:u,originalError:s.error})}}function x(r){r.on("vite:beforeUpdate",()=>{window.parent?.postMessage({type:"sandbox:beforeUpdate"},"*")}),r.on("vite:afterUpdate",()=>{window.parent?.postMessage({type:"sandbox:afterUpdate"},"*")})}function O(){new MutationObserver(d=>{let p=d.some(a=>a.addedNodes.length>0),g=d.some(a=>a.removedNodes.length>0);(p||g)&&(document.body.querySelectorAll("[data-source-location], [data-dynamic-content]").length>0?window.parent?.postMessage({type:"sandbox:onMounted"},"*"):window.parent?.postMessage({type:"sandbox:onUnmounted"},"*"))}).observe(document.body,{childList:!0,subtree:!0})}function k(){let r=window.location.href;function d(){let a=window.location.href;a!==r&&(r=a,window.parent?.postMessage({type:"app_changed_url",url:a},"*"))}let p=history.pushState.bind(history);history.pushState=function(...a){p(...a),d()};let g=history.replaceState.bind(history);history.replaceState=function(...a){g(...a),d()},window.addEventListener("popstate",d),window.parent?.postMessage({type:"app_changed_url",url:window.location.href},"*")}function E(r){if(!r)return[];let d=Array.from(document.querySelectorAll(`[data-source-location="${r}"]`));return d.length>0?d:Array.from(document.querySelectorAll(`[data-visual-selector-id="${r}"]`))}function C(r,d){r.forEach(p=>{p.setAttribute("class",d)})}function A(){let r=!1,d=!1,p=!1,g=[],a=[],f=[],s=null,w=(n=!1)=>{let e=document.createElement("div");return e.style.position="absolute",e.style.pointerEvents="none",e.style.transition="all 0.1s ease-in-out",e.style.zIndex="9999",n?e.style.border="2px solid #2563EB":(e.style.border="2px solid #95a5fc",e.style.backgroundColor="rgba(99, 102, 241, 0.05)"),e},u=(n,e,t=!1)=>{if(!e||!r)return;e.offsetWidth;let o=e.getBoundingClientRect();n.style.top=`${o.top+window.scrollY}px`,n.style.left=`${o.left+window.scrollX}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`;let i=n.querySelector("div");i||(i=document.createElement("div"),i.textContent=e.tagName.toLowerCase(),i.style.position="absolute",i.style.top="-27px",i.style.left="-2px",i.style.padding="2px 8px",i.style.fontSize="11px",i.style.fontWeight=t?"500":"400",i.style.color=t?"#ffffff":"#526cff",i.style.backgroundColor=t?"#526cff":"#DBEAFE",i.style.borderRadius="3px",i.style.minWidth="24px",i.style.textAlign="center",n.appendChild(i))},m=()=>{g.forEach(n=>{n&&n.parentNode&&n.remove()}),g=[],f=[]},N=n=>{if(!r||d)return;let e=n.target;if(p){m();return}if(e.tagName.toLowerCase()==="path"){m();return}let t=e.closest("[data-source-location], [data-visual-selector-id]");if(!t){m();return}let l=t,o=l.dataset.sourceLocation||l.dataset.visualSelectorId;if(s===o){m();return}let i=E(o||null);m(),i.forEach(c=>{let h=w(!1);document.body.appendChild(h),g.push(h),u(h,c)}),f=i},M=()=>{d||m()},S=n=>{if(!r)return;let e=n.target;if(p){n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.parent.postMessage({type:"close-dropdowns"},"*");return}if(e.tagName.toLowerCase()==="path")return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();let t=e.closest("[data-source-location], [data-visual-selector-id]");if(!t)return;let l=t,o=l.dataset.sourceLocation||l.dataset.visualSelectorId;a.forEach(v=>{v&&v.parentNode&&v.remove()}),a=[],E(o||null).forEach(v=>{let L=w(!0);document.body.appendChild(L),a.push(L),u(L,v,!0)}),s=o||null,m();let c=t.getBoundingClientRect(),h={top:c.top,left:c.left,right:c.right,bottom:c.bottom,width:c.width,height:c.height,centerX:c.left+c.width/2,centerY:c.top+c.height/2},y=t,_={type:"element-selected",tagName:t.tagName,classes:y.className?.baseVal||t.className||"",visualSelectorId:o,content:t.innerText,dataSourceLocation:l.dataset.sourceLocation,isDynamicContent:l.dataset.dynamicContent==="true",linenumber:l.dataset.linenumber,filename:l.dataset.filename,position:h};window.parent.postMessage(_,"*")},H=()=>{a.forEach(n=>{n&&n.parentNode&&n.remove()}),a=[],s=null},R=(n,e)=>{let t=E(n);t.length!==0&&(C(t,e),setTimeout(()=>{s===n&&a.forEach((l,o)=>{o<t.length&&u(l,t[o])}),f.length>0&&f[0]?.dataset?.visualSelectorId===n&&g.forEach((i,c)=>{c<f.length&&u(i,f[c])})},50))},D=(n,e)=>{let t=E(n);t.length!==0&&(t.forEach(l=>{l.innerText=e}),setTimeout(()=>{s===n&&a.forEach((l,o)=>{o<t.length&&u(l,t[o])})},50))},U=n=>{r=n,n?(document.body.style.cursor="crosshair",document.addEventListener("mouseover",N),document.addEventListener("mouseout",M),document.addEventListener("click",S,!0)):(m(),a.forEach(e=>{e&&e.parentNode&&e.remove()}),a=[],f=[],s=null,document.body.style.cursor="default",document.removeEventListener("mouseover",N),document.removeEventListener("mouseout",M),document.removeEventListener("click",S,!0))},T=()=>{if(s){let n=E(s);if(n.length>0){let t=n[0].getBoundingClientRect(),l=window.innerHeight,o=window.innerWidth,i=t.top<l&&t.bottom>0&&t.left<o&&t.right>0,c={top:t.top,left:t.left,right:t.right,bottom:t.bottom,width:t.width,height:t.height,centerX:t.left+t.width/2,centerY:t.top+t.height/2};window.parent.postMessage({type:"element-position-update",position:c,isInViewport:i,visualSelectorId:s},"*")}}},P=n=>{let e=n.data;switch(e.type){case"toggle-visual-edit-mode":U(e.data.enabled);break;case"update-classes":e.data&&e.data.classes!==void 0?R(e.data.visualSelectorId,e.data.classes):console.warn("[VisualEditAgent] Invalid update-classes message:",e);break;case"unselect-element":H();break;case"refresh-page":window.location.reload();break;case"update-content":e.data&&e.data.content!==void 0?D(e.data.visualSelectorId,e.data.content):console.warn("[VisualEditAgent] Invalid update-content message:",e);break;case"request-element-position":if(s){let t=E(s);if(t.length>0){let o=t[0].getBoundingClientRect(),i=window.innerHeight,c=window.innerWidth,h=o.top<i&&o.bottom>0&&o.left<c&&o.right>0,y={top:o.top,left:o.left,right:o.right,bottom:o.bottom,width:o.width,height:o.height,centerX:o.left+o.width/2,centerY:o.top+o.height/2};window.parent.postMessage({type:"element-position-update",position:y,isInViewport:h,visualSelectorId:s},"*")}}break;case"popover-drag-state":e.data&&e.data.isDragging!==void 0&&(d=e.data.isDragging,e.data.isDragging&&m());break;case"dropdown-state":e.data&&e.data.isOpen!==void 0&&(p=e.data.isOpen,e.data.isOpen&&m());break;default:break}},b=()=>{if(s){let n=E(s);a.forEach((e,t)=>{t<n.length&&u(e,n[t])})}f.length>0&&g.forEach((n,e)=>{e<f.length&&u(n,f[e])})};document.querySelectorAll("[data-linenumber]:not([data-visual-selector-id])").forEach((n,e)=>{let t=n,l=`visual-id-${t.dataset.filename}-${t.dataset.linenumber}-${e}`;t.dataset.visualSelectorId=l});let V=new MutationObserver(n=>{n.some(t=>{let l=i=>{if(i.nodeType===Node.ELEMENT_NODE){let c=i;if(c.dataset&&c.dataset.visualSelectorId)return!0;for(let h=0;h<c.children.length;h++)if(l(c.children[h]))return!0}return!1};return t.type==="attributes"&&(t.attributeName==="style"||t.attributeName==="class"||t.attributeName==="width"||t.attributeName==="height")&&l(t.target)})&&setTimeout(b,50)});window.addEventListener("message",P),window.addEventListener("scroll",T,!0),document.addEventListener("scroll",T,!0),window.addEventListener("resize",b),window.addEventListener("scroll",b),V.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["style","class","width","height"]}),window.parent.postMessage({type:"visual-edit-agent-ready"},"*")}function Z(r={},d){window.self!==window.top&&(globalThis.__sandboxBridgeInitialized||(globalThis.__sandboxBridgeInitialized=!0,r.unhandledErrors!==!1&&I(d),r.mountObserver!==!1&&O(),r.hmrNotifier&&d&&x(d),r.navigationNotifier&&k(),r.visualEditAgent&&A()))}export{Z as init};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/injections/unhandled-errors-handlers.ts","../../src/injections/sandbox-hmr-notifier.ts","../../src/injections/sandbox-mount-observer.ts","../../src/injections/navigation-notifier.ts","../../src/injections/utils.ts","../../src/injections/visual-edit-agent.ts","../../src/bridge.ts"],"sourcesContent":["/** Register global error and unhandled-rejection listeners that report to the parent window. */\n\nconst ERROR_SUPPRESSION_TIMEOUT = 10000;\n\nexport function setupUnhandledErrors(hmr?: { on(event: string, cb: (...args: any[]) => void): void }) {\n window.removeEventListener(\"unhandledrejection\", handleUnhandledRejection);\n window.removeEventListener(\"error\", handleWindowError);\n\n window.addEventListener(\"unhandledrejection\", handleUnhandledRejection);\n window.addEventListener(\"error\", handleWindowError);\n\n let shouldPropagateErrors = true;\n let suppressionTimer: ReturnType<typeof setTimeout> | null = null;\n\n if (hmr) {\n hmr.on(\"vite:beforeUpdate\", () => {\n shouldPropagateErrors = false;\n\n if (suppressionTimer) {\n clearTimeout(suppressionTimer);\n }\n\n suppressionTimer = setTimeout(() => {\n shouldPropagateErrors = true;\n suppressionTimer = null;\n }, ERROR_SUPPRESSION_TIMEOUT);\n });\n hmr.on(\"vite:beforeFullReload\", () => {\n shouldPropagateErrors = false;\n if (suppressionTimer) {\n clearTimeout(suppressionTimer);\n suppressionTimer = null;\n }\n });\n }\n\n function onAppError({\n title,\n details,\n componentName,\n originalError,\n }: {\n title: string;\n details: string;\n componentName: string;\n originalError: any;\n }) {\n if (originalError?.response?.status === 402 || !shouldPropagateErrors) {\n return;\n }\n window.parent?.postMessage(\n {\n type: \"app_error\",\n error: {\n title: title.toString(),\n details: details?.toString(),\n componentName: componentName?.toString(),\n stack: originalError?.stack?.toString(),\n },\n },\n \"*\"\n );\n }\n\n function handleUnhandledRejection(event: any) {\n const stack = event.reason.stack;\n // extract function name from \"at X (eval\" where x is the function name\n const functionName = stack.match(/at\\s+(\\w+)\\s+\\(eval/)?.[1];\n const msg = functionName\n ? `Error in ${functionName}: ${event.reason.toString()}`\n : event.reason.toString();\n onAppError({\n title: msg,\n details: event.reason.toString(),\n componentName: functionName,\n originalError: event.reason,\n });\n }\n\n function handleWindowError(event: any) {\n const stack = event.error?.stack;\n let functionName = stack.match(/at\\s+(\\w+)\\s+\\(eval/)?.[1];\n if (functionName === \"eval\") {\n functionName = null;\n }\n\n const msg = functionName\n ? `in ${functionName}: ${event.error.toString()}`\n : event.error.toString();\n onAppError({\n title: msg,\n details: event.error.toString(),\n componentName: functionName,\n originalError: event.error,\n });\n }\n}\n","/** Forward Vite HMR lifecycle events (beforeUpdate / afterUpdate) to the parent window. */\nexport function setupHmrNotifier(hmr: { on(event: string, cb: (...args: any[]) => void): void }) {\n hmr.on(\"vite:beforeUpdate\", () => {\n window.parent?.postMessage({ type: \"sandbox:beforeUpdate\" }, \"*\");\n });\n hmr.on(\"vite:afterUpdate\", () => {\n window.parent?.postMessage({ type: \"sandbox:afterUpdate\" }, \"*\");\n });\n}\n","/** Observe DOM mutations and notify the parent when instrumented elements are mounted or unmounted. */\nexport function setupMountObserver() {\n const observer = new MutationObserver((mutations) => {\n const nodesAdded = mutations.some(\n (mutation) => mutation.addedNodes.length > 0\n );\n const nodesRemoved = mutations.some(\n (mutation) => mutation.removedNodes.length > 0\n );\n if (nodesAdded || nodesRemoved) {\n const foundElmWithDataAttribute =\n document.body.querySelectorAll(\n \"[data-source-location], [data-dynamic-content]\"\n ).length > 0;\n\n if (foundElmWithDataAttribute) {\n window.parent?.postMessage({ type: \"sandbox:onMounted\" }, \"*\");\n } else {\n window.parent?.postMessage({ type: \"sandbox:onUnmounted\" }, \"*\");\n }\n }\n });\n\n observer.observe(document.body, { childList: true, subtree: true });\n}\n","/** Intercept pushState / replaceState / popstate and notify the parent of URL changes. */\nexport function setupNavigationNotifier() {\n let lastUrl = window.location.href;\n\n function notifyNavigation() {\n const currentUrl = window.location.href;\n if (currentUrl !== lastUrl) {\n lastUrl = currentUrl;\n window.parent?.postMessage(\n {\n type: \"app_changed_url\",\n url: currentUrl,\n },\n \"*\"\n );\n }\n }\n\n // Intercept history.pushState\n const originalPushState = history.pushState.bind(history);\n history.pushState = function (...args) {\n originalPushState(...args);\n notifyNavigation();\n };\n\n // Intercept history.replaceState\n const originalReplaceState = history.replaceState.bind(history);\n history.replaceState = function (...args) {\n originalReplaceState(...args);\n notifyNavigation();\n };\n\n // Handle browser back/forward navigation\n window.addEventListener(\"popstate\", notifyNavigation);\n\n // Notify initial URL on load\n window.parent?.postMessage(\n {\n type: \"app_changed_url\",\n url: window.location.href,\n },\n \"*\"\n );\n}\n","/** Find elements by ID - first try data-source-location, fallback to data-visual-selector-id */\nexport function findElementsById(id: string | null): Element[] {\n if (!id) return [];\n const sourceElements = Array.from(\n document.querySelectorAll(`[data-source-location=\"${id}\"]`)\n );\n if (sourceElements.length > 0) {\n return sourceElements;\n }\n return Array.from(\n document.querySelectorAll(`[data-visual-selector-id=\"${id}\"]`)\n );\n}\n\n/**\n * Update element classes by visual selector ID.\n * Uses setAttribute instead of className to support both HTML and SVG elements.\n */\nexport function updateElementClasses(elements: Element[], classes: string): void {\n elements.forEach((element) => {\n element.setAttribute(\"class\", classes);\n }); \n}\n","import { findElementsById, updateElementClasses } from \"./utils.js\";\n\nexport function setupVisualEditAgent() {\n // State variables (replacing React useState/useRef)\n let isVisualEditMode = false;\n let isPopoverDragging = false;\n let isDropdownOpen = false;\n let hoverOverlays: HTMLDivElement[] = [];\n let selectedOverlays: HTMLDivElement[] = [];\n let currentHighlightedElements: Element[] = [];\n let selectedElementId: string | null = null;\n\n // Create overlay element\n const createOverlay = (isSelected = false): HTMLDivElement => {\n const overlay = document.createElement(\"div\");\n overlay.style.position = \"absolute\";\n overlay.style.pointerEvents = \"none\";\n overlay.style.transition = \"all 0.1s ease-in-out\";\n overlay.style.zIndex = \"9999\";\n\n if (isSelected) {\n overlay.style.border = \"2px solid #2563EB\";\n } else {\n overlay.style.border = \"2px solid #95a5fc\";\n overlay.style.backgroundColor = \"rgba(99, 102, 241, 0.05)\";\n }\n\n return overlay;\n };\n\n // Position overlay relative to element\n const positionOverlay = (\n overlay: HTMLDivElement,\n element: Element,\n isSelected = false\n ) => {\n if (!element || !isVisualEditMode) return;\n\n const htmlElement = element as HTMLElement;\n // Force layout recalculation\n void htmlElement.offsetWidth;\n\n const rect = element.getBoundingClientRect();\n overlay.style.top = `${rect.top + window.scrollY}px`;\n overlay.style.left = `${rect.left + window.scrollX}px`;\n overlay.style.width = `${rect.width}px`;\n overlay.style.height = `${rect.height}px`;\n\n // Check if label already exists in overlay\n let label = overlay.querySelector(\"div\") as HTMLDivElement | null;\n\n if (!label) {\n label = document.createElement(\"div\");\n label.textContent = element.tagName.toLowerCase();\n label.style.position = \"absolute\";\n label.style.top = \"-27px\";\n label.style.left = \"-2px\";\n label.style.padding = \"2px 8px\";\n label.style.fontSize = \"11px\";\n label.style.fontWeight = isSelected ? \"500\" : \"400\";\n label.style.color = isSelected ? \"#ffffff\" : \"#526cff\";\n label.style.backgroundColor = isSelected ? \"#526cff\" : \"#DBEAFE\";\n label.style.borderRadius = \"3px\";\n label.style.minWidth = \"24px\";\n label.style.textAlign = \"center\";\n overlay.appendChild(label);\n }\n };\n\n // Clear hover overlays\n const clearHoverOverlays = () => {\n hoverOverlays.forEach((overlay) => {\n if (overlay && overlay.parentNode) {\n overlay.remove();\n }\n });\n hoverOverlays = [];\n currentHighlightedElements = [];\n };\n\n // Handle mouse over event\n const handleMouseOver = (e: MouseEvent) => {\n if (!isVisualEditMode || isPopoverDragging) return;\n\n const target = e.target as Element;\n\n // Prevent hover effects when a dropdown is open\n if (isDropdownOpen) {\n clearHoverOverlays();\n return;\n }\n\n // Prevent hover effects on SVG path elements\n if (target.tagName.toLowerCase() === \"path\") {\n clearHoverOverlays();\n return;\n }\n\n // Support both data-source-location and data-visual-selector-id\n const element = target.closest(\n \"[data-source-location], [data-visual-selector-id]\"\n );\n if (!element) {\n clearHoverOverlays();\n return;\n }\n\n // Prefer data-source-location, fallback to data-visual-selector-id\n const htmlElement = element as HTMLElement;\n const selectorId =\n htmlElement.dataset.sourceLocation ||\n htmlElement.dataset.visualSelectorId;\n\n // Skip if this element is already selected\n if (selectedElementId === selectorId) {\n clearHoverOverlays();\n return;\n }\n\n // Find all elements with the same ID\n const elements = findElementsById(selectorId || null);\n\n // Clear previous hover overlays\n clearHoverOverlays();\n\n // Create overlays for all matching elements\n elements.forEach((el) => {\n const overlay = createOverlay(false);\n document.body.appendChild(overlay);\n hoverOverlays.push(overlay);\n positionOverlay(overlay, el);\n });\n\n currentHighlightedElements = elements;\n };\n\n // Handle mouse out event\n const handleMouseOut = () => {\n if (isPopoverDragging) return;\n clearHoverOverlays();\n };\n\n // Handle element click\n const handleElementClick = (e: MouseEvent) => {\n if (!isVisualEditMode) return;\n\n const target = e.target as Element;\n\n // Close dropdowns when clicking anywhere in iframe if a dropdown is open\n if (isDropdownOpen) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n\n window.parent.postMessage({ type: \"close-dropdowns\" }, \"*\");\n return;\n }\n\n // Prevent clicking on SVG path elements\n if (target.tagName.toLowerCase() === \"path\") {\n return;\n }\n\n // Prevent default behavior immediately when in visual edit mode\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n\n // Support both data-source-location and data-visual-selector-id\n const element = target.closest(\n \"[data-source-location], [data-visual-selector-id]\"\n );\n if (!element) {\n return;\n }\n\n const htmlElement = element as HTMLElement;\n const visualSelectorId =\n htmlElement.dataset.sourceLocation ||\n htmlElement.dataset.visualSelectorId;\n\n // Clear any existing selected overlays\n selectedOverlays.forEach((overlay) => {\n if (overlay && overlay.parentNode) {\n overlay.remove();\n }\n });\n selectedOverlays = [];\n\n // Find all elements with the same ID\n const elements = findElementsById(visualSelectorId || null);\n\n // Create selected overlays for all matching elements\n elements.forEach((el) => {\n const overlay = createOverlay(true);\n document.body.appendChild(overlay);\n selectedOverlays.push(overlay);\n positionOverlay(overlay, el, true);\n });\n\n selectedElementId = visualSelectorId || null;\n\n // Clear hover overlays\n clearHoverOverlays();\n\n // Calculate element position for popover positioning\n const rect = element.getBoundingClientRect();\n const elementPosition = {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n centerX: rect.left + rect.width / 2,\n centerY: rect.top + rect.height / 2,\n };\n\n // Send message to parent window with element info including position\n const svgElement = element as SVGElement;\n const elementData = {\n type: \"element-selected\",\n tagName: element.tagName,\n classes:\n (svgElement.className as unknown as SVGAnimatedString)?.baseVal ||\n element.className ||\n \"\",\n visualSelectorId: visualSelectorId,\n content: (element as HTMLElement).innerText,\n dataSourceLocation: htmlElement.dataset.sourceLocation,\n isDynamicContent: htmlElement.dataset.dynamicContent === \"true\",\n linenumber: htmlElement.dataset.linenumber,\n filename: htmlElement.dataset.filename,\n position: elementPosition,\n };\n window.parent.postMessage(elementData, \"*\");\n };\n\n // Unselect the current element\n const unselectElement = () => {\n selectedOverlays.forEach((overlay) => {\n if (overlay && overlay.parentNode) {\n overlay.remove();\n }\n });\n selectedOverlays = [];\n selectedElementId = null;\n };\n\n const updateElementClassesAndReposition = (visualSelectorId: string, classes: string) => {\n const elements = findElementsById(visualSelectorId);\n if (elements.length === 0) return;\n\n updateElementClasses(elements, classes);\n\n // Use a small delay to allow the browser to recalculate layout before repositioning\n setTimeout(() => {\n // Reposition selected overlays\n if (selectedElementId === visualSelectorId) {\n selectedOverlays.forEach((overlay, index) => {\n if (index < elements.length) {\n positionOverlay(overlay, elements[index]!);\n }\n });\n }\n\n // Reposition hover overlays if needed\n if (currentHighlightedElements.length > 0) {\n const hoveredElement = currentHighlightedElements[0] as HTMLElement;\n const hoveredId = hoveredElement?.dataset?.visualSelectorId;\n if (hoveredId === visualSelectorId) {\n hoverOverlays.forEach((overlay, index) => {\n if (index < currentHighlightedElements.length) {\n positionOverlay(overlay, currentHighlightedElements[index]!);\n }\n });\n }\n }\n }, 50);\n };\n\n // Update element content by visual selector ID\n const updateElementContent = (visualSelectorId: string, content: string) => {\n const elements = findElementsById(visualSelectorId);\n\n if (elements.length === 0) {\n return;\n }\n\n elements.forEach((element) => {\n (element as HTMLElement).innerText = content;\n });\n\n setTimeout(() => {\n if (selectedElementId === visualSelectorId) {\n selectedOverlays.forEach((overlay, index) => {\n if (index < elements.length) {\n positionOverlay(overlay, elements[index]!);\n }\n });\n }\n }, 50);\n };\n\n // Toggle visual edit mode\n const toggleVisualEditMode = (isEnabled: boolean) => {\n isVisualEditMode = isEnabled;\n\n if (!isEnabled) {\n clearHoverOverlays();\n\n selectedOverlays.forEach((overlay) => {\n if (overlay && overlay.parentNode) {\n overlay.remove();\n }\n });\n selectedOverlays = [];\n\n currentHighlightedElements = [];\n selectedElementId = null;\n document.body.style.cursor = \"default\";\n\n document.removeEventListener(\"mouseover\", handleMouseOver);\n document.removeEventListener(\"mouseout\", handleMouseOut);\n document.removeEventListener(\"click\", handleElementClick, true);\n } else {\n document.body.style.cursor = \"crosshair\";\n document.addEventListener(\"mouseover\", handleMouseOver);\n document.addEventListener(\"mouseout\", handleMouseOut);\n document.addEventListener(\"click\", handleElementClick, true);\n }\n };\n\n // Handle scroll events to update popover position\n const handleScroll = () => {\n if (selectedElementId) {\n const elements = findElementsById(selectedElementId);\n if (elements.length > 0) {\n const element = elements[0];\n const rect = element!.getBoundingClientRect();\n\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n const isInViewport =\n rect.top < viewportHeight &&\n rect.bottom > 0 &&\n rect.left < viewportWidth &&\n rect.right > 0;\n\n const elementPosition = {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n centerX: rect.left + rect.width / 2,\n centerY: rect.top + rect.height / 2,\n };\n\n window.parent.postMessage(\n {\n type: \"element-position-update\",\n position: elementPosition,\n isInViewport: isInViewport,\n visualSelectorId: selectedElementId,\n },\n \"*\"\n );\n }\n }\n };\n\n // Handle messages from parent window\n const handleMessage = (event: MessageEvent) => {\n const message = event.data;\n\n switch (message.type) {\n case \"toggle-visual-edit-mode\":\n toggleVisualEditMode(message.data.enabled);\n break;\n\n case \"update-classes\":\n if (message.data && message.data.classes !== undefined) {\n updateElementClassesAndReposition(\n message.data.visualSelectorId,\n message.data.classes\n );\n } else {\n console.warn(\n \"[VisualEditAgent] Invalid update-classes message:\",\n message\n );\n }\n break;\n\n case \"unselect-element\":\n unselectElement();\n break;\n\n case \"refresh-page\":\n window.location.reload();\n break;\n\n case \"update-content\":\n if (message.data && message.data.content !== undefined) {\n updateElementContent(\n message.data.visualSelectorId,\n message.data.content\n );\n } else {\n console.warn(\n \"[VisualEditAgent] Invalid update-content message:\",\n message\n );\n }\n break;\n\n case \"request-element-position\":\n if (selectedElementId) {\n const elements = findElementsById(selectedElementId);\n if (elements.length > 0) {\n const element = elements[0];\n const rect = element!.getBoundingClientRect();\n\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n const isInViewport =\n rect.top < viewportHeight &&\n rect.bottom > 0 &&\n rect.left < viewportWidth &&\n rect.right > 0;\n\n const elementPosition = {\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n width: rect.width,\n height: rect.height,\n centerX: rect.left + rect.width / 2,\n centerY: rect.top + rect.height / 2,\n };\n\n window.parent.postMessage(\n {\n type: \"element-position-update\",\n position: elementPosition,\n isInViewport: isInViewport,\n visualSelectorId: selectedElementId,\n },\n \"*\"\n );\n }\n }\n break;\n\n case \"popover-drag-state\":\n if (message.data && message.data.isDragging !== undefined) {\n isPopoverDragging = message.data.isDragging;\n if (message.data.isDragging) {\n clearHoverOverlays();\n }\n }\n break;\n\n case \"dropdown-state\":\n if (message.data && message.data.isOpen !== undefined) {\n isDropdownOpen = message.data.isOpen;\n if (message.data.isOpen) {\n clearHoverOverlays();\n }\n }\n break;\n\n default:\n break;\n }\n };\n\n // Handle window resize to reposition overlays\n const handleResize = () => {\n if (selectedElementId) {\n const elements = findElementsById(selectedElementId);\n selectedOverlays.forEach((overlay, index) => {\n if (index < elements.length) {\n positionOverlay(overlay, elements[index]!);\n }\n });\n }\n\n if (currentHighlightedElements.length > 0) {\n hoverOverlays.forEach((overlay, index) => {\n if (index < currentHighlightedElements.length) {\n positionOverlay(overlay, currentHighlightedElements[index]!);\n }\n });\n }\n };\n\n // Initialize: Add IDs to elements that don't have them but have linenumbers\n const elementsWithLineNumber = document.querySelectorAll(\n \"[data-linenumber]:not([data-visual-selector-id])\"\n );\n elementsWithLineNumber.forEach((el, index) => {\n const htmlEl = el as HTMLElement;\n const id = `visual-id-${htmlEl.dataset.filename}-${htmlEl.dataset.linenumber}-${index}`;\n htmlEl.dataset.visualSelectorId = id;\n });\n\n // Create mutation observer to detect layout changes\n const mutationObserver = new MutationObserver((mutations) => {\n const needsUpdate = mutations.some((mutation) => {\n const hasVisualId = (node: Node): boolean => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const el = node as HTMLElement;\n if (el.dataset && el.dataset.visualSelectorId) {\n return true;\n }\n for (let i = 0; i < el.children.length; i++) {\n if (hasVisualId(el.children[i]!)) {\n return true;\n }\n }\n }\n return false;\n };\n\n const isLayoutChange =\n mutation.type === \"attributes\" &&\n (mutation.attributeName === \"style\" ||\n mutation.attributeName === \"class\" ||\n mutation.attributeName === \"width\" ||\n mutation.attributeName === \"height\");\n\n return isLayoutChange && hasVisualId(mutation.target);\n });\n\n if (needsUpdate) {\n setTimeout(handleResize, 50);\n }\n });\n\n // Set up event listeners\n window.addEventListener(\"message\", handleMessage);\n window.addEventListener(\"scroll\", handleScroll, true);\n document.addEventListener(\"scroll\", handleScroll, true);\n window.addEventListener(\"resize\", handleResize);\n window.addEventListener(\"scroll\", handleResize);\n\n // Start observing DOM mutations\n mutationObserver.observe(document.body, {\n attributes: true,\n childList: true,\n subtree: true,\n attributeFilter: [\"style\", \"class\", \"width\", \"height\"],\n });\n\n // Send ready message to parent\n window.parent.postMessage({ type: \"visual-edit-agent-ready\" }, \"*\");\n}","/**\n * Sandbox bridge entry point — dynamically imported by the inline script\n * injected via html-injections-plugin. Conditionally initialises each\n * sandbox-side feature based on the supplied options.\n */\n\nimport { setupUnhandledErrors } from \"./injections/unhandled-errors-handlers.js\";\nimport { setupHmrNotifier } from \"./injections/sandbox-hmr-notifier.js\";\nimport { setupMountObserver } from \"./injections/sandbox-mount-observer.js\";\nimport { setupNavigationNotifier } from \"./injections/navigation-notifier.js\";\nimport { setupVisualEditAgent } from \"./injections/visual-edit-agent.js\";\n\n/**\n * Initialise the sandbox bridge. Called once from the injected inline script.\n * @param options Feature flags — each defaults to enabled unless explicitly disabled.\n * @param hmr Vite's HMR client (`import.meta.hot`), passed only in dev mode.\n */\nexport function init(\n options: {\n unhandledErrors?: boolean;\n mountObserver?: boolean;\n hmrNotifier?: boolean;\n navigationNotifier?: boolean;\n visualEditAgent?: boolean;\n } = {},\n hmr?: { on(event: string, cb: (...args: any[]) => void): void }\n) {\n if (window.self === window.top) return;\n if ((globalThis as any).__sandboxBridgeInitialized) return;\n (globalThis as any).__sandboxBridgeInitialized = true;\n\n if (options.unhandledErrors !== false) setupUnhandledErrors(hmr);\n if (options.mountObserver !== false) setupMountObserver();\n if (options.hmrNotifier && hmr) setupHmrNotifier(hmr);\n if (options.navigationNotifier) setupNavigationNotifier();\n if (options.visualEditAgent) setupVisualEditAgent();\n}\n"],"mappings":"AAIO,SAASA,EAAqBC,EAAiE,CACpG,OAAO,oBAAoB,qBAAsBC,CAAwB,EACzE,OAAO,oBAAoB,QAASC,CAAiB,EAErD,OAAO,iBAAiB,qBAAsBD,CAAwB,EACtE,OAAO,iBAAiB,QAASC,CAAiB,EAElD,IAAIC,EAAwB,GACxBC,EAAyD,KAEzDJ,IACFA,EAAI,GAAG,oBAAqB,IAAM,CAChCG,EAAwB,GAEpBC,GACF,aAAaA,CAAgB,EAG/BA,EAAmB,WAAW,IAAM,CAClCD,EAAwB,GACxBC,EAAmB,IACrB,EAAG,GAAyB,CAC9B,CAAC,EACDJ,EAAI,GAAG,wBAAyB,IAAM,CACpCG,EAAwB,GACpBC,IACF,aAAaA,CAAgB,EAC7BA,EAAmB,KAEvB,CAAC,GAGH,SAASC,EAAW,CAClB,MAAAC,EACA,QAAAC,EACA,cAAAC,EACA,cAAAC,CACF,EAKG,CACGA,GAAe,UAAU,SAAW,KAAO,CAACN,GAGhD,OAAO,QAAQ,YACb,CACE,KAAM,YACN,MAAO,CACL,MAAOG,EAAM,SAAS,EACtB,QAASC,GAAS,SAAS,EAC3B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Aa,KAAK,aAAc,CACvC,IAAM9B,EAAK8B,EACX,GAAI9B,EAAG,SAAWA,EAAG,QAAQ,iBAC3B,MAAO,GAET,QAAS+B,EAAI,EAAGA,EAAI/B,EAAG,SAAS,OAAQ+B,IACtC,GAAIF,EAAY7B,EAAG,SAAS+B,CAAC,CAAE,EAC7B,MAAO,EAGb,CACA,MAAO,EACT,EASA,OANEH,EAAS,OAAS,eACjBA,EAAS,gBAAkB,SAC1BA,EAAS,gBAAkB,SAC3BA,EAAS,gBAAkB,SAC3BA,EAAS,gBAAkB,WAENC,EAAYD,EAAS,MAAM,CACtD,CAAC,GAGC,WAAWL,EAAc,EAAE,CAE/B,CAAC,EAGD,OAAO,iBAAiB,UAAWH,CAAa,EAChD,OAAO,iBAAiB,SAAUJ,EAAc,EAAI,EACpD,SAAS,iBAAiB,SAAUA,EAAc,EAAI,EACtD,OAAO,iBAAiB,SAAUO,CAAY,EAC9C,OAAO,iBAAiB,SAAUA,CAAY,EAG9CG,EAAiB,QAAQ,SAAS,KAAM,CACtC,WAAY,GACZ,UAAW,GACX,QAAS,GACT,gBAAiB,CAAC,QAAS,QAAS,QAAS,QAAQ,CACvD,CAAC,EAGD,OAAO,OAAO,YAAY,CAAE,KAAM,yBAA0B,EAAG,GAAG,CACpE,CC/hBO,SAASM,EACdC,EAMI,CAAC,EACLC,EACA,CACI,OAAO,OAAS,OAAO,MACtB,WAAmB,6BACvB,WAAmB,2BAA6B,GAE7CD,EAAQ,kBAAoB,IAAOE,EAAqBD,CAAG,EAC3DD,EAAQ,gBAAkB,IAAOG,EAAmB,EACpDH,EAAQ,aAAeC,GAAKG,EAAiBH,CAAG,EAChDD,EAAQ,oBAAoBK,EAAwB,EACpDL,EAAQ,iBAAiBM,EAAqB,GACpD","names":["setupUnhandledErrors","hmr","handleUnhandledRejection","handleWindowError","shouldPropagateErrors","suppressionTimer","onAppError","title","details","componentName","originalError","event","functionName","msg","setupHmrNotifier","hmr","setupMountObserver","mutations","nodesAdded","mutation","nodesRemoved","setupNavigationNotifier","lastUrl","notifyNavigation","currentUrl","originalPushState","args","originalReplaceState","findElementsById","id","sourceElements","updateElementClasses","elements","classes","element","setupVisualEditAgent","isVisualEditMode","isPopoverDragging","isDropdownOpen","hoverOverlays","selectedOverlays","currentHighlightedElements","selectedElementId","createOverlay","isSelected","overlay","positionOverlay","element","rect","label","clearHoverOverlays","handleMouseOver","e","target","htmlElement","selectorId","elements","findElementsById","el","handleMouseOut","handleElementClick","visualSelectorId","elementPosition","svgElement","elementData","unselectElement","updateElementClassesAndReposition","classes","updateElementClasses","index","updateElementContent","content","toggleVisualEditMode","isEnabled","handleScroll","viewportHeight","viewportWidth","isInViewport","handleMessage","event","message","handleResize","htmlEl","id","mutationObserver","mutations","mutation","hasVisualId","node","i","init","options","hmr","setupUnhandledErrors","setupMountObserver","setupHmrNotifier","setupNavigationNotifier","setupVisualEditAgent"]}
|