@signalcore/ui 0.1.0 → 1.0.0-beta.0
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/README.md +896 -513
- package/dist/AgentAbout.d.ts +186 -0
- package/dist/AgentAbout.js +1020 -0
- package/dist/AgentAbout.js.map +1 -0
- package/dist/AgentCard.d.ts +49 -0
- package/dist/AgentCard.js +77 -0
- package/dist/AgentCard.js.map +1 -0
- package/dist/AgentChat.d.ts +233 -0
- package/dist/AgentChat.js +1119 -0
- package/dist/AgentChat.js.map +1 -0
- package/dist/AgentSpace.d.ts +112 -0
- package/dist/AgentSpace.js +339 -0
- package/dist/AgentSpace.js.map +1 -0
- package/dist/AgentTasks.d.ts +48 -0
- package/dist/AgentTasks.js +120 -0
- package/dist/AgentTasks.js.map +1 -0
- package/dist/BrowserView.d.ts +52 -0
- package/dist/BrowserView.js +328 -0
- package/dist/BrowserView.js.map +1 -0
- package/dist/FileView.d.ts +63 -0
- package/dist/FileView.js +449 -0
- package/dist/FileView.js.map +1 -0
- package/dist/Modes.d.ts +13 -0
- package/dist/Modes.js +75 -0
- package/dist/Modes.js.map +1 -0
- package/dist/VoiceCall.d.ts +91 -0
- package/dist/VoiceCall.js +302 -0
- package/dist/VoiceCall.js.map +1 -0
- package/dist/about.d.ts +212 -0
- package/dist/about.js +136 -0
- package/dist/about.js.map +1 -0
- package/dist/agentIcons.d.ts +33 -0
- package/dist/agentIcons.js +36 -0
- package/dist/agentIcons.js.map +1 -0
- package/dist/automation/Automation.d.ts +35 -0
- package/dist/automation/Automation.js +268 -0
- package/dist/automation/Automation.js.map +1 -0
- package/dist/automation/RunView.d.ts +25 -0
- package/dist/automation/RunView.js +187 -0
- package/dist/automation/RunView.js.map +1 -0
- package/dist/automation/cron.d.ts +41 -0
- package/dist/automation/cron.js +169 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/marks.js +121 -0
- package/dist/automation/marks.js.map +1 -0
- package/dist/automation/messages.d.ts +113 -0
- package/dist/automation/messages.js +113 -0
- package/dist/automation/messages.js.map +1 -0
- package/dist/automation/record.d.ts +47 -0
- package/dist/automation/record.js +177 -0
- package/dist/automation/record.js.map +1 -0
- package/dist/automation/types.d.ts +143 -0
- package/dist/automation/when.d.ts +36 -0
- package/dist/automation/when.js +168 -0
- package/dist/automation/when.js.map +1 -0
- package/dist/blocks.d.ts +185 -0
- package/dist/browser.js +292 -0
- package/dist/browser.js.map +1 -0
- package/dist/call.d.ts +89 -0
- package/dist/call.js +218 -0
- package/dist/call.js.map +1 -0
- package/dist/channelParts.js +26 -0
- package/dist/channelParts.js.map +1 -0
- package/dist/classes.js +8 -3
- package/dist/classes.js.map +1 -0
- package/dist/client.d.ts +146 -54
- package/dist/client.js +204 -1
- package/dist/client.js.map +1 -0
- package/dist/conversationFiles.js +46 -0
- package/dist/conversationFiles.js.map +1 -0
- package/dist/credentials.d.ts +45 -0
- package/dist/credentials.js +98 -0
- package/dist/credentials.js.map +1 -0
- package/dist/dev.js +17 -0
- package/dist/dev.js.map +1 -0
- package/dist/es.d.ts +17 -0
- package/dist/es.js +382 -0
- package/dist/es.js.map +1 -0
- package/dist/files.d.ts +21 -0
- package/dist/files.js +214 -0
- package/dist/files.js.map +1 -0
- package/dist/frames.d.ts +115 -0
- package/dist/frames.js +219 -0
- package/dist/frames.js.map +1 -0
- package/dist/icons.js +29 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +63 -60
- package/dist/index.js +59 -45
- package/dist/kit/AudioPlayer.d.ts +20 -0
- package/dist/kit/AudioPlayer.js +116 -0
- package/dist/kit/AudioPlayer.js.map +1 -0
- package/dist/kit/Button.d.ts +29 -0
- package/dist/kit/Button.js +59 -0
- package/dist/kit/Button.js.map +1 -0
- package/dist/kit/Card.d.ts +16 -0
- package/dist/kit/Card.js +36 -0
- package/dist/kit/Card.js.map +1 -0
- package/dist/kit/Chart.js +152 -0
- package/dist/kit/Chart.js.map +1 -0
- package/dist/kit/Choices.d.ts +21 -0
- package/dist/kit/Choices.js +99 -0
- package/dist/kit/Choices.js.map +1 -0
- package/dist/kit/Combobox.d.ts +26 -0
- package/dist/kit/Combobox.js +190 -0
- package/dist/kit/Combobox.js.map +1 -0
- package/dist/kit/DateField.d.ts +17 -0
- package/dist/kit/DateField.js +133 -0
- package/dist/kit/DateField.js.map +1 -0
- package/dist/kit/Field.d.ts +40 -0
- package/dist/kit/Field.js +98 -0
- package/dist/kit/Field.js.map +1 -0
- package/dist/kit/FileField.d.ts +113 -0
- package/dist/kit/FileField.js +341 -0
- package/dist/kit/FileField.js.map +1 -0
- package/dist/kit/FileMark.d.ts +15 -0
- package/dist/kit/FileMark.js +39 -0
- package/dist/kit/FileMark.js.map +1 -0
- package/dist/kit/Inputs.d.ts +59 -0
- package/dist/kit/Inputs.js +205 -0
- package/dist/kit/Inputs.js.map +1 -0
- package/dist/kit/List.d.ts +47 -0
- package/dist/kit/List.js +85 -0
- package/dist/kit/List.js.map +1 -0
- package/dist/kit/Mark.d.ts +30 -0
- package/dist/kit/Mark.js +27 -0
- package/dist/kit/Mark.js.map +1 -0
- package/dist/kit/MarkStack.d.ts +15 -0
- package/dist/kit/MarkStack.js +26 -0
- package/dist/kit/MarkStack.js.map +1 -0
- package/dist/kit/Note.d.ts +11 -0
- package/dist/kit/Note.js +31 -0
- package/dist/kit/Note.js.map +1 -0
- package/dist/kit/Popover.js +90 -0
- package/dist/kit/Popover.js.map +1 -0
- package/dist/kit/RangeField.d.ts +14 -0
- package/dist/kit/RangeField.js +47 -0
- package/dist/kit/RangeField.js.map +1 -0
- package/dist/kit/RatingField.d.ts +14 -0
- package/dist/kit/RatingField.js +50 -0
- package/dist/kit/RatingField.js.map +1 -0
- package/dist/kit/Stat.d.ts +26 -0
- package/dist/kit/Stat.js +46 -0
- package/dist/kit/Stat.js.map +1 -0
- package/dist/kit/Switch.d.ts +14 -0
- package/dist/kit/Switch.js +21 -0
- package/dist/kit/Switch.js.map +1 -0
- package/dist/kit/Tag.d.ts +16 -0
- package/dist/kit/Tag.js +20 -0
- package/dist/kit/Tag.js.map +1 -0
- package/dist/kit/Tile.d.ts +34 -0
- package/dist/kit/Tile.js +52 -0
- package/dist/kit/Tile.js.map +1 -0
- package/dist/kit/TimeField.d.ts +31 -0
- package/dist/kit/TimeField.js +109 -0
- package/dist/kit/TimeField.js.map +1 -0
- package/dist/kit/context.d.ts +22 -0
- package/dist/kit/context.js +46 -0
- package/dist/kit/context.js.map +1 -0
- package/dist/kit/dates.d.ts +14 -0
- package/dist/kit/dates.js +129 -0
- package/dist/kit/dates.js.map +1 -0
- package/dist/kit/messages.d.ts +99 -0
- package/dist/kit/messages.js +66 -0
- package/dist/kit/messages.js.map +1 -0
- package/dist/kit/numbers.d.ts +12 -0
- package/dist/kit/numbers.js +40 -0
- package/dist/kit/numbers.js.map +1 -0
- package/dist/kit/options.d.ts +10 -0
- package/dist/kit/options.js +23 -0
- package/dist/kit/options.js.map +1 -0
- package/dist/kit/uploads.d.ts +42 -0
- package/dist/kit/uploads.js +165 -0
- package/dist/kit/uploads.js.map +1 -0
- package/dist/kit/waveform.js +76 -0
- package/dist/kit/waveform.js.map +1 -0
- package/dist/locale.d.ts +1 -0
- package/dist/locale.js +1 -0
- package/dist/markdown.js +84 -0
- package/dist/markdown.js.map +1 -0
- package/dist/marks.js +217 -0
- package/dist/marks.js.map +1 -0
- package/dist/reveal.js +48 -0
- package/dist/reveal.js.map +1 -0
- package/dist/stepGlyphs.js +62 -0
- package/dist/stepGlyphs.js.map +1 -0
- package/dist/surface/Form.js +264 -0
- package/dist/surface/Form.js.map +1 -0
- package/dist/surface/Markdown.js +42 -0
- package/dist/surface/Markdown.js.map +1 -0
- package/dist/surface/Surface.d.ts +31 -17
- package/dist/surface/Surface.js +480 -57
- package/dist/surface/Surface.js.map +1 -0
- package/dist/surface/scope.d.ts +32 -0
- package/dist/surface/scope.js +23 -0
- package/dist/surface/scope.js.map +1 -0
- package/dist/surface/values.d.ts +44 -0
- package/dist/surface/values.js +237 -0
- package/dist/surface/values.js.map +1 -0
- package/dist/tint.d.ts +10 -0
- package/dist/tint.js +19 -0
- package/dist/tint.js.map +1 -0
- package/dist/types.d.ts +534 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/useAgentFace.d.ts +18 -0
- package/dist/useAgentFace.js +45 -0
- package/dist/useAgentFace.js.map +1 -0
- package/dist/useCall.d.ts +39 -0
- package/dist/useCall.js +273 -0
- package/dist/useCall.js.map +1 -0
- package/dist/useConversation.d.ts +77 -0
- package/dist/useConversation.js +523 -0
- package/dist/useConversation.js.map +1 -0
- package/dist/useDictation.d.ts +17 -0
- package/dist/useDictation.js +68 -0
- package/dist/useDictation.js.map +1 -0
- package/dist/useLive.d.ts +26 -0
- package/dist/useLive.js +88 -0
- package/dist/useLive.js.map +1 -0
- package/dist/usePolled.js +68 -0
- package/dist/usePolled.js.map +1 -0
- package/dist/voice/Orb.d.ts +10 -9
- package/dist/voice/Orb.js +43 -39
- package/dist/voice/Orb.js.map +1 -0
- package/dist/voice/StillOrb.js +33 -0
- package/dist/voice/StillOrb.js.map +1 -0
- package/dist/voice/WebGLOrb.js +98 -0
- package/dist/voice/WebGLOrb.js.map +1 -0
- package/dist/voice/fluidDots.js +161 -0
- package/dist/voice/fluidDots.js.map +1 -0
- package/dist/voice/motion.js +84 -0
- package/dist/voice/motion.js.map +1 -0
- package/dist/voice/orbs.d.ts +32 -0
- package/dist/voice/orbs.js +16 -0
- package/dist/voice/orbs.js.map +1 -0
- package/dist/voice/useReducedMotion.js +16 -16
- package/dist/voice/useReducedMotion.js.map +1 -0
- package/dist/voice/wave.js +116 -0
- package/dist/voice/wave.js.map +1 -0
- package/dist/voice/webgl.js +177 -0
- package/dist/voice/webgl.js.map +1 -0
- package/dist/widget.js +284 -8
- package/package.json +49 -39
- package/src/AgentAbout.tsx +1621 -0
- package/src/AgentCard.tsx +123 -0
- package/src/AgentChat.tsx +1795 -0
- package/src/AgentSpace.tsx +540 -0
- package/src/AgentTasks.tsx +163 -0
- package/src/BrowserView.tsx +442 -0
- package/src/FileView.tsx +620 -0
- package/src/Modes.tsx +112 -0
- package/src/VoiceCall.tsx +411 -0
- package/src/about.ts +355 -0
- package/src/agentIcons.ts +56 -0
- package/src/automation/Automation.tsx +308 -0
- package/src/automation/RunView.tsx +213 -0
- package/src/automation/cron.ts +196 -0
- package/src/automation/marks.tsx +144 -0
- package/src/automation/messages.ts +231 -0
- package/src/automation/record.ts +206 -0
- package/src/automation/types.ts +146 -0
- package/src/automation/when.ts +195 -0
- package/src/blocks.ts +249 -0
- package/src/browser.ts +334 -0
- package/src/call.ts +300 -0
- package/src/channelParts.ts +17 -0
- package/src/classes.ts +10 -0
- package/src/client.ts +397 -0
- package/src/conversationFiles.ts +54 -0
- package/src/credentials.ts +158 -0
- package/src/dev.ts +20 -0
- package/src/es.ts +423 -0
- package/src/files.ts +238 -0
- package/src/frames.ts +291 -0
- package/src/icons.tsx +49 -0
- package/src/index.ts +270 -0
- package/src/kit/AudioPlayer.tsx +129 -0
- package/src/kit/Button.tsx +97 -0
- package/src/kit/Card.tsx +47 -0
- package/src/kit/Chart.tsx +129 -0
- package/src/kit/Choices.tsx +131 -0
- package/src/kit/Combobox.tsx +247 -0
- package/src/kit/DateField.tsx +156 -0
- package/src/kit/Field.tsx +137 -0
- package/src/kit/FileField.tsx +492 -0
- package/src/kit/FileMark.tsx +56 -0
- package/src/kit/Inputs.tsx +250 -0
- package/src/kit/List.tsx +135 -0
- package/src/kit/Mark.tsx +64 -0
- package/src/kit/MarkStack.tsx +29 -0
- package/src/kit/Note.tsx +42 -0
- package/src/kit/Popover.tsx +121 -0
- package/src/kit/RangeField.tsx +53 -0
- package/src/kit/RatingField.tsx +62 -0
- package/src/kit/Stat.tsx +60 -0
- package/src/kit/Switch.tsx +28 -0
- package/src/kit/Tag.tsx +32 -0
- package/src/kit/Tile.tsx +74 -0
- package/src/kit/TimeField.tsx +157 -0
- package/src/kit/context.tsx +246 -0
- package/src/kit/dates.ts +150 -0
- package/src/kit/messages.ts +160 -0
- package/src/kit/numbers.ts +44 -0
- package/src/kit/options.ts +30 -0
- package/src/kit/uploads.ts +244 -0
- package/src/kit/waveform.ts +84 -0
- package/src/locale.ts +6 -0
- package/src/markdown.ts +69 -0
- package/src/marks.tsx +328 -0
- package/src/reveal.ts +52 -0
- package/src/stepGlyphs.ts +83 -0
- package/src/styles.css +6961 -0
- package/src/surface/Form.tsx +299 -0
- package/src/surface/Markdown.tsx +55 -0
- package/src/surface/Surface.tsx +605 -0
- package/src/surface/scope.ts +82 -0
- package/src/surface/values.ts +361 -0
- package/src/tint.ts +14 -0
- package/src/types.ts +596 -0
- package/src/useAgentFace.ts +47 -0
- package/src/useCall.ts +292 -0
- package/src/useConversation.ts +627 -0
- package/src/useDictation.ts +83 -0
- package/src/useLive.ts +115 -0
- package/src/usePolled.ts +60 -0
- package/src/voice/Orb.tsx +45 -0
- package/src/voice/StillOrb.tsx +29 -0
- package/src/voice/WebGLOrb.tsx +98 -0
- package/src/voice/fluidDots.tsx +171 -0
- package/src/voice/motion.ts +112 -0
- package/src/voice/orbs.ts +39 -0
- package/src/voice/useReducedMotion.ts +24 -0
- package/src/voice/wave.tsx +129 -0
- package/src/voice/webgl.ts +209 -0
- package/src/widget/css.d.ts +5 -0
- package/src/widget/element.tsx +535 -0
- package/src/widget/index.ts +10 -0
- package/src/widget/mount.ts +27 -0
- package/src/widget/widget.css +253 -0
- package/dist/SignalcoreProvider.d.ts +0 -113
- package/dist/SignalcoreProvider.js +0 -84
- package/dist/automations/AppMarks.d.ts +0 -11
- package/dist/automations/AppMarks.js +0 -18
- package/dist/automations/AutomationCard.d.ts +0 -27
- package/dist/automations/AutomationCard.js +0 -53
- package/dist/automations/AutomationsWindow.d.ts +0 -38
- package/dist/automations/AutomationsWindow.js +0 -57
- package/dist/automations/Card.d.ts +0 -46
- package/dist/automations/Card.js +0 -45
- package/dist/automations/ScheduleMarks.d.ts +0 -13
- package/dist/automations/ScheduleMarks.js +0 -24
- package/dist/automations/presentationIcons.d.ts +0 -7
- package/dist/automations/presentationIcons.js +0 -67
- package/dist/automations/schedule.d.ts +0 -25
- package/dist/automations/schedule.js +0 -59
- package/dist/automations/time.d.ts +0 -3
- package/dist/automations/time.js +0 -25
- package/dist/browser/BrowserView.d.ts +0 -43
- package/dist/browser/BrowserView.js +0 -94
- package/dist/browser/room.d.ts +0 -21
- package/dist/browser/room.js +0 -33
- package/dist/browser/useBrowserSession.d.ts +0 -17
- package/dist/browser/useBrowserSession.js +0 -67
- package/dist/builder/BuilderChat.d.ts +0 -32
- package/dist/builder/BuilderChat.js +0 -41
- package/dist/builder/BuilderTranscript.d.ts +0 -49
- package/dist/builder/BuilderTranscript.js +0 -62
- package/dist/builder/StatusLine.d.ts +0 -8
- package/dist/builder/StatusLine.js +0 -17
- package/dist/builder/answer.d.ts +0 -7
- package/dist/builder/answer.js +0 -8
- package/dist/builder/blocks.d.ts +0 -31
- package/dist/builder/blocks.js +0 -74
- package/dist/builder/items.d.ts +0 -15
- package/dist/builder/items.js +0 -21
- package/dist/builder/steps.d.ts +0 -20
- package/dist/builder/steps.js +0 -120
- package/dist/builder/time.d.ts +0 -4
- package/dist/builder/time.js +0 -24
- package/dist/builder/useBuildSession.d.ts +0 -36
- package/dist/builder/useBuildSession.js +0 -130
- package/dist/builder/workingOn.d.ts +0 -7
- package/dist/builder/workingOn.js +0 -15
- package/dist/chat/AgentChat.d.ts +0 -37
- package/dist/chat/AgentChat.js +0 -21
- package/dist/chat/ChatView.d.ts +0 -25
- package/dist/chat/ChatView.js +0 -34
- package/dist/chat/Composer.d.ts +0 -20
- package/dist/chat/Composer.js +0 -22
- package/dist/chat/MessageRow.d.ts +0 -22
- package/dist/chat/MessageRow.js +0 -32
- package/dist/chat/arrival.d.ts +0 -15
- package/dist/chat/arrival.js +0 -25
- package/dist/chat/history.d.ts +0 -24
- package/dist/chat/history.js +0 -45
- package/dist/chat/moments.d.ts +0 -25
- package/dist/chat/moments.js +0 -72
- package/dist/chat/types.d.ts +0 -12
- package/dist/chat/types.js +0 -1
- package/dist/chat/useComposer.d.ts +0 -46
- package/dist/chat/useComposer.js +0 -62
- package/dist/chat/useConversation.d.ts +0 -35
- package/dist/chat/useConversation.js +0 -71
- package/dist/chat/useStickToBottom.d.ts +0 -9
- package/dist/chat/useStickToBottom.js +0 -33
- package/dist/chat/useTurns.d.ts +0 -49
- package/dist/chat/useTurns.js +0 -111
- package/dist/classes.d.ts +0 -2
- package/dist/development.d.ts +0 -5
- package/dist/development.js +0 -8
- package/dist/flow/FlowWindow.d.ts +0 -42
- package/dist/flow/FlowWindow.js +0 -126
- package/dist/flow/index.d.ts +0 -16
- package/dist/flow/index.js +0 -16
- package/dist/flow/kinds.d.ts +0 -23
- package/dist/flow/kinds.js +0 -48
- package/dist/flow/map.d.ts +0 -44
- package/dist/flow/map.js +0 -225
- package/dist/flow/nodePaths.d.ts +0 -7
- package/dist/flow/nodePaths.js +0 -17
- package/dist/flow/relations.d.ts +0 -42
- package/dist/flow/relations.js +0 -174
- package/dist/host.d.ts +0 -124
- package/dist/host.js +0 -1
- package/dist/live/LiveView.d.ts +0 -28
- package/dist/live/LiveView.js +0 -55
- package/dist/live/capture.d.ts +0 -20
- package/dist/live/capture.js +0 -100
- package/dist/live/follow.d.ts +0 -26
- package/dist/live/follow.js +0 -72
- package/dist/live/paint.d.ts +0 -13
- package/dist/live/paint.js +0 -77
- package/dist/live/useLiveStream.d.ts +0 -16
- package/dist/live/useLiveStream.js +0 -57
- package/dist/look.d.ts +0 -33
- package/dist/look.js +0 -241
- package/dist/messages/en.d.ts +0 -3
- package/dist/messages/en.js +0 -251
- package/dist/messages/es.d.ts +0 -3
- package/dist/messages/es.js +0 -251
- package/dist/messages/index.d.ts +0 -16
- package/dist/messages/index.js +0 -33
- package/dist/messages/types.d.ts +0 -246
- package/dist/messages/types.js +0 -1
- package/dist/parts/Button.d.ts +0 -18
- package/dist/parts/Button.js +0 -17
- package/dist/parts/Icon.d.ts +0 -39
- package/dist/parts/Icon.js +0 -37
- package/dist/parts/Input.d.ts +0 -6
- package/dist/parts/Input.js +0 -11
- package/dist/parts/Spinner.d.ts +0 -2
- package/dist/parts/Spinner.js +0 -7
- package/dist/patterns.d.ts +0 -15
- package/dist/patterns.js +0 -5
- package/dist/presets.d.ts +0 -82
- package/dist/presets.js +0 -81
- package/dist/primitives.d.ts +0 -22
- package/dist/primitives.js +0 -58
- package/dist/request/RequestCard.d.ts +0 -34
- package/dist/request/RequestCard.js +0 -101
- package/dist/request/approval/ApprovalPreview.d.ts +0 -5
- package/dist/request/approval/ApprovalPreview.js +0 -27
- package/dist/request/approval/shapes.d.ts +0 -32
- package/dist/request/approval/shapes.js +0 -68
- package/dist/request/apps.d.ts +0 -11
- package/dist/request/apps.js +0 -27
- package/dist/request/cards.d.ts +0 -12
- package/dist/request/cards.js +0 -24
- package/dist/request/deliver.d.ts +0 -12
- package/dist/request/deliver.js +0 -21
- package/dist/request/handOver.d.ts +0 -18
- package/dist/request/handOver.js +0 -33
- package/dist/request/kinds/Approval.d.ts +0 -3
- package/dist/request/kinds/Approval.js +0 -9
- package/dist/request/kinds/Choice.d.ts +0 -3
- package/dist/request/kinds/Choice.js +0 -8
- package/dist/request/kinds/Connect.d.ts +0 -9
- package/dist/request/kinds/Connect.js +0 -119
- package/dist/request/kinds/FreeText.d.ts +0 -3
- package/dist/request/kinds/FreeText.js +0 -20
- package/dist/request/kinds/HandOver.d.ts +0 -13
- package/dist/request/kinds/HandOver.js +0 -20
- package/dist/request/kinds/Secret.d.ts +0 -7
- package/dist/request/kinds/Secret.js +0 -49
- package/dist/request/kinds/Upload.d.ts +0 -6
- package/dist/request/kinds/Upload.js +0 -47
- package/dist/request/types.d.ts +0 -83
- package/dist/request/types.js +0 -1
- package/dist/safeUrl.d.ts +0 -6
- package/dist/safeUrl.js +0 -8
- package/dist/stream/builder.d.ts +0 -176
- package/dist/stream/builder.js +0 -202
- package/dist/stream/reduce.d.ts +0 -51
- package/dist/stream/reduce.js +0 -58
- package/dist/stream/untilAborted.d.ts +0 -7
- package/dist/stream/untilAborted.js +0 -32
- package/dist/stream/useRunStream.d.ts +0 -26
- package/dist/stream/useRunStream.js +0 -137
- package/dist/styles.css +0 -2318
- package/dist/surface/HostNode.d.ts +0 -14
- package/dist/surface/HostNode.js +0 -30
- package/dist/surface/Node.d.ts +0 -7
- package/dist/surface/Node.js +0 -49
- package/dist/surface/SurfaceBoundary.d.ts +0 -26
- package/dist/surface/SurfaceBoundary.js +0 -20
- package/dist/surface/bindings.d.ts +0 -14
- package/dist/surface/bindings.js +0 -37
- package/dist/surface/check.d.ts +0 -27
- package/dist/surface/check.js +0 -102
- package/dist/surface/format.d.ts +0 -10
- package/dist/surface/format.js +0 -32
- package/dist/surface/hosts.d.ts +0 -6
- package/dist/surface/hosts.js +0 -11
- package/dist/surface/scene.d.ts +0 -21
- package/dist/surface/scene.js +0 -8
- package/dist/surface/templates/Browser.d.ts +0 -6
- package/dist/surface/templates/Browser.js +0 -11
- package/dist/surface/templates/Chart.d.ts +0 -6
- package/dist/surface/templates/Chart.js +0 -13
- package/dist/surface/templates/Choices.d.ts +0 -3
- package/dist/surface/templates/Choices.js +0 -12
- package/dist/surface/templates/Form.d.ts +0 -3
- package/dist/surface/templates/Form.js +0 -44
- package/dist/surface/templates/KeyValue.d.ts +0 -3
- package/dist/surface/templates/KeyValue.js +0 -7
- package/dist/surface/templates/Layout.d.ts +0 -5
- package/dist/surface/templates/Layout.js +0 -16
- package/dist/surface/templates/Live.d.ts +0 -6
- package/dist/surface/templates/Live.js +0 -9
- package/dist/surface/templates/Media.d.ts +0 -5
- package/dist/surface/templates/Media.js +0 -13
- package/dist/surface/templates/Slots.d.ts +0 -3
- package/dist/surface/templates/Slots.js +0 -19
- package/dist/surface/templates/Table.d.ts +0 -3
- package/dist/surface/templates/Table.js +0 -12
- package/dist/surface/templates/Text.d.ts +0 -4
- package/dist/surface/templates/Text.js +0 -15
- package/dist/surface/templates/index.d.ts +0 -7
- package/dist/surface/templates/index.js +0 -32
- package/dist/surface/types.d.ts +0 -68
- package/dist/surface/types.js +0 -6
- package/dist/theme.d.ts +0 -62
- package/dist/theme.js +0 -9
- package/dist/useTokens.d.ts +0 -7
- package/dist/useTokens.js +0 -41
- package/dist/voice/VoiceWindow.d.ts +0 -18
- package/dist/voice/VoiceWindow.js +0 -35
- package/dist/voice/index.d.ts +0 -13
- package/dist/voice/index.js +0 -12
- package/dist/voice/meter.d.ts +0 -16
- package/dist/voice/meter.js +0 -52
- package/dist/voice/orbColors.d.ts +0 -16
- package/dist/voice/orbColors.js +0 -75
- package/dist/voice/pushable.d.ts +0 -16
- package/dist/voice/pushable.js +0 -56
- package/dist/voice/useDictation.d.ts +0 -24
- package/dist/voice/useDictation.js +0 -60
- package/dist/voice/useReducedMotion.d.ts +0 -5
- package/dist/voice/useVoice.d.ts +0 -70
- package/dist/voice/useVoice.js +0 -197
- package/dist/voice/useVoicePrimitives.d.ts +0 -7
- package/dist/voice/useVoicePrimitives.js +0 -11
- package/dist/voice/voice.d.ts +0 -55
- package/dist/voice/voice.js +0 -9
- package/dist/voice/webSpeech.d.ts +0 -33
- package/dist/voice/webSpeech.js +0 -258
- package/dist/widget.js.map +0 -1
- package/dist/windows/AgentSpace.d.ts +0 -78
- package/dist/windows/AgentSpace.js +0 -135
- package/dist/windows/Captions.d.ts +0 -13
- package/dist/windows/Captions.js +0 -22
- package/dist/windows/Dock.d.ts +0 -37
- package/dist/windows/Dock.js +0 -22
- package/dist/windows/Journal.d.ts +0 -15
- package/dist/windows/Journal.js +0 -19
- package/dist/windows/KindMark.d.ts +0 -7
- package/dist/windows/KindMark.js +0 -31
- package/dist/windows/Pending.d.ts +0 -8
- package/dist/windows/Pending.js +0 -17
- package/dist/windows/Stage.d.ts +0 -18
- package/dist/windows/Stage.js +0 -21
- package/dist/windows/StatusLabel.d.ts +0 -9
- package/dist/windows/StatusLabel.js +0 -7
- package/dist/windows/Strip.d.ts +0 -17
- package/dist/windows/Strip.js +0 -42
- package/dist/windows/SurfaceWindow.d.ts +0 -20
- package/dist/windows/SurfaceWindow.js +0 -12
- package/dist/windows/WindowFrame.d.ts +0 -23
- package/dist/windows/WindowFrame.js +0 -22
- package/dist/windows/hearing.d.ts +0 -11
- package/dist/windows/hearing.js +0 -26
- package/dist/windows/kinds.d.ts +0 -47
- package/dist/windows/kinds.js +0 -28
- package/dist/windows/reduce.d.ts +0 -98
- package/dist/windows/reduce.js +0 -151
- package/dist/windows/registry.d.ts +0 -18
- package/dist/windows/registry.js +0 -61
- package/dist/windows/reveal.d.ts +0 -9
- package/dist/windows/reveal.js +0 -6
- package/dist/windows/space.d.ts +0 -21
- package/dist/windows/space.js +0 -6
- package/dist/windows/status.d.ts +0 -11
- package/dist/windows/status.js +0 -30
- package/dist/windows/types.d.ts +0 -15
- package/dist/windows/types.js +0 -1
- package/dist/windows/useLoaded.d.ts +0 -44
- package/dist/windows/useLoaded.js +0 -58
- package/dist/windows/useUnread.d.ts +0 -7
- package/dist/windows/useUnread.js +0 -21
- package/dist/windows/useWindows.d.ts +0 -70
- package/dist/windows/useWindows.js +0 -60
package/dist/host.d.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, ReactNode } from "react";
|
|
2
|
-
import type { VoiceState } from "./voice/voice.js";
|
|
3
|
-
/**
|
|
4
|
-
* What the user did on a component, before the surface adds its own id (see `SurfaceAction`):
|
|
5
|
-
* the name of the action, its data, and what the user said in words ("Good fit: Calle Mayor 3"),
|
|
6
|
-
* which is how it shows in the conversation.
|
|
7
|
-
*/
|
|
8
|
-
export interface HostAction {
|
|
9
|
-
name: string;
|
|
10
|
-
data: Record<string, unknown>;
|
|
11
|
-
label: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* What a host's component is given when it draws a catalog component's name (`SlotPicker`): the
|
|
15
|
-
* properties the agent filled, with bindings to the surface's data already resolved. They are
|
|
16
|
-
* the agent's words, not checked against anything: read them loosely. A container also gets its
|
|
17
|
-
* `children`, drawn, and a component that asks the user for something reports it with
|
|
18
|
-
* `onAction`, which is missing when the surface takes no actions (an older one).
|
|
19
|
-
*
|
|
20
|
-
* A component the host registered under a name of its own is drawn for a `host` node instead,
|
|
21
|
-
* and is given what is described at `HostComponents`.
|
|
22
|
-
*/
|
|
23
|
-
export type HostProps = Record<string, unknown> & {
|
|
24
|
-
children?: ReactNode;
|
|
25
|
-
onAction?: ((action: HostAction) => void) | undefined;
|
|
26
|
-
};
|
|
27
|
-
export interface ButtonProps {
|
|
28
|
-
children: ReactNode;
|
|
29
|
-
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
30
|
-
size?: "sm" | "md" | undefined;
|
|
31
|
-
type?: "button" | "submit" | undefined;
|
|
32
|
-
disabled?: boolean | undefined;
|
|
33
|
-
onClick?: (() => void) | undefined;
|
|
34
|
-
}
|
|
35
|
-
/** A box with a title: what a surface's `Card` is drawn with. */
|
|
36
|
-
export interface CardProps {
|
|
37
|
-
title?: string | undefined;
|
|
38
|
-
subtitle?: string | undefined;
|
|
39
|
-
children?: ReactNode;
|
|
40
|
-
}
|
|
41
|
-
/** Rows of records; every cell is already text. */
|
|
42
|
-
export interface TableProps {
|
|
43
|
-
columns: {
|
|
44
|
-
key: string;
|
|
45
|
-
label: string;
|
|
46
|
-
}[];
|
|
47
|
-
rows: Record<string, string>[];
|
|
48
|
-
}
|
|
49
|
-
/** The control of a text, number or date field; the label around it is the form's. */
|
|
50
|
-
export interface InputProps {
|
|
51
|
-
name: string;
|
|
52
|
-
type: "text" | "number" | "date";
|
|
53
|
-
required?: boolean | undefined;
|
|
54
|
-
onChange: (value: string) => void;
|
|
55
|
-
}
|
|
56
|
-
/** The control of a field with options; `""` is nothing picked yet. */
|
|
57
|
-
export interface SelectProps {
|
|
58
|
-
name: string;
|
|
59
|
-
options: {
|
|
60
|
-
id: string;
|
|
61
|
-
label: string;
|
|
62
|
-
}[];
|
|
63
|
-
required?: boolean | undefined;
|
|
64
|
-
onChange: (value: string) => void;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* The orb of the voice window: a shape that shows where the conversation stands and how loud it
|
|
68
|
-
* is. Nothing here is the agent's words; a host replaces it with its own artwork.
|
|
69
|
-
*/
|
|
70
|
-
export interface OrbProps {
|
|
71
|
-
/** Where the conversation stands. The orb looks different in each. */
|
|
72
|
-
state: VoiceState;
|
|
73
|
-
/**
|
|
74
|
-
* How loud the microphone (while `listening`) or the voice (while `speaking`) is right now, from
|
|
75
|
-
* 0 to 1, already smoothed: it can drive an animation as it is. 0 in the other states.
|
|
76
|
-
*/
|
|
77
|
-
level: number;
|
|
78
|
-
/** The diameter in pixels. Default: the orb's own. */
|
|
79
|
-
size?: number | undefined;
|
|
80
|
-
/** What the orb is, for those who cannot see it: set it as the `aria-label`. */
|
|
81
|
-
label: string;
|
|
82
|
-
className?: string | undefined;
|
|
83
|
-
}
|
|
84
|
-
export interface Primitives {
|
|
85
|
-
Button: ComponentType<ButtonProps>;
|
|
86
|
-
Card: ComponentType<CardProps>;
|
|
87
|
-
Table: ComponentType<TableProps>;
|
|
88
|
-
Input: ComponentType<InputProps>;
|
|
89
|
-
Select: ComponentType<SelectProps>;
|
|
90
|
-
/**
|
|
91
|
-
* Only the voice window draws it (`@signalcore/ui/voice`, whose default is the one built on the
|
|
92
|
-
* `orb-ui` library, so a host that never speaks does not load it). Ours stands still under
|
|
93
|
-
* `prefers-reduced-motion`; a replacement should too.
|
|
94
|
-
*/
|
|
95
|
-
Orb: ComponentType<OrbProps>;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* The host's components, by name. Three kinds of name:
|
|
99
|
-
*
|
|
100
|
-
* - A name of the host's own (`PropertyCard`), registered with the API too (in the SDKs,
|
|
101
|
-
* `client.ui.components.put`) with a schema for its props and a text twin. An agent uses it
|
|
102
|
-
* with a node `{ id, type: "host", component: "PropertyCard", props: { … } }`, and the host's
|
|
103
|
-
* component is drawn with:
|
|
104
|
-
* - the node's `props`, exactly as given: the API validated them against the registered
|
|
105
|
-
* schema before the surface was sent, so the component can rely on their shape. They are
|
|
106
|
-
* values: a binding (`{ path }`) is not looked up in them;
|
|
107
|
-
* - `onAction({ name, data, label })`, to report what the user does (a "Good fit" button):
|
|
108
|
-
* it goes back through the surface's action path as `Action` (with the surface's id), like
|
|
109
|
-
* a pick on a list. It is missing when the surface takes no actions (a record), and the
|
|
110
|
-
* node's props cannot replace it;
|
|
111
|
-
* - no `children`.
|
|
112
|
-
*
|
|
113
|
-
* The component's text twin is already part of the surface's `fallback_text`, so a surface
|
|
114
|
-
* whose component this page has not registered, or whose component throws, shows the whole
|
|
115
|
-
* surface in words instead (and a development build tells the developer which name is missing).
|
|
116
|
-
* - The catalog's (`SlotPicker`, `DataTable`…): a surface that uses the name is drawn with the
|
|
117
|
-
* host's component, given `HostProps`. Typed loosely so a component can declare the
|
|
118
|
-
* properties it expects.
|
|
119
|
-
* - The primitives (`Button`, `Card`, `Table`, `Input`, `Select`): every surface is built from
|
|
120
|
-
* the host's, with the typed props above. They add nothing to the catalog: a surface cannot
|
|
121
|
-
* name them, as a catalog component or as a `host` node. `Orb` is one too, though no surface
|
|
122
|
-
* uses it: the voice window does.
|
|
123
|
-
*/
|
|
124
|
-
export type HostComponents = Partial<Primitives> & Record<string, ComponentType<never>>;
|
package/dist/host.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/live/LiveView.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { LiveStatus } from "./follow.js";
|
|
2
|
-
export interface LiveViewProps {
|
|
3
|
-
/** The stream to watch (`liv_...`), from a `live` surface or a browser session. */
|
|
4
|
-
streamId: string;
|
|
5
|
-
/** The shape of the picture as "16:9", held until the stream says its real size. */
|
|
6
|
-
aspect?: string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Whether the person may act on the stream: the pointer, the wheel and (with the focus on it)
|
|
9
|
-
* the keys are then sent to it. Whether it is their turn is for the stream's producer to say.
|
|
10
|
-
*/
|
|
11
|
-
input?: boolean | undefined;
|
|
12
|
-
/** Told each time the view's state changes; `unavailable` means it cannot be watched from here. */
|
|
13
|
-
onStatus?: ((status: LiveStatus) => void) | undefined;
|
|
14
|
-
/** What the picture is, for those who cannot see it. */
|
|
15
|
-
label?: string | undefined;
|
|
16
|
-
className?: string | undefined;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A live stream, watched: the pictures it sends drawn on a canvas as they arrive (the newest,
|
|
20
|
-
* never a queue), sized by the stream, and a quiet word for how the connection is. A dropped
|
|
21
|
-
* connection is opened again, a little later each time; one that ended or was refused is not.
|
|
22
|
-
* It needs a client that can `live.connect` (the SDK's does).
|
|
23
|
-
*
|
|
24
|
-
* With `input`, the view takes the pointer and the keyboard once the stream says it takes input:
|
|
25
|
-
* clicks, drags, the wheel and keys go to the stream in its own pixels. The canvas is then
|
|
26
|
-
* reachable by the keyboard, and keys go to the stream only while it has the focus (Tab leaves).
|
|
27
|
-
*/
|
|
28
|
-
export declare function LiveView(props: LiveViewProps): import("react").JSX.Element;
|
package/dist/live/LiveView.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
|
-
import { Scoped, useMessages, useParts } from "../SignalcoreProvider.js";
|
|
4
|
-
import { capture } from "./capture.js";
|
|
5
|
-
import { painterOn } from "./paint.js";
|
|
6
|
-
import { useLiveStream } from "./useLiveStream.js";
|
|
7
|
-
const SHAPE = /^\d{1,3}:\d{1,3}$/;
|
|
8
|
-
const DEFAULT_SHAPE = "16 / 9";
|
|
9
|
-
/**
|
|
10
|
-
* A live stream, watched: the pictures it sends drawn on a canvas as they arrive (the newest,
|
|
11
|
-
* never a queue), sized by the stream, and a quiet word for how the connection is. A dropped
|
|
12
|
-
* connection is opened again, a little later each time; one that ended or was refused is not.
|
|
13
|
-
* It needs a client that can `live.connect` (the SDK's does).
|
|
14
|
-
*
|
|
15
|
-
* With `input`, the view takes the pointer and the keyboard once the stream says it takes input:
|
|
16
|
-
* clicks, drags, the wheel and keys go to the stream in its own pixels. The canvas is then
|
|
17
|
-
* reachable by the keyboard, and keys go to the stream only while it has the focus (Tab leaves).
|
|
18
|
-
*/
|
|
19
|
-
export function LiveView(props) {
|
|
20
|
-
return (_jsx(Scoped, { children: _jsx(Viewer, { ...props }) }));
|
|
21
|
-
}
|
|
22
|
-
function Viewer({ streamId, aspect = "16:9", input = false, onStatus, label, className, }) {
|
|
23
|
-
const part = useParts();
|
|
24
|
-
const messages = useMessages();
|
|
25
|
-
const shape = SHAPE.test(aspect) ? aspect.replace(":", " / ") : DEFAULT_SHAPE;
|
|
26
|
-
const canvas = useRef(null);
|
|
27
|
-
const painter = useRef(undefined);
|
|
28
|
-
const reported = useRef(onStatus);
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (!canvas.current)
|
|
31
|
-
return undefined;
|
|
32
|
-
const drawing = painterOn(canvas.current);
|
|
33
|
-
painter.current = drawing;
|
|
34
|
-
return () => {
|
|
35
|
-
drawing.dispose();
|
|
36
|
-
painter.current = undefined;
|
|
37
|
-
};
|
|
38
|
-
}, []);
|
|
39
|
-
const { status, info, send } = useLiveStream(streamId, (frame) => {
|
|
40
|
-
painter.current?.paint(frame.bytes);
|
|
41
|
-
});
|
|
42
|
-
const interactive = input && info?.input === true;
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (!canvas.current || !info || !interactive)
|
|
45
|
-
return undefined;
|
|
46
|
-
return capture(canvas.current, info, send);
|
|
47
|
-
}, [info, interactive, send]);
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
reported.current = onStatus;
|
|
50
|
-
});
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
reported.current?.(status);
|
|
53
|
-
}, [status]);
|
|
54
|
-
return (_jsxs("div", { ...part("live", [status, interactive && "input"], className), children: [_jsx("canvas", { ref: canvas, role: "img", "aria-label": label ?? messages.liveView, tabIndex: interactive ? 0 : undefined, width: info?.width, height: info?.height, style: info ? undefined : { aspectRatio: shape }, ...part("live__canvas") }), _jsxs("p", { role: "status", ...part("live__status"), children: [_jsx("span", { "aria-hidden": true, ...part("live__dot") }), messages.liveStatus[status]] })] }));
|
|
55
|
-
}
|
package/dist/live/capture.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A person's pointer, wheel and keys on a canvas, as the input a stream takes (`LiveInput`).
|
|
3
|
-
* Coordinates are the stream's pixels: the canvas is shown at whatever size the page gives it.
|
|
4
|
-
*/
|
|
5
|
-
import type { LiveInput } from "@signalcore/sdk";
|
|
6
|
-
export interface Size {
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
10
|
-
type Send = (input: LiveInput) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Starts sending what the person does on `canvas` to `send`; the returned function stops it.
|
|
13
|
-
*
|
|
14
|
-
* The pointer goes as `down`, `move` and `up` (so drags and double clicks work as they do on the
|
|
15
|
-
* page), the wheel as `wheel` (the page behind the canvas does not scroll), and keys as `down` and
|
|
16
|
-
* `up` while the canvas has the focus. Tab is left alone so that the focus can leave, and a key
|
|
17
|
-
* still held when the focus goes is let go. The context menu is the page's, not ours.
|
|
18
|
-
*/
|
|
19
|
-
export declare function capture(canvas: HTMLCanvasElement, size: Size, send: Send): () => void;
|
|
20
|
-
export {};
|
package/dist/live/capture.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A person's pointer, wheel and keys on a canvas, as the input a stream takes (`LiveInput`).
|
|
3
|
-
* Coordinates are the stream's pixels: the canvas is shown at whatever size the page gives it.
|
|
4
|
-
*/
|
|
5
|
-
const BUTTONS = { 0: "left", 1: "middle", 2: "right" };
|
|
6
|
-
const MOVE_EVERY_MS = 40; // a move is a hint of where the pointer is: 25 a second is plenty
|
|
7
|
-
const LINE_PX = 16; // what a wheel that scrolls by lines means in pixels
|
|
8
|
-
const MAX_DELTA = 10_000; // what the stream takes
|
|
9
|
-
/** Where `event` is on the stream: scaled from the canvas as shown, and kept inside it. */
|
|
10
|
-
function pointOf(event, canvas, size) {
|
|
11
|
-
const box = canvas.getBoundingClientRect();
|
|
12
|
-
const along = (at, from, shown, real) => shown > 0 ? Math.round(Math.min(Math.max((at - from) / shown, 0), 1) * real) : 0;
|
|
13
|
-
return {
|
|
14
|
-
x: along(event.clientX, box.left, box.width, size.width),
|
|
15
|
-
y: along(event.clientY, box.top, box.height, size.height),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const clamp = (value, limit) => Math.min(Math.max(value, -limit), limit);
|
|
19
|
-
/**
|
|
20
|
-
* Starts sending what the person does on `canvas` to `send`; the returned function stops it.
|
|
21
|
-
*
|
|
22
|
-
* The pointer goes as `down`, `move` and `up` (so drags and double clicks work as they do on the
|
|
23
|
-
* page), the wheel as `wheel` (the page behind the canvas does not scroll), and keys as `down` and
|
|
24
|
-
* `up` while the canvas has the focus. Tab is left alone so that the focus can leave, and a key
|
|
25
|
-
* still held when the focus goes is let go. The context menu is the page's, not ours.
|
|
26
|
-
*/
|
|
27
|
-
export function capture(canvas, size, send) {
|
|
28
|
-
const held = new Set();
|
|
29
|
-
let lastMove = Number.NEGATIVE_INFINITY;
|
|
30
|
-
let clicks = 1; // of the press the button is coming up from
|
|
31
|
-
const release = (event) => {
|
|
32
|
-
const button = BUTTONS[event.button];
|
|
33
|
-
if (button)
|
|
34
|
-
send({ type: "mouse", action: "up", ...pointOf(event, canvas, size), button, clicks });
|
|
35
|
-
};
|
|
36
|
-
const press = (event) => {
|
|
37
|
-
const button = BUTTONS[event.button];
|
|
38
|
-
if (!button)
|
|
39
|
-
return;
|
|
40
|
-
event.preventDefault(); // the page would select the canvas and keep the focus where it was
|
|
41
|
-
clicks = Math.min(Math.max(event.detail, 1), 3);
|
|
42
|
-
send({ type: "mouse", action: "down", ...pointOf(event, canvas, size), button, clicks });
|
|
43
|
-
canvas.focus({ preventScroll: true }); // a click does not move the page under the pointer
|
|
44
|
-
// The button may come up outside the canvas, in the middle of a drag.
|
|
45
|
-
window.addEventListener("mouseup", release, { once: true });
|
|
46
|
-
};
|
|
47
|
-
const move = (event) => {
|
|
48
|
-
if (event.timeStamp - lastMove < MOVE_EVERY_MS)
|
|
49
|
-
return;
|
|
50
|
-
lastMove = event.timeStamp;
|
|
51
|
-
send({ type: "mouse", action: "move", ...pointOf(event, canvas, size) });
|
|
52
|
-
};
|
|
53
|
-
const wheel = (event) => {
|
|
54
|
-
event.preventDefault();
|
|
55
|
-
const unit = event.deltaMode === 1 ? LINE_PX : event.deltaMode === 2 ? size.height : 1;
|
|
56
|
-
send({
|
|
57
|
-
type: "wheel",
|
|
58
|
-
...pointOf(event, canvas, size),
|
|
59
|
-
deltaX: clamp(event.deltaX * unit, MAX_DELTA),
|
|
60
|
-
deltaY: clamp(event.deltaY * unit, MAX_DELTA),
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const keyed = (action) => (event) => {
|
|
64
|
-
if (event.key === "Tab" || event.isComposing)
|
|
65
|
-
return;
|
|
66
|
-
event.preventDefault();
|
|
67
|
-
if (action === "down")
|
|
68
|
-
held.add(event.key);
|
|
69
|
-
else
|
|
70
|
-
held.delete(event.key);
|
|
71
|
-
send({ type: "key", action, key: event.key });
|
|
72
|
-
};
|
|
73
|
-
const letGo = () => {
|
|
74
|
-
for (const key of held)
|
|
75
|
-
send({ type: "key", action: "up", key });
|
|
76
|
-
held.clear();
|
|
77
|
-
};
|
|
78
|
-
const keyDown = keyed("down");
|
|
79
|
-
const keyUp = keyed("up");
|
|
80
|
-
const noMenu = (event) => {
|
|
81
|
-
event.preventDefault();
|
|
82
|
-
};
|
|
83
|
-
canvas.addEventListener("mousedown", press);
|
|
84
|
-
canvas.addEventListener("mousemove", move);
|
|
85
|
-
canvas.addEventListener("wheel", wheel, { passive: false });
|
|
86
|
-
canvas.addEventListener("contextmenu", noMenu);
|
|
87
|
-
canvas.addEventListener("keydown", keyDown);
|
|
88
|
-
canvas.addEventListener("keyup", keyUp);
|
|
89
|
-
canvas.addEventListener("blur", letGo);
|
|
90
|
-
return () => {
|
|
91
|
-
canvas.removeEventListener("mousedown", press);
|
|
92
|
-
canvas.removeEventListener("mousemove", move);
|
|
93
|
-
canvas.removeEventListener("wheel", wheel);
|
|
94
|
-
canvas.removeEventListener("contextmenu", noMenu);
|
|
95
|
-
canvas.removeEventListener("keydown", keyDown);
|
|
96
|
-
canvas.removeEventListener("keyup", keyUp);
|
|
97
|
-
canvas.removeEventListener("blur", letGo);
|
|
98
|
-
window.removeEventListener("mouseup", release);
|
|
99
|
-
};
|
|
100
|
-
}
|
package/dist/live/follow.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type LiveFrame, type LiveInfo } from "@signalcore/sdk";
|
|
2
|
-
import type { UiClient, WatchedStream } from "../client.js";
|
|
3
|
-
/**
|
|
4
|
-
* Where a followed stream stands. `unavailable`: it cannot be watched from here (refused, not
|
|
5
|
-
* there, or a connection that never worked), which is when something else should show the page.
|
|
6
|
-
*/
|
|
7
|
-
export type LiveStatus = "connecting" | "live" | "reconnecting" | "ended" | "unavailable";
|
|
8
|
-
/** Who is told what the followed stream does. */
|
|
9
|
-
export interface Watcher {
|
|
10
|
-
status: (status: LiveStatus) => void;
|
|
11
|
-
info: (info: LiveInfo) => void;
|
|
12
|
-
frame: (frame: LiveFrame) => void;
|
|
13
|
-
/** The connection input goes to; undefined between connections. */
|
|
14
|
-
stream: (stream: WatchedStream | undefined) => void;
|
|
15
|
-
}
|
|
16
|
-
type Connector = NonNullable<UiClient["live"]>;
|
|
17
|
-
/**
|
|
18
|
-
* The whole life of watching a stream: connect, show what comes, and connect again when the
|
|
19
|
-
* connection drops, waiting a little longer each time that no picture came in between. It ends
|
|
20
|
-
* when the stream does, when the server refuses (`SignalcoreError`: not signed in, not allowed,
|
|
21
|
-
* no such stream), or when `signal` stops it. A stream that has answered once exists, so its
|
|
22
|
-
* drops are retried for as long as it takes; one that never answered is given up on after
|
|
23
|
-
* `GIVE_UP_AFTER` tries.
|
|
24
|
-
*/
|
|
25
|
-
export declare function follow(live: Connector, streamId: string, signal: AbortSignal, watcher: Watcher): Promise<void>;
|
|
26
|
-
export {};
|
package/dist/live/follow.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { SignalcoreError } from "@signalcore/sdk";
|
|
2
|
-
/** Connections in a row that never got as far as the stream's first frame, before giving up. */
|
|
3
|
-
const GIVE_UP_AFTER = 3;
|
|
4
|
-
const FIRST_DELAY_MS = 500;
|
|
5
|
-
const LONGEST_DELAY_MS = 10_000;
|
|
6
|
-
/**
|
|
7
|
-
* The whole life of watching a stream: connect, show what comes, and connect again when the
|
|
8
|
-
* connection drops, waiting a little longer each time that no picture came in between. It ends
|
|
9
|
-
* when the stream does, when the server refuses (`SignalcoreError`: not signed in, not allowed,
|
|
10
|
-
* no such stream), or when `signal` stops it. A stream that has answered once exists, so its
|
|
11
|
-
* drops are retried for as long as it takes; one that never answered is given up on after
|
|
12
|
-
* `GIVE_UP_AFTER` tries.
|
|
13
|
-
*/
|
|
14
|
-
export async function follow(live, streamId, signal, watcher) {
|
|
15
|
-
let drops = 0; // connections lost since a picture last came: they pace the next try
|
|
16
|
-
let answered = false;
|
|
17
|
-
const stopped = () => signal.aborted; // read each time: it changes while we wait
|
|
18
|
-
watcher.status("connecting");
|
|
19
|
-
while (!stopped()) {
|
|
20
|
-
let stream;
|
|
21
|
-
const hangUp = () => {
|
|
22
|
-
stream?.close();
|
|
23
|
-
};
|
|
24
|
-
signal.addEventListener("abort", hangUp, { once: true });
|
|
25
|
-
try {
|
|
26
|
-
stream = live.connect(streamId, { signal });
|
|
27
|
-
watcher.stream(stream);
|
|
28
|
-
watcher.info(await stream.info);
|
|
29
|
-
answered = true;
|
|
30
|
-
watcher.status("live");
|
|
31
|
-
for await (const frame of stream) {
|
|
32
|
-
drops = 0;
|
|
33
|
-
watcher.frame(frame);
|
|
34
|
-
}
|
|
35
|
-
if (!stopped())
|
|
36
|
-
watcher.status("ended");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (stopped())
|
|
41
|
-
return;
|
|
42
|
-
if (error instanceof SignalcoreError) {
|
|
43
|
-
watcher.status("unavailable");
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
finally {
|
|
48
|
-
signal.removeEventListener("abort", hangUp);
|
|
49
|
-
watcher.stream(undefined);
|
|
50
|
-
stream?.close();
|
|
51
|
-
}
|
|
52
|
-
drops += 1;
|
|
53
|
-
if (!answered && drops >= GIVE_UP_AFTER) {
|
|
54
|
-
watcher.status("unavailable");
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
watcher.status("reconnecting");
|
|
58
|
-
await pause(Math.min(LONGEST_DELAY_MS, FIRST_DELAY_MS * 2 ** (drops - 1)), signal);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/** Waits `ms`, or less when `signal` stops it. */
|
|
62
|
-
function pause(ms, signal) {
|
|
63
|
-
return new Promise((resolve) => {
|
|
64
|
-
const done = () => {
|
|
65
|
-
clearTimeout(timer);
|
|
66
|
-
signal.removeEventListener("abort", done);
|
|
67
|
-
resolve();
|
|
68
|
-
};
|
|
69
|
-
const timer = setTimeout(done, ms);
|
|
70
|
-
signal.addEventListener("abort", done, { once: true });
|
|
71
|
-
});
|
|
72
|
-
}
|
package/dist/live/paint.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Drawing a stream's JPEGs on a canvas. */
|
|
2
|
-
export interface Painter {
|
|
3
|
-
/** Draw this JPEG, unless a newer one comes while it is still being decoded. */
|
|
4
|
-
paint: (jpeg: Uint8Array) => void;
|
|
5
|
-
/** Stop drawing: what is being decoded is let go of. */
|
|
6
|
-
dispose: () => void;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Draws pictures on `canvas`, stretched to its size, one at a time: a picture that arrives while
|
|
10
|
-
* another is being decoded waits, and a newer one replaces it, so a slow device skips to the
|
|
11
|
-
* present instead of falling behind. A picture that does not decode is skipped.
|
|
12
|
-
*/
|
|
13
|
-
export declare function painterOn(canvas: HTMLCanvasElement): Painter;
|
package/dist/live/paint.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/** Drawing a stream's JPEGs on a canvas. */
|
|
2
|
-
/** The picture in a JPEG, decoded off the main thread where the browser can (`createImageBitmap`). */
|
|
3
|
-
async function decode(bytes) {
|
|
4
|
-
const blob = new Blob([bytes.slice()], { type: "image/jpeg" }); // a copy over a plain ArrayBuffer, which Blob takes
|
|
5
|
-
if (typeof createImageBitmap === "function") {
|
|
6
|
-
const bitmap = await createImageBitmap(blob);
|
|
7
|
-
return {
|
|
8
|
-
source: bitmap,
|
|
9
|
-
release: () => {
|
|
10
|
-
bitmap.close();
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
return await decodeInImage(blob);
|
|
15
|
-
}
|
|
16
|
-
/** For a browser without `createImageBitmap`: an `<img>` over an object URL. */
|
|
17
|
-
function decodeInImage(blob) {
|
|
18
|
-
const url = URL.createObjectURL(blob);
|
|
19
|
-
const release = () => {
|
|
20
|
-
URL.revokeObjectURL(url);
|
|
21
|
-
};
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
const image = new Image();
|
|
24
|
-
image.onload = () => {
|
|
25
|
-
resolve({ source: image, release });
|
|
26
|
-
};
|
|
27
|
-
image.onerror = () => {
|
|
28
|
-
release();
|
|
29
|
-
reject(new Error("The picture could not be decoded"));
|
|
30
|
-
};
|
|
31
|
-
image.src = url;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Draws pictures on `canvas`, stretched to its size, one at a time: a picture that arrives while
|
|
36
|
-
* another is being decoded waits, and a newer one replaces it, so a slow device skips to the
|
|
37
|
-
* present instead of falling behind. A picture that does not decode is skipped.
|
|
38
|
-
*/
|
|
39
|
-
export function painterOn(canvas) {
|
|
40
|
-
let decoding = false;
|
|
41
|
-
let waiting;
|
|
42
|
-
let disposed = false;
|
|
43
|
-
const run = async (jpeg) => {
|
|
44
|
-
decoding = true;
|
|
45
|
-
try {
|
|
46
|
-
const picture = await decode(jpeg);
|
|
47
|
-
try {
|
|
48
|
-
if (!disposed) {
|
|
49
|
-
canvas.getContext("2d")?.drawImage(picture.source, 0, 0, canvas.width, canvas.height);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
picture.release();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// Damaged or cut off: the next picture replaces it.
|
|
58
|
-
}
|
|
59
|
-
decoding = false;
|
|
60
|
-
const next = waiting;
|
|
61
|
-
waiting = undefined;
|
|
62
|
-
if (next && !disposed)
|
|
63
|
-
await run(next);
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
paint: (jpeg) => {
|
|
67
|
-
if (decoding)
|
|
68
|
-
waiting = jpeg;
|
|
69
|
-
else
|
|
70
|
-
void run(jpeg);
|
|
71
|
-
},
|
|
72
|
-
dispose: () => {
|
|
73
|
-
disposed = true;
|
|
74
|
-
waiting = undefined;
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { LiveFrame, LiveInfo, LiveInput } from "@signalcore/sdk";
|
|
2
|
-
import { type LiveStatus } from "./follow.js";
|
|
3
|
-
export interface LiveConnection {
|
|
4
|
-
status: LiveStatus;
|
|
5
|
-
/** What the stream said it is (its size, whether it takes input); nothing until it has. */
|
|
6
|
-
info: LiveInfo | undefined;
|
|
7
|
-
/** Act on the stream; nothing happens between connections. */
|
|
8
|
-
send: (input: LiveInput) => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Watches a stream through the provider's client (`live.connect`), handing each picture to
|
|
12
|
-
* `onFrame`, and connects again when the connection drops (see `follow`). Without a client that
|
|
13
|
-
* can, or without a stream, it is `unavailable`. Stops when the component goes away or
|
|
14
|
-
* `streamId` changes.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useLiveStream(streamId: string, onFrame: (frame: LiveFrame) => void): LiveConnection;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
import { useSignalcore } from "../SignalcoreProvider.js";
|
|
3
|
-
import { follow } from "./follow.js";
|
|
4
|
-
const begin = (streamId) => ({ streamId, status: "connecting", info: undefined });
|
|
5
|
-
/**
|
|
6
|
-
* Watches a stream through the provider's client (`live.connect`), handing each picture to
|
|
7
|
-
* `onFrame`, and connects again when the connection drops (see `follow`). Without a client that
|
|
8
|
-
* can, or without a stream, it is `unavailable`. Stops when the component goes away or
|
|
9
|
-
* `streamId` changes.
|
|
10
|
-
*/
|
|
11
|
-
export function useLiveStream(streamId, onFrame) {
|
|
12
|
-
const connector = useSignalcore().client?.live;
|
|
13
|
-
const [state, setState] = useState(() => begin(streamId));
|
|
14
|
-
const connection = useRef(undefined);
|
|
15
|
-
const frames = useRef(onFrame);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
frames.current = onFrame;
|
|
18
|
-
});
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!connector || streamId === "")
|
|
21
|
-
return undefined;
|
|
22
|
-
const stop = new AbortController();
|
|
23
|
-
const patch = (change) => {
|
|
24
|
-
if (stop.signal.aborted)
|
|
25
|
-
return;
|
|
26
|
-
setState((old) => ({ ...(old.streamId === streamId ? old : begin(streamId)), ...change }));
|
|
27
|
-
};
|
|
28
|
-
void follow(connector, streamId, stop.signal, {
|
|
29
|
-
status: (status) => {
|
|
30
|
-
patch({ status });
|
|
31
|
-
},
|
|
32
|
-
info: (info) => {
|
|
33
|
-
patch({ info });
|
|
34
|
-
},
|
|
35
|
-
frame: (frame) => {
|
|
36
|
-
if (!stop.signal.aborted)
|
|
37
|
-
frames.current(frame);
|
|
38
|
-
},
|
|
39
|
-
stream: (stream) => {
|
|
40
|
-
// A follower that was stopped may still be letting go of its stream: not the new one's.
|
|
41
|
-
if (!stop.signal.aborted)
|
|
42
|
-
connection.current = stream;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
return () => {
|
|
46
|
-
stop.abort();
|
|
47
|
-
connection.current = undefined;
|
|
48
|
-
};
|
|
49
|
-
}, [connector, streamId]);
|
|
50
|
-
const send = useCallback((input) => {
|
|
51
|
-
connection.current?.send(input);
|
|
52
|
-
}, []);
|
|
53
|
-
// Until the effect has started over for a new stream, the state is still the old one's.
|
|
54
|
-
const current = state.streamId === streamId ? state : begin(streamId);
|
|
55
|
-
const usable = connector !== undefined && streamId !== "";
|
|
56
|
-
return { status: usable ? current.status : "unavailable", info: current.info, send };
|
|
57
|
-
}
|
package/dist/look.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Every element the package draws is a named slot. It carries the class `sc-<slot>` (BEM: a
|
|
3
|
-
* block, `card`, or one of its elements, `card__title`), the attribute `data-sc="<slot>"`, and
|
|
4
|
-
* `data-sc-mod="primary sm"` for its modifiers, which are also classes (`sc-button--primary`).
|
|
5
|
-
* They are the stable hooks for a host's CSS, and the names `classNames` is keyed by. The same names
|
|
6
|
-
* are the element's `part`s (`message message--person`), so a chat inside a shadow root, as the
|
|
7
|
-
* widget is, is styled from outside with `::part(message)`.
|
|
8
|
-
*/
|
|
9
|
-
export declare const SLOTS: readonly ["ui", "surface", "column", "row", "card", "card__title", "card__subtitle", "text", "callout", "image", "link", "pairs", "pairs__row", "pairs__label", "pairs__value", "table-wrap", "table", "table__row", "table__head", "table__cell", "chart", "chart__title", "chart__row", "chart__label", "chart__bar", "chart__value", "choices", "choice", "choice__label", "choice__description", "slots", "form", "form__actions", "field", "input", "select", "checkbox", "button", "icon-button", "icon", "spinner", "sr-only", "error", "browser", "browser__header", "browser__driver", "browser__dot", "browser__who", "browser__controls", "browser__site", "browser__site-name", "browser__screen", "browser__frame", "browser__shot", "browser__cover", "browser__caption", "browser__step", "browser__line", "browser__ended", "browser__ended-title", "browser__ended-summary", "live", "live__canvas", "live__status", "live__dot", "request", "request__heading", "request__icon", "request__body", "request__title", "request__details", "request__done", "request__check", "request__actions", "request__form", "request__hint", "request__name", "approval", "calls", "calls__item", "calls__label", "calls__summary", "preview-pairs", "preview-pairs__row", "preview-pairs__label", "preview-pairs__value", "preview-table", "preview-table__table", "preview-table__head", "preview-table__cell", "preview-table__more", "preview-json", "handover", "handover__side", "steps", "steps__item", "steps__number", "steps__text", "drop", "drop__icon", "app-button", "app-button__logo", "app-button__ping", "app-logo", "chat", "chat__scroll", "chat__content", "chat__note", "chat__status", "messages", "moment", "message", "message__text", "message__surface", "message__window", "message__open", "composer", "composer__context", "composer__box", "composer__input", "composer__bar", "composer__tools", "composer__send", "transcript", "reply", "reply__cursor", "activity", "activity__step", "activity__toggle", "activity__mark", "activity__verb", "activity__target", "activity__note", "activity__summary", "note", "changes", "changes__title", "changes__list", "changes__item", "changes__label", "changes__more", "status-line", "status-line__dot", "status-line__hint", "status", "status__dot", "automations", "automations__group", "automations__title", "automations__list", "automations__item", "automations__empty", "automation", "automation__wash", "automation__head", "automation__tile", "automation__glyph", "automation__text", "automation__line", "automation__title", "automation__status", "automation__tagline", "automation__meta", "automation__chevron", "automation__body", "automation__description", "automation__facts", "automation__fact", "automation__label", "automation__value", "automation__activity", "automation__tips", "automation__actions", "schedule", "schedule__days", "schedule__day", "schedule__time", "app-marks", "app-marks__item", "flow", "flow__empty", "flow__node", "flow__handle", "flow__mark", "flow__glyph", "flow__text", "flow__name", "flow__detail", "flow__trigger", "orb", "orb__ring", "orb__core", "voice", "voice__stage", "voice__state", "voice__captions", "voice__line", "voice__who", "voice__note", "voice__controls", "window", "window__bar", "window__mark", "window__title", "window__body", "window__twin", "captions", "captions__line", "space", "space__main", "space__stage", "strip", "strip__tab", "strip__mark", "strip__title", "strip__dot", "dock", "dock__status", "dock__voice"];
|
|
10
|
-
export type Slot = (typeof SLOTS)[number];
|
|
11
|
-
/**
|
|
12
|
-
* Classes a host adds to the package's elements, by slot (`card`, `card__title`) or by slot and
|
|
13
|
-
* modifier (`button--primary`). They are added to ours, so they work with the shipped stylesheet
|
|
14
|
-
* (they come later in the cascade) and, with the provider's `unstyled`, instead of it.
|
|
15
|
-
*/
|
|
16
|
-
export type ClassNames = {
|
|
17
|
-
[S in Slot]?: string;
|
|
18
|
-
} & {
|
|
19
|
-
[variant: `${Slot}--${string}`]: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
type Modifier = string | false | null | undefined;
|
|
22
|
-
/** What to spread onto an element to make it the slot. */
|
|
23
|
-
export interface PartProps {
|
|
24
|
-
className: string;
|
|
25
|
-
"data-sc": Slot;
|
|
26
|
-
"data-sc-mod": string | undefined;
|
|
27
|
-
/** The shadow part: the slot, and the slot with each modifier. Inert outside a shadow root. */
|
|
28
|
-
part: string;
|
|
29
|
-
}
|
|
30
|
-
/** The props of a slot, with the modifiers that apply and any class the caller adds. */
|
|
31
|
-
export type Part = (slot: Slot, modifiers?: Modifier[], extra?: string) => PartProps;
|
|
32
|
-
export declare function partsOf(classNames: ClassNames | undefined): Part;
|
|
33
|
-
export {};
|