@ghia/native 0.0.0-stage → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/browser.mjs +7 -0
- package/dist/aria.d.ts +72 -0
- package/dist/aria.d.ts.map +1 -0
- package/dist/aria.js +2 -0
- package/dist/aria.js.map +1 -0
- package/dist/automation/client.d.ts +243 -0
- package/dist/automation/client.d.ts.map +1 -0
- package/dist/automation/client.js +801 -0
- package/dist/automation/client.js.map +1 -0
- package/dist/automation/index.d.ts +5 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +4 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/protocol.d.ts +309 -0
- package/dist/automation/protocol.d.ts.map +1 -0
- package/dist/automation/protocol.js +320 -0
- package/dist/automation/protocol.js.map +1 -0
- package/dist/blob-images.d.ts +32 -0
- package/dist/blob-images.d.ts.map +1 -0
- package/dist/blob-images.js +55 -0
- package/dist/blob-images.js.map +1 -0
- package/dist/bounds.d.ts +61 -0
- package/dist/bounds.d.ts.map +1 -0
- package/dist/bounds.js +85 -0
- package/dist/bounds.js.map +1 -0
- package/dist/clipboard-global.d.ts +11 -0
- package/dist/clipboard-global.d.ts.map +1 -0
- package/dist/clipboard-global.js +2 -0
- package/dist/clipboard-global.js.map +1 -0
- package/dist/clipboard.d.ts +19 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +41 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/cpu-throttle.d.ts +6 -0
- package/dist/cpu-throttle.d.ts.map +1 -0
- package/dist/cpu-throttle.js +42 -0
- package/dist/cpu-throttle.js.map +1 -0
- package/dist/events/data-transfer.d.ts +23 -0
- package/dist/events/data-transfer.d.ts.map +1 -0
- package/dist/events/data-transfer.js +97 -0
- package/dist/events/data-transfer.js.map +1 -0
- package/dist/events/dispatch.d.ts +144 -0
- package/dist/events/dispatch.d.ts.map +1 -0
- package/dist/events/dispatch.js +241 -0
- package/dist/events/dispatch.js.map +1 -0
- package/dist/events/drag.d.ts +21 -0
- package/dist/events/drag.d.ts.map +1 -0
- package/dist/events/drag.js +111 -0
- package/dist/events/drag.js.map +1 -0
- package/dist/events/event-props.d.ts +19 -0
- package/dist/events/event-props.d.ts.map +1 -0
- package/dist/events/event-props.js +104 -0
- package/dist/events/event-props.js.map +1 -0
- package/dist/events/keyboard-defaults.d.ts +18 -0
- package/dist/events/keyboard-defaults.d.ts.map +1 -0
- package/dist/events/keyboard-defaults.js +121 -0
- package/dist/events/keyboard-defaults.js.map +1 -0
- package/dist/events/listeners.d.ts +18 -0
- package/dist/events/listeners.d.ts.map +1 -0
- package/dist/events/listeners.js +49 -0
- package/dist/events/listeners.js.map +1 -0
- package/dist/events/route.d.ts +17 -0
- package/dist/events/route.d.ts.map +1 -0
- package/dist/events/route.js +36 -0
- package/dist/events/route.js.map +1 -0
- package/dist/events/types.d.ts +269 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/events/types.js +2 -0
- package/dist/events/types.js.map +1 -0
- package/dist/events/window-target.d.ts +120 -0
- package/dist/events/window-target.d.ts.map +1 -0
- package/dist/events/window-target.js +311 -0
- package/dist/events/window-target.js.map +1 -0
- package/dist/eyedropper.d.ts +33 -0
- package/dist/eyedropper.d.ts.map +1 -0
- package/dist/eyedropper.js +66 -0
- package/dist/eyedropper.js.map +1 -0
- package/dist/focus.d.ts +18 -0
- package/dist/focus.d.ts.map +1 -0
- package/dist/focus.js +26 -0
- package/dist/focus.js.map +1 -0
- package/dist/fonts.d.ts +12 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +17 -0
- package/dist/fonts.js.map +1 -0
- package/dist/forms.d.ts +10 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +9 -0
- package/dist/forms.js.map +1 -0
- package/dist/host-runtime.d.ts +108 -0
- package/dist/host-runtime.d.ts.map +1 -0
- package/dist/host-runtime.js +213 -0
- package/dist/host-runtime.js.map +1 -0
- package/dist/host.d.ts +2403 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +30 -0
- package/dist/host.js.map +1 -0
- package/dist/idle-gc.d.ts +36 -0
- package/dist/idle-gc.d.ts.map +1 -0
- package/dist/idle-gc.js +70 -0
- package/dist/idle-gc.js.map +1 -0
- package/dist/keyframes.d.ts +108 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/keyframes.js +107 -0
- package/dist/keyframes.js.map +1 -0
- package/dist/layout-animation.d.ts +38 -0
- package/dist/layout-animation.d.ts.map +1 -0
- package/dist/layout-animation.js +41 -0
- package/dist/layout-animation.js.map +1 -0
- package/dist/match-media.d.ts +62 -0
- package/dist/match-media.d.ts.map +1 -0
- package/dist/match-media.js +272 -0
- package/dist/match-media.js.map +1 -0
- package/dist/media-query.d.ts +21 -0
- package/dist/media-query.d.ts.map +1 -0
- package/dist/media-query.js +599 -0
- package/dist/media-query.js.map +1 -0
- package/dist/motion-bindings.d.ts +36 -0
- package/dist/motion-bindings.d.ts.map +1 -0
- package/dist/motion-bindings.js +107 -0
- package/dist/motion-bindings.js.map +1 -0
- package/dist/motion-config.d.ts +20 -0
- package/dist/motion-config.d.ts.map +1 -0
- package/dist/motion-config.js +51 -0
- package/dist/motion-config.js.map +1 -0
- package/dist/motion-span.d.ts +57 -0
- package/dist/motion-span.d.ts.map +1 -0
- package/dist/motion-span.js +150 -0
- package/dist/motion-span.js.map +1 -0
- package/dist/motion-value.d.ts +269 -0
- package/dist/motion-value.d.ts.map +1 -0
- package/dist/motion-value.js +941 -0
- package/dist/motion-value.js.map +1 -0
- package/dist/motion-variants.d.ts +190 -0
- package/dist/motion-variants.d.ts.map +1 -0
- package/dist/motion-variants.js +249 -0
- package/dist/motion-variants.js.map +1 -0
- package/dist/mutations.d.ts +65 -0
- package/dist/mutations.d.ts.map +1 -0
- package/dist/mutations.js +320 -0
- package/dist/mutations.js.map +1 -0
- package/dist/nativeview.d.ts +10 -0
- package/dist/nativeview.d.ts.map +1 -0
- package/dist/nativeview.js +92 -0
- package/dist/nativeview.js.map +1 -0
- package/dist/observers.d.ts +92 -0
- package/dist/observers.d.ts.map +1 -0
- package/dist/observers.js +579 -0
- package/dist/observers.js.map +1 -0
- package/dist/presence.d.ts +63 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +54 -0
- package/dist/presence.js.map +1 -0
- package/dist/renderer-state.d.ts +155 -0
- package/dist/renderer-state.d.ts.map +1 -0
- package/dist/renderer-state.js +302 -0
- package/dist/renderer-state.js.map +1 -0
- package/dist/reorder.d.ts +63 -0
- package/dist/reorder.d.ts.map +1 -0
- package/dist/reorder.js +303 -0
- package/dist/reorder.js.map +1 -0
- package/dist/runtime.d.ts +23 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +157 -0
- package/dist/runtime.js.map +1 -0
- package/dist/screen.d.ts +8 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +16 -0
- package/dist/screen.js.map +1 -0
- package/dist/scroll.d.ts +79 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +170 -0
- package/dist/scroll.js.map +1 -0
- package/dist/style-images.d.ts +20 -0
- package/dist/style-images.d.ts.map +1 -0
- package/dist/style-images.js +57 -0
- package/dist/style-images.js.map +1 -0
- package/dist/svg.d.ts +16 -0
- package/dist/svg.d.ts.map +1 -0
- package/dist/svg.js +119 -0
- package/dist/svg.js.map +1 -0
- package/dist/testing.d.ts +811 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +1187 -0
- package/dist/testing.js.map +1 -0
- package/dist/text-match.d.ts +8 -0
- package/dist/text-match.d.ts.map +1 -0
- package/dist/text-match.js +10 -0
- package/dist/text-match.js.map +1 -0
- package/dist/text-selection.d.ts +34 -0
- package/dist/text-selection.d.ts.map +1 -0
- package/dist/text-selection.js +23 -0
- package/dist/text-selection.js.map +1 -0
- package/dist/universal-style.d.ts +22 -0
- package/dist/universal-style.d.ts.map +1 -0
- package/dist/universal-style.js +58 -0
- package/dist/universal-style.js.map +1 -0
- package/dist/web-animations.d.ts +300 -0
- package/dist/web-animations.d.ts.map +1 -0
- package/dist/web-animations.js +1032 -0
- package/dist/web-animations.js.map +1 -0
- package/dist/webview.d.ts +39 -0
- package/dist/webview.d.ts.map +1 -0
- package/dist/webview.js +26 -0
- package/dist/webview.js.map +1 -0
- package/gpuix-native.darwin-arm64.node +4 -0
- package/index.cjs +789 -0
- package/index.d.ts +2603 -0
- package/index.js +729 -0
- package/package.json +94 -3
- package/README.md +0 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "./clipboard-global.js";
|
|
2
|
+
export function createClipboard(host) {
|
|
3
|
+
const requireHost = () => {
|
|
4
|
+
const current = host();
|
|
5
|
+
if (!current?.writeClipboardText || !current.readClipboardText) {
|
|
6
|
+
throw new Error("No GPUIX renderer with a clipboard is running");
|
|
7
|
+
}
|
|
8
|
+
return current;
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
async writeText(text) {
|
|
12
|
+
requireHost().writeClipboardText(String(text));
|
|
13
|
+
},
|
|
14
|
+
async readText() {
|
|
15
|
+
const text = requireHost().readClipboardText();
|
|
16
|
+
// The DOM has no "empty" state: readText() of a text-less clipboard is "".
|
|
17
|
+
return text === null ? "" : text;
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
let activeHost;
|
|
22
|
+
/** The clipboard of the renderer created last. */
|
|
23
|
+
export const clipboard = createClipboard(() => activeHost);
|
|
24
|
+
/**
|
|
25
|
+
* Point `clipboard` at `host`, and expose it as `navigator.clipboard` when the
|
|
26
|
+
* runtime has a `navigator` without one, so code written for the web runs
|
|
27
|
+
* unchanged. A runtime with no `navigator` is left without one.
|
|
28
|
+
*/
|
|
29
|
+
export function bindClipboard(host) {
|
|
30
|
+
activeHost = host;
|
|
31
|
+
const scope = globalThis;
|
|
32
|
+
const target = scope.navigator;
|
|
33
|
+
if (target !== undefined && target.clipboard === undefined) {
|
|
34
|
+
Object.defineProperty(target, "clipboard", {
|
|
35
|
+
value: clipboard,
|
|
36
|
+
configurable: true,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../js/clipboard.ts"],"names":[],"mappings":"AACA,OAAO,uBAAuB,CAAA;AAc9B,MAAM,UAAU,eAAe,CAC7B,IAAqC;IAErC,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,MAAM,OAAO,GAAG,IAAI,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO,EAAE,kBAAkB,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;QAClE,CAAC;QACD,OAAO,OAAkC,CAAA;IAC3C,CAAC,CAAA;IACD,OAAO;QACL,KAAK,CAAC,SAAS,CAAC,IAAI;YAClB,WAAW,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;QAChD,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,MAAM,IAAI,GAAG,WAAW,EAAE,CAAC,iBAAiB,EAAE,CAAA;YAC9C,2EAA2E;YAC3E,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QAClC,CAAC;KACF,CAAA;AACH,CAAC;AAED,IAAI,UAAqC,CAAA;AAEzC,kDAAkD;AAClD,MAAM,CAAC,MAAM,SAAS,GAAc,eAAe,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAA;AAErE;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,IAAmB;IAC/C,UAAU,GAAG,IAAI,CAAA;IACjB,MAAM,KAAK,GAAG,UAAuD,CAAA;IACrE,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC9B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC3D,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,KAAK,EAAE,SAAS;YAChB,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const MAC_CPU_THROTTLES: readonly ["utility", "background", "maintenance"];
|
|
2
|
+
export type MacCpuThrottle = (typeof MAC_CPU_THROTTLES)[number];
|
|
3
|
+
export declare function readMacCpuThrottle(): MacCpuThrottle | null;
|
|
4
|
+
/** Re-exec under `taskpolicy -c`. Call from the process entry, not a vitest worker. */
|
|
5
|
+
export declare function applyMacCpuThrottleFromEnv(): MacCpuThrottle | null;
|
|
6
|
+
//# sourceMappingURL=cpu-throttle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpu-throttle.d.ts","sourceRoot":"","sources":["../js/cpu-throttle.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,mDAAoD,CAAA;AAElF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAS/D,wBAAgB,kBAAkB,IAAI,cAAc,GAAG,IAAI,CAU1D;AAED,uFAAuF;AACvF,wBAAgB,0BAA0B,IAAI,cAAc,GAAG,IAAI,CAmBlE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// macOS CPU clamp helpers that stay safe to import in browser bundles.
|
|
2
|
+
export const MAC_CPU_THROTTLES = ["utility", "background", "maintenance"];
|
|
3
|
+
function isMacCpuThrottle(value) {
|
|
4
|
+
for (const clamp of MAC_CPU_THROTTLES) {
|
|
5
|
+
if (clamp === value)
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
export function readMacCpuThrottle() {
|
|
11
|
+
if (typeof process === "undefined")
|
|
12
|
+
return null;
|
|
13
|
+
const raw = (process.env.THROTTLE ?? "").trim().toLowerCase();
|
|
14
|
+
if (!raw)
|
|
15
|
+
return null;
|
|
16
|
+
if (!isMacCpuThrottle(raw)) {
|
|
17
|
+
throw new Error(`THROTTLE=${raw} is invalid. Use utility, background, or maintenance.`);
|
|
18
|
+
}
|
|
19
|
+
return raw;
|
|
20
|
+
}
|
|
21
|
+
/** Re-exec under `taskpolicy -c`. Call from the process entry, not a vitest worker. */
|
|
22
|
+
export function applyMacCpuThrottleFromEnv() {
|
|
23
|
+
const mode = readMacCpuThrottle();
|
|
24
|
+
if (!mode)
|
|
25
|
+
return null;
|
|
26
|
+
if (process.env.GPUIX_CPU_THROTTLE_APPLIED === mode)
|
|
27
|
+
return mode;
|
|
28
|
+
if (process.platform !== "darwin") {
|
|
29
|
+
throw new Error(`THROTTLE=${mode} needs macOS taskpolicy`);
|
|
30
|
+
}
|
|
31
|
+
if (process.argv.some((arg) => arg.includes("vitest/dist/workers"))) {
|
|
32
|
+
throw new Error(`THROTTLE=${mode} must wrap the vitest process. Use examples/vitest.config.ts.`);
|
|
33
|
+
}
|
|
34
|
+
console.log(`[throttle] taskpolicy -c ${mode}`);
|
|
35
|
+
const { spawnSync } = process.getBuiltinModule("node:child_process");
|
|
36
|
+
const result = spawnSync("taskpolicy", ["-c", mode, ...process.argv], {
|
|
37
|
+
stdio: "inherit",
|
|
38
|
+
env: { ...process.env, GPUIX_CPU_THROTTLE_APPLIED: mode },
|
|
39
|
+
});
|
|
40
|
+
process.exit(result.status ?? 1);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=cpu-throttle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpu-throttle.js","sourceRoot":"","sources":["../js/cpu-throttle.ts"],"names":[],"mappings":"AAAA,wEAAwE;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A;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAA;IAC/C,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAA;IACpE,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE;QACpE,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,0BAA0B,EAAE,IAAI,EAAE;KAC1D,CAAC,CAAA;IACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HostDataTransfer, HostDropEffect, HostEffectAllowed, HostFile } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* What a handler may do with a `dataTransfer`, as the DOM's drag data store
|
|
4
|
+
* modes: `readwrite` in `dragstart`, `readonly` in `drop` and `protected` in
|
|
5
|
+
* every other drag event, where `getData` is empty and `setData` does nothing.
|
|
6
|
+
*/
|
|
7
|
+
export type DataTransferMode = "readwrite" | "readonly" | "protected";
|
|
8
|
+
export interface DataTransferSession {
|
|
9
|
+
readonly dataTransfer: HostDataTransfer;
|
|
10
|
+
/** The drag dispatcher sets this before each event; handlers cannot. */
|
|
11
|
+
mode: DataTransferMode;
|
|
12
|
+
}
|
|
13
|
+
/** The drop effect a target gets before its handler picks one. */
|
|
14
|
+
export declare function defaultDropEffect(effectAllowed: HostEffectAllowed): HostDropEffect;
|
|
15
|
+
/** Whether a source that allowed `effectAllowed` lets a target choose `dropEffect`. */
|
|
16
|
+
export declare function allowsDropEffect(effectAllowed: HostEffectAllowed, dropEffect: HostDropEffect): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The data of one drag. A drag of an element fills it in `dragstart`; a drag of
|
|
19
|
+
* files from the OS arrives with `files` and nothing else for a handler to
|
|
20
|
+
* add. `setDragImage` is accepted and ignored: there is no drag image.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createDataTransfer(files?: readonly HostFile[]): DataTransferSession;
|
|
23
|
+
//# sourceMappingURL=data-transfer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-transfer.d.ts","sourceRoot":"","sources":["../../js/events/data-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAE/F;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;AAErE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,YAAY,EAAE,gBAAgB,CAAA;IACvC,wEAAwE;IACxE,IAAI,EAAE,gBAAgB,CAAA;CACvB;AAgBD,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,iBAAiB,GAAG,cAAc,CAYlF;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,iBAAiB,EAChC,UAAU,EAAE,cAAc,GACzB,OAAO,CAIT;AAUD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,SAAS,QAAQ,EAAO,GAAG,mBAAmB,CAyCvF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const DROP_EFFECTS = new Set(["none", "copy", "link", "move"]);
|
|
2
|
+
const EFFECT_ALLOWED = new Set([
|
|
3
|
+
"none",
|
|
4
|
+
"copy",
|
|
5
|
+
"copyLink",
|
|
6
|
+
"copyMove",
|
|
7
|
+
"link",
|
|
8
|
+
"linkMove",
|
|
9
|
+
"move",
|
|
10
|
+
"all",
|
|
11
|
+
"uninitialized",
|
|
12
|
+
]);
|
|
13
|
+
/** The drop effect a target gets before its handler picks one. */
|
|
14
|
+
export function defaultDropEffect(effectAllowed) {
|
|
15
|
+
switch (effectAllowed) {
|
|
16
|
+
case "none":
|
|
17
|
+
return "none";
|
|
18
|
+
case "link":
|
|
19
|
+
case "linkMove":
|
|
20
|
+
return "link";
|
|
21
|
+
case "move":
|
|
22
|
+
return "move";
|
|
23
|
+
default:
|
|
24
|
+
return "copy";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Whether a source that allowed `effectAllowed` lets a target choose `dropEffect`. */
|
|
28
|
+
export function allowsDropEffect(effectAllowed, dropEffect) {
|
|
29
|
+
if (dropEffect === "none")
|
|
30
|
+
return true;
|
|
31
|
+
if (effectAllowed === "all" || effectAllowed === "uninitialized")
|
|
32
|
+
return true;
|
|
33
|
+
return effectAllowed.toLowerCase().includes(dropEffect);
|
|
34
|
+
}
|
|
35
|
+
/** `"text"` and `"url"` are the legacy names of two MIME types, and formats ignore case. */
|
|
36
|
+
function normalizeFormat(format) {
|
|
37
|
+
const lower = format.toLowerCase();
|
|
38
|
+
if (lower === "text")
|
|
39
|
+
return "text/plain";
|
|
40
|
+
if (lower === "url")
|
|
41
|
+
return "text/uri-list";
|
|
42
|
+
return lower;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The data of one drag. A drag of an element fills it in `dragstart`; a drag of
|
|
46
|
+
* files from the OS arrives with `files` and nothing else for a handler to
|
|
47
|
+
* add. `setDragImage` is accepted and ignored: there is no drag image.
|
|
48
|
+
*/
|
|
49
|
+
export function createDataTransfer(files = []) {
|
|
50
|
+
const entries = new Map();
|
|
51
|
+
const frozenFiles = Object.freeze([...files]);
|
|
52
|
+
let effectAllowed = files.length > 0 ? "all" : "uninitialized";
|
|
53
|
+
let dropEffect = "none";
|
|
54
|
+
const session = {
|
|
55
|
+
mode: "protected",
|
|
56
|
+
dataTransfer: {
|
|
57
|
+
get dropEffect() {
|
|
58
|
+
return dropEffect;
|
|
59
|
+
},
|
|
60
|
+
set dropEffect(value) {
|
|
61
|
+
if (DROP_EFFECTS.has(value))
|
|
62
|
+
dropEffect = value;
|
|
63
|
+
},
|
|
64
|
+
get effectAllowed() {
|
|
65
|
+
return effectAllowed;
|
|
66
|
+
},
|
|
67
|
+
set effectAllowed(value) {
|
|
68
|
+
if (session.mode === "readwrite" && EFFECT_ALLOWED.has(value))
|
|
69
|
+
effectAllowed = value;
|
|
70
|
+
},
|
|
71
|
+
files: frozenFiles,
|
|
72
|
+
get types() {
|
|
73
|
+
return Object.freeze(frozenFiles.length > 0 ? [...entries.keys(), "Files"] : [...entries.keys()]);
|
|
74
|
+
},
|
|
75
|
+
getData(format) {
|
|
76
|
+
if (session.mode === "protected")
|
|
77
|
+
return "";
|
|
78
|
+
return entries.get(normalizeFormat(format)) ?? "";
|
|
79
|
+
},
|
|
80
|
+
setData(format, data) {
|
|
81
|
+
if (session.mode === "readwrite")
|
|
82
|
+
entries.set(normalizeFormat(format), String(data));
|
|
83
|
+
},
|
|
84
|
+
clearData(format) {
|
|
85
|
+
if (session.mode !== "readwrite")
|
|
86
|
+
return;
|
|
87
|
+
if (format === undefined)
|
|
88
|
+
entries.clear();
|
|
89
|
+
else
|
|
90
|
+
entries.delete(normalizeFormat(format));
|
|
91
|
+
},
|
|
92
|
+
setDragImage() { },
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
return session;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=data-transfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-transfer.js","sourceRoot":"","sources":["../../js/events/data-transfer.ts"],"names":[],"mappings":"AAeA,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;AAEnF,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC;IAClD,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,MAAM;IACN,KAAK;IACL,eAA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M,CAAC,CAAC,CAAA;YAC9C,CAAC;YACD,YAAY,KAAI,CAAC;SAClB;KACF,CAAA;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { EventPayload } from "../../index.js";
|
|
2
|
+
import type { EventHandlerMap } from "../host.js";
|
|
3
|
+
import type { HostDropEffect } from "./types.js";
|
|
4
|
+
export declare const EVENT_PHASE_NONE = 0;
|
|
5
|
+
export declare const EVENT_PHASE_CAPTURING = 1;
|
|
6
|
+
export declare const EVENT_PHASE_AT_TARGET = 2;
|
|
7
|
+
export declare const EVENT_PHASE_BUBBLING = 3;
|
|
8
|
+
export declare function isEnterLeaveType(eventType: string): boolean;
|
|
9
|
+
export declare function eventBubbles(eventType: string): boolean;
|
|
10
|
+
export declare function eventIsCancelable(eventType: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Key of a capture-phase handler in `EventHandlerMap`: the event type plus
|
|
13
|
+
* `"Capture"`, next to the bubble-phase handler registered under the bare type.
|
|
14
|
+
*/
|
|
15
|
+
export declare function captureHandlerKey(eventType: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* What a handler sees of the native payload: every field but the three that
|
|
18
|
+
* carry element ids, which the event replaces with elements. `elementId` stays
|
|
19
|
+
* the numeric id of the element the payload was addressed to.
|
|
20
|
+
*/
|
|
21
|
+
export type PublicEventFields = Omit<EventPayload, "target" | "relatedTarget" | "path" | "data"> & {
|
|
22
|
+
/** `null` for an edit that inserted no text, see `HostInputEvent`. */
|
|
23
|
+
data?: string | null;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* An event with no propagation, such as `onSelectionChange` or
|
|
27
|
+
* `onAppearanceChange`: the payload with its elements in place of their ids.
|
|
28
|
+
* An element is the object a `ref` gives in the adapter (React's host
|
|
29
|
+
* instance, Solid's element).
|
|
30
|
+
*/
|
|
31
|
+
export interface RootEvent extends PublicEventFields {
|
|
32
|
+
/**
|
|
33
|
+
* The element the event was aimed at. `null` for an event aimed at the
|
|
34
|
+
* window: a key with nothing focused, a pointer move outside every element.
|
|
35
|
+
* GPUIX has no `body` or `html` element to stand in. The `document` object
|
|
36
|
+
* for `pointerlockchange` and `pointerlockerror`, as in the DOM.
|
|
37
|
+
*/
|
|
38
|
+
readonly target: object | null;
|
|
39
|
+
/** The other element of a boundary or focus event, or `null` when there is none. */
|
|
40
|
+
readonly relatedTarget: object | null;
|
|
41
|
+
}
|
|
42
|
+
/** The event object handlers receive: the native payload plus the DOM surface. */
|
|
43
|
+
export interface DomEvent extends RootEvent {
|
|
44
|
+
readonly type: string;
|
|
45
|
+
/**
|
|
46
|
+
* The element whose handler is running, or the `window` / `document` object
|
|
47
|
+
* during their phases. `null` outside a dispatch.
|
|
48
|
+
*/
|
|
49
|
+
currentTarget: object | null;
|
|
50
|
+
/** The elements on the propagation path, target first, like the DOM's `composedPath()`. */
|
|
51
|
+
composedPath(): object[];
|
|
52
|
+
eventPhase: number;
|
|
53
|
+
readonly bubbles: boolean;
|
|
54
|
+
readonly cancelable: boolean;
|
|
55
|
+
readonly timeStamp: number;
|
|
56
|
+
defaultPrevented: boolean;
|
|
57
|
+
stopPropagation(): void;
|
|
58
|
+
stopImmediatePropagation(): void;
|
|
59
|
+
preventDefault(): void;
|
|
60
|
+
}
|
|
61
|
+
export interface DomDispatchResult {
|
|
62
|
+
defaultPrevented: boolean;
|
|
63
|
+
propagationStopped: boolean;
|
|
64
|
+
/** Set for a `dragover`: what the drop would do. */
|
|
65
|
+
dropEffect?: HostDropEffect;
|
|
66
|
+
}
|
|
67
|
+
export interface DomEventRoot {
|
|
68
|
+
eventHandlers: EventHandlerMap;
|
|
69
|
+
/**
|
|
70
|
+
* The element for a native element id, as the adapter's ref gives it, or
|
|
71
|
+
* `undefined` once the root has dropped it.
|
|
72
|
+
*/
|
|
73
|
+
elementById(id: number): object | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Where an error a handler throws goes: the renderer's `onError`. Without it
|
|
76
|
+
* the error is reported to the global handler, as the DOM does.
|
|
77
|
+
*/
|
|
78
|
+
reportError?: (error: unknown) => void;
|
|
79
|
+
}
|
|
80
|
+
/** What `stopPropagation()` and `stopImmediatePropagation()` have done so far. */
|
|
81
|
+
export interface DomEventState {
|
|
82
|
+
readonly propagationStopped: boolean;
|
|
83
|
+
readonly immediatePropagationStopped: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Phases that belong outside the element tree: `window` and `document` wrap
|
|
87
|
+
* the path. They run with the live event, so a `preventDefault()` or
|
|
88
|
+
* `stopPropagation()` on either side is seen by the other.
|
|
89
|
+
*/
|
|
90
|
+
export interface DomDispatchHooks {
|
|
91
|
+
/**
|
|
92
|
+
* Before the first capture handler. Skipped phases follow `state`. A throw
|
|
93
|
+
* of a listener goes to `fail` so the dispatch goes on.
|
|
94
|
+
*/
|
|
95
|
+
beforeCapture?(event: DomEvent, state: DomEventState, fail: (error: unknown) => void): void;
|
|
96
|
+
/**
|
|
97
|
+
* After the last bubble handler, for an event that bubbles and was not stopped.
|
|
98
|
+
* A throw of a listener goes to `fail`.
|
|
99
|
+
*/
|
|
100
|
+
afterBubble?(event: DomEvent, state: DomEventState, fail: (error: unknown) => void): void;
|
|
101
|
+
}
|
|
102
|
+
/** The element for `id`, or throws: the root dropped an element native still names. */
|
|
103
|
+
export declare function requireElement(root: DomEventRoot, id: number, eventType: string): object;
|
|
104
|
+
/**
|
|
105
|
+
* The element for an id native may not have sent. `null` for no id, and for an
|
|
106
|
+
* element the root has already dropped: one that left the tree is not the other
|
|
107
|
+
* end of a boundary or focus event any more.
|
|
108
|
+
*/
|
|
109
|
+
export declare function optionalElement(root: DomEventRoot, id: number | undefined): object | null;
|
|
110
|
+
/** The payload as a public event: element ids replaced by the elements they name. */
|
|
111
|
+
export declare function toRootEvent(root: DomEventRoot, payload: EventPayload, target: object | null): RootEvent;
|
|
112
|
+
/**
|
|
113
|
+
* Creates the event object and the state behind its stop methods. `path` is
|
|
114
|
+
* the propagation path as elements, target first; empty for an event aimed at
|
|
115
|
+
* the window or the document, whose `target` is `pathlessTarget`.
|
|
116
|
+
*/
|
|
117
|
+
export declare function createDomEvent(root: DomEventRoot, payload: EventPayload, path: readonly object[], pathlessTarget: object | null): {
|
|
118
|
+
event: DomEvent;
|
|
119
|
+
state: DomEventState;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* What the DOM does with an exception a listener leaves uncaught: report it to
|
|
123
|
+
* the global error handler without disturbing the dispatch or its caller.
|
|
124
|
+
*/
|
|
125
|
+
export declare function reportUncaught(error: unknown): void;
|
|
126
|
+
/** Reports the errors a dispatch collected, once it is over. */
|
|
127
|
+
export declare function reportHandlerErrors(root: DomEventRoot, errors: readonly unknown[]): void;
|
|
128
|
+
/**
|
|
129
|
+
* Runs `payload` through the handlers registered on `root`: capture handlers
|
|
130
|
+
* from the root down to the target, then the target's, then bubble handlers
|
|
131
|
+
* from the target back up, along `payload.path` (target first). Handlers run
|
|
132
|
+
* synchronously. A payload without `path` is handled at `payload.elementId`
|
|
133
|
+
* only. A handler that throws does not end the dispatch: the error goes to
|
|
134
|
+
* `root.reportError` (or the global handler) after the dispatch, and the rest
|
|
135
|
+
* of the handlers run.
|
|
136
|
+
*/
|
|
137
|
+
export declare function dispatchDomEvent(root: DomEventRoot, payload: EventPayload, hooks?: DomDispatchHooks): DomDispatchResult;
|
|
138
|
+
/**
|
|
139
|
+
* `event.preventDefault()` for a handler typed with the plain payload. Throws
|
|
140
|
+
* for an event that did not come through `dispatchDomEvent`, where there is no
|
|
141
|
+
* default to cancel.
|
|
142
|
+
*/
|
|
143
|
+
export declare function preventEventDefault(event: PublicEventFields): void;
|
|
144
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../js/events/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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AgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAIzF;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAQvG;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CA4B3C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAQnD;AAED,gEAAgE;AAChE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAExF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,YAAY,EACrB,KAAK,CAAC,EAAE,gBAAgB,GACvB,iBAAiB,CAqDnB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAMlE"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
export const EVENT_PHASE_NONE = 0;
|
|
2
|
+
export const EVENT_PHASE_CAPTURING = 1;
|
|
3
|
+
export const EVENT_PHASE_AT_TARGET = 2;
|
|
4
|
+
export const EVENT_PHASE_BUBBLING = 3;
|
|
5
|
+
/**
|
|
6
|
+
* Types that neither bubble nor can be cancelled. Types are compared
|
|
7
|
+
* case-insensitively because native types are camelCase (`mouseEnter`) and DOM
|
|
8
|
+
* names are lowercase (`mouseenter`).
|
|
9
|
+
*/
|
|
10
|
+
const PLAIN_NOTIFICATIONS = new Set([
|
|
11
|
+
"mouseenter",
|
|
12
|
+
"mouseleave",
|
|
13
|
+
"pointerenter",
|
|
14
|
+
"pointerleave",
|
|
15
|
+
"focus",
|
|
16
|
+
"blur",
|
|
17
|
+
"load",
|
|
18
|
+
"error",
|
|
19
|
+
"scroll",
|
|
20
|
+
"did-start-loading",
|
|
21
|
+
"did-stop-loading",
|
|
22
|
+
"did-navigate",
|
|
23
|
+
"page-title-updated",
|
|
24
|
+
"did-fail-load",
|
|
25
|
+
"attach",
|
|
26
|
+
"detach",
|
|
27
|
+
]);
|
|
28
|
+
/**
|
|
29
|
+
* Non-bubbling types an ancestor hears in the capture phase only. Native is told
|
|
30
|
+
* about their capture listeners apart from the bubble ones (see
|
|
31
|
+
* `nativeEventType`), so it can skip the event where no one above is capturing.
|
|
32
|
+
*/
|
|
33
|
+
const ENTER_LEAVE_TYPES = new Set([
|
|
34
|
+
"mouseenter",
|
|
35
|
+
"mouseleave",
|
|
36
|
+
"pointerenter",
|
|
37
|
+
"pointerleave",
|
|
38
|
+
]);
|
|
39
|
+
export function isEnterLeaveType(eventType) {
|
|
40
|
+
return ENTER_LEAVE_TYPES.has(eventType);
|
|
41
|
+
}
|
|
42
|
+
/** Types that do not bubble. Everything else bubbles. `invalid` is cancelable. */
|
|
43
|
+
const NON_BUBBLING_TYPES = new Set([...PLAIN_NOTIFICATIONS, "invalid"]);
|
|
44
|
+
/** `preventDefault()` is a no-op on these, as in the DOM. */
|
|
45
|
+
const NON_CANCELABLE_TYPES = new Set([
|
|
46
|
+
...PLAIN_NOTIFICATIONS,
|
|
47
|
+
"focusin",
|
|
48
|
+
"focusout",
|
|
49
|
+
"pointercancel",
|
|
50
|
+
"gotpointercapture",
|
|
51
|
+
"lostpointercapture",
|
|
52
|
+
"transitionrun",
|
|
53
|
+
"transitionstart",
|
|
54
|
+
"transitionend",
|
|
55
|
+
"transitioncancel",
|
|
56
|
+
"animationstart",
|
|
57
|
+
"animationiteration",
|
|
58
|
+
"animationend",
|
|
59
|
+
"animationcancel",
|
|
60
|
+
"compositionstart",
|
|
61
|
+
"compositionupdate",
|
|
62
|
+
"compositionend",
|
|
63
|
+
"pointerlockchange",
|
|
64
|
+
"pointerlockerror",
|
|
65
|
+
]);
|
|
66
|
+
export function eventBubbles(eventType) {
|
|
67
|
+
return !NON_BUBBLING_TYPES.has(eventType.toLowerCase());
|
|
68
|
+
}
|
|
69
|
+
export function eventIsCancelable(eventType) {
|
|
70
|
+
return !NON_CANCELABLE_TYPES.has(eventType.toLowerCase());
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Key of a capture-phase handler in `EventHandlerMap`: the event type plus
|
|
74
|
+
* `"Capture"`, next to the bubble-phase handler registered under the bare type.
|
|
75
|
+
*/
|
|
76
|
+
export function captureHandlerKey(eventType) {
|
|
77
|
+
return `${eventType}Capture`;
|
|
78
|
+
}
|
|
79
|
+
/** What a form's `submit` event adds: the `FormData` and no submitter button. */
|
|
80
|
+
function formSubmission(entries) {
|
|
81
|
+
const formData = new FormData();
|
|
82
|
+
for (const [name, value] of entries)
|
|
83
|
+
formData.append(name, value);
|
|
84
|
+
return { formData, submitter: null };
|
|
85
|
+
}
|
|
86
|
+
/** The element for `id`, or throws: the root dropped an element native still names. */
|
|
87
|
+
export function requireElement(root, id, eventType) {
|
|
88
|
+
const element = root.elementById(id);
|
|
89
|
+
if (element === undefined) {
|
|
90
|
+
throw new Error(`Event "${eventType}" names element ${id}, which its root does not have.`);
|
|
91
|
+
}
|
|
92
|
+
return element;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The element for an id native may not have sent. `null` for no id, and for an
|
|
96
|
+
* element the root has already dropped: one that left the tree is not the other
|
|
97
|
+
* end of a boundary or focus event any more.
|
|
98
|
+
*/
|
|
99
|
+
export function optionalElement(root, id) {
|
|
100
|
+
if (id == null)
|
|
101
|
+
return null;
|
|
102
|
+
const element = root.elementById(id);
|
|
103
|
+
return element === undefined ? null : element;
|
|
104
|
+
}
|
|
105
|
+
/** The payload as a public event: element ids replaced by the elements they name. */
|
|
106
|
+
export function toRootEvent(root, payload, target) {
|
|
107
|
+
const fields = {
|
|
108
|
+
...payload,
|
|
109
|
+
};
|
|
110
|
+
delete fields.target;
|
|
111
|
+
delete fields.relatedTarget;
|
|
112
|
+
delete fields.path;
|
|
113
|
+
return { ...fields, target, relatedTarget: optionalElement(root, payload.relatedTarget) };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates the event object and the state behind its stop methods. `path` is
|
|
117
|
+
* the propagation path as elements, target first; empty for an event aimed at
|
|
118
|
+
* the window or the document, whose `target` is `pathlessTarget`.
|
|
119
|
+
*/
|
|
120
|
+
export function createDomEvent(root, payload, path, pathlessTarget) {
|
|
121
|
+
const state = { propagationStopped: false, immediatePropagationStopped: false };
|
|
122
|
+
const cancelable = eventIsCancelable(payload.eventType);
|
|
123
|
+
const event = {
|
|
124
|
+
...toRootEvent(root, payload, path[0] ?? pathlessTarget),
|
|
125
|
+
...(payload.formEntries && formSubmission(payload.formEntries)),
|
|
126
|
+
// An edit has no data unless it inserted text, and the DOM says so with null.
|
|
127
|
+
...(payload.eventType === "change" && { data: payload.data ?? null }),
|
|
128
|
+
type: payload.eventType,
|
|
129
|
+
currentTarget: null,
|
|
130
|
+
composedPath: () => [...path],
|
|
131
|
+
eventPhase: EVENT_PHASE_NONE,
|
|
132
|
+
bubbles: eventBubbles(payload.eventType),
|
|
133
|
+
cancelable,
|
|
134
|
+
timeStamp: performance.now(),
|
|
135
|
+
defaultPrevented: false,
|
|
136
|
+
stopPropagation() {
|
|
137
|
+
state.propagationStopped = true;
|
|
138
|
+
},
|
|
139
|
+
stopImmediatePropagation() {
|
|
140
|
+
state.propagationStopped = true;
|
|
141
|
+
state.immediatePropagationStopped = true;
|
|
142
|
+
},
|
|
143
|
+
preventDefault() {
|
|
144
|
+
if (cancelable)
|
|
145
|
+
event.defaultPrevented = true;
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
return { event, state };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* What the DOM does with an exception a listener leaves uncaught: report it to
|
|
152
|
+
* the global error handler without disturbing the dispatch or its caller.
|
|
153
|
+
*/
|
|
154
|
+
export function reportUncaught(error) {
|
|
155
|
+
if (typeof reportError === "function") {
|
|
156
|
+
reportError(error);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
queueMicrotask(() => {
|
|
160
|
+
throw error;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/** Reports the errors a dispatch collected, once it is over. */
|
|
164
|
+
export function reportHandlerErrors(root, errors) {
|
|
165
|
+
errors.forEach(root.reportError ?? reportUncaught);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Runs `payload` through the handlers registered on `root`: capture handlers
|
|
169
|
+
* from the root down to the target, then the target's, then bubble handlers
|
|
170
|
+
* from the target back up, along `payload.path` (target first). Handlers run
|
|
171
|
+
* synchronously. A payload without `path` is handled at `payload.elementId`
|
|
172
|
+
* only. A handler that throws does not end the dispatch: the error goes to
|
|
173
|
+
* `root.reportError` (or the global handler) after the dispatch, and the rest
|
|
174
|
+
* of the handlers run.
|
|
175
|
+
*/
|
|
176
|
+
export function dispatchDomEvent(root, payload, hooks) {
|
|
177
|
+
const path = payload.path ?? [payload.elementId];
|
|
178
|
+
if (path.length === 0) {
|
|
179
|
+
throw new Error(`Event "${payload.eventType}" has an empty propagation path.`);
|
|
180
|
+
}
|
|
181
|
+
const target = path[0];
|
|
182
|
+
if (payload.path && payload.target != null && payload.target !== target) {
|
|
183
|
+
throw new Error(`Event "${payload.eventType}" targets element ${payload.target} but its path starts at ${target}.`);
|
|
184
|
+
}
|
|
185
|
+
const elements = path.map((id) => requireElement(root, id, payload.eventType));
|
|
186
|
+
const { event, state } = createDomEvent(root, payload, elements, null);
|
|
187
|
+
const errors = [];
|
|
188
|
+
const captureKey = captureHandlerKey(payload.eventType);
|
|
189
|
+
const visit = (index, phase, keys) => {
|
|
190
|
+
event.currentTarget = elements[index];
|
|
191
|
+
event.eventPhase = phase;
|
|
192
|
+
const handlers = root.eventHandlers.get(path[index]);
|
|
193
|
+
if (!handlers)
|
|
194
|
+
return;
|
|
195
|
+
for (const key of keys) {
|
|
196
|
+
if (state.immediatePropagationStopped)
|
|
197
|
+
return;
|
|
198
|
+
try {
|
|
199
|
+
handlers.get(key)?.(event);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
errors.push(error);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const fail = (error) => errors.push(error);
|
|
207
|
+
hooks?.beforeCapture?.(event, state, fail);
|
|
208
|
+
for (let index = path.length - 1; index > 0 && !state.propagationStopped; index--) {
|
|
209
|
+
visit(index, EVENT_PHASE_CAPTURING, [captureKey]);
|
|
210
|
+
}
|
|
211
|
+
if (!state.propagationStopped) {
|
|
212
|
+
visit(0, EVENT_PHASE_AT_TARGET, [captureKey, payload.eventType]);
|
|
213
|
+
}
|
|
214
|
+
if (event.bubbles) {
|
|
215
|
+
for (let index = 1; index < path.length && !state.propagationStopped; index++) {
|
|
216
|
+
visit(index, EVENT_PHASE_BUBBLING, [payload.eventType]);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
if (event.bubbles && !state.propagationStopped)
|
|
220
|
+
hooks?.afterBubble?.(event, state, fail);
|
|
221
|
+
event.currentTarget = null;
|
|
222
|
+
event.eventPhase = EVENT_PHASE_NONE;
|
|
223
|
+
reportHandlerErrors(root, errors);
|
|
224
|
+
return {
|
|
225
|
+
defaultPrevented: event.defaultPrevented,
|
|
226
|
+
propagationStopped: state.propagationStopped,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* `event.preventDefault()` for a handler typed with the plain payload. Throws
|
|
231
|
+
* for an event that did not come through `dispatchDomEvent`, where there is no
|
|
232
|
+
* default to cancel.
|
|
233
|
+
*/
|
|
234
|
+
export function preventEventDefault(event) {
|
|
235
|
+
const cancelable = event;
|
|
236
|
+
if (!cancelable.preventDefault) {
|
|
237
|
+
throw new Error(`Event "${event.eventType}" cannot be cancelled: it was not dispatched through the DOM walk.`);
|
|
238
|
+
}
|
|
239
|
+
cancelable.preventDefault();
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../js/events/dispatch.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AACtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AACtC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAA;AAErC;;;;GAIG;AACH,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAC;IACvD,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,OAAO;IACP,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,mBAAmB;IACnB,kBAAkB;IAClB,cAAc;IACd,oBAAoB;IACpB,eAAe;IACf,QAAQ;IACR,QAAQ;CACT,CAAC,CAAA;AAEF;;;;GAIG;AACH,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IACrD,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;CACf,CAAC,CAAA;AAEF,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,kFAAkF;AAClF,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,mBAAmB,EAAE,SAAS,CAAC,CAAC,CAAA;AAE5F,6DAA6D;AAC7D,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC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