@moldable-ai/ui 0.2.19 → 0.2.21
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/dist/catalog/catalog-coverage.d.ts +15 -0
- package/dist/catalog/catalog-coverage.d.ts.map +1 -0
- package/dist/catalog/catalog-coverage.js +44 -0
- package/dist/catalog/catalog-manifest.d.ts +6 -0
- package/dist/catalog/catalog-manifest.d.ts.map +1 -0
- package/dist/catalog/catalog-manifest.js +117 -0
- package/dist/catalog/catalog-types.d.ts +64 -0
- package/dist/catalog/catalog-types.d.ts.map +1 -0
- package/dist/catalog/catalog-types.js +20 -0
- package/dist/catalog/component-catalog.d.ts +14 -0
- package/dist/catalog/component-catalog.d.ts.map +1 -0
- package/dist/catalog/component-catalog.js +49 -0
- package/dist/catalog/core-catalog-exclusions.d.ts +8 -0
- package/dist/catalog/core-catalog-exclusions.d.ts.map +1 -0
- package/dist/catalog/core-catalog-exclusions.js +151 -0
- package/dist/catalog/core-catalog.d.ts +2 -0
- package/dist/catalog/core-catalog.d.ts.map +1 -0
- package/dist/catalog/core-catalog.js +19 -0
- package/dist/catalog/core-collection-stories.d.ts +3 -0
- package/dist/catalog/core-collection-stories.d.ts.map +1 -0
- package/dist/catalog/core-collection-stories.js +42 -0
- package/dist/catalog/core-control-stories.d.ts +3 -0
- package/dist/catalog/core-control-stories.d.ts.map +1 -0
- package/dist/catalog/core-control-stories.js +94 -0
- package/dist/catalog/core-feedback-stories.d.ts +3 -0
- package/dist/catalog/core-feedback-stories.d.ts.map +1 -0
- package/dist/catalog/core-feedback-stories.js +50 -0
- package/dist/catalog/core-foundation-stories.d.ts +3 -0
- package/dist/catalog/core-foundation-stories.d.ts.map +1 -0
- package/dist/catalog/core-foundation-stories.js +53 -0
- package/dist/catalog/core-navigation-stories.d.ts +3 -0
- package/dist/catalog/core-navigation-stories.d.ts.map +1 -0
- package/dist/catalog/core-navigation-stories.js +25 -0
- package/dist/catalog/core-overlay-stories.d.ts +3 -0
- package/dist/catalog/core-overlay-stories.d.ts.map +1 -0
- package/dist/catalog/core-overlay-stories.js +20 -0
- package/dist/catalog/index.d.ts +7 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +6 -0
- package/dist/components/app-error-boundary.d.ts +1 -0
- package/dist/components/app-error-boundary.d.ts.map +1 -1
- package/dist/components/app-error-boundary.js +13 -0
- package/dist/components/chat/chat-image-lightbox.d.ts +9 -0
- package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -0
- package/dist/components/chat/chat-image-lightbox.js +9 -0
- package/dist/components/chat/chat-message.d.ts +19 -1
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +66 -16
- package/dist/components/chat/chat-messages.d.ts +5 -2
- package/dist/components/chat/chat-messages.d.ts.map +1 -1
- package/dist/components/chat/chat-messages.js +61 -6
- package/dist/components/chat/chat-panel.d.ts +49 -6
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +196 -163
- package/dist/components/chat/conversation-history.d.ts +39 -5
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +192 -26
- package/dist/components/chat/index.d.ts +2 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +1 -1
- package/dist/components/chat/tool-handlers.d.ts.map +1 -1
- package/dist/components/chat/tool-handlers.js +40 -2
- package/dist/components/chat/vertical-scroll-fade.d.ts +6 -0
- package/dist/components/chat/vertical-scroll-fade.d.ts.map +1 -0
- package/dist/components/chat/vertical-scroll-fade.js +12 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts +9 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel-helpers.js +37 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts +56 -0
- package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/bluetooth-panel.js +470 -0
- package/dist/components/native-capabilities/camera-preview.d.ts +39 -0
- package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/camera-preview.js +228 -0
- package/dist/components/native-capabilities/capability-badge.d.ts +23 -0
- package/dist/components/native-capabilities/capability-badge.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-badge.js +39 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts +14 -0
- package/dist/components/native-capabilities/capability-matrix.d.ts.map +1 -0
- package/dist/components/native-capabilities/capability-matrix.js +97 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts +26 -0
- package/dist/components/native-capabilities/clipboard-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/clipboard-button.js +99 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts +4 -0
- package/dist/components/native-capabilities/device-io-controls.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-io-controls.js +28 -0
- package/dist/components/native-capabilities/device-list.d.ts +20 -0
- package/dist/components/native-capabilities/device-list.d.ts.map +1 -0
- package/dist/components/native-capabilities/device-list.js +14 -0
- package/dist/components/native-capabilities/display-map.d.ts +23 -0
- package/dist/components/native-capabilities/display-map.d.ts.map +1 -0
- package/dist/components/native-capabilities/display-map.js +114 -0
- package/dist/components/native-capabilities/haptic-button.d.ts +26 -0
- package/dist/components/native-capabilities/haptic-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/haptic-button.js +94 -0
- package/dist/components/native-capabilities/hid-panel.d.ts +40 -0
- package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/hid-panel.js +373 -0
- package/dist/components/native-capabilities/index.d.ts +27 -0
- package/dist/components/native-capabilities/index.d.ts.map +1 -0
- package/dist/components/native-capabilities/index.js +26 -0
- package/dist/components/native-capabilities/live-indicator.d.ts +15 -0
- package/dist/components/native-capabilities/live-indicator.d.ts.map +1 -0
- package/dist/components/native-capabilities/live-indicator.js +26 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts +33 -0
- package/dist/components/native-capabilities/local-auth-button.d.ts.map +1 -0
- package/dist/components/native-capabilities/local-auth-button.js +115 -0
- package/dist/components/native-capabilities/location-panel.d.ts +29 -0
- package/dist/components/native-capabilities/location-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/location-panel.js +146 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts +35 -0
- package/dist/components/native-capabilities/microphone-meter.d.ts.map +1 -0
- package/dist/components/native-capabilities/microphone-meter.js +244 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts +54 -0
- package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/midi-monitor.js +534 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts +11 -0
- package/dist/components/native-capabilities/native-capability-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/native-capability-panel.js +28 -0
- package/dist/components/native-capabilities/notification-panel.d.ts +24 -0
- package/dist/components/native-capabilities/notification-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/notification-panel.js +124 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts +19 -0
- package/dist/components/native-capabilities/power-blocker-controller.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-blocker-controller.js +83 -0
- package/dist/components/native-capabilities/power-panel.d.ts +67 -0
- package/dist/components/native-capabilities/power-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/power-panel.js +309 -0
- package/dist/components/native-capabilities/readout.d.ts +10 -0
- package/dist/components/native-capabilities/readout.d.ts.map +1 -0
- package/dist/components/native-capabilities/readout.js +11 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts +36 -0
- package/dist/components/native-capabilities/screen-share-preview.d.ts.map +1 -0
- package/dist/components/native-capabilities/screen-share-preview.js +191 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts +36 -0
- package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/secure-storage-panel.js +193 -0
- package/dist/components/native-capabilities/serial-console.d.ts +64 -0
- package/dist/components/native-capabilities/serial-console.d.ts.map +1 -0
- package/dist/components/native-capabilities/serial-console.js +399 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts +35 -0
- package/dist/components/native-capabilities/shortcut-recorder.d.ts.map +1 -0
- package/dist/components/native-capabilities/shortcut-recorder.js +217 -0
- package/dist/components/native-capabilities/stream-log.d.ts +35 -0
- package/dist/components/native-capabilities/stream-log.d.ts.map +1 -0
- package/dist/components/native-capabilities/stream-log.js +65 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts +34 -0
- package/dist/components/native-capabilities/system-audio-monitor.d.ts.map +1 -0
- package/dist/components/native-capabilities/system-audio-monitor.js +275 -0
- package/dist/components/native-capabilities/usb-panel.d.ts +54 -0
- package/dist/components/native-capabilities/usb-panel.d.ts.map +1 -0
- package/dist/components/native-capabilities/usb-panel.js +363 -0
- package/dist/components/native-capabilities/use-capability.d.ts +20 -0
- package/dist/components/native-capabilities/use-capability.d.ts.map +1 -0
- package/dist/components/native-capabilities/use-capability.js +61 -0
- package/dist/components/ui/alert-dialog.d.ts +7 -3
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +9 -5
- package/dist/components/ui/alert.d.ts +19 -3
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +25 -8
- package/dist/components/ui/app-frame.d.ts +28 -0
- package/dist/components/ui/app-frame.d.ts.map +1 -0
- package/dist/components/ui/app-frame.js +95 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/collapsible.d.ts +9 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +13 -2
- package/dist/components/ui/collection-navigation.d.ts +8 -0
- package/dist/components/ui/collection-navigation.d.ts.map +1 -0
- package/dist/components/ui/collection-navigation.js +19 -0
- package/dist/components/ui/color-well.d.ts +13 -0
- package/dist/components/ui/color-well.d.ts.map +1 -0
- package/dist/components/ui/color-well.js +30 -0
- package/dist/components/ui/command.d.ts +5 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +13 -1
- package/dist/components/ui/confirm-dialog.d.ts +19 -0
- package/dist/components/ui/confirm-dialog.d.ts.map +1 -0
- package/dist/components/ui/confirm-dialog.js +45 -0
- package/dist/components/ui/date-field.d.ts +19 -0
- package/dist/components/ui/date-field.d.ts.map +1 -0
- package/dist/components/ui/date-field.js +54 -0
- package/dist/components/ui/date-picker.d.ts +24 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +92 -0
- package/dist/components/ui/dialog.d.ts +4 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +8 -5
- package/dist/components/ui/edge-fade.d.ts +11 -0
- package/dist/components/ui/edge-fade.d.ts.map +1 -0
- package/dist/components/ui/edge-fade.js +41 -0
- package/dist/components/ui/empty.d.ts +7 -2
- package/dist/components/ui/empty.d.ts.map +1 -1
- package/dist/components/ui/empty.js +20 -7
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/grid.d.ts +24 -0
- package/dist/components/ui/grid.d.ts.map +1 -0
- package/dist/components/ui/grid.js +258 -0
- package/dist/components/ui/icon-button.d.ts +15 -0
- package/dist/components/ui/icon-button.d.ts.map +1 -0
- package/dist/components/ui/icon-button.js +15 -0
- package/dist/components/ui/index.d.ts +23 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +23 -0
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/inspector.d.ts +15 -0
- package/dist/components/ui/inspector.d.ts.map +1 -0
- package/dist/components/ui/inspector.js +26 -0
- package/dist/components/ui/kbd.d.ts +1 -1
- package/dist/components/ui/list.d.ts +28 -0
- package/dist/components/ui/list.d.ts.map +1 -0
- package/dist/components/ui/list.js +235 -0
- package/dist/components/ui/material.d.ts +34 -0
- package/dist/components/ui/material.d.ts.map +1 -0
- package/dist/components/ui/material.js +34 -0
- package/dist/components/ui/message-scroller-controller.d.ts +162 -0
- package/dist/components/ui/message-scroller-controller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-controller.js +888 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts +33 -0
- package/dist/components/ui/message-scroller-layout-stability.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-layout-stability.js +153 -0
- package/dist/components/ui/message-scroller-policy.d.ts +74 -0
- package/dist/components/ui/message-scroller-policy.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-policy.js +129 -0
- package/dist/components/ui/message-scroller-primitive.d.ts +55 -0
- package/dist/components/ui/message-scroller-primitive.d.ts.map +1 -0
- package/dist/components/ui/message-scroller-primitive.js +226 -0
- package/dist/components/ui/message-scroller.d.ts +11 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -0
- package/dist/components/ui/message-scroller.js +25 -0
- package/dist/components/ui/navigation-button-group.d.ts +16 -0
- package/dist/components/ui/navigation-button-group.d.ts.map +1 -0
- package/dist/components/ui/navigation-button-group.js +9 -0
- package/dist/components/ui/notification-dot.d.ts +4 -0
- package/dist/components/ui/notification-dot.d.ts.map +1 -0
- package/dist/components/ui/notification-dot.js +7 -0
- package/dist/components/ui/number-input.d.ts +16 -0
- package/dist/components/ui/number-input.d.ts.map +1 -0
- package/dist/components/ui/number-input.js +56 -0
- package/dist/components/ui/panel.d.ts +18 -0
- package/dist/components/ui/panel.d.ts.map +1 -0
- package/dist/components/ui/panel.js +40 -0
- package/dist/components/ui/popover.d.ts +9 -2
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +14 -4
- package/dist/components/ui/scroll-area.d.ts +8 -2
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +6 -3
- package/dist/components/ui/search-field.d.ts +19 -0
- package/dist/components/ui/search-field.d.ts.map +1 -0
- package/dist/components/ui/search-field.js +64 -0
- package/dist/components/ui/segmented-control.d.ts +21 -0
- package/dist/components/ui/segmented-control.d.ts.map +1 -0
- package/dist/components/ui/segmented-control.js +62 -0
- package/dist/components/ui/sheet.d.ts +4 -2
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +12 -9
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/sonner.d.ts +4 -3
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/sonner.js +7 -6
- package/dist/components/ui/split-view.d.ts +11 -0
- package/dist/components/ui/split-view.d.ts.map +1 -0
- package/dist/components/ui/split-view.js +13 -0
- package/dist/components/ui/status.d.ts +13 -0
- package/dist/components/ui/status.d.ts.map +1 -0
- package/dist/components/ui/status.js +36 -0
- package/dist/components/ui/table.d.ts +11 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +33 -6
- package/dist/components/ui/text.d.ts +17 -0
- package/dist/components/ui/text.d.ts.map +1 -0
- package/dist/components/ui/text.js +55 -0
- package/dist/components/ui/toggle.d.ts +12 -4
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +13 -2
- package/dist/components/ui/toolbar.d.ts +27 -0
- package/dist/components/ui/toolbar.d.ts.map +1 -0
- package/dist/components/ui/toolbar.js +71 -0
- package/dist/components/ui/tooltip.d.ts +8 -3
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +11 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lib/frame-lifecycle.d.ts +29 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +85 -0
- package/dist/lib/native-capabilities/access.d.ts +13 -0
- package/dist/lib/native-capabilities/access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/access.js +53 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts +14 -0
- package/dist/lib/native-capabilities/bluetooth-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-access.js +43 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts +19 -0
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-connection.js +88 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-gatt.js +77 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts +10 -0
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-internal.js +105 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +33 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-native-fallback.js +214 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts +85 -0
- package/dist/lib/native-capabilities/bluetooth-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth-types.js +2 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts +7 -0
- package/dist/lib/native-capabilities/bluetooth.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bluetooth.js +4 -0
- package/dist/lib/native-capabilities/bridge.d.ts +23 -0
- package/dist/lib/native-capabilities/bridge.d.ts.map +1 -0
- package/dist/lib/native-capabilities/bridge.js +266 -0
- package/dist/lib/native-capabilities/capabilities.d.ts +7 -0
- package/dist/lib/native-capabilities/capabilities.d.ts.map +1 -0
- package/dist/lib/native-capabilities/capabilities.js +95 -0
- package/dist/lib/native-capabilities/clipboard.d.ts +11 -0
- package/dist/lib/native-capabilities/clipboard.d.ts.map +1 -0
- package/dist/lib/native-capabilities/clipboard.js +58 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts +11 -0
- package/dist/lib/native-capabilities/device-io-errors.d.ts.map +1 -0
- package/dist/lib/native-capabilities/device-io-errors.js +82 -0
- package/dist/lib/native-capabilities/displays.d.ts +38 -0
- package/dist/lib/native-capabilities/displays.d.ts.map +1 -0
- package/dist/lib/native-capabilities/displays.js +12 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts +86 -0
- package/dist/lib/native-capabilities/global-shortcuts.d.ts.map +1 -0
- package/dist/lib/native-capabilities/global-shortcuts.js +351 -0
- package/dist/lib/native-capabilities/haptics.d.ts +25 -0
- package/dist/lib/native-capabilities/haptics.d.ts.map +1 -0
- package/dist/lib/native-capabilities/haptics.js +18 -0
- package/dist/lib/native-capabilities/hid-native.d.ts +26 -0
- package/dist/lib/native-capabilities/hid-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid-native.js +229 -0
- package/dist/lib/native-capabilities/hid.d.ts +52 -0
- package/dist/lib/native-capabilities/hid.d.ts.map +1 -0
- package/dist/lib/native-capabilities/hid.js +163 -0
- package/dist/lib/native-capabilities/index.d.ts +40 -0
- package/dist/lib/native-capabilities/index.d.ts.map +1 -0
- package/dist/lib/native-capabilities/index.js +21 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts +32 -0
- package/dist/lib/native-capabilities/local-authentication.d.ts.map +1 -0
- package/dist/lib/native-capabilities/local-authentication.js +46 -0
- package/dist/lib/native-capabilities/location.d.ts +49 -0
- package/dist/lib/native-capabilities/location.d.ts.map +1 -0
- package/dist/lib/native-capabilities/location.js +114 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts +28 -0
- package/dist/lib/native-capabilities/media-permissions.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media-permissions.js +37 -0
- package/dist/lib/native-capabilities/media.d.ts +17 -0
- package/dist/lib/native-capabilities/media.d.ts.map +1 -0
- package/dist/lib/native-capabilities/media.js +104 -0
- package/dist/lib/native-capabilities/midi-access.d.ts +13 -0
- package/dist/lib/native-capabilities/midi-access.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-access.js +68 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts +12 -0
- package/dist/lib/native-capabilities/midi-internal.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-internal.js +88 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts +27 -0
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-native-fallback.js +127 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts +6 -0
- package/dist/lib/native-capabilities/midi-ports.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-ports.js +115 -0
- package/dist/lib/native-capabilities/midi-types.d.ts +25 -0
- package/dist/lib/native-capabilities/midi-types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi-types.js +1 -0
- package/dist/lib/native-capabilities/midi.d.ts +6 -0
- package/dist/lib/native-capabilities/midi.d.ts.map +1 -0
- package/dist/lib/native-capabilities/midi.js +3 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts +28 -0
- package/dist/lib/native-capabilities/native-device-io.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-io.js +91 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts +13 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.d.ts.map +1 -0
- package/dist/lib/native-capabilities/native-device-lifecycle.js +40 -0
- package/dist/lib/native-capabilities/notifications.d.ts +38 -0
- package/dist/lib/native-capabilities/notifications.d.ts.map +1 -0
- package/dist/lib/native-capabilities/notifications.js +50 -0
- package/dist/lib/native-capabilities/power-session.d.ts +113 -0
- package/dist/lib/native-capabilities/power-session.d.ts.map +1 -0
- package/dist/lib/native-capabilities/power-session.js +264 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts +36 -0
- package/dist/lib/native-capabilities/secure-storage.d.ts.map +1 -0
- package/dist/lib/native-capabilities/secure-storage.js +64 -0
- package/dist/lib/native-capabilities/serial-native.d.ts +23 -0
- package/dist/lib/native-capabilities/serial-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial-native.js +181 -0
- package/dist/lib/native-capabilities/serial.d.ts +76 -0
- package/dist/lib/native-capabilities/serial.d.ts.map +1 -0
- package/dist/lib/native-capabilities/serial.js +215 -0
- package/dist/lib/native-capabilities/system-audio.d.ts +127 -0
- package/dist/lib/native-capabilities/system-audio.d.ts.map +1 -0
- package/dist/lib/native-capabilities/system-audio.js +330 -0
- package/dist/lib/native-capabilities/types.d.ts +62 -0
- package/dist/lib/native-capabilities/types.d.ts.map +1 -0
- package/dist/lib/native-capabilities/types.js +27 -0
- package/dist/lib/native-capabilities/usb-native.d.ts +39 -0
- package/dist/lib/native-capabilities/usb-native.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb-native.js +217 -0
- package/dist/lib/native-capabilities/usb.d.ts +85 -0
- package/dist/lib/native-capabilities/usb.d.ts.map +1 -0
- package/dist/lib/native-capabilities/usb.js +225 -0
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +2 -1
- package/docs/README.md +39 -0
- package/docs/accessibility.md +32 -0
- package/docs/adaptive-materials.md +79 -0
- package/docs/app-anatomy.md +74 -0
- package/docs/component-catalog.md +82 -0
- package/docs/component-guide-template.md +37 -0
- package/docs/design-tokens.md +185 -0
- package/docs/foundations.md +58 -0
- package/docs/native-integration.md +33 -0
- package/docs/standalone-app-windows.md +136 -0
- package/package.json +8 -3
- package/src/components/ui/alert-dialog.md +31 -0
- package/src/components/ui/alert.md +77 -0
- package/src/components/ui/app-frame.md +38 -0
- package/src/components/ui/badge.md +57 -0
- package/src/components/ui/button.md +76 -0
- package/src/components/ui/collapsible.md +52 -0
- package/src/components/ui/color-well.md +11 -0
- package/src/components/ui/combobox.md +42 -0
- package/src/components/ui/command.md +54 -0
- package/src/components/ui/date-field.md +32 -0
- package/src/components/ui/date-picker.md +55 -0
- package/src/components/ui/dialog.md +40 -0
- package/src/components/ui/edge-fade.md +7 -0
- package/src/components/ui/empty.md +87 -0
- package/src/components/ui/field.md +77 -0
- package/src/components/ui/grid.md +109 -0
- package/src/components/ui/icon-button.md +36 -0
- package/src/components/ui/inspector.md +11 -0
- package/src/components/ui/item.md +87 -0
- package/src/components/ui/list.md +140 -0
- package/src/components/ui/material.md +51 -0
- package/src/components/ui/navigation-button-group.md +46 -0
- package/src/components/ui/notification-dot.md +7 -0
- package/src/components/ui/number-input.md +19 -0
- package/src/components/ui/panel.md +11 -0
- package/src/components/ui/popover.md +31 -0
- package/src/components/ui/resizable.md +66 -0
- package/src/components/ui/scroll-area.md +72 -0
- package/src/components/ui/search-field.md +33 -0
- package/src/components/ui/segmented-control.md +36 -0
- package/src/components/ui/sheet.md +30 -0
- package/src/components/ui/sidebar.md +113 -0
- package/src/components/ui/sonner.md +37 -0
- package/src/components/ui/split-view.md +15 -0
- package/src/components/ui/status.md +12 -0
- package/src/components/ui/table.md +37 -0
- package/src/components/ui/tabs.md +66 -0
- package/src/components/ui/text.md +17 -0
- package/src/components/ui/toggle-button.md +48 -0
- package/src/components/ui/toggle-group.md +80 -0
- package/src/components/ui/toggle.md +73 -0
- package/src/components/ui/toolbar.md +26 -0
- package/src/components/ui/tooltip.md +31 -0
- package/src/styles/index.css +704 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
2
|
+
import type { NativeCapabilityRequestEnvelope, NativeCapabilityResultEnvelope } from './types';
|
|
3
|
+
export declare const NATIVE_POWER_SESSION_REQUEST_TYPE: "moldable:native-power-session";
|
|
4
|
+
export declare const NATIVE_POWER_SESSION_RESULT_TYPE: "moldable:native-power-session-result";
|
|
5
|
+
export declare const NATIVE_POWER_SESSION_EVENT_TYPE: "moldable:native-power-session-event";
|
|
6
|
+
export type MoldablePowerSource = 'ac' | 'battery' | 'unknown';
|
|
7
|
+
export type MoldableBatteryState = 'charging' | 'discharging' | 'empty' | 'full' | 'unknown';
|
|
8
|
+
export interface MoldableBatteryStatus {
|
|
9
|
+
state: MoldableBatteryState;
|
|
10
|
+
chargePercent: number;
|
|
11
|
+
timeToEmptySeconds: number | null;
|
|
12
|
+
timeToFullSeconds: number | null;
|
|
13
|
+
}
|
|
14
|
+
export interface MoldablePowerState {
|
|
15
|
+
source: MoldablePowerSource;
|
|
16
|
+
batteries: MoldableBatteryStatus[];
|
|
17
|
+
}
|
|
18
|
+
export type MoldableSystemIdleState = 'active' | 'idle' | 'locked';
|
|
19
|
+
export type MoldableThermalState = 'nominal' | 'fair' | 'serious' | 'critical' | 'unknown';
|
|
20
|
+
export interface MoldableSystemIdleResult {
|
|
21
|
+
seconds: number;
|
|
22
|
+
state: MoldableSystemIdleState;
|
|
23
|
+
thresholdSeconds: number;
|
|
24
|
+
}
|
|
25
|
+
export type MoldableSleepBlockerType = 'prevent-app-suspension' | 'prevent-display-sleep';
|
|
26
|
+
export type MoldablePowerSessionEvent = {
|
|
27
|
+
kind: 'suspend';
|
|
28
|
+
occurredAt: string;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'resume';
|
|
31
|
+
occurredAt: string;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'lock';
|
|
34
|
+
occurredAt: string;
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'unlock';
|
|
37
|
+
occurredAt: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'session-active';
|
|
40
|
+
occurredAt: string;
|
|
41
|
+
} | {
|
|
42
|
+
kind: 'session-inactive';
|
|
43
|
+
occurredAt: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'shutdown';
|
|
46
|
+
occurredAt: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'thermal-state-change';
|
|
49
|
+
occurredAt: string;
|
|
50
|
+
state: MoldableThermalState;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'power-source-change';
|
|
53
|
+
occurredAt: string;
|
|
54
|
+
powerState: MoldablePowerState;
|
|
55
|
+
};
|
|
56
|
+
export type NativePowerSessionRequest = NativeCapabilityRequestEnvelope<typeof NATIVE_POWER_SESSION_REQUEST_TYPE, {
|
|
57
|
+
action: 'getPowerState';
|
|
58
|
+
} | {
|
|
59
|
+
action: 'getCurrentThermalState';
|
|
60
|
+
} | {
|
|
61
|
+
action: 'getIdleState';
|
|
62
|
+
thresholdSeconds: number;
|
|
63
|
+
} | {
|
|
64
|
+
action: 'startSleepBlocker';
|
|
65
|
+
blockerType: MoldableSleepBlockerType;
|
|
66
|
+
} | {
|
|
67
|
+
action: 'stopSleepBlocker';
|
|
68
|
+
blockerId: string;
|
|
69
|
+
} | {
|
|
70
|
+
action: 'isSleepBlockerStarted';
|
|
71
|
+
blockerId: string;
|
|
72
|
+
} | {
|
|
73
|
+
action: 'subscribeEvents';
|
|
74
|
+
} | {
|
|
75
|
+
action: 'unsubscribeEvents';
|
|
76
|
+
subscriptionId: string;
|
|
77
|
+
}>;
|
|
78
|
+
export type NativePowerSessionResult = NativeCapabilityResultEnvelope<typeof NATIVE_POWER_SESSION_RESULT_TYPE, MoldablePowerState | MoldableThermalState | MoldableSystemIdleResult | {
|
|
79
|
+
blockerId: string;
|
|
80
|
+
blockerType: MoldableSleepBlockerType;
|
|
81
|
+
} | {
|
|
82
|
+
stopped: true;
|
|
83
|
+
} | {
|
|
84
|
+
started: boolean;
|
|
85
|
+
} | {
|
|
86
|
+
subscriptionId: string;
|
|
87
|
+
} | {
|
|
88
|
+
unsubscribed: true;
|
|
89
|
+
}>;
|
|
90
|
+
export interface WatchMoldablePowerSessionOptions {
|
|
91
|
+
signal?: AbortSignal;
|
|
92
|
+
}
|
|
93
|
+
export type StopWatchingMoldablePowerSession = () => Promise<void>;
|
|
94
|
+
export declare function isMoldablePowerSessionEvent(value: unknown): value is MoldablePowerSessionEvent;
|
|
95
|
+
export declare function getMoldablePowerState(options?: NativeCapabilityBridgeOptions): Promise<MoldablePowerState>;
|
|
96
|
+
/** Return the host's current thermal pressure classification. */
|
|
97
|
+
export declare function getMoldableCurrentThermalState(options?: NativeCapabilityBridgeOptions): Promise<MoldableThermalState>;
|
|
98
|
+
export declare function getMoldableSystemIdleState(thresholdSeconds: number, options?: NativeCapabilityBridgeOptions): Promise<MoldableSystemIdleResult>;
|
|
99
|
+
export declare function getMoldableSystemIdleTime(options?: NativeCapabilityBridgeOptions): Promise<number>;
|
|
100
|
+
export interface MoldableSleepBlocker {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly type: MoldableSleepBlockerType;
|
|
103
|
+
readonly stopped: boolean;
|
|
104
|
+
isStarted(options?: NativeCapabilityBridgeOptions): Promise<boolean>;
|
|
105
|
+
stop(options?: NativeCapabilityBridgeOptions): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
export declare function startMoldableSleepBlocker(blockerType: MoldableSleepBlockerType, options?: NativeCapabilityBridgeOptions): Promise<MoldableSleepBlocker>;
|
|
108
|
+
/** Stop a blocker returned by {@link startMoldableSleepBlocker}. */
|
|
109
|
+
export declare function stopMoldableSleepBlocker(blocker: MoldableSleepBlocker, options?: NativeCapabilityBridgeOptions): Promise<void>;
|
|
110
|
+
/** Ask the host whether a blocker still belongs to this active app scope. */
|
|
111
|
+
export declare function isMoldableSleepBlockerStarted(blocker: MoldableSleepBlocker, options?: NativeCapabilityBridgeOptions): Promise<boolean>;
|
|
112
|
+
export declare function watchMoldablePowerSession(listener: (event: MoldablePowerSessionEvent) => void, options?: WatchMoldablePowerSessionOptions & NativeCapabilityBridgeOptions): Promise<StopWatchingMoldablePowerSession>;
|
|
113
|
+
//# sourceMappingURL=power-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"power-session.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/power-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EAGnC,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,iCAAiC,EAC5C,+BAAwC,CAAA;AAC1C,eAAO,MAAM,gCAAgC,EA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AC7B,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,6EAA6E;AAC7E,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,oBAAoB,EAC7B,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,yBAAyB,KAAK,IAAI,EACpD,OAAO,GAAE,gCAAgC,GACvC,6BAAkC,GACnC,OAAO,CAAC,gCAAgC,CAAC,CAmF3C"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { NativeCapabilityBridgeError, callNativeCapabilityBridge, resolveNativeCapabilityParentOrigin, } from './bridge';
|
|
2
|
+
export const NATIVE_POWER_SESSION_REQUEST_TYPE = 'moldable:native-power-session';
|
|
3
|
+
export const NATIVE_POWER_SESSION_RESULT_TYPE = 'moldable:native-power-session-result';
|
|
4
|
+
export const NATIVE_POWER_SESSION_EVENT_TYPE = 'moldable:native-power-session-event';
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function isPowerState(value) {
|
|
9
|
+
if (!isRecord(value))
|
|
10
|
+
return false;
|
|
11
|
+
if (!['ac', 'battery', 'unknown'].includes(String(value.source)))
|
|
12
|
+
return false;
|
|
13
|
+
if (!Array.isArray(value.batteries))
|
|
14
|
+
return false;
|
|
15
|
+
return value.batteries.every((battery) => isRecord(battery) &&
|
|
16
|
+
['charging', 'discharging', 'empty', 'full', 'unknown'].includes(String(battery.state)) &&
|
|
17
|
+
typeof battery.chargePercent === 'number' &&
|
|
18
|
+
Number.isFinite(battery.chargePercent) &&
|
|
19
|
+
battery.chargePercent >= 0 &&
|
|
20
|
+
battery.chargePercent <= 100 &&
|
|
21
|
+
(battery.timeToEmptySeconds === null ||
|
|
22
|
+
(typeof battery.timeToEmptySeconds === 'number' &&
|
|
23
|
+
Number.isFinite(battery.timeToEmptySeconds) &&
|
|
24
|
+
battery.timeToEmptySeconds >= 0)) &&
|
|
25
|
+
(battery.timeToFullSeconds === null ||
|
|
26
|
+
(typeof battery.timeToFullSeconds === 'number' &&
|
|
27
|
+
Number.isFinite(battery.timeToFullSeconds) &&
|
|
28
|
+
battery.timeToFullSeconds >= 0)));
|
|
29
|
+
}
|
|
30
|
+
function isThermalState(value) {
|
|
31
|
+
return ['nominal', 'fair', 'serious', 'critical', 'unknown'].includes(String(value));
|
|
32
|
+
}
|
|
33
|
+
export function isMoldablePowerSessionEvent(value) {
|
|
34
|
+
if (!isRecord(value) || typeof value.occurredAt !== 'string')
|
|
35
|
+
return false;
|
|
36
|
+
if (Number.isNaN(Date.parse(value.occurredAt)))
|
|
37
|
+
return false;
|
|
38
|
+
if (value.kind === 'suspend' ||
|
|
39
|
+
value.kind === 'resume' ||
|
|
40
|
+
value.kind === 'lock' ||
|
|
41
|
+
value.kind === 'unlock' ||
|
|
42
|
+
value.kind === 'session-active' ||
|
|
43
|
+
value.kind === 'session-inactive' ||
|
|
44
|
+
value.kind === 'shutdown') {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (value.kind === 'thermal-state-change') {
|
|
48
|
+
return isThermalState(value.state);
|
|
49
|
+
}
|
|
50
|
+
return value.kind === 'power-source-change' && isPowerState(value.powerState);
|
|
51
|
+
}
|
|
52
|
+
export async function getMoldablePowerState(options = {}) {
|
|
53
|
+
const value = await callNativeCapabilityBridge({ type: NATIVE_POWER_SESSION_REQUEST_TYPE, action: 'getPowerState' }, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
54
|
+
if (!isPowerState(value)) {
|
|
55
|
+
throw new NativeCapabilityBridgeError({
|
|
56
|
+
code: 'invalid_response',
|
|
57
|
+
message: 'Moldable returned an invalid power state.',
|
|
58
|
+
details: value,
|
|
59
|
+
retryable: false,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return value;
|
|
63
|
+
}
|
|
64
|
+
/** Return the host's current thermal pressure classification. */
|
|
65
|
+
export async function getMoldableCurrentThermalState(options = {}) {
|
|
66
|
+
const value = await callNativeCapabilityBridge({
|
|
67
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
68
|
+
action: 'getCurrentThermalState',
|
|
69
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
70
|
+
if (!isThermalState(value)) {
|
|
71
|
+
throw new NativeCapabilityBridgeError({
|
|
72
|
+
code: 'invalid_response',
|
|
73
|
+
message: 'Moldable returned an invalid thermal state.',
|
|
74
|
+
details: value,
|
|
75
|
+
retryable: false,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
export async function getMoldableSystemIdleState(thresholdSeconds, options = {}) {
|
|
81
|
+
if (!Number.isSafeInteger(thresholdSeconds) ||
|
|
82
|
+
thresholdSeconds < 1 ||
|
|
83
|
+
thresholdSeconds > 86_400) {
|
|
84
|
+
throw new RangeError('thresholdSeconds must be an integer from 1 to 86400.');
|
|
85
|
+
}
|
|
86
|
+
const value = await callNativeCapabilityBridge({
|
|
87
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
88
|
+
action: 'getIdleState',
|
|
89
|
+
thresholdSeconds,
|
|
90
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
91
|
+
if (!isRecord(value) ||
|
|
92
|
+
typeof value.seconds !== 'number' ||
|
|
93
|
+
!Number.isFinite(value.seconds) ||
|
|
94
|
+
value.seconds < 0 ||
|
|
95
|
+
!['active', 'idle', 'locked'].includes(String(value.state)) ||
|
|
96
|
+
value.thresholdSeconds !== thresholdSeconds) {
|
|
97
|
+
throw new NativeCapabilityBridgeError({
|
|
98
|
+
code: 'invalid_response',
|
|
99
|
+
message: 'Moldable returned an invalid system idle state.',
|
|
100
|
+
details: value,
|
|
101
|
+
retryable: false,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
export async function getMoldableSystemIdleTime(options = {}) {
|
|
107
|
+
const result = await getMoldableSystemIdleState(86_400, options);
|
|
108
|
+
return result.seconds;
|
|
109
|
+
}
|
|
110
|
+
class MoldableSleepBlockerHandle {
|
|
111
|
+
id;
|
|
112
|
+
type;
|
|
113
|
+
#stopPromise = null;
|
|
114
|
+
#stopped = false;
|
|
115
|
+
constructor(id, type) {
|
|
116
|
+
this.id = id;
|
|
117
|
+
this.type = type;
|
|
118
|
+
}
|
|
119
|
+
get stopped() {
|
|
120
|
+
return this.#stopped;
|
|
121
|
+
}
|
|
122
|
+
async isStarted(options = {}) {
|
|
123
|
+
if (this.#stopped)
|
|
124
|
+
return false;
|
|
125
|
+
const result = await callNativeCapabilityBridge({
|
|
126
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
127
|
+
action: 'isSleepBlockerStarted',
|
|
128
|
+
blockerId: this.id,
|
|
129
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
130
|
+
if (typeof result.started !== 'boolean') {
|
|
131
|
+
throw new NativeCapabilityBridgeError({
|
|
132
|
+
code: 'invalid_response',
|
|
133
|
+
message: 'Moldable returned an invalid sleep blocker state.',
|
|
134
|
+
details: result,
|
|
135
|
+
retryable: false,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (!result.started)
|
|
139
|
+
this.#stopped = true;
|
|
140
|
+
return result.started;
|
|
141
|
+
}
|
|
142
|
+
stop(options = {}) {
|
|
143
|
+
if (this.#stopped)
|
|
144
|
+
return Promise.resolve();
|
|
145
|
+
if (this.#stopPromise)
|
|
146
|
+
return this.#stopPromise;
|
|
147
|
+
this.#stopPromise = callNativeCapabilityBridge({
|
|
148
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
149
|
+
action: 'stopSleepBlocker',
|
|
150
|
+
blockerId: this.id,
|
|
151
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options)
|
|
152
|
+
.then(() => {
|
|
153
|
+
this.#stopped = true;
|
|
154
|
+
})
|
|
155
|
+
.catch((error) => {
|
|
156
|
+
this.#stopPromise = null;
|
|
157
|
+
throw error;
|
|
158
|
+
});
|
|
159
|
+
return this.#stopPromise;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export async function startMoldableSleepBlocker(blockerType, options = {}) {
|
|
163
|
+
const result = await callNativeCapabilityBridge({
|
|
164
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
165
|
+
action: 'startSleepBlocker',
|
|
166
|
+
blockerType,
|
|
167
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
168
|
+
if (typeof result.blockerId !== 'string' ||
|
|
169
|
+
result.blockerId.length === 0 ||
|
|
170
|
+
result.blockerType !== blockerType) {
|
|
171
|
+
throw new NativeCapabilityBridgeError({
|
|
172
|
+
code: 'invalid_response',
|
|
173
|
+
message: 'Moldable returned an invalid sleep blocker handle.',
|
|
174
|
+
details: result,
|
|
175
|
+
retryable: false,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return new MoldableSleepBlockerHandle(result.blockerId, blockerType);
|
|
179
|
+
}
|
|
180
|
+
/** Stop a blocker returned by {@link startMoldableSleepBlocker}. */
|
|
181
|
+
export function stopMoldableSleepBlocker(blocker, options = {}) {
|
|
182
|
+
return blocker.stop(options);
|
|
183
|
+
}
|
|
184
|
+
/** Ask the host whether a blocker still belongs to this active app scope. */
|
|
185
|
+
export function isMoldableSleepBlockerStarted(blocker, options = {}) {
|
|
186
|
+
return blocker.isStarted(options);
|
|
187
|
+
}
|
|
188
|
+
export async function watchMoldablePowerSession(listener, options = {}) {
|
|
189
|
+
if (typeof window === 'undefined' || window.parent === window) {
|
|
190
|
+
throw new NativeCapabilityBridgeError({
|
|
191
|
+
code: 'not_in_moldable',
|
|
192
|
+
message: 'Power/session events are only available inside Moldable.',
|
|
193
|
+
retryable: false,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
const parentOrigin = resolveNativeCapabilityParentOrigin(document.referrer);
|
|
197
|
+
if (!parentOrigin) {
|
|
198
|
+
throw new NativeCapabilityBridgeError({
|
|
199
|
+
code: 'not_in_moldable',
|
|
200
|
+
message: 'The power/session event parent could not be verified.',
|
|
201
|
+
retryable: false,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
let active = true;
|
|
205
|
+
const handleMessage = (event) => {
|
|
206
|
+
if (!active ||
|
|
207
|
+
event.source !== window.parent ||
|
|
208
|
+
event.origin !== parentOrigin ||
|
|
209
|
+
!isRecord(event.data)) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (event.data.type !== NATIVE_POWER_SESSION_EVENT_TYPE)
|
|
213
|
+
return;
|
|
214
|
+
if (!isMoldablePowerSessionEvent(event.data.event))
|
|
215
|
+
return;
|
|
216
|
+
listener(event.data.event);
|
|
217
|
+
};
|
|
218
|
+
let stopPromise = null;
|
|
219
|
+
let subscriptionId = '';
|
|
220
|
+
const stop = () => {
|
|
221
|
+
if (stopPromise)
|
|
222
|
+
return stopPromise;
|
|
223
|
+
active = false;
|
|
224
|
+
window.removeEventListener('message', handleMessage);
|
|
225
|
+
options.signal?.removeEventListener('abort', handleAbort);
|
|
226
|
+
stopPromise = callNativeCapabilityBridge({
|
|
227
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
228
|
+
action: 'unsubscribeEvents',
|
|
229
|
+
subscriptionId,
|
|
230
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, { timeoutMs: options.timeoutMs })
|
|
231
|
+
.then(() => undefined)
|
|
232
|
+
.catch((error) => {
|
|
233
|
+
stopPromise = null;
|
|
234
|
+
throw error;
|
|
235
|
+
});
|
|
236
|
+
return stopPromise;
|
|
237
|
+
};
|
|
238
|
+
const handleAbort = () => void stop().catch(() => undefined);
|
|
239
|
+
window.addEventListener('message', handleMessage);
|
|
240
|
+
try {
|
|
241
|
+
const result = await callNativeCapabilityBridge({
|
|
242
|
+
type: NATIVE_POWER_SESSION_REQUEST_TYPE,
|
|
243
|
+
action: 'subscribeEvents',
|
|
244
|
+
}, NATIVE_POWER_SESSION_RESULT_TYPE, options);
|
|
245
|
+
if (typeof result.subscriptionId !== 'string' || !result.subscriptionId) {
|
|
246
|
+
throw new NativeCapabilityBridgeError({
|
|
247
|
+
code: 'invalid_response',
|
|
248
|
+
message: 'Moldable returned an invalid power event subscription.',
|
|
249
|
+
details: result,
|
|
250
|
+
retryable: false,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
subscriptionId = result.subscriptionId;
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
active = false;
|
|
257
|
+
window.removeEventListener('message', handleMessage);
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
260
|
+
options.signal?.addEventListener('abort', handleAbort, { once: true });
|
|
261
|
+
if (options.signal?.aborted)
|
|
262
|
+
handleAbort();
|
|
263
|
+
return stop;
|
|
264
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
2
|
+
export declare const NATIVE_SECURE_STORAGE_REQUEST_TYPE: "moldable:native-secure-storage";
|
|
3
|
+
export declare const NATIVE_SECURE_STORAGE_RESULT_TYPE: "moldable:native-secure-storage-result";
|
|
4
|
+
export declare const SECURE_STORAGE_MAX_KEY_LENGTH = 128;
|
|
5
|
+
export declare const SECURE_STORAGE_MAX_VALUE_BYTES = 2048;
|
|
6
|
+
export interface MoldableSecureStorageValueResult {
|
|
7
|
+
value: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface MoldableSecureStorageSetResult {
|
|
10
|
+
stored: true;
|
|
11
|
+
}
|
|
12
|
+
export interface MoldableSecureStorageDeleteResult {
|
|
13
|
+
deleted: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface MoldableSecureStorageEntryMetadata {
|
|
16
|
+
key: string;
|
|
17
|
+
createdAtMs: number;
|
|
18
|
+
updatedAtMs: number;
|
|
19
|
+
}
|
|
20
|
+
export interface MoldableSecureStorageListResult {
|
|
21
|
+
entries: MoldableSecureStorageEntryMetadata[];
|
|
22
|
+
}
|
|
23
|
+
export type MoldableSecureStorageBackend = 'keychain' | 'credential-manager' | 'secret-service' | 'unsupported';
|
|
24
|
+
export interface MoldableSecureStorageDiagnostics {
|
|
25
|
+
available: boolean;
|
|
26
|
+
backend: MoldableSecureStorageBackend;
|
|
27
|
+
reason?: string;
|
|
28
|
+
}
|
|
29
|
+
/** Inspect credential-store readiness without reading or returning a secret. */
|
|
30
|
+
export declare function getMoldableSecureStorageDiagnostics(options?: NativeCapabilityBridgeOptions): Promise<MoldableSecureStorageDiagnostics>;
|
|
31
|
+
export declare function getMoldableSecureValue(key: string, options?: NativeCapabilityBridgeOptions): Promise<MoldableSecureStorageValueResult>;
|
|
32
|
+
export declare function setMoldableSecureValue(key: string, value: string, options?: NativeCapabilityBridgeOptions): Promise<MoldableSecureStorageSetResult>;
|
|
33
|
+
export declare function deleteMoldableSecureValue(key: string, options?: NativeCapabilityBridgeOptions): Promise<MoldableSecureStorageDeleteResult>;
|
|
34
|
+
/** List entry metadata for the current app and workspace; values are omitted. */
|
|
35
|
+
export declare function listMoldableSecureValues(options?: NativeCapabilityBridgeOptions): Promise<MoldableSecureStorageListResult>;
|
|
36
|
+
//# sourceMappingURL=secure-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secure-storage.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/secure-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,6BAA6B,EAEnC,MAAM,UAAU,CAAA;AAEjB,eAAO,MAAM,kCAAkC,EAC7C,gCAAyC,CAAA;AAC3C,eAAO,MAAM,iCAAiC,EAC5C,uCAAgD,CAAA;AAElD,eAAO,MAAM,6BAA6B,MAAM,CAAA;AAGhD,eAAO,MAAM,8BAA8B,O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{ callNativeCapabilityBridge, } from './bridge';
|
|
2
|
+
export const NATIVE_SECURE_STORAGE_REQUEST_TYPE = 'moldable:native-secure-storage';
|
|
3
|
+
export const NATIVE_SECURE_STORAGE_RESULT_TYPE = 'moldable:native-secure-storage-result';
|
|
4
|
+
export const SECURE_STORAGE_MAX_KEY_LENGTH = 128;
|
|
5
|
+
// Windows Credential Manager has the smallest commonly supported payload;
|
|
6
|
+
// keeping one cross-platform limit makes behavior portable between hosts.
|
|
7
|
+
export const SECURE_STORAGE_MAX_VALUE_BYTES = 2_048;
|
|
8
|
+
/** Inspect credential-store readiness without reading or returning a secret. */
|
|
9
|
+
export function getMoldableSecureStorageDiagnostics(options = {}) {
|
|
10
|
+
return callNativeCapabilityBridge({
|
|
11
|
+
type: NATIVE_SECURE_STORAGE_REQUEST_TYPE,
|
|
12
|
+
capability: 'secure-storage',
|
|
13
|
+
action: 'getDiagnostics',
|
|
14
|
+
}, NATIVE_SECURE_STORAGE_RESULT_TYPE, options);
|
|
15
|
+
}
|
|
16
|
+
function assertValidKey(key) {
|
|
17
|
+
if (key.trim().length === 0 ||
|
|
18
|
+
key.length > SECURE_STORAGE_MAX_KEY_LENGTH ||
|
|
19
|
+
!/^[A-Za-z0-9._-]+$/.test(key)) {
|
|
20
|
+
throw new TypeError(`Secure-storage keys must contain 1-${SECURE_STORAGE_MAX_KEY_LENGTH} ASCII letters, numbers, dots, underscores, or hyphens.`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function utf8Length(value) {
|
|
24
|
+
return new TextEncoder().encode(value).byteLength;
|
|
25
|
+
}
|
|
26
|
+
export function getMoldableSecureValue(key, options = {}) {
|
|
27
|
+
assertValidKey(key);
|
|
28
|
+
return callNativeCapabilityBridge({
|
|
29
|
+
type: NATIVE_SECURE_STORAGE_REQUEST_TYPE,
|
|
30
|
+
capability: 'secure-storage',
|
|
31
|
+
action: 'get',
|
|
32
|
+
key,
|
|
33
|
+
}, NATIVE_SECURE_STORAGE_RESULT_TYPE, options);
|
|
34
|
+
}
|
|
35
|
+
export function setMoldableSecureValue(key, value, options = {}) {
|
|
36
|
+
assertValidKey(key);
|
|
37
|
+
if (utf8Length(value) > SECURE_STORAGE_MAX_VALUE_BYTES) {
|
|
38
|
+
throw new TypeError(`Secure-storage values cannot exceed ${SECURE_STORAGE_MAX_VALUE_BYTES} UTF-8 bytes.`);
|
|
39
|
+
}
|
|
40
|
+
return callNativeCapabilityBridge({
|
|
41
|
+
type: NATIVE_SECURE_STORAGE_REQUEST_TYPE,
|
|
42
|
+
capability: 'secure-storage',
|
|
43
|
+
action: 'set',
|
|
44
|
+
key,
|
|
45
|
+
value,
|
|
46
|
+
}, NATIVE_SECURE_STORAGE_RESULT_TYPE, options);
|
|
47
|
+
}
|
|
48
|
+
export function deleteMoldableSecureValue(key, options = {}) {
|
|
49
|
+
assertValidKey(key);
|
|
50
|
+
return callNativeCapabilityBridge({
|
|
51
|
+
type: NATIVE_SECURE_STORAGE_REQUEST_TYPE,
|
|
52
|
+
capability: 'secure-storage',
|
|
53
|
+
action: 'delete',
|
|
54
|
+
key,
|
|
55
|
+
}, NATIVE_SECURE_STORAGE_RESULT_TYPE, options);
|
|
56
|
+
}
|
|
57
|
+
/** List entry metadata for the current app and workspace; values are omitted. */
|
|
58
|
+
export function listMoldableSecureValues(options = {}) {
|
|
59
|
+
return callNativeCapabilityBridge({
|
|
60
|
+
type: NATIVE_SECURE_STORAGE_REQUEST_TYPE,
|
|
61
|
+
capability: 'secure-storage',
|
|
62
|
+
action: 'list',
|
|
63
|
+
}, NATIVE_SECURE_STORAGE_RESULT_TYPE, options);
|
|
64
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type MoldableNativeDeviceDescriptor } from './native-device-io';
|
|
2
|
+
import type { MoldableSerialInputSignals, MoldableSerialOpenOptions, MoldableSerialOutputSignals, MoldableSerialPort, MoldableSerialPortInfo } from './serial';
|
|
3
|
+
export declare class NativeMoldableSerialPort extends EventTarget implements MoldableSerialPort {
|
|
4
|
+
readonly descriptor: MoldableNativeDeviceDescriptor;
|
|
5
|
+
readable: ReadableStream<Uint8Array> | null;
|
|
6
|
+
writable: WritableStream<Uint8Array> | null;
|
|
7
|
+
private handle?;
|
|
8
|
+
private closing?;
|
|
9
|
+
private readonly lifecycle;
|
|
10
|
+
constructor(descriptor: MoldableNativeDeviceDescriptor);
|
|
11
|
+
get connected(): boolean;
|
|
12
|
+
getInfo(): MoldableSerialPortInfo;
|
|
13
|
+
open(options: MoldableSerialOpenOptions): Promise<void>;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
forget(): Promise<void>;
|
|
16
|
+
getSignals(): Promise<MoldableSerialInputSignals>;
|
|
17
|
+
setSignals(signals: MoldableSerialOutputSignals): Promise<void>;
|
|
18
|
+
private createReadable;
|
|
19
|
+
private createWritable;
|
|
20
|
+
private execute;
|
|
21
|
+
}
|
|
22
|
+
export declare function isNativeMoldableSerialPort(port: MoldableSerialPort): port is NativeMoldableSerialPort;
|
|
23
|
+
//# sourceMappingURL=serial-native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serial-native.d.ts","sourceRoot":"","sources":["../../../src/lib/native-capabilities/serial-native.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,8BAA8B,EAMpC,MAAM,oBAAoB,CAAA;AAK3B,OAAO,KAAK,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,UAAU,CAAA;AAEjB,qBAAa,wBACX,SAAQ,WACR,YAAW,kBAAkB;IAQjB,QAAQ,CAAC,UAAU,EAAE,8BAA8B;IAN/D,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAO;IAClD,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAO;IAClD,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;gBAEnC,UAAU,EAAE,8BAA8B;IAI/D,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,OAAO,IAAI,sBAAsB;IAO3B,IAAI,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmCvD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIvB,UAAU,IAAI,OAAO,CAAC,0BAA0B,CAAC;IAsBjD,UAAU,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,IAAI,CAAC;IASrE,OAAO,CAAC,cAAc;IA8BtB,OAAO,CAAC,cAAc;YAqBR,OAAO;CA6BtB;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,kBAAkB,GACvB,IAAI,IAAI,wBAAwB,CAElC"}
|