@signalcore/ui 0.1.0 → 1.0.0-beta.1
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 +1127 -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 +541 -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 +1812 -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 +271 -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 +6970 -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 +604 -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
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
//#region src/voice/webgl.ts
|
|
2
|
+
const VERTEX = `attribute vec2 aPos; void main(){ gl_Position=vec4(aPos,0.0,1.0); }`;
|
|
3
|
+
/**
|
|
4
|
+
* The line every shader ends its `main` with: the shaders paint light on black, and an orb sits on
|
|
5
|
+
* any background, so what is near black becomes transparent instead. The canvas is premultiplied,
|
|
6
|
+
* so the colour goes with its alpha. There is no black square around the orb.
|
|
7
|
+
*/
|
|
8
|
+
const CUTOUT = `gl_FragColor.a *= smoothstep(0.02, 0.12, max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b))); gl_FragColor.rgb *= gl_FragColor.a;`;
|
|
9
|
+
/** The uniforms of the host's colour, which every shader declares beside its own. */
|
|
10
|
+
const INK_UNIFORMS = `uniform vec3 uInk; uniform float uInked; // signalcore: the host's colour`;
|
|
11
|
+
/**
|
|
12
|
+
* The line before `CUTOUT`: with the host's colour (`uInked` 1), the shader's light is painted
|
|
13
|
+
* in it, as bright as it was (its brightest channel); without, the shader's own colours stay.
|
|
14
|
+
*/
|
|
15
|
+
const INK = `gl_FragColor.rgb = mix(gl_FragColor.rgb, uInk * max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b)), uInked);`;
|
|
16
|
+
/**
|
|
17
|
+
* What the shader paints so that, blended by exclusion over `surface`, its brightest light shows
|
|
18
|
+
* as `color`: the colour itself over black, its opposite over white (exclusion turns it over),
|
|
19
|
+
* and between them, channel by channel, what turns into it as far as it can; a channel of the
|
|
20
|
+
* surface near the middle turns nothing over, and keeps the colour.
|
|
21
|
+
*/
|
|
22
|
+
function inkOver(color, surface) {
|
|
23
|
+
const channel = (wanted, under) => {
|
|
24
|
+
const turn = 1 - 2 * under;
|
|
25
|
+
if (Math.abs(turn) < .2) return wanted;
|
|
26
|
+
return Math.min(1, Math.max(0, (wanted - under) / turn));
|
|
27
|
+
};
|
|
28
|
+
return [
|
|
29
|
+
channel(color[0], surface[0]),
|
|
30
|
+
channel(color[1], surface[1]),
|
|
31
|
+
channel(color[2], surface[2])
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
/** A pixel to read colours off: any CSS colour, as the browser paints it. */
|
|
35
|
+
let swatch;
|
|
36
|
+
/** A CSS colour as red, green, blue and alpha, each 0 to 1; null where it can't be read. */
|
|
37
|
+
function rgbaOf(css) {
|
|
38
|
+
if (swatch === void 0) swatch = document.createElement("canvas").getContext("2d", { willReadFrequently: true });
|
|
39
|
+
if (swatch === null || css === "") return null;
|
|
40
|
+
swatch.clearRect(0, 0, 1, 1);
|
|
41
|
+
swatch.fillStyle = "#000";
|
|
42
|
+
swatch.fillStyle = css;
|
|
43
|
+
swatch.fillRect(0, 0, 1, 1);
|
|
44
|
+
const [r = 0, g = 0, b = 0, a = 0] = swatch.getImageData(0, 0, 1, 1).data;
|
|
45
|
+
return [
|
|
46
|
+
r / 255,
|
|
47
|
+
g / 255,
|
|
48
|
+
b / 255,
|
|
49
|
+
a / 255
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The host's colour for an orb's canvas, as its shader paints it, from what the stylesheet puts
|
|
54
|
+
* on the canvas: the colour (`color`: `--sc-orb-color`, transparent when none) and the surface it
|
|
55
|
+
* blends with (`outline-color`; a page's own, light, where the surface is see-through). Null:
|
|
56
|
+
* the shader's own colours.
|
|
57
|
+
*/
|
|
58
|
+
function inkOf(canvas) {
|
|
59
|
+
const style = getComputedStyle(canvas);
|
|
60
|
+
const color = rgbaOf(style.color);
|
|
61
|
+
if (color === null || color[3] === 0) return null;
|
|
62
|
+
const surface = rgbaOf(style.outlineColor);
|
|
63
|
+
const under = surface === null || surface[3] < .5 ? [
|
|
64
|
+
1,
|
|
65
|
+
1,
|
|
66
|
+
1
|
|
67
|
+
] : [
|
|
68
|
+
surface[0],
|
|
69
|
+
surface[1],
|
|
70
|
+
surface[2]
|
|
71
|
+
];
|
|
72
|
+
return inkOver([
|
|
73
|
+
color[0],
|
|
74
|
+
color[1],
|
|
75
|
+
color[2]
|
|
76
|
+
], under);
|
|
77
|
+
}
|
|
78
|
+
function compile(gl, type, source) {
|
|
79
|
+
const shader = gl.createShader(type);
|
|
80
|
+
if (!shader) throw new Error("no shader");
|
|
81
|
+
gl.shaderSource(shader, source);
|
|
82
|
+
gl.compileShader(shader);
|
|
83
|
+
if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
|
|
84
|
+
const log = gl.getShaderInfoLog(shader);
|
|
85
|
+
gl.deleteShader(shader);
|
|
86
|
+
throw new Error(log ?? "shader compile error");
|
|
87
|
+
}
|
|
88
|
+
return shader;
|
|
89
|
+
}
|
|
90
|
+
/** The program of a fragment shader, linked: the triangle's vertex shader and `fragment`. */
|
|
91
|
+
function link(gl, fragment) {
|
|
92
|
+
const program = gl.createProgram();
|
|
93
|
+
const vertex = compile(gl, gl.VERTEX_SHADER, VERTEX);
|
|
94
|
+
const pixels = compile(gl, gl.FRAGMENT_SHADER, fragment);
|
|
95
|
+
gl.attachShader(program, vertex);
|
|
96
|
+
gl.attachShader(program, pixels);
|
|
97
|
+
gl.linkProgram(program);
|
|
98
|
+
gl.deleteShader(vertex);
|
|
99
|
+
gl.deleteShader(pixels);
|
|
100
|
+
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
101
|
+
const log = gl.getProgramInfoLog(program);
|
|
102
|
+
gl.deleteProgram(program);
|
|
103
|
+
throw new Error(log ?? "shader link error");
|
|
104
|
+
}
|
|
105
|
+
return program;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Sets `canvas` up to draw `fragment` on a square of `dim` pixels, compiled once: the program, the
|
|
109
|
+
* triangle and the uniforms' places are kept for every frame after. Nothing when WebGL is not
|
|
110
|
+
* there or the shader does not compile on this device, and `onLost` is called if the browser
|
|
111
|
+
* takes the context away later (a GPU reset, too many contexts on the page).
|
|
112
|
+
*/
|
|
113
|
+
function createRenderer(canvas, fragment, dim, onLost) {
|
|
114
|
+
const gl = canvas.getContext("webgl", {
|
|
115
|
+
alpha: true,
|
|
116
|
+
premultipliedAlpha: true
|
|
117
|
+
});
|
|
118
|
+
if (!gl) return void 0;
|
|
119
|
+
let program;
|
|
120
|
+
try {
|
|
121
|
+
program = link(gl, fragment);
|
|
122
|
+
} catch {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
gl.useProgram(program);
|
|
126
|
+
const buffer = gl.createBuffer();
|
|
127
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
128
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
|
129
|
+
-1,
|
|
130
|
+
-1,
|
|
131
|
+
3,
|
|
132
|
+
-1,
|
|
133
|
+
-1,
|
|
134
|
+
3
|
|
135
|
+
]), gl.STATIC_DRAW);
|
|
136
|
+
const position = gl.getAttribLocation(program, "aPos");
|
|
137
|
+
gl.enableVertexAttribArray(position);
|
|
138
|
+
gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);
|
|
139
|
+
canvas.width = dim;
|
|
140
|
+
canvas.height = dim;
|
|
141
|
+
gl.viewport(0, 0, dim, dim);
|
|
142
|
+
gl.clearColor(0, 0, 0, 0);
|
|
143
|
+
gl.uniform2f(gl.getUniformLocation(program, "iResolution"), dim, dim);
|
|
144
|
+
const time = gl.getUniformLocation(program, "iTime");
|
|
145
|
+
const level = gl.getUniformLocation(program, "uLevel");
|
|
146
|
+
const energy = gl.getUniformLocation(program, "uEnergy");
|
|
147
|
+
const inkColor = gl.getUniformLocation(program, "uInk");
|
|
148
|
+
const inked = gl.getUniformLocation(program, "uInked");
|
|
149
|
+
gl.uniform1f(inked, 0);
|
|
150
|
+
const lost = (event) => {
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
onLost();
|
|
153
|
+
};
|
|
154
|
+
canvas.addEventListener("webglcontextlost", lost);
|
|
155
|
+
return {
|
|
156
|
+
draw(values) {
|
|
157
|
+
gl.uniform1f(time, values.time);
|
|
158
|
+
gl.uniform1f(level, values.level);
|
|
159
|
+
gl.uniform1f(energy, values.energy);
|
|
160
|
+
gl.clear(gl.COLOR_BUFFER_BIT);
|
|
161
|
+
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
162
|
+
},
|
|
163
|
+
ink(ink) {
|
|
164
|
+
if (ink !== null) gl.uniform3f(inkColor, ink[0], ink[1], ink[2]);
|
|
165
|
+
gl.uniform1f(inked, ink === null ? 0 : 1);
|
|
166
|
+
},
|
|
167
|
+
dispose() {
|
|
168
|
+
canvas.removeEventListener("webglcontextlost", lost);
|
|
169
|
+
gl.deleteProgram(program);
|
|
170
|
+
gl.deleteBuffer(buffer);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//#endregion
|
|
175
|
+
export { CUTOUT, INK, INK_UNIFORMS, createRenderer, inkOf, inkOver, rgbaOf };
|
|
176
|
+
|
|
177
|
+
//# sourceMappingURL=webgl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webgl.js","names":[],"sources":["../../src/voice/webgl.ts"],"sourcesContent":["/**\n * The WebGL under the `wave` and `fluid-dots` orbs: one fullscreen triangle drawn by one\n * fragment shader, and its uniforms (the time, the signal, the host's colour). Nothing here knows\n * React, a call or a state; the frame loop is `motion`'s.\n */\n\n/** A style of orb drawn by a fragment shader. */\nexport interface Shader {\n /** GLSL ES 1.00 source of the fragment shader; it reads the uniforms named in `Uniforms`. */\n fragment: string;\n /**\n * How fast the shader's clock runs at an energy, 0 (idle) to 1 (listening, speaking): 1 is the\n * shader's own pace. The clock is summed frame by frame on this side, so a change of pace bends\n * the motion instead of making it jump, as a time multiplied inside the shader would.\n */\n pace(energy: number): number;\n}\n\n/** What one frame is drawn from. */\nexport interface Uniforms {\n /** `iTime`: seconds on the shader's own clock, already paced. */\n time: number;\n /** `uLevel`: how loud the microphone or the voice is, 0 to 1. */\n level: number;\n /** `uEnergy`: 0 at rest, 0.5 while thinking, 1 while listening or speaking. */\n energy: number;\n}\n\n/** A colour as the shader takes it: red, green and blue, each 0 to 1. */\nexport type Rgb = readonly [number, number, number];\n\nexport interface Renderer {\n draw(values: Uniforms): void;\n /** Paints the next frames in `ink` (`uInk`), or (null) in the shader's own colours. */\n ink(ink: Rgb | null): void;\n dispose(): void;\n}\n\nconst VERTEX = `attribute vec2 aPos; void main(){ gl_Position=vec4(aPos,0.0,1.0); }`;\n\n/**\n * The line every shader ends its `main` with: the shaders paint light on black, and an orb sits on\n * any background, so what is near black becomes transparent instead. The canvas is premultiplied,\n * so the colour goes with its alpha. There is no black square around the orb.\n */\nexport const CUTOUT = `gl_FragColor.a *= smoothstep(0.02, 0.12, max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b))); gl_FragColor.rgb *= gl_FragColor.a;`;\n\n/** The uniforms of the host's colour, which every shader declares beside its own. */\nexport const INK_UNIFORMS = `uniform vec3 uInk; uniform float uInked; // signalcore: the host's colour`;\n\n/**\n * The line before `CUTOUT`: with the host's colour (`uInked` 1), the shader's light is painted\n * in it, as bright as it was (its brightest channel); without, the shader's own colours stay.\n */\nexport const INK = `gl_FragColor.rgb = mix(gl_FragColor.rgb, uInk * max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b)), uInked);`;\n\n/**\n * What the shader paints so that, blended by exclusion over `surface`, its brightest light shows\n * as `color`: the colour itself over black, its opposite over white (exclusion turns it over),\n * and between them, channel by channel, what turns into it as far as it can; a channel of the\n * surface near the middle turns nothing over, and keeps the colour.\n */\nexport function inkOver(color: Rgb, surface: Rgb): Rgb {\n const channel = (wanted: number, under: number): number => {\n const turn = 1 - 2 * under;\n if (Math.abs(turn) < 0.2) return wanted;\n return Math.min(1, Math.max(0, (wanted - under) / turn));\n };\n return [\n channel(color[0], surface[0]),\n channel(color[1], surface[1]),\n channel(color[2], surface[2]),\n ];\n}\n\n/** A pixel to read colours off: any CSS colour, as the browser paints it. */\nlet swatch: CanvasRenderingContext2D | null | undefined;\n\n/** A CSS colour as red, green, blue and alpha, each 0 to 1; null where it can't be read. */\nexport function rgbaOf(css: string): readonly [number, number, number, number] | null {\n if (swatch === undefined) {\n swatch = document.createElement(\"canvas\").getContext(\"2d\", { willReadFrequently: true });\n }\n if (swatch === null || css === \"\") return null;\n swatch.clearRect(0, 0, 1, 1);\n swatch.fillStyle = \"#000\";\n swatch.fillStyle = css;\n swatch.fillRect(0, 0, 1, 1);\n const [r = 0, g = 0, b = 0, a = 0] = swatch.getImageData(0, 0, 1, 1).data;\n return [r / 255, g / 255, b / 255, a / 255];\n}\n\n/**\n * The host's colour for an orb's canvas, as its shader paints it, from what the stylesheet puts\n * on the canvas: the colour (`color`: `--sc-orb-color`, transparent when none) and the surface it\n * blends with (`outline-color`; a page's own, light, where the surface is see-through). Null:\n * the shader's own colours.\n */\nexport function inkOf(canvas: HTMLCanvasElement): Rgb | null {\n const style = getComputedStyle(canvas);\n const color = rgbaOf(style.color);\n if (color === null || color[3] === 0) return null;\n const surface = rgbaOf(style.outlineColor);\n const under: Rgb =\n surface === null || surface[3] < 0.5 ? [1, 1, 1] : [surface[0], surface[1], surface[2]];\n return inkOver([color[0], color[1], color[2]], under);\n}\n\nfunction compile(gl: WebGLRenderingContext, type: number, source: string): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) throw new Error(\"no shader\");\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(log ?? \"shader compile error\");\n }\n return shader;\n}\n\n/** The program of a fragment shader, linked: the triangle's vertex shader and `fragment`. */\nfunction link(gl: WebGLRenderingContext, fragment: string): WebGLProgram {\n const program = gl.createProgram();\n const vertex = compile(gl, gl.VERTEX_SHADER, VERTEX);\n const pixels = compile(gl, gl.FRAGMENT_SHADER, fragment);\n gl.attachShader(program, vertex);\n gl.attachShader(program, pixels);\n gl.linkProgram(program);\n // Linked, the program keeps what it needs: the shaders can go.\n gl.deleteShader(vertex);\n gl.deleteShader(pixels);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(log ?? \"shader link error\");\n }\n return program;\n}\n\n/**\n * Sets `canvas` up to draw `fragment` on a square of `dim` pixels, compiled once: the program, the\n * triangle and the uniforms' places are kept for every frame after. Nothing when WebGL is not\n * there or the shader does not compile on this device, and `onLost` is called if the browser\n * takes the context away later (a GPU reset, too many contexts on the page).\n */\nexport function createRenderer(\n canvas: HTMLCanvasElement,\n fragment: string,\n dim: number,\n onLost: () => void,\n): Renderer | undefined {\n const gl = canvas.getContext(\"webgl\", { alpha: true, premultipliedAlpha: true });\n if (!gl) return undefined;\n\n let program: WebGLProgram;\n try {\n program = link(gl, fragment);\n } catch {\n return undefined;\n }\n gl.useProgram(program);\n\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n // One triangle bigger than the screen: three vertices cover it, with no seam across a quad.\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 3, -1, -1, 3]), gl.STATIC_DRAW);\n const position = gl.getAttribLocation(program, \"aPos\");\n gl.enableVertexAttribArray(position);\n gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n canvas.width = dim;\n canvas.height = dim;\n gl.viewport(0, 0, dim, dim);\n gl.clearColor(0, 0, 0, 0);\n // A uniform a shader does not use is optimised out and has no place: setting it does nothing.\n gl.uniform2f(gl.getUniformLocation(program, \"iResolution\"), dim, dim);\n const time = gl.getUniformLocation(program, \"iTime\");\n const level = gl.getUniformLocation(program, \"uLevel\");\n const energy = gl.getUniformLocation(program, \"uEnergy\");\n const inkColor = gl.getUniformLocation(program, \"uInk\");\n const inked = gl.getUniformLocation(program, \"uInked\");\n gl.uniform1f(inked, 0);\n\n const lost = (event: Event) => {\n event.preventDefault();\n onLost();\n };\n canvas.addEventListener(\"webglcontextlost\", lost);\n\n return {\n draw(values) {\n gl.uniform1f(time, values.time);\n gl.uniform1f(level, values.level);\n gl.uniform1f(energy, values.energy);\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n },\n ink(ink) {\n if (ink !== null) gl.uniform3f(inkColor, ink[0], ink[1], ink[2]);\n gl.uniform1f(inked, ink === null ? 0 : 1);\n },\n dispose() {\n canvas.removeEventListener(\"webglcontextlost\", lost);\n gl.deleteProgram(program);\n gl.deleteBuffer(buffer);\n },\n };\n}\n"],"mappings":";AAsCA,MAAM,SAAS;;;;;;AAOf,MAAa,SAAS;;AAGtB,MAAa,eAAe;;;;;AAM5B,MAAa,MAAM;;;;;;;AAQnB,SAAgB,QAAQ,OAAY,SAAmB;CACrD,MAAM,WAAW,QAAgB,UAA0B;EACzD,MAAM,OAAO,IAAI,IAAI;EAC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