@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
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ComponentData } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A node of the host's own: its component, registered under the node's name, drawn with the
|
|
4
|
-
* node's `props` exactly as given (the API validated them against the schema the host
|
|
5
|
-
* registered, and a binding is not looked up in them) and `onAction`, which reports what the
|
|
6
|
-
* user does through the surface's action path. It has no children, and the node cannot
|
|
7
|
-
* override `onAction` with a prop of its own.
|
|
8
|
-
*
|
|
9
|
-
* The surface was checked before it was drawn, so the name is registered; if it ever is not,
|
|
10
|
-
* this throws and the surface's boundary shows its text twin, never an empty box.
|
|
11
|
-
*/
|
|
12
|
-
export declare function HostNode({ node }: {
|
|
13
|
-
node: ComponentData;
|
|
14
|
-
}): import("react").JSX.Element;
|
package/dist/surface/HostNode.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useSignalcore } from "../SignalcoreProvider.js";
|
|
3
|
-
import { isRecord } from "./check.js";
|
|
4
|
-
import { hostComponent } from "./hosts.js";
|
|
5
|
-
import { useScene } from "./scene.js";
|
|
6
|
-
/**
|
|
7
|
-
* A node of the host's own: its component, registered under the node's name, drawn with the
|
|
8
|
-
* node's `props` exactly as given (the API validated them against the schema the host
|
|
9
|
-
* registered, and a binding is not looked up in them) and `onAction`, which reports what the
|
|
10
|
-
* user does through the surface's action path. It has no children, and the node cannot
|
|
11
|
-
* override `onAction` with a prop of its own.
|
|
12
|
-
*
|
|
13
|
-
* The surface was checked before it was drawn, so the name is registered; if it ever is not,
|
|
14
|
-
* this throws and the surface's boundary shows its text twin, never an empty box.
|
|
15
|
-
*/
|
|
16
|
-
export function HostNode({ node }) {
|
|
17
|
-
const { components } = useSignalcore();
|
|
18
|
-
const { act } = useScene();
|
|
19
|
-
const Host = hostComponent(components, node.component);
|
|
20
|
-
if (!Host)
|
|
21
|
-
throw new Error(`${node.component} is not a host component this page has registered`);
|
|
22
|
-
const props = {
|
|
23
|
-
...(isRecord(node["props"]) ? node["props"] : {}),
|
|
24
|
-
children: undefined,
|
|
25
|
-
onAction: act,
|
|
26
|
-
};
|
|
27
|
-
// The component comes from the provider's `components`, by the name the node carries.
|
|
28
|
-
// eslint-disable-next-line react-hooks/static-components
|
|
29
|
-
return _jsx(Host, { ...props });
|
|
30
|
-
}
|
package/dist/surface/Node.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One component of the surface: the host's own (a `host` node, see `HostNode`), or a catalog
|
|
3
|
-
* component drawn by the host's component of that name, else by ours.
|
|
4
|
-
*/
|
|
5
|
-
export declare function Node({ id }: {
|
|
6
|
-
id: string;
|
|
7
|
-
}): import("react").JSX.Element | null;
|
package/dist/surface/Node.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PRIMITIVE_ONLY } from "../primitives.js";
|
|
3
|
-
import { useSignalcore } from "../SignalcoreProvider.js";
|
|
4
|
-
import { bound, readerOf } from "./bindings.js";
|
|
5
|
-
import { isHostNode } from "./check.js";
|
|
6
|
-
import { HostNode } from "./HostNode.js";
|
|
7
|
-
import { useScene } from "./scene.js";
|
|
8
|
-
import { TEMPLATES } from "./templates/index.js";
|
|
9
|
-
/**
|
|
10
|
-
* One component of the surface: the host's own (a `host` node, see `HostNode`), or a catalog
|
|
11
|
-
* component drawn by the host's component of that name, else by ours.
|
|
12
|
-
*/
|
|
13
|
-
export function Node({ id }) {
|
|
14
|
-
const node = useScene().byId.get(id);
|
|
15
|
-
if (!node)
|
|
16
|
-
return null;
|
|
17
|
-
return isHostNode(node) ? _jsx(HostNode, { node: node }) : _jsx(Catalog, { node: node });
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A catalog component, drawn by the host's component of that name, else by ours. The
|
|
21
|
-
* primitives (`Button`, `Table`…) are not catalog names: a host registering one changes what the
|
|
22
|
-
* catalog is drawn with, never what a surface may name.
|
|
23
|
-
*/
|
|
24
|
-
function Catalog({ node }) {
|
|
25
|
-
const scene = useScene();
|
|
26
|
-
const { components } = useSignalcore();
|
|
27
|
-
const read = readerOf(node, scene.data);
|
|
28
|
-
const ids = read.list("children");
|
|
29
|
-
const children = ids.length > 0 ? ids.map((child) => _jsx(Node, { id: child }, child)) : null;
|
|
30
|
-
if (Object.hasOwn(components, node.component) && !PRIMITIVE_ONLY.has(node.component)) {
|
|
31
|
-
const Host = components[node.component];
|
|
32
|
-
return _jsx(Host, { ...hostProps(node, scene, children) });
|
|
33
|
-
}
|
|
34
|
-
const Template = TEMPLATES.get(node.component);
|
|
35
|
-
// The templates are components of this module, picked from a fixed map: none is made here.
|
|
36
|
-
// eslint-disable-next-line react-hooks/static-components
|
|
37
|
-
return Template ? _jsx(Template, { read: read, children: children }) : null;
|
|
38
|
-
}
|
|
39
|
-
/** The agent's properties, bindings resolved; ours (`children`, `onAction`) cannot be overridden. */
|
|
40
|
-
function hostProps(node, scene, children) {
|
|
41
|
-
const props = {};
|
|
42
|
-
for (const [name, value] of Object.entries(node)) {
|
|
43
|
-
if (name !== "id" && name !== "component")
|
|
44
|
-
props[name] = bound(value, scene.data);
|
|
45
|
-
}
|
|
46
|
-
props.children = children ?? undefined;
|
|
47
|
-
props.onAction = scene.act;
|
|
48
|
-
return props;
|
|
49
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component, type ReactNode } from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
/** What to show instead when something below throws. */
|
|
4
|
-
fallback: ReactNode;
|
|
5
|
-
/** A new value tries the children again; the same one keeps the fallback. */
|
|
6
|
-
resetKey: unknown;
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A surface comes from a model: whatever is wrong with it, it must never take the page down. If
|
|
11
|
-
* anything below throws while drawing, the surface shows its text twin and the rest of the page
|
|
12
|
-
* carries on.
|
|
13
|
-
*/
|
|
14
|
-
export declare class SurfaceBoundary extends Component<Props, {
|
|
15
|
-
failed: boolean;
|
|
16
|
-
}> {
|
|
17
|
-
state: {
|
|
18
|
-
failed: boolean;
|
|
19
|
-
};
|
|
20
|
-
static getDerivedStateFromError(): {
|
|
21
|
-
failed: boolean;
|
|
22
|
-
};
|
|
23
|
-
componentDidUpdate(previous: Props): void;
|
|
24
|
-
render(): ReactNode;
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Component } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A surface comes from a model: whatever is wrong with it, it must never take the page down. If
|
|
4
|
-
* anything below throws while drawing, the surface shows its text twin and the rest of the page
|
|
5
|
-
* carries on.
|
|
6
|
-
*/
|
|
7
|
-
export class SurfaceBoundary extends Component {
|
|
8
|
-
state = { failed: false };
|
|
9
|
-
static getDerivedStateFromError() {
|
|
10
|
-
return { failed: true };
|
|
11
|
-
}
|
|
12
|
-
componentDidUpdate(previous) {
|
|
13
|
-
if (this.state.failed && previous.resetKey !== this.props.resetKey) {
|
|
14
|
-
this.setState({ failed: false });
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
return this.state.failed ? this.props.fallback : this.props.children;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ComponentData } from "./types.js";
|
|
2
|
-
type Data = Record<string, unknown>;
|
|
3
|
-
/** A property's value: the literal, or what its binding points at in the surface's data. */
|
|
4
|
-
export declare function bound(value: unknown, data: Data): unknown;
|
|
5
|
-
/** What a component reads of its own properties; a wrong kind of value reads as missing. */
|
|
6
|
-
export interface Reader {
|
|
7
|
-
text: (prop: string) => string | undefined;
|
|
8
|
-
count: (prop: string) => number | undefined;
|
|
9
|
-
/** Whether the property is `true`; anything else, or nothing, is false. */
|
|
10
|
-
flag: (prop: string) => boolean;
|
|
11
|
-
list: <Item = unknown>(prop: string) => Item[];
|
|
12
|
-
}
|
|
13
|
-
export declare function readerOf(node: ComponentData, data: Data): Reader;
|
|
14
|
-
export {};
|
package/dist/surface/bindings.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/** A property's value: the literal, or what its binding points at in the surface's data. */
|
|
2
|
-
export function bound(value, data) {
|
|
3
|
-
if (value && typeof value === "object" && "path" in value && typeof value.path === "string") {
|
|
4
|
-
return pointer(data, value.path);
|
|
5
|
-
}
|
|
6
|
-
return value;
|
|
7
|
-
}
|
|
8
|
-
/** The value at a JSON Pointer (RFC 6901); nothing when the data has no such place. */
|
|
9
|
-
function pointer(data, path) {
|
|
10
|
-
let current = data;
|
|
11
|
-
for (const raw of path.split("/").slice(1)) {
|
|
12
|
-
const key = raw.replaceAll("~1", "/").replaceAll("~0", "~");
|
|
13
|
-
if (current && typeof current === "object")
|
|
14
|
-
current = current[key];
|
|
15
|
-
else
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
return current;
|
|
19
|
-
}
|
|
20
|
-
export function readerOf(node, data) {
|
|
21
|
-
const value = (prop) => bound(node[prop], data);
|
|
22
|
-
return {
|
|
23
|
-
text: (prop) => {
|
|
24
|
-
const found = value(prop);
|
|
25
|
-
return typeof found === "string" ? found : undefined;
|
|
26
|
-
},
|
|
27
|
-
count: (prop) => {
|
|
28
|
-
const found = value(prop);
|
|
29
|
-
return typeof found === "number" ? found : undefined;
|
|
30
|
-
},
|
|
31
|
-
flag: (prop) => value(prop) === true,
|
|
32
|
-
list: (prop) => {
|
|
33
|
-
const found = value(prop);
|
|
34
|
-
return Array.isArray(found) ? found : [];
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
package/dist/surface/check.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { SurfaceData } from "./types.js";
|
|
2
|
-
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
3
|
-
/**
|
|
4
|
-
* A node the host draws with a component of its own: `{ id, type: "host", component, props }`.
|
|
5
|
-
* The API validated its props against the schema the host registered for the name.
|
|
6
|
-
*/
|
|
7
|
-
export declare const isHostNode: (node: Record<string, unknown>) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Why a surface cannot be drawn, or null when it can. The API checks every surface before it
|
|
10
|
-
* sends it, so this is for what the API did not promise: a payload that arrived damaged, a
|
|
11
|
-
* newer catalog than this renderer knows (a component it has no way to draw), or a host
|
|
12
|
-
* component this page has not registered (`hosts`). A surface that cannot be drawn whole is not
|
|
13
|
-
* drawn in part: it shows its text twin.
|
|
14
|
-
*/
|
|
15
|
-
export declare function problemWith(surface: unknown, known: ReadonlySet<string>, hosts: ReadonlySet<string>): string | null;
|
|
16
|
-
/**
|
|
17
|
-
* The host components a surface names that the page has not registered, for the developer: the
|
|
18
|
-
* surface shows its text twin until they are. Reads any payload, damaged or not.
|
|
19
|
-
*/
|
|
20
|
-
export declare function unregisteredHosts(surface: unknown, hosts: ReadonlySet<string>): string[];
|
|
21
|
-
/**
|
|
22
|
-
* A surface from a payload of unknown shape, if it has the shape of one (a journal event carries
|
|
23
|
-
* it as loose JSON). `Surface` checks the rest when it draws.
|
|
24
|
-
*/
|
|
25
|
-
export declare function surfaceOf(value: unknown): SurfaceData | undefined;
|
|
26
|
-
/** What a surface says when it cannot be drawn: its text twin, if it came with one, else `none`. */
|
|
27
|
-
export declare function twinOf(surface: unknown, none: string): string;
|
package/dist/surface/check.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
export const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2
|
-
/**
|
|
3
|
-
* A node the host draws with a component of its own: `{ id, type: "host", component, props }`.
|
|
4
|
-
* The API validated its props against the schema the host registered for the name.
|
|
5
|
-
*/
|
|
6
|
-
export const isHostNode = (node) => node["type"] === "host";
|
|
7
|
-
/**
|
|
8
|
-
* Why a surface cannot be drawn, or null when it can. The API checks every surface before it
|
|
9
|
-
* sends it, so this is for what the API did not promise: a payload that arrived damaged, a
|
|
10
|
-
* newer catalog than this renderer knows (a component it has no way to draw), or a host
|
|
11
|
-
* component this page has not registered (`hosts`). A surface that cannot be drawn whole is not
|
|
12
|
-
* drawn in part: it shows its text twin.
|
|
13
|
-
*/
|
|
14
|
-
export function problemWith(surface, known, hosts) {
|
|
15
|
-
if (!isRecord(surface))
|
|
16
|
-
return "the surface is not an object";
|
|
17
|
-
const { root, components, data } = surface;
|
|
18
|
-
if (typeof root !== "string")
|
|
19
|
-
return "the surface has no root";
|
|
20
|
-
if (!Array.isArray(components))
|
|
21
|
-
return "the surface has no list of components";
|
|
22
|
-
if (data !== undefined && !isRecord(data))
|
|
23
|
-
return "the surface's data is not an object";
|
|
24
|
-
const byId = new Map();
|
|
25
|
-
for (const item of components) {
|
|
26
|
-
if (!isRecord(item) ||
|
|
27
|
-
typeof item["id"] !== "string" ||
|
|
28
|
-
typeof item["component"] !== "string") {
|
|
29
|
-
return "a component has no id or no type";
|
|
30
|
-
}
|
|
31
|
-
byId.set(item["id"], item);
|
|
32
|
-
}
|
|
33
|
-
const seen = new Set();
|
|
34
|
-
const pending = [root];
|
|
35
|
-
while (pending.length > 0) {
|
|
36
|
-
const id = pending.pop();
|
|
37
|
-
const node = byId.get(id);
|
|
38
|
-
if (!node)
|
|
39
|
-
return `${id} is a child but not one of the components`;
|
|
40
|
-
if (seen.has(id))
|
|
41
|
-
return `${id} appears twice in the tree`;
|
|
42
|
-
seen.add(id);
|
|
43
|
-
const kind = node["component"];
|
|
44
|
-
if (isHostNode(node)) {
|
|
45
|
-
// A host component is a leaf: what it shows is its own.
|
|
46
|
-
const problem = hostProblem(id, kind, node["props"], hosts);
|
|
47
|
-
if (problem !== null)
|
|
48
|
-
return problem;
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
if (!known.has(kind))
|
|
52
|
-
return `${kind} is not in the catalog`;
|
|
53
|
-
const children = node["children"];
|
|
54
|
-
if (children === undefined)
|
|
55
|
-
continue;
|
|
56
|
-
if (!Array.isArray(children) || !children.every((child) => typeof child === "string")) {
|
|
57
|
-
return `${id} has children that are not ids`;
|
|
58
|
-
}
|
|
59
|
-
pending.push(...children);
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
function hostProblem(id, name, props, hosts) {
|
|
64
|
-
if (!hosts.has(name))
|
|
65
|
-
return `${name} is not a host component this page has registered`;
|
|
66
|
-
if (props !== undefined && !isRecord(props))
|
|
67
|
-
return `${id} has props that are not an object`;
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* The host components a surface names that the page has not registered, for the developer: the
|
|
72
|
-
* surface shows its text twin until they are. Reads any payload, damaged or not.
|
|
73
|
-
*/
|
|
74
|
-
export function unregisteredHosts(surface, hosts) {
|
|
75
|
-
const nodes = isRecord(surface) ? surface["components"] : undefined;
|
|
76
|
-
if (!Array.isArray(nodes))
|
|
77
|
-
return [];
|
|
78
|
-
const names = nodes.flatMap((node) => {
|
|
79
|
-
const name = isRecord(node) && isHostNode(node) ? node["component"] : undefined;
|
|
80
|
-
return typeof name === "string" && !hosts.has(name) ? [name] : [];
|
|
81
|
-
});
|
|
82
|
-
return [...new Set(names)];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* A surface from a payload of unknown shape, if it has the shape of one (a journal event carries
|
|
86
|
-
* it as loose JSON). `Surface` checks the rest when it draws.
|
|
87
|
-
*/
|
|
88
|
-
export function surfaceOf(value) {
|
|
89
|
-
if (!isRecord(value))
|
|
90
|
-
return undefined;
|
|
91
|
-
const { id, root, components, fallback_text: twin } = value;
|
|
92
|
-
const shaped = typeof id === "string" &&
|
|
93
|
-
typeof root === "string" &&
|
|
94
|
-
Array.isArray(components) &&
|
|
95
|
-
typeof twin === "string";
|
|
96
|
-
return shaped ? value : undefined;
|
|
97
|
-
}
|
|
98
|
-
/** What a surface says when it cannot be drawn: its text twin, if it came with one, else `none`. */
|
|
99
|
-
export function twinOf(surface, none) {
|
|
100
|
-
const text = isRecord(surface) ? surface["fallback_text"] : undefined;
|
|
101
|
-
return typeof text === "string" && text.trim() ? text : none;
|
|
102
|
-
}
|
package/dist/surface/format.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Locale } from "../messages/index.js";
|
|
2
|
-
/** A value as a table cell or an answer reads it. */
|
|
3
|
-
export declare function display(value: unknown): string;
|
|
4
|
-
/** An ISO moment as a slot reads: "mar 6, 10:00", in the locale's language and the reader's zone. */
|
|
5
|
-
export declare function when(start: string, locale: Locale): string;
|
|
6
|
-
/**
|
|
7
|
-
* What a submitted form says in words, for the conversation: "nombre: Ana, personas: 2", or
|
|
8
|
-
* `none` ("Enviado") when it held nothing.
|
|
9
|
-
*/
|
|
10
|
-
export declare function summarize(values: Record<string, unknown>, none: string): string;
|
package/dist/surface/format.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** A value as a table cell or an answer reads it. */
|
|
2
|
-
export function display(value) {
|
|
3
|
-
if (value === null || value === undefined)
|
|
4
|
-
return "";
|
|
5
|
-
if (typeof value === "string")
|
|
6
|
-
return value;
|
|
7
|
-
if (typeof value === "number" || typeof value === "boolean")
|
|
8
|
-
return String(value);
|
|
9
|
-
return JSON.stringify(value);
|
|
10
|
-
}
|
|
11
|
-
/** An ISO moment as a slot reads: "mar 6, 10:00", in the locale's language and the reader's zone. */
|
|
12
|
-
export function when(start, locale) {
|
|
13
|
-
const date = new Date(start);
|
|
14
|
-
return Number.isNaN(date.getTime())
|
|
15
|
-
? start
|
|
16
|
-
: date.toLocaleString(locale, {
|
|
17
|
-
weekday: "short",
|
|
18
|
-
day: "numeric",
|
|
19
|
-
hour: "2-digit",
|
|
20
|
-
minute: "2-digit",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* What a submitted form says in words, for the conversation: "nombre: Ana, personas: 2", or
|
|
25
|
-
* `none` ("Enviado") when it held nothing.
|
|
26
|
-
*/
|
|
27
|
-
export function summarize(values, none) {
|
|
28
|
-
const line = Object.entries(values)
|
|
29
|
-
.map(([key, value]) => `${key}: ${display(value)}`)
|
|
30
|
-
.join(", ");
|
|
31
|
-
return line || none;
|
|
32
|
-
}
|
package/dist/surface/hosts.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from "react";
|
|
2
|
-
import type { HostComponents, HostProps } from "../host.js";
|
|
3
|
-
/** The names a surface may use for the host's own components: whatever the provider registered. */
|
|
4
|
-
export declare function registeredHosts(components: HostComponents): ReadonlySet<string>;
|
|
5
|
-
/** The host's component of that name, when the provider has registered one. */
|
|
6
|
-
export declare function hostComponent(components: HostComponents, name: string): ComponentType<HostProps> | undefined;
|
package/dist/surface/hosts.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PRIMITIVE_NAMES } from "../primitives.js";
|
|
2
|
-
/** The names a surface may use for the host's own components: whatever the provider registered. */
|
|
3
|
-
export function registeredHosts(components) {
|
|
4
|
-
return new Set(Object.keys(components).filter((name) => !PRIMITIVE_NAMES.has(name)));
|
|
5
|
-
}
|
|
6
|
-
/** The host's component of that name, when the provider has registered one. */
|
|
7
|
-
export function hostComponent(components, name) {
|
|
8
|
-
if (!Object.hasOwn(components, name) || PRIMITIVE_NAMES.has(name))
|
|
9
|
-
return undefined;
|
|
10
|
-
return components[name];
|
|
11
|
-
}
|
package/dist/surface/scene.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import type { HostAction } from "../host.js";
|
|
3
|
-
import type { Reader } from "./bindings.js";
|
|
4
|
-
import type { ComponentData } from "./types.js";
|
|
5
|
-
/** Reports what the user did; missing when the surface takes no actions (an older one). */
|
|
6
|
-
export type Act = (action: HostAction) => void;
|
|
7
|
-
/** The surface being drawn: its components, its data and what it is allowed to report. */
|
|
8
|
-
export interface Scene {
|
|
9
|
-
byId: ReadonlyMap<string, ComponentData>;
|
|
10
|
-
data: Record<string, unknown>;
|
|
11
|
-
act: Act | undefined;
|
|
12
|
-
/** The agent is at work on it now: a browser in it shows it working. */
|
|
13
|
-
active: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare const SceneContext: import("react").Context<Scene | null>;
|
|
16
|
-
export declare function useScene(): Scene;
|
|
17
|
-
/** What every catalog component is given: its properties to read, and its children drawn. */
|
|
18
|
-
export interface TemplateProps {
|
|
19
|
-
read: Reader;
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
}
|
package/dist/surface/scene.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
|
-
export const SceneContext = createContext(null);
|
|
3
|
-
export function useScene() {
|
|
4
|
-
const scene = useContext(SceneContext);
|
|
5
|
-
if (!scene)
|
|
6
|
-
throw new Error("A surface component was drawn outside a surface");
|
|
7
|
-
return scene;
|
|
8
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type TemplateProps } from "../scene.js";
|
|
2
|
-
/**
|
|
3
|
-
* The browser session an agent drives, watched live (on its stream when the surface names one);
|
|
4
|
-
* nothing in it comes back as an action.
|
|
5
|
-
*/
|
|
6
|
-
export declare function Browser({ read }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BrowserView } from "../../browser/BrowserView.js";
|
|
3
|
-
import { useScene } from "../scene.js";
|
|
4
|
-
/**
|
|
5
|
-
* The browser session an agent drives, watched live (on its stream when the surface names one);
|
|
6
|
-
* nothing in it comes back as an action.
|
|
7
|
-
*/
|
|
8
|
-
export function Browser({ read }) {
|
|
9
|
-
const { active } = useScene();
|
|
10
|
-
return (_jsx(BrowserView, { sessionId: read.text("session_id") ?? "", liveUrl: read.text("live_url"), url: read.text("url"), title: read.text("title"), status: read.text("status"), streamId: read.text("stream_id"), caption: read.text("caption"), step: read.count("step"), summary: read.text("summary"), active: active }));
|
|
11
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TemplateProps } from "../scene.js";
|
|
2
|
-
/**
|
|
3
|
-
* Numbers to compare, as bars in proportion to the largest. Every `kind` (bar, line, donut) reads
|
|
4
|
-
* as bars for now: the same figures, drawn the one way that never hides a value.
|
|
5
|
-
*/
|
|
6
|
-
export declare function Chart({ read }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
3
|
-
/**
|
|
4
|
-
* Numbers to compare, as bars in proportion to the largest. Every `kind` (bar, line, donut) reads
|
|
5
|
-
* as bars for now: the same figures, drawn the one way that never hides a value.
|
|
6
|
-
*/
|
|
7
|
-
export function Chart({ read }) {
|
|
8
|
-
const part = useParts();
|
|
9
|
-
const title = read.text("title");
|
|
10
|
-
const series = read.list("series");
|
|
11
|
-
const top = Math.max(...series.map((point) => point.value), 0) || 1;
|
|
12
|
-
return (_jsxs("figure", { ...part("chart"), children: [title && _jsx("figcaption", { ...part("chart__title"), children: title }), series.map((point) => (_jsxs("div", { ...part("chart__row"), children: [_jsx("span", { ...part("chart__label"), children: point.label }), _jsx("span", { ...part("chart__bar"), style: { width: `${Math.max((point.value / top) * 100, 2)}%` } }), _jsx("span", { ...part("chart__value"), children: point.value })] }, point.label)))] }));
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
3
|
-
import { useScene } from "../scene.js";
|
|
4
|
-
/** Pick one: each option is a button, and the pick goes back as the `choose` action. */
|
|
5
|
-
export function ChoiceList({ read }) {
|
|
6
|
-
const part = useParts();
|
|
7
|
-
const { act } = useScene();
|
|
8
|
-
const name = read.text("action") ?? "choose";
|
|
9
|
-
return (_jsx("div", { ...part("choices"), children: read.list("options").map((option) => (_jsxs("button", { type: "button", disabled: !act, ...part("choice"), onClick: () => {
|
|
10
|
-
act?.({ name, data: { option: option.id }, label: option.label });
|
|
11
|
-
}, children: [_jsx("span", { ...part("choice__label"), children: option.label }), option.description && _jsx("span", { ...part("choice__description"), children: option.description })] }, option.id))) }));
|
|
12
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { usePrimitives } from "../../primitives.js";
|
|
4
|
-
import { useMessages, useParts, useSignalcore } from "../../SignalcoreProvider.js";
|
|
5
|
-
import { summarize } from "../format.js";
|
|
6
|
-
import { useScene } from "../scene.js";
|
|
7
|
-
/** Details to collect; sending them goes back as the `submit` action, never as typed text. */
|
|
8
|
-
export function Form({ read }) {
|
|
9
|
-
const part = useParts();
|
|
10
|
-
const messages = useMessages();
|
|
11
|
-
const { Button } = usePrimitives();
|
|
12
|
-
const { patterns } = useSignalcore();
|
|
13
|
-
const { act } = useScene();
|
|
14
|
-
const [values, setValues] = useState({});
|
|
15
|
-
const set = (name, value) => {
|
|
16
|
-
setValues((old) => ({ ...old, [name]: value }));
|
|
17
|
-
};
|
|
18
|
-
return (_jsxs("form", { ...part("form"), onSubmit: (event) => {
|
|
19
|
-
event.preventDefault();
|
|
20
|
-
act?.({
|
|
21
|
-
name: read.text("action") ?? "submit",
|
|
22
|
-
data: values,
|
|
23
|
-
label: summarize(values, messages.sent),
|
|
24
|
-
});
|
|
25
|
-
}, children: [read.list("fields").map((field) => (_jsxs("label", { ...part("field"), children: [field.label, _jsx(Control, { field: field, set: set })] }, field.name))), _jsx("div", { ...part("form__actions", [patterns.actions]), children: _jsx(Button, { type: "submit", variant: "primary", size: "sm", disabled: !act, children: read.text("submit_label") ?? messages.send }) })] }));
|
|
26
|
-
}
|
|
27
|
-
function Control({ field, set, }) {
|
|
28
|
-
const part = useParts();
|
|
29
|
-
const { Input, Select } = usePrimitives();
|
|
30
|
-
switch (field.kind) {
|
|
31
|
-
case "select":
|
|
32
|
-
return (_jsx(Select, { name: field.name, options: field.options ?? [], required: field.required, onChange: (value) => {
|
|
33
|
-
set(field.name, value);
|
|
34
|
-
} }));
|
|
35
|
-
case "checkbox":
|
|
36
|
-
return (_jsx("input", { type: "checkbox", name: field.name, ...part("checkbox"), onChange: (event) => {
|
|
37
|
-
set(field.name, event.target.checked);
|
|
38
|
-
} }));
|
|
39
|
-
default:
|
|
40
|
-
return (_jsx(Input, { name: field.name, type: field.kind, required: field.required, onChange: (value) => {
|
|
41
|
-
set(field.name, field.kind === "number" ? Number(value) : value);
|
|
42
|
-
} }));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
3
|
-
/** Facts as label and value: a quote, an order. */
|
|
4
|
-
export function KeyValue({ read }) {
|
|
5
|
-
const part = useParts();
|
|
6
|
-
return (_jsx("dl", { ...part("pairs"), children: read.list("items").map((pair, index) => (_jsxs("div", { ...part("pairs__row"), children: [_jsx("dt", { ...part("pairs__label"), children: pair.label }), _jsx("dd", { ...part("pairs__value"), children: pair.value })] }, index))) }));
|
|
7
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { TemplateProps } from "../scene.js";
|
|
2
|
-
export declare function Column({ children }: TemplateProps): import("react").JSX.Element;
|
|
3
|
-
export declare function Row({ children }: TemplateProps): import("react").JSX.Element;
|
|
4
|
-
/** The one box of the catalog: a title and what it holds, drawn with the host's `Card` if it has one. */
|
|
5
|
-
export declare function Card({ read, children }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { usePrimitives } from "../../primitives.js";
|
|
3
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
4
|
-
export function Column({ children }) {
|
|
5
|
-
const part = useParts();
|
|
6
|
-
return _jsx("div", { ...part("column"), children: children });
|
|
7
|
-
}
|
|
8
|
-
export function Row({ children }) {
|
|
9
|
-
const part = useParts();
|
|
10
|
-
return _jsx("div", { ...part("row"), children: children });
|
|
11
|
-
}
|
|
12
|
-
/** The one box of the catalog: a title and what it holds, drawn with the host's `Card` if it has one. */
|
|
13
|
-
export function Card({ read, children }) {
|
|
14
|
-
const { Card: Box } = usePrimitives();
|
|
15
|
-
return (_jsx(Box, { title: read.text("title"), subtitle: read.text("subtitle"), children: children }));
|
|
16
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TemplateProps } from "../scene.js";
|
|
2
|
-
/**
|
|
3
|
-
* Live output of a run (a preview, a video being cut) watched as it happens; nothing in it comes
|
|
4
|
-
* back as an action, what a person does on it travels on the stream's own socket.
|
|
5
|
-
*/
|
|
6
|
-
export declare function Live({ read }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { LiveView } from "../../live/LiveView.js";
|
|
3
|
-
/**
|
|
4
|
-
* Live output of a run (a preview, a video being cut) watched as it happens; nothing in it comes
|
|
5
|
-
* back as an action, what a person does on it travels on the stream's own socket.
|
|
6
|
-
*/
|
|
7
|
-
export function Live({ read }) {
|
|
8
|
-
return (_jsx(LiveView, { streamId: read.text("stream_id") ?? "", aspect: read.text("aspect"), input: read.flag("input") }));
|
|
9
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { TemplateProps } from "../scene.js";
|
|
2
|
-
/** A picture. An address that is not `https://` leaves it without a source, so nothing loads. */
|
|
3
|
-
export declare function Image({ read }: TemplateProps): import("react").JSX.Element;
|
|
4
|
-
/** A link that opens in a tab of its own; an address that is not `https://` is no link. */
|
|
5
|
-
export declare function Link({ read }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { safeUrl } from "../../safeUrl.js";
|
|
3
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
4
|
-
/** A picture. An address that is not `https://` leaves it without a source, so nothing loads. */
|
|
5
|
-
export function Image({ read }) {
|
|
6
|
-
const part = useParts();
|
|
7
|
-
return _jsx("img", { src: safeUrl(read.text("url")), alt: read.text("alt") ?? "", ...part("image") });
|
|
8
|
-
}
|
|
9
|
-
/** A link that opens in a tab of its own; an address that is not `https://` is no link. */
|
|
10
|
-
export function Link({ read }) {
|
|
11
|
-
const part = useParts();
|
|
12
|
-
return (_jsx("a", { href: safeUrl(read.text("url")), target: "_blank", rel: "noreferrer noopener", ...part("link"), children: read.text("label") }));
|
|
13
|
-
}
|