@kabmo-labs/kabmo 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/dist/client/index.html +9 -8
- package/dist/client/index.js +334 -334
- package/dist/client/static/js/{index-zg32n2sk.js → index-297dck9a.js} +784 -791
- package/dist/client/static/js/index-7ppta1pb.css +1 -0
- package/extensions/kabmo-modes/commands.ts +17 -3
- package/extensions/kabmo-modes/goal-start.ts +101 -0
- package/extensions/kabmo-modes/goal.test.ts +80 -5
- package/extensions/kabmo-modes/goal.ts +13 -38
- package/extensions/kabmo-modes/prompts.test.ts +12 -0
- package/extensions/kabmo-modes/prompts.ts +9 -2
- package/index.html +8 -7
- package/package.json +2 -2
- package/src/cli/lib/args.js +9 -0
- package/src/cli/lib/args.test.js +26 -0
- package/src/cli/lib/commands/doctor.js +153 -0
- package/src/cli/lib/commands/doctor.test.js +139 -0
- package/src/cli/lib/commands/serve.js +23 -10
- package/src/cli/lib/commands/status.js +22 -3
- package/src/cli/lib/omp-setup.js +131 -0
- package/src/cli/lib/omp-setup.test.js +115 -0
- package/src/cli/main.js +1 -1
- package/src/client/components/common/DemoDataBadge.tsx +52 -0
- package/src/client/components/common/FolderPicker.tsx +2 -2
- package/src/client/components/common/Modal.tsx +15 -1
- package/src/client/components/common/code-surface/blame-panel.ts +1 -1
- package/src/client/components/common/context-usage-button/index.test.tsx +1 -1
- package/src/client/components/common/context-usage-button/index.tsx +4 -4
- package/src/client/components/common/demo-data-badge.test.tsx +58 -0
- package/src/client/components/common/diagram-viewer/index.tsx +2 -2
- package/src/client/components/common/editor-view-buttons/index.tsx +2 -2
- package/src/client/components/common/header-controls/MoreMenu.tsx +1 -1
- package/src/client/components/common/header-controls/index.tsx +4 -1
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +1 -1
- package/src/client/components/common/panel-mark/index.tsx +2 -1
- package/src/client/components/common/server-control/Panel.tsx +3 -3
- package/src/client/components/common/server-control/index.tsx +1 -1
- package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
- package/src/client/components/common/todo-row/index.tsx +1 -1
- package/src/client/components/layout/ActivityBar.tsx +4 -0
- package/src/client/components/layout/ShellNotice.tsx +33 -0
- package/src/client/components/layout/desktop-layout/index.tsx +14 -16
- package/src/client/components/layout/desktop-layout/resizer/index.tsx +14 -1
- package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +2 -1
- package/src/client/components/layout/session-sidebar/ClassicView.tsx +5 -1
- package/src/client/components/layout/session-sidebar/SessionList.tsx +1 -1
- package/src/client/components/layout/session-sidebar/SessionListNotice.tsx +56 -0
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +2 -0
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +12 -1
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +2 -1
- package/src/client/components/layout/session-sidebar/modern/index.tsx +6 -2
- package/src/client/components/layout/session-sidebar/new-workspace-modal/CloneField.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +2 -2
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +3 -3
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +150 -0
- package/src/client/components/layout/session-sidebar/variant-props.ts +6 -0
- package/src/client/components/mobile/LayoutWrapper.tsx +20 -30
- package/src/client/components/mobile/MainView.tsx +5 -2
- package/src/client/components/mobile/RightSidebar.tsx +1 -1
- package/src/client/components/mobile/SessionSidebar.tsx +3 -0
- package/src/client/components/mobile/mobile-main-view/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +7 -1
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +1 -1
- package/src/client/components/settings/Modal.tsx +15 -1
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +1 -1
- package/src/client/components/settings/Sidebar.tsx +2 -2
- package/src/client/components/settings/categories/OmpSettings.tsx +1 -1
- package/src/client/components/settings/categories/TokenUsageSettings.tsx +1 -1
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +3 -3
- package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ComposerStyleSection.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/GoalSection.tsx +1 -1
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +5 -5
- package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +3 -3
- package/src/client/components/settings/categories/omp-settings/RoleRow.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/LeftDockSettings.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginMark.tsx +4 -3
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/NameInput.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/PathField.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +4 -4
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
- package/src/client/components/settings/categories/token-usage-settings/Breakdown.tsx +4 -4
- package/src/client/components/settings/categories/token-usage-settings/Chart.tsx +2 -2
- package/src/client/components/settings/categories/token-usage-settings/Controls.tsx +1 -1
- package/src/client/components/settings/categories/token-usage-settings/MetricsGrid.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/KenariCard.tsx +5 -5
- package/src/client/components/workspace/browser-panel/AddressBar.tsx +1 -1
- package/src/client/components/workspace/browser-panel/Screencast.tsx +6 -6
- package/src/client/components/workspace/browser-panel/TabStrip.tsx +1 -1
- package/src/client/components/workspace/browser-panel/index.tsx +1 -1
- package/src/client/components/workspace/browser-toolbar/index.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/AttachmentChips.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/GeneratingIndicator.tsx +13 -26
- package/src/client/components/workspace/chat-timeline/GoalNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/MinimapShortcuts.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SubagentView.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ArmedGoalStrip.tsx +71 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +4 -3
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.test.ts +176 -0
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +70 -81
- package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +10 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +20 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +13 -7
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +65 -3
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +69 -19
- package/src/client/components/workspace/chat-timeline/chat-input/WaitingDependencyPicker.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/composer-portal.test.tsx +174 -0
- package/src/client/components/workspace/chat-timeline/chat-input/goal-modal-parts.tsx +80 -0
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +15 -3
- package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FrameControl.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionBlock.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/index.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/Header.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/SelectBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +13 -13
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Checkpoint.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ContextNotes.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +10 -10
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Memory.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +15 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchFs.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SearchTool.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Think.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +4 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +17 -17
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/WebSearch.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ExcerptCode.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/JsonCodeBlock.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/OutputWindow.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +1 -1
- package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
- package/src/client/components/workspace/context-panel/StatsGrid.tsx +1 -1
- package/src/client/components/workspace/context-panel/index.tsx +1 -1
- package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +1 -1
- package/src/client/components/workspace/editor/EmptyEditor.tsx +1 -1
- package/src/client/components/workspace/editor/FindWidget.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.tsx +1 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +1 -1
- package/src/client/components/workspace/file-explorer/OutlineSection.tsx +2 -2
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -1
- package/src/client/components/workspace/file-explorer/index.tsx +1 -1
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
- package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
- package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
- package/src/client/components/workspace/git-panel/FileItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/StashSection.tsx +5 -5
- package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +4 -4
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
- package/src/client/components/workspace/git-panel/index.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/Item.tsx +3 -3
- package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/index.tsx +3 -3
- package/src/client/components/workspace/plan-panel/index.tsx +2 -2
- package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
- package/src/client/components/workspace/repo-picker/Row.tsx +6 -6
- package/src/client/components/workspace/search-panel/Body.tsx +2 -2
- package/src/client/components/workspace/search-panel/Results.tsx +1 -1
- package/src/client/components/workspace/search-panel/index.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
- package/src/client/components/workspace/todo-panel/PhaseGroup.tsx +1 -1
- package/src/client/components/workspace/todo-panel/index.tsx +2 -2
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +5 -5
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.test.tsx +13 -13
- package/src/client/components/workspace/user-browser-panel/AnnotateBar.tsx +4 -4
- package/src/client/components/workspace/user-browser-panel/AnnotateLayer.tsx +1 -1
- package/src/client/components/workspace/user-browser-panel/AnnotateTarget.tsx +7 -7
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/Nav.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
- package/src/client/glass.css +50 -0
- package/src/client/glass.test.ts +68 -24
- package/src/client/hooks/chat/composer/browser-context.test.ts +6 -6
- package/src/client/hooks/chat/composer/use-draft.test.ts +2 -2
- package/src/client/hooks/chat/omp/prompt-send.test.ts +36 -0
- package/src/client/hooks/chat/omp/prompt-send.ts +24 -18
- package/src/client/hooks/chat/omp/session-list.tsx +24 -70
- package/src/client/hooks/chat/omp/session-merges.ts +89 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -1
- package/src/client/hooks/chat/timeline/armed-goal-send.test.ts +168 -0
- package/src/client/hooks/chat/timeline/armed-goal.test.ts +178 -0
- package/src/client/hooks/chat/timeline/goal-command.ts +57 -27
- package/src/client/hooks/chat/timeline/index.ts +7 -4
- package/src/client/hooks/chat/timeline/mode-post.ts +46 -0
- package/src/client/hooks/chat/timeline/modes-contract.ts +94 -0
- package/src/client/hooks/chat/timeline/modes.ts +60 -95
- package/src/client/hooks/chat/timeline/send-props.ts +97 -0
- package/src/client/hooks/chat/timeline/send-steer.test.ts +6 -0
- package/src/client/hooks/chat/timeline/send.test-util.ts +55 -8
- package/src/client/hooks/chat/timeline/send.test.ts +17 -1
- package/src/client/hooks/chat/timeline/send.ts +64 -72
- package/src/client/hooks/ui/dialog-behaviour.ts +143 -0
- package/src/client/hooks/ui/theme.ts +17 -0
- package/src/client/hooks/workspace/copy-tab-path.ts +23 -0
- package/src/client/hooks/workspace/mobile-back.ts +71 -0
- package/src/client/palette-class.test.ts +93 -0
- package/src/client/tailwind-contrast.test.ts +194 -0
- package/src/client/tailwind.css +327 -8
- package/src/server/lib/assets/theme-shell.server.ts +4 -10
- package/src/server/lib/omp/config/provider-seeds.test.ts +39 -1
- package/src/server/lib/omp/config/provider-seeds.ts +32 -3
- package/src/server/lib/omp/config/provider-vision-compat.test.ts +140 -0
- package/src/server/lib/omp/core/host-resolution.test.ts +1 -55
- package/src/server/lib/omp/core/install-hint.test.ts +48 -0
- package/src/server/lib/omp/core/install-hint.ts +64 -0
- package/src/server/lib/omp/core/startup.test.ts +125 -0
- package/src/server/lib/omp/core/startup.ts +5 -1
- package/src/server/lib/omp/mode/request.ts +14 -6
- package/src/server/plugins/ssr.ts +2 -1
- package/src/shared/lib/browser/annotate.test.ts +22 -22
- package/src/shared/lib/browser/annotate.ts +14 -14
- package/src/shared/lib/browser/page-context.ts +6 -6
- package/src/shared/lib/icons/icon-paint-authority.test.ts +86 -0
- package/src/shared/lib/icons/icon-paint-authority.ts +94 -0
- package/src/shared/lib/icons/icon-paint-css.test.ts +139 -25
- package/src/shared/lib/icons/icon-paint-css.ts +76 -50
- package/src/shared/lib/icons/icon-paint-panel.ts +15 -18
- package/src/shared/lib/icons/icon-paint-weight.ts +142 -0
- package/src/shared/lib/icons/icon-tone.ts +58 -13
- package/src/shared/lib/icons/tint-hues.generated.ts +51 -6
- package/src/shared/lib/icons/tint-tones.test.ts +257 -0
- package/src/shared/lib/icons/tint.test.ts +3 -211
- package/src/shared/lib/icons/tint.ts +23 -25
- package/src/shared/lib/omp/mode/actions.ts +40 -0
- package/src/shared/lib/omp/mode/types.ts +12 -0
- package/src/shared/lib/theme/css.ts +21 -0
- package/src/shared/lib/theme/first-frame.ts +38 -0
- package/src/shared/lib/theme/ink-scale.test.ts +151 -0
- package/src/shared/lib/theme/ink-scale.ts +103 -0
- package/src/shared/lib/theme/shell-palette.test.ts +22 -5
- package/src/shared/lib/theme/shell-palette.ts +9 -4
- package/src/shared/lib/theme/theme.test.ts +28 -3
- package/src/shared/lib/workspace/project-accent.test.ts +33 -1
- package/src/shared/lib/workspace/project-accent.ts +23 -0
- package/src/shared/types/omp/agent.ts +24 -9
- package/dist/client/static/js/index-0721wrkf.css +0 -1
|
@@ -81,14 +81,14 @@ describe('isUsableShape', () => {
|
|
|
81
81
|
describe('describeShape', () => {
|
|
82
82
|
test('a box states the region in percent AND the pixel size the panel size makes resolvable', () => {
|
|
83
83
|
expect(describeShape(shape({ note: 'total harga terpotong' }), 1, PANEL))
|
|
84
|
-
.toBe('1.
|
|
84
|
+
.toBe('1. box left 10.0%, top 20.0%, width 20.0%, height 15.0% (205×115 px): total harga terpotong');
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
test('a pin states one point, an arrow states where it points', () => {
|
|
88
88
|
expect(describeShape(shape({ tool: 'pin', note: 'badge salah' }), 2, PANEL))
|
|
89
|
-
.toBe('2.
|
|
89
|
+
.toBe('2. pin at (10.0%, 20.0%) (102×154 px): badge salah');
|
|
90
90
|
expect(describeShape(shape({ tool: 'arrow', end: { x: 0.72, y: 0.185 } }), 3, PANEL))
|
|
91
|
-
.toBe('3.
|
|
91
|
+
.toBe('3. arrow (10.0%, 20.0%) → (72.0%, 18.5%)');
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
test('a mark with no note ends at the geometry, with no dangling separator', () => {
|
|
@@ -104,8 +104,8 @@ describe('describeAnnotations', () => {
|
|
|
104
104
|
shape({ id: 'c', tool: 'pin', start: { x: 0.9, y: 0.1 }, end: { x: 0.9, y: 0.1 }, note: 'tiga' }),
|
|
105
105
|
], PANEL);
|
|
106
106
|
expect(lines).toHaveLength(2);
|
|
107
|
-
expect(lines[0]?.startsWith('1.
|
|
108
|
-
expect(lines[1]?.startsWith('2.
|
|
107
|
+
expect(lines[0]?.startsWith('1. box')).toBe(true);
|
|
108
|
+
expect(lines[1]?.startsWith('2. pin')).toBe(true);
|
|
109
109
|
});
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -150,10 +150,10 @@ describe('readAnnotatePanel', () => {
|
|
|
150
150
|
describe('formatPageContextBlock', () => {
|
|
151
151
|
test('a page with no marks keeps the shape the panel has always produced', () => {
|
|
152
152
|
expect(formatPageContextBlock({ url: 'https://a.test/x', title: 'A' })).toBe([
|
|
153
|
-
'[
|
|
153
|
+
'[Browser page context]',
|
|
154
154
|
'URL: https://a.test/x',
|
|
155
|
-
'
|
|
156
|
-
'(
|
|
155
|
+
'Title: A',
|
|
156
|
+
'(Continue from this page.)',
|
|
157
157
|
].join('\n'));
|
|
158
158
|
});
|
|
159
159
|
|
|
@@ -164,8 +164,8 @@ describe('formatPageContextBlock', () => {
|
|
|
164
164
|
annotations: [shape({ note: 'tombol Bayar nonaktif' })],
|
|
165
165
|
});
|
|
166
166
|
expect(block).toContain('Panel: laptop 1024×768 px @100%');
|
|
167
|
-
expect(block).toContain('
|
|
168
|
-
expect(block).toContain('
|
|
167
|
+
expect(block).toContain('Annotations (1):\n1. box');
|
|
168
|
+
expect(block).toContain('Only the user can see this page');
|
|
169
169
|
});
|
|
170
170
|
|
|
171
171
|
test('a panel size with only unusable marks sends no annotation section at all', () => {
|
|
@@ -174,23 +174,23 @@ describe('formatPageContextBlock', () => {
|
|
|
174
174
|
panel: { width: 100, height: 100, viewportMode: 'responsive', zoom: 100 },
|
|
175
175
|
annotations: [shape({ start: { x: 0.4, y: 0.4 }, end: { x: 0.4, y: 0.4 } })],
|
|
176
176
|
});
|
|
177
|
-
expect(block).not.toContain('
|
|
177
|
+
expect(block).not.toContain('Annotations');
|
|
178
178
|
});
|
|
179
179
|
});
|
|
180
180
|
|
|
181
181
|
describe('appendPageContext', () => {
|
|
182
182
|
test('a blank draft receives the block alone', () => {
|
|
183
|
-
expect(appendPageContext('', { url: 'https://a.test' }).startsWith('[
|
|
183
|
+
expect(appendPageContext('', { url: 'https://a.test' }).startsWith('[Browser page context]')).toBe(true);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
186
|
test('existing text is separated by exactly one blank line', () => {
|
|
187
187
|
expect(appendPageContext('halo', { url: 'https://a.test' })).toBe(
|
|
188
|
-
'halo\n\n[
|
|
188
|
+
'halo\n\n[Browser page context]\nURL: https://a.test\n(Continue from this page.)',
|
|
189
189
|
);
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
test('a draft already ending in a blank line does not gain a third', () => {
|
|
193
|
-
expect(appendPageContext('halo\n\n', { url: 'https://a.test' })).toContain('halo\n\n[
|
|
193
|
+
expect(appendPageContext('halo\n\n', { url: 'https://a.test' })).toContain('halo\n\n[Browser');
|
|
194
194
|
expect(appendPageContext('halo\n\n', { url: 'https://a.test' })).not.toContain('halo\n\n\n');
|
|
195
195
|
});
|
|
196
196
|
});
|
|
@@ -198,12 +198,12 @@ describe('appendPageContext', () => {
|
|
|
198
198
|
describe('label on a mark', () => {
|
|
199
199
|
test('a named region leads the line, so the agent knows WHAT before WHERE', () => {
|
|
200
200
|
expect(describeShape(shape({ label: 'Ringkasan pesanan', note: 'total terpotong' }), 1, PANEL))
|
|
201
|
-
.toBe('1.
|
|
201
|
+
.toBe('1. part "Ringkasan pesanan": box left 10.0%, top 20.0%, width 20.0%, height 15.0% (205×115 px): total terpotong');
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
test('an unnamed mark keeps exactly the line it produced before labels existed', () => {
|
|
205
205
|
expect(describeShape(shape(), 1, PANEL))
|
|
206
|
-
.toBe('1.
|
|
206
|
+
.toBe('1. box left 10.0%, top 20.0%, width 20.0%, height 15.0% (205×115 px)');
|
|
207
207
|
});
|
|
208
208
|
|
|
209
209
|
test('a label alone makes a zero-size mark worth sending', () => {
|
|
@@ -225,11 +225,11 @@ describe('element on a mark', () => {
|
|
|
225
225
|
|
|
226
226
|
test('a readable element adds its path, state and text after the geometry', () => {
|
|
227
227
|
const line = describeShape(shape({ element: select }), 1, PANEL);
|
|
228
|
-
expect(line).toContain('[
|
|
228
|
+
expect(line).toContain('[element: section[aria-label="Ringkasan"] > form > select#prov');
|
|
229
229
|
expect(line).toContain('nilai "Jawa Barat", 5 opsi');
|
|
230
|
-
expect(line).toContain('
|
|
230
|
+
expect(line).toContain('text "Provinsi"');
|
|
231
231
|
// The note still ends the line, after the element facts.
|
|
232
|
-
expect(line.endsWith('px) [
|
|
232
|
+
expect(line.endsWith('px) [element:')).toBe(false);
|
|
233
233
|
});
|
|
234
234
|
|
|
235
235
|
test('an unreadable mark says nothing about elements rather than printing an empty one', () => {
|
|
@@ -273,11 +273,11 @@ describe('viewport resolution hint', () => {
|
|
|
273
273
|
|
|
274
274
|
test('the block states the viewport the coordinates are fractions of', () => {
|
|
275
275
|
const block = formatPageContextBlock(base);
|
|
276
|
-
expect(block).toContain('
|
|
277
|
-
expect(block).toContain('
|
|
276
|
+
expect(block).toContain('Coordinates are relative to a 276×620 px viewport');
|
|
277
|
+
expect(block).toContain('look for the element at that point');
|
|
278
278
|
});
|
|
279
279
|
|
|
280
280
|
test('the hint belongs to an annotated page, not to a plain one', () => {
|
|
281
|
-
expect(formatPageContextBlock({ url: 'https://a.test' })).not.toContain('
|
|
281
|
+
expect(formatPageContextBlock({ url: 'https://a.test' })).not.toContain('Coordinates are relative');
|
|
282
282
|
});
|
|
283
283
|
});
|
|
@@ -69,9 +69,9 @@ export function isUsableShape(shape: Pick<AnnotateShape, 'start' | 'end' | 'note
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export const ANNOTATE_TOOL_LABEL: Record<AnnotateTool, string> = {
|
|
72
|
-
box: '
|
|
73
|
-
pin: '
|
|
74
|
-
arrow: '
|
|
72
|
+
box: 'box',
|
|
73
|
+
pin: 'pin',
|
|
74
|
+
arrow: 'arrow',
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
/**
|
|
@@ -85,19 +85,19 @@ export const ANNOTATE_TOOL_LABEL: Record<AnnotateTool, string> = {
|
|
|
85
85
|
export const ANNOTATE_LABEL_SUGGESTIONS = [
|
|
86
86
|
'header',
|
|
87
87
|
'nav',
|
|
88
|
-
'
|
|
88
|
+
'content',
|
|
89
89
|
'form',
|
|
90
|
-
'
|
|
91
|
-
'
|
|
90
|
+
'table',
|
|
91
|
+
'list',
|
|
92
92
|
'modal',
|
|
93
93
|
'sidebar',
|
|
94
94
|
'footer',
|
|
95
95
|
] as const;
|
|
96
96
|
|
|
97
|
-
/** `
|
|
97
|
+
/** `part "Checkout summary": ` for a named mark, nothing for an unnamed one. */
|
|
98
98
|
function labelPrefix(label: string | undefined): string {
|
|
99
99
|
const name = label?.trim();
|
|
100
|
-
return name ? `
|
|
100
|
+
return name ? `part "${name}": ` : '';
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/** What the mark sits on, when the frame was readable. */
|
|
@@ -106,8 +106,8 @@ function elementSuffix(element: AnnotateShape['element']): string {
|
|
|
106
106
|
const facts = [element.path];
|
|
107
107
|
if (element.role) facts.push(`role ${element.role}`);
|
|
108
108
|
if (element.state) facts.push(element.state);
|
|
109
|
-
if (element.text) facts.push(`
|
|
110
|
-
return ` [
|
|
109
|
+
if (element.text) facts.push(`text "${element.text}"`);
|
|
110
|
+
return ` [element: ${facts.join(' · ')}]`;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/** `12.0%` — one decimal, which is precise enough to re-find a spot by hand. */
|
|
@@ -137,18 +137,18 @@ export function describeShape(
|
|
|
137
137
|
const tool = ANNOTATE_TOOL_LABEL[shape.tool];
|
|
138
138
|
const head = `${index}. ${labelPrefix(shape.label)}${tool}`;
|
|
139
139
|
const note = shape.note.trim();
|
|
140
|
-
const tail = note.length > 0 ?
|
|
140
|
+
const tail = note.length > 0 ? `: ${note}` : '';
|
|
141
141
|
const element = elementSuffix(shape.element);
|
|
142
142
|
|
|
143
|
-
if (shape.tool === 'pin') return `${head}
|
|
143
|
+
if (shape.tool === 'pin') return `${head} at ${where} ${spot}${element}${tail}`;
|
|
144
144
|
if (shape.tool === 'arrow') {
|
|
145
145
|
const to = `(${percent(shape.end.x)}, ${percent(shape.end.y)})`;
|
|
146
146
|
return `${head} ${where} → ${to}${element}${tail}`;
|
|
147
147
|
}
|
|
148
148
|
const region = shapeRegion(shape);
|
|
149
|
-
const size = `
|
|
149
|
+
const size = `width ${percent(region.width)}, height ${percent(region.height)}`;
|
|
150
150
|
const pixels = `(${px(region.width, panel.width)}×${px(region.height, panel.height)} px)`;
|
|
151
|
-
return `${head}
|
|
151
|
+
return `${head} left ${percent(region.x)}, top ${percent(region.y)}, ${size} ${pixels}${element}${tail}`;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
/** Every usable mark, described and numbered from 1 in draw order. */
|
|
@@ -36,8 +36,8 @@ export function emitBrowserPageContext(detail: BrowserPageContext): void {
|
|
|
36
36
|
* so the agent knows to open the URL itself before acting.
|
|
37
37
|
*/
|
|
38
38
|
export function formatPageContextBlock(detail: BrowserPageContext): string {
|
|
39
|
-
const lines = ['[
|
|
40
|
-
if (detail.title) lines.push(`
|
|
39
|
+
const lines = ['[Browser page context]', `URL: ${detail.url}`];
|
|
40
|
+
if (detail.title) lines.push(`Title: ${detail.title}`);
|
|
41
41
|
|
|
42
42
|
const panel = detail.panel;
|
|
43
43
|
const description = detail.annotations && panel
|
|
@@ -47,17 +47,17 @@ export function formatPageContextBlock(detail: BrowserPageContext): string {
|
|
|
47
47
|
lines.push(`Panel: ${panel.viewportMode} ${Math.round(panel.width)}×${Math.round(panel.height)} px @${panel.zoom}%`);
|
|
48
48
|
}
|
|
49
49
|
if (description.length > 0 && panel) {
|
|
50
|
-
lines.push(`
|
|
51
|
-
lines.push('
|
|
50
|
+
lines.push(`Annotations (${description.length}):`, ...description);
|
|
51
|
+
lines.push('Only the user can see this page: open the URL above yourself before changing anything.');
|
|
52
52
|
// The coordinates are fractions of the panel the user was looking at, not
|
|
53
53
|
// of whatever viewport the agent opens. Saying so is what lets the agent
|
|
54
54
|
// resolve them (`elementFromPoint` at the same box, or scaled) instead of
|
|
55
55
|
// treating a percentage as an absolute position.
|
|
56
56
|
lines.push(
|
|
57
|
-
`
|
|
57
|
+
`Coordinates are relative to a ${Math.round(panel.width)}×${Math.round(panel.height)} px viewport; open the page at that size and look for the element at that point.`,
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
lines.push('(
|
|
60
|
+
lines.push('(Continue from this page.)');
|
|
61
61
|
return lines.join('\n');
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Where a call site outranks the icon colour mode.
|
|
8
|
+
*
|
|
9
|
+
* Two rules, and both are a measured defect rather than a preference:
|
|
10
|
+
*
|
|
11
|
+
* - **An author's signal class.** Twenty-two glyphs carried `text-error`,
|
|
12
|
+
* `text-success`, `text-warning` or `text-info` to say what they MEANT, and
|
|
13
|
+
* the mode repainted every one with its hashed hue — it discarded the only
|
|
14
|
+
* colour information the call site had.
|
|
15
|
+
* - **A solid signal fill.** `bg-error text-canvas` is a filled destructive
|
|
16
|
+
* button, and the glyph was painted in the same red as its own fill: 1.00:1.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { describe, expect, test } from 'bun:test';
|
|
20
|
+
import { iconPaintStyleSheet } from '@/shared/lib/icons/icon-paint-css';
|
|
21
|
+
|
|
22
|
+
const css = iconPaintStyleSheet();
|
|
23
|
+
|
|
24
|
+
describe('an author class is authority', () => {
|
|
25
|
+
test('every signal class a glyph can carry resolves to its palette token', () => {
|
|
26
|
+
// The mode paints by hue, and a hue is only the answer to "this icon said
|
|
27
|
+
// nothing". Twenty-two call sites say something — a `LogOut` on a destructive
|
|
28
|
+
// provider action, a `Play` on a successful eval, an `Info` on a reconnect —
|
|
29
|
+
// and every one of them was repainted with its hashed hue the moment the
|
|
30
|
+
// setting was turned on.
|
|
31
|
+
for (const [token, value] of [
|
|
32
|
+
['text-error', 'var(--theme-error)'],
|
|
33
|
+
['text-success', 'var(--theme-success)'],
|
|
34
|
+
['text-warning', 'var(--theme-warning)'],
|
|
35
|
+
['text-info', 'var(--theme-info)'],
|
|
36
|
+
['text-meta', 'var(--theme-meta)'],
|
|
37
|
+
] as const) {
|
|
38
|
+
expect(css).toContain(`:where([data-icon-style="color"]) :where(svg[class~="${token}"]) { --icon-color: ${value}; }`);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('the slashed form is the same statement at a weight', () => {
|
|
43
|
+
// `text-error/60` is six live call sites; without a rule for the slashed
|
|
44
|
+
// token the icon falls back to the hue while the class says otherwise.
|
|
45
|
+
expect(css).toContain(
|
|
46
|
+
':where([data-icon-style="color"]) :where(svg[class~="text-error/60"]) { --icon-color: oklch(from var(--theme-error) l calc(c * 0.6) h); }',
|
|
47
|
+
);
|
|
48
|
+
// A weight scales chroma and leaves lightness — the same rule the ink
|
|
49
|
+
// weights obey, so a muted signal does not go dark.
|
|
50
|
+
const slashed = css.split('\n').filter((line) => /class~="text-(error|success|warning|info|meta)\/\d+"/.test(line));
|
|
51
|
+
expect(slashed.length).toBeGreaterThan(0);
|
|
52
|
+
for (const line of slashed) expect(line, line.slice(0, 80)).toContain('oklch(from');
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test('a token matches one class WORD, never a substring', () => {
|
|
56
|
+
// `[class*=…]` would also fire on `group-hover:text-error`, painting the
|
|
57
|
+
// resting glyph red — the defect the ink weights were fixed for.
|
|
58
|
+
const authorRules = css.split('\n').filter((line) => line.includes('svg[class~="text-'));
|
|
59
|
+
expect(authorRules.length).toBeGreaterThan(0);
|
|
60
|
+
for (const line of authorRules) expect(line, line.slice(0, 80)).toContain('[class~="');
|
|
61
|
+
expect(css).not.toContain('svg[class*="text-');
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
describe('a solid signal fill owns its foreground', () => {
|
|
66
|
+
test('an icon on bg-error/success/warning/info takes the inherited colour', () => {
|
|
67
|
+
// `bg-error text-canvas` is a filled destructive button — Delete, Close, the
|
|
68
|
+
// mobile save — and the glyph was painted in the SAME red as its fill:
|
|
69
|
+
// measured in the running console, `Trash2` computed rgb(200,50,30) on
|
|
70
|
+
// rgb(200,50,30), 1.00:1, a blank square where a bin should be.
|
|
71
|
+
expect(css).toContain(
|
|
72
|
+
'[data-icon-style="color"] :where([class~="bg-error"], [class~="bg-success"], [class~="bg-warning"], [class~="bg-info"]) svg.lucide { color: currentColor; }',
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('a TINTED signal chip keeps its hue', () => {
|
|
77
|
+
// `bg-error/10` is a different class token, so the rule above cannot catch a
|
|
78
|
+
// chip that merely borrows the signal as a wash.
|
|
79
|
+
expect(css).not.toContain('[class*="bg-error');
|
|
80
|
+
expect(css).not.toContain('bg-error/');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
test('a plugin mark on the fill takes it too', () => {
|
|
84
|
+
expect(css).toContain(':where([class~="bg-error"], [class~="bg-success"]');
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The two surfaces where the call site OUTRANKS the colour mode.
|
|
8
|
+
*
|
|
9
|
+
* Split out of `icon-paint-css.ts` so both files stay readable, not because the
|
|
10
|
+
* rules are independent: they are one of the families that sheet concatenates.
|
|
11
|
+
*
|
|
12
|
+
* The mode's contract is "paint an icon that said nothing". Both rules here take
|
|
13
|
+
* an icon that DID say something and give it the value it asked for — one by
|
|
14
|
+
* name (`text-error`), one by the surface it sits on (a solid signal fill). They
|
|
15
|
+
* are the only rules in the sheet whose job is to STOP the generated hue.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The weights an author's signal class actually uses (`text-error/60`,
|
|
20
|
+
* `text-success/90`, …). Measured over `src/client/**`: 29 slashed call sites,
|
|
21
|
+
* every one of them in this set. A step not listed here falls back to the hue,
|
|
22
|
+
* which is the old behaviour for a class this build has never seen.
|
|
23
|
+
*/
|
|
24
|
+
const AUTHOR_COLOUR_STEPS = [60, 70, 80, 90] as const;
|
|
25
|
+
|
|
26
|
+
/** The signal classes a call site may write, and the token each one means. */
|
|
27
|
+
const AUTHOR_COLOURS: ReadonlyArray<readonly [string, string]> = [
|
|
28
|
+
['text-error', 'var(--theme-error)'],
|
|
29
|
+
['text-success', 'var(--theme-success)'],
|
|
30
|
+
['text-warning', 'var(--theme-warning)'],
|
|
31
|
+
['text-info', 'var(--theme-info)'],
|
|
32
|
+
['text-meta', 'var(--theme-meta)'],
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An AUTHOR's colour on a glyph is a decision, not a default to overwrite.
|
|
37
|
+
*
|
|
38
|
+
* The mode paints by hue, and a hue is only ever the answer to "this icon said
|
|
39
|
+
* nothing". Twenty-two call sites say something: a `LogOut` on a destructive
|
|
40
|
+
* provider action is `text-error`, a `Play` on a successful eval is
|
|
41
|
+
* `text-success`, an `Info` about a reconnect is `text-info`. Every one of them
|
|
42
|
+
* was silently repainted with its hashed hue the moment the setting was turned
|
|
43
|
+
* on, so the mode DISCARDED the only colour information the call site had.
|
|
44
|
+
*
|
|
45
|
+
* `--icon-color`, not `color`: the value then flows through the same paint and
|
|
46
|
+
* weight rules as every other source, so a slashed mute and the hover variants
|
|
47
|
+
* keep working instead of being frozen at full strength.
|
|
48
|
+
*
|
|
49
|
+
* `[class~=…]`, never `[class*=…]`: a substring match also fires on the VARIANT
|
|
50
|
+
* token, so `group-hover:text-error` would paint the resting icon red — the
|
|
51
|
+
* defect `icon-paint-weight.ts` documents for the ink weights.
|
|
52
|
+
*/
|
|
53
|
+
export function authorColourRules(): string[] {
|
|
54
|
+
const rules: string[] = [];
|
|
55
|
+
for (const [token, value] of AUTHOR_COLOURS) {
|
|
56
|
+
rules.push(`:where([data-icon-style="color"]) :where(svg[class~="${token}"]) { --icon-color: ${value}; }`);
|
|
57
|
+
// The SLASHED form is the same statement at a weight, so it has to resolve
|
|
58
|
+
// `--icon-color` too, or the icon falls back to the hue while the class says
|
|
59
|
+
// otherwise. The formula is the one `inkWeightRules` uses: scale chroma,
|
|
60
|
+
// never lightness.
|
|
61
|
+
for (const step of AUTHOR_COLOUR_STEPS) {
|
|
62
|
+
rules.push(
|
|
63
|
+
`:where([data-icon-style="color"]) :where(svg[class~="${token}/${step}"]) { --icon-color: oklch(from ${value} l calc(c * ${step / 100}) h); }`,
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return rules;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Inside a SOLID signal fill, the glyph takes the surface's own foreground.
|
|
72
|
+
*
|
|
73
|
+
* `bg-error text-canvas` is a filled destructive button — Delete, Close, the
|
|
74
|
+
* mobile save-and-recreate — and the colour mode painted the glyph in the same
|
|
75
|
+
* red as the fill it sits on: measured in the running console, `Trash2` on the
|
|
76
|
+
* Delete button computed `rgb(200, 50, 30)` on `rgb(200, 50, 30)`, **1.00:1**,
|
|
77
|
+
* a white space where a bin should be. A hue is tuned for paper; a signal fill
|
|
78
|
+
* is the signal used as paper, so the surface's declared foreground is the only
|
|
79
|
+
* value that is right on it — exactly the argument `invertedSurfaceRules` makes
|
|
80
|
+
* for `bg-ink`.
|
|
81
|
+
*
|
|
82
|
+
* `[class~="bg-error"]` matches the SOLID class only: Tailwind spells a tinted
|
|
83
|
+
* one `bg-error/10`, a different token, so a tinted chip keeps its hue. Stated
|
|
84
|
+
* after `paintRules` at the same (0,2,1) so it wins on order.
|
|
85
|
+
*/
|
|
86
|
+
export function solidSignalFillRules(): string[] {
|
|
87
|
+
const scope = ['bg-error', 'bg-success', 'bg-warning', 'bg-info']
|
|
88
|
+
.map((token) => `[class~="${token}"]`)
|
|
89
|
+
.join(', ');
|
|
90
|
+
return [
|
|
91
|
+
`[data-icon-style="color"] :where(${scope}) svg.lucide { color: currentColor; }`,
|
|
92
|
+
`:where([data-icon-style="color"]) :where(${scope}) :where([data-plugin-mark]) { --plugin-color: currentColor; }`,
|
|
93
|
+
];
|
|
94
|
+
}
|