@moldable-ai/ui 0.2.22 → 0.2.25
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 +1 -1
- package/dist/catalog/catalog-manifest.d.ts +1 -1
- package/dist/catalog/catalog-manifest.js +1 -1
- package/dist/catalog/component-catalog.d.ts +1 -1
- package/dist/catalog/component-catalog.js +2 -2
- package/dist/catalog/core-catalog-exclusions.d.ts +1 -1
- package/dist/catalog/core-catalog-exclusions.d.ts.map +1 -1
- package/dist/catalog/core-catalog-exclusions.js +1 -150
- package/dist/catalog/core-catalog.d.ts +1 -1
- package/dist/catalog/core-catalog.d.ts.map +1 -1
- package/dist/catalog/core-catalog.js +11 -7
- package/dist/catalog/core-collection-stories.d.ts +1 -1
- package/dist/catalog/core-collection-stories.d.ts.map +1 -1
- package/dist/catalog/core-collection-stories.js +40 -8
- package/dist/catalog/core-control-stories.d.ts +1 -1
- package/dist/catalog/core-control-stories.d.ts.map +1 -1
- package/dist/catalog/core-control-stories.js +48 -20
- package/dist/catalog/core-feedback-stories.d.ts +1 -1
- package/dist/catalog/core-feedback-stories.d.ts.map +1 -1
- package/dist/catalog/core-feedback-stories.js +89 -10
- package/dist/catalog/core-form-stories.d.ts +3 -0
- package/dist/catalog/core-form-stories.d.ts.map +1 -0
- package/dist/catalog/core-form-stories.js +56 -0
- package/dist/catalog/core-foundation-stories.d.ts +1 -1
- package/dist/catalog/core-foundation-stories.js +7 -7
- package/dist/catalog/core-layout-stories.d.ts +3 -0
- package/dist/catalog/core-layout-stories.d.ts.map +1 -0
- package/dist/catalog/core-layout-stories.js +78 -0
- package/dist/catalog/core-navigation-stories.d.ts +1 -1
- package/dist/catalog/core-navigation-stories.d.ts.map +1 -1
- package/dist/catalog/core-navigation-stories.js +25 -3
- package/dist/catalog/core-overlay-stories.d.ts +1 -1
- package/dist/catalog/core-overlay-stories.d.ts.map +1 -1
- package/dist/catalog/core-overlay-stories.js +113 -8
- package/dist/catalog/index.d.ts +6 -6
- package/dist/catalog/index.js +6 -6
- package/dist/components/app-error-boundary.js +2 -2
- package/dist/components/chat/chat-image-lightbox.js +3 -3
- package/dist/components/chat/chat-input.js +5 -5
- package/dist/components/chat/chat-message.js +17 -17
- package/dist/components/chat/chat-messages.d.ts +1 -1
- package/dist/components/chat/chat-messages.js +3 -3
- package/dist/components/chat/chat-panel.d.ts +6 -6
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +33 -33
- package/dist/components/chat/checkpoint-badge.js +3 -3
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +13 -13
- package/dist/components/chat/index.d.ts +20 -15
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +20 -15
- package/dist/components/chat/markdown.js +1 -1
- package/dist/components/chat/model-effort-selector.js +10 -10
- package/dist/components/chat/model-selector.js +4 -4
- package/dist/components/chat/reasoning-effort-selector.js +4 -4
- package/dist/components/chat/restore-dialog.js +3 -3
- package/dist/components/chat/thinking-timeline.js +2 -2
- package/dist/components/chat/tool-approval.d.ts +1 -1
- package/dist/components/chat/tool-approval.d.ts.map +1 -1
- package/dist/components/chat/tool-approval.js +9 -9
- package/dist/components/chat/tool-handlers.d.ts +2 -2
- package/dist/components/chat/tool-handlers.js +90 -90
- package/dist/components/chat/voice-orb-audio.d.ts +16 -0
- package/dist/components/chat/voice-orb-audio.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-audio.js +110 -0
- package/dist/components/chat/voice-orb-renderer.d.ts +51 -0
- package/dist/components/chat/voice-orb-renderer.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-renderer.js +410 -0
- package/dist/components/chat/voice-orb-shaders.d.ts +3 -0
- package/dist/components/chat/voice-orb-shaders.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-shaders.js +355 -0
- package/dist/components/chat/voice-orb-types.d.ts +24 -0
- package/dist/components/chat/voice-orb-types.d.ts.map +1 -0
- package/dist/components/chat/voice-orb-types.js +73 -0
- package/dist/components/chat/voice-orb.d.ts +20 -0
- package/dist/components/chat/voice-orb.d.ts.map +1 -0
- package/dist/components/chat/voice-orb.js +67 -0
- package/dist/components/code-block.js +1 -1
- package/dist/components/hardware/bluetooth-panel.d.ts +2 -2
- package/dist/components/hardware/bluetooth-panel.js +10 -10
- package/dist/components/hardware/camera-preview.js +6 -6
- package/dist/components/hardware/capability-badge.d.ts +2 -2
- package/dist/components/hardware/capability-badge.js +2 -2
- package/dist/components/hardware/capability-matrix.d.ts +1 -1
- package/dist/components/hardware/capability-matrix.js +5 -5
- package/dist/components/hardware/clipboard-button.d.ts +1 -1
- package/dist/components/hardware/clipboard-button.js +2 -2
- package/dist/components/hardware/device-list.js +1 -1
- package/dist/components/hardware/display-map.d.ts +1 -1
- package/dist/components/hardware/display-map.js +7 -7
- package/dist/components/hardware/haptic-button.d.ts +2 -2
- package/dist/components/hardware/haptic-button.js +3 -3
- package/dist/components/hardware/hardware-panel.js +1 -1
- package/dist/components/hardware/hid-panel.d.ts +2 -2
- package/dist/components/hardware/hid-panel.js +10 -10
- package/dist/components/hardware/index.d.ts +26 -26
- package/dist/components/hardware/index.js +26 -26
- package/dist/components/hardware/live-indicator.js +1 -1
- package/dist/components/hardware/local-auth-button.d.ts +2 -2
- package/dist/components/hardware/local-auth-button.js +4 -4
- package/dist/components/hardware/location-panel.d.ts +1 -1
- package/dist/components/hardware/location-panel.js +6 -6
- package/dist/components/hardware/microphone-meter.js +7 -7
- package/dist/components/hardware/midi-monitor.d.ts +2 -2
- package/dist/components/hardware/midi-monitor.js +9 -9
- package/dist/components/hardware/notification-panel.d.ts +1 -1
- package/dist/components/hardware/notification-panel.js +8 -8
- package/dist/components/hardware/power-blocker-controller.d.ts +1 -1
- package/dist/components/hardware/power-blocker-controller.js +1 -1
- package/dist/components/hardware/power-panel.d.ts +1 -1
- package/dist/components/hardware/power-panel.js +9 -9
- package/dist/components/hardware/readout.js +1 -1
- package/dist/components/hardware/screen-share-preview.js +5 -5
- package/dist/components/hardware/secure-storage-panel.d.ts +1 -1
- package/dist/components/hardware/secure-storage-panel.js +9 -9
- package/dist/components/hardware/serial-console.d.ts +2 -2
- package/dist/components/hardware/serial-console.js +10 -10
- package/dist/components/hardware/shortcut-recorder.d.ts +1 -1
- package/dist/components/hardware/shortcut-recorder.js +4 -4
- package/dist/components/hardware/stream-log.js +1 -1
- package/dist/components/hardware/system-audio-monitor.d.ts +1 -1
- package/dist/components/hardware/system-audio-monitor.js +9 -9
- package/dist/components/hardware/usb-panel.d.ts +5 -5
- package/dist/components/hardware/usb-panel.js +10 -10
- package/dist/components/hardware/use-capability.d.ts +1 -1
- package/dist/components/hardware/use-capability.js +1 -1
- package/dist/components/markdown.js +5 -5
- package/dist/components/native-capabilities/bluetooth-panel.d.ts +2 -2
- package/dist/components/native-capabilities/bluetooth-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/bluetooth-panel.js +17 -17
- package/dist/components/native-capabilities/camera-preview.d.ts.map +1 -1
- package/dist/components/native-capabilities/camera-preview.js +7 -7
- package/dist/components/native-capabilities/capability-badge.d.ts +2 -2
- package/dist/components/native-capabilities/capability-badge.js +4 -4
- package/dist/components/native-capabilities/capability-matrix.d.ts +1 -1
- package/dist/components/native-capabilities/capability-matrix.js +7 -7
- package/dist/components/native-capabilities/clipboard-button.d.ts +1 -1
- package/dist/components/native-capabilities/clipboard-button.js +2 -2
- package/dist/components/native-capabilities/device-list.js +4 -4
- package/dist/components/native-capabilities/display-map.d.ts +1 -1
- package/dist/components/native-capabilities/display-map.d.ts.map +1 -1
- package/dist/components/native-capabilities/display-map.js +11 -11
- package/dist/components/native-capabilities/haptic-button.d.ts +2 -2
- package/dist/components/native-capabilities/haptic-button.js +3 -3
- package/dist/components/native-capabilities/hid-panel.d.ts +2 -2
- package/dist/components/native-capabilities/hid-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/hid-panel.js +14 -14
- package/dist/components/native-capabilities/index.d.ts +26 -26
- package/dist/components/native-capabilities/index.js +26 -26
- package/dist/components/native-capabilities/live-indicator.js +3 -3
- package/dist/components/native-capabilities/local-auth-button.d.ts +2 -2
- package/dist/components/native-capabilities/local-auth-button.js +4 -4
- package/dist/components/native-capabilities/location-panel.d.ts +1 -1
- package/dist/components/native-capabilities/location-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/location-panel.js +8 -8
- package/dist/components/native-capabilities/microphone-meter.js +9 -9
- package/dist/components/native-capabilities/midi-monitor.d.ts +2 -2
- package/dist/components/native-capabilities/midi-monitor.d.ts.map +1 -1
- package/dist/components/native-capabilities/midi-monitor.js +11 -11
- package/dist/components/native-capabilities/native-capability-panel.js +6 -6
- package/dist/components/native-capabilities/notification-panel.d.ts +1 -1
- package/dist/components/native-capabilities/notification-panel.js +9 -9
- package/dist/components/native-capabilities/power-blocker-controller.d.ts +1 -1
- package/dist/components/native-capabilities/power-blocker-controller.js +1 -1
- package/dist/components/native-capabilities/power-panel.d.ts +1 -1
- package/dist/components/native-capabilities/power-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/power-panel.js +12 -12
- package/dist/components/native-capabilities/readout.d.ts.map +1 -1
- package/dist/components/native-capabilities/readout.js +2 -2
- package/dist/components/native-capabilities/screen-share-preview.js +6 -6
- package/dist/components/native-capabilities/secure-storage-panel.d.ts +1 -1
- package/dist/components/native-capabilities/secure-storage-panel.d.ts.map +1 -1
- package/dist/components/native-capabilities/secure-storage-panel.js +11 -11
- package/dist/components/native-capabilities/serial-console.d.ts +2 -2
- package/dist/components/native-capabilities/serial-console.d.ts.map +1 -1
- package/dist/components/native-capabilities/serial-console.js +11 -11
- package/dist/components/native-capabilities/shortcut-recorder.d.ts +1 -1
- package/dist/components/native-capabilities/shortcut-recorder.js +5 -5
- package/dist/components/native-capabilities/stream-log.js +3 -3
- package/dist/components/native-capabilities/system-audio-monitor.d.ts +1 -1
- package/dist/components/native-capabilities/system-audio-monitor.js +12 -12
- package/dist/components/native-capabilities/usb-panel.d.ts +5 -5
- package/dist/components/native-capabilities/usb-panel.js +15 -15
- package/dist/components/native-capabilities/use-capability.d.ts +1 -1
- package/dist/components/native-capabilities/use-capability.js +1 -1
- package/dist/components/rich-media-player.js +3 -3
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +16 -10
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/alert.js +11 -11
- package/dist/components/ui/app-frame.d.ts +7 -1
- package/dist/components/ui/app-frame.d.ts.map +1 -1
- package/dist/components/ui/app-frame.js +52 -16
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +4 -4
- package/dist/components/ui/breadcrumb.js +2 -2
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +4 -4
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +16 -16
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/calendar.js +15 -15
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/carousel.d.ts +1 -1
- package/dist/components/ui/carousel.js +4 -4
- package/dist/components/ui/chart.js +5 -5
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/collapsible.js +3 -3
- package/dist/components/ui/color-well.js +2 -2
- package/dist/components/ui/combobox.js +9 -9
- package/dist/components/ui/command.d.ts +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +9 -9
- package/dist/components/ui/confirm-dialog.d.ts +1 -1
- package/dist/components/ui/confirm-dialog.js +2 -2
- package/dist/components/ui/context-menu.d.ts +16 -5
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +92 -16
- package/dist/components/ui/date-field.d.ts.map +1 -1
- package/dist/components/ui/date-field.js +8 -8
- package/dist/components/ui/date-picker.d.ts +2 -2
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +16 -8
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/dropdown-menu.d.ts +15 -5
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +98 -16
- package/dist/components/ui/edge-fade.js +1 -1
- package/dist/components/ui/empty.d.ts +1 -1
- package/dist/components/ui/empty.js +5 -5
- package/dist/components/ui/error-boundary-view.d.ts.map +1 -1
- package/dist/components/ui/error-boundary-view.js +3 -3
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.d.ts.map +1 -1
- package/dist/components/ui/field.js +9 -9
- package/dist/components/ui/form.js +4 -4
- package/dist/components/ui/grid.d.ts.map +1 -1
- package/dist/components/ui/grid.js +5 -5
- package/dist/components/ui/hover-card.js +2 -2
- package/dist/components/ui/icon-button.d.ts +1 -1
- package/dist/components/ui/icon-button.js +3 -3
- package/dist/components/ui/index.d.ts +77 -77
- package/dist/components/ui/index.js +77 -77
- package/dist/components/ui/input-group.d.ts +2 -2
- package/dist/components/ui/input-group.js +14 -14
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input.js +2 -2
- package/dist/components/ui/inspector.d.ts +1 -1
- package/dist/components/ui/inspector.js +6 -6
- package/dist/components/ui/item.d.ts +1 -1
- package/dist/components/ui/item.js +7 -7
- package/dist/components/ui/kbd.js +2 -2
- package/dist/components/ui/label.js +2 -2
- package/dist/components/ui/list.d.ts.map +1 -1
- package/dist/components/ui/list.js +5 -5
- package/dist/components/ui/material.js +3 -3
- package/dist/components/ui/menu-items.d.ts +28 -0
- package/dist/components/ui/menu-items.d.ts.map +1 -0
- package/dist/components/ui/menu-items.js +111 -0
- package/dist/components/ui/menubar.js +11 -11
- package/dist/components/ui/message-scroller-controller.d.ts +1 -1
- package/dist/components/ui/message-scroller-controller.js +1 -1
- package/dist/components/ui/message-scroller-primitive.d.ts +1 -1
- package/dist/components/ui/message-scroller-primitive.js +1 -1
- package/dist/components/ui/message-scroller.d.ts +2 -2
- package/dist/components/ui/message-scroller.js +3 -3
- package/dist/components/ui/navigation-button-group.d.ts +2 -2
- package/dist/components/ui/navigation-button-group.js +2 -2
- package/dist/components/ui/navigation-menu.js +6 -6
- package/dist/components/ui/notification-dot.js +2 -2
- package/dist/components/ui/number-input.js +8 -8
- package/dist/components/ui/pagination.d.ts +1 -1
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/panel.d.ts +1 -1
- package/dist/components/ui/panel.js +3 -3
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +3 -3
- package/dist/components/ui/progress.js +2 -2
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/resizable.js +15 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +3 -3
- package/dist/components/ui/search-field.js +7 -7
- package/dist/components/ui/segmented-control.js +9 -9
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +6 -6
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.js +4 -4
- package/dist/components/ui/sidebar.d.ts +5 -5
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +111 -24
- package/dist/components/ui/skeleton.js +2 -2
- package/dist/components/ui/slider.d.ts +3 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/slider.js +3 -3
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/spinner.js +1 -1
- package/dist/components/ui/split-view.js +1 -1
- package/dist/components/ui/status.d.ts +1 -1
- package/dist/components/ui/status.d.ts.map +1 -1
- package/dist/components/ui/status.js +10 -9
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +7 -7
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/text.d.ts +2 -2
- package/dist/components/ui/text.js +19 -19
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/toggle-group.d.ts +1 -1
- package/dist/components/ui/toggle-group.js +4 -4
- package/dist/components/ui/toggle.d.ts +1 -1
- package/dist/components/ui/toggle.js +10 -10
- package/dist/components/ui/toolbar.d.ts +7 -7
- package/dist/components/ui/toolbar.js +7 -7
- package/dist/components/ui/tooltip.d.ts +2 -2
- package/dist/components/ui/tooltip.js +5 -5
- package/dist/index.d.ts +21 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -20
- package/dist/lib/frame-lifecycle.d.ts +27 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +136 -0
- package/dist/lib/host-date-time-picker.d.ts +1 -1
- package/dist/lib/host-date-time-picker.js +1 -1
- package/dist/lib/host-file-dialog.d.ts +1 -1
- package/dist/lib/host-file-dialog.js +1 -1
- package/dist/lib/host-native-menu.d.ts +48 -7
- package/dist/lib/host-native-menu.d.ts.map +1 -1
- package/dist/lib/host-native-menu.js +56 -1
- package/dist/lib/host-services.js +1 -1
- package/dist/lib/host-share.d.ts +1 -1
- package/dist/lib/host-share.js +1 -1
- package/dist/lib/host-web-surface.d.ts +31 -0
- package/dist/lib/host-web-surface.d.ts.map +1 -0
- package/dist/lib/host-web-surface.js +116 -0
- package/dist/lib/native-capabilities/access.d.ts +2 -2
- package/dist/lib/native-capabilities/access.js +2 -2
- package/dist/lib/native-capabilities/bluetooth-access.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-access.js +2 -2
- package/dist/lib/native-capabilities/bluetooth-connection.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-connection.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-gatt.d.ts +1 -1
- package/dist/lib/native-capabilities/bluetooth-gatt.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-internal.d.ts +2 -2
- package/dist/lib/native-capabilities/bluetooth-internal.js +1 -1
- package/dist/lib/native-capabilities/bluetooth-native-fallback.d.ts +2 -2
- package/dist/lib/native-capabilities/bluetooth-native-fallback.js +2 -2
- package/dist/lib/native-capabilities/bluetooth.d.ts +6 -6
- package/dist/lib/native-capabilities/bluetooth.js +4 -4
- package/dist/lib/native-capabilities/bridge.d.ts +1 -1
- package/dist/lib/native-capabilities/bridge.js +2 -2
- package/dist/lib/native-capabilities/capabilities.d.ts +1 -1
- package/dist/lib/native-capabilities/capabilities.js +1 -1
- package/dist/lib/native-capabilities/clipboard.js +2 -2
- package/dist/lib/native-capabilities/device-io-errors.d.ts +1 -1
- package/dist/lib/native-capabilities/device-io-errors.js +1 -1
- package/dist/lib/native-capabilities/displays.d.ts +1 -1
- package/dist/lib/native-capabilities/displays.js +1 -1
- package/dist/lib/native-capabilities/global-shortcuts.d.ts +2 -2
- package/dist/lib/native-capabilities/global-shortcuts.js +1 -1
- package/dist/lib/native-capabilities/haptics.d.ts +1 -1
- package/dist/lib/native-capabilities/haptics.js +1 -1
- package/dist/lib/native-capabilities/hid-native.d.ts +2 -2
- package/dist/lib/native-capabilities/hid-native.js +3 -3
- package/dist/lib/native-capabilities/hid.js +5 -5
- package/dist/lib/native-capabilities/index.d.ts +39 -39
- package/dist/lib/native-capabilities/index.js +21 -21
- package/dist/lib/native-capabilities/local-authentication.d.ts +1 -1
- package/dist/lib/native-capabilities/local-authentication.js +1 -1
- package/dist/lib/native-capabilities/location.js +1 -1
- package/dist/lib/native-capabilities/media-permissions.d.ts +1 -1
- package/dist/lib/native-capabilities/media-permissions.js +1 -1
- package/dist/lib/native-capabilities/media.d.ts +1 -1
- package/dist/lib/native-capabilities/media.js +2 -2
- package/dist/lib/native-capabilities/midi-access.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-access.js +3 -3
- package/dist/lib/native-capabilities/midi-internal.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-internal.js +1 -1
- package/dist/lib/native-capabilities/midi-native-fallback.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-native-fallback.js +2 -2
- package/dist/lib/native-capabilities/midi-ports.d.ts +1 -1
- package/dist/lib/native-capabilities/midi-ports.js +1 -1
- package/dist/lib/native-capabilities/midi.d.ts +5 -5
- package/dist/lib/native-capabilities/midi.js +3 -3
- package/dist/lib/native-capabilities/native-device-io.d.ts +1 -1
- package/dist/lib/native-capabilities/native-device-io.js +1 -1
- package/dist/lib/native-capabilities/native-device-lifecycle.js +1 -1
- package/dist/lib/native-capabilities/notifications.d.ts +2 -2
- package/dist/lib/native-capabilities/notifications.js +1 -1
- package/dist/lib/native-capabilities/power-session.d.ts +2 -2
- package/dist/lib/native-capabilities/power-session.js +1 -1
- package/dist/lib/native-capabilities/secure-storage.d.ts +1 -1
- package/dist/lib/native-capabilities/secure-storage.js +1 -1
- package/dist/lib/native-capabilities/serial-native.d.ts +2 -2
- package/dist/lib/native-capabilities/serial-native.js +3 -3
- package/dist/lib/native-capabilities/serial.js +5 -5
- package/dist/lib/native-capabilities/system-audio.d.ts +1 -1
- package/dist/lib/native-capabilities/system-audio.js +1 -1
- package/dist/lib/native-capabilities/usb-native.d.ts +2 -2
- package/dist/lib/native-capabilities/usb-native.js +3 -3
- package/dist/lib/native-capabilities/usb.js +5 -5
- package/dist/lib/native-hardware/bluetooth-access.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-access.js +1 -1
- package/dist/lib/native-hardware/bluetooth-connection.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-connection.js +1 -1
- package/dist/lib/native-hardware/bluetooth-gatt.d.ts +1 -1
- package/dist/lib/native-hardware/bluetooth-gatt.js +1 -1
- package/dist/lib/native-hardware/bluetooth-internal.d.ts +2 -2
- package/dist/lib/native-hardware/bluetooth-internal.js +1 -1
- package/dist/lib/native-hardware/bluetooth-native-fallback.d.ts +2 -2
- package/dist/lib/native-hardware/bluetooth-native-fallback.js +2 -2
- package/dist/lib/native-hardware/bluetooth.d.ts +6 -6
- package/dist/lib/native-hardware/bluetooth.js +4 -4
- package/dist/lib/native-hardware/bridge.d.ts +1 -1
- package/dist/lib/native-hardware/bridge.js +2 -2
- package/dist/lib/native-hardware/capabilities.d.ts +1 -1
- package/dist/lib/native-hardware/capabilities.js +1 -1
- package/dist/lib/native-hardware/clipboard.js +1 -1
- package/dist/lib/native-hardware/device-io-errors.d.ts +1 -1
- package/dist/lib/native-hardware/device-io-errors.js +1 -1
- package/dist/lib/native-hardware/displays.d.ts +1 -1
- package/dist/lib/native-hardware/displays.js +1 -1
- package/dist/lib/native-hardware/global-shortcuts.d.ts +2 -2
- package/dist/lib/native-hardware/global-shortcuts.js +1 -1
- package/dist/lib/native-hardware/haptics.d.ts +1 -1
- package/dist/lib/native-hardware/haptics.js +1 -1
- package/dist/lib/native-hardware/hid-native.d.ts +2 -2
- package/dist/lib/native-hardware/hid-native.js +3 -3
- package/dist/lib/native-hardware/hid.js +4 -4
- package/dist/lib/native-hardware/index.d.ts +37 -37
- package/dist/lib/native-hardware/index.js +20 -20
- package/dist/lib/native-hardware/local-authentication.d.ts +1 -1
- package/dist/lib/native-hardware/local-authentication.js +1 -1
- package/dist/lib/native-hardware/location.js +1 -1
- package/dist/lib/native-hardware/media-permissions.d.ts +1 -1
- package/dist/lib/native-hardware/media-permissions.js +1 -1
- package/dist/lib/native-hardware/media.d.ts +1 -1
- package/dist/lib/native-hardware/media.js +1 -1
- package/dist/lib/native-hardware/midi-access.d.ts +1 -1
- package/dist/lib/native-hardware/midi-access.js +2 -2
- package/dist/lib/native-hardware/midi-internal.d.ts +1 -1
- package/dist/lib/native-hardware/midi-internal.js +1 -1
- package/dist/lib/native-hardware/midi-native-fallback.d.ts +1 -1
- package/dist/lib/native-hardware/midi-native-fallback.js +2 -2
- package/dist/lib/native-hardware/midi-ports.d.ts +1 -1
- package/dist/lib/native-hardware/midi-ports.js +1 -1
- package/dist/lib/native-hardware/midi.d.ts +5 -5
- package/dist/lib/native-hardware/midi.js +3 -3
- package/dist/lib/native-hardware/native-device-io.d.ts +1 -1
- package/dist/lib/native-hardware/native-device-io.js +1 -1
- package/dist/lib/native-hardware/native-device-lifecycle.js +1 -1
- package/dist/lib/native-hardware/notifications.d.ts +2 -2
- package/dist/lib/native-hardware/notifications.js +1 -1
- package/dist/lib/native-hardware/power-session.d.ts +2 -2
- package/dist/lib/native-hardware/power-session.js +1 -1
- package/dist/lib/native-hardware/secure-storage.d.ts +1 -1
- package/dist/lib/native-hardware/secure-storage.js +1 -1
- package/dist/lib/native-hardware/serial-native.d.ts +2 -2
- package/dist/lib/native-hardware/serial-native.js +3 -3
- package/dist/lib/native-hardware/serial.js +4 -4
- package/dist/lib/native-hardware/system-audio.d.ts +1 -1
- package/dist/lib/native-hardware/system-audio.js +1 -1
- package/dist/lib/native-hardware/usb-native.d.ts +2 -2
- package/dist/lib/native-hardware/usb-native.js +3 -3
- package/dist/lib/native-hardware/usb.js +4 -4
- package/dist/lib/theme.js +1 -1
- package/docs/design-tokens.md +28 -6
- package/docs/foundations.md +4 -2
- package/package.json +4 -2
- package/src/components/ui/confirm-dialog.md +97 -0
- package/src/components/ui/context-menu.md +158 -0
- package/src/components/ui/dropdown-menu.md +165 -0
- package/src/components/ui/hover-card.md +90 -0
- package/src/components/ui/select.md +111 -0
- package/src/lib/host-date-time-picker.md +29 -0
- package/src/lib/host-file-dialog.md +76 -0
- package/src/lib/host-native-menu.md +67 -0
- package/src/lib/host-share.md +36 -0
- package/src/lib/host-web-surface.md +66 -0
- package/src/styles/index.css +141 -68
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { type HostServiceRequestOptions } from './host-services.js';
|
|
2
3
|
export declare const HOST_NATIVE_MENU_MAX_DEPTH = 3;
|
|
3
4
|
export declare const HOST_NATIVE_MENU_MAX_ITEMS = 200;
|
|
4
5
|
export declare const HOST_NATIVE_MENU_MAX_TITLE_LENGTH = 256;
|
|
@@ -8,16 +9,14 @@ export interface NativeMenuShortcut {
|
|
|
8
9
|
key: string;
|
|
9
10
|
modifiers?: Array<'cmd' | 'shift' | 'alt' | 'ctrl'>;
|
|
10
11
|
}
|
|
11
|
-
interface
|
|
12
|
-
sublabel?: string;
|
|
12
|
+
interface MenuItemState {
|
|
13
13
|
enabled?: boolean;
|
|
14
14
|
shortcut?: NativeMenuShortcut;
|
|
15
|
-
/**
|
|
16
|
-
* Reserved for a future native destructive appearance. It is validated and
|
|
17
|
-
* carried through the v1 service but intentionally not rendered by AppKit.
|
|
18
|
-
*/
|
|
19
15
|
destructive?: boolean;
|
|
20
16
|
}
|
|
17
|
+
interface NativeMenuItemBase extends MenuItemState {
|
|
18
|
+
sublabel?: string;
|
|
19
|
+
}
|
|
21
20
|
export type NativeMenuItem = (NativeMenuItemBase & {
|
|
22
21
|
id: string;
|
|
23
22
|
kind?: 'normal';
|
|
@@ -43,6 +42,42 @@ export type NativeMenuItem = (NativeMenuItemBase & {
|
|
|
43
42
|
checked?: boolean;
|
|
44
43
|
submenu?: never;
|
|
45
44
|
});
|
|
45
|
+
interface RendererMenuItemBase extends MenuItemState {
|
|
46
|
+
id: string;
|
|
47
|
+
label: string;
|
|
48
|
+
/** Rendered only by the portable menu. */
|
|
49
|
+
icon?: LucideIcon;
|
|
50
|
+
/** Reserved for a future native-symbol allowlist. */
|
|
51
|
+
sfSymbol?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A renderer-facing declarative menu item shared by portable and native menu
|
|
55
|
+
* paths. Despite the pluralized public name, roots accept `MenuItems[]`.
|
|
56
|
+
*/
|
|
57
|
+
export type MenuItems = (RendererMenuItemBase & {
|
|
58
|
+
kind?: 'normal';
|
|
59
|
+
checked?: never;
|
|
60
|
+
submenu?: MenuItems[];
|
|
61
|
+
}) | {
|
|
62
|
+
id: string;
|
|
63
|
+
kind: 'separator';
|
|
64
|
+
label?: never;
|
|
65
|
+
icon?: never;
|
|
66
|
+
sfSymbol?: never;
|
|
67
|
+
enabled?: never;
|
|
68
|
+
checked?: never;
|
|
69
|
+
shortcut?: never;
|
|
70
|
+
destructive?: never;
|
|
71
|
+
submenu?: never;
|
|
72
|
+
} | (RendererMenuItemBase & {
|
|
73
|
+
kind: 'checkbox';
|
|
74
|
+
checked?: boolean | 'mixed';
|
|
75
|
+
submenu?: never;
|
|
76
|
+
}) | (RendererMenuItemBase & {
|
|
77
|
+
kind: 'radio';
|
|
78
|
+
checked?: boolean;
|
|
79
|
+
submenu?: never;
|
|
80
|
+
});
|
|
46
81
|
export interface HostNativeMenuAnchorRect {
|
|
47
82
|
x: number;
|
|
48
83
|
y: number;
|
|
@@ -69,6 +104,12 @@ export interface HostNativeMenu {
|
|
|
69
104
|
available: boolean;
|
|
70
105
|
open: (items: NativeMenuItem[], options: HostNativeMenuOptions) => Promise<HostNativeMenuResult>;
|
|
71
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Converts renderer menu items to the host wire model by explicit allowlist.
|
|
109
|
+
* Portable-only icons and sfSymbol metadata, plus any unexpected runtime
|
|
110
|
+
* fields, are intentionally omitted.
|
|
111
|
+
*/
|
|
112
|
+
export declare function toNativeMenuItems(items: MenuItems[]): NativeMenuItem[];
|
|
72
113
|
export declare function openNativeMenuWithHost(items: NativeMenuItem[], options: HostNativeMenuOptions): Promise<HostNativeMenuResult>;
|
|
73
114
|
export declare function useHostNativeMenu(): HostNativeMenu;
|
|
74
115
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-native-menu.d.ts","sourceRoot":"","sources":["../../src/lib/host-native-menu.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host-native-menu.d.ts","sourceRoot":"","sources":["../../src/lib/host-native-menu.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,11 +1,66 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { HostServiceRequestError, isHostServiceAvailable, requestHostService, } from './host-services';
|
|
2
|
+
import { HostServiceRequestError, isHostServiceAvailable, requestHostService, } from './host-services.js';
|
|
3
3
|
const HOST_CONTEXT_CHANGE_EVENT = 'moldable:host-context-change';
|
|
4
4
|
const NATIVE_MENU_SERVICE_NAME = 'nativeMenu';
|
|
5
5
|
export const HOST_NATIVE_MENU_MAX_DEPTH = 3;
|
|
6
6
|
export const HOST_NATIVE_MENU_MAX_ITEMS = 200;
|
|
7
7
|
export const HOST_NATIVE_MENU_MAX_TITLE_LENGTH = 256;
|
|
8
8
|
export const HOST_NATIVE_MENU_MAX_SUBLABEL_LENGTH = 512;
|
|
9
|
+
function nativeMenuItemState(item) {
|
|
10
|
+
return {
|
|
11
|
+
...(item.enabled !== undefined ? { enabled: item.enabled } : {}),
|
|
12
|
+
...(item.shortcut
|
|
13
|
+
? {
|
|
14
|
+
shortcut: {
|
|
15
|
+
key: item.shortcut.key,
|
|
16
|
+
...(item.shortcut.modifiers
|
|
17
|
+
? { modifiers: [...item.shortcut.modifiers] }
|
|
18
|
+
: {}),
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
: {}),
|
|
22
|
+
...(item.destructive !== undefined
|
|
23
|
+
? { destructive: item.destructive }
|
|
24
|
+
: {}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Converts renderer menu items to the host wire model by explicit allowlist.
|
|
29
|
+
* Portable-only icons and sfSymbol metadata, plus any unexpected runtime
|
|
30
|
+
* fields, are intentionally omitted.
|
|
31
|
+
*/
|
|
32
|
+
export function toNativeMenuItems(items) {
|
|
33
|
+
return items.map((item) => {
|
|
34
|
+
if (item.kind === 'separator') {
|
|
35
|
+
return { id: item.id, kind: 'separator' };
|
|
36
|
+
}
|
|
37
|
+
const state = nativeMenuItemState(item);
|
|
38
|
+
if (item.kind === 'checkbox') {
|
|
39
|
+
return {
|
|
40
|
+
id: item.id,
|
|
41
|
+
kind: 'checkbox',
|
|
42
|
+
title: item.label,
|
|
43
|
+
...state,
|
|
44
|
+
...(item.checked !== undefined ? { checked: item.checked } : {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (item.kind === 'radio') {
|
|
48
|
+
return {
|
|
49
|
+
id: item.id,
|
|
50
|
+
kind: 'radio',
|
|
51
|
+
title: item.label,
|
|
52
|
+
...state,
|
|
53
|
+
...(item.checked !== undefined ? { checked: item.checked } : {}),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
id: item.id,
|
|
58
|
+
title: item.label,
|
|
59
|
+
...state,
|
|
60
|
+
...(item.submenu ? { submenu: toNativeMenuItems(item.submenu) } : {}),
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
9
64
|
function finitePoint(value) {
|
|
10
65
|
return Number.isFinite(value.x) && Number.isFinite(value.y);
|
|
11
66
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getMoldableHostServices } from './frame-lifecycle';
|
|
1
|
+
import { getMoldableHostServices } from './frame-lifecycle.js';
|
|
2
2
|
const HOST_SERVICE_REQUEST_TYPE = 'moldable:service-request';
|
|
3
3
|
const HOST_SERVICE_RESPONSE_TYPE = 'moldable:service-response';
|
|
4
4
|
const HOST_SERVICE_CANCEL_TYPE = 'moldable:service-cancel';
|
package/dist/lib/host-share.d.ts
CHANGED
package/dist/lib/host-share.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { HostServiceRequestError, isHostServiceAvailable, requestHostService, } from './host-services';
|
|
2
|
+
import { HostServiceRequestError, isHostServiceAvailable, requestHostService, } from './host-services.js';
|
|
3
3
|
const HOST_CONTEXT_CHANGE_EVENT = 'moldable:host-context-change';
|
|
4
4
|
const SHARE_SERVICE_NAME = 'share';
|
|
5
5
|
const MAX_SHARE_ITEMS = 64;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type HostServiceRequestOptions } from './host-services.js';
|
|
2
|
+
export interface HostWebSurfaceBounds {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export interface HostWebSurfaceNavigationState {
|
|
9
|
+
surfaceId: string;
|
|
10
|
+
url: string;
|
|
11
|
+
title: string;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
canGoBack: boolean;
|
|
14
|
+
canGoForward: boolean;
|
|
15
|
+
faviconUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
export type HostWebSurfaceNavigationSubscriber = (state: HostWebSurfaceNavigationState) => void;
|
|
18
|
+
export interface HostWebSurface {
|
|
19
|
+
available: boolean;
|
|
20
|
+
create: (surfaceId: string, url: string, bounds: HostWebSurfaceBounds, options?: HostServiceRequestOptions) => Promise<void>;
|
|
21
|
+
navigate: (surfaceId: string, url: string, options?: HostServiceRequestOptions) => Promise<void>;
|
|
22
|
+
reload: (surfaceId: string, options?: HostServiceRequestOptions) => Promise<void>;
|
|
23
|
+
goBack: (surfaceId: string, options?: HostServiceRequestOptions) => Promise<void>;
|
|
24
|
+
goForward: (surfaceId: string, options?: HostServiceRequestOptions) => Promise<void>;
|
|
25
|
+
setBounds: (surfaceId: string, bounds: HostWebSurfaceBounds, options?: HostServiceRequestOptions) => Promise<void>;
|
|
26
|
+
setVisible: (surfaceId: string, visible: boolean, options?: HostServiceRequestOptions) => Promise<void>;
|
|
27
|
+
destroy: (surfaceId: string, options?: HostServiceRequestOptions) => Promise<void>;
|
|
28
|
+
onNavState: (subscribe: HostWebSurfaceNavigationSubscriber) => () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function useHostWebSurface(): HostWebSurface;
|
|
31
|
+
//# sourceMappingURL=host-web-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-web-surface.d.ts","sourceRoot":"","sources":["../../src/lib/host-web-surface.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,yBAAyB,EAG/B,MAAM,iBAAiB,CAAA;AAQxB,MAAM,WAAW,oBAAoB;IACnC,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,MAAM,kCAAkC,GAAG,CAC/C,KAAK,EAAE,6BAA6B,KACjC,IAAI,CAAA;AAET,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,QAAQ,EAAE,CACR,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,MAAM,EAAE,CACN,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,SAAS,EAAE,CACT,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,SAAS,EAAE,CACT,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,UAAU,EAAE,CACV,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,OAAO,EAAE,CACP,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,yBAAyB,KAChC,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB,UAAU,EAAE,CAAC,SAAS,EAAE,kCAAkC,KAAK,MAAM,IAAI,CAAA;CAC1E;AAmID,wBAAgB,iBAAiB,IAAI,cAAc,CAmElD"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { isHostServiceAvailable, requestHostService, } from './host-services.js';
|
|
3
|
+
const HOST_CONTEXT_CHANGE_EVENT = 'moldable:host-context-change';
|
|
4
|
+
const HOST_SERVICE_EVENT_TYPE = 'moldable:service-event';
|
|
5
|
+
const WEB_SURFACE_SERVICE_NAME = 'webSurface';
|
|
6
|
+
const SURFACE_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
7
|
+
const MAX_URL_LENGTH = 4096;
|
|
8
|
+
function isRecord(value) {
|
|
9
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
10
|
+
}
|
|
11
|
+
function validateSurfaceId(surfaceId) {
|
|
12
|
+
if (!SURFACE_ID.test(surfaceId)) {
|
|
13
|
+
throw new TypeError('surfaceId must be 1–64 ASCII letters, numbers, underscores, or hyphens.');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function validateUrl(url) {
|
|
17
|
+
if (typeof url !== 'string' ||
|
|
18
|
+
url.length === 0 ||
|
|
19
|
+
url.length > MAX_URL_LENGTH) {
|
|
20
|
+
throw new TypeError('Web-surface URLs must be 1–4096 characters.');
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const protocol = new URL(url).protocol;
|
|
24
|
+
if (protocol !== 'http:' && protocol !== 'https:')
|
|
25
|
+
throw new Error();
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
throw new TypeError('Web-surface URLs must be valid http or https URLs.');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function validateBounds(bounds) {
|
|
32
|
+
if (!bounds ||
|
|
33
|
+
!Number.isFinite(bounds.x) ||
|
|
34
|
+
!Number.isFinite(bounds.y) ||
|
|
35
|
+
!Number.isFinite(bounds.width) ||
|
|
36
|
+
!Number.isFinite(bounds.height) ||
|
|
37
|
+
bounds.width < 0 ||
|
|
38
|
+
bounds.height < 0) {
|
|
39
|
+
throw new TypeError('Web-surface bounds require finite coordinates and non-negative dimensions.');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function validatePayload(payload) {
|
|
43
|
+
validateSurfaceId(payload.surfaceId);
|
|
44
|
+
if (payload.method === 'create' || payload.method === 'navigate') {
|
|
45
|
+
validateUrl(payload.url);
|
|
46
|
+
}
|
|
47
|
+
if (payload.method === 'create' || payload.method === 'setBounds') {
|
|
48
|
+
validateBounds(payload.bounds);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async function requestWebSurface(payload, options) {
|
|
52
|
+
validatePayload(payload);
|
|
53
|
+
const result = await requestHostService(WEB_SURFACE_SERVICE_NAME, payload, options);
|
|
54
|
+
if (result?.status !== 'completed') {
|
|
55
|
+
throw new Error('The host web-surface service returned an invalid result.');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function isNavigationState(value) {
|
|
59
|
+
return (isRecord(value) &&
|
|
60
|
+
typeof value.surfaceId === 'string' &&
|
|
61
|
+
SURFACE_ID.test(value.surfaceId) &&
|
|
62
|
+
typeof value.url === 'string' &&
|
|
63
|
+
value.url.length <= MAX_URL_LENGTH &&
|
|
64
|
+
typeof value.title === 'string' &&
|
|
65
|
+
typeof value.loading === 'boolean' &&
|
|
66
|
+
typeof value.canGoBack === 'boolean' &&
|
|
67
|
+
typeof value.canGoForward === 'boolean' &&
|
|
68
|
+
(value.faviconUrl === undefined || typeof value.faviconUrl === 'string'));
|
|
69
|
+
}
|
|
70
|
+
function subscribeToNavigationState(subscribe) {
|
|
71
|
+
if (typeof window === 'undefined')
|
|
72
|
+
return () => undefined;
|
|
73
|
+
const handler = (event) => {
|
|
74
|
+
if (event.source !== window.parent || !isRecord(event.data))
|
|
75
|
+
return;
|
|
76
|
+
if (event.data.type !== HOST_SERVICE_EVENT_TYPE ||
|
|
77
|
+
event.data.service !== WEB_SURFACE_SERVICE_NAME ||
|
|
78
|
+
event.data.event !== 'navigationState' ||
|
|
79
|
+
!isNavigationState(event.data.payload)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
subscribe(event.data.payload);
|
|
83
|
+
};
|
|
84
|
+
window.addEventListener('message', handler);
|
|
85
|
+
return () => window.removeEventListener('message', handler);
|
|
86
|
+
}
|
|
87
|
+
export function useHostWebSurface() {
|
|
88
|
+
const [available, setAvailable] = useState(() => isHostServiceAvailable(WEB_SURFACE_SERVICE_NAME));
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
const update = () => setAvailable(isHostServiceAvailable(WEB_SURFACE_SERVICE_NAME));
|
|
91
|
+
update();
|
|
92
|
+
window.addEventListener(HOST_CONTEXT_CHANGE_EVENT, update);
|
|
93
|
+
return () => window.removeEventListener(HOST_CONTEXT_CHANGE_EVENT, update);
|
|
94
|
+
}, []);
|
|
95
|
+
const create = useCallback((surfaceId, url, bounds, options) => requestWebSurface({ method: 'create', surfaceId, url, bounds }, options), []);
|
|
96
|
+
const navigate = useCallback((surfaceId, url, options) => requestWebSurface({ method: 'navigate', surfaceId, url }, options), []);
|
|
97
|
+
const reload = useCallback((surfaceId, options) => requestWebSurface({ method: 'reload', surfaceId }, options), []);
|
|
98
|
+
const goBack = useCallback((surfaceId, options) => requestWebSurface({ method: 'goBack', surfaceId }, options), []);
|
|
99
|
+
const goForward = useCallback((surfaceId, options) => requestWebSurface({ method: 'goForward', surfaceId }, options), []);
|
|
100
|
+
const setBounds = useCallback((surfaceId, bounds, options) => requestWebSurface({ method: 'setBounds', surfaceId, bounds }, options), []);
|
|
101
|
+
const setVisible = useCallback((surfaceId, visible, options) => requestWebSurface({ method: 'setVisible', surfaceId, visible }, options), []);
|
|
102
|
+
const destroy = useCallback((surfaceId, options) => requestWebSurface({ method: 'destroy', surfaceId }, options), []);
|
|
103
|
+
const onNavState = useCallback(subscribeToNavigationState, []);
|
|
104
|
+
return {
|
|
105
|
+
available,
|
|
106
|
+
create,
|
|
107
|
+
navigate,
|
|
108
|
+
reload,
|
|
109
|
+
goBack,
|
|
110
|
+
goForward,
|
|
111
|
+
setBounds,
|
|
112
|
+
setVisible,
|
|
113
|
+
destroy,
|
|
114
|
+
onNavState,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
2
|
-
import type { NativeCapabilityId } from './types';
|
|
1
|
+
import { type NativeCapabilityBridgeOptions } from './bridge.js';
|
|
2
|
+
import type { NativeCapabilityId } from './types.js';
|
|
3
3
|
export declare const NATIVE_CAPABILITY_ACCESS_REQUEST_TYPE: "moldable:native-capabilities-access-request";
|
|
4
4
|
export declare const NATIVE_CAPABILITY_ACCESS_RESULT_TYPE: "moldable:native-capabilities-access-result";
|
|
5
5
|
export interface MoldableNativeCapabilityAccessState {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError, callNativeCapabilityBridge, } from './bridge';
|
|
2
|
-
import { isNativeCapabilityId } from './capabilities';
|
|
1
|
+
import { NativeCapabilityBridgeError, callNativeCapabilityBridge, } from './bridge.js';
|
|
2
|
+
import { isNativeCapabilityId } from './capabilities.js';
|
|
3
3
|
export const NATIVE_CAPABILITY_ACCESS_REQUEST_TYPE = 'moldable:native-capabilities-access-request';
|
|
4
4
|
export const NATIVE_CAPABILITY_ACCESS_RESULT_TYPE = 'moldable:native-capabilities-access-result';
|
|
5
5
|
function isEmbedded() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MoldableBluetoothAvailability, MoldableBluetoothDevice, MoldableBluetoothOperationOptions, MoldableBluetoothRequestDeviceOptions, MoldableBluetoothRequestOptions } from './bluetooth-types';
|
|
1
|
+
import type { MoldableBluetoothAvailability, MoldableBluetoothDevice, MoldableBluetoothOperationOptions, MoldableBluetoothRequestDeviceOptions, MoldableBluetoothRequestOptions } from './bluetooth-types.js';
|
|
2
2
|
/** Checks only for the standards-based Web Bluetooth entry point. */
|
|
3
3
|
export declare function isMoldableBluetoothSupported(): boolean;
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assertMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access';
|
|
2
|
-
import { abortableBluetooth, assertBluetoothUserGesture, bluetoothError, getBluetoothAPI, getBluetoothNavigator, validateBluetoothRequestOptions, } from './bluetooth-internal';
|
|
1
|
+
import { assertMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access.js';
|
|
2
|
+
import { abortableBluetooth, assertBluetoothUserGesture, bluetoothError, getBluetoothAPI, getBluetoothNavigator, validateBluetoothRequestOptions, } from './bluetooth-internal.js';
|
|
3
3
|
/** Checks only for the standards-based Web Bluetooth entry point. */
|
|
4
4
|
export function isMoldableBluetoothSupported() {
|
|
5
5
|
const api = getBluetoothNavigator()?.bluetooth;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MoldableBluetoothConnectionOptions, MoldableBluetoothDevice, MoldableBluetoothOperationOptions, MoldableBluetoothRemoteGATTServer, MoldableBluetoothRemoteGATTService, MoldableBluetoothUUID } from './bluetooth-types';
|
|
1
|
+
import type { MoldableBluetoothConnectionOptions, MoldableBluetoothDevice, MoldableBluetoothOperationOptions, MoldableBluetoothRemoteGATTServer, MoldableBluetoothRemoteGATTService, MoldableBluetoothUUID } from './bluetooth-types.js';
|
|
2
2
|
export declare class MoldableBluetoothConnection {
|
|
3
3
|
readonly device: MoldableBluetoothDevice;
|
|
4
4
|
readonly server: MoldableBluetoothRemoteGATTServer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MoldableBluetoothOperationOptions, MoldableBluetoothRemoteGATTCharacteristic, MoldableBluetoothRemoteGATTService, MoldableBluetoothUUID, MoldableBluetoothWriteMode } from './bluetooth-types';
|
|
1
|
+
import type { MoldableBluetoothOperationOptions, MoldableBluetoothRemoteGATTCharacteristic, MoldableBluetoothRemoteGATTService, MoldableBluetoothUUID, MoldableBluetoothWriteMode } from './bluetooth-types.js';
|
|
2
2
|
export declare function getMoldableBluetoothCharacteristic(service: MoldableBluetoothRemoteGATTService, characteristic: MoldableBluetoothUUID, options?: MoldableBluetoothOperationOptions): Promise<MoldableBluetoothRemoteGATTCharacteristic>;
|
|
3
3
|
export declare function readMoldableBluetoothValue(characteristic: MoldableBluetoothRemoteGATTCharacteristic, options?: MoldableBluetoothOperationOptions): Promise<DataView>;
|
|
4
4
|
/** Starts notifications and returns async, idempotent subscription cleanup. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { abortableBluetooth, bluetoothAborted, bluetoothError, } from './bluetooth-internal';
|
|
1
|
+
import { abortableBluetooth, bluetoothAborted, bluetoothError, } from './bluetooth-internal.js';
|
|
2
2
|
export async function getMoldableBluetoothCharacteristic(service, characteristic, options = {}) {
|
|
3
3
|
const operation = `get Bluetooth characteristic ${String(characteristic)}`;
|
|
4
4
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MoldableBluetoothAPI, MoldableBluetoothNavigator, MoldableBluetoothRequestDeviceOptions } from './bluetooth-types';
|
|
2
|
-
import { NativeCapabilityBridgeError } from './bridge';
|
|
1
|
+
import type { MoldableBluetoothAPI, MoldableBluetoothNavigator, MoldableBluetoothRequestDeviceOptions } from './bluetooth-types.js';
|
|
2
|
+
import { NativeCapabilityBridgeError } from './bridge.js';
|
|
3
3
|
export declare function bluetoothError(error: unknown, operation: string): NativeCapabilityBridgeError;
|
|
4
4
|
export declare function bluetoothAborted(operation: string): NativeCapabilityBridgeError;
|
|
5
5
|
export declare function getBluetoothNavigator(): MoldableBluetoothNavigator | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge';
|
|
1
|
+
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge.js';
|
|
2
2
|
export function bluetoothError(error, operation) {
|
|
3
3
|
if (error instanceof NativeCapabilityBridgeError)
|
|
4
4
|
return error;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MoldableBluetoothDevice, MoldableBluetoothRequestDeviceOptions } from './bluetooth-types';
|
|
2
|
-
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
1
|
+
import type { MoldableBluetoothDevice, MoldableBluetoothRequestDeviceOptions } from './bluetooth-types.js';
|
|
2
|
+
import { type NativeCapabilityBridgeOptions } from './bridge.js';
|
|
3
3
|
export type MoldableBluetoothTransport = {
|
|
4
4
|
kind: 'web-bluetooth';
|
|
5
5
|
device: MoldableBluetoothDevice;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
-
import { callNativeCapabilityBridge, } from './bridge';
|
|
1
|
+
import { isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access.js';
|
|
2
|
+
import { callNativeCapabilityBridge, } from './bridge.js';
|
|
3
3
|
const REQUEST_TYPE = 'moldable:native-bluetooth';
|
|
4
4
|
const RESULT_TYPE = 'moldable:native-bluetooth-result';
|
|
5
5
|
const EVENT_TYPE = 'moldable:native-bluetooth-event';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
-
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection';
|
|
3
|
-
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt';
|
|
4
|
-
export type * from './bluetooth-types';
|
|
5
|
-
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback';
|
|
6
|
-
export type { MoldableBluetoothTransport, MoldableNativeBluetoothDevice, MoldableNativeBluetoothService, } from './bluetooth-native-fallback';
|
|
1
|
+
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access.js';
|
|
2
|
+
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection.js';
|
|
3
|
+
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt.js';
|
|
4
|
+
export type * from './bluetooth-types.js';
|
|
5
|
+
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback.js';
|
|
6
|
+
export type { MoldableBluetoothTransport, MoldableNativeBluetoothDevice, MoldableNativeBluetoothService, } from './bluetooth-native-fallback.js';
|
|
7
7
|
//# sourceMappingURL=bluetooth.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access';
|
|
2
|
-
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection';
|
|
3
|
-
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt';
|
|
4
|
-
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback';
|
|
1
|
+
export { getMoldableBluetoothAvailability, isMoldableBluetoothSupported, requestMoldableBluetoothDevice, } from './bluetooth-access.js';
|
|
2
|
+
export { connectMoldableBluetoothDevice, MoldableBluetoothConnection, } from './bluetooth-connection.js';
|
|
3
|
+
export { getMoldableBluetoothCharacteristic, observeMoldableBluetoothNotifications, readMoldableBluetoothValue, writeMoldableBluetoothValue, } from './bluetooth-gatt.js';
|
|
4
|
+
export { requestMoldableBluetoothWithFallback } from './bluetooth-native-fallback.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NativeCapabilityErrorCode, type NativeCapabilityErrorPayload, type NativeCapabilityManifest } from './types';
|
|
1
|
+
import { type NativeCapabilityErrorCode, type NativeCapabilityErrorPayload, type NativeCapabilityManifest } from './types.js';
|
|
2
2
|
export declare const NATIVE_CAPABILITY_CANCEL_REQUEST_TYPE: "moldable:native-capabilities-cancel";
|
|
3
3
|
export interface NativeCapabilityBridgeOptions {
|
|
4
4
|
timeoutMs?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isNativeCapabilityManifest } from './capabilities';
|
|
2
|
-
import { NATIVE_CAPABILITIES_REQUEST_TYPE, NATIVE_CAPABILITIES_RESULT_TYPE, } from './types';
|
|
1
|
+
import { isNativeCapabilityManifest } from './capabilities.js';
|
|
2
|
+
import { NATIVE_CAPABILITIES_REQUEST_TYPE, NATIVE_CAPABILITIES_RESULT_TYPE, } from './types.js';
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
4
4
|
export const NATIVE_CAPABILITY_CANCEL_REQUEST_TYPE = 'moldable:native-capabilities-cancel';
|
|
5
5
|
const ERROR_CODES = new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NativeCapabilityDescriptor, type NativeCapabilityId, type NativeCapabilityManifest } from './types';
|
|
1
|
+
import { type NativeCapabilityDescriptor, type NativeCapabilityId, type NativeCapabilityManifest } from './types.js';
|
|
2
2
|
export declare function isNativeCapabilityId(value: unknown): value is NativeCapabilityId;
|
|
3
3
|
export declare function isNativeCapabilityDescriptor(value: unknown, expectedId?: NativeCapabilityId): value is NativeCapabilityDescriptor;
|
|
4
4
|
export declare function isNativeCapabilityManifest(value: unknown): value is NativeCapabilityManifest;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NATIVE_CAPABILITY_IDS, NATIVE_CAPABILITY_MANIFEST_SCHEMA_VERSION, } from './types';
|
|
1
|
+
import { NATIVE_CAPABILITY_IDS, NATIVE_CAPABILITY_MANIFEST_SCHEMA_VERSION, } from './types.js';
|
|
2
2
|
const CAPABILITY_IDS = new Set(NATIVE_CAPABILITY_IDS);
|
|
3
3
|
const PLATFORMS = new Set(['macos', 'windows', 'linux', 'unknown']);
|
|
4
4
|
const SUPPORT_LEVELS = new Set(['supported', 'partial', 'unsupported']);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requireMoldableNativeCapabilityAccess } from './access';
|
|
2
|
-
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge';
|
|
1
|
+
import { requireMoldableNativeCapabilityAccess } from './access.js';
|
|
2
|
+
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge.js';
|
|
3
3
|
function clipboardFor(capability, method) {
|
|
4
4
|
if (typeof navigator === 'undefined' ||
|
|
5
5
|
!navigator.clipboard ||
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError } from './bridge';
|
|
1
|
+
import { NativeCapabilityBridgeError } from './bridge.js';
|
|
2
2
|
export type DeviceIoOperation = 'enumerate' | 'request' | 'open' | 'close' | 'read' | 'write';
|
|
3
3
|
export declare function deviceIoError(capability: 'usb' | 'hid' | 'serial', operation: DeviceIoOperation, error: unknown): NativeCapabilityBridgeError;
|
|
4
4
|
export declare function unsupportedDeviceIoError(capability: 'usb' | 'hid' | 'serial'): NativeCapabilityBridgeError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge';
|
|
1
|
+
import { NativeCapabilityBridgeError, toNativeCapabilityBridgeError, } from './bridge.js';
|
|
2
2
|
function errorCodeFor(error, operation) {
|
|
3
3
|
if (error instanceof NativeCapabilityBridgeError)
|
|
4
4
|
return error.code;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NativeCapabilityRequestEnvelope, NativeCapabilityResultEnvelope } from './types';
|
|
1
|
+
import type { NativeCapabilityRequestEnvelope, NativeCapabilityResultEnvelope } from './types.js';
|
|
2
2
|
export declare const NATIVE_DISPLAYS_REQUEST_TYPE: "moldable:native-displays";
|
|
3
3
|
export declare const NATIVE_DISPLAYS_RESULT_TYPE: "moldable:native-displays-result";
|
|
4
4
|
/** A position in physical screen pixels within the virtual desktop. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { callNativeCapabilityBridge } from './bridge';
|
|
1
|
+
import { callNativeCapabilityBridge } from './bridge.js';
|
|
2
2
|
export const NATIVE_DISPLAYS_REQUEST_TYPE = 'moldable:native-displays';
|
|
3
3
|
export const NATIVE_DISPLAYS_RESULT_TYPE = 'moldable:native-displays-result';
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
2
|
-
import type { NativeCapabilityRequestEnvelope, NativeCapabilityResultEnvelope } from './types';
|
|
1
|
+
import { type NativeCapabilityBridgeOptions } from './bridge.js';
|
|
2
|
+
import type { NativeCapabilityRequestEnvelope, NativeCapabilityResultEnvelope } from './types.js';
|
|
3
3
|
export declare const NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE: "moldable:native-global-shortcuts";
|
|
4
4
|
export declare const NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE: "moldable:native-global-shortcuts-result";
|
|
5
5
|
export declare const NATIVE_GLOBAL_SHORTCUT_EVENT_TYPE: "moldable:native-global-shortcut-event";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError, callNativeCapabilityBridge, } from './bridge';
|
|
1
|
+
import { NativeCapabilityBridgeError, callNativeCapabilityBridge, } from './bridge.js';
|
|
2
2
|
export const NATIVE_GLOBAL_SHORTCUT_REQUEST_TYPE = 'moldable:native-global-shortcuts';
|
|
3
3
|
export const NATIVE_GLOBAL_SHORTCUT_RESULT_TYPE = 'moldable:native-global-shortcuts-result';
|
|
4
4
|
export const NATIVE_GLOBAL_SHORTCUT_EVENT_TYPE = 'moldable:native-global-shortcut-event';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NativeCapabilityBridgeOptions } from './bridge';
|
|
1
|
+
import { type NativeCapabilityBridgeOptions } from './bridge.js';
|
|
2
2
|
export declare const NATIVE_HAPTICS_REQUEST_TYPE: "moldable:native-haptics";
|
|
3
3
|
export declare const NATIVE_HAPTICS_RESULT_TYPE: "moldable:native-haptics-result";
|
|
4
4
|
export type MoldableHapticPattern = 'generic' | 'alignment' | 'level-change';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { callNativeCapabilityBridge, } from './bridge';
|
|
1
|
+
import { callNativeCapabilityBridge, } from './bridge.js';
|
|
2
2
|
export const NATIVE_HAPTICS_REQUEST_TYPE = 'moldable:native-haptics';
|
|
3
3
|
export const NATIVE_HAPTICS_RESULT_TYPE = 'moldable:native-haptics-result';
|
|
4
4
|
export function getMoldableHapticAvailability(options = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MoldableHidDevice, MoldableHidInputReportEvent } from './hid';
|
|
2
|
-
import { type MoldableNativeDeviceDescriptor } from './native-device-io';
|
|
1
|
+
import type { MoldableHidDevice, MoldableHidInputReportEvent } from './hid.js';
|
|
2
|
+
import { type MoldableNativeDeviceDescriptor } from './native-device-io.js';
|
|
3
3
|
export declare class NativeMoldableHidDevice extends EventTarget implements MoldableHidDevice {
|
|
4
4
|
readonly descriptor: MoldableNativeDeviceDescriptor;
|
|
5
5
|
readonly vendorId: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NativeCapabilityBridgeError } from './bridge';
|
|
2
|
-
import { bytesFromNativeDeviceResult, bytesWrittenFromNativeDeviceResult, closeMoldableNativeDevice, executeMoldableNativeDeviceOperation, openMoldableNativeDevice, } from './native-device-io';
|
|
3
|
-
import { NativeDeviceLifecycle, isNativeDeviceDisconnect, } from './native-device-lifecycle';
|
|
1
|
+
import { NativeCapabilityBridgeError } from './bridge.js';
|
|
2
|
+
import { bytesFromNativeDeviceResult, bytesWrittenFromNativeDeviceResult, closeMoldableNativeDevice, executeMoldableNativeDeviceOperation, openMoldableNativeDevice, } from './native-device-io.js';
|
|
3
|
+
import { NativeDeviceLifecycle, isNativeDeviceDisconnect, } from './native-device-lifecycle.js';
|
|
4
4
|
export class NativeMoldableHidDevice extends EventTarget {
|
|
5
5
|
descriptor;
|
|
6
6
|
vendorId;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assertMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access';
|
|
2
|
-
import { NativeCapabilityBridgeError } from './bridge';
|
|
3
|
-
import { awaitDeviceIoWithAbort, deviceIoError, unsupportedDeviceIoError, } from './device-io-errors';
|
|
4
|
-
import { NativeMoldableHidDevice, isNativeMoldableHidDevice, } from './hid-native';
|
|
5
|
-
import { listMoldableNativeDevices } from './native-device-io';
|
|
1
|
+
import { assertMoldableNativeCapabilityAccess, requireMoldableNativeCapabilityAccess, } from './access.js';
|
|
2
|
+
import { NativeCapabilityBridgeError } from './bridge.js';
|
|
3
|
+
import { awaitDeviceIoWithAbort, deviceIoError, unsupportedDeviceIoError, } from './device-io-errors.js';
|
|
4
|
+
import { NativeMoldableHidDevice, isNativeMoldableHidDevice, } from './hid-native.js';
|
|
5
|
+
import { listMoldableNativeDevices } from './native-device-io.js';
|
|
6
6
|
function assertNativeHidFiltersSupported(filters) {
|
|
7
7
|
if (filters?.some((filter) => filter.usagePage !== undefined || filter.usage !== undefined)) {
|
|
8
8
|
throw new NativeCapabilityBridgeError({
|