@adecore/agents-react 0.31.12 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/AccountDot.js +57 -6
- package/dist/agents/AgentIcon.js +88 -12
- package/dist/agents/ModelOptionControl.js +153 -18
- package/dist/agents/ProviderLogo.js +49 -4
- package/dist/agents/account-limits.js +17 -14
- package/dist/agents/accounts.js +99 -67
- package/dist/agents/agent-marks.js +5 -3
- package/dist/agents/model-name.js +42 -31
- package/dist/agents/model-options.js +8 -8
- package/dist/agents/model-requirement.js +17 -14
- package/dist/agents/option-words.d.ts +7 -0
- package/dist/agents/option-words.js +35 -0
- package/dist/agents/provider-paths.js +6 -6
- package/dist/agents/status-look.js +32 -12
- package/dist/chat/account-choice.d.ts +13 -0
- package/dist/chat/account-choice.js +90 -20
- package/dist/chat/actions.js +126 -59
- package/dist/chat/activity.js +5 -5
- package/dist/chat/attachments.js +74 -53
- package/dist/chat/bookmarks.js +58 -48
- package/dist/chat/chat-client.js +344 -263
- package/dist/chat/chat-references.js +3 -3
- package/dist/chat/composer-effort.d.ts +5 -0
- package/dist/chat/composer-effort.js +26 -0
- package/dist/chat/composer-send.js +13 -13
- package/dist/chat/drafts.js +115 -79
- package/dist/chat/forks.js +81 -24
- package/dist/chat/guards.js +15 -43
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.js +3 -2
- package/dist/chat/logic/ansi.js +170 -167
- package/dist/chat/logic/answers.js +2 -2
- package/dist/chat/logic/bookmarks.js +19 -19
- package/dist/chat/logic/command-looks.js +138 -96
- package/dist/chat/logic/context-usage.js +13 -9
- package/dist/chat/logic/continue-after-stop.js +15 -19
- package/dist/chat/logic/effort.d.ts +14 -0
- package/dist/chat/logic/effort.js +34 -0
- package/dist/chat/logic/embedded-code.js +387 -326
- package/dist/chat/logic/fork.js +134 -110
- package/dist/chat/logic/generated-image.js +54 -23
- package/dist/chat/logic/goal.js +28 -20
- package/dist/chat/logic/handback.js +6 -6
- package/dist/chat/logic/json.js +2 -2
- package/dist/chat/logic/limit.js +46 -30
- package/dist/chat/logic/picker-entries.d.ts +5 -3
- package/dist/chat/logic/picker-entries.js +83 -43
- package/dist/chat/logic/resume-compaction.d.ts +14 -1
- package/dist/chat/logic/resume-compaction.js +93 -24
- package/dist/chat/logic/scrubber.js +188 -136
- package/dist/chat/logic/thought.js +13 -16
- package/dist/chat/logic/thread-cards.js +60 -48
- package/dist/chat/logic/timeline-copy.js +30 -38
- package/dist/chat/logic/timeline-target.js +92 -63
- package/dist/chat/logic/timeline.js +499 -355
- package/dist/chat/logic/tool-catalog.js +54 -34
- package/dist/chat/logic/tools.js +106 -82
- package/dist/chat/logic/visual-height.js +18 -18
- package/dist/chat/logic/visual-viewport.js +6 -3
- package/dist/chat/logic/welcome.js +9 -9
- package/dist/chat/logic/workflow.js +45 -34
- package/dist/chat/mentions.js +149 -109
- package/dist/chat/persisted-json.js +51 -54
- package/dist/chat/preferences.d.ts +4 -0
- package/dist/chat/preferences.js +162 -84
- package/dist/chat/prompt-hold.js +9 -9
- package/dist/chat/quote.js +21 -30
- package/dist/chat/reading-width.js +12 -10
- package/dist/chat/recent-messages.js +34 -21
- package/dist/chat/resume-compaction-dismissals.js +25 -5
- package/dist/chat/runtime-modes.js +3 -3
- package/dist/chat/send-key.js +11 -7
- package/dist/chat/stash.js +89 -69
- package/dist/chat/subagent-conversation.js +181 -139
- package/dist/chat/subagent-list.js +65 -67
- package/dist/chat/subagent-support.js +12 -7
- package/dist/chat/subagent-view.js +132 -44
- package/dist/chat/thumbnails.js +88 -60
- package/dist/chat/timeline-flash.js +24 -12
- package/dist/chat/timeline-scroll.js +116 -86
- package/dist/chat/ui/AccountPill.js +126 -15
- package/dist/chat/ui/AnsiOutput.js +62 -6
- package/dist/chat/ui/BookmarkMarker.js +231 -41
- package/dist/chat/ui/BookmarkSubmenu.js +165 -18
- package/dist/chat/ui/ChatActivity.js +649 -70
- package/dist/chat/ui/ChatReferenceChip.js +104 -9
- package/dist/chat/ui/CodeBlock.js +132 -58
- package/dist/chat/ui/Composer.js +866 -132
- package/dist/chat/ui/ComposerInput.js +309 -120
- package/dist/chat/ui/DiffPool.js +75 -14
- package/dist/chat/ui/EditDiff.js +160 -21
- package/dist/chat/ui/FadingWords.js +32 -3
- package/dist/chat/ui/GoalDock.js +235 -42
- package/dist/chat/ui/ImageView.js +617 -61
- package/dist/chat/ui/LimitState.js +446 -72
- package/dist/chat/ui/Markdown.js +991 -173
- package/dist/chat/ui/MermaidBlock.js +238 -68
- package/dist/chat/ui/MessageActions.js +251 -39
- package/dist/chat/ui/ModelMarks.js +55 -5
- package/dist/chat/ui/Pickers.js +664 -113
- package/dist/chat/ui/PromptComposer.js +281 -51
- package/dist/chat/ui/QuoteButton.js +151 -57
- package/dist/chat/ui/ResumeCompactionDock.d.ts +6 -2
- package/dist/chat/ui/ResumeCompactionDock.js +141 -6
- package/dist/chat/ui/RowTime.js +59 -5
- package/dist/chat/ui/RunSettings.js +1744 -154
- package/dist/chat/ui/Scrubber.js +517 -88
- package/dist/chat/ui/ShellCommand.js +183 -107
- package/dist/chat/ui/SubagentControls.js +212 -24
- package/dist/chat/ui/SubagentInfo.js +170 -13
- package/dist/chat/ui/SubagentStopButton.js +115 -24
- package/dist/chat/ui/SubagentTimeline.js +357 -91
- package/dist/chat/ui/Timeline.js +988 -476
- package/dist/chat/ui/TimelineMenu.js +552 -37
- package/dist/chat/ui/UnifiedDiff.js +234 -27
- package/dist/chat/ui/UploadThumb.js +37 -7
- package/dist/chat/ui/VisualDialogs.js +251 -20
- package/dist/chat/ui/VisualFrame.js +321 -95
- package/dist/chat/ui/Welcome.js +72 -7
- package/dist/chat/ui/chips.js +1 -1
- package/dist/chat/ui/code-lines.js +36 -36
- package/dist/chat/ui/code-streaming.js +1 -1
- package/dist/chat/ui/code-theme.js +7 -7
- package/dist/chat/ui/composer/ComposerControls.js +329 -21
- package/dist/chat/ui/composer/ComposerMenu.js +358 -30
- package/dist/chat/ui/composer/DraftParts.js +185 -11
- package/dist/chat/ui/composer/QueuedMessages.js +138 -13
- package/dist/chat/ui/composer/chips.js +29 -19
- package/dist/chat/ui/composer/editor.js +79 -63
- package/dist/chat/ui/composer/insert.js +26 -12
- package/dist/chat/ui/composer/key-handler.js +180 -127
- package/dist/chat/ui/composer/keys.js +90 -73
- package/dist/chat/ui/composer/menu-aria.js +18 -9
- package/dist/chat/ui/composer/placeholder.js +78 -31
- package/dist/chat/ui/composer/surface.js +13 -37
- package/dist/chat/ui/composer/use-chat-controls.js +230 -90
- package/dist/chat/ui/composer/use-compaction-offer.js +50 -18
- package/dist/chat/ui/composer/use-composer-draft.js +65 -34
- package/dist/chat/ui/composer/use-composer-menus.js +478 -193
- package/dist/chat/ui/composer/use-composer-submit.js +251 -109
- package/dist/chat/ui/composer/use-continuable-turn.js +33 -6
- package/dist/chat/ui/composer/use-draft-files.js +245 -93
- package/dist/chat/ui/composer/use-effort-stepper.d.ts +13 -0
- package/dist/chat/ui/composer/use-effort-stepper.js +88 -0
- package/dist/chat/ui/composer/use-notice.js +61 -16
- package/dist/chat/ui/composer/use-pending-requests.js +38 -17
- package/dist/chat/ui/composer/use-prompt-history.js +117 -45
- package/dist/chat/ui/composer/use-prompt-hold.js +119 -35
- package/dist/chat/ui/composer/use-take-back.js +94 -72
- package/dist/chat/ui/diff/ApprovalReview.js +101 -23
- package/dist/chat/ui/diff/DiffFallbackBoundary.js +21 -13
- package/dist/chat/ui/diff/DiffOmitted.js +56 -6
- package/dist/chat/ui/diff/DiffStack.js +92 -8
- package/dist/chat/ui/diff/DiffUnavailable.js +56 -6
- package/dist/chat/ui/diff/EditorEditDiff.js +263 -51
- package/dist/chat/ui/diff/EditorPatchDiff.js +39 -14
- package/dist/chat/ui/diff/LegacyDiffPool.js +27 -10
- package/dist/chat/ui/diff/LegacyEditDiff.js +97 -20
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +172 -42
- package/dist/chat/ui/diff/RawDiff.js +65 -5
- package/dist/chat/ui/diff/ReviewDiff.js +77 -5
- package/dist/chat/ui/diff/diff-props.js +1 -1
- package/dist/chat/ui/diff/diff-source-budget.js +46 -35
- package/dist/chat/ui/diff/editor-edit-model.js +18 -14
- package/dist/chat/ui/diff/review-plan.js +63 -40
- package/dist/chat/ui/diff/review-settle.js +24 -9
- package/dist/chat/ui/diff/syntax-runtime.js +236 -201
- package/dist/chat/ui/diff/use-review-stack.js +146 -25
- package/dist/chat/ui/diff-syntax.js +70 -58
- package/dist/chat/ui/diff-theme.js +31 -12
- package/dist/chat/ui/file-links.js +39 -10
- package/dist/chat/ui/find-reveal.js +29 -8
- package/dist/chat/ui/full-diff.js +17 -12
- package/dist/chat/ui/highlighter.js +143 -113
- package/dist/chat/ui/icons.js +16 -7
- package/dist/chat/ui/index.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +556 -82
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +73 -5
- package/dist/chat/ui/intelligent-ui/UiReply.js +666 -262
- package/dist/chat/ui/intelligent-ui/block-local.js +59 -31
- package/dist/chat/ui/intelligent-ui/chart-data.js +77 -67
- package/dist/chat/ui/intelligent-ui/node-text.js +77 -91
- package/dist/chat/ui/intelligent-ui/registry.js +46 -46
- package/dist/chat/ui/intelligent-ui/render-context.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/base-land.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/binding.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +1223 -123
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +312 -34
- package/dist/chat/ui/intelligent-ui/renderers/content.js +1241 -86
- package/dist/chat/ui/intelligent-ui/renderers/data.js +619 -54
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +868 -67
- package/dist/chat/ui/intelligent-ui/renderers/links.js +366 -62
- package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +118 -60
- package/dist/chat/ui/intelligent-ui/renderers/map-style.js +85 -78
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +282 -217
- package/dist/chat/ui/intelligent-ui/renderers/map.js +621 -69
- package/dist/chat/ui/intelligent-ui/renderers/place-point.js +15 -8
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +262 -20
- package/dist/chat/ui/intelligent-ui/renderers/text.js +674 -49
- package/dist/chat/ui/intelligent-ui/reply-parts.js +24 -15
- package/dist/chat/ui/intelligent-ui/table-data.js +97 -57
- package/dist/chat/ui/intelligent-ui/tones.js +31 -31
- package/dist/chat/ui/intelligent-ui/use-in-view.js +30 -12
- package/dist/chat/ui/intelligent-ui/use-later.js +28 -13
- package/dist/chat/ui/intelligent-ui/use-truncated.js +45 -21
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +296 -109
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +256 -246
- package/dist/chat/ui/markdown-blocks.js +296 -262
- package/dist/chat/ui/mermaid.js +60 -72
- package/dist/chat/ui/quote-selection.js +32 -29
- package/dist/chat/ui/rehype-chips.js +35 -23
- package/dist/chat/ui/rehype-fade.js +28 -17
- package/dist/chat/ui/remark-html-as-text.js +22 -15
- package/dist/chat/ui/reply-context.js +1 -1
- package/dist/chat/ui/reveal.js +161 -72
- package/dist/chat/ui/rows/ForksRow.js +226 -24
- package/dist/chat/ui/rows/GeneratedImageRow.js +541 -87
- package/dist/chat/ui/rows/MessageRows.js +1706 -159
- package/dist/chat/ui/rows/RowContainer.js +57 -7
- package/dist/chat/ui/rows/Rows.js +463 -54
- package/dist/chat/ui/rows/SubagentRow.js +577 -60
- package/dist/chat/ui/rows/TaskRow.js +359 -40
- package/dist/chat/ui/rows/VisualRow.js +233 -11
- package/dist/chat/ui/rows/WorkRows.js +1945 -164
- package/dist/chat/ui/rows/WorkflowRow.js +293 -34
- package/dist/chat/ui/rows/row-rhythm.js +27 -17
- package/dist/chat/ui/theme-watch.js +26 -23
- package/dist/chat/ui/timestamp-format.js +4 -1
- package/dist/chat/ui/use-diff-source-tokens.js +70 -34
- package/dist/chat/ui/useToggleSet.js +51 -19
- package/dist/chat/ui/visual-theme.js +153 -128
- package/dist/chat/visual-bridge.js +123 -123
- package/dist/chat/visual-viewport.js +94 -83
- package/dist/chat/visuals.js +13 -5
- package/dist/host-hooks.d.ts +29 -0
- package/dist/host-hooks.js +78 -0
- package/dist/host.js +120 -48
- package/dist/index.js +1 -1
- package/dist/lazy.js +38 -32
- package/dist/locales/en/agent-chat.d.ts +34 -0
- package/dist/locales/en/agent-chat.js +747 -713
- package/dist/locales/en/agent-prompts.js +42 -42
- package/dist/locales/en/agent-providers.d.ts +1 -0
- package/dist/locales/en/agent-providers.js +166 -165
- package/dist/locales/en/agent-usage.d.ts +6 -0
- package/dist/locales/en/agent-usage.js +129 -123
- package/dist/locales/nl/agent-chat.d.ts +34 -0
- package/dist/locales/nl/agent-chat.js +747 -713
- package/dist/locales/nl/agent-prompts.js +42 -42
- package/dist/locales/nl/agent-providers.d.ts +1 -0
- package/dist/locales/nl/agent-providers.js +166 -165
- package/dist/locales/nl/agent-usage.d.ts +6 -0
- package/dist/locales/nl/agent-usage.js +129 -123
- package/dist/locales.js +14 -14
- package/dist/mounted-registry.js +31 -30
- package/dist/port-transport.js +122 -111
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/logic/focus.js +15 -14
- package/dist/prompts/logic/keys.js +93 -59
- package/dist/prompts/logic/prompts.js +27 -14
- package/dist/prompts/logic/subjects.js +60 -46
- package/dist/prompts/logic/useFocusAfterAnswer.js +60 -20
- package/dist/prompts/logic/usePromptSession.js +88 -77
- package/dist/prompts/ui/ApprovalBody.js +246 -27
- package/dist/prompts/ui/PromptActions.js +215 -9
- package/dist/prompts/ui/PromptCard.js +215 -36
- package/dist/prompts/ui/PromptView.js +372 -34
- package/dist/prompts/ui/QuestionBody.js +269 -73
- package/dist/providers/AccountColors.js +36 -5
- package/dist/providers/AccountDetail.js +683 -50
- package/dist/providers/AccountVariables.js +139 -32
- package/dist/providers/AddAccountForm.js +125 -38
- package/dist/providers/CliDetail.js +343 -36
- package/dist/providers/InstallPage.js +644 -59
- package/dist/providers/ProviderList.d.ts +2 -1
- package/dist/providers/ProviderList.js +215 -23
- package/dist/providers/ProvidersPane.d.ts +4 -2
- package/dist/providers/ProvidersPane.js +244 -64
- package/dist/providers/account-actions.js +54 -30
- package/dist/providers/index.js +1 -1
- package/dist/providers/install-steps.js +12 -9
- package/dist/providers/pane-target.d.ts +3 -0
- package/dist/providers/pane-target.js +34 -13
- package/dist/providers/parts.js +62 -12
- package/dist/providers/provider-abilities.js +5 -5
- package/dist/providers/provider-groups.js +75 -40
- package/dist/providers/variables.js +73 -39
- package/dist/scope.js +6 -6
- package/dist/settings/sections.js +18 -18
- package/dist/state/chats.js +404 -192
- package/dist/state/index.js +1 -1
- package/dist/state/provider-accounts.js +70 -47
- package/dist/state/providers.js +45 -16
- package/dist/state/usage.js +154 -77
- package/dist/storage.js +69 -68
- package/dist/testing/index.js +1 -1
- package/dist/testing/prompts.js +105 -67
- package/dist/transport.js +10 -10
- package/dist/ui/PlainTextarea.js +27 -3
- package/dist/usage/LimitsList.js +646 -40
- package/dist/usage/UsageBreakdown.js +879 -38
- package/dist/usage/UsageChart.js +311 -32
- package/dist/usage/UsageDialog.js +46 -4
- package/dist/usage/UsageLimits.js +467 -34
- package/dist/usage/UsageLimitsCard.js +95 -11
- package/dist/usage/UsagePage.js +817 -96
- package/dist/usage/UsagePane.js +164 -10
- package/dist/usage/UsageSummary.js +151 -6
- package/dist/usage/UsageTiles.js +164 -14
- package/dist/usage/format.js +32 -32
- package/dist/usage/index.d.ts +1 -1
- package/dist/usage/index.js +2 -1
- package/dist/usage/limit-groups.d.ts +2 -0
- package/dist/usage/limit-groups.js +77 -59
- package/dist/usage/limits.js +78 -43
- package/dist/usage/money.js +20 -4
- package/dist/usage/summary.js +85 -64
- package/package.json +8 -8
- package/src/agents/ModelOptionControl.tsx +3 -1
- package/src/agents/option-words.ts +27 -0
- package/src/chat/account-choice.ts +41 -1
- package/src/chat/composer-effort.ts +32 -0
- package/src/chat/forks.ts +4 -5
- package/src/chat/index.ts +3 -1
- package/src/chat/logic/effort.ts +32 -0
- package/src/chat/logic/picker-entries.ts +45 -10
- package/src/chat/logic/resume-compaction.ts +95 -17
- package/src/chat/logic/timeline.ts +11 -3
- package/src/chat/preferences.ts +35 -0
- package/src/chat/subagent-view.ts +2 -3
- package/src/chat/ui/AnsiOutput.tsx +1 -2
- package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
- package/src/chat/ui/ChatActivity.tsx +14 -22
- package/src/chat/ui/ChatReferenceChip.tsx +2 -3
- package/src/chat/ui/Composer.tsx +15 -7
- package/src/chat/ui/EditDiff.tsx +2 -3
- package/src/chat/ui/LimitState.tsx +2 -2
- package/src/chat/ui/Markdown.tsx +10 -8
- package/src/chat/ui/MermaidBlock.tsx +2 -3
- package/src/chat/ui/Pickers.tsx +49 -29
- package/src/chat/ui/PromptComposer.tsx +7 -9
- package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
- package/src/chat/ui/RunSettings.tsx +67 -28
- package/src/chat/ui/Scrubber.tsx +3 -3
- package/src/chat/ui/ShellCommand.tsx +2 -0
- package/src/chat/ui/SubagentInfo.tsx +2 -3
- package/src/chat/ui/SubagentTimeline.tsx +12 -16
- package/src/chat/ui/Timeline.tsx +6 -6
- package/src/chat/ui/UnifiedDiff.tsx +3 -4
- package/src/chat/ui/VisualFrame.tsx +5 -8
- package/src/chat/ui/code-theme.ts +4 -4
- package/src/chat/ui/composer/placeholder.ts +2 -2
- package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
- package/src/chat/ui/composer/use-composer-menus.ts +4 -9
- package/src/chat/ui/composer/use-composer-submit.ts +2 -1
- package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
- package/src/chat/ui/composer/use-notice.ts +2 -2
- package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
- package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
- package/src/chat/ui/diff/use-review-stack.ts +4 -4
- package/src/chat/ui/diff-theme.ts +3 -3
- package/src/chat/ui/file-links.ts +2 -2
- package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
- package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
- package/src/chat/ui/rows/ForksRow.tsx +3 -5
- package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
- package/src/chat/ui/rows/MessageRows.tsx +12 -21
- package/src/chat/ui/rows/SubagentRow.tsx +3 -3
- package/src/chat/ui/rows/TaskRow.tsx +1 -1
- package/src/chat/ui/rows/WorkRows.tsx +10 -5
- package/src/chat/ui/useToggleSet.ts +15 -18
- package/src/chat/ui/visual-theme.ts +2 -3
- package/src/host-hooks.ts +113 -0
- package/src/lazy.tsx +2 -0
- package/src/locales/en/agent-chat.ts +134 -108
- package/src/locales/en/agent-prompts.ts +7 -7
- package/src/locales/en/agent-providers.ts +35 -34
- package/src/locales/en/agent-usage.ts +26 -20
- package/src/locales/nl/agent-chat.ts +126 -100
- package/src/locales/nl/agent-prompts.ts +5 -5
- package/src/locales/nl/agent-providers.ts +33 -32
- package/src/locales/nl/agent-usage.ts +25 -20
- package/src/providers/CliDetail.tsx +2 -1
- package/src/providers/InstallPage.tsx +2 -4
- package/src/providers/ProviderList.tsx +12 -2
- package/src/providers/ProvidersPane.tsx +45 -15
- package/src/providers/pane-target.ts +20 -4
- package/src/state/chats.ts +2 -2
- package/src/usage/LimitsList.tsx +12 -13
- package/src/usage/UsageBreakdown.tsx +17 -6
- package/src/usage/UsageLimits.tsx +2 -1
- package/src/usage/UsagePage.tsx +3 -3
- package/src/usage/index.ts +1 -1
- package/src/usage/limit-groups.ts +12 -0
- package/src/usage/limits.ts +2 -2
- package/src/usage/money.ts +1 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { createContext, useContext, useId } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
@@ -7,61 +7,528 @@ import { formatNumber } from '@adecore/ui/format';
|
|
|
7
7
|
import { uiChildrenOf, uiNodeLabel, uiOwnLabel, uiWithUnit } from '../node-text.js';
|
|
8
8
|
import { useTruncated } from '../use-truncated.js';
|
|
9
9
|
import { bindingOf, PENDING } from './binding.js';
|
|
10
|
-
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const ChecklistContext = createContext({
|
|
12
|
+
values: [],
|
|
13
|
+
enabled: false,
|
|
14
|
+
toggle: () => undefined
|
|
15
|
+
});
|
|
11
16
|
/* The rows of a checklist as one named group. */
|
|
12
|
-
function ChecklistGroup(
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
function ChecklistGroup(t0) {
|
|
18
|
+
const $ = _c(8);
|
|
19
|
+
const {
|
|
20
|
+
pending,
|
|
21
|
+
children
|
|
22
|
+
} = t0;
|
|
23
|
+
const {
|
|
24
|
+
t
|
|
25
|
+
} = useTranslation("agent-chat");
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== t) {
|
|
28
|
+
t1 = t("blocks.checklist");
|
|
29
|
+
$[0] = t;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[1];
|
|
33
|
+
}
|
|
34
|
+
const t2 = pending && PENDING;
|
|
35
|
+
let t3;
|
|
36
|
+
if ($[2] !== t2) {
|
|
37
|
+
t3 = clsx("chat-ui-nodes flex flex-col gap-1.5", t2);
|
|
38
|
+
$[2] = t2;
|
|
39
|
+
$[3] = t3;
|
|
40
|
+
} else {
|
|
41
|
+
t3 = $[3];
|
|
42
|
+
}
|
|
43
|
+
let t4;
|
|
44
|
+
if ($[4] !== children || $[5] !== t1 || $[6] !== t3) {
|
|
45
|
+
t4 = /*#__PURE__*/_jsx("div", {
|
|
46
|
+
role: "group",
|
|
47
|
+
"aria-label": t1,
|
|
48
|
+
className: t3,
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
51
|
+
$[4] = children;
|
|
52
|
+
$[5] = t1;
|
|
53
|
+
$[6] = t3;
|
|
54
|
+
$[7] = t4;
|
|
55
|
+
} else {
|
|
56
|
+
t4 = $[7];
|
|
57
|
+
}
|
|
58
|
+
return t4;
|
|
15
59
|
}
|
|
16
|
-
export function ChecklistRenderer(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
60
|
+
export function ChecklistRenderer(t0) {
|
|
61
|
+
const $ = _c(16);
|
|
62
|
+
const {
|
|
63
|
+
node,
|
|
64
|
+
children,
|
|
65
|
+
context
|
|
66
|
+
} = t0;
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[0] !== context || $[1] !== node) {
|
|
69
|
+
t1 = bindingOf(node, context);
|
|
70
|
+
$[0] = context;
|
|
71
|
+
$[1] = node;
|
|
72
|
+
$[2] = t1;
|
|
73
|
+
} else {
|
|
74
|
+
t1 = $[2];
|
|
75
|
+
}
|
|
76
|
+
const binding = t1;
|
|
77
|
+
const values = binding?.value ?? node.props.value;
|
|
78
|
+
let t2;
|
|
79
|
+
if ($[3] !== binding || $[4] !== values) {
|
|
80
|
+
t2 = value => {
|
|
81
|
+
binding?.onValueChange(values.includes(value) ? values.filter(entry => entry !== value) : [...values, value]);
|
|
21
82
|
};
|
|
22
|
-
|
|
83
|
+
$[3] = binding;
|
|
84
|
+
$[4] = values;
|
|
85
|
+
$[5] = t2;
|
|
86
|
+
} else {
|
|
87
|
+
t2 = $[5];
|
|
88
|
+
}
|
|
89
|
+
const toggle = t2;
|
|
90
|
+
const t3 = binding !== null;
|
|
91
|
+
let t4;
|
|
92
|
+
if ($[6] !== t3 || $[7] !== toggle || $[8] !== values) {
|
|
93
|
+
t4 = {
|
|
94
|
+
values,
|
|
95
|
+
enabled: t3,
|
|
96
|
+
toggle
|
|
97
|
+
};
|
|
98
|
+
$[6] = t3;
|
|
99
|
+
$[7] = toggle;
|
|
100
|
+
$[8] = values;
|
|
101
|
+
$[9] = t4;
|
|
102
|
+
} else {
|
|
103
|
+
t4 = $[9];
|
|
104
|
+
}
|
|
105
|
+
const t5 = !node.complete;
|
|
106
|
+
let t6;
|
|
107
|
+
if ($[10] !== children || $[11] !== t5) {
|
|
108
|
+
t6 = /*#__PURE__*/_jsx(ChecklistGroup, {
|
|
109
|
+
pending: t5,
|
|
110
|
+
children: children
|
|
111
|
+
});
|
|
112
|
+
$[10] = children;
|
|
113
|
+
$[11] = t5;
|
|
114
|
+
$[12] = t6;
|
|
115
|
+
} else {
|
|
116
|
+
t6 = $[12];
|
|
117
|
+
}
|
|
118
|
+
let t7;
|
|
119
|
+
if ($[13] !== t4 || $[14] !== t6) {
|
|
120
|
+
t7 = /*#__PURE__*/_jsx(ChecklistContext, {
|
|
121
|
+
value: t4,
|
|
122
|
+
children: t6
|
|
123
|
+
});
|
|
124
|
+
$[13] = t4;
|
|
125
|
+
$[14] = t6;
|
|
126
|
+
$[15] = t7;
|
|
127
|
+
} else {
|
|
128
|
+
t7 = $[15];
|
|
129
|
+
}
|
|
130
|
+
return t7;
|
|
23
131
|
}
|
|
24
132
|
/* The whole tile is the label, ringed in the accent while checked; a link inside it keeps its own click and checks nothing. */
|
|
25
|
-
export function ItemRenderer(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
133
|
+
export function ItemRenderer(t0) {
|
|
134
|
+
const $ = _c(22);
|
|
135
|
+
const {
|
|
136
|
+
node,
|
|
137
|
+
children
|
|
138
|
+
} = t0;
|
|
139
|
+
const list = useContext(ChecklistContext);
|
|
140
|
+
const {
|
|
141
|
+
value
|
|
142
|
+
} = node.props;
|
|
143
|
+
let checked;
|
|
144
|
+
let t1;
|
|
145
|
+
let toggleRow;
|
|
146
|
+
if ($[0] !== list || $[1] !== value) {
|
|
147
|
+
checked = list.values.includes(value);
|
|
148
|
+
toggleRow = event => {
|
|
149
|
+
if (list.enabled && !event.target.closest("button, a")) {
|
|
150
|
+
list.toggle(value);
|
|
151
|
+
}
|
|
33
152
|
};
|
|
34
|
-
|
|
153
|
+
t1 = clsx("flex min-h-10 items-start gap-3 rounded-xl bg-ui-tile px-3 py-2.5 text-xs text-text", checked && "ring-2 ring-accent ring-inset", list.enabled && "hover:bg-surface-active");
|
|
154
|
+
$[0] = list;
|
|
155
|
+
$[1] = value;
|
|
156
|
+
$[2] = checked;
|
|
157
|
+
$[3] = t1;
|
|
158
|
+
$[4] = toggleRow;
|
|
159
|
+
} else {
|
|
160
|
+
checked = $[2];
|
|
161
|
+
t1 = $[3];
|
|
162
|
+
toggleRow = $[4];
|
|
163
|
+
}
|
|
164
|
+
let t2;
|
|
165
|
+
if ($[5] !== list || $[6] !== value) {
|
|
166
|
+
t2 = () => list.toggle(value);
|
|
167
|
+
$[5] = list;
|
|
168
|
+
$[6] = value;
|
|
169
|
+
$[7] = t2;
|
|
170
|
+
} else {
|
|
171
|
+
t2 = $[7];
|
|
172
|
+
}
|
|
173
|
+
let t3;
|
|
174
|
+
if ($[8] !== node) {
|
|
175
|
+
t3 = uiNodeLabel(node);
|
|
176
|
+
$[8] = node;
|
|
177
|
+
$[9] = t3;
|
|
178
|
+
} else {
|
|
179
|
+
t3 = $[9];
|
|
180
|
+
}
|
|
181
|
+
const t4 = !list.enabled;
|
|
182
|
+
let t5;
|
|
183
|
+
if ($[10] !== checked || $[11] !== t2 || $[12] !== t3 || $[13] !== t4) {
|
|
184
|
+
t5 = /*#__PURE__*/_jsx(Checkbox, {
|
|
185
|
+
className: "mt-0.5",
|
|
186
|
+
checked: checked,
|
|
187
|
+
onCheckedChange: t2,
|
|
188
|
+
label: t3,
|
|
189
|
+
disabled: t4
|
|
190
|
+
});
|
|
191
|
+
$[10] = checked;
|
|
192
|
+
$[11] = t2;
|
|
193
|
+
$[12] = t3;
|
|
194
|
+
$[13] = t4;
|
|
195
|
+
$[14] = t5;
|
|
196
|
+
} else {
|
|
197
|
+
t5 = $[14];
|
|
198
|
+
}
|
|
199
|
+
let t6;
|
|
200
|
+
if ($[15] !== children) {
|
|
201
|
+
t6 = /*#__PURE__*/_jsx("div", {
|
|
202
|
+
className: "min-w-0 grow",
|
|
203
|
+
children: children
|
|
204
|
+
});
|
|
205
|
+
$[15] = children;
|
|
206
|
+
$[16] = t6;
|
|
207
|
+
} else {
|
|
208
|
+
t6 = $[16];
|
|
209
|
+
}
|
|
210
|
+
let t7;
|
|
211
|
+
if ($[17] !== t1 || $[18] !== t5 || $[19] !== t6 || $[20] !== toggleRow) {
|
|
212
|
+
t7 = /*#__PURE__*/_jsxs("div", {
|
|
213
|
+
className: t1,
|
|
214
|
+
onClick: toggleRow,
|
|
215
|
+
children: [t5, t6]
|
|
216
|
+
});
|
|
217
|
+
$[17] = t1;
|
|
218
|
+
$[18] = t5;
|
|
219
|
+
$[19] = t6;
|
|
220
|
+
$[20] = toggleRow;
|
|
221
|
+
$[21] = t7;
|
|
222
|
+
} else {
|
|
223
|
+
t7 = $[21];
|
|
224
|
+
}
|
|
225
|
+
return t7;
|
|
35
226
|
}
|
|
36
|
-
export function SwitchRenderer(
|
|
37
|
-
|
|
38
|
-
|
|
227
|
+
export function SwitchRenderer(t0) {
|
|
228
|
+
const $ = _c(20);
|
|
229
|
+
const {
|
|
230
|
+
node,
|
|
231
|
+
children,
|
|
232
|
+
context
|
|
233
|
+
} = t0;
|
|
234
|
+
let t1;
|
|
235
|
+
if ($[0] !== context || $[1] !== node) {
|
|
236
|
+
t1 = bindingOf(node, context);
|
|
237
|
+
$[0] = context;
|
|
238
|
+
$[1] = node;
|
|
239
|
+
$[2] = t1;
|
|
240
|
+
} else {
|
|
241
|
+
t1 = $[2];
|
|
242
|
+
}
|
|
243
|
+
const binding = t1;
|
|
244
|
+
const t2 = !node.complete && PENDING;
|
|
245
|
+
let t3;
|
|
246
|
+
if ($[3] !== t2) {
|
|
247
|
+
t3 = clsx("chat-ui-flat flex min-h-11 items-center justify-between gap-3 rounded-xl bg-ui-tile px-3 py-2 text-xs", t2);
|
|
248
|
+
$[3] = t2;
|
|
249
|
+
$[4] = t3;
|
|
250
|
+
} else {
|
|
251
|
+
t3 = $[4];
|
|
252
|
+
}
|
|
253
|
+
let t4;
|
|
254
|
+
if ($[5] !== children) {
|
|
255
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
256
|
+
className: "min-w-0 font-medium text-text",
|
|
257
|
+
children: children
|
|
258
|
+
});
|
|
259
|
+
$[5] = children;
|
|
260
|
+
$[6] = t4;
|
|
261
|
+
} else {
|
|
262
|
+
t4 = $[6];
|
|
263
|
+
}
|
|
264
|
+
const t5 = binding?.value ?? node.props.value;
|
|
265
|
+
let t6;
|
|
266
|
+
if ($[7] !== binding) {
|
|
267
|
+
t6 = next => binding?.onValueChange(next);
|
|
268
|
+
$[7] = binding;
|
|
269
|
+
$[8] = t6;
|
|
270
|
+
} else {
|
|
271
|
+
t6 = $[8];
|
|
272
|
+
}
|
|
273
|
+
let t7;
|
|
274
|
+
if ($[9] !== node) {
|
|
275
|
+
t7 = uiNodeLabel(node);
|
|
276
|
+
$[9] = node;
|
|
277
|
+
$[10] = t7;
|
|
278
|
+
} else {
|
|
279
|
+
t7 = $[10];
|
|
280
|
+
}
|
|
281
|
+
const t8 = binding === null;
|
|
282
|
+
let t9;
|
|
283
|
+
if ($[11] !== t5 || $[12] !== t6 || $[13] !== t7 || $[14] !== t8) {
|
|
284
|
+
t9 = /*#__PURE__*/_jsx(Switch, {
|
|
285
|
+
checked: t5,
|
|
286
|
+
onCheckedChange: t6,
|
|
287
|
+
label: t7,
|
|
288
|
+
disabled: t8
|
|
289
|
+
});
|
|
290
|
+
$[11] = t5;
|
|
291
|
+
$[12] = t6;
|
|
292
|
+
$[13] = t7;
|
|
293
|
+
$[14] = t8;
|
|
294
|
+
$[15] = t9;
|
|
295
|
+
} else {
|
|
296
|
+
t9 = $[15];
|
|
297
|
+
}
|
|
298
|
+
let t10;
|
|
299
|
+
if ($[16] !== t3 || $[17] !== t4 || $[18] !== t9) {
|
|
300
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
301
|
+
className: t3,
|
|
302
|
+
children: [t4, t9]
|
|
303
|
+
});
|
|
304
|
+
$[16] = t3;
|
|
305
|
+
$[17] = t4;
|
|
306
|
+
$[18] = t9;
|
|
307
|
+
$[19] = t10;
|
|
308
|
+
} else {
|
|
309
|
+
t10 = $[19];
|
|
310
|
+
}
|
|
311
|
+
return t10;
|
|
39
312
|
}
|
|
40
313
|
/* Its children are the label, read as text: the slider writes its own label line. */
|
|
41
|
-
export function SliderRenderer(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
314
|
+
export function SliderRenderer(t0) {
|
|
315
|
+
const $ = _c(21);
|
|
316
|
+
const {
|
|
317
|
+
node,
|
|
318
|
+
context
|
|
319
|
+
} = t0;
|
|
320
|
+
let t1;
|
|
321
|
+
if ($[0] !== context || $[1] !== node) {
|
|
322
|
+
t1 = bindingOf(node, context);
|
|
323
|
+
$[0] = context;
|
|
324
|
+
$[1] = node;
|
|
325
|
+
$[2] = t1;
|
|
326
|
+
} else {
|
|
327
|
+
t1 = $[2];
|
|
328
|
+
}
|
|
329
|
+
const binding = t1;
|
|
330
|
+
const {
|
|
331
|
+
value,
|
|
332
|
+
min,
|
|
333
|
+
max,
|
|
334
|
+
step,
|
|
335
|
+
unit
|
|
336
|
+
} = node.props;
|
|
337
|
+
const t2 = binding?.value ?? value;
|
|
338
|
+
let t3;
|
|
339
|
+
if ($[3] !== binding) {
|
|
340
|
+
t3 = next => binding?.onValueChange(next);
|
|
341
|
+
$[3] = binding;
|
|
342
|
+
$[4] = t3;
|
|
343
|
+
} else {
|
|
344
|
+
t3 = $[4];
|
|
345
|
+
}
|
|
346
|
+
let t4;
|
|
347
|
+
if ($[5] !== unit) {
|
|
348
|
+
t4 = uiWithUnit("", unit);
|
|
349
|
+
$[5] = unit;
|
|
350
|
+
$[6] = t4;
|
|
351
|
+
} else {
|
|
352
|
+
t4 = $[6];
|
|
353
|
+
}
|
|
354
|
+
let t5;
|
|
355
|
+
if ($[7] !== node) {
|
|
356
|
+
t5 = uiNodeLabel(node);
|
|
357
|
+
$[7] = node;
|
|
358
|
+
$[8] = t5;
|
|
359
|
+
} else {
|
|
360
|
+
t5 = $[8];
|
|
361
|
+
}
|
|
362
|
+
const t6 = binding === null;
|
|
363
|
+
const t7 = !node.complete && PENDING;
|
|
364
|
+
let t8;
|
|
365
|
+
if ($[9] !== t7) {
|
|
366
|
+
t8 = clsx("chat-ui-flat rounded-xl bg-ui-tile p-3", t7);
|
|
367
|
+
$[9] = t7;
|
|
368
|
+
$[10] = t8;
|
|
369
|
+
} else {
|
|
370
|
+
t8 = $[10];
|
|
371
|
+
}
|
|
372
|
+
let t9;
|
|
373
|
+
if ($[11] !== max || $[12] !== min || $[13] !== step || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 || $[19] !== t8) {
|
|
374
|
+
t9 = /*#__PURE__*/_jsx(Slider, {
|
|
375
|
+
value: t2,
|
|
376
|
+
onValueChange: t3,
|
|
377
|
+
min: min,
|
|
378
|
+
max: max,
|
|
379
|
+
step: step,
|
|
380
|
+
unit: t4,
|
|
381
|
+
label: t5,
|
|
382
|
+
disabled: t6,
|
|
383
|
+
className: t8
|
|
384
|
+
});
|
|
385
|
+
$[11] = max;
|
|
386
|
+
$[12] = min;
|
|
387
|
+
$[13] = step;
|
|
388
|
+
$[14] = t2;
|
|
389
|
+
$[15] = t3;
|
|
390
|
+
$[16] = t4;
|
|
391
|
+
$[17] = t5;
|
|
392
|
+
$[18] = t6;
|
|
393
|
+
$[19] = t8;
|
|
394
|
+
$[20] = t9;
|
|
395
|
+
} else {
|
|
396
|
+
t9 = $[20];
|
|
397
|
+
}
|
|
398
|
+
return t9;
|
|
47
399
|
}
|
|
48
400
|
/* A label longer than this reads as a sentence, which wraps badly beside another; the options then stand in a column. */
|
|
49
401
|
const SIDE_BY_SIDE_LABEL = 24;
|
|
50
402
|
/* Left aligned, never the full width. Each Option is a segment by its place, since a value may be any scalar. */
|
|
51
|
-
export function SegmentedRenderer(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
403
|
+
export function SegmentedRenderer(t0) {
|
|
404
|
+
const $ = _c(31);
|
|
405
|
+
const {
|
|
406
|
+
node,
|
|
407
|
+
context
|
|
408
|
+
} = t0;
|
|
409
|
+
const {
|
|
410
|
+
t
|
|
411
|
+
} = useTranslation("agent-chat");
|
|
412
|
+
let t1;
|
|
413
|
+
if ($[0] !== context || $[1] !== node) {
|
|
414
|
+
t1 = bindingOf(node, context);
|
|
415
|
+
$[0] = context;
|
|
416
|
+
$[1] = node;
|
|
417
|
+
$[2] = t1;
|
|
418
|
+
} else {
|
|
419
|
+
t1 = $[2];
|
|
420
|
+
}
|
|
421
|
+
const binding = t1;
|
|
422
|
+
const current = binding?.value ?? node.props.value;
|
|
423
|
+
let T0;
|
|
424
|
+
let options;
|
|
425
|
+
let t2;
|
|
426
|
+
let t3;
|
|
427
|
+
let t4;
|
|
428
|
+
let t5;
|
|
429
|
+
let t6;
|
|
430
|
+
if ($[3] !== current || $[4] !== node || $[5] !== t) {
|
|
431
|
+
options = uiChildrenOf(node, "Option").map(_temp);
|
|
432
|
+
const picked = options.find(option_0 => option_0.value === current)?.id ?? "";
|
|
433
|
+
const t7 = !node.complete && PENDING;
|
|
434
|
+
if ($[13] !== t7) {
|
|
435
|
+
t6 = clsx(t7);
|
|
436
|
+
$[13] = t7;
|
|
437
|
+
$[14] = t6;
|
|
438
|
+
} else {
|
|
439
|
+
t6 = $[14];
|
|
440
|
+
}
|
|
441
|
+
T0 = Segmented;
|
|
442
|
+
t2 = picked;
|
|
443
|
+
t3 = options;
|
|
444
|
+
if ($[15] !== t) {
|
|
445
|
+
t4 = t("blocks.options");
|
|
446
|
+
$[15] = t;
|
|
447
|
+
$[16] = t4;
|
|
448
|
+
} else {
|
|
449
|
+
t4 = $[16];
|
|
450
|
+
}
|
|
451
|
+
t5 = options.some(_temp2) ? "vertical" : "horizontal";
|
|
452
|
+
$[3] = current;
|
|
453
|
+
$[4] = node;
|
|
454
|
+
$[5] = t;
|
|
455
|
+
$[6] = T0;
|
|
456
|
+
$[7] = options;
|
|
457
|
+
$[8] = t2;
|
|
458
|
+
$[9] = t3;
|
|
459
|
+
$[10] = t4;
|
|
460
|
+
$[11] = t5;
|
|
461
|
+
$[12] = t6;
|
|
462
|
+
} else {
|
|
463
|
+
T0 = $[6];
|
|
464
|
+
options = $[7];
|
|
465
|
+
t2 = $[8];
|
|
466
|
+
t3 = $[9];
|
|
467
|
+
t4 = $[10];
|
|
468
|
+
t5 = $[11];
|
|
469
|
+
t6 = $[12];
|
|
470
|
+
}
|
|
471
|
+
const t7 = binding === null;
|
|
472
|
+
let t8;
|
|
473
|
+
if ($[17] !== binding || $[18] !== options) {
|
|
474
|
+
t8 = id => {
|
|
475
|
+
const option_2 = options[Number(id)];
|
|
476
|
+
if (option_2 !== undefined) {
|
|
477
|
+
binding?.onValueChange(option_2.value);
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
$[17] = binding;
|
|
481
|
+
$[18] = options;
|
|
482
|
+
$[19] = t8;
|
|
483
|
+
} else {
|
|
484
|
+
t8 = $[19];
|
|
485
|
+
}
|
|
486
|
+
let t9;
|
|
487
|
+
if ($[20] !== T0 || $[21] !== t2 || $[22] !== t3 || $[23] !== t4 || $[24] !== t5 || $[25] !== t7 || $[26] !== t8) {
|
|
488
|
+
t9 = /*#__PURE__*/_jsx(T0, {
|
|
489
|
+
value: t2,
|
|
490
|
+
options: t3,
|
|
491
|
+
label: t4,
|
|
492
|
+
orientation: t5,
|
|
493
|
+
disabled: t7,
|
|
494
|
+
onValueChange: t8
|
|
495
|
+
});
|
|
496
|
+
$[20] = T0;
|
|
497
|
+
$[21] = t2;
|
|
498
|
+
$[22] = t3;
|
|
499
|
+
$[23] = t4;
|
|
500
|
+
$[24] = t5;
|
|
501
|
+
$[25] = t7;
|
|
502
|
+
$[26] = t8;
|
|
503
|
+
$[27] = t9;
|
|
504
|
+
} else {
|
|
505
|
+
t9 = $[27];
|
|
506
|
+
}
|
|
507
|
+
let t10;
|
|
508
|
+
if ($[28] !== t6 || $[29] !== t9) {
|
|
509
|
+
t10 = /*#__PURE__*/_jsx("div", {
|
|
510
|
+
className: t6,
|
|
511
|
+
children: t9
|
|
512
|
+
});
|
|
513
|
+
$[28] = t6;
|
|
514
|
+
$[29] = t9;
|
|
515
|
+
$[30] = t10;
|
|
516
|
+
} else {
|
|
517
|
+
t10 = $[30];
|
|
518
|
+
}
|
|
519
|
+
return t10;
|
|
63
520
|
}
|
|
64
521
|
/* The longest a text field takes when its agent names none; the schema allows up to 1024. */
|
|
522
|
+
function _temp2(option_1) {
|
|
523
|
+
return option_1.label.length > SIDE_BY_SIDE_LABEL;
|
|
524
|
+
}
|
|
525
|
+
function _temp(option, index) {
|
|
526
|
+
return {
|
|
527
|
+
id: String(index),
|
|
528
|
+
label: uiNodeLabel(option),
|
|
529
|
+
value: option.props.value
|
|
530
|
+
};
|
|
531
|
+
}
|
|
65
532
|
const DEFAULT_MAX_LENGTH = 256;
|
|
66
533
|
/* The count under a field appears once the field is this full, and never nags before. */
|
|
67
534
|
const COUNT_FROM = 0.8;
|
|
@@ -69,37 +536,371 @@ const COUNT_FROM = 0.8;
|
|
|
69
536
|
* A line of text: the label above the field, which stops taking characters at its limit. Nothing here binds
|
|
70
537
|
* a key or submits on Enter, so the value reaches the agent only through a Choice.
|
|
71
538
|
*/
|
|
72
|
-
export function TextFieldRenderer(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
539
|
+
export function TextFieldRenderer(t0) {
|
|
540
|
+
const $ = _c(29);
|
|
541
|
+
const {
|
|
542
|
+
node,
|
|
543
|
+
children,
|
|
544
|
+
context
|
|
545
|
+
} = t0;
|
|
546
|
+
const {
|
|
547
|
+
t
|
|
548
|
+
} = useTranslation("agent-chat");
|
|
549
|
+
const id = useId();
|
|
550
|
+
let t1;
|
|
551
|
+
if ($[0] !== context || $[1] !== node) {
|
|
552
|
+
t1 = bindingOf(node, context);
|
|
553
|
+
$[0] = context;
|
|
554
|
+
$[1] = node;
|
|
555
|
+
$[2] = t1;
|
|
556
|
+
} else {
|
|
557
|
+
t1 = $[2];
|
|
558
|
+
}
|
|
559
|
+
const binding = t1;
|
|
560
|
+
const {
|
|
561
|
+
maxLength: t2,
|
|
562
|
+
placeholder
|
|
563
|
+
} = node.props;
|
|
564
|
+
const maxLength = t2 === undefined ? DEFAULT_MAX_LENGTH : t2;
|
|
565
|
+
const value = binding?.value ?? node.props.value;
|
|
566
|
+
const countId = `${id}-count`;
|
|
567
|
+
const counting = value.length >= maxLength * COUNT_FROM;
|
|
568
|
+
const t3 = !node.complete && PENDING;
|
|
569
|
+
let t4;
|
|
570
|
+
if ($[3] !== t3) {
|
|
571
|
+
t4 = clsx("flex flex-col gap-1.5", t3);
|
|
572
|
+
$[3] = t3;
|
|
573
|
+
$[4] = t4;
|
|
574
|
+
} else {
|
|
575
|
+
t4 = $[4];
|
|
576
|
+
}
|
|
577
|
+
let t5;
|
|
578
|
+
if ($[5] !== children || $[6] !== id) {
|
|
579
|
+
t5 = /*#__PURE__*/_jsx("label", {
|
|
580
|
+
htmlFor: id,
|
|
581
|
+
className: "px-0.5 text-2xs text-text-muted",
|
|
582
|
+
children: children
|
|
583
|
+
});
|
|
584
|
+
$[5] = children;
|
|
585
|
+
$[6] = id;
|
|
586
|
+
$[7] = t5;
|
|
587
|
+
} else {
|
|
588
|
+
t5 = $[7];
|
|
589
|
+
}
|
|
590
|
+
const t6 = binding === null;
|
|
591
|
+
const t7 = counting ? countId : undefined;
|
|
592
|
+
let t8;
|
|
593
|
+
if ($[8] !== binding) {
|
|
594
|
+
t8 = event => binding?.onValueChange(event.target.value);
|
|
595
|
+
$[8] = binding;
|
|
596
|
+
$[9] = t8;
|
|
597
|
+
} else {
|
|
598
|
+
t8 = $[9];
|
|
599
|
+
}
|
|
600
|
+
let t9;
|
|
601
|
+
if ($[10] !== id || $[11] !== maxLength || $[12] !== placeholder || $[13] !== t6 || $[14] !== t7 || $[15] !== t8 || $[16] !== value) {
|
|
602
|
+
t9 = /*#__PURE__*/_jsx(Input, {
|
|
603
|
+
id: id,
|
|
604
|
+
value: value,
|
|
605
|
+
size: "sm",
|
|
606
|
+
maxLength: maxLength,
|
|
607
|
+
placeholder: placeholder,
|
|
608
|
+
disabled: t6,
|
|
609
|
+
"aria-describedby": t7,
|
|
610
|
+
className: "border-transparent bg-ui-tile",
|
|
611
|
+
onChange: t8
|
|
612
|
+
});
|
|
613
|
+
$[10] = id;
|
|
614
|
+
$[11] = maxLength;
|
|
615
|
+
$[12] = placeholder;
|
|
616
|
+
$[13] = t6;
|
|
617
|
+
$[14] = t7;
|
|
618
|
+
$[15] = t8;
|
|
619
|
+
$[16] = value;
|
|
620
|
+
$[17] = t9;
|
|
621
|
+
} else {
|
|
622
|
+
t9 = $[17];
|
|
623
|
+
}
|
|
624
|
+
let t10;
|
|
625
|
+
if ($[18] !== countId || $[19] !== counting || $[20] !== maxLength || $[21] !== t || $[22] !== value.length) {
|
|
626
|
+
t10 = counting && /*#__PURE__*/_jsx("span", {
|
|
627
|
+
id: countId,
|
|
628
|
+
className: "text-xs text-text-muted tabular-nums",
|
|
629
|
+
children: t("blocks.textField.count", {
|
|
630
|
+
used: formatNumber(value.length),
|
|
631
|
+
max: formatNumber(maxLength)
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
$[18] = countId;
|
|
635
|
+
$[19] = counting;
|
|
636
|
+
$[20] = maxLength;
|
|
637
|
+
$[21] = t;
|
|
638
|
+
$[22] = value.length;
|
|
639
|
+
$[23] = t10;
|
|
640
|
+
} else {
|
|
641
|
+
t10 = $[23];
|
|
642
|
+
}
|
|
643
|
+
let t11;
|
|
644
|
+
if ($[24] !== t10 || $[25] !== t4 || $[26] !== t5 || $[27] !== t9) {
|
|
645
|
+
t11 = /*#__PURE__*/_jsxs("div", {
|
|
646
|
+
className: t4,
|
|
647
|
+
children: [t5, t9, t10]
|
|
648
|
+
});
|
|
649
|
+
$[24] = t10;
|
|
650
|
+
$[25] = t4;
|
|
651
|
+
$[26] = t5;
|
|
652
|
+
$[27] = t9;
|
|
653
|
+
$[28] = t11;
|
|
654
|
+
} else {
|
|
655
|
+
t11 = $[28];
|
|
656
|
+
}
|
|
657
|
+
return t11;
|
|
81
658
|
}
|
|
82
659
|
/*
|
|
83
660
|
* Left aligned, never the full width. Like Segmented, each Option is an item by its place, since a value may be any scalar.
|
|
84
661
|
* The text beside its options is its label, drawn above it and read as its name.
|
|
85
662
|
*/
|
|
86
|
-
export function SelectRenderer(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
663
|
+
export function SelectRenderer(t0) {
|
|
664
|
+
const $ = _c(35);
|
|
665
|
+
const {
|
|
666
|
+
node,
|
|
667
|
+
context
|
|
668
|
+
} = t0;
|
|
669
|
+
const {
|
|
670
|
+
t
|
|
671
|
+
} = useTranslation("agent-chat");
|
|
672
|
+
let t1;
|
|
673
|
+
if ($[0] !== context || $[1] !== node) {
|
|
674
|
+
t1 = bindingOf(node, context);
|
|
675
|
+
$[0] = context;
|
|
676
|
+
$[1] = node;
|
|
677
|
+
$[2] = t1;
|
|
678
|
+
} else {
|
|
679
|
+
t1 = $[2];
|
|
680
|
+
}
|
|
681
|
+
const binding = t1;
|
|
682
|
+
const current = binding?.value ?? node.props.value;
|
|
683
|
+
let T0;
|
|
684
|
+
let label;
|
|
685
|
+
let options;
|
|
686
|
+
let t2;
|
|
687
|
+
let t3;
|
|
688
|
+
let t4;
|
|
689
|
+
let t5;
|
|
690
|
+
if ($[3] !== current || $[4] !== node) {
|
|
691
|
+
options = uiChildrenOf(node, "Option").map(_temp3);
|
|
692
|
+
let t6;
|
|
693
|
+
if ($[12] !== node) {
|
|
694
|
+
t6 = uiOwnLabel(node);
|
|
695
|
+
$[12] = node;
|
|
696
|
+
$[13] = t6;
|
|
697
|
+
} else {
|
|
698
|
+
t6 = $[13];
|
|
699
|
+
}
|
|
700
|
+
label = t6;
|
|
701
|
+
const t7 = !node.complete && PENDING;
|
|
702
|
+
if ($[14] !== t7) {
|
|
703
|
+
t4 = clsx("flex flex-col items-start gap-1.5", t7);
|
|
704
|
+
$[14] = t7;
|
|
705
|
+
$[15] = t4;
|
|
706
|
+
} else {
|
|
707
|
+
t4 = $[15];
|
|
708
|
+
}
|
|
709
|
+
if ($[16] !== label) {
|
|
710
|
+
t5 = label !== "" && /*#__PURE__*/_jsx("span", {
|
|
711
|
+
className: "px-0.5 text-2xs text-text-muted",
|
|
712
|
+
children: label
|
|
713
|
+
});
|
|
714
|
+
$[16] = label;
|
|
715
|
+
$[17] = t5;
|
|
716
|
+
} else {
|
|
717
|
+
t5 = $[17];
|
|
718
|
+
}
|
|
719
|
+
T0 = Select;
|
|
720
|
+
t2 = options.find(option_0 => option_0.value === current)?.id ?? null;
|
|
721
|
+
t3 = options.map(_temp4);
|
|
722
|
+
$[3] = current;
|
|
723
|
+
$[4] = node;
|
|
724
|
+
$[5] = T0;
|
|
725
|
+
$[6] = label;
|
|
726
|
+
$[7] = options;
|
|
727
|
+
$[8] = t2;
|
|
728
|
+
$[9] = t3;
|
|
729
|
+
$[10] = t4;
|
|
730
|
+
$[11] = t5;
|
|
731
|
+
} else {
|
|
732
|
+
T0 = $[5];
|
|
733
|
+
label = $[6];
|
|
734
|
+
options = $[7];
|
|
735
|
+
t2 = $[8];
|
|
736
|
+
t3 = $[9];
|
|
737
|
+
t4 = $[10];
|
|
738
|
+
t5 = $[11];
|
|
739
|
+
}
|
|
740
|
+
let t6;
|
|
741
|
+
if ($[18] !== label || $[19] !== t) {
|
|
742
|
+
t6 = label === "" ? t("blocks.options") : label;
|
|
743
|
+
$[18] = label;
|
|
744
|
+
$[19] = t;
|
|
745
|
+
$[20] = t6;
|
|
746
|
+
} else {
|
|
747
|
+
t6 = $[20];
|
|
748
|
+
}
|
|
749
|
+
const t7 = binding === null || options.length === 0;
|
|
750
|
+
let t8;
|
|
751
|
+
if ($[21] !== binding || $[22] !== options) {
|
|
752
|
+
t8 = id => {
|
|
753
|
+
const option_2 = options[Number(id)];
|
|
754
|
+
if (option_2 !== undefined) {
|
|
755
|
+
binding?.onValueChange(option_2.value);
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
$[21] = binding;
|
|
759
|
+
$[22] = options;
|
|
760
|
+
$[23] = t8;
|
|
761
|
+
} else {
|
|
762
|
+
t8 = $[23];
|
|
763
|
+
}
|
|
764
|
+
let t9;
|
|
765
|
+
if ($[24] !== T0 || $[25] !== t2 || $[26] !== t3 || $[27] !== t6 || $[28] !== t7 || $[29] !== t8) {
|
|
766
|
+
t9 = /*#__PURE__*/_jsx(T0, {
|
|
767
|
+
value: t2,
|
|
768
|
+
items: t3,
|
|
769
|
+
label: t6,
|
|
770
|
+
disabled: t7,
|
|
771
|
+
onValueChange: t8
|
|
772
|
+
});
|
|
773
|
+
$[24] = T0;
|
|
774
|
+
$[25] = t2;
|
|
775
|
+
$[26] = t3;
|
|
776
|
+
$[27] = t6;
|
|
777
|
+
$[28] = t7;
|
|
778
|
+
$[29] = t8;
|
|
779
|
+
$[30] = t9;
|
|
780
|
+
} else {
|
|
781
|
+
t9 = $[30];
|
|
782
|
+
}
|
|
783
|
+
let t10;
|
|
784
|
+
if ($[31] !== t4 || $[32] !== t5 || $[33] !== t9) {
|
|
785
|
+
t10 = /*#__PURE__*/_jsxs("div", {
|
|
786
|
+
className: t4,
|
|
787
|
+
children: [t5, t9]
|
|
788
|
+
});
|
|
789
|
+
$[31] = t4;
|
|
790
|
+
$[32] = t5;
|
|
791
|
+
$[33] = t9;
|
|
792
|
+
$[34] = t10;
|
|
793
|
+
} else {
|
|
794
|
+
t10 = $[34];
|
|
795
|
+
}
|
|
796
|
+
return t10;
|
|
98
797
|
}
|
|
99
798
|
/* Runs its local action once its own node closed; like an input, it closes once the block is answered. A label cut to the button's one line reads whole in its tooltip. */
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
799
|
+
function _temp4(option_1) {
|
|
800
|
+
return {
|
|
801
|
+
value: option_1.id,
|
|
802
|
+
label: option_1.label
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
function _temp3(option, index) {
|
|
806
|
+
return {
|
|
807
|
+
id: String(index),
|
|
808
|
+
label: uiNodeLabel(option),
|
|
809
|
+
value: option.props.value
|
|
810
|
+
};
|
|
105
811
|
}
|
|
812
|
+
export function ButtonRenderer(t0) {
|
|
813
|
+
const $ = _c(20);
|
|
814
|
+
const {
|
|
815
|
+
node,
|
|
816
|
+
children,
|
|
817
|
+
context
|
|
818
|
+
} = t0;
|
|
819
|
+
const enabled = node.onAction !== undefined && node.complete && context.answer === null && node.props.disabled !== true;
|
|
820
|
+
let t1;
|
|
821
|
+
if ($[0] !== node) {
|
|
822
|
+
t1 = uiNodeLabel(node);
|
|
823
|
+
$[0] = node;
|
|
824
|
+
$[1] = t1;
|
|
825
|
+
} else {
|
|
826
|
+
t1 = $[1];
|
|
827
|
+
}
|
|
828
|
+
const label = t1;
|
|
829
|
+
const [measure, truncated] = useTruncated();
|
|
830
|
+
const t2 = !node.complete && PENDING;
|
|
831
|
+
let t3;
|
|
832
|
+
if ($[2] !== t2) {
|
|
833
|
+
t3 = clsx(t2);
|
|
834
|
+
$[2] = t2;
|
|
835
|
+
$[3] = t3;
|
|
836
|
+
} else {
|
|
837
|
+
t3 = $[3];
|
|
838
|
+
}
|
|
839
|
+
const t4 = !truncated;
|
|
840
|
+
const t5 = !enabled;
|
|
841
|
+
let t6;
|
|
842
|
+
if ($[4] !== node) {
|
|
843
|
+
t6 = () => node.onAction?.();
|
|
844
|
+
$[4] = node;
|
|
845
|
+
$[5] = t6;
|
|
846
|
+
} else {
|
|
847
|
+
t6 = $[5];
|
|
848
|
+
}
|
|
849
|
+
let t7;
|
|
850
|
+
if ($[6] !== children || $[7] !== measure) {
|
|
851
|
+
t7 = /*#__PURE__*/_jsx("span", {
|
|
852
|
+
ref: measure,
|
|
853
|
+
className: "min-w-0 truncate",
|
|
854
|
+
children: children
|
|
855
|
+
});
|
|
856
|
+
$[6] = children;
|
|
857
|
+
$[7] = measure;
|
|
858
|
+
$[8] = t7;
|
|
859
|
+
} else {
|
|
860
|
+
t7 = $[8];
|
|
861
|
+
}
|
|
862
|
+
let t8;
|
|
863
|
+
if ($[9] !== t5 || $[10] !== t6 || $[11] !== t7) {
|
|
864
|
+
t8 = /*#__PURE__*/_jsx(Button, {
|
|
865
|
+
variant: "secondary",
|
|
866
|
+
size: "sm",
|
|
867
|
+
className: "max-w-full",
|
|
868
|
+
disabled: t5,
|
|
869
|
+
onClick: t6,
|
|
870
|
+
children: t7
|
|
871
|
+
});
|
|
872
|
+
$[9] = t5;
|
|
873
|
+
$[10] = t6;
|
|
874
|
+
$[11] = t7;
|
|
875
|
+
$[12] = t8;
|
|
876
|
+
} else {
|
|
877
|
+
t8 = $[12];
|
|
878
|
+
}
|
|
879
|
+
let t9;
|
|
880
|
+
if ($[13] !== label || $[14] !== t4 || $[15] !== t8) {
|
|
881
|
+
t9 = /*#__PURE__*/_jsx(Tooltip, {
|
|
882
|
+
label: label,
|
|
883
|
+
disabled: t4,
|
|
884
|
+
children: t8
|
|
885
|
+
});
|
|
886
|
+
$[13] = label;
|
|
887
|
+
$[14] = t4;
|
|
888
|
+
$[15] = t8;
|
|
889
|
+
$[16] = t9;
|
|
890
|
+
} else {
|
|
891
|
+
t9 = $[16];
|
|
892
|
+
}
|
|
893
|
+
let t10;
|
|
894
|
+
if ($[17] !== t3 || $[18] !== t9) {
|
|
895
|
+
t10 = /*#__PURE__*/_jsx("div", {
|
|
896
|
+
className: t3,
|
|
897
|
+
children: t9
|
|
898
|
+
});
|
|
899
|
+
$[17] = t3;
|
|
900
|
+
$[18] = t9;
|
|
901
|
+
$[19] = t10;
|
|
902
|
+
} else {
|
|
903
|
+
t10 = $[19];
|
|
904
|
+
}
|
|
905
|
+
return t10;
|
|
906
|
+
}
|