@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,165 @@
|
|
|
1
|
+
import { formatSize } from "./numbers.js";
|
|
2
|
+
//#region src/kit/uploads.ts
|
|
3
|
+
/** The most a file may weigh anywhere, in MB: the API's ceiling. */
|
|
4
|
+
const MAX_MB = 50;
|
|
5
|
+
const MB = 1048576;
|
|
6
|
+
/** A name's extension, lowercase, without its dot; "" for one without (`README`, `.env`). */
|
|
7
|
+
function extensionOf(name) {
|
|
8
|
+
const dot = name.lastIndexOf(".");
|
|
9
|
+
return dot <= 0 ? "" : name.slice(dot + 1).toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
/** The types a browser often leaves out, by extension. */
|
|
12
|
+
const TYPES = {
|
|
13
|
+
pdf: "application/pdf",
|
|
14
|
+
png: "image/png",
|
|
15
|
+
jpg: "image/jpeg",
|
|
16
|
+
jpeg: "image/jpeg",
|
|
17
|
+
gif: "image/gif",
|
|
18
|
+
webp: "image/webp",
|
|
19
|
+
heic: "image/heic",
|
|
20
|
+
heif: "image/heif",
|
|
21
|
+
csv: "text/csv",
|
|
22
|
+
txt: "text/plain",
|
|
23
|
+
md: "text/markdown",
|
|
24
|
+
json: "application/json",
|
|
25
|
+
doc: "application/msword",
|
|
26
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
27
|
+
xls: "application/vnd.ms-excel",
|
|
28
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
29
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
30
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
31
|
+
zip: "application/zip"
|
|
32
|
+
};
|
|
33
|
+
/** A file's type: the browser's, else the one its extension names, else "". */
|
|
34
|
+
function typeOf(file) {
|
|
35
|
+
return (file.type || TYPES[extensionOf(file.name)] || "").toLowerCase();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether a file is of a kind `accept` lists, read as an <input accept> reads it: a type
|
|
39
|
+
* ("application/pdf"), a family ("image/*") or an extension (".xlsx"); none takes anything.
|
|
40
|
+
*/
|
|
41
|
+
function accepts(accept, file) {
|
|
42
|
+
if (accept === void 0 || accept.length === 0) return true;
|
|
43
|
+
const type = typeOf(file);
|
|
44
|
+
const extension = extensionOf(file.name);
|
|
45
|
+
return accept.some((raw) => {
|
|
46
|
+
const rule = raw.trim().toLowerCase();
|
|
47
|
+
if (rule === "*" || rule === "*/*") return true;
|
|
48
|
+
if (rule.startsWith(".")) return extension !== "" && rule === `.${extension}`;
|
|
49
|
+
if (rule.endsWith("/*")) return type.startsWith(rule.slice(0, -1));
|
|
50
|
+
return type === rule;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** The most a field takes per file, in MB: its own, within the ceiling. */
|
|
54
|
+
function limitOf(maxMb) {
|
|
55
|
+
return maxMb !== void 0 && maxMb > 0 ? Math.min(maxMb, 50) : 50;
|
|
56
|
+
}
|
|
57
|
+
/** That most, as people read it: "10 MB". */
|
|
58
|
+
function limitWords(maxMb, code) {
|
|
59
|
+
return formatSize(limitOf(maxMb) * MB, code);
|
|
60
|
+
}
|
|
61
|
+
/** What keeps a file from being sent, in words: a kind not taken, or past the most; else null. */
|
|
62
|
+
function refusalOf(file, accept, maxMb, code, messages) {
|
|
63
|
+
if (!accepts(accept, file)) return messages.wrongType;
|
|
64
|
+
if (file.size > limitOf(maxMb) * MB) return messages.tooBig(limitWords(maxMb, code));
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* What a failed upload says: past what the server takes (413), a kind it refused (415), or that
|
|
69
|
+
* it failed, to be tried again.
|
|
70
|
+
*/
|
|
71
|
+
function failureOf(error, maxMb, code, messages) {
|
|
72
|
+
const status = typeof error === "object" && error !== null && "status" in error ? error.status : void 0;
|
|
73
|
+
if (status === 413) return messages.tooBig(limitWords(maxMb, code));
|
|
74
|
+
if (status === 415) return messages.wrongType;
|
|
75
|
+
return messages.uploadFailed;
|
|
76
|
+
}
|
|
77
|
+
/** Whether an upload's failure is the person letting it go: nothing to show. */
|
|
78
|
+
function isAbort(error) {
|
|
79
|
+
return error instanceof DOMException && error.name === "AbortError";
|
|
80
|
+
}
|
|
81
|
+
/** Short names for the types people know by one. */
|
|
82
|
+
const SHORT = Object.fromEntries(Object.entries(TYPES).map(([extension, type]) => [type, extension.toUpperCase()]));
|
|
83
|
+
/**
|
|
84
|
+
* The kinds a field takes as people name them, each once: a family ("image/*") by `anyOf`, a type
|
|
85
|
+
* by its short name ("PDF", "XLSX"), an extension by its letters; none when it takes anything.
|
|
86
|
+
*/
|
|
87
|
+
function kindsOf(accept, messages) {
|
|
88
|
+
const rules = (accept ?? []).map((rule) => rule.trim().toLowerCase());
|
|
89
|
+
if (rules.some((rule) => rule === "*" || rule === "*/*")) return [];
|
|
90
|
+
const names = rules.map((rule) => {
|
|
91
|
+
if (rule.startsWith(".")) return rule.slice(1).toUpperCase();
|
|
92
|
+
if (rule.endsWith("/*")) return messages.anyOf(rule.slice(0, -2));
|
|
93
|
+
return SHORT[rule] ?? (rule.split("/")[1] ?? rule).toUpperCase();
|
|
94
|
+
});
|
|
95
|
+
return [...new Set(names.filter((name) => name !== ""))];
|
|
96
|
+
}
|
|
97
|
+
/** The line under a drop zone: the kinds it takes, joined ("Images or PDF"), and its most. */
|
|
98
|
+
function limitsOf(accept, maxMb, code, messages) {
|
|
99
|
+
const kinds = kindsOf(accept, messages);
|
|
100
|
+
const joined = kinds.length === 0 ? "" : new Intl.ListFormat(code, { type: "disjunction" }).format(kinds);
|
|
101
|
+
const line = messages.limits(joined, limitWords(maxMb, code));
|
|
102
|
+
return line.charAt(0).toLocaleUpperCase(code) + line.slice(1);
|
|
103
|
+
}
|
|
104
|
+
const FAMILIES = {
|
|
105
|
+
png: "image",
|
|
106
|
+
jpg: "image",
|
|
107
|
+
jpeg: "image",
|
|
108
|
+
gif: "image",
|
|
109
|
+
webp: "image",
|
|
110
|
+
avif: "image",
|
|
111
|
+
heic: "image",
|
|
112
|
+
heif: "image",
|
|
113
|
+
svg: "image",
|
|
114
|
+
bmp: "image",
|
|
115
|
+
pdf: "pdf",
|
|
116
|
+
csv: "sheet",
|
|
117
|
+
tsv: "sheet",
|
|
118
|
+
xls: "sheet",
|
|
119
|
+
xlsx: "sheet",
|
|
120
|
+
ods: "sheet",
|
|
121
|
+
numbers: "sheet",
|
|
122
|
+
doc: "doc",
|
|
123
|
+
docx: "doc",
|
|
124
|
+
odt: "doc",
|
|
125
|
+
rtf: "doc",
|
|
126
|
+
pages: "doc",
|
|
127
|
+
ppt: "slides",
|
|
128
|
+
pptx: "slides",
|
|
129
|
+
odp: "slides",
|
|
130
|
+
key: "slides",
|
|
131
|
+
txt: "text",
|
|
132
|
+
md: "text",
|
|
133
|
+
markdown: "text",
|
|
134
|
+
json: "text",
|
|
135
|
+
yaml: "text",
|
|
136
|
+
yml: "text",
|
|
137
|
+
xml: "text",
|
|
138
|
+
html: "text",
|
|
139
|
+
log: "text",
|
|
140
|
+
zip: "archive",
|
|
141
|
+
rar: "archive",
|
|
142
|
+
"7z": "archive",
|
|
143
|
+
tar: "archive",
|
|
144
|
+
gz: "archive",
|
|
145
|
+
mp3: "audio",
|
|
146
|
+
wav: "audio",
|
|
147
|
+
m4a: "audio",
|
|
148
|
+
ogg: "audio",
|
|
149
|
+
mp4: "video",
|
|
150
|
+
mov: "video",
|
|
151
|
+
webm: "video"
|
|
152
|
+
};
|
|
153
|
+
/** A file's family, by its name's extension first, then by its type. */
|
|
154
|
+
function familyOf(name, type) {
|
|
155
|
+
const known = FAMILIES[extensionOf(name)];
|
|
156
|
+
if (known) return known;
|
|
157
|
+
const media = type.toLowerCase();
|
|
158
|
+
if (media === "application/pdf") return "pdf";
|
|
159
|
+
const family = media.split("/")[0];
|
|
160
|
+
return family === "image" || family === "audio" || family === "video" || family === "text" ? family : "other";
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { MAX_MB, accepts, extensionOf, failureOf, familyOf, isAbort, kindsOf, limitOf, limitsOf, refusalOf, typeOf };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=uploads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploads.js","names":[],"sources":["../../src/kit/uploads.ts"],"sourcesContent":["/**\n * Files a person picks, as pure functions: whether a field takes one (its kind, its weight), how\n * a field's kinds and limits read, what family a file is of (for its glyph), and the words for\n * what went wrong. Nothing here touches the page or the network.\n */\nimport type { Attachment } from \"../types\";\nimport type { KitMessages } from \"./messages\";\nimport { formatSize } from \"./numbers\";\n\n/** The most a file may weigh anywhere, in MB: the API's ceiling. */\nexport const MAX_MB = 50;\nconst MB = 1024 * 1024;\n\n/**\n * Sends one file where it belongs, telling how much of it has gone (0 to 1) as it goes; aborting\n * `signal` lets it go. Resolves to the file as stored.\n */\nexport type Uploader = (\n file: File,\n progress: (share: number) => void,\n signal: AbortSignal,\n) => Promise<Attachment>;\n\n/** Where a field's files go and how the ones already sent are found: the conversation's. */\nexport interface FileHost {\n upload: Uploader;\n /** The files known by id: said in the conversation, uploaded to it. */\n known: ReadonlyMap<string, Attachment>;\n /** Asks for files it does not know yet, by id: read back from the conversation. */\n find?: ((ids: readonly string[]) => void) | undefined;\n /** Opens one, when the host shows files. */\n open?: ((file: Attachment) => void) | undefined;\n /**\n * Where a picture, a video or a sound plays from in the page's own player: an address the\n * player streams with no credential, for a while.\n */\n play?: ((file: Attachment) => Promise<string>) | undefined;\n}\n\n/** A file as picked: its name, its type as the browser gave it (\"\" when none), its weight. */\nexport interface Picked {\n name: string;\n type: string;\n size: number;\n}\n\n/** A name's extension, lowercase, without its dot; \"\" for one without (`README`, `.env`). */\nexport function extensionOf(name: string): string {\n const dot = name.lastIndexOf(\".\");\n return dot <= 0 ? \"\" : name.slice(dot + 1).toLowerCase();\n}\n\n/** The types a browser often leaves out, by extension. */\nconst TYPES: Readonly<Record<string, string>> = {\n pdf: \"application/pdf\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n heic: \"image/heic\",\n heif: \"image/heif\",\n csv: \"text/csv\",\n txt: \"text/plain\",\n md: \"text/markdown\",\n json: \"application/json\",\n doc: \"application/msword\",\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n xls: \"application/vnd.ms-excel\",\n xlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n ppt: \"application/vnd.ms-powerpoint\",\n pptx: \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n zip: \"application/zip\",\n};\n\n/** A file's type: the browser's, else the one its extension names, else \"\". */\nexport function typeOf(file: Pick<Picked, \"name\" | \"type\">): string {\n return (file.type || TYPES[extensionOf(file.name)] || \"\").toLowerCase();\n}\n\n/**\n * Whether a file is of a kind `accept` lists, read as an <input accept> reads it: a type\n * (\"application/pdf\"), a family (\"image/*\") or an extension (\".xlsx\"); none takes anything.\n */\nexport function accepts(\n accept: readonly string[] | undefined,\n file: Pick<Picked, \"name\" | \"type\">,\n): boolean {\n if (accept === undefined || accept.length === 0) return true;\n const type = typeOf(file);\n const extension = extensionOf(file.name);\n return accept.some((raw) => {\n const rule = raw.trim().toLowerCase();\n if (rule === \"*\" || rule === \"*/*\") return true;\n if (rule.startsWith(\".\")) return extension !== \"\" && rule === `.${extension}`;\n if (rule.endsWith(\"/*\")) return type.startsWith(rule.slice(0, -1));\n return type === rule;\n });\n}\n\n/** The most a field takes per file, in MB: its own, within the ceiling. */\nexport function limitOf(maxMb: number | undefined): number {\n return maxMb !== undefined && maxMb > 0 ? Math.min(maxMb, MAX_MB) : MAX_MB;\n}\n\n/** That most, as people read it: \"10 MB\". */\nfunction limitWords(maxMb: number | undefined, code: string): string {\n return formatSize(limitOf(maxMb) * MB, code);\n}\n\n/** What keeps a file from being sent, in words: a kind not taken, or past the most; else null. */\nexport function refusalOf(\n file: Picked,\n accept: readonly string[] | undefined,\n maxMb: number | undefined,\n code: string,\n messages: KitMessages,\n): string | null {\n if (!accepts(accept, file)) return messages.wrongType;\n if (file.size > limitOf(maxMb) * MB) return messages.tooBig(limitWords(maxMb, code));\n return null;\n}\n\n/**\n * What a failed upload says: past what the server takes (413), a kind it refused (415), or that\n * it failed, to be tried again.\n */\nexport function failureOf(\n error: unknown,\n maxMb: number | undefined,\n code: string,\n messages: KitMessages,\n): string {\n const status =\n typeof error === \"object\" && error !== null && \"status\" in error ? error.status : undefined;\n if (status === 413) return messages.tooBig(limitWords(maxMb, code));\n if (status === 415) return messages.wrongType;\n return messages.uploadFailed;\n}\n\n/** Whether an upload's failure is the person letting it go: nothing to show. */\nexport function isAbort(error: unknown): boolean {\n return error instanceof DOMException && error.name === \"AbortError\";\n}\n\n/** Short names for the types people know by one. */\nconst SHORT: Readonly<Record<string, string>> = Object.fromEntries(\n Object.entries(TYPES).map(([extension, type]) => [type, extension.toUpperCase()]),\n);\n\n/**\n * The kinds a field takes as people name them, each once: a family (\"image/*\") by `anyOf`, a type\n * by its short name (\"PDF\", \"XLSX\"), an extension by its letters; none when it takes anything.\n */\nexport function kindsOf(accept: readonly string[] | undefined, messages: KitMessages): string[] {\n const rules = (accept ?? []).map((rule) => rule.trim().toLowerCase());\n if (rules.some((rule) => rule === \"*\" || rule === \"*/*\")) return [];\n const names = rules.map((rule) => {\n if (rule.startsWith(\".\")) return rule.slice(1).toUpperCase();\n if (rule.endsWith(\"/*\")) return messages.anyOf(rule.slice(0, -2));\n return SHORT[rule] ?? (rule.split(\"/\")[1] ?? rule).toUpperCase();\n });\n return [...new Set(names.filter((name) => name !== \"\"))];\n}\n\n/** The line under a drop zone: the kinds it takes, joined (\"Images or PDF\"), and its most. */\nexport function limitsOf(\n accept: readonly string[] | undefined,\n maxMb: number | undefined,\n code: string,\n messages: KitMessages,\n): string {\n const kinds = kindsOf(accept, messages);\n const joined =\n kinds.length === 0 ? \"\" : new Intl.ListFormat(code, { type: \"disjunction\" }).format(kinds);\n const line = messages.limits(joined, limitWords(maxMb, code));\n return line.charAt(0).toLocaleUpperCase(code) + line.slice(1);\n}\n\n/** The families a file's glyph tells apart. */\nexport type FileFamily =\n \"image\" | \"pdf\" | \"sheet\" | \"doc\" | \"slides\" | \"text\" | \"archive\" | \"audio\" | \"video\" | \"other\";\n\nconst FAMILIES: Readonly<Record<string, FileFamily>> = {\n png: \"image\",\n jpg: \"image\",\n jpeg: \"image\",\n gif: \"image\",\n webp: \"image\",\n avif: \"image\",\n heic: \"image\",\n heif: \"image\",\n svg: \"image\",\n bmp: \"image\",\n pdf: \"pdf\",\n csv: \"sheet\",\n tsv: \"sheet\",\n xls: \"sheet\",\n xlsx: \"sheet\",\n ods: \"sheet\",\n numbers: \"sheet\",\n doc: \"doc\",\n docx: \"doc\",\n odt: \"doc\",\n rtf: \"doc\",\n pages: \"doc\",\n ppt: \"slides\",\n pptx: \"slides\",\n odp: \"slides\",\n key: \"slides\",\n txt: \"text\",\n md: \"text\",\n markdown: \"text\",\n json: \"text\",\n yaml: \"text\",\n yml: \"text\",\n xml: \"text\",\n html: \"text\",\n log: \"text\",\n zip: \"archive\",\n rar: \"archive\",\n \"7z\": \"archive\",\n tar: \"archive\",\n gz: \"archive\",\n mp3: \"audio\",\n wav: \"audio\",\n m4a: \"audio\",\n ogg: \"audio\",\n mp4: \"video\",\n mov: \"video\",\n webm: \"video\",\n};\n\n/** A file's family, by its name's extension first, then by its type. */\nexport function familyOf(name: string, type: string): FileFamily {\n const known = FAMILIES[extensionOf(name)];\n if (known) return known;\n const media = type.toLowerCase();\n if (media === \"application/pdf\") return \"pdf\";\n const family = media.split(\"/\")[0];\n return family === \"image\" || family === \"audio\" || family === \"video\" || family === \"text\"\n ? family\n : \"other\";\n}\n"],"mappings":";;;AAUA,MAAa,SAAS;AACtB,MAAM,KAAK;;AAoCX,SAAgB,YAAY,MAAsB;CAChD,MAAM,MAAM,KAAK,YAAY,GAAG;CAChC,OAAO,OAAO,IAAI,KAAK,KAAK,MAAM,MAAM,CAAC,CAAC,CAAC,YAAY;AACzD;;AAGA,MAAM,QAA0C;CAC9C,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,MAAM;CACN,MAAM;CACN,KAAK;CACL,KAAK;CACL,IAAI;CACJ,MAAM;CACN,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,KAAK;CACL,MAAM;CACN,KAAK;AACP;;AAGA,SAAgB,OAAO,MAA6C;CAClE,QAAQ,KAAK,QAAQ,MAAM,YAAY,KAAK,IAAI,MAAM,GAAA,CAAI,YAAY;AACxE;;;;;AAMA,SAAgB,QACd,QACA,MACS;CACT,IAAI,WAAW,KAAA,KAAa,OAAO,WAAW,GAAG,OAAO;CACxD,MAAM,OAAO,OAAO,IAAI;CACxB,MAAM,YAAY,YAAY,KAAK,IAAI;CACvC,OAAO,OAAO,MAAM,QA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KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACL,IAAI;CACJ,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,MAAM;AACR;;AAGA,SAAgB,SAAS,MAAc,MAA0B;CAC/D,MAAM,QAAQ,SAAS,YAAY,IAAI;CACvC,IAAI,OAAO,OAAO;CAClB,MAAM,QAAQ,KAAK,YAAY;CAC/B,IAAI,UAAU,mBAAmB,OAAO;CACxC,MAAM,SAAS,MAAM,MAAM,GAAG,CAAC,CAAC;CAChC,OAAO,WAAW,WAAW,WAAW,WAAW,WAAW,WAAW,WAAW,SAChF,SACA;AACN"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
//#region src/kit/waveform.ts
|
|
3
|
+
/** The most a file may weigh to be drawn as its waveform: past it, it draws even. */
|
|
4
|
+
const MOST_BYTES = 8388608;
|
|
5
|
+
const drawn = /* @__PURE__ */ new Map();
|
|
6
|
+
/**
|
|
7
|
+
* An audio's waveform as `bars` heights between 0 and 1 (each stretch's energy, the strongest at
|
|
8
|
+
* 1), and its length. Read once per address and kept; null while it is read, and for audio the
|
|
9
|
+
* browser can't read (or too heavy to), which draws even.
|
|
10
|
+
*/
|
|
11
|
+
function useWaveform(src, bars) {
|
|
12
|
+
const [heights, setHeights] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (src === void 0) return;
|
|
15
|
+
let live = true;
|
|
16
|
+
const key = `${String(bars)} ${src}`;
|
|
17
|
+
let reading = drawn.get(key);
|
|
18
|
+
if (reading === void 0) {
|
|
19
|
+
reading = read(src, bars);
|
|
20
|
+
drawn.set(key, reading);
|
|
21
|
+
}
|
|
22
|
+
reading.then((read) => {
|
|
23
|
+
if (live) setHeights(read);
|
|
24
|
+
});
|
|
25
|
+
return () => {
|
|
26
|
+
live = false;
|
|
27
|
+
};
|
|
28
|
+
}, [src, bars]);
|
|
29
|
+
return heights;
|
|
30
|
+
}
|
|
31
|
+
async function read(src, bars) {
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(src, { credentials: "same-origin" });
|
|
34
|
+
if (!response.ok) return null;
|
|
35
|
+
if (Number(response.headers.get("content-length") ?? 0) > MOST_BYTES) return null;
|
|
36
|
+
const context = new AudioContext();
|
|
37
|
+
try {
|
|
38
|
+
const audio = await context.decodeAudioData(await response.arrayBuffer());
|
|
39
|
+
return {
|
|
40
|
+
heights: energies(audio, bars),
|
|
41
|
+
seconds: audio.duration
|
|
42
|
+
};
|
|
43
|
+
} finally {
|
|
44
|
+
context.close();
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The energy (root mean square) of each of `bars` even stretches, the strongest channel's, scaled
|
|
52
|
+
* so the strongest stretch is 1: speech reads as its syllables and pauses, where the loudest
|
|
53
|
+
* sample of each would stand nearly even.
|
|
54
|
+
*/
|
|
55
|
+
function energies(audio, bars) {
|
|
56
|
+
const channels = Array.from({ length: audio.numberOfChannels }, (_, index) => audio.getChannelData(index));
|
|
57
|
+
const length = channels[0]?.length ?? 0;
|
|
58
|
+
const stretch = Math.max(1, Math.floor(length / bars));
|
|
59
|
+
const found = Array.from({ length: bars }, (_, bar) => {
|
|
60
|
+
const from = bar * stretch;
|
|
61
|
+
const to = Math.min(length, from + stretch);
|
|
62
|
+
let strongest = 0;
|
|
63
|
+
for (const data of channels) {
|
|
64
|
+
let sum = 0;
|
|
65
|
+
for (let at = from; at < to; at += 1) sum += (data[at] ?? 0) ** 2;
|
|
66
|
+
strongest = Math.max(strongest, to > from ? Math.sqrt(sum / (to - from)) : 0);
|
|
67
|
+
}
|
|
68
|
+
return strongest;
|
|
69
|
+
});
|
|
70
|
+
const top = Math.max(...found, 0);
|
|
71
|
+
return top === 0 ? found.map(() => 0) : found.map((value) => value / top);
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { energies, useWaveform };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=waveform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waveform.js","names":[],"sources":["../../src/kit/waveform.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\n/** The most a file may weigh to be drawn as its waveform: past it, it draws even. */\nconst MOST_BYTES = 8 * 1024 * 1024;\n\n/** An audio as drawn: its bars' heights, and how long it is (what an Ogg doesn't say upfront). */\nexport interface Waveform {\n heights: number[];\n seconds: number;\n}\n\nconst drawn = new Map<string, Promise<Waveform | null>>();\n\n/**\n * An audio's waveform as `bars` heights between 0 and 1 (each stretch's energy, the strongest at\n * 1), and its length. Read once per address and kept; null while it is read, and for audio the\n * browser can't read (or too heavy to), which draws even.\n */\nexport function useWaveform(src: string | undefined, bars: number): Waveform | null {\n const [heights, setHeights] = useState<Waveform | null>(null);\n useEffect(() => {\n if (src === undefined) return;\n let live = true;\n const key = `${String(bars)} ${src}`;\n let reading = drawn.get(key);\n if (reading === undefined) {\n reading = read(src, bars);\n drawn.set(key, reading);\n }\n void reading.then((read) => {\n if (live) setHeights(read);\n });\n return () => {\n live = false;\n };\n }, [src, bars]);\n return heights;\n}\n\nasync function read(src: string, bars: number): Promise<Waveform | null> {\n try {\n const response = await fetch(src, { credentials: \"same-origin\" });\n if (!response.ok) return null;\n if (Number(response.headers.get(\"content-length\") ?? 0) > MOST_BYTES) return null;\n const context = new AudioContext();\n try {\n const audio = await context.decodeAudioData(await response.arrayBuffer());\n return { heights: energies(audio, bars), seconds: audio.duration };\n } finally {\n void context.close();\n }\n } catch {\n return null;\n }\n}\n\n/**\n * The energy (root mean square) of each of `bars` even stretches, the strongest channel's, scaled\n * so the strongest stretch is 1: speech reads as its syllables and pauses, where the loudest\n * sample of each would stand nearly even.\n */\nexport function energies(\n audio: Pick<AudioBuffer, \"numberOfChannels\" | \"getChannelData\">,\n bars: number,\n): number[] {\n const channels = Array.from({ length: audio.numberOfChannels }, (_, index) =>\n audio.getChannelData(index),\n );\n const length = channels[0]?.length ?? 0;\n const stretch = Math.max(1, Math.floor(length / bars));\n const found = Array.from({ length: bars }, (_, bar) => {\n const from = bar * stretch;\n const to = Math.min(length, from + stretch);\n let strongest = 0;\n for (const data of channels) {\n let sum = 0;\n for (let at = from; at < to; at += 1) sum += (data[at] ?? 0) ** 2;\n strongest = Math.max(strongest, to > from ? Math.sqrt(sum / (to - from)) : 0);\n }\n return strongest;\n });\n const top = Math.max(...found, 0);\n return top === 0 ? found.map(() => 0) : found.map((value) => value / top);\n}\n"],"mappings":";;;AAGA,MAAM,aAAa;AAQnB,MAAM,wBAAQ,IAAI,IAAsC;;;;;;AAOxD,SAAgB,YAAY,KAAyB,MAA+B;CAClF,MAAM,CAAC,SAAS,cAAc,SAA0B,IAAI;CAC5D,gBAAgB;EACd,IAAI,QAAQ,KAAA,GAAW;EACvB,IAAI,OAAO;EACX,MAAM,MAAM,GAAG,OAAO,IAAI,EAAE,GAAG;EAC/B,IAAI,UAAU,MAAM,IAAI,GAAG;EAC3B,IAAI,YAAY,KAAA,GAAW;GACzB,UAAU,KAAK,KAAK,IAAI;GACxB,MAAM,IAAI,KAAK,OAAO;EACxB;EACA,QAAa,MAAM,SAAS;GAC1B,IAAI,MAAM,WAAW,IAAI;EAC3B,CAAC;EACD,aAAa;GACX,OAAO;EACT;CACF,GAAG,CAAC,KAAK,IAAI,CAAC;CACd,OAAO;AACT;AAEA,eAAe,KAAK,KAAa,MAAwC;CACvE,IAAI;EACF,MAAM,WAAW,MAAM,MAAM,KAAK,EAAE,aAAa,cAAc,CAAC;EAChE,IAAI,CAAC,SAAS,IAAI,OAAO;EACzB,IAAI,OAAO,SAAS,QAAQ,IAAI,gBAAgB,KAAK,CAAC,IAAI,YAAY,OAAO;EAC7E,MAAM,UAAU,IAAI,aAAa;EACjC,IAAI;GACF,MAAM,QAAQ,MAAM,QAAQ,gBAAgB,MAAM,SAAS,YAAY,CAAC;GACxE,OAAO;IAAE,SAAS,SAAS,OAAO,IAAI;IAAG,SAAS,MAAM;GAAS;EACnE,UAAU;GACR,QAAa,MAAM;EACrB;CACF,QAAQ;EACN,OAAO;CACT;AACF;;;;;;AAOA,SAAgB,SACd,OACA,MACU;CACV,MAAM,WAAW,MAAM,KAAK,EAAE,QAAQ,MAAM,iBAAiB,IAAI,GAAG,UAClE,MAAM,eAAe,KAAK,CAC5B;CACA,MAAM,SAAS,SAAS,EAAE,EAAE,UAAU;CACtC,MAAM,UAAU,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,IAAI,CAAC;CACrD,MAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,QAAQ;EACrD,MAAM,OAAO,MAAM;EACnB,MAAM,KAAK,KAAK,IAAI,QAAQ,OAAO,OAAO;EAC1C,IAAI,YAAY;EAChB,KAAK,MAAM,QAAQ,UAAU;GAC3B,IAAI,MAAM;GACV,KAAK,IAAI,KAAK,MAAM,KAAK,IAAI,MAAM,GAAG,QAAQ,KAAK,OAAO,MAAM;GAChE,YAAY,KAAK,IAAI,WAAW,KAAK,OAAO,KAAK,KAAK,OAAO,KAAK,KAAK,IAAI,CAAC;EAC9E;EACA,OAAO;CACT,CAAC;CACD,MAAM,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC;CAChC,OAAO,QAAQ,IAAI,MAAM,UAAU,CAAC,IAAI,MAAM,KAAK,UAAU,QAAQ,GAAG;AAC1E"}
|
package/dist/locale.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "react-day-picker/locale";
|
package/dist/locale.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "react-day-picker/locale";
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//#region src/markdown.ts
|
|
2
|
+
/** `# Title`, up to six marks, a space, the words (closing marks dropped). */
|
|
3
|
+
const HEADING = /^ {0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/;
|
|
4
|
+
const ITEM = /^\s*[-*]\s+(.*)$/;
|
|
5
|
+
const INLINE = /`([^`]+)`|\*\*([^*]+)\*\*|\*([^*]+)\*|\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
6
|
+
const SAFE_HREF = /^(https?:|mailto:)/i;
|
|
7
|
+
function parse(markdown) {
|
|
8
|
+
const nodes = [];
|
|
9
|
+
let lines = [];
|
|
10
|
+
const paragraph = () => {
|
|
11
|
+
if (lines.length > 0) nodes.push({
|
|
12
|
+
kind: "paragraph",
|
|
13
|
+
inline: inline(lines.join("\n"))
|
|
14
|
+
});
|
|
15
|
+
lines = [];
|
|
16
|
+
};
|
|
17
|
+
for (const line of markdown.split("\n")) {
|
|
18
|
+
const heading = HEADING.exec(line);
|
|
19
|
+
const item = ITEM.exec(line);
|
|
20
|
+
if (heading) {
|
|
21
|
+
paragraph();
|
|
22
|
+
const [, marks = "#", text = ""] = heading;
|
|
23
|
+
nodes.push({
|
|
24
|
+
kind: "heading",
|
|
25
|
+
level: marks.length,
|
|
26
|
+
inline: inline(text)
|
|
27
|
+
});
|
|
28
|
+
} else if (item) {
|
|
29
|
+
paragraph();
|
|
30
|
+
const last = nodes.at(-1);
|
|
31
|
+
const text = inline(item[1] ?? "");
|
|
32
|
+
if (last?.kind === "list") last.items.push(text);
|
|
33
|
+
else nodes.push({
|
|
34
|
+
kind: "list",
|
|
35
|
+
items: [text]
|
|
36
|
+
});
|
|
37
|
+
} else if (line.trim() === "") paragraph();
|
|
38
|
+
else lines.push(line.trim());
|
|
39
|
+
}
|
|
40
|
+
paragraph();
|
|
41
|
+
return nodes;
|
|
42
|
+
}
|
|
43
|
+
function inline(text) {
|
|
44
|
+
const out = [];
|
|
45
|
+
let at = 0;
|
|
46
|
+
for (const match of text.matchAll(INLINE)) {
|
|
47
|
+
if (match.index > at) out.push({
|
|
48
|
+
kind: "text",
|
|
49
|
+
text: text.slice(at, match.index)
|
|
50
|
+
});
|
|
51
|
+
const [whole, code, strong, em, label, href] = match;
|
|
52
|
+
if (code !== void 0) out.push({
|
|
53
|
+
kind: "code",
|
|
54
|
+
text: code
|
|
55
|
+
});
|
|
56
|
+
else if (strong !== void 0) out.push({
|
|
57
|
+
kind: "strong",
|
|
58
|
+
text: strong
|
|
59
|
+
});
|
|
60
|
+
else if (em !== void 0) out.push({
|
|
61
|
+
kind: "em",
|
|
62
|
+
text: em
|
|
63
|
+
});
|
|
64
|
+
else if (label !== void 0 && href !== void 0 && SAFE_HREF.test(href)) out.push({
|
|
65
|
+
kind: "link",
|
|
66
|
+
text: label,
|
|
67
|
+
href
|
|
68
|
+
});
|
|
69
|
+
else out.push({
|
|
70
|
+
kind: "text",
|
|
71
|
+
text: whole
|
|
72
|
+
});
|
|
73
|
+
at = match.index + whole.length;
|
|
74
|
+
}
|
|
75
|
+
if (at < text.length) out.push({
|
|
76
|
+
kind: "text",
|
|
77
|
+
text: text.slice(at)
|
|
78
|
+
});
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
export { inline, parse };
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","names":[],"sources":["../src/markdown.ts"],"sourcesContent":["/**\n * The little Markdown an agent's words use, read into a tree the renderer draws: headings,\n * paragraphs and bullet lists, with bold, italic, code and links inside. No library: this is all\n * a surface's text (and a file of notes) needs, and what it cannot read it shows as written.\n */\n\nexport type Inline =\n | { kind: \"text\" | \"strong\" | \"em\" | \"code\"; text: string }\n | { kind: \"link\"; text: string; href: string };\n\nexport type Node =\n | { kind: \"heading\"; level: number; inline: Inline[] }\n | { kind: \"paragraph\"; inline: Inline[] }\n | { kind: \"list\"; items: Inline[][] };\n\n/** `# Title`, up to six marks, a space, the words (closing marks dropped). */\nconst HEADING = /^ {0,3}(#{1,6})\\s+(.*?)(?:\\s+#+)?\\s*$/;\nconst ITEM = /^\\s*[-*]\\s+(.*)$/;\nconst INLINE = /`([^`]+)`|\\*\\*([^*]+)\\*\\*|\\*([^*]+)\\*|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)/g;\n// The words are the agent's, not the host's: a link may open a page, never run anything.\nconst SAFE_HREF = /^(https?:|mailto:)/i;\n\nexport function parse(markdown: string): Node[] {\n const nodes: Node[] = [];\n let lines: string[] = [];\n const paragraph = () => {\n if (lines.length > 0) nodes.push({ kind: \"paragraph\", inline: inline(lines.join(\"\\n\")) });\n lines = [];\n };\n for (const line of markdown.split(\"\\n\")) {\n const heading = HEADING.exec(line);\n const item = ITEM.exec(line);\n if (heading) {\n paragraph();\n const [, marks = \"#\", text = \"\"] = heading;\n nodes.push({ kind: \"heading\", level: marks.length, inline: inline(text) });\n } else if (item) {\n paragraph();\n const last = nodes.at(-1);\n const text = inline(item[1] ?? \"\");\n if (last?.kind === \"list\") last.items.push(text);\n else nodes.push({ kind: \"list\", items: [text] });\n } else if (line.trim() === \"\") {\n paragraph();\n } else {\n lines.push(line.trim());\n }\n }\n paragraph();\n return nodes;\n}\n\nexport function inline(text: string): Inline[] {\n const out: Inline[] = [];\n let at = 0;\n for (const match of text.matchAll(INLINE)) {\n if (match.index > at) out.push({ kind: \"text\", text: text.slice(at, match.index) });\n const [whole, code, strong, em, label, href] = match;\n if (code !== undefined) out.push({ kind: \"code\", text: code });\n else if (strong !== undefined) out.push({ kind: \"strong\", text: strong });\n else if (em !== undefined) out.push({ kind: \"em\", text: em });\n else if (label !== undefined && href !== undefined && SAFE_HREF.test(href)) {\n out.push({ kind: \"link\", text: label, href });\n } else out.push({ kind: \"text\", text: whole });\n at = match.index + whole.length;\n }\n if (at < text.length) out.push({ kind: \"text\", text: text.slice(at) });\n return out;\n}\n"],"mappings":";;AAgBA,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,SAAS;AAEf,MAAM,YAAY;AAElB,SAAgB,MAAM,UAA0B;CAC9C,MAAM,QAAgB,CAAC;CACvB,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U,MAAM;EAAO,CAAC;OACnE,IAAI,OAAO,KAAA,GAAW,IAAI,KAAK;GAAE,MAAM;GAAM,MAAM;EAAG,CAAC;OACvD,IAAI,UAAU,KAAA,KAAa,SAAS,KAAA,KAAa,UAAU,KAAK,IAAI,GACvE,IAAI,KAAK;GAAE,MAAM;GAAQ,MAAM;GAAO;EAAK,CAAC;OACvC,IAAI,KAAK;GAAE,MAAM;GAAQ,MAAM;EAAM,CAAC;EAC7C,KAAK,MAAM,QAAQ,MAAM;CAC3B;CACA,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK;EAAE,MAAM;EAAQ,MAAM,KAAK,MAAM,EAAE;CAAE,CAAC;CACrE,OAAO;AACT"}
|
package/dist/marks.js
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/marks.tsx
|
|
3
|
+
/**
|
|
4
|
+
* The marks Qué puede draws, each a 16-unit stroke glyph in `currentColor`: the icons a generated
|
|
5
|
+
* line may carry, the shipped actions' marks, the kinds of automation, and the simplest faithful
|
|
6
|
+
* glyph of each app, channel and device. No icon library: a host reads nothing but this package.
|
|
7
|
+
*/
|
|
8
|
+
const STROKE = {
|
|
9
|
+
fill: "none",
|
|
10
|
+
stroke: "currentColor",
|
|
11
|
+
strokeWidth: 1.5,
|
|
12
|
+
strokeLinecap: "round",
|
|
13
|
+
strokeLinejoin: "round"
|
|
14
|
+
};
|
|
15
|
+
/** One glyph: the paths inside the shared frame. */
|
|
16
|
+
function Glyph({ children, brand }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
18
|
+
viewBox: "0 0 16 16",
|
|
19
|
+
"aria-hidden": true,
|
|
20
|
+
"data-brand": brand,
|
|
21
|
+
...STROKE,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const message = /* @__PURE__ */ jsx("path", { d: "M3 3h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H7.6l-3.1 2.6V11H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" });
|
|
26
|
+
const phone = /* @__PURE__ */ jsx("path", { d: "M4.3 2.5h2l1.1 2.9-1.5 1a7.3 7.3 0 0 0 3.7 3.7l1-1.5 2.9 1.1v2a1.2 1.2 0 0 1-1.3 1.2A10.5 10.5 0 0 1 3.1 3.8a1.2 1.2 0 0 1 1.2-1.3z" });
|
|
27
|
+
const mail = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
|
|
28
|
+
x: "2.5",
|
|
29
|
+
y: "3.5",
|
|
30
|
+
width: "11",
|
|
31
|
+
height: "9",
|
|
32
|
+
rx: "1.5"
|
|
33
|
+
}), /* @__PURE__ */ jsx("path", { d: "m2.5 5.5 5.5 3.7 5.5-3.7" })] });
|
|
34
|
+
const search = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
|
|
35
|
+
cx: "7",
|
|
36
|
+
cy: "7",
|
|
37
|
+
r: "4.25"
|
|
38
|
+
}), /* @__PURE__ */ jsx("path", { d: "m10.2 10.2 3.3 3.3" })] });
|
|
39
|
+
const bell = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M4 11V7.5a4 4 0 0 1 8 0V11l1 1.5H3z" }), /* @__PURE__ */ jsx("path", { d: "M6.5 13.5a1.5 1.5 0 0 0 3 0" })] });
|
|
40
|
+
const hand = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M5.5 8.2V4.5a1 1 0 0 1 2 0v3M7.5 7.5v-4a1 1 0 0 1 2 0v4M9.5 7.5V4.5a1 1 0 0 1 2 0v4.6" }), /* @__PURE__ */ jsx("path", { d: "M5.5 8.2 4.4 7a1 1 0 0 0-1.6 1.2L5 11.6a3.6 3.6 0 0 0 3.1 1.9H9a2.5 2.5 0 0 0 2.5-2.5V9.1" })] });
|
|
41
|
+
const globe = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
|
|
42
|
+
cx: "8",
|
|
43
|
+
cy: "8",
|
|
44
|
+
r: "5.75"
|
|
45
|
+
}), /* @__PURE__ */ jsx("path", { d: "M2.25 8h11.5M8 2.25c2 2.1 2 9.4 0 11.5M8 2.25c-2 2.1-2 9.4 0 11.5" })] });
|
|
46
|
+
const code = /* @__PURE__ */ jsx("path", { d: "m5.5 5-3 3 3 3M10.5 5l3 3-3 3M9.3 3.5 6.7 12.5" });
|
|
47
|
+
const pane = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("rect", {
|
|
48
|
+
x: "2.5",
|
|
49
|
+
y: "3",
|
|
50
|
+
width: "11",
|
|
51
|
+
height: "10",
|
|
52
|
+
rx: "1.5"
|
|
53
|
+
}), /* @__PURE__ */ jsx("path", { d: "M2.5 6h11" })] });
|
|
54
|
+
const brain = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M7.5 2.75a2.4 2.4 0 0 0-3.3 2.6 2.4 2.4 0 0 0-.4 4.4A2.4 2.4 0 0 0 7.5 13.3z" }), /* @__PURE__ */ jsx("path", { d: "M8.5 2.75a2.4 2.4 0 0 1 3.3 2.6 2.4 2.4 0 0 1 .4 4.4 2.4 2.4 0 0 1-3.7 3.55z" })] });
|
|
55
|
+
const book = /* @__PURE__ */ jsx("path", { d: "M2.5 3.5H7a1 1 0 0 1 1 1v9a1 1 0 0 0-1-1H2.5zM13.5 3.5H9a1 1 0 0 0-1 1v9a1 1 0 0 1 1-1h4.5z" });
|
|
56
|
+
const bolt = /* @__PURE__ */ jsx("path", { d: "M9 2 3.5 9h4L7 14l5.5-7h-4z" });
|
|
57
|
+
/** The shipped actions' marks, by name; an own action is code, one this package does not know a bolt. */
|
|
58
|
+
const ACTIONS = {
|
|
59
|
+
show: pane,
|
|
60
|
+
ask_person: message,
|
|
61
|
+
escalate: hand,
|
|
62
|
+
notify: bell,
|
|
63
|
+
remember: brain,
|
|
64
|
+
recall: brain,
|
|
65
|
+
search_files: search,
|
|
66
|
+
load_skill: book,
|
|
67
|
+
browser_open: globe,
|
|
68
|
+
browser_read: globe,
|
|
69
|
+
browser_click: globe,
|
|
70
|
+
browser_fill: globe,
|
|
71
|
+
browser_scroll: globe,
|
|
72
|
+
browser_back: globe,
|
|
73
|
+
browser_submit: globe,
|
|
74
|
+
browser_hand_over: hand
|
|
75
|
+
};
|
|
76
|
+
const actionMark = (name, source) => /* @__PURE__ */ jsx(Glyph, { children: source === "own" ? code : ACTIONS[name] ?? bolt });
|
|
77
|
+
/** A letter alone: the simplest monogram of an app. */
|
|
78
|
+
function Monogram({ letter }) {
|
|
79
|
+
return /* @__PURE__ */ jsx("text", {
|
|
80
|
+
x: "8",
|
|
81
|
+
y: "12.25",
|
|
82
|
+
textAnchor: "middle",
|
|
83
|
+
fontSize: "12.5",
|
|
84
|
+
fontWeight: "500",
|
|
85
|
+
fontFamily: "inherit",
|
|
86
|
+
fill: "currentColor",
|
|
87
|
+
stroke: "none",
|
|
88
|
+
children: letter
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const PROVIDERS = {
|
|
92
|
+
arcade: /* @__PURE__ */ jsx(Monogram, { letter: "A" }),
|
|
93
|
+
composio: /* @__PURE__ */ jsx(Monogram, { letter: "C" }),
|
|
94
|
+
mcp: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M8 1.75 13.4 4.9v6.2L8 14.25 2.6 11.1V4.9z" }), /* @__PURE__ */ jsx("circle", {
|
|
95
|
+
cx: "8",
|
|
96
|
+
cy: "8",
|
|
97
|
+
r: "1.4",
|
|
98
|
+
fill: "currentColor",
|
|
99
|
+
stroke: "none"
|
|
100
|
+
})] }),
|
|
101
|
+
api: /* @__PURE__ */ jsx("path", { d: "M6 2.5c-1.5 0-2 .6-2 2v1.8c0 1-.5 1.7-1.5 1.7 1 0 1.5.7 1.5 1.7v1.8c0 1.4.5 2 2 2M10 2.5c1.5 0 2 .6 2 2v1.8c0 1 .5 1.7 1.5 1.7-1 0-1.5.7-1.5 1.7v1.8c0 1.4-.5 2-2 2" })
|
|
102
|
+
};
|
|
103
|
+
/** An app's mark: its own, when the provider gives a URL; the provider's glyph otherwise. */
|
|
104
|
+
const providerMark = (provider, icon) => icon === void 0 ? /* @__PURE__ */ jsx(Glyph, { children: PROVIDERS[provider] }) : /* @__PURE__ */ jsx("img", {
|
|
105
|
+
src: icon,
|
|
106
|
+
alt: ""
|
|
107
|
+
});
|
|
108
|
+
const CHANNELS = {
|
|
109
|
+
whatsapp: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M8 2.25A5.75 5.75 0 0 0 3.1 11L2.3 13.7l2.8-.75A5.75 5.75 0 1 0 8 2.25z" }), /* @__PURE__ */ jsx("path", {
|
|
110
|
+
d: "M6.2 5.3c.2-.3.5-.3.7-.3l.5 1.2c.1.2 0 .4-.1.5l-.4.4c.4.9 1.1 1.6 2 2l.4-.4c.1-.1.3-.2.5-.1l1.2.5c0 .2 0 .5-.3.7-.5.3-1.2.4-2.5-.5C6.9 8.4 6.3 7.3 6 6.1c-.1-.3 0-.6.2-.8z",
|
|
111
|
+
fill: "currentColor",
|
|
112
|
+
stroke: "none"
|
|
113
|
+
})] }),
|
|
114
|
+
instagram: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
115
|
+
/* @__PURE__ */ jsx("rect", {
|
|
116
|
+
x: "2.5",
|
|
117
|
+
y: "2.5",
|
|
118
|
+
width: "11",
|
|
119
|
+
height: "11",
|
|
120
|
+
rx: "3"
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsx("circle", {
|
|
123
|
+
cx: "8",
|
|
124
|
+
cy: "8",
|
|
125
|
+
r: "2.6"
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ jsx("circle", {
|
|
128
|
+
cx: "11.2",
|
|
129
|
+
cy: "4.8",
|
|
130
|
+
r: ".7",
|
|
131
|
+
fill: "currentColor",
|
|
132
|
+
stroke: "none"
|
|
133
|
+
})
|
|
134
|
+
] }),
|
|
135
|
+
email: mail,
|
|
136
|
+
sms: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
137
|
+
message,
|
|
138
|
+
/* @__PURE__ */ jsx("circle", {
|
|
139
|
+
cx: "5.5",
|
|
140
|
+
cy: "7",
|
|
141
|
+
r: ".7",
|
|
142
|
+
fill: "currentColor",
|
|
143
|
+
stroke: "none"
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsx("circle", {
|
|
146
|
+
cx: "8",
|
|
147
|
+
cy: "7",
|
|
148
|
+
r: ".7",
|
|
149
|
+
fill: "currentColor",
|
|
150
|
+
stroke: "none"
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ jsx("circle", {
|
|
153
|
+
cx: "10.5",
|
|
154
|
+
cy: "7",
|
|
155
|
+
r: ".7",
|
|
156
|
+
fill: "currentColor",
|
|
157
|
+
stroke: "none"
|
|
158
|
+
})
|
|
159
|
+
] }),
|
|
160
|
+
web: globe,
|
|
161
|
+
phone
|
|
162
|
+
};
|
|
163
|
+
/** A channel's glyph, carrying its brand for the stylesheet's tint. */
|
|
164
|
+
const channelMark = (kind) => /* @__PURE__ */ jsx(Glyph, {
|
|
165
|
+
brand: kind,
|
|
166
|
+
children: CHANNELS[kind]
|
|
167
|
+
});
|
|
168
|
+
const DEVICES = {
|
|
169
|
+
extension: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
170
|
+
/* @__PURE__ */ jsx("circle", {
|
|
171
|
+
cx: "8",
|
|
172
|
+
cy: "8",
|
|
173
|
+
r: "5.75"
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ jsx("circle", {
|
|
176
|
+
cx: "8",
|
|
177
|
+
cy: "8",
|
|
178
|
+
r: "2.25"
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ jsx("path", { d: "M8 5.75h5.5M6.05 9.1 3.3 4.4M9.95 9.1l-2.7 4.6" })
|
|
181
|
+
] }),
|
|
182
|
+
installer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
183
|
+
/* @__PURE__ */ jsx("rect", {
|
|
184
|
+
x: "2.5",
|
|
185
|
+
y: "2.5",
|
|
186
|
+
width: "4.75",
|
|
187
|
+
height: "4.75",
|
|
188
|
+
rx: "1"
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ jsx("rect", {
|
|
191
|
+
x: "8.75",
|
|
192
|
+
y: "2.5",
|
|
193
|
+
width: "4.75",
|
|
194
|
+
height: "4.75",
|
|
195
|
+
rx: "1"
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ jsx("rect", {
|
|
198
|
+
x: "2.5",
|
|
199
|
+
y: "8.75",
|
|
200
|
+
width: "4.75",
|
|
201
|
+
height: "4.75",
|
|
202
|
+
rx: "1"
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ jsx("rect", {
|
|
205
|
+
x: "8.75",
|
|
206
|
+
y: "8.75",
|
|
207
|
+
width: "4.75",
|
|
208
|
+
height: "4.75",
|
|
209
|
+
rx: "1"
|
|
210
|
+
})
|
|
211
|
+
] })
|
|
212
|
+
};
|
|
213
|
+
const deviceMark = (kind) => /* @__PURE__ */ jsx(Glyph, { children: DEVICES[kind] });
|
|
214
|
+
//#endregion
|
|
215
|
+
export { actionMark, channelMark, deviceMark, providerMark };
|
|
216
|
+
|
|
217
|
+
//# sourceMappingURL=marks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marks.js","names":[],"sources":["../src/marks.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type {\n ActionSource,\n AutomationKind,\n ChannelKind,\n DeviceKind,\n Icon,\n Provider,\n} from \"./about\";\n\n/**\n * The marks Qué puede draws, each a 16-unit stroke glyph in `currentColor`: the icons a generated\n * line may carry, the shipped actions' marks, the kinds of automation, and the simplest faithful\n * glyph of each app, channel and device. No icon library: a host reads nothing but this package.\n */\n\nconst STROKE = {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 1.5,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n} as const;\n\ninterface GlyphProps {\n /** A brand's own tint, set by the stylesheet on the mark alone. */\n brand?: ChannelKind | undefined;\n}\n\n/** One glyph: the paths inside the shared frame. */\nfunction Glyph({ children, brand }: GlyphProps & { children: ReactNode }) {\n return (\n <svg viewBox=\"0 0 16 16\" aria-hidden data-brand={brand} {...STROKE}>\n {children}\n </svg>\n );\n}\n\nconst message = (\n <path d=\"M3 3h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H7.6l-3.1 2.6V11H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\" />\n);\nconst phone = (\n <path d=\"M4.3 2.5h2l1.1 2.9-1.5 1a7.3 7.3 0 0 0 3.7 3.7l1-1.5 2.9 1.1v2a1.2 1.2 0 0 1-1.3 1.2A10.5 10.5 0 0 1 3.1 3.8a1.2 1.2 0 0 1 1.2-1.3z\" />\n);\nconst mail = (\n <>\n <rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"9\" rx=\"1.5\" />\n <path d=\"m2.5 5.5 5.5 3.7 5.5-3.7\" />\n </>\n);\nconst calendar = (\n <>\n <rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"10\" rx=\"1.5\" />\n <path d=\"M2.5 7h11M5.5 2v3M10.5 2v3\" />\n </>\n);\nconst clock = (\n <>\n <circle cx=\"8\" cy=\"8\" r=\"5.75\" />\n <path d=\"M8 4.75V8l2.2 1.4\" />\n </>\n);\nconst search = (\n <>\n <circle cx=\"7\" cy=\"7\" r=\"4.25\" />\n <path d=\"m10.2 10.2 3.3 3.3\" />\n </>\n);\nconst file = (\n <>\n <path d=\"M4 2.5h5l3.5 3.5v7.5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1z\" />\n <path d=\"M9 2.5V6h3.5\" />\n </>\n);\nconst table = (\n <>\n <rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" />\n <path d=\"M2.5 6.5h11M6.5 6.5V13\" />\n </>\n);\nconst bell = (\n <>\n <path d=\"M4 11V7.5a4 4 0 0 1 8 0V11l1 1.5H3z\" />\n <path d=\"M6.5 13.5a1.5 1.5 0 0 0 3 0\" />\n </>\n);\nconst hand = (\n <>\n <path d=\"M5.5 8.2V4.5a1 1 0 0 1 2 0v3M7.5 7.5v-4a1 1 0 0 1 2 0v4M9.5 7.5V4.5a1 1 0 0 1 2 0v4.6\" />\n <path d=\"M5.5 8.2 4.4 7a1 1 0 0 0-1.6 1.2L5 11.6a3.6 3.6 0 0 0 3.1 1.9H9a2.5 2.5 0 0 0 2.5-2.5V9.1\" />\n </>\n);\nconst user = (\n <>\n <circle cx=\"8\" cy=\"5.5\" r=\"2.75\" />\n <path d=\"M3 13.5a5 5 0 0 1 10 0\" />\n </>\n);\nconst globe = (\n <>\n <circle cx=\"8\" cy=\"8\" r=\"5.75\" />\n <path d=\"M2.25 8h11.5M8 2.25c2 2.1 2 9.4 0 11.5M8 2.25c-2 2.1-2 9.4 0 11.5\" />\n </>\n);\nconst code = <path d=\"m5.5 5-3 3 3 3M10.5 5l3 3-3 3M9.3 3.5 6.7 12.5\" />;\nconst lock = (\n <>\n <rect x=\"3.5\" y=\"7\" width=\"9\" height=\"6.5\" rx=\"1.5\" />\n <path d=\"M5.5 7V5a2.5 2.5 0 0 1 5 0v2\" />\n </>\n);\nconst cart = (\n <>\n <path d=\"M2 3h1.8l1.4 7h7.3l1.3-5H4.4\" />\n <circle cx=\"6\" cy=\"12.8\" r=\".9\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"11.5\" cy=\"12.8\" r=\".9\" fill=\"currentColor\" stroke=\"none\" />\n </>\n);\nconst card = (\n <>\n <rect x=\"2\" y=\"3.5\" width=\"12\" height=\"9\" rx=\"1.5\" />\n <path d=\"M2 6.5h12M4.5 10h3\" />\n </>\n);\nconst map = (\n <>\n <path d=\"m2.5 4.5 3.5-1.5 4 1.5 3.5-1.5v9l-3.5 1.5-4-1.5-3.5 1.5z\" />\n <path d=\"M6 3v9M10 4.5v9\" />\n </>\n);\nconst check = <path d=\"m3.5 8.5 3 3 6-7\" />;\nconst warning = (\n <>\n <path d=\"M8 2.5 14 13H2z\" />\n <path d=\"M8 6.5v3\" />\n <circle cx=\"8\" cy=\"11.3\" r=\".8\" fill=\"currentColor\" stroke=\"none\" />\n </>\n);\nconst sparkle = (\n <>\n <path d=\"M7 2.5c.4 2.9 1.5 4 4.4 4.4-2.9.4-4 1.5-4.4 4.4-.4-2.9-1.5-4-4.4-4.4C5.5 6.5 6.6 5.4 7 2.5z\" />\n <path d=\"M12.3 10.5c.2 1 .5 1.3 1.5 1.5-1 .2-1.3.5-1.5 1.5-.2-1-.5-1.3-1.5-1.5 1-.2 1.3-.5 1.5-1.5z\" />\n </>\n);\n\nconst ICONS: Readonly<Record<Icon, ReactNode>> = {\n message,\n phone,\n mail,\n calendar,\n clock,\n search,\n file,\n table,\n bell,\n hand,\n user,\n globe,\n code,\n lock,\n cart,\n card,\n map,\n check,\n warning,\n sparkle,\n};\n\n/** The mark of a generated line. */\nexport const iconOf = (icon: Icon): ReactNode => <Glyph>{ICONS[icon]}</Glyph>;\n\nconst pane = (\n <>\n <rect x=\"2.5\" y=\"3\" width=\"11\" height=\"10\" rx=\"1.5\" />\n <path d=\"M2.5 6h11\" />\n </>\n);\nconst brain = (\n <>\n <path d=\"M7.5 2.75a2.4 2.4 0 0 0-3.3 2.6 2.4 2.4 0 0 0-.4 4.4A2.4 2.4 0 0 0 7.5 13.3z\" />\n <path d=\"M8.5 2.75a2.4 2.4 0 0 1 3.3 2.6 2.4 2.4 0 0 1 .4 4.4 2.4 2.4 0 0 1-3.7 3.55z\" />\n </>\n);\nconst book = (\n <path d=\"M2.5 3.5H7a1 1 0 0 1 1 1v9a1 1 0 0 0-1-1H2.5zM13.5 3.5H9a1 1 0 0 0-1 1v9a1 1 0 0 1 1-1h4.5z\" />\n);\nconst bolt = <path d=\"M9 2 3.5 9h4L7 14l5.5-7h-4z\" />;\n\n/** The shipped actions' marks, by name; an own action is code, one this package does not know a bolt. */\nconst ACTIONS: Readonly<Record<string, ReactNode>> = {\n show: pane,\n ask_person: message,\n escalate: hand,\n notify: bell,\n remember: brain,\n recall: brain,\n search_files: search,\n load_skill: book,\n browser_open: globe,\n browser_read: globe,\n browser_click: globe,\n browser_fill: globe,\n browser_scroll: globe,\n browser_back: globe,\n browser_submit: globe,\n browser_hand_over: hand,\n};\n\nexport const actionMark = (name: string, source: ActionSource): ReactNode => (\n <Glyph>{source === \"own\" ? code : (ACTIONS[name] ?? bolt)}</Glyph>\n);\n\nconst hook = (\n <>\n <path d=\"M2.5 8h7M7 5.5 9.5 8 7 10.5\" />\n <path d=\"M11 3.5h1.5a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H11\" />\n </>\n);\n\nconst AUTOMATIONS: Readonly<Record<AutomationKind, ReactNode>> = {\n schedule: clock,\n webhook: hook,\n event: bolt,\n};\n\nexport const automationMark = (kind: AutomationKind): ReactNode => (\n <Glyph>{AUTOMATIONS[kind]}</Glyph>\n);\n\n/** A letter alone: the simplest monogram of an app. */\nfunction Monogram({ letter }: { letter: string }) {\n return (\n <text\n x=\"8\"\n y=\"12.25\"\n textAnchor=\"middle\"\n fontSize=\"12.5\"\n fontWeight=\"500\"\n fontFamily=\"inherit\"\n fill=\"currentColor\"\n stroke=\"none\"\n >\n {letter}\n </text>\n );\n}\n\nconst hexagon = (\n <>\n <path d=\"M8 1.75 13.4 4.9v6.2L8 14.25 2.6 11.1V4.9z\" />\n <circle cx=\"8\" cy=\"8\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\" />\n </>\n);\nconst braces = (\n <path d=\"M6 2.5c-1.5 0-2 .6-2 2v1.8c0 1-.5 1.7-1.5 1.7 1 0 1.5.7 1.5 1.7v1.8c0 1.4.5 2 2 2M10 2.5c1.5 0 2 .6 2 2v1.8c0 1 .5 1.7 1.5 1.7-1 0-1.5.7-1.5 1.7v1.8c0 1.4-.5 2-2 2\" />\n);\n\nconst PROVIDERS: Readonly<Record<Provider, ReactNode>> = {\n arcade: <Monogram letter=\"A\" />,\n composio: <Monogram letter=\"C\" />,\n mcp: hexagon,\n api: braces,\n};\n\n/** An app's mark: its own, when the provider gives a URL; the provider's glyph otherwise. */\nexport const providerMark = (provider: Provider, icon: string | undefined): ReactNode =>\n icon === undefined ? <Glyph>{PROVIDERS[provider]}</Glyph> : <img src={icon} alt=\"\" />;\n\nconst whatsapp = (\n <>\n <path d=\"M8 2.25A5.75 5.75 0 0 0 3.1 11L2.3 13.7l2.8-.75A5.75 5.75 0 1 0 8 2.25z\" />\n <path\n d=\"M6.2 5.3c.2-.3.5-.3.7-.3l.5 1.2c.1.2 0 .4-.1.5l-.4.4c.4.9 1.1 1.6 2 2l.4-.4c.1-.1.3-.2.5-.1l1.2.5c0 .2 0 .5-.3.7-.5.3-1.2.4-2.5-.5C6.9 8.4 6.3 7.3 6 6.1c-.1-.3 0-.6.2-.8z\"\n fill=\"currentColor\"\n stroke=\"none\"\n />\n </>\n);\nconst instagram = (\n <>\n <rect x=\"2.5\" y=\"2.5\" width=\"11\" height=\"11\" rx=\"3\" />\n <circle cx=\"8\" cy=\"8\" r=\"2.6\" />\n <circle cx=\"11.2\" cy=\"4.8\" r=\".7\" fill=\"currentColor\" stroke=\"none\" />\n </>\n);\nconst sms = (\n <>\n {message}\n <circle cx=\"5.5\" cy=\"7\" r=\".7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"8\" cy=\"7\" r=\".7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"10.5\" cy=\"7\" r=\".7\" fill=\"currentColor\" stroke=\"none\" />\n </>\n);\n\nconst CHANNELS: Readonly<Record<ChannelKind, ReactNode>> = {\n whatsapp,\n instagram,\n email: mail,\n sms,\n web: globe,\n phone,\n};\n\n/** A channel's glyph, carrying its brand for the stylesheet's tint. */\nexport const channelMark = (kind: ChannelKind): ReactNode => (\n <Glyph brand={kind}>{CHANNELS[kind]}</Glyph>\n);\n\nconst chrome = (\n <>\n <circle cx=\"8\" cy=\"8\" r=\"5.75\" />\n <circle cx=\"8\" cy=\"8\" r=\"2.25\" />\n <path d=\"M8 5.75h5.5M6.05 9.1 3.3 4.4M9.95 9.1l-2.7 4.6\" />\n </>\n);\nconst panes = (\n <>\n <rect x=\"2.5\" y=\"2.5\" width=\"4.75\" height=\"4.75\" rx=\"1\" />\n <rect x=\"8.75\" y=\"2.5\" width=\"4.75\" height=\"4.75\" rx=\"1\" />\n <rect x=\"2.5\" y=\"8.75\" width=\"4.75\" height=\"4.75\" rx=\"1\" />\n <rect x=\"8.75\" y=\"8.75\" width=\"4.75\" height=\"4.75\" rx=\"1\" />\n </>\n);\n\nconst DEVICES: Readonly<Record<DeviceKind, ReactNode>> = { extension: chrome, installer: panes };\n\nexport const deviceMark = (kind: DeviceKind): ReactNode => <Glyph>{DEVICES[kind]}</Glyph>;\n"],"mappings":";;;;;;;AAiBA,MAAM,SAAS;CACb,MAAM;CACN,QAAQ;CACR,aAAa;CACb,eAAe;CACf,gBAAgB;AAClB;;AAQA,SAAS,MAAM,EAAE,UAAU,SAA+C;CACxE,OACE,oBAAC,OAAD;EAAK,SAAQ;EAAY,eAAA;EAAY,cAAY;EAAO,GAAI;EACzD;CACE,CAAA;AAET;AAEA,MAAM,UACJ,oBAAC,QAAD,EAAM,GAAE,yFAA0F,CAAA;AAEpG,MAAM,QACJ,oBAAC,QAAD,EAAM,GAAE,sIAAuI,CAAA;AAEjJ,MAAM,OACJ,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;CAAM,GAAE;CAAM,GAAE;CAAM,OAAM;CAAK,QAAO;CAAI,IAAG;AAAO,CAAA,GACtD,oBAAC,QAAD,EAAM,GAAE,2BAA4B,CAAA,CACpC,EAAA,CAAA;AAcJ,MAA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