@seelen-ui/lib 2.5.8 → 2.6.6-next.2605170835
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/esm/gen/types/AppBarEdge.d.ts +7 -0
- package/esm/gen/types/AppBarEdge.d.ts.map +1 -0
- package/esm/gen/types/AppBarEdge.js +8 -0
- package/esm/gen/types/AppNotification.d.ts +3 -0
- package/esm/gen/types/AppNotification.d.ts.map +1 -1
- package/esm/gen/types/AudioWaveform.d.ts +11 -0
- package/esm/gen/types/AudioWaveform.d.ts.map +1 -0
- package/esm/gen/types/BackupStatus.d.ts +10 -0
- package/esm/gen/types/BackupStatus.d.ts.map +1 -0
- package/esm/gen/types/BluetoothDevice.d.ts +1 -0
- package/esm/gen/types/BluetoothDevice.d.ts.map +1 -1
- package/esm/gen/types/ClipboardData.d.ts +15 -0
- package/esm/gen/types/ClipboardData.d.ts.map +1 -0
- package/esm/gen/types/ClipboardEntry.d.ts +24 -0
- package/esm/gen/types/ClipboardEntry.d.ts.map +1 -0
- package/esm/gen/types/ClipboardEntryContent.d.ts +16 -0
- package/esm/gen/types/ClipboardEntryContent.d.ts.map +1 -0
- package/esm/gen/types/ClipboardEntryContent.js +2 -0
- package/esm/gen/types/Comparator.d.ts +9 -0
- package/esm/gen/types/Comparator.d.ts.map +1 -0
- package/esm/gen/types/Comparator.js +10 -0
- package/esm/gen/types/ContextMenu.d.ts +8 -0
- package/esm/gen/types/ContextMenu.d.ts.map +1 -1
- package/esm/gen/types/ContextMenuCallbackPayload.d.ts +20 -0
- package/esm/gen/types/ContextMenuCallbackPayload.d.ts.map +1 -0
- package/esm/gen/types/ContextMenuItem.d.ts +4 -2
- package/esm/gen/types/ContextMenuItem.d.ts.map +1 -1
- package/esm/gen/types/FancyToolbarSettings.d.ts +6 -0
- package/esm/gen/types/FancyToolbarSettings.d.ts.map +1 -1
- package/esm/gen/types/FocusedApp.d.ts +1 -1
- package/esm/gen/types/FocusedApp.d.ts.map +1 -1
- package/esm/gen/types/KnownPlugin.d.ts +2 -2
- package/esm/gen/types/KnownPlugin.d.ts.map +1 -1
- package/esm/gen/types/NotificationsMode.d.ts +6 -0
- package/esm/gen/types/NotificationsMode.d.ts.map +1 -0
- package/esm/gen/types/NotificationsMode.js +7 -0
- package/esm/gen/types/Operand.d.ts +5 -0
- package/esm/gen/types/Operand.d.ts.map +1 -0
- package/esm/gen/types/Operand.js +6 -0
- package/esm/gen/types/ResolvedShortcut.d.ts +9 -0
- package/esm/gen/types/ResolvedShortcut.d.ts.map +1 -0
- package/esm/gen/types/ResolvedShortcut.js +2 -0
- package/esm/gen/types/ResourceId.d.ts +6 -2
- package/esm/gen/types/ResourceId.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandActivateNotificationArgs.d.ts +3 -0
- package/esm/gen/types/SeelenCommandActivateNotificationArgs.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandActivateNotificationArgs.js +0 -1
- package/esm/gen/types/SeelenCommandArgument.d.ts +51 -5
- package/esm/gen/types/SeelenCommandArgument.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandClipboardDeleteEntryArgs.js +2 -0
- package/esm/gen/types/SeelenCommandClipboardPasteArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandClipboardPasteArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandClipboardPasteArgs.js +2 -0
- package/esm/gen/types/SeelenCommandClipboardSetContentArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandClipboardSetContentArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandClipboardSetContentArgs.js +2 -0
- package/esm/gen/types/SeelenCommandConnectBluetoothDeviceArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandConnectBluetoothDeviceArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandConnectBluetoothDeviceArgs.js +2 -0
- package/esm/gen/types/SeelenCommandMoveWindowToWorkspaceArgs.d.ts +6 -0
- package/esm/gen/types/SeelenCommandMoveWindowToWorkspaceArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandRegisterAppBarArgs.d.ts +7 -0
- package/esm/gen/types/SeelenCommandRegisterAppBarArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandRegisterAppBarArgs.js +1 -0
- package/esm/gen/types/SeelenCommandReturn.d.ts +49 -8
- package/esm/gen/types/SeelenCommandReturn.d.ts.map +1 -1
- package/esm/gen/types/SeelenCommandSetFocusAssistArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandSetFocusAssistArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandSetFocusAssistArgs.js +2 -0
- package/esm/gen/types/SeelenCommandSetNotificationsModeArgs.d.ts +5 -0
- package/esm/gen/types/SeelenCommandSetNotificationsModeArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandSetNotificationsModeArgs.js +1 -0
- package/esm/gen/types/SeelenCommandSystemSetAccentColorArgs.d.ts +5 -0
- package/esm/gen/types/SeelenCommandSystemSetAccentColorArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandSystemSetAccentColorArgs.js +1 -0
- package/esm/gen/types/SeelenCommandWlanForgetArgs.d.ts +4 -0
- package/esm/gen/types/SeelenCommandWlanForgetArgs.d.ts.map +1 -0
- package/esm/gen/types/SeelenCommandWlanForgetArgs.js +2 -0
- package/esm/gen/types/SeelenEventPayload.d.ts +26 -8
- package/esm/gen/types/SeelenEventPayload.d.ts.map +1 -1
- package/esm/gen/types/SeelenFont.d.ts +4 -0
- package/esm/gen/types/SeelenFont.d.ts.map +1 -0
- package/esm/gen/types/SeelenFont.js +2 -0
- package/esm/gen/types/SeelenWallSettings.d.ts +14 -0
- package/esm/gen/types/SeelenWallSettings.d.ts.map +1 -1
- package/esm/gen/types/SeelenWegSettings.d.ts +11 -0
- package/esm/gen/types/SeelenWegSettings.d.ts.map +1 -1
- package/esm/gen/types/Settings.d.ts +12 -0
- package/esm/gen/types/Settings.d.ts.map +1 -1
- package/esm/gen/types/SettingsByWidget.d.ts +7 -0
- package/esm/gen/types/SettingsByWidget.d.ts.map +1 -1
- package/esm/gen/types/SluShortcutsSettings.d.ts +9 -2
- package/esm/gen/types/SluShortcutsSettings.d.ts.map +1 -1
- package/esm/gen/types/SluShortcutsSettings.js +1 -0
- package/esm/gen/types/SystemShortcutDeclaration.d.ts +16 -0
- package/esm/gen/types/SystemShortcutDeclaration.d.ts.map +1 -0
- package/esm/gen/types/SystemShortcutDeclaration.js +2 -0
- package/esm/gen/types/ThemeConfigDefinition.d.ts +2 -4
- package/esm/gen/types/ThemeConfigDefinition.d.ts.map +1 -1
- package/esm/gen/types/ThemeConfigGroupVariant.d.ts +5 -0
- package/esm/gen/types/ThemeConfigGroupVariant.d.ts.map +1 -0
- package/esm/gen/types/ThemeConfigGroupVariant.js +1 -0
- package/esm/gen/types/ThemeVariableDefinition.d.ts +2 -0
- package/esm/gen/types/ThemeVariableDefinition.d.ts.map +1 -1
- package/esm/gen/types/ThirdPartyWidgetSettings.d.ts +7 -0
- package/esm/gen/types/ThirdPartyWidgetSettings.d.ts.map +1 -1
- package/esm/gen/types/ToolbarItem.d.ts +2 -0
- package/esm/gen/types/ToolbarItem.d.ts.map +1 -1
- package/esm/gen/types/TwmCondition.d.ts +17 -0
- package/esm/gen/types/TwmCondition.d.ts.map +1 -0
- package/esm/gen/types/TwmCondition.js +1 -0
- package/esm/gen/types/TwmGlobalRuntimeTree.d.ts +8 -0
- package/esm/gen/types/TwmGlobalRuntimeTree.d.ts.map +1 -0
- package/esm/gen/types/TwmGlobalRuntimeTree.js +1 -0
- package/esm/gen/types/{WmNodeKind.d.ts → TwmNodeKind.d.ts} +2 -2
- package/esm/gen/types/TwmNodeKind.d.ts.map +1 -0
- package/esm/gen/types/TwmNodeKind.js +8 -0
- package/esm/gen/types/TwmNodeLifetime.d.ts +5 -0
- package/esm/gen/types/TwmNodeLifetime.d.ts.map +1 -0
- package/esm/gen/types/TwmNodeLifetime.js +6 -0
- package/esm/gen/types/TwmPlugin.d.ts +8 -0
- package/esm/gen/types/TwmPlugin.d.ts.map +1 -0
- package/esm/gen/types/TwmPlugin.js +1 -0
- package/esm/gen/types/{WmNode.d.ts → TwmPluginNode.d.ts} +15 -17
- package/esm/gen/types/TwmPluginNode.d.ts.map +1 -0
- package/esm/gen/types/TwmPluginNode.js +1 -0
- package/esm/gen/types/TwmReservation.d.ts +9 -0
- package/esm/gen/types/TwmReservation.d.ts.map +1 -0
- package/esm/gen/types/TwmReservation.js +10 -0
- package/esm/gen/types/TwmRuntimeNode.d.ts +22 -0
- package/esm/gen/types/TwmRuntimeNode.d.ts.map +1 -0
- package/esm/gen/types/TwmRuntimeNode.js +1 -0
- package/esm/gen/types/TwmRuntimeTree.d.ts +8 -0
- package/esm/gen/types/TwmRuntimeTree.d.ts.map +1 -0
- package/esm/gen/types/TwmRuntimeTree.js +1 -0
- package/esm/gen/types/TwmStackPolicy.d.ts +6 -0
- package/esm/gen/types/TwmStackPolicy.d.ts.map +1 -0
- package/esm/gen/types/TwmStackPolicy.js +7 -0
- package/esm/gen/types/UIColors.d.ts +9 -10
- package/esm/gen/types/UIColors.d.ts.map +1 -1
- package/esm/gen/types/UIColors.js +0 -1
- package/esm/gen/types/UserAppWindow.d.ts +5 -0
- package/esm/gen/types/UserAppWindow.d.ts.map +1 -1
- package/esm/gen/types/UserAppWindowPreview.d.ts +1 -1
- package/esm/gen/types/Wallpaper.d.ts +1 -1
- package/esm/gen/types/WallpaperKind.d.ts +1 -0
- package/esm/gen/types/WallpaperKind.d.ts.map +1 -1
- package/esm/gen/types/WallpaperKind.js +1 -0
- package/esm/gen/types/WegMiddleClickAction.d.ts +5 -0
- package/esm/gen/types/WegMiddleClickAction.d.ts.map +1 -0
- package/esm/gen/types/WegMiddleClickAction.js +6 -0
- package/esm/gen/types/Widget.d.ts +11 -0
- package/esm/gen/types/Widget.d.ts.map +1 -1
- package/esm/gen/types/WidgetConfigDefinition.d.ts +2 -4
- package/esm/gen/types/WidgetConfigDefinition.d.ts.map +1 -1
- package/esm/gen/types/WidgetConfigGroupVariant.d.ts +5 -0
- package/esm/gen/types/WidgetConfigGroupVariant.d.ts.map +1 -0
- package/esm/gen/types/WidgetConfigGroupVariant.js +1 -0
- package/esm/gen/types/WidgetSelectOption.d.ts +1 -1
- package/esm/gen/types/WidgetSelectOption.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingColor.d.ts +4 -4
- package/esm/gen/types/WidgetSettingColor.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingFont.d.ts +34 -0
- package/esm/gen/types/WidgetSettingFont.d.ts.map +1 -0
- package/esm/gen/types/WidgetSettingFont.js +1 -0
- package/esm/gen/types/WidgetSettingInputNumber.d.ts +4 -4
- package/esm/gen/types/WidgetSettingInputNumber.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingInputText.d.ts +4 -4
- package/esm/gen/types/WidgetSettingInputText.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingItem.d.ts +4 -1
- package/esm/gen/types/WidgetSettingItem.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingRange.d.ts +4 -4
- package/esm/gen/types/WidgetSettingRange.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingSelect.d.ts +4 -4
- package/esm/gen/types/WidgetSettingSelect.d.ts.map +1 -1
- package/esm/gen/types/WidgetSettingSwitch.d.ts +4 -4
- package/esm/gen/types/WidgetSettingSwitch.d.ts.map +1 -1
- package/esm/gen/types/WidgetShortcutDeclaration.d.ts +33 -0
- package/esm/gen/types/WidgetShortcutDeclaration.d.ts.map +1 -0
- package/esm/gen/types/WidgetShortcutDeclaration.js +1 -0
- package/esm/gen/types/WidgetStatus.d.ts +2 -1
- package/esm/gen/types/WidgetStatus.d.ts.map +1 -1
- package/esm/gen/types/WidgetStatus.js +1 -0
- package/esm/gen/types/WindowManagerSettings.d.ts +6 -0
- package/esm/gen/types/WindowManagerSettings.d.ts.map +1 -1
- package/esm/gen/types/WlanBssEntry.d.ts +15 -6
- package/esm/gen/types/WlanBssEntry.d.ts.map +1 -1
- package/esm/gen/types/mod.d.ts +275 -245
- package/esm/gen/types/mod.d.ts.map +1 -1
- package/esm/gen/types/mod.js +275 -245
- package/esm/gen/types/serde_json/JsonValue.d.ts +4 -0
- package/esm/gen/types/serde_json/JsonValue.d.ts.map +1 -0
- package/esm/gen/types/serde_json/JsonValue.js +2 -0
- package/esm/src/handlers/commands.d.ts +22 -4
- package/esm/src/handlers/commands.d.ts.map +1 -1
- package/esm/src/handlers/commands.js +21 -3
- package/esm/src/handlers/events.d.ts +9 -3
- package/esm/src/handlers/events.d.ts.map +1 -1
- package/esm/src/handlers/events.js +8 -2
- package/esm/src/state/theme/theming.d.ts +1 -0
- package/esm/src/state/theme/theming.d.ts.map +1 -1
- package/esm/src/state/theme/theming.js +21 -1
- package/esm/src/state/widget/interfaces.d.ts +48 -7
- package/esm/src/state/widget/interfaces.d.ts.map +1 -1
- package/esm/src/state/widget/mod.d.ts +12 -7
- package/esm/src/state/widget/mod.d.ts.map +1 -1
- package/esm/src/state/widget/mod.js +90 -99
- package/esm/src/state/widget/positioning.js +1 -1
- package/esm/src/state/widget/sizing.d.ts +14 -3
- package/esm/src/state/widget/sizing.d.ts.map +1 -1
- package/esm/src/state/widget/sizing.js +60 -17
- package/esm/src/system_state/ui_colors.d.ts +0 -1
- package/esm/src/system_state/ui_colors.d.ts.map +1 -1
- package/esm/src/system_state/ui_colors.js +5 -22
- package/esm/src/utils/async.d.ts +12 -0
- package/esm/src/utils/async.d.ts.map +1 -1
- package/esm/src/utils/async.js +46 -0
- package/esm/src/utils/mod.d.ts +2 -0
- package/esm/src/utils/mod.d.ts.map +1 -1
- package/esm/src/utils/mod.js +5 -0
- package/package.json +7 -6
- package/script/gen/types/AppBarEdge.d.ts +7 -0
- package/script/gen/types/AppBarEdge.d.ts.map +1 -0
- package/script/gen/types/AppBarEdge.js +11 -0
- package/script/gen/types/AppNotification.d.ts +3 -0
- package/script/gen/types/AppNotification.d.ts.map +1 -1
- package/script/gen/types/AudioWaveform.d.ts +11 -0
- package/script/gen/types/AudioWaveform.d.ts.map +1 -0
- package/script/gen/types/BackupStatus.d.ts +10 -0
- package/script/gen/types/BackupStatus.d.ts.map +1 -0
- package/script/gen/types/BluetoothDevice.d.ts +1 -0
- package/script/gen/types/BluetoothDevice.d.ts.map +1 -1
- package/script/gen/types/ClipboardData.d.ts +15 -0
- package/script/gen/types/ClipboardData.d.ts.map +1 -0
- package/script/gen/types/ClipboardEntry.d.ts +24 -0
- package/script/gen/types/ClipboardEntry.d.ts.map +1 -0
- package/script/gen/types/ClipboardEntryContent.d.ts +16 -0
- package/script/gen/types/ClipboardEntryContent.d.ts.map +1 -0
- package/script/gen/types/ClipboardEntryContent.js +3 -0
- package/script/gen/types/Comparator.d.ts +9 -0
- package/script/gen/types/Comparator.d.ts.map +1 -0
- package/script/gen/types/Comparator.js +13 -0
- package/script/gen/types/ContextMenu.d.ts +8 -0
- package/script/gen/types/ContextMenu.d.ts.map +1 -1
- package/script/gen/types/ContextMenuCallbackPayload.d.ts +20 -0
- package/script/gen/types/ContextMenuCallbackPayload.d.ts.map +1 -0
- package/script/gen/types/ContextMenuItem.d.ts +4 -2
- package/script/gen/types/ContextMenuItem.d.ts.map +1 -1
- package/script/gen/types/FancyToolbarSettings.d.ts +6 -0
- package/script/gen/types/FancyToolbarSettings.d.ts.map +1 -1
- package/script/gen/types/FocusedApp.d.ts +1 -1
- package/script/gen/types/FocusedApp.d.ts.map +1 -1
- package/script/gen/types/KnownPlugin.d.ts +2 -2
- package/script/gen/types/KnownPlugin.d.ts.map +1 -1
- package/script/gen/types/NotificationsMode.d.ts +6 -0
- package/script/gen/types/NotificationsMode.d.ts.map +1 -0
- package/script/gen/types/NotificationsMode.js +10 -0
- package/script/gen/types/Operand.d.ts +5 -0
- package/script/gen/types/Operand.d.ts.map +1 -0
- package/script/gen/types/Operand.js +9 -0
- package/script/gen/types/ResolvedShortcut.d.ts +9 -0
- package/script/gen/types/ResolvedShortcut.d.ts.map +1 -0
- package/script/gen/types/ResolvedShortcut.js +3 -0
- package/script/gen/types/ResourceId.d.ts +6 -2
- package/script/gen/types/ResourceId.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandActivateNotificationArgs.d.ts +3 -0
- package/script/gen/types/SeelenCommandActivateNotificationArgs.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandActivateNotificationArgs.js +0 -1
- package/script/gen/types/SeelenCommandArgument.d.ts +51 -5
- package/script/gen/types/SeelenCommandArgument.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandClipboardDeleteEntryArgs.js +3 -0
- package/script/gen/types/SeelenCommandClipboardPasteArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandClipboardPasteArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandClipboardPasteArgs.js +3 -0
- package/script/gen/types/SeelenCommandClipboardSetContentArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandClipboardSetContentArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandClipboardSetContentArgs.js +3 -0
- package/script/gen/types/SeelenCommandConnectBluetoothDeviceArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandConnectBluetoothDeviceArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandConnectBluetoothDeviceArgs.js +3 -0
- package/script/gen/types/SeelenCommandMoveWindowToWorkspaceArgs.d.ts +6 -0
- package/script/gen/types/SeelenCommandMoveWindowToWorkspaceArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandRegisterAppBarArgs.d.ts +7 -0
- package/script/gen/types/SeelenCommandRegisterAppBarArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandRegisterAppBarArgs.js +2 -0
- package/script/gen/types/SeelenCommandReturn.d.ts +49 -8
- package/script/gen/types/SeelenCommandReturn.d.ts.map +1 -1
- package/script/gen/types/SeelenCommandSetFocusAssistArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandSetFocusAssistArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandSetFocusAssistArgs.js +3 -0
- package/script/gen/types/SeelenCommandSetNotificationsModeArgs.d.ts +5 -0
- package/script/gen/types/SeelenCommandSetNotificationsModeArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandSetNotificationsModeArgs.js +2 -0
- package/script/gen/types/SeelenCommandSystemSetAccentColorArgs.d.ts +5 -0
- package/script/gen/types/SeelenCommandSystemSetAccentColorArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandSystemSetAccentColorArgs.js +2 -0
- package/script/gen/types/SeelenCommandWlanForgetArgs.d.ts +4 -0
- package/script/gen/types/SeelenCommandWlanForgetArgs.d.ts.map +1 -0
- package/script/gen/types/SeelenCommandWlanForgetArgs.js +3 -0
- package/script/gen/types/SeelenEventPayload.d.ts +26 -8
- package/script/gen/types/SeelenEventPayload.d.ts.map +1 -1
- package/script/gen/types/SeelenFont.d.ts +4 -0
- package/script/gen/types/SeelenFont.d.ts.map +1 -0
- package/script/gen/types/SeelenFont.js +3 -0
- package/script/gen/types/SeelenWallSettings.d.ts +14 -0
- package/script/gen/types/SeelenWallSettings.d.ts.map +1 -1
- package/script/gen/types/SeelenWegSettings.d.ts +11 -0
- package/script/gen/types/SeelenWegSettings.d.ts.map +1 -1
- package/script/gen/types/Settings.d.ts +12 -0
- package/script/gen/types/Settings.d.ts.map +1 -1
- package/script/gen/types/SettingsByWidget.d.ts +7 -0
- package/script/gen/types/SettingsByWidget.d.ts.map +1 -1
- package/script/gen/types/SluShortcutsSettings.d.ts +9 -2
- package/script/gen/types/SluShortcutsSettings.d.ts.map +1 -1
- package/script/gen/types/SluShortcutsSettings.js +1 -0
- package/script/gen/types/SystemShortcutDeclaration.d.ts +16 -0
- package/script/gen/types/SystemShortcutDeclaration.d.ts.map +1 -0
- package/script/gen/types/SystemShortcutDeclaration.js +3 -0
- package/script/gen/types/ThemeConfigDefinition.d.ts +2 -4
- package/script/gen/types/ThemeConfigDefinition.d.ts.map +1 -1
- package/script/gen/types/ThemeConfigGroupVariant.d.ts +5 -0
- package/script/gen/types/ThemeConfigGroupVariant.d.ts.map +1 -0
- package/script/gen/types/ThemeConfigGroupVariant.js +2 -0
- package/script/gen/types/ThemeVariableDefinition.d.ts +2 -0
- package/script/gen/types/ThemeVariableDefinition.d.ts.map +1 -1
- package/script/gen/types/ThirdPartyWidgetSettings.d.ts +7 -0
- package/script/gen/types/ThirdPartyWidgetSettings.d.ts.map +1 -1
- package/script/gen/types/ToolbarItem.d.ts +2 -0
- package/script/gen/types/ToolbarItem.d.ts.map +1 -1
- package/script/gen/types/TwmCondition.d.ts +17 -0
- package/script/gen/types/TwmCondition.d.ts.map +1 -0
- package/script/gen/types/TwmCondition.js +2 -0
- package/script/gen/types/TwmGlobalRuntimeTree.d.ts +8 -0
- package/script/gen/types/TwmGlobalRuntimeTree.d.ts.map +1 -0
- package/script/gen/types/TwmGlobalRuntimeTree.js +2 -0
- package/script/gen/types/{WmNodeKind.d.ts → TwmNodeKind.d.ts} +2 -2
- package/script/gen/types/TwmNodeKind.d.ts.map +1 -0
- package/script/gen/types/TwmNodeKind.js +11 -0
- package/script/gen/types/TwmNodeLifetime.d.ts +5 -0
- package/script/gen/types/TwmNodeLifetime.d.ts.map +1 -0
- package/script/gen/types/TwmNodeLifetime.js +9 -0
- package/script/gen/types/TwmPlugin.d.ts +8 -0
- package/script/gen/types/TwmPlugin.d.ts.map +1 -0
- package/script/gen/types/TwmPlugin.js +2 -0
- package/script/gen/types/{WmNode.d.ts → TwmPluginNode.d.ts} +15 -17
- package/script/gen/types/TwmPluginNode.d.ts.map +1 -0
- package/script/gen/types/TwmPluginNode.js +2 -0
- package/script/gen/types/TwmReservation.d.ts +9 -0
- package/script/gen/types/TwmReservation.d.ts.map +1 -0
- package/script/gen/types/TwmReservation.js +13 -0
- package/script/gen/types/TwmRuntimeNode.d.ts +22 -0
- package/script/gen/types/TwmRuntimeNode.d.ts.map +1 -0
- package/script/gen/types/TwmRuntimeNode.js +2 -0
- package/script/gen/types/TwmRuntimeTree.d.ts +8 -0
- package/script/gen/types/TwmRuntimeTree.d.ts.map +1 -0
- package/script/gen/types/TwmRuntimeTree.js +2 -0
- package/script/gen/types/TwmStackPolicy.d.ts +6 -0
- package/script/gen/types/TwmStackPolicy.d.ts.map +1 -0
- package/script/gen/types/TwmStackPolicy.js +10 -0
- package/script/gen/types/UIColors.d.ts +9 -10
- package/script/gen/types/UIColors.d.ts.map +1 -1
- package/script/gen/types/UIColors.js +0 -1
- package/script/gen/types/UserAppWindow.d.ts +5 -0
- package/script/gen/types/UserAppWindow.d.ts.map +1 -1
- package/script/gen/types/UserAppWindowPreview.d.ts +1 -1
- package/script/gen/types/Wallpaper.d.ts +1 -1
- package/script/gen/types/WallpaperKind.d.ts +1 -0
- package/script/gen/types/WallpaperKind.d.ts.map +1 -1
- package/script/gen/types/WallpaperKind.js +1 -0
- package/script/gen/types/WegMiddleClickAction.d.ts +5 -0
- package/script/gen/types/WegMiddleClickAction.d.ts.map +1 -0
- package/script/gen/types/WegMiddleClickAction.js +9 -0
- package/script/gen/types/Widget.d.ts +11 -0
- package/script/gen/types/Widget.d.ts.map +1 -1
- package/script/gen/types/WidgetConfigDefinition.d.ts +2 -4
- package/script/gen/types/WidgetConfigDefinition.d.ts.map +1 -1
- package/script/gen/types/WidgetConfigGroupVariant.d.ts +5 -0
- package/script/gen/types/WidgetConfigGroupVariant.d.ts.map +1 -0
- package/script/gen/types/WidgetConfigGroupVariant.js +2 -0
- package/script/gen/types/WidgetSelectOption.d.ts +1 -1
- package/script/gen/types/WidgetSelectOption.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingColor.d.ts +4 -4
- package/script/gen/types/WidgetSettingColor.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingFont.d.ts +34 -0
- package/script/gen/types/WidgetSettingFont.d.ts.map +1 -0
- package/script/gen/types/WidgetSettingFont.js +2 -0
- package/script/gen/types/WidgetSettingInputNumber.d.ts +4 -4
- package/script/gen/types/WidgetSettingInputNumber.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingInputText.d.ts +4 -4
- package/script/gen/types/WidgetSettingInputText.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingItem.d.ts +4 -1
- package/script/gen/types/WidgetSettingItem.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingRange.d.ts +4 -4
- package/script/gen/types/WidgetSettingRange.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingSelect.d.ts +4 -4
- package/script/gen/types/WidgetSettingSelect.d.ts.map +1 -1
- package/script/gen/types/WidgetSettingSwitch.d.ts +4 -4
- package/script/gen/types/WidgetSettingSwitch.d.ts.map +1 -1
- package/script/gen/types/WidgetShortcutDeclaration.d.ts +33 -0
- package/script/gen/types/WidgetShortcutDeclaration.d.ts.map +1 -0
- package/script/gen/types/WidgetShortcutDeclaration.js +2 -0
- package/script/gen/types/WidgetStatus.d.ts +2 -1
- package/script/gen/types/WidgetStatus.d.ts.map +1 -1
- package/script/gen/types/WidgetStatus.js +1 -0
- package/script/gen/types/WindowManagerSettings.d.ts +6 -0
- package/script/gen/types/WindowManagerSettings.d.ts.map +1 -1
- package/script/gen/types/WlanBssEntry.d.ts +15 -6
- package/script/gen/types/WlanBssEntry.d.ts.map +1 -1
- package/script/gen/types/mod.d.ts +275 -245
- package/script/gen/types/mod.d.ts.map +1 -1
- package/script/gen/types/mod.js +275 -245
- package/script/gen/types/serde_json/JsonValue.d.ts +4 -0
- package/script/gen/types/serde_json/JsonValue.d.ts.map +1 -0
- package/script/gen/types/serde_json/JsonValue.js +3 -0
- package/script/src/handlers/commands.d.ts +22 -4
- package/script/src/handlers/commands.d.ts.map +1 -1
- package/script/src/handlers/commands.js +21 -3
- package/script/src/handlers/events.d.ts +9 -3
- package/script/src/handlers/events.d.ts.map +1 -1
- package/script/src/handlers/events.js +8 -2
- package/script/src/state/theme/theming.d.ts +1 -0
- package/script/src/state/theme/theming.d.ts.map +1 -1
- package/script/src/state/theme/theming.js +22 -1
- package/script/src/state/widget/interfaces.d.ts +48 -7
- package/script/src/state/widget/interfaces.d.ts.map +1 -1
- package/script/src/state/widget/mod.d.ts +12 -7
- package/script/src/state/widget/mod.d.ts.map +1 -1
- package/script/src/state/widget/mod.js +89 -98
- package/script/src/state/widget/positioning.js +2 -2
- package/script/src/state/widget/sizing.d.ts +14 -3
- package/script/src/state/widget/sizing.d.ts.map +1 -1
- package/script/src/state/widget/sizing.js +61 -18
- package/script/src/system_state/ui_colors.d.ts +0 -1
- package/script/src/system_state/ui_colors.d.ts.map +1 -1
- package/script/src/system_state/ui_colors.js +5 -22
- package/script/src/utils/async.d.ts +12 -0
- package/script/src/utils/async.d.ts.map +1 -1
- package/script/src/utils/async.js +49 -0
- package/script/src/utils/mod.d.ts +2 -0
- package/script/src/utils/mod.d.ts.map +1 -1
- package/script/src/utils/mod.js +8 -1
- package/styles/colors.css +521 -0
- package/styles/reset.css +129 -0
- package/styles/shadows.css +7 -0
- package/styles/spacings.css +9 -0
- package/esm/gen/types/SluHotkey.d.ts +0 -17
- package/esm/gen/types/SluHotkey.d.ts.map +0 -1
- package/esm/gen/types/SluHotkeyAction.d.ts +0 -96
- package/esm/gen/types/SluHotkeyAction.d.ts.map +0 -1
- package/esm/gen/types/WindowManagerLayout.d.ts +0 -6
- package/esm/gen/types/WindowManagerLayout.d.ts.map +0 -1
- package/esm/gen/types/WlanProfile.d.ts +0 -8
- package/esm/gen/types/WlanProfile.d.ts.map +0 -1
- package/esm/gen/types/WmNode.d.ts.map +0 -1
- package/esm/gen/types/WmNodeKind.d.ts.map +0 -1
- package/esm/gen/types/WmNodeKind.js +0 -8
- package/esm/gen/types/WmNodeLifetime.d.ts +0 -5
- package/esm/gen/types/WmNodeLifetime.d.ts.map +0 -1
- package/esm/gen/types/WmNodeLifetime.js +0 -6
- package/esm/gen/types/WmRenderTree.d.ts +0 -6
- package/esm/gen/types/WmRenderTree.d.ts.map +0 -1
- package/script/gen/types/SluHotkey.d.ts +0 -17
- package/script/gen/types/SluHotkey.d.ts.map +0 -1
- package/script/gen/types/SluHotkeyAction.d.ts +0 -96
- package/script/gen/types/SluHotkeyAction.d.ts.map +0 -1
- package/script/gen/types/WindowManagerLayout.d.ts +0 -6
- package/script/gen/types/WindowManagerLayout.d.ts.map +0 -1
- package/script/gen/types/WlanProfile.d.ts +0 -8
- package/script/gen/types/WlanProfile.d.ts.map +0 -1
- package/script/gen/types/WmNode.d.ts.map +0 -1
- package/script/gen/types/WmNodeKind.d.ts.map +0 -1
- package/script/gen/types/WmNodeKind.js +0 -11
- package/script/gen/types/WmNodeLifetime.d.ts +0 -5
- package/script/gen/types/WmNodeLifetime.d.ts.map +0 -1
- package/script/gen/types/WmNodeLifetime.js +0 -9
- package/script/gen/types/WmRenderTree.d.ts +0 -6
- package/script/gen/types/WmRenderTree.d.ts.map +0 -1
- /package/esm/gen/types/{SluHotkeyAction.js → AudioWaveform.js} +0 -0
- /package/esm/gen/types/{WlanProfile.js → BackupStatus.js} +0 -0
- /package/esm/gen/types/{SluHotkey.js → ClipboardData.js} +0 -0
- /package/esm/gen/types/{WindowManagerLayout.js → ClipboardEntry.js} +0 -0
- /package/esm/gen/types/{WmNode.js → ContextMenuCallbackPayload.js} +0 -0
- /package/esm/gen/types/{WmRenderTree.js → SeelenCommandMoveWindowToWorkspaceArgs.js} +0 -0
- /package/script/gen/types/{SluHotkeyAction.js → AudioWaveform.js} +0 -0
- /package/script/gen/types/{WlanProfile.js → BackupStatus.js} +0 -0
- /package/script/gen/types/{SluHotkey.js → ClipboardData.js} +0 -0
- /package/script/gen/types/{WindowManagerLayout.js → ClipboardEntry.js} +0 -0
- /package/script/gen/types/{WmNode.js → ContextMenuCallbackPayload.js} +0 -0
- /package/script/gen/types/{WmRenderTree.js → SeelenCommandMoveWindowToWorkspaceArgs.js} +0 -0
|
@@ -45,6 +45,7 @@ const theming_js_1 = require("../theme/theming.js");
|
|
|
45
45
|
const performance_js_1 = require("./performance.js");
|
|
46
46
|
const webview_1 = require("@tauri-apps/api/webview");
|
|
47
47
|
const window_1 = require("@tauri-apps/api/window");
|
|
48
|
+
const mod_js_4 = require("../../handlers/mod.js");
|
|
48
49
|
/**
|
|
49
50
|
* Represents the widget instance running in the current webview
|
|
50
51
|
*/
|
|
@@ -75,18 +76,11 @@ class Widget {
|
|
|
75
76
|
/** current window where the widget is running */
|
|
76
77
|
window;
|
|
77
78
|
autoSizer;
|
|
79
|
+
destroyOnHide = false;
|
|
78
80
|
runtimeState = {
|
|
79
81
|
hwnd: 0,
|
|
80
82
|
initialized: false,
|
|
81
83
|
ready: false,
|
|
82
|
-
position: {
|
|
83
|
-
x: 0,
|
|
84
|
-
y: 0,
|
|
85
|
-
},
|
|
86
|
-
size: {
|
|
87
|
-
width: 0,
|
|
88
|
-
height: 0,
|
|
89
|
-
},
|
|
90
84
|
firstFocus: true,
|
|
91
85
|
};
|
|
92
86
|
constructor(widget) {
|
|
@@ -108,15 +102,6 @@ class Widget {
|
|
|
108
102
|
get windowId() {
|
|
109
103
|
return this.runtimeState.hwnd;
|
|
110
104
|
}
|
|
111
|
-
/** Returns the current position and size of the widget */
|
|
112
|
-
get frame() {
|
|
113
|
-
return {
|
|
114
|
-
x: this.runtimeState.position.x,
|
|
115
|
-
y: this.runtimeState.position.y,
|
|
116
|
-
width: this.runtimeState.size.width,
|
|
117
|
-
height: this.runtimeState.size.height,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
105
|
/** Returns the default config of the widget, declared on the widget definition */
|
|
121
106
|
getDefaultConfig() {
|
|
122
107
|
const config = { enabled: true };
|
|
@@ -125,69 +110,37 @@ class Widget {
|
|
|
125
110
|
}
|
|
126
111
|
return config;
|
|
127
112
|
}
|
|
128
|
-
applyInvisiblePreset() {
|
|
129
|
-
return [
|
|
130
|
-
this.window.setDecorations(false), // no title bar
|
|
131
|
-
this.window.setShadow(false), // no shadows
|
|
132
|
-
// hide from native shell
|
|
133
|
-
this.window.setSkipTaskbar(true),
|
|
134
|
-
// as a (desktop/overlay) widget we don't wanna allow nothing of these
|
|
135
|
-
this.window.setMinimizable(false),
|
|
136
|
-
this.window.setMaximizable(false),
|
|
137
|
-
this.window.setClosable(false),
|
|
138
|
-
];
|
|
139
|
-
}
|
|
140
113
|
/** Will apply the recommended settings for a desktop widget */
|
|
141
|
-
|
|
142
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnBottom(true)]);
|
|
143
|
-
}
|
|
114
|
+
applyDesktopPreset() { }
|
|
144
115
|
/** Will apply the recommended settings for an overlay widget */
|
|
145
|
-
|
|
146
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnTop(true)]);
|
|
147
|
-
}
|
|
116
|
+
applyOverlayPreset() { }
|
|
148
117
|
/** Will apply the recommended settings for a popup widget */
|
|
149
|
-
|
|
150
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnTop(true)]);
|
|
151
|
-
const hideWidget = (0, async_js_1.debounce)(() => {
|
|
152
|
-
this.hide(true);
|
|
153
|
-
}, 100);
|
|
154
|
-
this.window.onFocusChanged(({ payload: focused }) => {
|
|
155
|
-
if (focused) {
|
|
156
|
-
hideWidget.cancel();
|
|
157
|
-
}
|
|
158
|
-
else {
|
|
159
|
-
hideWidget();
|
|
160
|
-
}
|
|
161
|
-
});
|
|
118
|
+
applyPopupPreset() {
|
|
162
119
|
this.onTrigger(async ({ desiredPosition, alignX, alignY }) => {
|
|
163
|
-
// avoid flickering when clicking a button that triggers the widget
|
|
164
|
-
hideWidget.cancel();
|
|
165
|
-
if (this.autoSizer && alignX && alignY) {
|
|
166
|
-
this.autoSizer.originX = alignX;
|
|
167
|
-
this.autoSizer.originY = alignY;
|
|
168
|
-
}
|
|
169
120
|
if (desiredPosition) {
|
|
170
|
-
|
|
171
|
-
frame: {
|
|
172
|
-
x: desiredPosition.x,
|
|
173
|
-
y: desiredPosition.y,
|
|
174
|
-
width: this.runtimeState.size.width,
|
|
175
|
-
height: this.runtimeState.size.height,
|
|
176
|
-
},
|
|
177
|
-
originX: alignX,
|
|
178
|
-
originY: alignY,
|
|
179
|
-
});
|
|
180
|
-
await this.setPosition({
|
|
181
|
-
left: adjusted.x,
|
|
182
|
-
top: adjusted.y,
|
|
183
|
-
right: adjusted.x + adjusted.width,
|
|
184
|
-
bottom: adjusted.y + adjusted.height,
|
|
185
|
-
});
|
|
121
|
+
await this.adjustAndSetPosition(desiredPosition.x, desiredPosition.y, alignX, alignY);
|
|
186
122
|
}
|
|
187
123
|
await this.show();
|
|
188
124
|
await this.focus();
|
|
189
125
|
});
|
|
190
126
|
}
|
|
127
|
+
hideOnFocusLoss() {
|
|
128
|
+
let wasFocused = false;
|
|
129
|
+
const hideDelayed = (0, async_js_1.debounce)(() => {
|
|
130
|
+
this.hide();
|
|
131
|
+
}, 100);
|
|
132
|
+
(0, mod_js_4.subscribe)(mod_js_2.SeelenEvent.GlobalFocusChanged, ({ payload: focused }) => {
|
|
133
|
+
if (focused.hwnd !== this.runtimeState.hwnd && focused.ownerHwnd !== this.runtimeState.hwnd) {
|
|
134
|
+
if (wasFocused) {
|
|
135
|
+
hideDelayed();
|
|
136
|
+
}
|
|
137
|
+
wasFocused = false;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
wasFocused = true;
|
|
141
|
+
hideDelayed.cancel();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
191
144
|
/**
|
|
192
145
|
* Will restore the saved position and size of the widget on start,
|
|
193
146
|
* after that will store the position and size of the widget on change.
|
|
@@ -223,6 +176,18 @@ class Widget {
|
|
|
223
176
|
console.info(`Widget size saved: ${width} ${height}`);
|
|
224
177
|
}, 500));
|
|
225
178
|
}
|
|
179
|
+
async normalizeDevicePixelRatio() {
|
|
180
|
+
// play with zoom level to reset device pixel ratio to 1:1
|
|
181
|
+
let oldDPR = globalThis.devicePixelRatio;
|
|
182
|
+
await this.webview.setZoom(1 / oldDPR);
|
|
183
|
+
this.window.onScaleChanged(() => {
|
|
184
|
+
if (globalThis.devicePixelRatio !== oldDPR) {
|
|
185
|
+
// when zoom was set dpr changed, so in case of change this is accomulative unit
|
|
186
|
+
oldDPR = oldDPR * globalThis.devicePixelRatio;
|
|
187
|
+
this.webview.setZoom(1 / (oldDPR * globalThis.devicePixelRatio));
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
226
191
|
/**
|
|
227
192
|
* Will initialize the widget based on the preset and mark it as `pending`, this function won't show the widget.
|
|
228
193
|
* This should be called before any other action on the widget. After this you should call
|
|
@@ -235,23 +200,30 @@ class Widget {
|
|
|
235
200
|
}
|
|
236
201
|
this.runtimeState.hwnd = await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.GetSelfWindowId);
|
|
237
202
|
this.runtimeState.initialized = true;
|
|
203
|
+
this.destroyOnHide = options.closeOnHide ?? this.def.lazy;
|
|
204
|
+
if (options.normalizeDevicePixelRatio) {
|
|
205
|
+
await this.normalizeDevicePixelRatio();
|
|
206
|
+
}
|
|
238
207
|
if (options.autoSizeByContent) {
|
|
239
|
-
this.autoSizer = new sizing_js_1.WidgetAutoSizer(this, options.autoSizeByContent);
|
|
208
|
+
this.autoSizer = new sizing_js_1.WidgetAutoSizer(this, options.autoSizeByContent, options.autoSizeFitOnScreen ?? true);
|
|
240
209
|
}
|
|
241
|
-
|
|
210
|
+
if (options.saveAndRestoreLastRect ?? this.def.preset === mod_js_1.WidgetPreset.Desktop) {
|
|
242
211
|
await this.persistPositionAndSize();
|
|
243
212
|
}
|
|
213
|
+
if (options.hideOnFocusLoss ?? this.def.preset === mod_js_1.WidgetPreset.Popup) {
|
|
214
|
+
this.hideOnFocusLoss();
|
|
215
|
+
}
|
|
244
216
|
switch (this.def.preset) {
|
|
245
217
|
case mod_js_1.WidgetPreset.None:
|
|
246
218
|
break;
|
|
247
219
|
case mod_js_1.WidgetPreset.Desktop:
|
|
248
|
-
|
|
220
|
+
this.applyDesktopPreset();
|
|
249
221
|
break;
|
|
250
222
|
case mod_js_1.WidgetPreset.Overlay:
|
|
251
|
-
|
|
223
|
+
this.applyOverlayPreset();
|
|
252
224
|
break;
|
|
253
225
|
case mod_js_1.WidgetPreset.Popup:
|
|
254
|
-
|
|
226
|
+
this.applyPopupPreset();
|
|
255
227
|
break;
|
|
256
228
|
}
|
|
257
229
|
await (0, theming_js_1.startThemingTool)();
|
|
@@ -262,16 +234,8 @@ class Widget {
|
|
|
262
234
|
else {
|
|
263
235
|
console.trace("Animations won't be disabled because widget configuration");
|
|
264
236
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
this.runtimeState.position = await this.window.outerPosition();
|
|
268
|
-
this.window.onResized((e) => {
|
|
269
|
-
this.runtimeState.size.width = e.payload.width;
|
|
270
|
-
this.runtimeState.size.height = e.payload.height;
|
|
271
|
-
});
|
|
272
|
-
this.window.onMoved((e) => {
|
|
273
|
-
this.runtimeState.position.x = e.payload.x;
|
|
274
|
-
this.runtimeState.position.y = e.payload.y;
|
|
237
|
+
await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (state) => {
|
|
238
|
+
await state.init(this);
|
|
275
239
|
});
|
|
276
240
|
}
|
|
277
241
|
/**
|
|
@@ -293,7 +257,7 @@ class Widget {
|
|
|
293
257
|
await this.autoSizer?.execute();
|
|
294
258
|
if (show && !(await this.window.isVisible())) {
|
|
295
259
|
await this.show();
|
|
296
|
-
await this.focus();
|
|
260
|
+
// await this.focus();
|
|
297
261
|
}
|
|
298
262
|
// this will mark the widget as ready, and send pending trigger event if exists
|
|
299
263
|
await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.SetCurrentWidgetStatus, { status: mod_js_1.WidgetStatus.Ready });
|
|
@@ -303,13 +267,8 @@ class Widget {
|
|
|
303
267
|
cb(payload);
|
|
304
268
|
});
|
|
305
269
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
this.runtimeState.position.x = rect.left;
|
|
309
|
-
this.runtimeState.position.y = rect.top;
|
|
310
|
-
this.runtimeState.size.width = rect.right - rect.left;
|
|
311
|
-
this.runtimeState.size.height = rect.bottom - rect.top;
|
|
312
|
-
return (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.SetSelfPosition, {
|
|
270
|
+
async __unsafe_setPosition(rect, ref) {
|
|
271
|
+
await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.SetSelfPosition, {
|
|
313
272
|
rect: {
|
|
314
273
|
left: Math.round(rect.left),
|
|
315
274
|
top: Math.round(rect.top),
|
|
@@ -317,6 +276,40 @@ class Widget {
|
|
|
317
276
|
bottom: Math.round(rect.bottom),
|
|
318
277
|
},
|
|
319
278
|
});
|
|
279
|
+
// optimistically update state, as arrived event after change is async
|
|
280
|
+
ref.x = rect.left;
|
|
281
|
+
ref.y = rect.top;
|
|
282
|
+
ref.width = rect.right - rect.left;
|
|
283
|
+
ref.height = rect.bottom - rect.top;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* This will adjust the position of the widget based on the current placement and alignX/alignY arguments.
|
|
287
|
+
* This makes the widget fit into the monitor where it was placed, avoiding monitor overflow.
|
|
288
|
+
*/
|
|
289
|
+
async adjustAndSetPosition(x, y, alignX, alignY) {
|
|
290
|
+
await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (ref) => {
|
|
291
|
+
const adjusted = (0, positioning_js_1.adjustPositionByPlacement)({
|
|
292
|
+
frame: {
|
|
293
|
+
x,
|
|
294
|
+
y,
|
|
295
|
+
width: ref.width,
|
|
296
|
+
height: ref.height,
|
|
297
|
+
},
|
|
298
|
+
originX: alignX,
|
|
299
|
+
originY: alignY,
|
|
300
|
+
});
|
|
301
|
+
await Widget.self.__unsafe_setPosition({
|
|
302
|
+
left: adjusted.x,
|
|
303
|
+
top: adjusted.y,
|
|
304
|
+
right: adjusted.x + adjusted.width,
|
|
305
|
+
bottom: adjusted.y + adjusted.height,
|
|
306
|
+
}, ref);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
async setPosition(rect) {
|
|
310
|
+
await sizing_js_1.OPTIMISTIC_FRAME.runExclusive(async (frame) => {
|
|
311
|
+
await this.__unsafe_setPosition(rect, frame);
|
|
312
|
+
});
|
|
320
313
|
}
|
|
321
314
|
async show() {
|
|
322
315
|
debouncedClose.cancel();
|
|
@@ -328,13 +321,11 @@ class Widget {
|
|
|
328
321
|
await (0, webview_1.getCurrentWebview)().setFocus();
|
|
329
322
|
this.runtimeState.firstFocus = false;
|
|
330
323
|
}
|
|
331
|
-
await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.RequestFocus, { hwnd: this.runtimeState.hwnd }).catch(() => {
|
|
332
|
-
console.warn(`Failed to focus widget: ${this.decoded.label}`);
|
|
333
|
-
});
|
|
324
|
+
await (0, mod_js_2.invoke)(mod_js_2.SeelenCommand.RequestFocus, { hwnd: this.runtimeState.hwnd }).catch(() => { });
|
|
334
325
|
}
|
|
335
|
-
hide(
|
|
326
|
+
hide() {
|
|
336
327
|
this.window.hide();
|
|
337
|
-
if (
|
|
328
|
+
if (this.destroyOnHide) {
|
|
338
329
|
debouncedClose();
|
|
339
330
|
}
|
|
340
331
|
}
|
|
@@ -5,13 +5,13 @@ exports.adjustPositionByPlacement = adjustPositionByPlacement;
|
|
|
5
5
|
exports.fitIntoMonitor = fitIntoMonitor;
|
|
6
6
|
const mod_js_1 = require("../../../gen/types/mod.js");
|
|
7
7
|
const mod_js_2 = require("../../handlers/mod.js");
|
|
8
|
-
const
|
|
8
|
+
const commands_js_1 = require("../../handlers/commands.js");
|
|
9
9
|
const events_js_1 = require("../../handlers/events.js");
|
|
10
10
|
const monitors = {
|
|
11
11
|
value: [],
|
|
12
12
|
};
|
|
13
13
|
async function initMonitorsState() {
|
|
14
|
-
monitors.value = await (0, mod_js_2.invoke)(
|
|
14
|
+
monitors.value = await (0, mod_js_2.invoke)(commands_js_1.SeelenCommand.SystemGetMonitors);
|
|
15
15
|
(0, mod_js_2.subscribe)(events_js_1.SeelenEvent.SystemMonitorsChanged, ({ payload }) => {
|
|
16
16
|
monitors.value = payload;
|
|
17
17
|
});
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import type { Widget } from "./mod.js";
|
|
2
2
|
import { Alignment } from "../../../gen/types/mod.js";
|
|
3
|
+
import { Mutex } from "../../utils/async.js";
|
|
4
|
+
declare class OptimisiticFrame {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
init(widget: Widget): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const OPTIMISTIC_FRAME: Mutex<OptimisiticFrame>;
|
|
3
12
|
export declare class WidgetAutoSizer {
|
|
4
13
|
private widget;
|
|
5
14
|
private element;
|
|
15
|
+
private fitOnScreen;
|
|
6
16
|
/** From which side the widget will grow */
|
|
7
|
-
originX
|
|
17
|
+
originX?: Alignment | null;
|
|
8
18
|
/** From which side the widget will grow */
|
|
9
|
-
originY
|
|
10
|
-
constructor(widget: Widget, element: HTMLElement);
|
|
19
|
+
originY?: Alignment | null;
|
|
20
|
+
constructor(widget: Widget, element: HTMLElement, fitOnScreen: boolean);
|
|
11
21
|
private setup;
|
|
12
22
|
execute(): Promise<void>;
|
|
13
23
|
}
|
|
24
|
+
export {};
|
|
14
25
|
//# sourceMappingURL=sizing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/sizing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../src/src/state/widget/sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,cAAM,gBAAgB;IACpB,CAAC,EAAE,MAAM,CAAK;IACd,CAAC,EAAE,MAAM,CAAK;IACd,KAAK,EAAE,MAAM,CAAK;IAClB,MAAM,EAAE,MAAM,CAAK;IAEb,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB1C;AAED,eAAO,MAAM,gBAAgB,yBAAoC,CAAC;AAElE,qBAAa,eAAe;IAOxB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,WAAW;IARrB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAC3B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;gBAGjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,OAAO;IAM9B,OAAO,CAAC,KAAK;IAqBP,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAsD/B"}
|
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WidgetAutoSizer = void 0;
|
|
4
|
-
const dpi_1 = require("@tauri-apps/api/dpi");
|
|
3
|
+
exports.WidgetAutoSizer = exports.OPTIMISTIC_FRAME = void 0;
|
|
5
4
|
const mod_js_1 = require("../../../gen/types/mod.js");
|
|
5
|
+
const async_js_1 = require("../../utils/async.js");
|
|
6
|
+
const positioning_js_1 = require("./positioning.js");
|
|
7
|
+
class OptimisiticFrame {
|
|
8
|
+
x = 0;
|
|
9
|
+
y = 0;
|
|
10
|
+
width = 0;
|
|
11
|
+
height = 0;
|
|
12
|
+
async init(widget) {
|
|
13
|
+
const { width, height } = await widget.window.outerSize();
|
|
14
|
+
const { x, y } = await widget.window.outerPosition();
|
|
15
|
+
this.width = width;
|
|
16
|
+
this.height = height;
|
|
17
|
+
this.x = x;
|
|
18
|
+
this.y = y;
|
|
19
|
+
widget.window.onResized((e) => {
|
|
20
|
+
exports.OPTIMISTIC_FRAME.runExclusive((ref) => {
|
|
21
|
+
ref.width = e.payload.width;
|
|
22
|
+
ref.height = e.payload.height;
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
widget.window.onMoved((e) => {
|
|
26
|
+
exports.OPTIMISTIC_FRAME.runExclusive((ref) => {
|
|
27
|
+
ref.x = e.payload.x;
|
|
28
|
+
ref.y = e.payload.y;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.OPTIMISTIC_FRAME = new async_js_1.Mutex(new OptimisiticFrame());
|
|
6
34
|
class WidgetAutoSizer {
|
|
7
35
|
widget;
|
|
8
36
|
element;
|
|
37
|
+
fitOnScreen;
|
|
9
38
|
/** From which side the widget will grow */
|
|
10
|
-
originX
|
|
39
|
+
originX;
|
|
11
40
|
/** From which side the widget will grow */
|
|
12
|
-
originY
|
|
13
|
-
constructor(widget, element) {
|
|
41
|
+
originY;
|
|
42
|
+
constructor(widget, element, fitOnScreen) {
|
|
14
43
|
this.widget = widget;
|
|
15
44
|
this.element = element;
|
|
45
|
+
this.fitOnScreen = fitOnScreen;
|
|
16
46
|
this.execute = this.execute.bind(this);
|
|
17
47
|
this.setup();
|
|
18
48
|
}
|
|
19
49
|
setup() {
|
|
20
50
|
// Disable resizing by the user
|
|
21
51
|
this.widget.window.setResizable(false);
|
|
52
|
+
this.widget.onTrigger(({ alignX, alignY }) => {
|
|
53
|
+
exports.OPTIMISTIC_FRAME.runExclusive(() => {
|
|
54
|
+
this.originX = alignX;
|
|
55
|
+
this.originY = alignY;
|
|
56
|
+
});
|
|
57
|
+
});
|
|
22
58
|
const observer = new ResizeObserver(this.execute);
|
|
23
59
|
observer.observe(this.element, {
|
|
24
60
|
box: "border-box",
|
|
@@ -28,8 +64,9 @@ class WidgetAutoSizer {
|
|
|
28
64
|
};
|
|
29
65
|
}
|
|
30
66
|
async execute() {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
67
|
+
const guard = await exports.OPTIMISTIC_FRAME.acquire();
|
|
68
|
+
const { x, y, width, height } = guard.value;
|
|
69
|
+
let frame = {
|
|
33
70
|
x,
|
|
34
71
|
y,
|
|
35
72
|
width: Math.ceil(this.element.scrollWidth * globalThis.window.devicePixelRatio),
|
|
@@ -39,9 +76,12 @@ class WidgetAutoSizer {
|
|
|
39
76
|
const heightDiff = frame.height - height;
|
|
40
77
|
// Only update if the difference is more than 1px (avoid infinite loops from decimal differences)
|
|
41
78
|
if (widthDiff === 0 && heightDiff === 0) {
|
|
79
|
+
guard.release();
|
|
42
80
|
return;
|
|
43
81
|
}
|
|
44
|
-
console.
|
|
82
|
+
/* console.debug(
|
|
83
|
+
`Auto resizing from ${width}x${height} to ${frame.width}x${frame.height} using ${this.originX}/${this.originY} origin`,
|
|
84
|
+
); */
|
|
45
85
|
if (this.originX === mod_js_1.Alignment.Center) {
|
|
46
86
|
frame.x -= widthDiff / 2;
|
|
47
87
|
}
|
|
@@ -54,17 +94,20 @@ class WidgetAutoSizer {
|
|
|
54
94
|
else if (this.originY === mod_js_1.Alignment.End) {
|
|
55
95
|
frame.y -= heightDiff;
|
|
56
96
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
97
|
+
if (this.fitOnScreen) {
|
|
98
|
+
frame = (0, positioning_js_1.fitIntoMonitor)(frame);
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
await this.widget.__unsafe_setPosition({
|
|
102
|
+
left: frame.x,
|
|
103
|
+
top: frame.y,
|
|
104
|
+
right: frame.x + frame.width,
|
|
105
|
+
bottom: frame.y + frame.height,
|
|
106
|
+
}, guard.value);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
guard.release();
|
|
61
110
|
}
|
|
62
|
-
await this.widget.setPosition({
|
|
63
|
-
left: frame.x,
|
|
64
|
-
top: frame.y,
|
|
65
|
-
right: frame.x + frame.width,
|
|
66
|
-
bottom: frame.y + frame.height,
|
|
67
|
-
});
|
|
68
111
|
}
|
|
69
112
|
}
|
|
70
113
|
exports.WidgetAutoSizer = WidgetAutoSizer;
|
|
@@ -5,7 +5,6 @@ export declare class UIColors {
|
|
|
5
5
|
constructor(inner: IUIColors);
|
|
6
6
|
static getAsync(): Promise<UIColors>;
|
|
7
7
|
static onChange(cb: (payload: UIColors) => void): Promise<UnSubscriber>;
|
|
8
|
-
static default(): UIColors;
|
|
9
8
|
setAsCssVariables(): void;
|
|
10
9
|
}
|
|
11
10
|
export interface Color extends IColor {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_colors.d.ts","sourceRoot":"","sources":["../../../src/src/system_state/ui_colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnF,OAAO,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAErF,qBAAa,QAAQ;IACA,KAAK,EAAE,SAAS;gBAAhB,KAAK,EAAE,SAAS;IAEnC,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IAIpC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAIvE,
|
|
1
|
+
{"version":3,"file":"ui_colors.d.ts","sourceRoot":"","sources":["../../../src/src/system_state/ui_colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGnF,OAAO,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,QAAQ,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAErF,qBAAa,QAAQ;IACA,KAAK,EAAE,SAAS;gBAAhB,KAAK,EAAE,SAAS;IAEnC,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IAIpC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAIvE,iBAAiB,IAAI,IAAI;CAuB1B;AAED,MAAM,WAAW,KAAM,SAAQ,MAAM;CAAG;AAExC,qBAAa,KAAK;gBACJ,GAAG,EAAE,MAAM;IAOvB,qCAAqC;IACrC,MAAM,CAAC,MAAM,IAAI,KAAK;IAStB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK;IAyBlC,WAAW,IAAI,MAAM;IAUrB,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,oBAAoB;IAkB5B;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAWpC;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM;IAYzC,aAAa,IAAI,KAAK;CAQvB"}
|
|
@@ -15,36 +15,19 @@ class UIColors {
|
|
|
15
15
|
static onChange(cb) {
|
|
16
16
|
return (0, State_js_1.newOnEvent)(cb, this, mod_js_1.SeelenEvent.ColorsChanged);
|
|
17
17
|
}
|
|
18
|
-
static default() {
|
|
19
|
-
return new this({
|
|
20
|
-
background: "#ffffff",
|
|
21
|
-
foreground: "#000000",
|
|
22
|
-
accent_darkest: "#990000",
|
|
23
|
-
accent_darker: "#aa0000",
|
|
24
|
-
accent_dark: "#bb0000",
|
|
25
|
-
accent: "#cc0000",
|
|
26
|
-
accent_light: "#dd0000",
|
|
27
|
-
accent_lighter: "#ee0000",
|
|
28
|
-
accent_lightest: "#ff0000",
|
|
29
|
-
complement: null,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
18
|
setAsCssVariables() {
|
|
33
19
|
const oldStyles = new DOM_js_1.RuntimeStyleSheet("@deprecated/system-colors");
|
|
34
20
|
const newStyles = new DOM_js_1.RuntimeStyleSheet("@runtime/system-colors");
|
|
35
|
-
for (const [key,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
const color = Color.fromHex(value);
|
|
40
|
-
const { r, g, b } = color;
|
|
21
|
+
for (const [key, _color] of Object.entries(this.inner)) {
|
|
22
|
+
const color = new Color(_color);
|
|
23
|
+
const { r, g, b } = _color;
|
|
41
24
|
// replace rust snake case with kebab case
|
|
42
25
|
const name = key.replace("_", "-");
|
|
43
26
|
// @deprecated old names
|
|
44
|
-
oldStyles.addVariable(`--config-${name}-color`,
|
|
27
|
+
oldStyles.addVariable(`--config-${name}-color`, color.toHexString());
|
|
45
28
|
oldStyles.addVariable(`--config-${name}-color-rgb`, `${r}, ${g}, ${b}`);
|
|
46
29
|
if (name.startsWith("accent")) {
|
|
47
|
-
newStyles.addVariable(`--system-${name}-color`,
|
|
30
|
+
newStyles.addVariable(`--system-${name}-color`, color.toHexString());
|
|
48
31
|
}
|
|
49
32
|
}
|
|
50
33
|
oldStyles.applyToDocument();
|
|
@@ -5,4 +5,16 @@ export interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
|
5
5
|
pending(): boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number): DebouncedFunction<T>;
|
|
8
|
+
export declare class Mutex<T> {
|
|
9
|
+
private _rawValue;
|
|
10
|
+
constructor(_rawValue: T);
|
|
11
|
+
private lock;
|
|
12
|
+
acquire(): Promise<Guard<T>>;
|
|
13
|
+
runExclusive<U>(fn: (v: T) => U): Promise<U>;
|
|
14
|
+
}
|
|
15
|
+
export declare class Guard<T> {
|
|
16
|
+
value: T;
|
|
17
|
+
release: () => void;
|
|
18
|
+
constructor(value: T, release: () => void);
|
|
19
|
+
}
|
|
8
20
|
//# sourceMappingURL=async.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../src/src/utils/async.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;IAClE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,IAAI,CAAC;IACf,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,OAAO,CAAC;CACpB;AAGD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,MAAM,GACZ,iBAAiB,CAAC,CAAC,CAAC,CA6CtB"}
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../src/src/utils/async.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;IAClE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,IAAI,IAAI,CAAC;IACf,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,OAAO,CAAC;CACpB;AAGD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,EAAE,EAAE,CAAC,EACL,KAAK,EAAE,MAAM,GACZ,iBAAiB,CAAC,CAAC,CAAC,CA6CtB;AAED,qBAAa,KAAK,CAAC,CAAC;IACN,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,CAAC;IAEhC,OAAO,CAAC,IAAI,CAII;IAEV,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IA0B5B,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAQnD;AAED,qBAAa,KAAK,CAAC,CAAC;IAET,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,MAAM,IAAI;gBADnB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,IAAI;CAE7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Guard = exports.Mutex = void 0;
|
|
3
4
|
exports.debounce = debounce;
|
|
4
5
|
// deno-lint-ignore no-explicit-any
|
|
5
6
|
function debounce(fn, delay) {
|
|
@@ -40,3 +41,51 @@ function debounce(fn, delay) {
|
|
|
40
41
|
};
|
|
41
42
|
return debounced;
|
|
42
43
|
}
|
|
44
|
+
class Mutex {
|
|
45
|
+
_rawValue;
|
|
46
|
+
constructor(_rawValue) {
|
|
47
|
+
this._rawValue = _rawValue;
|
|
48
|
+
}
|
|
49
|
+
lock = null;
|
|
50
|
+
async acquire() {
|
|
51
|
+
if (this.lock) {
|
|
52
|
+
await this.lock.__promise;
|
|
53
|
+
}
|
|
54
|
+
// deno-lint-ignore no-explicit-any
|
|
55
|
+
let __resolve;
|
|
56
|
+
// deno-lint-ignore no-explicit-any
|
|
57
|
+
let __reject;
|
|
58
|
+
const __promise = new Promise((resolve, reject) => {
|
|
59
|
+
__resolve = resolve;
|
|
60
|
+
__reject = reject;
|
|
61
|
+
});
|
|
62
|
+
this.lock = {
|
|
63
|
+
__promise,
|
|
64
|
+
__resolve,
|
|
65
|
+
__reject,
|
|
66
|
+
};
|
|
67
|
+
return new Guard(this._rawValue, () => {
|
|
68
|
+
this.lock = null;
|
|
69
|
+
__resolve();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async runExclusive(fn) {
|
|
73
|
+
const guard = await this.acquire();
|
|
74
|
+
try {
|
|
75
|
+
return await fn(guard.value);
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
guard.release();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.Mutex = Mutex;
|
|
83
|
+
class Guard {
|
|
84
|
+
value;
|
|
85
|
+
release;
|
|
86
|
+
constructor(value, release) {
|
|
87
|
+
this.value = value;
|
|
88
|
+
this.release = release;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.Guard = Guard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/utils/mod.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;IACf,IAAI,SAAK;IACT,GAAG,SAAK;IACR,KAAK,SAAK;IACV,MAAM,SAAK;CACZ"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/utils/mod.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;IACf,IAAI,SAAK;IACT,GAAG,SAAK;IACR,KAAK,SAAK;IACV,MAAM,SAAK;CACZ;AAED,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/script/src/utils/mod.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Rect = void 0;
|
|
3
|
+
exports.RuntimeStyleSheet = exports.Rect = void 0;
|
|
4
|
+
exports.isSeelenUIRuntime = isSeelenUIRuntime;
|
|
4
5
|
class Rect {
|
|
5
6
|
left = 0;
|
|
6
7
|
top = 0;
|
|
@@ -8,3 +9,9 @@ class Rect {
|
|
|
8
9
|
bottom = 0;
|
|
9
10
|
}
|
|
10
11
|
exports.Rect = Rect;
|
|
12
|
+
function isSeelenUIRuntime() {
|
|
13
|
+
// deno-lint-ignore no-explicit-any
|
|
14
|
+
return !!globalThis.window.__SLU_WIDGET;
|
|
15
|
+
}
|
|
16
|
+
var DOM_js_1 = require("./DOM.js");
|
|
17
|
+
Object.defineProperty(exports, "RuntimeStyleSheet", { enumerable: true, get: function () { return DOM_js_1.RuntimeStyleSheet; } });
|