@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
|
@@ -3,12 +3,13 @@ import { WidgetPreset, WidgetStatus, } from "../../../gen/types/mod.js";
|
|
|
3
3
|
import { invoke, SeelenCommand, SeelenEvent } from "../../handlers/mod.js";
|
|
4
4
|
import { decodeBase64Url } from "../../../deps/jsr.io/@std/encoding/1.0.10/mod.js";
|
|
5
5
|
import { debounce } from "../../utils/async.js";
|
|
6
|
-
import { WidgetAutoSizer } from "./sizing.js";
|
|
6
|
+
import { OPTIMISTIC_FRAME, WidgetAutoSizer } from "./sizing.js";
|
|
7
7
|
import { adjustPositionByPlacement, fitIntoMonitor, initMonitorsState } from "./positioning.js";
|
|
8
8
|
import { startThemingTool } from "../theme/theming.js";
|
|
9
9
|
import { disableAnimationsOnPerformanceMode } from "./performance.js";
|
|
10
10
|
import { getCurrentWebview } from "@tauri-apps/api/webview";
|
|
11
11
|
import { getCurrentWindow } from "@tauri-apps/api/window";
|
|
12
|
+
import { subscribe } from "../../handlers/mod.js";
|
|
12
13
|
/**
|
|
13
14
|
* Represents the widget instance running in the current webview
|
|
14
15
|
*/
|
|
@@ -39,18 +40,11 @@ export class Widget {
|
|
|
39
40
|
/** current window where the widget is running */
|
|
40
41
|
window;
|
|
41
42
|
autoSizer;
|
|
43
|
+
destroyOnHide = false;
|
|
42
44
|
runtimeState = {
|
|
43
45
|
hwnd: 0,
|
|
44
46
|
initialized: false,
|
|
45
47
|
ready: false,
|
|
46
|
-
position: {
|
|
47
|
-
x: 0,
|
|
48
|
-
y: 0,
|
|
49
|
-
},
|
|
50
|
-
size: {
|
|
51
|
-
width: 0,
|
|
52
|
-
height: 0,
|
|
53
|
-
},
|
|
54
48
|
firstFocus: true,
|
|
55
49
|
};
|
|
56
50
|
constructor(widget) {
|
|
@@ -72,15 +66,6 @@ export class Widget {
|
|
|
72
66
|
get windowId() {
|
|
73
67
|
return this.runtimeState.hwnd;
|
|
74
68
|
}
|
|
75
|
-
/** Returns the current position and size of the widget */
|
|
76
|
-
get frame() {
|
|
77
|
-
return {
|
|
78
|
-
x: this.runtimeState.position.x,
|
|
79
|
-
y: this.runtimeState.position.y,
|
|
80
|
-
width: this.runtimeState.size.width,
|
|
81
|
-
height: this.runtimeState.size.height,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
69
|
/** Returns the default config of the widget, declared on the widget definition */
|
|
85
70
|
getDefaultConfig() {
|
|
86
71
|
const config = { enabled: true };
|
|
@@ -89,69 +74,37 @@ export class Widget {
|
|
|
89
74
|
}
|
|
90
75
|
return config;
|
|
91
76
|
}
|
|
92
|
-
applyInvisiblePreset() {
|
|
93
|
-
return [
|
|
94
|
-
this.window.setDecorations(false), // no title bar
|
|
95
|
-
this.window.setShadow(false), // no shadows
|
|
96
|
-
// hide from native shell
|
|
97
|
-
this.window.setSkipTaskbar(true),
|
|
98
|
-
// as a (desktop/overlay) widget we don't wanna allow nothing of these
|
|
99
|
-
this.window.setMinimizable(false),
|
|
100
|
-
this.window.setMaximizable(false),
|
|
101
|
-
this.window.setClosable(false),
|
|
102
|
-
];
|
|
103
|
-
}
|
|
104
77
|
/** Will apply the recommended settings for a desktop widget */
|
|
105
|
-
|
|
106
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnBottom(true)]);
|
|
107
|
-
}
|
|
78
|
+
applyDesktopPreset() { }
|
|
108
79
|
/** Will apply the recommended settings for an overlay widget */
|
|
109
|
-
|
|
110
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnTop(true)]);
|
|
111
|
-
}
|
|
80
|
+
applyOverlayPreset() { }
|
|
112
81
|
/** Will apply the recommended settings for a popup widget */
|
|
113
|
-
|
|
114
|
-
await Promise.all([...this.applyInvisiblePreset(), this.window.setAlwaysOnTop(true)]);
|
|
115
|
-
const hideWidget = debounce(() => {
|
|
116
|
-
this.hide(true);
|
|
117
|
-
}, 100);
|
|
118
|
-
this.window.onFocusChanged(({ payload: focused }) => {
|
|
119
|
-
if (focused) {
|
|
120
|
-
hideWidget.cancel();
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
hideWidget();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
82
|
+
applyPopupPreset() {
|
|
126
83
|
this.onTrigger(async ({ desiredPosition, alignX, alignY }) => {
|
|
127
|
-
// avoid flickering when clicking a button that triggers the widget
|
|
128
|
-
hideWidget.cancel();
|
|
129
|
-
if (this.autoSizer && alignX && alignY) {
|
|
130
|
-
this.autoSizer.originX = alignX;
|
|
131
|
-
this.autoSizer.originY = alignY;
|
|
132
|
-
}
|
|
133
84
|
if (desiredPosition) {
|
|
134
|
-
|
|
135
|
-
frame: {
|
|
136
|
-
x: desiredPosition.x,
|
|
137
|
-
y: desiredPosition.y,
|
|
138
|
-
width: this.runtimeState.size.width,
|
|
139
|
-
height: this.runtimeState.size.height,
|
|
140
|
-
},
|
|
141
|
-
originX: alignX,
|
|
142
|
-
originY: alignY,
|
|
143
|
-
});
|
|
144
|
-
await this.setPosition({
|
|
145
|
-
left: adjusted.x,
|
|
146
|
-
top: adjusted.y,
|
|
147
|
-
right: adjusted.x + adjusted.width,
|
|
148
|
-
bottom: adjusted.y + adjusted.height,
|
|
149
|
-
});
|
|
85
|
+
await this.adjustAndSetPosition(desiredPosition.x, desiredPosition.y, alignX, alignY);
|
|
150
86
|
}
|
|
151
87
|
await this.show();
|
|
152
88
|
await this.focus();
|
|
153
89
|
});
|
|
154
90
|
}
|
|
91
|
+
hideOnFocusLoss() {
|
|
92
|
+
let wasFocused = false;
|
|
93
|
+
const hideDelayed = debounce(() => {
|
|
94
|
+
this.hide();
|
|
95
|
+
}, 100);
|
|
96
|
+
subscribe(SeelenEvent.GlobalFocusChanged, ({ payload: focused }) => {
|
|
97
|
+
if (focused.hwnd !== this.runtimeState.hwnd && focused.ownerHwnd !== this.runtimeState.hwnd) {
|
|
98
|
+
if (wasFocused) {
|
|
99
|
+
hideDelayed();
|
|
100
|
+
}
|
|
101
|
+
wasFocused = false;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
wasFocused = true;
|
|
105
|
+
hideDelayed.cancel();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
155
108
|
/**
|
|
156
109
|
* Will restore the saved position and size of the widget on start,
|
|
157
110
|
* after that will store the position and size of the widget on change.
|
|
@@ -187,6 +140,18 @@ export class Widget {
|
|
|
187
140
|
console.info(`Widget size saved: ${width} ${height}`);
|
|
188
141
|
}, 500));
|
|
189
142
|
}
|
|
143
|
+
async normalizeDevicePixelRatio() {
|
|
144
|
+
// play with zoom level to reset device pixel ratio to 1:1
|
|
145
|
+
let oldDPR = globalThis.devicePixelRatio;
|
|
146
|
+
await this.webview.setZoom(1 / oldDPR);
|
|
147
|
+
this.window.onScaleChanged(() => {
|
|
148
|
+
if (globalThis.devicePixelRatio !== oldDPR) {
|
|
149
|
+
// when zoom was set dpr changed, so in case of change this is accomulative unit
|
|
150
|
+
oldDPR = oldDPR * globalThis.devicePixelRatio;
|
|
151
|
+
this.webview.setZoom(1 / (oldDPR * globalThis.devicePixelRatio));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
190
155
|
/**
|
|
191
156
|
* Will initialize the widget based on the preset and mark it as `pending`, this function won't show the widget.
|
|
192
157
|
* This should be called before any other action on the widget. After this you should call
|
|
@@ -199,23 +164,30 @@ export class Widget {
|
|
|
199
164
|
}
|
|
200
165
|
this.runtimeState.hwnd = await invoke(SeelenCommand.GetSelfWindowId);
|
|
201
166
|
this.runtimeState.initialized = true;
|
|
167
|
+
this.destroyOnHide = options.closeOnHide ?? this.def.lazy;
|
|
168
|
+
if (options.normalizeDevicePixelRatio) {
|
|
169
|
+
await this.normalizeDevicePixelRatio();
|
|
170
|
+
}
|
|
202
171
|
if (options.autoSizeByContent) {
|
|
203
|
-
this.autoSizer = new WidgetAutoSizer(this, options.autoSizeByContent);
|
|
172
|
+
this.autoSizer = new WidgetAutoSizer(this, options.autoSizeByContent, options.autoSizeFitOnScreen ?? true);
|
|
204
173
|
}
|
|
205
|
-
|
|
174
|
+
if (options.saveAndRestoreLastRect ?? this.def.preset === WidgetPreset.Desktop) {
|
|
206
175
|
await this.persistPositionAndSize();
|
|
207
176
|
}
|
|
177
|
+
if (options.hideOnFocusLoss ?? this.def.preset === WidgetPreset.Popup) {
|
|
178
|
+
this.hideOnFocusLoss();
|
|
179
|
+
}
|
|
208
180
|
switch (this.def.preset) {
|
|
209
181
|
case WidgetPreset.None:
|
|
210
182
|
break;
|
|
211
183
|
case WidgetPreset.Desktop:
|
|
212
|
-
|
|
184
|
+
this.applyDesktopPreset();
|
|
213
185
|
break;
|
|
214
186
|
case WidgetPreset.Overlay:
|
|
215
|
-
|
|
187
|
+
this.applyOverlayPreset();
|
|
216
188
|
break;
|
|
217
189
|
case WidgetPreset.Popup:
|
|
218
|
-
|
|
190
|
+
this.applyPopupPreset();
|
|
219
191
|
break;
|
|
220
192
|
}
|
|
221
193
|
await startThemingTool();
|
|
@@ -226,16 +198,8 @@ export class Widget {
|
|
|
226
198
|
else {
|
|
227
199
|
console.trace("Animations won't be disabled because widget configuration");
|
|
228
200
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
this.runtimeState.position = await this.window.outerPosition();
|
|
232
|
-
this.window.onResized((e) => {
|
|
233
|
-
this.runtimeState.size.width = e.payload.width;
|
|
234
|
-
this.runtimeState.size.height = e.payload.height;
|
|
235
|
-
});
|
|
236
|
-
this.window.onMoved((e) => {
|
|
237
|
-
this.runtimeState.position.x = e.payload.x;
|
|
238
|
-
this.runtimeState.position.y = e.payload.y;
|
|
201
|
+
await OPTIMISTIC_FRAME.runExclusive(async (state) => {
|
|
202
|
+
await state.init(this);
|
|
239
203
|
});
|
|
240
204
|
}
|
|
241
205
|
/**
|
|
@@ -257,7 +221,7 @@ export class Widget {
|
|
|
257
221
|
await this.autoSizer?.execute();
|
|
258
222
|
if (show && !(await this.window.isVisible())) {
|
|
259
223
|
await this.show();
|
|
260
|
-
await this.focus();
|
|
224
|
+
// await this.focus();
|
|
261
225
|
}
|
|
262
226
|
// this will mark the widget as ready, and send pending trigger event if exists
|
|
263
227
|
await invoke(SeelenCommand.SetCurrentWidgetStatus, { status: WidgetStatus.Ready });
|
|
@@ -267,13 +231,8 @@ export class Widget {
|
|
|
267
231
|
cb(payload);
|
|
268
232
|
});
|
|
269
233
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
this.runtimeState.position.x = rect.left;
|
|
273
|
-
this.runtimeState.position.y = rect.top;
|
|
274
|
-
this.runtimeState.size.width = rect.right - rect.left;
|
|
275
|
-
this.runtimeState.size.height = rect.bottom - rect.top;
|
|
276
|
-
return invoke(SeelenCommand.SetSelfPosition, {
|
|
234
|
+
async __unsafe_setPosition(rect, ref) {
|
|
235
|
+
await invoke(SeelenCommand.SetSelfPosition, {
|
|
277
236
|
rect: {
|
|
278
237
|
left: Math.round(rect.left),
|
|
279
238
|
top: Math.round(rect.top),
|
|
@@ -281,6 +240,40 @@ export class Widget {
|
|
|
281
240
|
bottom: Math.round(rect.bottom),
|
|
282
241
|
},
|
|
283
242
|
});
|
|
243
|
+
// optimistically update state, as arrived event after change is async
|
|
244
|
+
ref.x = rect.left;
|
|
245
|
+
ref.y = rect.top;
|
|
246
|
+
ref.width = rect.right - rect.left;
|
|
247
|
+
ref.height = rect.bottom - rect.top;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* This will adjust the position of the widget based on the current placement and alignX/alignY arguments.
|
|
251
|
+
* This makes the widget fit into the monitor where it was placed, avoiding monitor overflow.
|
|
252
|
+
*/
|
|
253
|
+
async adjustAndSetPosition(x, y, alignX, alignY) {
|
|
254
|
+
await OPTIMISTIC_FRAME.runExclusive(async (ref) => {
|
|
255
|
+
const adjusted = adjustPositionByPlacement({
|
|
256
|
+
frame: {
|
|
257
|
+
x,
|
|
258
|
+
y,
|
|
259
|
+
width: ref.width,
|
|
260
|
+
height: ref.height,
|
|
261
|
+
},
|
|
262
|
+
originX: alignX,
|
|
263
|
+
originY: alignY,
|
|
264
|
+
});
|
|
265
|
+
await Widget.self.__unsafe_setPosition({
|
|
266
|
+
left: adjusted.x,
|
|
267
|
+
top: adjusted.y,
|
|
268
|
+
right: adjusted.x + adjusted.width,
|
|
269
|
+
bottom: adjusted.y + adjusted.height,
|
|
270
|
+
}, ref);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
async setPosition(rect) {
|
|
274
|
+
await OPTIMISTIC_FRAME.runExclusive(async (frame) => {
|
|
275
|
+
await this.__unsafe_setPosition(rect, frame);
|
|
276
|
+
});
|
|
284
277
|
}
|
|
285
278
|
async show() {
|
|
286
279
|
debouncedClose.cancel();
|
|
@@ -292,13 +285,11 @@ export class Widget {
|
|
|
292
285
|
await getCurrentWebview().setFocus();
|
|
293
286
|
this.runtimeState.firstFocus = false;
|
|
294
287
|
}
|
|
295
|
-
await invoke(SeelenCommand.RequestFocus, { hwnd: this.runtimeState.hwnd }).catch(() => {
|
|
296
|
-
console.warn(`Failed to focus widget: ${this.decoded.label}`);
|
|
297
|
-
});
|
|
288
|
+
await invoke(SeelenCommand.RequestFocus, { hwnd: this.runtimeState.hwnd }).catch(() => { });
|
|
298
289
|
}
|
|
299
|
-
hide(
|
|
290
|
+
hide() {
|
|
300
291
|
this.window.hide();
|
|
301
|
-
if (
|
|
292
|
+
if (this.destroyOnHide) {
|
|
302
293
|
debouncedClose();
|
|
303
294
|
}
|
|
304
295
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Alignment } from "../../../gen/types/mod.js";
|
|
2
2
|
import { invoke, subscribe } from "../../handlers/mod.js";
|
|
3
|
-
import { SeelenCommand } from "../../
|
|
3
|
+
import { SeelenCommand } from "../../handlers/commands.js";
|
|
4
4
|
import { SeelenEvent } from "../../handlers/events.js";
|
|
5
5
|
const monitors = {
|
|
6
6
|
value: [],
|
|
@@ -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,21 +1,57 @@
|
|
|
1
|
-
import { PhysicalSize } from "@tauri-apps/api/dpi";
|
|
2
1
|
import { Alignment } from "../../../gen/types/mod.js";
|
|
2
|
+
import { Mutex } from "../../utils/async.js";
|
|
3
|
+
import { fitIntoMonitor } from "./positioning.js";
|
|
4
|
+
class OptimisiticFrame {
|
|
5
|
+
x = 0;
|
|
6
|
+
y = 0;
|
|
7
|
+
width = 0;
|
|
8
|
+
height = 0;
|
|
9
|
+
async init(widget) {
|
|
10
|
+
const { width, height } = await widget.window.outerSize();
|
|
11
|
+
const { x, y } = await widget.window.outerPosition();
|
|
12
|
+
this.width = width;
|
|
13
|
+
this.height = height;
|
|
14
|
+
this.x = x;
|
|
15
|
+
this.y = y;
|
|
16
|
+
widget.window.onResized((e) => {
|
|
17
|
+
OPTIMISTIC_FRAME.runExclusive((ref) => {
|
|
18
|
+
ref.width = e.payload.width;
|
|
19
|
+
ref.height = e.payload.height;
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
widget.window.onMoved((e) => {
|
|
23
|
+
OPTIMISTIC_FRAME.runExclusive((ref) => {
|
|
24
|
+
ref.x = e.payload.x;
|
|
25
|
+
ref.y = e.payload.y;
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export const OPTIMISTIC_FRAME = new Mutex(new OptimisiticFrame());
|
|
3
31
|
export class WidgetAutoSizer {
|
|
4
32
|
widget;
|
|
5
33
|
element;
|
|
34
|
+
fitOnScreen;
|
|
6
35
|
/** From which side the widget will grow */
|
|
7
|
-
originX
|
|
36
|
+
originX;
|
|
8
37
|
/** From which side the widget will grow */
|
|
9
|
-
originY
|
|
10
|
-
constructor(widget, element) {
|
|
38
|
+
originY;
|
|
39
|
+
constructor(widget, element, fitOnScreen) {
|
|
11
40
|
this.widget = widget;
|
|
12
41
|
this.element = element;
|
|
42
|
+
this.fitOnScreen = fitOnScreen;
|
|
13
43
|
this.execute = this.execute.bind(this);
|
|
14
44
|
this.setup();
|
|
15
45
|
}
|
|
16
46
|
setup() {
|
|
17
47
|
// Disable resizing by the user
|
|
18
48
|
this.widget.window.setResizable(false);
|
|
49
|
+
this.widget.onTrigger(({ alignX, alignY }) => {
|
|
50
|
+
OPTIMISTIC_FRAME.runExclusive(() => {
|
|
51
|
+
this.originX = alignX;
|
|
52
|
+
this.originY = alignY;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
19
55
|
const observer = new ResizeObserver(this.execute);
|
|
20
56
|
observer.observe(this.element, {
|
|
21
57
|
box: "border-box",
|
|
@@ -25,8 +61,9 @@ export class WidgetAutoSizer {
|
|
|
25
61
|
};
|
|
26
62
|
}
|
|
27
63
|
async execute() {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
64
|
+
const guard = await OPTIMISTIC_FRAME.acquire();
|
|
65
|
+
const { x, y, width, height } = guard.value;
|
|
66
|
+
let frame = {
|
|
30
67
|
x,
|
|
31
68
|
y,
|
|
32
69
|
width: Math.ceil(this.element.scrollWidth * globalThis.window.devicePixelRatio),
|
|
@@ -36,9 +73,12 @@ export class WidgetAutoSizer {
|
|
|
36
73
|
const heightDiff = frame.height - height;
|
|
37
74
|
// Only update if the difference is more than 1px (avoid infinite loops from decimal differences)
|
|
38
75
|
if (widthDiff === 0 && heightDiff === 0) {
|
|
76
|
+
guard.release();
|
|
39
77
|
return;
|
|
40
78
|
}
|
|
41
|
-
console.
|
|
79
|
+
/* console.debug(
|
|
80
|
+
`Auto resizing from ${width}x${height} to ${frame.width}x${frame.height} using ${this.originX}/${this.originY} origin`,
|
|
81
|
+
); */
|
|
42
82
|
if (this.originX === Alignment.Center) {
|
|
43
83
|
frame.x -= widthDiff / 2;
|
|
44
84
|
}
|
|
@@ -51,16 +91,19 @@ export class WidgetAutoSizer {
|
|
|
51
91
|
else if (this.originY === Alignment.End) {
|
|
52
92
|
frame.y -= heightDiff;
|
|
53
93
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
94
|
+
if (this.fitOnScreen) {
|
|
95
|
+
frame = fitIntoMonitor(frame);
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
await this.widget.__unsafe_setPosition({
|
|
99
|
+
left: frame.x,
|
|
100
|
+
top: frame.y,
|
|
101
|
+
right: frame.x + frame.width,
|
|
102
|
+
bottom: frame.y + frame.height,
|
|
103
|
+
}, guard.value);
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
guard.release();
|
|
58
107
|
}
|
|
59
|
-
await this.widget.setPosition({
|
|
60
|
-
left: frame.x,
|
|
61
|
-
top: frame.y,
|
|
62
|
-
right: frame.x + frame.width,
|
|
63
|
-
bottom: frame.y + frame.height,
|
|
64
|
-
});
|
|
65
108
|
}
|
|
66
109
|
}
|
|
@@ -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"}
|
|
@@ -12,36 +12,19 @@ export class UIColors {
|
|
|
12
12
|
static onChange(cb) {
|
|
13
13
|
return newOnEvent(cb, this, SeelenEvent.ColorsChanged);
|
|
14
14
|
}
|
|
15
|
-
static default() {
|
|
16
|
-
return new this({
|
|
17
|
-
background: "#ffffff",
|
|
18
|
-
foreground: "#000000",
|
|
19
|
-
accent_darkest: "#990000",
|
|
20
|
-
accent_darker: "#aa0000",
|
|
21
|
-
accent_dark: "#bb0000",
|
|
22
|
-
accent: "#cc0000",
|
|
23
|
-
accent_light: "#dd0000",
|
|
24
|
-
accent_lighter: "#ee0000",
|
|
25
|
-
accent_lightest: "#ff0000",
|
|
26
|
-
complement: null,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
15
|
setAsCssVariables() {
|
|
30
16
|
const oldStyles = new RuntimeStyleSheet("@deprecated/system-colors");
|
|
31
17
|
const newStyles = new RuntimeStyleSheet("@runtime/system-colors");
|
|
32
|
-
for (const [key,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
const color = Color.fromHex(value);
|
|
37
|
-
const { r, g, b } = color;
|
|
18
|
+
for (const [key, _color] of Object.entries(this.inner)) {
|
|
19
|
+
const color = new Color(_color);
|
|
20
|
+
const { r, g, b } = _color;
|
|
38
21
|
// replace rust snake case with kebab case
|
|
39
22
|
const name = key.replace("_", "-");
|
|
40
23
|
// @deprecated old names
|
|
41
|
-
oldStyles.addVariable(`--config-${name}-color`,
|
|
24
|
+
oldStyles.addVariable(`--config-${name}-color`, color.toHexString());
|
|
42
25
|
oldStyles.addVariable(`--config-${name}-color-rgb`, `${r}, ${g}, ${b}`);
|
|
43
26
|
if (name.startsWith("accent")) {
|
|
44
|
-
newStyles.addVariable(`--system-${name}-color`,
|
|
27
|
+
newStyles.addVariable(`--system-${name}-color`, color.toHexString());
|
|
45
28
|
}
|
|
46
29
|
}
|
|
47
30
|
oldStyles.applyToDocument();
|
package/esm/src/utils/async.d.ts
CHANGED
|
@@ -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"}
|
package/esm/src/utils/async.js
CHANGED
|
@@ -37,3 +37,49 @@ export function debounce(fn, delay) {
|
|
|
37
37
|
};
|
|
38
38
|
return debounced;
|
|
39
39
|
}
|
|
40
|
+
export class Mutex {
|
|
41
|
+
_rawValue;
|
|
42
|
+
constructor(_rawValue) {
|
|
43
|
+
this._rawValue = _rawValue;
|
|
44
|
+
}
|
|
45
|
+
lock = null;
|
|
46
|
+
async acquire() {
|
|
47
|
+
if (this.lock) {
|
|
48
|
+
await this.lock.__promise;
|
|
49
|
+
}
|
|
50
|
+
// deno-lint-ignore no-explicit-any
|
|
51
|
+
let __resolve;
|
|
52
|
+
// deno-lint-ignore no-explicit-any
|
|
53
|
+
let __reject;
|
|
54
|
+
const __promise = new Promise((resolve, reject) => {
|
|
55
|
+
__resolve = resolve;
|
|
56
|
+
__reject = reject;
|
|
57
|
+
});
|
|
58
|
+
this.lock = {
|
|
59
|
+
__promise,
|
|
60
|
+
__resolve,
|
|
61
|
+
__reject,
|
|
62
|
+
};
|
|
63
|
+
return new Guard(this._rawValue, () => {
|
|
64
|
+
this.lock = null;
|
|
65
|
+
__resolve();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async runExclusive(fn) {
|
|
69
|
+
const guard = await this.acquire();
|
|
70
|
+
try {
|
|
71
|
+
return await fn(guard.value);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
guard.release();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class Guard {
|
|
79
|
+
value;
|
|
80
|
+
release;
|
|
81
|
+
constructor(value, release) {
|
|
82
|
+
this.value = value;
|
|
83
|
+
this.release = release;
|
|
84
|
+
}
|
|
85
|
+
}
|
package/esm/src/utils/mod.d.ts
CHANGED
|
@@ -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/esm/src/utils/mod.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seelen-ui/lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.6-next.2605170835",
|
|
4
4
|
"description": "Seelen UI Library for Widgets",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"./tauri": {
|
|
25
25
|
"import": "./esm/src/re-exports/tauri.js",
|
|
26
26
|
"require": "./script/src/re-exports/tauri.js"
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
|
+
"./styles/*": "./styles/*"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@tauri-apps/api": "^2.
|
|
32
|
-
"@tauri-apps/plugin-dialog": "^2.
|
|
33
|
-
"@tauri-apps/plugin-fs": "^2.
|
|
32
|
+
"@tauri-apps/api": "^2.11.0",
|
|
33
|
+
"@tauri-apps/plugin-dialog": "^2.7.1",
|
|
34
|
+
"@tauri-apps/plugin-fs": "^2.5.1",
|
|
34
35
|
"@tauri-apps/plugin-log": "^2.8.0",
|
|
35
36
|
"@tauri-apps/plugin-process": "^2.3.1"
|
|
36
37
|
},
|
|
37
38
|
"_generatedBy": "dnt@dev"
|
|
38
|
-
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppBarEdge.d.ts","sourceRoot":"","sources":["../../../src/gen/types/AppBarEdge.ts"],"names":[],"mappings":"AAEA,oBAAY,UAAU;IAAG,KAAK,QAAQ;IAAE,MAAM,SAAS;IAAE,QAAQ,WAAW;IAAE,OAAO,UAAU;CAAE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AppBarEdge = void 0;
|
|
5
|
+
var AppBarEdge;
|
|
6
|
+
(function (AppBarEdge) {
|
|
7
|
+
AppBarEdge["Top"] = "Top";
|
|
8
|
+
AppBarEdge["Left"] = "Left";
|
|
9
|
+
AppBarEdge["Bottom"] = "Bottom";
|
|
10
|
+
AppBarEdge["Right"] = "Right";
|
|
11
|
+
})(AppBarEdge || (exports.AppBarEdge = AppBarEdge = {}));
|