winui-svelte 0.0.7 → 0.0.8
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/API.md +565 -19
- package/README.md +21 -5
- package/dist/app/activate.d.ts.map +1 -1
- package/dist/app/activate.js +3 -0
- package/dist/app/activate.js.map +1 -1
- package/dist/app/activation/index.d.ts +3 -0
- package/dist/app/activation/index.d.ts.map +1 -1
- package/dist/app/activation/index.js +2 -0
- package/dist/app/activation/index.js.map +1 -1
- package/dist/app/activation/login.d.ts +2 -1
- package/dist/app/activation/login.d.ts.map +1 -1
- package/dist/app/activation/login.js +2 -1
- package/dist/app/activation/login.js.map +1 -1
- package/dist/app/activation/native.js +1 -2
- package/dist/app/activation/native.js.map +1 -1
- package/dist/app/activation/packaged.d.ts +49 -0
- package/dist/app/activation/packaged.d.ts.map +1 -0
- package/dist/app/activation/packaged.js +90 -0
- package/dist/app/activation/packaged.js.map +1 -0
- package/dist/app/activation/receive.d.ts +11 -2
- package/dist/app/activation/receive.d.ts.map +1 -1
- package/dist/app/activation/receive.js +11 -4
- package/dist/app/activation/receive.js.map +1 -1
- package/dist/app/activation/registration.d.ts +3 -3
- package/dist/app/activation/registration.js +7 -7
- package/dist/app/activation/registration.js.map +1 -1
- package/dist/app/activation/scheme.d.ts +10 -0
- package/dist/app/activation/scheme.d.ts.map +1 -1
- package/dist/app/activation/scheme.js +17 -0
- package/dist/app/activation/scheme.js.map +1 -1
- package/dist/app/index.d.ts +4 -2
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +3 -1
- package/dist/app/index.js.map +1 -1
- package/dist/app/instance-running.d.ts +15 -0
- package/dist/app/instance-running.d.ts.map +1 -0
- package/dist/app/instance-running.js +20 -0
- package/dist/app/instance-running.js.map +1 -0
- package/dist/app/jump-list/native.d.ts.map +1 -1
- package/dist/app/jump-list/native.js +1 -2
- package/dist/app/jump-list/native.js.map +1 -1
- package/dist/app/native-messaging/browsers.d.ts +19 -0
- package/dist/app/native-messaging/browsers.d.ts.map +1 -0
- package/dist/app/native-messaging/browsers.js +17 -0
- package/dist/app/native-messaging/browsers.js.map +1 -0
- package/dist/app/native-messaging/index.d.ts +41 -0
- package/dist/app/native-messaging/index.d.ts.map +1 -0
- package/dist/app/native-messaging/index.js +84 -0
- package/dist/app/native-messaging/index.js.map +1 -0
- package/dist/app/native.d.ts +0 -6
- package/dist/app/native.d.ts.map +1 -1
- package/dist/app/native.js +1 -24
- package/dist/app/native.js.map +1 -1
- package/dist/app/notification-source.d.ts.map +1 -1
- package/dist/app/notification-source.js +1 -2
- package/dist/app/notification-source.js.map +1 -1
- package/dist/app/shell/native.js +1 -2
- package/dist/app/shell/native.js.map +1 -1
- package/dist/app/single-instance.d.ts +27 -1
- package/dist/app/single-instance.d.ts.map +1 -1
- package/dist/app/single-instance.js +32 -10
- package/dist/app/single-instance.js.map +1 -1
- package/dist/automation/native.d.ts.map +1 -1
- package/dist/automation/native.js +1 -2
- package/dist/automation/native.js.map +1 -1
- package/dist/bindings/.dynwinrt-js-types +198 -0
- package/dist/bindings/.dynwinrt-managed +1 -1
- package/dist/bindings/index.d.ts +15 -0
- package/dist/bindings/index.js +20 -0
- package/dist/bindings/index.mjs +2902 -2882
- package/dist/bindings/index.proxy.js +10 -0
- package/dist/bindings/windows/application-model/activation/ActivationKind.d.ts +49 -0
- package/dist/bindings/windows/application-model/activation/ActivationKind.js +50 -0
- package/dist/bindings/windows/application-model/activation/ApplicationExecutionState.d.ts +9 -0
- package/dist/bindings/windows/application-model/activation/ApplicationExecutionState.js +10 -0
- package/dist/bindings/windows/application-model/activation/IActivatedEventArgs.d.ts +36 -0
- package/dist/bindings/windows/application-model/activation/IActivatedEventArgs.js +149 -0
- package/dist/bindings/windows/application-model/activation/IActivatedEventArgsWithUser.d.ts +28 -0
- package/dist/bindings/windows/application-model/activation/IActivatedEventArgsWithUser.js +119 -0
- package/dist/bindings/windows/application-model/activation/IApplicationViewActivatedEventArgs.d.ts +27 -0
- package/dist/bindings/windows/application-model/activation/IApplicationViewActivatedEventArgs.js +116 -0
- package/dist/bindings/windows/application-model/activation/IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData.d.ts +31 -0
- package/dist/bindings/windows/application-model/activation/IProtocolActivatedEventArgsWithCallerPackageFamilyNameAndData.js +131 -0
- package/dist/bindings/windows/application-model/activation/IViewSwitcherProvider.d.ts +28 -0
- package/dist/bindings/windows/application-model/activation/IViewSwitcherProvider.js +119 -0
- package/dist/bindings/windows/application-model/activation/ProtocolActivatedEventArgs.d.ts +25 -0
- package/dist/bindings/windows/application-model/activation/ProtocolActivatedEventArgs.js +166 -0
- package/dist/bindings/windows/application-model/activation/SplashScreen.d.ts +35 -0
- package/dist/bindings/windows/application-model/activation/SplashScreen.js +105 -0
- package/dist/bindings/windows/foundation/TypedEventHandler_WindowsApplicationModelActivationSplashScreen_Object_g7a7dbfa699cd28ff.d.ts +7 -0
- package/dist/bindings/windows/foundation/TypedEventHandler_WindowsApplicationModelActivationSplashScreen_Object_g7a7dbfa699cd28ff.js +7 -0
- package/dist/bindings/windows/ui/view-management/ActivationViewSwitcher.d.ts +12 -0
- package/dist/bindings/windows/ui/view-management/ActivationViewSwitcher.js +96 -0
- package/dist/chrome/context-menus/context-menu-schema.d.ts.map +1 -1
- package/dist/chrome/context-menus/context-menu-schema.js +1 -7
- package/dist/chrome/context-menus/context-menu-schema.js.map +1 -1
- package/dist/chrome/parse-or-throw.d.ts +7 -0
- package/dist/chrome/parse-or-throw.d.ts.map +1 -0
- package/dist/chrome/parse-or-throw.js +9 -0
- package/dist/chrome/parse-or-throw.js.map +1 -0
- package/dist/chrome/permissions/permission-schema.d.ts.map +1 -1
- package/dist/chrome/permissions/permission-schema.js +1 -7
- package/dist/chrome/permissions/permission-schema.js.map +1 -1
- package/dist/chrome/windows/chrome-windows.d.ts.map +1 -1
- package/dist/chrome/windows/chrome-windows.js +1 -7
- package/dist/chrome/windows/chrome-windows.js.map +1 -1
- package/dist/components/hand-written/items/keyed-rows.svelte.d.ts.map +1 -1
- package/dist/components/hand-written/items/keyed-rows.svelte.js +6 -0
- package/dist/components/hand-written/items/keyed-rows.svelte.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/runtime.svelte.d.ts.map +1 -1
- package/dist/components/runtime.svelte.js +7 -0
- package/dist/components/runtime.svelte.js.map +1 -1
- package/dist/composition/expression.d.ts +1 -1
- package/dist/css/runtime/containers.d.ts.map +1 -1
- package/dist/css/runtime/containers.js +1 -17
- package/dist/css/runtime/containers.js.map +1 -1
- package/dist/css/runtime/native.d.ts.map +1 -1
- package/dist/css/runtime/native.js +40 -20
- package/dist/css/runtime/native.js.map +1 -1
- package/dist/css/translate/property-kit.d.ts +9 -0
- package/dist/css/translate/property-kit.d.ts.map +1 -1
- package/dist/css/translate/property-kit.js.map +1 -1
- package/dist/css/translate/transition-properties.d.ts +1 -1
- package/dist/css/translate/transition-properties.d.ts.map +1 -1
- package/dist/css/translate/transition-properties.js +32 -5
- package/dist/css/translate/transition-properties.js.map +1 -1
- package/dist/data-transfer/data-transfer.d.ts +3 -3
- package/dist/data-transfer/data-transfer.d.ts.map +1 -1
- package/dist/data-transfer/data-transfer.js.map +1 -1
- package/dist/data-transfer/drag-effects.d.ts +25 -2
- package/dist/data-transfer/drag-effects.d.ts.map +1 -1
- package/dist/data-transfer/drag-effects.js +27 -2
- package/dist/data-transfer/drag-effects.js.map +1 -1
- package/dist/data-transfer/drag-helper.d.ts +50 -0
- package/dist/data-transfer/drag-helper.d.ts.map +1 -0
- package/dist/data-transfer/drag-helper.js +156 -0
- package/dist/data-transfer/drag-helper.js.map +1 -0
- package/dist/data-transfer/drop-target.d.ts +6 -5
- package/dist/data-transfer/drop-target.d.ts.map +1 -1
- package/dist/data-transfer/drop-target.js +68 -20
- package/dist/data-transfer/drop-target.js.map +1 -1
- package/dist/data-transfer/index.d.ts +1 -0
- package/dist/data-transfer/index.d.ts.map +1 -1
- package/dist/data-transfer/index.js.map +1 -1
- package/dist/data-transfer/launcher.d.ts +4 -3
- package/dist/data-transfer/launcher.d.ts.map +1 -1
- package/dist/data-transfer/launcher.js +58 -9
- package/dist/data-transfer/launcher.js.map +1 -1
- package/dist/data-transfer/native.d.ts +66 -0
- package/dist/data-transfer/native.d.ts.map +1 -0
- package/dist/data-transfer/native.js +148 -0
- package/dist/data-transfer/native.js.map +1 -0
- package/dist/data-transfer/ole-data-object.d.ts +62 -0
- package/dist/data-transfer/ole-data-object.d.ts.map +1 -0
- package/dist/data-transfer/ole-data-object.js +162 -0
- package/dist/data-transfer/ole-data-object.js.map +1 -0
- package/dist/data-transfer/ole-drop-target.d.ts +54 -0
- package/dist/data-transfer/ole-drop-target.d.ts.map +1 -0
- package/dist/data-transfer/ole-drop-target.js +192 -0
- package/dist/data-transfer/ole-drop-target.js.map +1 -0
- package/dist/data-transfer/share-interop.d.ts.map +1 -1
- package/dist/data-transfer/share-interop.js +1 -1
- package/dist/data-transfer/share-interop.js.map +1 -1
- package/dist/data-transfer/shell-items.d.ts +10 -0
- package/dist/data-transfer/shell-items.d.ts.map +1 -0
- package/dist/data-transfer/shell-items.js +67 -0
- package/dist/data-transfer/shell-items.js.map +1 -0
- package/dist/data-transfer/window-drop.d.ts +35 -0
- package/dist/data-transfer/window-drop.d.ts.map +1 -0
- package/dist/data-transfer/window-drop.js +311 -0
- package/dist/data-transfer/window-drop.js.map +1 -0
- package/dist/devices/native.js +1 -2
- package/dist/devices/native.js.map +1 -1
- package/dist/enums.d.ts +3 -0
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +3 -0
- package/dist/enums.js.map +1 -1
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.d.ts.map +1 -1
- package/dist/input/index.js +1 -0
- package/dist/input/index.js.map +1 -1
- package/dist/input/modifier-keys.d.ts +24 -0
- package/dist/input/modifier-keys.d.ts.map +1 -0
- package/dist/input/modifier-keys.js +20 -0
- package/dist/input/modifier-keys.js.map +1 -0
- package/dist/media/pixel-buffer.d.ts.map +1 -1
- package/dist/media/pixel-buffer.js +1 -1
- package/dist/media/pixel-buffer.js.map +1 -1
- package/dist/messaging/web-view2/core.d.ts +56 -0
- package/dist/messaging/web-view2/core.d.ts.map +1 -1
- package/dist/messaging/web-view2/core.js +6 -0
- package/dist/messaging/web-view2/core.js.map +1 -1
- package/dist/messaging/web-view2/environment.d.ts +41 -0
- package/dist/messaging/web-view2/environment.d.ts.map +1 -0
- package/dist/messaging/web-view2/environment.js +91 -0
- package/dist/messaging/web-view2/environment.js.map +1 -0
- package/dist/messaging/web-view2/index.d.ts +9 -1
- package/dist/messaging/web-view2/index.d.ts.map +1 -1
- package/dist/messaging/web-view2/index.js +5 -0
- package/dist/messaging/web-view2/index.js.map +1 -1
- package/dist/messaging/web-view2/input.d.ts +68 -0
- package/dist/messaging/web-view2/input.d.ts.map +1 -0
- package/dist/messaging/web-view2/input.js +108 -0
- package/dist/messaging/web-view2/input.js.map +1 -0
- package/dist/messaging/web-view2/protocol.d.ts +24 -0
- package/dist/messaging/web-view2/protocol.d.ts.map +1 -0
- package/dist/messaging/web-view2/protocol.js +31 -0
- package/dist/messaging/web-view2/protocol.js.map +1 -0
- package/dist/messaging/web-view2/recovery.d.ts +65 -0
- package/dist/messaging/web-view2/recovery.d.ts.map +1 -0
- package/dist/messaging/web-view2/recovery.js +138 -0
- package/dist/messaging/web-view2/recovery.js.map +1 -0
- package/dist/messaging/web-view2/requests.d.ts +88 -0
- package/dist/messaging/web-view2/requests.d.ts.map +1 -0
- package/dist/messaging/web-view2/requests.js +169 -0
- package/dist/messaging/web-view2/requests.js.map +1 -0
- package/dist/messaging/web-view2/transport.d.ts.map +1 -1
- package/dist/messaging/web-view2/transport.js +1 -4
- package/dist/messaging/web-view2/transport.js.map +1 -1
- package/dist/native-identity.d.ts +10 -0
- package/dist/native-identity.d.ts.map +1 -0
- package/dist/native-identity.js +20 -0
- package/dist/native-identity.js.map +1 -0
- package/dist/renderer/host/host.d.ts.map +1 -1
- package/dist/renderer/host/host.js +33 -16
- package/dist/renderer/host/host.js.map +1 -1
- package/dist/renderer/host/structure-sync.d.ts +9 -0
- package/dist/renderer/host/structure-sync.d.ts.map +1 -0
- package/dist/renderer/host/structure-sync.js +24 -0
- package/dist/renderer/host/structure-sync.js.map +1 -0
- package/dist/security/data-protection-error.d.ts +14 -0
- package/dist/security/data-protection-error.d.ts.map +1 -0
- package/dist/security/data-protection-error.js +15 -0
- package/dist/security/data-protection-error.js.map +1 -0
- package/dist/security/index.d.ts +48 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +32 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/native.d.ts +43 -0
- package/dist/security/native.d.ts.map +1 -0
- package/dist/security/native.js +170 -0
- package/dist/security/native.js.map +1 -0
- package/dist/security/protection-scope.d.ts +13 -0
- package/dist/security/protection-scope.d.ts.map +1 -0
- package/dist/security/protection-scope.js +11 -0
- package/dist/security/protection-scope.js.map +1 -0
- package/dist/store/states.d.ts +2 -2
- package/dist/store/windows-identity.d.ts +2 -6
- package/dist/store/windows-identity.d.ts.map +1 -1
- package/dist/store/windows-identity.js +2 -29
- package/dist/store/windows-identity.js.map +1 -1
- package/dist/store/windows-packages.d.ts +2 -2
- package/dist/store/windows-store.d.ts +2 -2
- package/dist/tray/click-detector.d.ts.map +1 -1
- package/dist/tray/click-detector.js.map +1 -1
- package/dist/tray/flyout-model.d.ts +4 -3
- package/dist/tray/flyout-model.d.ts.map +1 -1
- package/dist/tray/flyout-model.js +12 -2
- package/dist/tray/flyout-model.js.map +1 -1
- package/dist/tray/menu/icon.d.ts +17 -0
- package/dist/tray/menu/icon.d.ts.map +1 -0
- package/dist/tray/menu/icon.js +31 -0
- package/dist/tray/menu/icon.js.map +1 -0
- package/dist/tray/menu/index.d.ts +1 -1
- package/dist/tray/menu/index.d.ts.map +1 -1
- package/dist/tray/menu/index.js.map +1 -1
- package/dist/tray/menu/types.d.ts +23 -6
- package/dist/tray/menu/types.d.ts.map +1 -1
- package/dist/tray/menu/types.js.map +1 -1
- package/dist/tray/menu-svelte/menu-node.d.ts +4 -4
- package/dist/tray/native.d.ts +9 -4
- package/dist/tray/native.d.ts.map +1 -1
- package/dist/tray/native.js +10 -18
- package/dist/tray/native.js.map +1 -1
- package/dist/tray/personalize.d.ts +18 -0
- package/dist/tray/personalize.d.ts.map +1 -0
- package/dist/tray/personalize.js +42 -0
- package/dist/tray/personalize.js.map +1 -0
- package/dist/tray/standalone/icon-raster.d.ts +72 -0
- package/dist/tray/standalone/icon-raster.d.ts.map +1 -0
- package/dist/tray/standalone/icon-raster.js +161 -0
- package/dist/tray/standalone/icon-raster.js.map +1 -0
- package/dist/tray/standalone/index.d.ts +3 -2
- package/dist/tray/standalone/index.d.ts.map +1 -1
- package/dist/tray/standalone/index.js +1 -0
- package/dist/tray/standalone/index.js.map +1 -1
- package/dist/tray/standalone/menu-icons.d.ts +9 -0
- package/dist/tray/standalone/menu-icons.d.ts.map +1 -0
- package/dist/tray/standalone/menu-icons.js +280 -0
- package/dist/tray/standalone/menu-icons.js.map +1 -0
- package/dist/tray/standalone/native.d.ts +19 -6
- package/dist/tray/standalone/native.d.ts.map +1 -1
- package/dist/tray/standalone/native.js +58 -15
- package/dist/tray/standalone/native.js.map +1 -1
- package/dist/tray/standalone/standalone-tray.d.ts +4 -2
- package/dist/tray/standalone/standalone-tray.d.ts.map +1 -1
- package/dist/tray/standalone/standalone-tray.js +12 -2
- package/dist/tray/standalone/standalone-tray.js.map +1 -1
- package/dist/tray/themed-icon.d.ts.map +1 -1
- package/dist/tray/themed-icon.js +4 -28
- package/dist/tray/themed-icon.js.map +1 -1
- package/dist/tray/tray-core.d.ts.map +1 -1
- package/dist/tray/tray-core.js +5 -1
- package/dist/tray/tray-core.js.map +1 -1
- package/dist/tray/tray-extras.d.ts +26 -2
- package/dist/tray/tray-extras.d.ts.map +1 -1
- package/dist/web-apis/eye-dropper.d.ts.map +1 -1
- package/dist/web-apis/eye-dropper.js +8 -5
- package/dist/web-apis/eye-dropper.js.map +1 -1
- package/dist/web-apis/media-devices-source.d.ts +1 -1
- package/dist/web-apis/native.d.ts +0 -7
- package/dist/web-apis/native.d.ts.map +1 -1
- package/dist/web-apis/native.js +0 -19
- package/dist/web-apis/native.js.map +1 -1
- package/dist/win2d/activation-failure.d.ts +10 -0
- package/dist/win2d/activation-failure.d.ts.map +1 -0
- package/dist/win2d/activation-failure.js +30 -0
- package/dist/win2d/activation-failure.js.map +1 -0
- package/dist/win2d/element-lifecycle.d.ts.map +1 -1
- package/dist/win2d/element-lifecycle.js +6 -1
- package/dist/win2d/element-lifecycle.js.map +1 -1
- package/dist/win2d/manifest.d.ts +29 -0
- package/dist/win2d/manifest.d.ts.map +1 -0
- package/dist/win2d/manifest.js +67 -0
- package/dist/win2d/manifest.js.map +1 -0
- package/dist/win32/index.d.ts +3 -0
- package/dist/win32/index.d.ts.map +1 -0
- package/dist/win32/index.js +11 -0
- package/dist/win32/index.js.map +1 -0
- package/dist/win32-calls.d.ts +6 -0
- package/dist/win32-calls.d.ts.map +1 -1
- package/dist/win32-calls.js +6 -1
- package/dist/win32-calls.js.map +1 -1
- package/dist/win32-foreground.d.ts +20 -0
- package/dist/win32-foreground.d.ts.map +1 -1
- package/dist/win32-foreground.js +24 -4
- package/dist/win32-foreground.js.map +1 -1
- package/dist/win32-icons.d.ts.map +1 -1
- package/dist/win32-icons.js +1 -2
- package/dist/win32-icons.js.map +1 -1
- package/dist/win32-key-state.d.ts +31 -0
- package/dist/win32-key-state.d.ts.map +1 -0
- package/dist/win32-key-state.js +41 -0
- package/dist/win32-key-state.js.map +1 -0
- package/dist/window/anchor.d.ts +15 -0
- package/dist/window/anchor.d.ts.map +1 -1
- package/dist/window/anchor.js +23 -0
- package/dist/window/anchor.js.map +1 -1
- package/dist/window/apply-frame.d.ts +4 -2
- package/dist/window/apply-frame.d.ts.map +1 -1
- package/dist/window/apply-frame.js +2 -3
- package/dist/window/apply-frame.js.map +1 -1
- package/dist/window/bootstrap-core.d.ts +69 -0
- package/dist/window/bootstrap-core.d.ts.map +1 -0
- package/dist/window/bootstrap-core.js +93 -0
- package/dist/window/bootstrap-core.js.map +1 -0
- package/dist/window/bootstrap-mode.d.ts +21 -0
- package/dist/window/bootstrap-mode.d.ts.map +1 -0
- package/dist/window/bootstrap-mode.js +17 -0
- package/dist/window/bootstrap-mode.js.map +1 -0
- package/dist/window/bootstrap.d.ts +12 -28
- package/dist/window/bootstrap.d.ts.map +1 -1
- package/dist/window/bootstrap.js +18 -66
- package/dist/window/bootstrap.js.map +1 -1
- package/dist/window/cover.d.ts +43 -0
- package/dist/window/cover.d.ts.map +1 -0
- package/dist/window/cover.js +64 -0
- package/dist/window/cover.js.map +1 -0
- package/dist/window/create-window.d.ts +1 -1
- package/dist/window/create-window.d.ts.map +1 -1
- package/dist/window/create-window.js +1 -0
- package/dist/window/create-window.js.map +1 -1
- package/dist/window/dpi-awareness.d.ts +71 -0
- package/dist/window/dpi-awareness.d.ts.map +1 -0
- package/dist/window/dpi-awareness.js +127 -0
- package/dist/window/dpi-awareness.js.map +1 -0
- package/dist/window/foreground-native.d.ts.map +1 -1
- package/dist/window/foreground-native.js +3 -5
- package/dist/window/foreground-native.js.map +1 -1
- package/dist/window/index.d.ts +2 -0
- package/dist/window/index.d.ts.map +1 -1
- package/dist/window/index.js +1 -0
- package/dist/window/index.js.map +1 -1
- package/dist/window/native.d.ts.map +1 -1
- package/dist/window/native.js +1 -2
- package/dist/window/native.js.map +1 -1
- package/dist/window/package-identity.d.ts +17 -0
- package/dist/window/package-identity.d.ts.map +1 -0
- package/dist/window/package-identity.js +97 -0
- package/dist/window/package-identity.js.map +1 -0
- package/dist/window/system-dispatcher-queue.d.ts.map +1 -1
- package/dist/window/system-dispatcher-queue.js +1 -2
- package/dist/window/system-dispatcher-queue.js.map +1 -1
- package/dist/window/taskbar-calls.d.ts +1 -1
- package/dist/window/taskbar-native.d.ts.map +1 -1
- package/dist/window/taskbar-native.js +1 -2
- package/dist/window/taskbar-native.js.map +1 -1
- package/dist/window/window-handle.d.ts +25 -1
- package/dist/window/window-handle.d.ts.map +1 -1
- package/dist/window/window-handle.js +27 -1
- package/dist/window/window-handle.js.map +1 -1
- package/dist/window/window-host.svelte.d.ts +10 -1
- package/dist/window/window-host.svelte.d.ts.map +1 -1
- package/dist/window/window-host.svelte.js +38 -4
- package/dist/window/window-host.svelte.js.map +1 -1
- package/package.json +26 -4
- package/src/app/activate.ts +3 -0
- package/src/app/activation/index.ts +3 -0
- package/src/app/activation/login.ts +2 -1
- package/src/app/activation/native.ts +1 -1
- package/src/app/activation/packaged.ts +118 -0
- package/src/app/activation/receive.ts +24 -4
- package/src/app/activation/registration.ts +7 -7
- package/src/app/activation/scheme.ts +19 -0
- package/src/app/index.ts +4 -2
- package/src/app/instance-running.ts +22 -0
- package/src/app/jump-list/native.ts +1 -2
- package/src/app/native-messaging/browsers.ts +21 -0
- package/src/app/native-messaging/index.ts +124 -0
- package/src/app/native.ts +1 -32
- package/src/app/notification-source.ts +1 -3
- package/src/app/shell/native.ts +1 -1
- package/src/app/single-instance.ts +34 -10
- package/src/automation/native.ts +1 -2
- package/src/chrome/context-menus/context-menu-schema.ts +1 -12
- package/src/chrome/parse-or-throw.ts +14 -0
- package/src/chrome/permissions/permission-schema.ts +1 -12
- package/src/chrome/windows/chrome-windows.ts +1 -13
- package/src/components/hand-written/items/keyed-rows.svelte.ts +6 -0
- package/src/components/index.ts +1 -0
- package/src/components/runtime.svelte.ts +8 -0
- package/src/css/runtime/containers.ts +1 -20
- package/src/css/runtime/native.ts +46 -21
- package/src/css/translate/property-kit.ts +9 -0
- package/src/css/translate/transition-properties.ts +44 -10
- package/src/data-transfer/data-transfer.ts +3 -3
- package/src/data-transfer/drag-effects.ts +48 -4
- package/src/data-transfer/drag-helper.ts +216 -0
- package/src/data-transfer/drop-target.ts +90 -26
- package/src/data-transfer/index.ts +1 -0
- package/src/data-transfer/launcher.ts +65 -9
- package/src/data-transfer/native.ts +184 -0
- package/src/data-transfer/ole-data-object.ts +200 -0
- package/src/data-transfer/ole-drop-target.ts +263 -0
- package/src/data-transfer/share-interop.ts +1 -1
- package/src/data-transfer/shell-items.ts +81 -0
- package/src/data-transfer/window-drop.ts +411 -0
- package/src/devices/native.ts +1 -1
- package/src/enums.ts +3 -0
- package/src/input/index.ts +2 -0
- package/src/input/modifier-keys.ts +30 -0
- package/src/media/pixel-buffer.ts +1 -1
- package/src/messaging/web-view2/core.ts +64 -0
- package/src/messaging/web-view2/environment.ts +131 -0
- package/src/messaging/web-view2/index.ts +11 -0
- package/src/messaging/web-view2/input.ts +154 -0
- package/src/messaging/web-view2/protocol.ts +41 -0
- package/src/messaging/web-view2/recovery.ts +177 -0
- package/src/messaging/web-view2/requests.ts +238 -0
- package/src/messaging/web-view2/transport.ts +1 -5
- package/src/native-identity.ts +22 -0
- package/src/renderer/host/host.ts +39 -17
- package/src/renderer/host/structure-sync.ts +25 -0
- package/src/security/data-protection-error.ts +18 -0
- package/src/security/index.ts +57 -0
- package/src/security/native.ts +234 -0
- package/src/security/protection-scope.ts +13 -0
- package/src/store/windows-identity.ts +3 -35
- package/src/tray/click-detector.ts +6 -7
- package/src/tray/flyout-model.ts +14 -3
- package/src/tray/menu/icon.ts +40 -0
- package/src/tray/menu/index.ts +3 -0
- package/src/tray/menu/types.ts +27 -6
- package/src/tray/native.ts +20 -21
- package/src/tray/personalize.ts +57 -0
- package/src/tray/pointer-share.ts +3 -3
- package/src/tray/standalone/icon-raster.ts +208 -0
- package/src/tray/standalone/index.ts +4 -1
- package/src/tray/standalone/menu-icons.ts +317 -0
- package/src/tray/standalone/native.ts +78 -15
- package/src/tray/standalone/standalone-tray.ts +26 -5
- package/src/tray/themed-icon.ts +4 -36
- package/src/tray/tray-core.ts +6 -1
- package/src/tray/tray-extras.ts +31 -2
- package/src/web-apis/eye-dropper.ts +9 -5
- package/src/web-apis/native.ts +0 -20
- package/src/win2d/activation-failure.ts +35 -0
- package/src/win2d/element-lifecycle.ts +6 -1
- package/src/win2d/manifest.ts +78 -0
- package/src/win32/index.ts +19 -0
- package/src/win32-calls.ts +8 -1
- package/src/win32-foreground.ts +28 -4
- package/src/win32-icons.ts +7 -2
- package/src/win32-key-state.ts +48 -0
- package/src/window/anchor.ts +28 -0
- package/src/window/apply-frame.ts +6 -4
- package/src/window/bootstrap-core.ts +165 -0
- package/src/window/bootstrap-mode.ts +23 -0
- package/src/window/bootstrap.ts +20 -103
- package/src/window/cover.ts +100 -0
- package/src/window/create-window.ts +2 -0
- package/src/window/dpi-awareness.ts +162 -0
- package/src/window/foreground-native.ts +3 -5
- package/src/window/index.ts +2 -0
- package/src/window/native.ts +1 -1
- package/src/window/package-identity.ts +112 -0
- package/src/window/system-dispatcher-queue.ts +7 -2
- package/src/window/taskbar-native.ts +1 -2
- package/src/window/window-handle.ts +29 -1
- package/src/window/window-host.svelte.ts +58 -5
- package/web-types.json +11 -3
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import type { DragFeedback, Position } from "./drag-event.ts";
|
|
2
|
+
import type { DropArgs } from "./drop-target.ts";
|
|
3
|
+
import { clientPointOf } from "./native.ts";
|
|
4
|
+
import { copyOf, readerOf, sourceOfReader } from "./ole-data-object.ts";
|
|
5
|
+
import type { OleDataCall, OleDragCall, OleDropHandler, OleEffect } from "./ole-drop-target.ts";
|
|
6
|
+
import { registerOleDropTarget } from "./ole-drop-target.ts";
|
|
7
|
+
import { identityOf } from "#src/native-identity.js";
|
|
8
|
+
import { projectAs } from "#winui/lifetime";
|
|
9
|
+
import type { WindowId } from "#winui/microsoft/ui/windowing/AppWindow";
|
|
10
|
+
import { AppWindow } from "#winui/microsoft/ui/windowing/AppWindow";
|
|
11
|
+
import { VisualTreeHelper } from "#winui/microsoft/ui/xaml/media/VisualTreeHelper";
|
|
12
|
+
import { UIElement } from "#winui/microsoft/ui/xaml/UIElement";
|
|
13
|
+
import { DragDropModifiers } from "#winui/windows/application-model/data-transfer/drag-drop/DragDropModifiers";
|
|
14
|
+
|
|
15
|
+
// A drag from another app reaches the window as OLE calls (ole-drop-target.ts);
|
|
16
|
+
// WinUI's own drop events never fire for it. This routes each call the way
|
|
17
|
+
// WinUI routes a drag it does receive: the element under the cursor, then the
|
|
18
|
+
// nearest ancestor that is a drop zone answers, and a point outside every zone
|
|
19
|
+
// answers "no drop" (the forbidden sign).
|
|
20
|
+
|
|
21
|
+
const MK_SHIFT = 0x4;
|
|
22
|
+
const MK_CONTROL = 0x8;
|
|
23
|
+
const MK_ALT = 0x20;
|
|
24
|
+
const MK_LBUTTON = 0x1;
|
|
25
|
+
const MK_RBUTTON = 0x2;
|
|
26
|
+
const MK_MBUTTON = 0x10;
|
|
27
|
+
const NO_EFFECT = 0;
|
|
28
|
+
const FALLBACK_SCALE = 1;
|
|
29
|
+
const HIT_SIZE = 1;
|
|
30
|
+
|
|
31
|
+
/** What a drop zone answers the window's drags with: the calls of its binding. */
|
|
32
|
+
export interface WindowZone {
|
|
33
|
+
enter(args: DropArgs): void;
|
|
34
|
+
over(args: DropArgs): void;
|
|
35
|
+
leave(args: DropArgs): void;
|
|
36
|
+
drop(args: DropArgs): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The part of a control's XamlRoot the window needs. */
|
|
40
|
+
export interface WindowRoot {
|
|
41
|
+
readonly content: object | null;
|
|
42
|
+
readonly rasterizationScale?: number;
|
|
43
|
+
readonly contentIslandEnvironment?: {
|
|
44
|
+
readonly appWindowId: WindowId;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The part of a control that tells which window it is in. */
|
|
49
|
+
export interface WindowControl {
|
|
50
|
+
readonly xamlRoot?: WindowRoot | null;
|
|
51
|
+
onLoaded?(callback: () => void): () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface Entry {
|
|
55
|
+
readonly control: WindowControl;
|
|
56
|
+
readonly zone: WindowZone;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface OpenDrag {
|
|
60
|
+
reader: ReturnType<typeof readerOf>;
|
|
61
|
+
allowedEffects: OleEffect;
|
|
62
|
+
entry: Entry | null;
|
|
63
|
+
effect: OleEffect;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
class WindowDrop implements OleDropHandler {
|
|
67
|
+
readonly entries = new Map<unknown, Entry>();
|
|
68
|
+
private revoke: (() => void) | null = null;
|
|
69
|
+
private drag: OpenDrag | null = null;
|
|
70
|
+
private stopDestroying: (() => void) | null = null;
|
|
71
|
+
private readonly hwnd: bigint;
|
|
72
|
+
private readonly root: WindowRoot;
|
|
73
|
+
private readonly windowId: WindowId;
|
|
74
|
+
|
|
75
|
+
constructor({ windowId, root }: {
|
|
76
|
+
windowId: WindowId;
|
|
77
|
+
root: WindowRoot;
|
|
78
|
+
}) {
|
|
79
|
+
this.windowId = windowId;
|
|
80
|
+
this.hwnd = windowId.value;
|
|
81
|
+
this.root = root;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Revoked with the window: a target still registered when it goes down is a leak.
|
|
85
|
+
start() {
|
|
86
|
+
this.revoke = registerOleDropTarget({
|
|
87
|
+
hwnd: this.hwnd,
|
|
88
|
+
handler: this
|
|
89
|
+
});
|
|
90
|
+
this.stopDestroying = AppWindow.getFromWindowId(this.windowId).onDestroying(() => this.stop());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
stop() {
|
|
94
|
+
this.revoke?.();
|
|
95
|
+
this.revoke = null;
|
|
96
|
+
this.stopDestroying?.();
|
|
97
|
+
this.stopDestroying = null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
enter(call: OleDataCall) {
|
|
101
|
+
this.drag = {
|
|
102
|
+
reader: readerOf(call.data),
|
|
103
|
+
allowedEffects: call.allowedEffects,
|
|
104
|
+
entry: null,
|
|
105
|
+
effect: NO_EFFECT
|
|
106
|
+
};
|
|
107
|
+
return this.route({
|
|
108
|
+
call,
|
|
109
|
+
isEntering: true
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
over(call: OleDragCall) {
|
|
114
|
+
return this.route({
|
|
115
|
+
call,
|
|
116
|
+
isEntering: false
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
leave() {
|
|
121
|
+
const { drag } = this;
|
|
122
|
+
this.drag = null;
|
|
123
|
+
|
|
124
|
+
if (drag?.entry) {
|
|
125
|
+
drag.entry.zone.leave(
|
|
126
|
+
this.argsOf({
|
|
127
|
+
drag,
|
|
128
|
+
call: null
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
drop(call: OleDataCall) {
|
|
135
|
+
const { drag } = this;
|
|
136
|
+
this.drag = null;
|
|
137
|
+
const hasZone = drag?.entry != null;
|
|
138
|
+
if (!hasZone) {
|
|
139
|
+
return NO_EFFECT;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const frozen = {
|
|
143
|
+
...drag,
|
|
144
|
+
reader: copyOf(readerOf(call.data))
|
|
145
|
+
};
|
|
146
|
+
const args = this.argsOf({
|
|
147
|
+
drag: frozen,
|
|
148
|
+
call
|
|
149
|
+
});
|
|
150
|
+
drag.entry?.zone.drop(args).catch(reportError);
|
|
151
|
+
return drag.effect;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
private route({ call, isEntering }: {
|
|
155
|
+
call: OleDragCall;
|
|
156
|
+
isEntering: boolean;
|
|
157
|
+
}) {
|
|
158
|
+
const { drag } = this;
|
|
159
|
+
if (!drag) {
|
|
160
|
+
return NO_EFFECT;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const found = this.zoneAt(call.point);
|
|
164
|
+
const hasChanged = found !== drag.entry;
|
|
165
|
+
const isLeavingZone = hasChanged && drag.entry !== null;
|
|
166
|
+
if (isLeavingZone) {
|
|
167
|
+
drag.entry?.zone.leave(
|
|
168
|
+
this.argsOf({
|
|
169
|
+
drag,
|
|
170
|
+
call
|
|
171
|
+
})
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
drag.entry = found;
|
|
176
|
+
|
|
177
|
+
if (!found) {
|
|
178
|
+
drag.effect = NO_EFFECT;
|
|
179
|
+
return NO_EFFECT;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const args = this.argsOf({
|
|
183
|
+
drag,
|
|
184
|
+
call
|
|
185
|
+
});
|
|
186
|
+
const isNew = isEntering || hasChanged;
|
|
187
|
+
if (isNew) {
|
|
188
|
+
found.zone.enter(args);
|
|
189
|
+
} else {
|
|
190
|
+
found.zone.over(args);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
drag.effect = args.acceptedOperation;
|
|
194
|
+
return drag.effect;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
private zoneAt(point: Position) {
|
|
198
|
+
const { content } = this.root;
|
|
199
|
+
const hasNoContent = content === null;
|
|
200
|
+
if (hasNoContent) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const local = clientDipOf({
|
|
205
|
+
hwnd: this.hwnd,
|
|
206
|
+
point,
|
|
207
|
+
scale: this.root.rasterizationScale ?? FALLBACK_SCALE
|
|
208
|
+
});
|
|
209
|
+
const subtree = projectAs(content, UIElement);
|
|
210
|
+
// The generated dispatch cannot tell the point overload from the rectangle one (both take two
|
|
211
|
+
// arguments), so a one-pixel rectangle stands for the point.
|
|
212
|
+
const hits = VisualTreeHelper.findElementsInHostCoordinates({
|
|
213
|
+
...local,
|
|
214
|
+
width: HIT_SIZE,
|
|
215
|
+
height: HIT_SIZE
|
|
216
|
+
}, subtree);
|
|
217
|
+
for (const element of hits ?? []) {
|
|
218
|
+
const found = this.nearestEntry(element);
|
|
219
|
+
if (found) {
|
|
220
|
+
return found;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// The element itself, then its ancestors, until one is a zone.
|
|
228
|
+
private nearestEntry(element: object) {
|
|
229
|
+
for (let node: object | null = element; node !== null; node = parentOf(node)) {
|
|
230
|
+
const entry = this.entries.get(identityOf(node));
|
|
231
|
+
if (entry) {
|
|
232
|
+
return entry;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
private argsOf({ drag, call }: {
|
|
240
|
+
drag: OpenDrag;
|
|
241
|
+
call: OleDragCall | null;
|
|
242
|
+
}) {
|
|
243
|
+
const dragUIOverride: DragFeedback = {
|
|
244
|
+
caption: "",
|
|
245
|
+
isCaptionVisible: false,
|
|
246
|
+
isGlyphVisible: true,
|
|
247
|
+
isContentVisible: true
|
|
248
|
+
};
|
|
249
|
+
const { content } = this.root;
|
|
250
|
+
const local = call === null ? {
|
|
251
|
+
x: 0,
|
|
252
|
+
y: 0
|
|
253
|
+
} : clientDipOf({
|
|
254
|
+
hwnd: this.hwnd,
|
|
255
|
+
point: call.point,
|
|
256
|
+
scale: this.root.rasterizationScale ?? FALLBACK_SCALE
|
|
257
|
+
});
|
|
258
|
+
const args: DropArgs = {
|
|
259
|
+
acceptedOperation: NO_EFFECT,
|
|
260
|
+
allowedOperations: drag.allowedEffects,
|
|
261
|
+
source: sourceOfReader(drag.reader),
|
|
262
|
+
modifiers: modifiersOf(call?.keys ?? 0),
|
|
263
|
+
dragUIOverride,
|
|
264
|
+
handled: false,
|
|
265
|
+
getPosition: relativeTo => positionIn({
|
|
266
|
+
content,
|
|
267
|
+
relativeTo,
|
|
268
|
+
local
|
|
269
|
+
}),
|
|
270
|
+
getDeferral: () => ({
|
|
271
|
+
complete: () => undefined
|
|
272
|
+
})
|
|
273
|
+
};
|
|
274
|
+
return args;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function reportError(error: unknown) {
|
|
279
|
+
queueMicrotask(() => {
|
|
280
|
+
throw error;
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const MODIFIER_OF_KEY = [
|
|
285
|
+
[MK_SHIFT, DragDropModifiers.Shift],
|
|
286
|
+
[MK_CONTROL, DragDropModifiers.Control],
|
|
287
|
+
[MK_ALT, DragDropModifiers.Alt],
|
|
288
|
+
[MK_LBUTTON, DragDropModifiers.LeftButton],
|
|
289
|
+
[MK_MBUTTON, DragDropModifiers.MiddleButton],
|
|
290
|
+
[MK_RBUTTON, DragDropModifiers.RightButton]
|
|
291
|
+
] as const;
|
|
292
|
+
|
|
293
|
+
function modifiersOf(keys: number) {
|
|
294
|
+
let modifiers = 0;
|
|
295
|
+
for (const [key, modifier] of MODIFIER_OF_KEY) {
|
|
296
|
+
const isHeld = (keys & key) !== 0;
|
|
297
|
+
if (isHeld) {
|
|
298
|
+
modifiers |= modifier;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return modifiers;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function parentOf(node: object) {
|
|
306
|
+
const parent: object | null | undefined = VisualTreeHelper.getParent(projectAs(node, UIElement));
|
|
307
|
+
return parent ?? null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// A screen point in the window content's device-independent pixels.
|
|
311
|
+
function clientDipOf({ hwnd, point, scale }: {
|
|
312
|
+
hwnd: bigint;
|
|
313
|
+
point: Position;
|
|
314
|
+
scale: number;
|
|
315
|
+
}) {
|
|
316
|
+
const client = clientPointOf({
|
|
317
|
+
hwnd,
|
|
318
|
+
point
|
|
319
|
+
});
|
|
320
|
+
return {
|
|
321
|
+
x: client.x / scale,
|
|
322
|
+
y: client.y / scale
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function positionIn({ content, relativeTo, local }: {
|
|
327
|
+
content: object | null;
|
|
328
|
+
relativeTo: object;
|
|
329
|
+
local: Position;
|
|
330
|
+
}) {
|
|
331
|
+
const hasNoContent = content === null;
|
|
332
|
+
if (hasNoContent) {
|
|
333
|
+
return local;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const toTarget = projectAs(content, UIElement).transformToVisual(projectAs(relativeTo, UIElement));
|
|
337
|
+
const { x, y } = toTarget.transformPoint(local);
|
|
338
|
+
return {
|
|
339
|
+
x,
|
|
340
|
+
y
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const windows = new Map<bigint, WindowDrop>();
|
|
345
|
+
|
|
346
|
+
function attach(entry: Entry) {
|
|
347
|
+
const root = entry.control.xamlRoot;
|
|
348
|
+
const environment = root?.contentIslandEnvironment;
|
|
349
|
+
const isOutsideWindow = !root || !environment;
|
|
350
|
+
if (isOutsideWindow) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const { appWindowId } = environment;
|
|
355
|
+
const hwnd = appWindowId.value;
|
|
356
|
+
const existing = windows.get(hwnd);
|
|
357
|
+
const state = existing ?? new WindowDrop({
|
|
358
|
+
windowId: appWindowId,
|
|
359
|
+
root
|
|
360
|
+
});
|
|
361
|
+
if (!existing) {
|
|
362
|
+
windows.set(hwnd, state);
|
|
363
|
+
state.start();
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const key = identityOf(entry.control);
|
|
367
|
+
state.entries.set(key, entry);
|
|
368
|
+
return () => {
|
|
369
|
+
state.entries.delete(key);
|
|
370
|
+
const isEmpty = state.entries.size === 0;
|
|
371
|
+
if (isEmpty) {
|
|
372
|
+
state.stop();
|
|
373
|
+
windows.delete(hwnd);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Makes a drop zone take the drags of other apps (Explorer, a browser) that
|
|
380
|
+
* reach its window: the window gets an OLE drop target, routed to the nearest
|
|
381
|
+
* zone under the cursor. A control not yet in a window joins when it loads.
|
|
382
|
+
*
|
|
383
|
+
* @param options - The control and what answers its drags.
|
|
384
|
+
* @returns What removes the zone; the window stops taking drags with its last zone.
|
|
385
|
+
*/
|
|
386
|
+
export function joinWindow({ control, zone }: {
|
|
387
|
+
control: WindowControl;
|
|
388
|
+
zone: WindowZone;
|
|
389
|
+
}) {
|
|
390
|
+
const entry = {
|
|
391
|
+
control,
|
|
392
|
+
zone
|
|
393
|
+
};
|
|
394
|
+
let leave = attach(entry);
|
|
395
|
+
const isLoaded = leave !== null;
|
|
396
|
+
const stopLoaded = isLoaded ? doNothing : listenForLoad();
|
|
397
|
+
function doNothing() {
|
|
398
|
+
return undefined;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function listenForLoad() {
|
|
402
|
+
return control.onLoaded?.(() => {
|
|
403
|
+
leave = attach(entry);
|
|
404
|
+
}) ?? doNothing;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return () => {
|
|
408
|
+
stopLoaded();
|
|
409
|
+
leave?.();
|
|
410
|
+
};
|
|
411
|
+
}
|
package/src/devices/native.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
addressOf,
|
|
7
7
|
bind,
|
|
8
8
|
numberOf,
|
|
9
|
+
POINTER_BYTES,
|
|
9
10
|
pointerOf,
|
|
10
11
|
WIDE_CHAR_BYTES,
|
|
11
12
|
wideMemory,
|
|
@@ -43,7 +44,6 @@ const ENUM_CONNECTIONS = 0x4;
|
|
|
43
44
|
const INFO_LEVEL = 2;
|
|
44
45
|
const INFO_SIZE = 136;
|
|
45
46
|
const DWORD_BYTES = 4;
|
|
46
|
-
const POINTER_BYTES = 8;
|
|
47
47
|
const NAME_CHARS = 260;
|
|
48
48
|
const OFFSET_SERVER = 0;
|
|
49
49
|
const OFFSET_NAME = 8;
|
package/src/enums.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
export { LivePriority } from "./accessibility/live-priority.ts";
|
|
8
8
|
export { UiaControlType, UiaPatternName, UiaPropertyId } from "./automation/ids.ts";
|
|
9
9
|
export { ActivationKind } from "./app/activation/kinds.ts";
|
|
10
|
+
export { ProtectionScope } from "./security/protection-scope.ts";
|
|
10
11
|
export { ShellFailure } from "./app/shell/kinds.ts";
|
|
11
12
|
export { RestartCondition } from "./app/restart-after-crash.ts";
|
|
12
13
|
export * from "./components/generated/enums.ts";
|
|
@@ -15,6 +16,7 @@ export { MoveDirection } from "./components/hand-written/items/reorder.ts";
|
|
|
15
16
|
export { NavigationCacheMode, NavigationMode } from "./components/hand-written/navigation/navigation-stack.ts";
|
|
16
17
|
export { CookieSameSite } from "./messaging/web-view2/cookies.ts";
|
|
17
18
|
export { PermissionKind, PermissionState } from "./messaging/web-view2/policy.ts";
|
|
19
|
+
export { ProcessFailureKind } from "./messaging/web-view2/recovery.ts";
|
|
18
20
|
export { ColorKeyword } from "./components/values.ts";
|
|
19
21
|
export { XamlKind } from "./components/xaml-source.ts";
|
|
20
22
|
export { ConnectedAnimationKind } from "./renderer/host/connected-configuration.ts";
|
|
@@ -33,3 +35,4 @@ export { DockDisplay } from "./window/dock.ts";
|
|
|
33
35
|
export { PickerLocation } from "./window/pickers.ts";
|
|
34
36
|
export { TaskbarFlashUntil, TaskbarProgressState } from "./window/taskbar-calls.ts";
|
|
35
37
|
export { DialogButton, DialogResult } from "./web-apis/dialog-types.ts";
|
|
38
|
+
export { BootstrapMode, RuntimeSource } from "./window/bootstrap-mode.ts";
|
package/src/input/index.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { activeElement } from "./active-element.svelte.ts";
|
|
|
3
3
|
export type { DomEvent, FocusEvent, InputEventMap, InputEventType, KeyboardEvent, PointerEvent, WheelEvent } from "./dom-event.ts";
|
|
4
4
|
export { enableInputEvents } from "./events.ts";
|
|
5
5
|
export type { KeyboardFields } from "./keyboard-fields.ts";
|
|
6
|
+
export type { ModifierKeys } from "./modifier-keys.ts";
|
|
7
|
+
export { modifierKeysHeld } from "./modifier-keys.ts";
|
|
6
8
|
export { moveFocus } from "./move-focus.ts";
|
|
7
9
|
export type { CaptureControl } from "./pointer-capture.ts";
|
|
8
10
|
export { hasPointerCapture, releasePointerCapture, setPointerCapture } from "./pointer-capture.ts";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createKeyStateReader } from "#src/win32-key-state.js";
|
|
2
|
+
|
|
3
|
+
const VIRTUAL_KEY_SHIFT = 0x10;
|
|
4
|
+
const VIRTUAL_KEY_CONTROL = 0x11;
|
|
5
|
+
const VIRTUAL_KEY_ALT = 0x12;
|
|
6
|
+
|
|
7
|
+
/** Which of the modifier keys are held, named as the `shiftKey`, `ctrlKey` and `altKey` of a DOM event. */
|
|
8
|
+
export interface ModifierKeys {
|
|
9
|
+
readonly shiftKey: boolean;
|
|
10
|
+
readonly ctrlKey: boolean;
|
|
11
|
+
readonly altKey: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Reads which modifier keys are held at this moment, for a click, a submit or
|
|
16
|
+
* a pick that carries no key state of its own (a keyboard `Enter` on a form).
|
|
17
|
+
* It only reads; nothing is sent.
|
|
18
|
+
*
|
|
19
|
+
* @param options - `readKey` is for tests: it gets a virtual key code and says whether the key is down.
|
|
20
|
+
* @returns The three flags.
|
|
21
|
+
*/
|
|
22
|
+
export function modifierKeysHeld({ readKey = createKeyStateReader() }: {
|
|
23
|
+
readonly readKey?: (virtualKey: number) => { readonly isDown: boolean };
|
|
24
|
+
} = {}) {
|
|
25
|
+
return {
|
|
26
|
+
shiftKey: readKey(VIRTUAL_KEY_SHIFT).isDown,
|
|
27
|
+
ctrlKey: readKey(VIRTUAL_KEY_CONTROL).isDown,
|
|
28
|
+
altKey: readKey(VIRTUAL_KEY_ALT).isDown
|
|
29
|
+
} satisfies ModifierKeys;
|
|
30
|
+
}
|
|
@@ -2,6 +2,7 @@ import { DynWinRtValue } from "@microsoft/dynwinrt";
|
|
|
2
2
|
import { DynComMethodSig, DynComUnsafe, WinGuid } from "@microsoft/dynwinrt/com/unsafe";
|
|
3
3
|
import { DynComRawMemory, DynComRawOwnedComPointer } from "@microsoft/dynwinrt/com/unsafe/raw";
|
|
4
4
|
import { read } from "#src/renderer/host/reflect.js";
|
|
5
|
+
import { POINTER_BYTES } from "#src/win32-calls.js";
|
|
5
6
|
import type { IBuffer } from "#winui/windows/storage/streams/IBuffer";
|
|
6
7
|
|
|
7
8
|
// A WinRT IBuffer has no member to write through: the way in is its
|
|
@@ -13,7 +14,6 @@ const IBUFFER_BYTE_ACCESS = WinGuid.parse("905a0fef-bc53-11df-8c49-001e4fc686da"
|
|
|
13
14
|
const BUFFER_SLOT = 3;
|
|
14
15
|
const NATIVE_OBJECT = "_obj";
|
|
15
16
|
const BYTE_ALIGNMENT = 1;
|
|
16
|
-
const POINTER_BYTES = 8;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Overwrites the start of a WinRT buffer with bytes.
|
|
@@ -35,6 +35,46 @@ export interface PermissionArguments {
|
|
|
35
35
|
savesInProfile: boolean;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/** What `WebResourceRequested` hands over of the request. */
|
|
39
|
+
export interface WebResourceRequestLike {
|
|
40
|
+
readonly uri: string;
|
|
41
|
+
readonly method: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** What `WebResourceRequested` hands over; assigning `response` answers the request. */
|
|
45
|
+
export interface WebResourceRequestedArguments {
|
|
46
|
+
readonly request: WebResourceRequestLike;
|
|
47
|
+
readonly resourceContext: number;
|
|
48
|
+
response: unknown;
|
|
49
|
+
getDeferral(): { complete(): void };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** What `DevToolsProtocolEventReceived` hands over. */
|
|
53
|
+
export interface DevToolsEventArguments {
|
|
54
|
+
readonly parameterObjectAsJson: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The subscription point of one DevTools protocol event. */
|
|
58
|
+
export interface DevToolsEventReceiverLike {
|
|
59
|
+
onDevToolsProtocolEventReceived(callback: (sender: unknown, args: DevToolsEventArguments) => void): () => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The controller options of one control: its profile inside the environment's folder. */
|
|
63
|
+
export interface ControllerOptionsLike {
|
|
64
|
+
profileName: string;
|
|
65
|
+
isInPrivateModeEnabled: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The environment of a browser: its profile folder, and its part in answering a
|
|
70
|
+
* request (`content` is a WinRT stream).
|
|
71
|
+
*/
|
|
72
|
+
export interface EnvironmentLike {
|
|
73
|
+
readonly userDataFolder: string;
|
|
74
|
+
createCoreWebView2ControllerOptions(): ControllerOptionsLike;
|
|
75
|
+
createWebResourceResponse(content: unknown, statusCode: number, reasonPhrase: string, headers: string): unknown;
|
|
76
|
+
}
|
|
77
|
+
|
|
38
78
|
/** One cookie of the browser profile. */
|
|
39
79
|
export interface CookieLike {
|
|
40
80
|
readonly name: string;
|
|
@@ -57,9 +97,17 @@ export interface CookieManagerLike {
|
|
|
57
97
|
deleteAllCookies(): void;
|
|
58
98
|
}
|
|
59
99
|
|
|
100
|
+
/** What `CoreProcessFailed` hands over. */
|
|
101
|
+
export interface ProcessFailedArguments {
|
|
102
|
+
/** A `CoreWebView2ProcessFailedKind`; 0 is the browser process. */
|
|
103
|
+
readonly processFailedKind: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
60
106
|
/** What the helpers use of `CoreWebView2`; every `on...` returns its unsubscribe. */
|
|
61
107
|
export interface CoreWebView2Like {
|
|
62
108
|
readonly cookieManager: CookieManagerLike;
|
|
109
|
+
readonly environment: EnvironmentLike;
|
|
110
|
+
readonly browserProcessId: number;
|
|
63
111
|
readonly settings: {
|
|
64
112
|
areHostObjectsAllowed: boolean;
|
|
65
113
|
};
|
|
@@ -68,16 +116,30 @@ export interface CoreWebView2Like {
|
|
|
68
116
|
addScriptToExecuteOnDocumentCreatedAsync(javaScript: string): Promise<string>;
|
|
69
117
|
removeScriptToExecuteOnDocumentCreated(id: string): void;
|
|
70
118
|
openDevToolsWindow(): void;
|
|
119
|
+
reload(): void;
|
|
120
|
+
addWebResourceRequestedFilter(uri: string, resourceContext: number): void;
|
|
121
|
+
removeWebResourceRequestedFilter(uri: string, resourceContext: number): void;
|
|
122
|
+
callDevToolsProtocolMethodAsync(methodName: string, parametersAsJson: string): Promise<string>;
|
|
123
|
+
getDevToolsProtocolEventReceiver(eventName: string): DevToolsEventReceiverLike;
|
|
124
|
+
onWebResourceRequested(callback: (sender: unknown, args: WebResourceRequestedArguments) => void): () => void;
|
|
71
125
|
onWebMessageReceived(callback: (sender: unknown, args: WebMessageArguments) => void): () => void;
|
|
72
126
|
onNavigationStarting(callback: (sender: unknown, args: NavigationArguments) => void): () => void;
|
|
73
127
|
onDownloadStarting(callback: (sender: unknown, args: DownloadArguments) => void): () => void;
|
|
74
128
|
onPermissionRequested(callback: (sender: unknown, args: PermissionArguments) => void): () => void;
|
|
75
129
|
}
|
|
76
130
|
|
|
131
|
+
/** The text of whatever a call threw. */
|
|
132
|
+
export function messageOf(error: unknown) {
|
|
133
|
+
return error instanceof Error ? error.message : String(error);
|
|
134
|
+
}
|
|
135
|
+
|
|
77
136
|
/** What the helpers use of the `WebView2` control. */
|
|
78
137
|
export interface WebView2Like {
|
|
79
138
|
readonly coreWebView2: CoreWebView2Like;
|
|
139
|
+
onCoreProcessFailed(callback: (sender: unknown, args: ProcessFailedArguments) => void): () => void;
|
|
80
140
|
ensureCoreWebView2Async(): Promise<void>;
|
|
141
|
+
ensureCoreWebView2Async(environment: EnvironmentLike): Promise<void>;
|
|
142
|
+
ensureCoreWebView2Async(environment: EnvironmentLike, controllerOptions: ControllerOptionsLike): Promise<void>;
|
|
81
143
|
}
|
|
82
144
|
|
|
83
145
|
/**
|
|
@@ -85,6 +147,8 @@ export interface WebView2Like {
|
|
|
85
147
|
* `CoreWebView2` once it is ready (`CoreWebView2Initialized` has been
|
|
86
148
|
* raised); resolves at once when it already is
|
|
87
149
|
* The control must be in a window for the browser to start
|
|
150
|
+
* It starts the default environment (the process's one profile folder, no
|
|
151
|
+
* flags); to use a custom environment, call `startWebView2` first
|
|
88
152
|
*/
|
|
89
153
|
export async function waitForCoreWebView2(control: WebView2Like) {
|
|
90
154
|
await control.ensureCoreWebView2Async();
|