@agimon-ai/po-web-components 0.0.0-alpha.2 → 0.0.0-alpha.21
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/LICENSE +191 -1
- package/README.md +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CfX6zgs1.d.mts → @modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts} +5 -6
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-D4NN8WsG.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.d.mts +2 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/compat.d.mts +8 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/compat.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.d.mts +21 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/errors.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.d.mts +15 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/parse.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.d.mts +169 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/classic/schemas.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.d.mts +38 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/api.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.d.mts +63 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/checks.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.d.mts +50 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/core.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/errors.d.mts +3 -87
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/errors.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/json-schema.d.mts +1 -26
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/json-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/registries.d.mts +3 -7
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/registries.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/schemas.d.mts +10 -405
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/schemas.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/standard-schema.d.mts +1 -1
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/standard-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/to-json-schema.d.mts +4 -33
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.d.mts +38 -0
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/util.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/{zod@4.6.5 → zod@4.6.6}/node_modules/zod/v4/core/versions.d.mts +1 -1
- package/dist/node_modules/.pnpm/zod@4.6.6/node_modules/zod/v4/core/versions.d.mts.map +1 -0
- package/dist/packages/core/po-core/dist/mcpWidget.d.mts +2 -2
- package/dist/packages/core/po-core/dist/src/web/types/mcpWidget.d.mts +3 -3
- package/dist/packages/core/po-core/dist/web.d.mts +2 -2
- package/dist/packages/core/po-web-components/src/components/Accordion.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Accordion.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/AgentAvatar.d.mts +14 -0
- package/dist/packages/core/po-web-components/src/components/AgentAvatar.d.mts.map +1 -0
- package/dist/packages/core/po-web-components/src/components/AgentAvatar.mjs +2 -0
- package/dist/packages/core/po-web-components/src/components/AgentAvatar.mjs.map +1 -0
- package/dist/packages/core/po-web-components/src/components/AnsiText.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/AnsiText.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Avatar.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Avatar.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Badge.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Badge.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Breadcrumb.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Button.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Button.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Button.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Checkbox.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Checkbox.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/CodeBlock.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/CodeBlock.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/CodeEditorView.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/CodeEditorView.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Command.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Command.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/CopyButton.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/CopyButton.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Dialog.d.mts +1 -1
- package/dist/packages/core/po-web-components/src/components/Dialog.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Dialog.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/DiffView.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/DiffView.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Dot.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Dot.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Drawer.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Drawer.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/DropdownMenu.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/EmptyState.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/EmptyState.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/HashlineLines.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Input.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Input.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Kbd.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Kbd.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Label.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Label.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Markdown.d.mts +1 -0
- package/dist/packages/core/po-web-components/src/components/Markdown.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Markdown.mjs +2 -2
- package/dist/packages/core/po-web-components/src/components/Markdown.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/McpApp.d.mts +5 -4
- package/dist/packages/core/po-web-components/src/components/McpApp.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/components/McpApp.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.d.mts +3 -3
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs +2 -2
- package/dist/packages/core/po-web-components/src/components/McpToolWidget.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/MediaPreview.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/MermaidDiagram.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/MessageItem.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/MessageItem.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/MessageLines.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/MessageLines.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/OptionList.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/OptionList.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Panel.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Panel.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/PdfPreview.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Picker.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Picker.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Popover.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Popover.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Progress.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Progress.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/RadioGroup.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/RadioGroup.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/ReviewCommentDraft.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/ScrollArea.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/ScrollArea.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/SectionLabel.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/SectionLabel.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Select.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Select.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Separator.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Separator.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Settings.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Settings.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Sheet.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Sheet.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Skeleton.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Skeleton.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/StatusBadge.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/StatusBadge.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/StreamCursor.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/StreamCursor.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Switch.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Switch.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Tabs.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Tabs.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Toast.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Toast.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/ToolPathLink.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/components/Tooltip.mjs +1 -1
- package/dist/packages/core/po-web-components/src/components/Tooltip.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/icons/icons.d.mts +2 -2
- package/dist/packages/core/po-web-components/src/icons/icons.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/ansiSpans.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/lib/editorTheme.d.mts +19 -19
- package/dist/packages/core/po-web-components/src/lib/editorTheme.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/lib/editorTheme.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/editorTheme.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/hashlineHighlight.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/lib/hashlineView.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/hashlineView.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.d.mts +2 -2
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.mjs +1 -1
- package/dist/packages/core/po-web-components/src/lib/syntaxHighlight.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.d.mts +1 -1
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.mjs +1 -1
- package/dist/packages/core/po-web-components/src/theme/builtinThemes.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/theme/derive.mjs +1 -1
- package/dist/packages/core/po-web-components/src/theme/derive.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.d.mts +2 -2
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.mjs +1 -1
- package/dist/packages/core/po-web-components/src/theme/nativeTheme.mjs.map +1 -1
- package/dist/packages/core/po-web-components/src/types/theme.d.mts +1 -1
- package/dist/packages/core/po-web-components/src/types/theme.d.mts.map +1 -1
- package/dist/packages/core/po-web-components/src/types/theme.mjs +1 -1
- package/dist/packages/core/po-web-components/src/types/theme.mjs.map +1 -1
- package/dist/packages/core/po-web-components/themes/po-nord-dark.mjs +2 -0
- package/dist/packages/core/po-web-components/themes/po-nord-dark.mjs.map +1 -0
- package/dist/packages/core/po-web-components/themes/po-one-light.mjs +2 -0
- package/dist/packages/core/po-web-components/themes/po-one-light.mjs.map +1 -0
- package/dist/src/components/Accordion.cjs +1 -1
- package/dist/src/components/Accordion.cjs.map +1 -1
- package/dist/src/components/AgentAvatar.cjs +2 -0
- package/dist/src/components/AgentAvatar.cjs.map +1 -0
- package/dist/src/components/AnsiText.cjs +1 -1
- package/dist/src/components/AnsiText.cjs.map +1 -1
- package/dist/src/components/Avatar.cjs +1 -1
- package/dist/src/components/Avatar.cjs.map +1 -1
- package/dist/src/components/Badge.cjs +1 -1
- package/dist/src/components/Badge.cjs.map +1 -1
- package/dist/src/components/Breadcrumb.cjs +1 -1
- package/dist/src/components/Breadcrumb.cjs.map +1 -1
- package/dist/src/components/Button.cjs +1 -1
- package/dist/src/components/Button.cjs.map +1 -1
- package/dist/src/components/Checkbox.cjs +1 -1
- package/dist/src/components/Checkbox.cjs.map +1 -1
- package/dist/src/components/CodeBlock.cjs +1 -1
- package/dist/src/components/CodeBlock.cjs.map +1 -1
- package/dist/src/components/CodeEditorView.cjs +1 -1
- package/dist/src/components/CodeEditorView.cjs.map +1 -1
- package/dist/src/components/Command.cjs +1 -1
- package/dist/src/components/Command.cjs.map +1 -1
- package/dist/src/components/CopyButton.cjs +1 -1
- package/dist/src/components/CopyButton.cjs.map +1 -1
- package/dist/src/components/Dialog.cjs +1 -1
- package/dist/src/components/Dialog.cjs.map +1 -1
- package/dist/src/components/DiffView.cjs +1 -1
- package/dist/src/components/DiffView.cjs.map +1 -1
- package/dist/src/components/Dot.cjs +1 -1
- package/dist/src/components/Dot.cjs.map +1 -1
- package/dist/src/components/Drawer.cjs +1 -1
- package/dist/src/components/Drawer.cjs.map +1 -1
- package/dist/src/components/DropdownMenu.cjs +1 -1
- package/dist/src/components/DropdownMenu.cjs.map +1 -1
- package/dist/src/components/EmptyState.cjs +1 -1
- package/dist/src/components/EmptyState.cjs.map +1 -1
- package/dist/src/components/HashlineLines.cjs +1 -1
- package/dist/src/components/HashlineLines.cjs.map +1 -1
- package/dist/src/components/Input.cjs +1 -1
- package/dist/src/components/Input.cjs.map +1 -1
- package/dist/src/components/Kbd.cjs +1 -1
- package/dist/src/components/Kbd.cjs.map +1 -1
- package/dist/src/components/Label.cjs +1 -1
- package/dist/src/components/Label.cjs.map +1 -1
- package/dist/src/components/Markdown.cjs +2 -2
- package/dist/src/components/Markdown.cjs.map +1 -1
- package/dist/src/components/McpApp.cjs.map +1 -1
- package/dist/src/components/McpToolWidget.cjs +2 -2
- package/dist/src/components/McpToolWidget.cjs.map +1 -1
- package/dist/src/components/MediaPreview.cjs +1 -1
- package/dist/src/components/MediaPreview.cjs.map +1 -1
- package/dist/src/components/MermaidDiagram.cjs +1 -1
- package/dist/src/components/MermaidDiagram.cjs.map +1 -1
- package/dist/src/components/MessageItem.cjs +1 -1
- package/dist/src/components/MessageItem.cjs.map +1 -1
- package/dist/src/components/MessageLines.cjs +1 -1
- package/dist/src/components/MessageLines.cjs.map +1 -1
- package/dist/src/components/OptionList.cjs +1 -1
- package/dist/src/components/OptionList.cjs.map +1 -1
- package/dist/src/components/Panel.cjs +1 -1
- package/dist/src/components/Panel.cjs.map +1 -1
- package/dist/src/components/PdfPreview.cjs +1 -1
- package/dist/src/components/PdfPreview.cjs.map +1 -1
- package/dist/src/components/Picker.cjs +1 -1
- package/dist/src/components/Picker.cjs.map +1 -1
- package/dist/src/components/Popover.cjs +1 -1
- package/dist/src/components/Popover.cjs.map +1 -1
- package/dist/src/components/Progress.cjs +1 -1
- package/dist/src/components/Progress.cjs.map +1 -1
- package/dist/src/components/RadioGroup.cjs +1 -1
- package/dist/src/components/RadioGroup.cjs.map +1 -1
- package/dist/src/components/ReviewCommentDraft.cjs +1 -1
- package/dist/src/components/ReviewCommentDraft.cjs.map +1 -1
- package/dist/src/components/ScrollArea.cjs +1 -1
- package/dist/src/components/ScrollArea.cjs.map +1 -1
- package/dist/src/components/SectionLabel.cjs +1 -1
- package/dist/src/components/SectionLabel.cjs.map +1 -1
- package/dist/src/components/Select.cjs +1 -1
- package/dist/src/components/Select.cjs.map +1 -1
- package/dist/src/components/Separator.cjs +1 -1
- package/dist/src/components/Separator.cjs.map +1 -1
- package/dist/src/components/Settings.cjs +1 -1
- package/dist/src/components/Settings.cjs.map +1 -1
- package/dist/src/components/Sheet.cjs +1 -1
- package/dist/src/components/Sheet.cjs.map +1 -1
- package/dist/src/components/Skeleton.cjs +1 -1
- package/dist/src/components/Skeleton.cjs.map +1 -1
- package/dist/src/components/StatusBadge.cjs +1 -1
- package/dist/src/components/StatusBadge.cjs.map +1 -1
- package/dist/src/components/StreamCursor.cjs +1 -1
- package/dist/src/components/StreamCursor.cjs.map +1 -1
- package/dist/src/components/Switch.cjs +1 -1
- package/dist/src/components/Switch.cjs.map +1 -1
- package/dist/src/components/Tabs.cjs +1 -1
- package/dist/src/components/Tabs.cjs.map +1 -1
- package/dist/src/components/Toast.cjs +1 -1
- package/dist/src/components/Toast.cjs.map +1 -1
- package/dist/src/components/ToolPathLink.cjs +1 -1
- package/dist/src/components/ToolPathLink.cjs.map +1 -1
- package/dist/src/components/Tooltip.cjs +1 -1
- package/dist/src/components/Tooltip.cjs.map +1 -1
- package/dist/src/icons/icons.cjs +1 -1
- package/dist/src/lib/ansiSpans.cjs +1 -1
- package/dist/src/lib/ansiSpans.cjs.map +1 -1
- package/dist/src/lib/editorTheme.cjs +1 -1
- package/dist/src/lib/editorTheme.cjs.map +1 -1
- package/dist/src/lib/hashlineHighlight.cjs +1 -1
- package/dist/src/lib/hashlineHighlight.cjs.map +1 -1
- package/dist/src/lib/hashlineView.cjs +1 -1
- package/dist/src/lib/hashlineView.cjs.map +1 -1
- package/dist/src/lib/syntaxHighlight.cjs +1 -1
- package/dist/src/lib/syntaxHighlight.cjs.map +1 -1
- package/dist/src/theme/builtinThemes.cjs +1 -1
- package/dist/src/theme/builtinThemes.cjs.map +1 -1
- package/dist/src/theme/derive.cjs +1 -1
- package/dist/src/theme/derive.cjs.map +1 -1
- package/dist/src/theme/nativeTheme.cjs +1 -1
- package/dist/src/theme/nativeTheme.cjs.map +1 -1
- package/dist/src/types/theme.cjs +1 -1
- package/dist/src/types/theme.cjs.map +1 -1
- package/dist/themes/po-nord-dark.cjs +2 -0
- package/dist/themes/po-nord-dark.cjs.map +1 -0
- package/dist/themes/po-one-light.cjs +2 -0
- package/dist/themes/po-one-light.cjs.map +1 -0
- package/package.json +18 -18
- package/styles/mcp.css +11 -11
- package/styles/preview.css +1 -1
- package/styles/theme.css +118 -119
- package/themes/{doom-nord-dark.json → po-nord-dark.json} +1 -1
- package/themes/{doom-one-light.json → po-one-light.json} +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CfX6zgs1.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_server@2.2.0/node_modules/@modelcontextprotocol/server/dist/index.d.mts +0 -2
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.d.mts +0 -20
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.d.mts +0 -50
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/deep-partial.d.mts +0 -10
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/deep-partial.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.mts +0 -33
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.d.mts +0 -28
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/from-json-schema.d.mts +0 -14
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/from-json-schema.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/in-out.d.mts +0 -13
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/in-out.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.d.mts +0 -13
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.mts +0 -54
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.mts +0 -775
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.mts +0 -331
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.mts +0 -296
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.d.mts +0 -67
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.mts +0 -85
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.d.mts +0 -18
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.d.mts +0 -24
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-generator.d.mts +0 -67
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-generator.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.d.mts +0 -12
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.d.mts +0 -18
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.d.mts +0 -54
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.d.mts +0 -94
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/standard-schema.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.mts +0 -237
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/index.d.mts +0 -29
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/index.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ar.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ar.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/az.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/az.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/be.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bg.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bg.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bn.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/bn.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ca.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ca.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ckb.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ckb.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/cs.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/cs.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/da.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/da.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/de.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/de.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/el.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/el.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/eo.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/eo.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/es.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/es.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fa.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fa.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fi.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fi.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr-CA.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr-CA.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/fr.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/gu.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/gu.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/he.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/he.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hi.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hi.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hr.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hr.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hu.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hu.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/hy.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/id.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/id.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/index.d.mts +0 -69
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/index.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/is.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/is.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/it.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/it.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ja.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ja.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ka.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ka.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kh.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kh.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/km.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/km.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kn.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/kn.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ko.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ko.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/mk.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/mk.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ms.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ms.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ne.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ne.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nl.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nl.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nn.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/nn.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/no.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/no.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ota.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ota.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pl.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pl.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ps.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ps.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt-BR.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt-BR.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/pt.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ro.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ro.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ru.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sk.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sk.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sl.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sl.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sv.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/sv.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ta.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ta.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tg.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tg.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/th.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/th.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tk.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tk.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tr.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/tr.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ua.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ua.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uk.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uk.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ur.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/ur.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uz.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/uz.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/vi.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/vi.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/yo.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/yo.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-CN.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-CN.d.mts.map +0 -1
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-TW.d.mts +0 -8
- package/dist/node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/zh-TW.d.mts.map +0 -1
- package/dist/packages/core/po-web-components/themes/doom-nord-dark.mjs +0 -2
- package/dist/packages/core/po-web-components/themes/doom-nord-dark.mjs.map +0 -1
- package/dist/packages/core/po-web-components/themes/doom-one-dark.mjs +0 -2
- package/dist/packages/core/po-web-components/themes/doom-one-dark.mjs.map +0 -1
- package/dist/packages/core/po-web-components/themes/doom-one-light.mjs +0 -2
- package/dist/packages/core/po-web-components/themes/doom-one-light.mjs.map +0 -1
- package/dist/themes/doom-nord-dark.cjs +0 -2
- package/dist/themes/doom-nord-dark.cjs.map +0 -1
- package/dist/themes/doom-one-dark.cjs +0 -2
- package/dist/themes/doom-one-dark.cjs.map +0 -1
- package/dist/themes/doom-one-light.cjs +0 -2
- package/dist/themes/doom-one-light.cjs.map +0 -1
- package/themes/doom-one-dark.json +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.cjs","names":["SwitchPrimitive","cn","require_cn","radix_ui","react_jsx_runtime","Switch","props","className"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-
|
|
1
|
+
{"version":3,"file":"Switch.cjs","names":["SwitchPrimitive","cn","require_cn","radix_ui","react_jsx_runtime","Switch","props","className"],"sources":["../../../src/components/Switch.tsx"],"sourcesContent":["import { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** An on/off track; use it where the change takes effect immediately, a checkbox where it needs a save. */\nexport function Switch({ className, ...props }: ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n className={cn(\n 'inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border border-po-border bg-po-deep p-px outline-none transition-colors focus-visible:ring-2 focus-visible:ring-po-green/50 disabled:pointer-events-none disabled:opacity-40 data-[state=checked]:border-po-green data-[state=checked]:bg-po-tint-green',\n className,\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className=\"block h-3 w-3 rounded-full bg-po-faint transition-transform data-[state=checked]:translate-x-3 data-[state=checked]:bg-po-green\"\n />\n </SwitchPrimitive.Root>\n );\n}\n"],"mappings":"0FAMA,SAAgBK,EAAO,CAAE,YAAW,GAAGC,GAAsD,CAC3F,MACE,iBAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,OAAgB,KAAjB,CACE,YAAU,SACV,UAAWC,EAAAA,GACT,+TACAM,CACF,EACA,GAAID,EAEJ,SAAA,iBAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,OAAgB,MAAjB,CACE,YAAU,eACV,UAAU,iIACX,CAAA,CACmB,CAAA,CAE1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority");const i=(0,r.cva)(`flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-base font-medium transition-colors outline-none`,{variants:{active:{true:`bg-
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority");const i=(0,r.cva)(`flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-base font-medium transition-colors outline-none`,{variants:{active:{true:`bg-po-tint-green font-semibold text-po-green`,false:`text-po-dim hover:bg-po-panel hover:text-po-hi`}},defaultVariants:{active:!1}}),a=(0,r.cva)(`flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-semibold`,{variants:{active:{true:`bg-po-green text-po-rail`,false:`bg-po-panel text-po-dim`}},defaultVariants:{active:!1}});function o({className:r,active:a,asChild:o=!1,...s}){let c=o?t.Slot.Root:`a`;return/* @__PURE__ */ (0,n.jsx)(c,{"data-slot":`nav-tab`,"data-active":a??!1,className:e.cn(i({active:a}),r),...s})}function s({className:t,active:r,...i}){return/* @__PURE__ */ (0,n.jsx)(`span`,{"data-slot":`nav-tab-badge`,className:e.cn(a({active:r}),t),...i})}function c(e){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Root,{"data-slot":`tabs`,...e})}function l({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.List,{"data-slot":`tabs-list`,className:e.cn(`flex items-center gap-1`,r),...i})}function u({className:r,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Trigger,{"data-slot":`tabs-trigger`,className:e.cn(i({active:!1}),`data-[state=active]:bg-po-tint-green data-[state=active]:font-semibold data-[state=active]:text-po-green`,r),...a})}function d({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Tabs.Content,{"data-slot":`tabs-content`,className:e.cn(`min-h-0 flex-1`,r),...i})}exports.NavTab=o,exports.NavTabBadge=s,exports.Tabs=c,exports.TabsContent=d,exports.TabsList=l,exports.TabsTrigger=u,exports.tabBadgeVariants=a,exports.tabVariants=i;
|
|
2
2
|
//# sourceMappingURL=Tabs.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.cjs","names":["cva","Slot","cn","TabsPrimitive","require_cn","radix_ui","react_jsx_runtime","class_variance_authority","tabVariants","tabBadgeVariants","NavTab","props","Component","asChild","active","className","NavTabBadge","Tabs","TabsList","TabsTrigger","TabsContent"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * The look a tab wears, whether Radix drives it or a router link does. It is\n * exported because the cockpit's own tabs navigate routes rather than swap\n * panels, and a link that looks like a tab must not be a second implementation.\n */\nexport const tabVariants = cva(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-base font-medium transition-colors outline-none',\n {\n variants: {\n active: {\n true: 'bg-
|
|
1
|
+
{"version":3,"file":"Tabs.cjs","names":["cva","Slot","cn","TabsPrimitive","require_cn","radix_ui","react_jsx_runtime","class_variance_authority","tabVariants","tabBadgeVariants","NavTab","props","Component","asChild","active","className","NavTabBadge","Tabs","TabsList","TabsTrigger","TabsContent"],"sources":["../../../src/components/Tabs.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { Slot } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/**\n * The look a tab wears, whether Radix drives it or a router link does. It is\n * exported because the cockpit's own tabs navigate routes rather than swap\n * panels, and a link that looks like a tab must not be a second implementation.\n */\nexport const tabVariants = cva(\n 'flex min-h-6 min-w-6 cursor-pointer items-center gap-1.5 rounded px-2 py-1 text-base font-medium transition-colors outline-none',\n {\n variants: {\n active: {\n true: 'bg-po-tint-green font-semibold text-po-green',\n false: 'text-po-dim hover:bg-po-panel hover:text-po-hi',\n },\n },\n defaultVariants: { active: false },\n },\n);\n\n/** The count a tab carries; it inverts on the active tab so it stays readable on the tint. */\nexport const tabBadgeVariants = cva(\n 'flex h-[15px] min-w-[15px] items-center justify-center rounded-full px-1 text-2xs font-semibold',\n {\n variants: {\n active: {\n true: 'bg-po-green text-po-rail',\n false: 'bg-po-panel text-po-dim',\n },\n },\n defaultVariants: { active: false },\n },\n);\n\nexport interface NavTabProps extends ComponentProps<'a'>, VariantProps<typeof tabVariants> {\n /** Render the child element instead of an <a>, so a router Link can be the tab. */\n asChild?: boolean;\n}\n\n/**\n * A tab that navigates. Radix Tabs owns panels and roving focus over content\n * it renders; a route-driven tab strip has neither, so it gets the styling and\n * leaves the semantics to the router.\n */\nexport function NavTab({ className, active, asChild = false, ...props }: NavTabProps) {\n const Component = asChild ? Slot.Root : 'a';\n return (\n <Component\n data-slot=\"nav-tab\"\n data-active={active ?? false}\n className={cn(tabVariants({ active }), className)}\n {...props}\n />\n );\n}\n\n/** The count beside a tab's label. */\nexport function NavTabBadge({\n className,\n active,\n ...props\n}: ComponentProps<'span'> & VariantProps<typeof tabBadgeVariants>) {\n return <span data-slot=\"nav-tab-badge\" className={cn(tabBadgeVariants({ active }), className)} {...props} />;\n}\n\n/** Radix Tabs, for a surface that swaps panels in place rather than navigating. */\nexport function Tabs(props: ComponentProps<typeof TabsPrimitive.Root>) {\n return <TabsPrimitive.Root data-slot=\"tabs\" {...props} />;\n}\n\nexport function TabsList({ className, ...props }: ComponentProps<typeof TabsPrimitive.List>) {\n return <TabsPrimitive.List data-slot=\"tabs-list\" className={cn('flex items-center gap-1', className)} {...props} />;\n}\n\nexport function TabsTrigger({ className, ...props }: ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n tabVariants({ active: false }),\n 'data-[state=active]:bg-po-tint-green data-[state=active]:font-semibold data-[state=active]:text-po-green',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function TabsContent({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) {\n return <TabsPrimitive.Content data-slot=\"tabs-content\" className={cn('min-h-0 flex-1', className)} {...props} />;\n}\n"],"mappings":"gIAYA,MAAaQ,GAAA,EAAcR,EAAAA,IAAAA,CACzB,kIACA,CACE,SAAU,CACR,OAAQ,CACN,KAAM,+CACN,MAAO,gDACT,CACF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAGaS,GAAA,EAAmBT,EAAAA,IAAAA,CAC9B,kGACA,CACE,SAAU,CACR,OAAQ,CACN,KAAM,2BACN,MAAO,yBACT,CACF,EACA,gBAAiB,CAAE,OAAQ,EAAM,CACnC,CACF,EAYA,SAAgBU,EAAO,CAAE,YAAW,SAAQ,UAAU,GAAO,GAAGC,GAAsB,CACpF,IAAMC,EAAYC,EAAUZ,EAAAA,KAAK,KAAO,IACxC,MACE,iBAAA,EAAAK,EAAA,IAAA,CAACM,EAAD,CACE,YAAU,UACV,cAAaE,GAAU,GACvB,UAAWZ,EAAAA,GAAGM,EAAY,CAAE,QAAO,CAAC,EAAGO,CAAS,EAChD,GAAIJ,CACL,CAAA,CAEL,CAGA,SAAgBK,EAAY,CAC1B,YACA,SACA,GAAGL,GAC8D,CACjE,MAAO,iBAAA,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,YAAU,gBAAgB,UAAWJ,EAAAA,GAAGO,EAAiB,CAAE,QAAO,CAAC,EAAGM,CAAS,EAAG,GAAIJ,CAAQ,CAAA,CAC7G,CAGA,SAAgBM,EAAK,EAAkD,CACrE,MAAO,iBAAA,EAAAX,EAAA,IAAA,CAACH,EAAAA,KAAc,KAAf,CAAoB,YAAU,OAAO,GAAIQ,CAAQ,CAAA,CAC1D,CAEA,SAAgBO,EAAS,CAAE,YAAW,GAAGP,GAAoD,CAC3F,MAAO,iBAAA,EAAAL,EAAA,IAAA,CAACH,EAAAA,KAAc,KAAf,CAAoB,YAAU,YAAY,UAAWD,EAAAA,GAAG,0BAA2Ba,CAAS,EAAG,GAAIJ,CAAQ,CAAA,CACpH,CAEA,SAAgBQ,EAAY,CAAE,YAAW,GAAGR,GAAuD,CACjG,MACE,iBAAA,EAAAL,EAAA,IAAA,CAACH,EAAAA,KAAc,QAAf,CACE,YAAU,eACV,UAAWD,EAAAA,GACTM,EAAY,CAAE,OAAQ,EAAM,CAAC,EAC7B,2GACAO,CACF,EACA,GAAIJ,CACL,CAAA,CAEL,CAEA,SAAgBS,EAAY,CAAE,YAAW,GAAGT,GAAuD,CACjG,MAAO,iBAAA,EAAAL,EAAA,IAAA,CAACH,EAAAA,KAAc,QAAf,CAAuB,YAAU,eAAe,UAAWD,EAAAA,GAAG,iBAAkBa,CAAS,EAAG,GAAIJ,CAAQ,CAAA,CACjH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Provider,{...e})}function o({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Viewport,{"data-slot":`toast-viewport`,className:e.cn(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,r),...i})}const s=(0,r.cva)(`flex items-start gap-3 rounded-md border bg-
|
|
1
|
+
require("../icons/icons.cjs");const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime"),r=require("class-variance-authority"),i=require("lucide-react");function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Provider,{...e})}function o({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Viewport,{"data-slot":`toast-viewport`,className:e.cn(`fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none`,r),...i})}const s=(0,r.cva)(`flex items-start gap-3 rounded-md border bg-po-panel px-3 py-2.5 shadow-2xl data-[state=open]:animate-po-rise`,{variants:{tone:{neutral:`border-po-border`,running:`border-po-edge-yellow`,ok:`border-po-edge-green`,error:`border-po-edge-red`,info:`border-po-edge-blue`,accent:`border-po-edge-magenta`}},defaultVariants:{tone:`neutral`}});function c({className:r,tone:i,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Root,{"data-slot":`toast`,className:e.cn(s({tone:i}),r),...a})}function l({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Title,{"data-slot":`toast-title`,className:e.cn(`text-base font-semibold text-po-hi`,r),...i})}function u({className:r,...i}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Description,{"data-slot":`toast-description`,className:e.cn(`text-sm leading-relaxed text-po-dim`,r),...i})}function d(e){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Action,{"data-slot":`toast-action`,...e})}function f({className:r,...a}){return/* @__PURE__ */ (0,n.jsx)(t.Toast.Close,{"data-slot":`toast-close`,"aria-label":`dismiss`,className:e.cn(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-po-faint transition-colors hover:text-po-hi`,r),...a,children:/* @__PURE__ */ (0,n.jsx)(i.X,{className:`h-3 w-3`})})}exports.Toast=c,exports.ToastAction=d,exports.ToastClose=f,exports.ToastDescription=u,exports.ToastProvider=a,exports.ToastTitle=l,exports.ToastViewport=o,exports.toastVariants=s;
|
|
2
2
|
//# sourceMappingURL=Toast.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","names":["ToastPrimitive","cn","cva","CloseIcon","require_cn","radix_ui","react_jsx_runtime","class_variance_authority","lucide_react","ToastProvider","props","ToastViewport","className","toastVariants","Toast","ToastTitle","ToastDescription","ToastAction","ToastClose"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport type { StatusTone } from '../types/tone';\n\n/**\n * A transient notice. Radix owns the part that is easy to get wrong: it\n * announces through a live region, pauses its timer on hover and on window\n * blur, and restores focus when it leaves. Mount one ToastProvider and one\n * ToastViewport per page.\n */\nexport function ToastProvider(props: ComponentProps<typeof ToastPrimitive.Provider>) {\n return <ToastPrimitive.Provider {...props} />;\n}\n\nexport function ToastViewport({ className, ...props }: ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn('fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport const toastVariants = cva(\n 'flex items-start gap-3 rounded-md border bg-
|
|
1
|
+
{"version":3,"file":"Toast.cjs","names":["ToastPrimitive","cn","cva","CloseIcon","require_cn","radix_ui","react_jsx_runtime","class_variance_authority","lucide_react","ToastProvider","props","ToastViewport","className","toastVariants","Toast","ToastTitle","ToastDescription","ToastAction","ToastClose"],"sources":["../../../src/components/Toast.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { CloseIcon } from '../icons/icons';\nimport { cn } from '../lib/cn';\nimport type { StatusTone } from '../types/tone';\n\n/**\n * A transient notice. Radix owns the part that is easy to get wrong: it\n * announces through a live region, pauses its timer on hover and on window\n * blur, and restores focus when it leaves. Mount one ToastProvider and one\n * ToastViewport per page.\n */\nexport function ToastProvider(props: ComponentProps<typeof ToastPrimitive.Provider>) {\n return <ToastPrimitive.Provider {...props} />;\n}\n\nexport function ToastViewport({ className, ...props }: ComponentProps<typeof ToastPrimitive.Viewport>) {\n return (\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n className={cn('fixed right-4 bottom-4 z-50 flex w-[360px] max-w-full flex-col gap-2 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport const toastVariants = cva(\n 'flex items-start gap-3 rounded-md border bg-po-panel px-3 py-2.5 shadow-2xl data-[state=open]:animate-po-rise',\n {\n variants: {\n tone: {\n neutral: 'border-po-border',\n running: 'border-po-edge-yellow',\n ok: 'border-po-edge-green',\n error: 'border-po-edge-red',\n info: 'border-po-edge-blue',\n accent: 'border-po-edge-magenta',\n } satisfies Record<StatusTone, string>,\n },\n defaultVariants: { tone: 'neutral' },\n },\n);\n\nexport interface ToastProps extends ComponentProps<typeof ToastPrimitive.Root>, VariantProps<typeof toastVariants> {}\n\nexport function Toast({ className, tone, ...props }: ToastProps) {\n return <ToastPrimitive.Root data-slot=\"toast\" className={cn(toastVariants({ tone }), className)} {...props} />;\n}\n\nexport function ToastTitle({ className, ...props }: ComponentProps<typeof ToastPrimitive.Title>) {\n return (\n <ToastPrimitive.Title\n data-slot=\"toast-title\"\n className={cn('text-base font-semibold text-po-hi', className)}\n {...props}\n />\n );\n}\n\nexport function ToastDescription({ className, ...props }: ComponentProps<typeof ToastPrimitive.Description>) {\n return (\n <ToastPrimitive.Description\n data-slot=\"toast-description\"\n className={cn('text-sm leading-relaxed text-po-dim', className)}\n {...props}\n />\n );\n}\n\nexport function ToastAction(props: ComponentProps<typeof ToastPrimitive.Action>) {\n return <ToastPrimitive.Action data-slot=\"toast-action\" {...props} />;\n}\n\nexport function ToastClose({ className, ...props }: ComponentProps<typeof ToastPrimitive.Close>) {\n return (\n <ToastPrimitive.Close\n data-slot=\"toast-close\"\n aria-label=\"dismiss\"\n className={cn(\n 'inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-po-faint transition-colors hover:text-po-hi',\n className,\n )}\n {...props}\n >\n <CloseIcon className=\"h-3 w-3\" />\n </ToastPrimitive.Close>\n );\n}\n"],"mappings":"wLAcA,SAAgBS,EAAc,EAAuD,CACnF,MAAO,iBAAA,EAAAH,EAAA,I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rE,CAEA,SAAgBQ,EAAW,CAAE,YAAW,GAAGR,GAAsD,CAC/F,MACE,iBAAA,EAAAJ,EAAA,IAAA,CAACN,EAAAA,MAAe,MAAhB,CACE,YAAU,cACV,aAAW,UACX,UAAWC,EAAAA,GACT,mIACAW,CACF,EACA,GAAIF,EAEJ,SAAA,iBAAA,EAAAJ,EAAA,IAAA,CAACH,EAAAA,EAAD,CAAW,UAAU,SAAW,CAAA,CACZ,CAAA,CAE1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({path:n,onOpen:r,className:i,"data-testid":a=`tool-path`,...o}){return r===void 0?/* @__PURE__ */ (0,t.jsx)(`span`,{"data-slot":`tool-path`,"data-testid":a,className:e.cn(`inline-block max-w-full min-w-0 truncate align-bottom text-
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("react/jsx-runtime");function n({path:n,onOpen:r,className:i,"data-testid":a=`tool-path`,...o}){return r===void 0?/* @__PURE__ */ (0,t.jsx)(`span`,{"data-slot":`tool-path`,"data-testid":a,className:e.cn(`inline-block max-w-full min-w-0 truncate align-bottom text-po-text`,i),...o,children:n}):/* @__PURE__ */ (0,t.jsx)(`button`,{type:`button`,"data-slot":`tool-path`,"data-testid":a,title:`open ${n}`,onClick:r,className:e.cn(`min-h-6 max-w-full min-w-0 cursor-pointer truncate text-left text-po-text hover:text-po-blue hover:underline`,i),...o,children:n})}exports.ToolPathLink=n;
|
|
2
2
|
//# sourceMappingURL=ToolPathLink.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolPathLink.cjs","names":["cn","require_cn","react_jsx_runtime","ToolPathLink","testId","props","onOpen","className","path"],"sources":["../../../src/components/ToolPathLink.tsx"],"sourcesContent":["import { cn } from '../lib/cn';\n\n/**\n * The file path in a tool call's header, as a link when something can open it.\n *\n * A read, a write and an edit all put a path in the same place, and a reader\n * who wants to see that file should not have to go looking for it in a file\n * list. Whether the path can be opened is not this component's business: the\n * host resolves it against whatever plugin owns files, and hands the answer\n * down as `onOpen`. Without one the path stays exactly what it was, plain\n * text, because a link that opens nothing is worse than no link.\n */\n\nexport interface ToolPathLinkProps {\n path: string;\n /** Opens the file; omitted when nothing installed can show it. */\n onOpen?: () => void;\n className?: string;\n /** Defaults to `tool-path`, which is how a test finds the link inside a call header. */\n 'data-testid'?: string;\n}\n\nexport function ToolPathLink({\n path,\n onOpen,\n className,\n 'data-testid': testId = 'tool-path',\n ...props\n}: ToolPathLinkProps) {\n if (onOpen === undefined) {\n return (\n <span\n data-slot=\"tool-path\"\n data-testid={testId}\n className={cn('inline-block max-w-full min-w-0 truncate align-bottom text-
|
|
1
|
+
{"version":3,"file":"ToolPathLink.cjs","names":["cn","require_cn","react_jsx_runtime","ToolPathLink","testId","props","onOpen","className","path"],"sources":["../../../src/components/ToolPathLink.tsx"],"sourcesContent":["import { cn } from '../lib/cn';\n\n/**\n * The file path in a tool call's header, as a link when something can open it.\n *\n * A read, a write and an edit all put a path in the same place, and a reader\n * who wants to see that file should not have to go looking for it in a file\n * list. Whether the path can be opened is not this component's business: the\n * host resolves it against whatever plugin owns files, and hands the answer\n * down as `onOpen`. Without one the path stays exactly what it was, plain\n * text, because a link that opens nothing is worse than no link.\n */\n\nexport interface ToolPathLinkProps {\n path: string;\n /** Opens the file; omitted when nothing installed can show it. */\n onOpen?: () => void;\n className?: string;\n /** Defaults to `tool-path`, which is how a test finds the link inside a call header. */\n 'data-testid'?: string;\n}\n\nexport function ToolPathLink({\n path,\n onOpen,\n className,\n 'data-testid': testId = 'tool-path',\n ...props\n}: ToolPathLinkProps) {\n if (onOpen === undefined) {\n return (\n <span\n data-slot=\"tool-path\"\n data-testid={testId}\n className={cn('inline-block max-w-full min-w-0 truncate align-bottom text-po-text', className)}\n {...props}\n >\n {path}\n </span>\n );\n }\n return (\n <button\n type=\"button\"\n data-slot=\"tool-path\"\n data-testid={testId}\n title={`open ${path}`}\n onClick={onOpen}\n className={cn(\n 'min-h-6 max-w-full min-w-0 cursor-pointer truncate text-left text-po-text hover:text-po-blue hover:underline',\n className,\n )}\n {...props}\n >\n {path}\n </button>\n );\n}\n"],"mappings":"oEAsBA,SAAgBG,EAAa,CAC3B,OACA,SACA,YACA,cAAeC,EAAS,YACxB,GAAGC,GACiB,CAapB,OAZIC,IAAW,IAAA,GAEX,iBAAA,EAAAJ,EAAA,IAAA,CAAC,OAAD,CACE,YAAU,YACV,cAAaE,EACb,UAAWJ,EAAAA,GAAG,qEAAsEO,CAAS,EAC7F,GAAIF,EAEH,SAAAG,CACG,CAAA,EAIR,iBAAA,EAAAN,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,YAAU,YACV,cAAaE,EACb,MAAO,QAAQI,IACf,QAASF,EACT,UAAWN,EAAAA,GACT,+GACAO,CACF,EACA,GAAIF,EAEH,SAAAG,CACK,CAAA,CAEZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({delayDuration:e=300,...r}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Root,{"data-slot":`tooltip`,...e})}function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Content,{"data-slot":`tooltip-content`,sideOffset:i,className:e.cn(`z-50 rounded border border-
|
|
1
|
+
const e=require("../lib/cn.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({delayDuration:e=300,...r}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Provider,{"data-slot":`tooltip-provider`,delayDuration:e,...r})}function i(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Root,{"data-slot":`tooltip`,...e})}function a(e){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Trigger,{"data-slot":`tooltip-trigger`,...e})}function o({className:r,sideOffset:i=4,children:a,...o}){return/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Portal,{children:/* @__PURE__ */ (0,n.jsx)(t.Tooltip.Content,{"data-slot":`tooltip-content`,sideOffset:i,className:e.cn(`z-50 rounded border border-po-border bg-po-deep px-2 py-1 text-sm text-po-text shadow-lg data-[state=delayed-open]:animate-po-fade`,r),...o,children:a})})}exports.Tooltip=i,exports.TooltipContent=o,exports.TooltipProvider=r,exports.TooltipTrigger=a;
|
|
2
2
|
//# sourceMappingURL=Tooltip.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","names":["TooltipPrimitive","cn","require_cn","radix_ui","react_jsx_runtime","TooltipProvider","props","Tooltip","TooltipTrigger","TooltipContent","className"],"sources":["../../../src/components/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** Mount once near the root; every Tooltip below shares its delay. */\nexport function TooltipProvider({ delayDuration = 300, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />;\n}\n\nexport function Tooltip(props: ComponentProps<typeof TooltipPrimitive.Root>) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nexport function TooltipContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'z-50 rounded border border-
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","names":["TooltipPrimitive","cn","require_cn","radix_ui","react_jsx_runtime","TooltipProvider","props","Tooltip","TooltipTrigger","TooltipContent","className"],"sources":["../../../src/components/Tooltip.tsx"],"sourcesContent":["import { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../lib/cn';\n\n/** Mount once near the root; every Tooltip below shares its delay. */\nexport function TooltipProvider({ delayDuration = 300, ...props }: ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />;\n}\n\nexport function Tooltip(props: ComponentProps<typeof TooltipPrimitive.Root>) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nexport function TooltipContent({\n className,\n sideOffset = 4,\n children,\n ...props\n}: ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'z-50 rounded border border-po-border bg-po-deep px-2 py-1 text-sm text-po-text shadow-lg data-[state=delayed-open]:animate-po-fade',\n className,\n )}\n {...props}\n >\n {children}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n"],"mappings":"0FAMA,SAAgBK,EAAgB,CAAE,gBAAgB,IAAK,GAAGC,GAA2D,CACnH,MAAO,iBAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,QAAiB,SAAlB,CAA2B,YAAU,mBAAkC,gBAAe,GAAIM,CAAQ,CAAA,CAC3G,CAEA,SAAgBC,EAAQ,EAAqD,CAC3E,MAAO,iBAAA,EAAAH,EAAA,IAAA,CAACJ,EAAAA,QAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAIM,CAAQ,CAAA,CAChE,CAEA,SAAgBE,EAAe,EAAwD,CACrF,MAAO,iBAAA,EAAAJ,EAAA,IAAA,CAACJ,EAAAA,QAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAIM,CAAQ,CAAA,CAC3E,CAEA,SAAgBG,EAAe,CAC7B,YACA,aAAa,EACb,WACA,GAAGH,GAC+C,CAClD,MACE,iBAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,QAAiB,OAAlB,CAAA,SACE,iBAAA,EAAAI,EAAA,IAAA,CAACJ,EAAAA,QAAiB,QAAlB,CACE,YAAU,kBACE,aACZ,UAAWC,EAAAA,GACT,qIACAS,CACF,EACA,GAAIJ,EAEH,UACuB,CAAA,CACH,CAAA,CAE7B"}
|
package/dist/src/icons/icons.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
let e=require("lucide-react");Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return e.Activity}}),Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return e.CircleAlert}}),Object.defineProperty(exports,"ArrowRightIcon",{enumerable:!0,get:function(){return e.ArrowRight}}),Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return e.AudioLines}}),Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return e.BookmarkPlus}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return e.GitBranch}}),Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return e.Check}}),Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return e.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return e.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return e.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return e.X}}),Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return e.Copy}}),Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return e.Pencil}}),Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return e.CornerDownLeft}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return e.ExternalLink}}),Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return e.FileText}}),Object.defineProperty(exports,"FolderIcon",{enumerable:!0,get:function(){return e.Folder}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return e.GitFork}}),Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return e.Settings}}),Object.defineProperty(exports,"GlobeIcon",{enumerable:!0,get:function(){return e.Globe}}),Object.defineProperty(exports,"HomeIcon",{enumerable:!0,get:function(){return e.House}}),Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return e.MoreVertical}}),Object.defineProperty(exports,"LightbulbIcon",{enumerable:!0,get:function(){return e.Lightbulb}}),Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return e.Loader2}}),Object.defineProperty(exports,"LockIcon",{enumerable:!0,get:function(){return e.Lock}}),Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return e.MessageCircle}}),Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return e.Mic}}),Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return e.Palette}}),Object.defineProperty(exports,"PaperclipIcon",{enumerable:!0,get:function(){return e.Paperclip}}),Object.defineProperty(exports,"PlayCircleIcon",{enumerable:!0,get:function(){return e.CirclePlay}}),Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return e.Plus}}),Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return e.Quote}}),Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return e.RefreshCw}}),Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return e.Rewind}}),Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return e.Search}}),Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return e.Send}}),Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return e.ShieldCheck}}),Object.defineProperty(exports,"SparklesIcon",{enumerable:!0,get:function(){return e.Sparkles}}),Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return e.Square}}),Object.defineProperty(exports,"TaskIcon",{enumerable:!0,get:function(){return e.SquareCheckBig}}),Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return e.Trash2}}),Object.defineProperty(exports,"UnlockIcon",{enumerable:!0,get:function(){return e.LockOpen}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return e.UserRound}}),Object.defineProperty(exports,"UsersIcon",{enumerable:!0,get:function(){return e.Users}}),Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return e.Volume2}}),Object.defineProperty(exports,"WorkflowIcon",{enumerable:!0,get:function(){return e.Workflow}}),Object.defineProperty(exports,"WrenchIcon",{enumerable:!0,get:function(){return e.Wrench}});
|
|
1
|
+
let e=require("lucide-react");Object.defineProperty(exports,"ActivityIcon",{enumerable:!0,get:function(){return e.Activity}}),Object.defineProperty(exports,"AlertIcon",{enumerable:!0,get:function(){return e.CircleAlert}}),Object.defineProperty(exports,"ArrowRightIcon",{enumerable:!0,get:function(){return e.ArrowRight}}),Object.defineProperty(exports,"AudioLinesIcon",{enumerable:!0,get:function(){return e.AudioLines}}),Object.defineProperty(exports,"BookmarkPlusIcon",{enumerable:!0,get:function(){return e.BookmarkPlus}}),Object.defineProperty(exports,"BranchIcon",{enumerable:!0,get:function(){return e.GitBranch}}),Object.defineProperty(exports,"CheckIcon",{enumerable:!0,get:function(){return e.Check}}),Object.defineProperty(exports,"ChevronDownIcon",{enumerable:!0,get:function(){return e.ChevronDown}}),Object.defineProperty(exports,"ChevronRightIcon",{enumerable:!0,get:function(){return e.ChevronRight}}),Object.defineProperty(exports,"ChevronUpIcon",{enumerable:!0,get:function(){return e.ChevronUp}}),Object.defineProperty(exports,"CloseIcon",{enumerable:!0,get:function(){return e.X}}),Object.defineProperty(exports,"CopyIcon",{enumerable:!0,get:function(){return e.Copy}}),Object.defineProperty(exports,"EditIcon",{enumerable:!0,get:function(){return e.Pencil}}),Object.defineProperty(exports,"EnterIcon",{enumerable:!0,get:function(){return e.CornerDownLeft}}),Object.defineProperty(exports,"ExternalLinkIcon",{enumerable:!0,get:function(){return e.ExternalLink}}),Object.defineProperty(exports,"FileIcon",{enumerable:!0,get:function(){return e.FileText}}),Object.defineProperty(exports,"FolderIcon",{enumerable:!0,get:function(){return e.Folder}}),Object.defineProperty(exports,"ForkIcon",{enumerable:!0,get:function(){return e.GitFork}}),Object.defineProperty(exports,"GearIcon",{enumerable:!0,get:function(){return e.Settings}}),Object.defineProperty(exports,"GlobeIcon",{enumerable:!0,get:function(){return e.Globe}}),Object.defineProperty(exports,"GridIcon",{enumerable:!0,get:function(){return e.LayoutGrid}}),Object.defineProperty(exports,"HomeIcon",{enumerable:!0,get:function(){return e.House}}),Object.defineProperty(exports,"ImageIcon",{enumerable:!0,get:function(){return e.Image}}),Object.defineProperty(exports,"KebabIcon",{enumerable:!0,get:function(){return e.MoreVertical}}),Object.defineProperty(exports,"LightbulbIcon",{enumerable:!0,get:function(){return e.Lightbulb}}),Object.defineProperty(exports,"ListIcon",{enumerable:!0,get:function(){return e.List}}),Object.defineProperty(exports,"LoaderIcon",{enumerable:!0,get:function(){return e.Loader2}}),Object.defineProperty(exports,"LockIcon",{enumerable:!0,get:function(){return e.Lock}}),Object.defineProperty(exports,"MessageIcon",{enumerable:!0,get:function(){return e.MessageCircle}}),Object.defineProperty(exports,"MicIcon",{enumerable:!0,get:function(){return e.Mic}}),Object.defineProperty(exports,"PaletteIcon",{enumerable:!0,get:function(){return e.Palette}}),Object.defineProperty(exports,"PaperclipIcon",{enumerable:!0,get:function(){return e.Paperclip}}),Object.defineProperty(exports,"PlayCircleIcon",{enumerable:!0,get:function(){return e.CirclePlay}}),Object.defineProperty(exports,"PlusIcon",{enumerable:!0,get:function(){return e.Plus}}),Object.defineProperty(exports,"QuoteIcon",{enumerable:!0,get:function(){return e.Quote}}),Object.defineProperty(exports,"RefreshIcon",{enumerable:!0,get:function(){return e.RefreshCw}}),Object.defineProperty(exports,"RewindIcon",{enumerable:!0,get:function(){return e.Rewind}}),Object.defineProperty(exports,"SearchIcon",{enumerable:!0,get:function(){return e.Search}}),Object.defineProperty(exports,"SendIcon",{enumerable:!0,get:function(){return e.Send}}),Object.defineProperty(exports,"ShieldIcon",{enumerable:!0,get:function(){return e.ShieldCheck}}),Object.defineProperty(exports,"SlidersIcon",{enumerable:!0,get:function(){return e.SlidersHorizontal}}),Object.defineProperty(exports,"SparklesIcon",{enumerable:!0,get:function(){return e.Sparkles}}),Object.defineProperty(exports,"StopIcon",{enumerable:!0,get:function(){return e.Square}}),Object.defineProperty(exports,"TaskIcon",{enumerable:!0,get:function(){return e.SquareCheckBig}}),Object.defineProperty(exports,"TrashIcon",{enumerable:!0,get:function(){return e.Trash2}}),Object.defineProperty(exports,"UnlockIcon",{enumerable:!0,get:function(){return e.LockOpen}}),Object.defineProperty(exports,"UserIcon",{enumerable:!0,get:function(){return e.UserRound}}),Object.defineProperty(exports,"UsersIcon",{enumerable:!0,get:function(){return e.Users}}),Object.defineProperty(exports,"VolumeIcon",{enumerable:!0,get:function(){return e.Volume2}}),Object.defineProperty(exports,"WorkflowIcon",{enumerable:!0,get:function(){return e.Workflow}}),Object.defineProperty(exports,"WrenchIcon",{enumerable:!0,get:function(){return e.Wrench}});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=/\x1b\[([0-9;:]*)([A-Za-z])|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][A-Za-z0-9]|\x1b[A-Za-z]/g,t={30:`text-
|
|
1
|
+
const e=/\x1b\[([0-9;:]*)([A-Za-z])|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][A-Za-z0-9]|\x1b[A-Za-z]/g,t={30:`text-po-faint`,31:`text-po-red`,32:`text-po-green`,33:`text-po-yellow`,34:`text-po-blue`,35:`text-po-magenta`,36:`text-po-cyan`,37:`text-po-text`,90:`text-po-dim`,91:`text-po-red`,92:`text-po-green`,93:`text-po-orange`,94:`text-po-blue`,95:`text-po-violet`,96:`text-po-cyan`,97:`text-po-hi`};function n(){return{bold:!1,faint:!1,italic:!1,underline:!1,inverse:!1}}function r(e){if(e<0||e>=256||e<16)return;if(e>=232){let t=(e-232)*10+8;return i(t,t,t)}let t=e-16,n=e=>e===0?0:e*40+55;return i(n(Math.floor(t/36)%6),n(Math.floor(t/6)%6),n(t%6))}function i(e,t,n){let r=e=>Math.max(0,Math.min(255,Math.round(e)));return`rgb(${r(e)} ${r(t)} ${r(n)})`}function a(e,t){let n=e[t+1];if(n===2){let[n,r,a]=e.slice(t+2,t+2+3);return n===void 0||r===void 0||a===void 0?{consumed:e.length}:{color:i(n,r,a),consumed:5}}if(n===5){let n=e[t+2];return{...n===void 0?{}:{color:r(n)},consumed:3}}return{consumed:1}}function o(e,r){let i=r===``?[0]:r.split(/[;:]/).map(e=>Number(e)||0),o={...e};for(let e=0;e<i.length;e+=1){let r=i[e];if(r===0)o=n();else if(r===1)o.bold=!0;else if(r===2)o.faint=!0;else if(r===3)o.italic=!0;else if(r===4)o.underline=!0;else if(r===7)o.inverse=!0;else if(r===22)o.bold=!1,o.faint=!1;else if(r===23)o.italic=!1;else if(r===24)o.underline=!1;else if(r===27)o.inverse=!1;else if(r===39)delete o.className,delete o.color;else if(r===38){let{color:t,consumed:n}=a(i,e);delete o.className,t===void 0?delete o.color:o.color=t,e+=n-1}else if(r===48)e+=a(i,e).consumed-1;else if(r>=30&&r<=37||r>=90&&r<=97){let e=t[r];delete o.color,e===void 0?delete o.className:o.className=e}else(r>=40&&r<=49||r>=100&&r<=107)&&(o.inverse=!1)}return o}function s(e,t){return{text:e,...t.className===void 0?{}:{className:t.className},...t.color===void 0?{}:{color:t.color},...t.bold?{bold:!0}:{},...t.faint?{faint:!0}:{},...t.italic?{italic:!0}:{},...t.underline?{underline:!0}:{},...t.inverse?{inverse:!0}:{}}}function c(t){let r=[],i=n(),a=0;e.lastIndex=0;let c=e.exec(t);for(;c!==null;)c.index>a&&r.push(s(t.slice(a,c.index),i)),c[2]===`m`&&(i=o(i,c[1]??``)),a=c.index+c[0].length,c=e.exec(t);return a<t.length&&r.push(s(t.slice(a),i)),r}exports.ansiSpans=c;
|
|
2
2
|
//# sourceMappingURL=ansiSpans.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ansiSpans.cjs","names":["ANSI_PATTERN","FOREGROUND_CLASS","blank","paletteColor","index","level","rgb","offset","channel","value","clamp","red","green","blue","extendedColor","selector","codes","entry","applySgr","parameters","part","next","current","code","color","consumed","className","spanOf","attributes","ansiSpans","spans","cursor","match","line"],"sources":["../../../src/lib/ansiSpans.ts"],"sourcesContent":["/**\n * The escapes a captured terminal screen carries, turned into spans.\n *\n * WHY THIS EXISTS:\n * Two kinds of output reach the cockpit with a terminal's colour still in it.\n * A workflow captures a tmux pane with `-e`, and a runner's log file keeps the\n * palette on purpose, stripping only cursor moves and redraws. The browser has\n * no terminal, and the cockpit carries no terminal emulator, so the sequences\n * are read here and rendered as ordinary spans. It lives in the component\n * library because both readers need it and neither may import the other.\n *\n * WHAT IT UNDERSTANDS:\n * SGR (`ESC [ … m`) only: the eight base colours and their bright forms, 256\n * colour and truecolour, and bold, faint, italic, underline and inverse. Every\n * other sequence is dropped rather than printed, because a cursor move or a\n * clear that arrives as visible junk is worse than one that arrives as\n * nothing: the screen is a snapshot, and the next one repaints it anyway.\n *\n * The named colours become theme tokens rather than the child's own palette,\n * so a run's output sits in the cockpit's colours instead of fighting them.\n * Only 256-colour and truecolour, which name a colour no token can stand in\n * for, are rendered as themselves.\n */\n\n/** One run of text with the attributes in force when it was printed. */\nexport interface AnsiSpan {\n text: string;\n /** Theme class for a named colour, absent when the colour is the default. */\n className?: string;\n /** An exact colour the child asked for, as `rgb(r g b)`; only 256/truecolour set this. */\n color?: string;\n bold?: boolean;\n faint?: boolean;\n italic?: boolean;\n underline?: boolean;\n /** Foreground and background swapped, which a TUI uses for selection and cursors. */\n inverse?: boolean;\n}\n\n// oxlint-disable-next-line no-control-regex -- reading terminal escapes is the point\nconst ANSI_PATTERN = /\\x1b\\[([0-9;:]*)([A-Za-z])|\\x1b\\][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)|\\x1b[()][A-Za-z0-9]|\\x1b[A-Za-z]/g;\nconst SGR_FINAL = 'm';\nconst RESET_CODE = 0;\nconst DEFAULT_FOREGROUND = 39;\nconst EXTENDED_FOREGROUND = 38;\nconst EXTENDED_BACKGROUND = 48;\nconst TRUECOLOR_SELECTOR = 2;\nconst PALETTE_SELECTOR = 5;\nconst BASE_FOREGROUND_START = 30;\nconst BASE_FOREGROUND_END = 37;\nconst BRIGHT_FOREGROUND_START = 90;\nconst BRIGHT_FOREGROUND_END = 97;\nconst BACKGROUND_START = 40;\nconst BACKGROUND_END = 49;\nconst BRIGHT_BACKGROUND_START = 100;\nconst BRIGHT_BACKGROUND_END = 107;\nconst RGB_CHANNELS = 3;\nconst PALETTE_SIZE = 256;\nconst PALETTE_CUBE_START = 16;\nconst PALETTE_GREY_START = 232;\nconst CUBE_SIDE = 6;\nconst CUBE_STEP = 40;\nconst CUBE_OFFSET = 55;\nconst GREY_STEP = 10;\nconst GREY_OFFSET = 8;\nconst MAX_CHANNEL = 255;\n\nconst BOLD = 1;\nconst FAINT = 2;\nconst ITALIC = 3;\nconst UNDERLINE = 4;\nconst INVERSE = 7;\nconst NOT_BOLD = 22;\nconst NOT_ITALIC = 23;\nconst NOT_UNDERLINE = 24;\nconst NOT_INVERSE = 27;\n\n/**\n * The eight terminal colours as theme tokens, listed as whole class strings so\n * the host's class scanner can see them.\n */\nconst FOREGROUND_CLASS: Readonly<Record<number, string>> = {\n 30: 'text-doom-faint',\n 31: 'text-doom-red',\n 32: 'text-doom-green',\n 33: 'text-doom-yellow',\n 34: 'text-doom-blue',\n 35: 'text-doom-magenta',\n 36: 'text-doom-cyan',\n 37: 'text-doom-text',\n 90: 'text-doom-dim',\n 91: 'text-doom-red',\n 92: 'text-doom-green',\n 93: 'text-doom-orange',\n 94: 'text-doom-blue',\n 95: 'text-doom-violet',\n 96: 'text-doom-cyan',\n 97: 'text-doom-hi',\n};\n\ninterface Attributes {\n className?: string;\n color?: string;\n bold: boolean;\n faint: boolean;\n italic: boolean;\n underline: boolean;\n inverse: boolean;\n}\n\nfunction blank(): Attributes {\n return { bold: false, faint: false, italic: false, underline: false, inverse: false };\n}\n\n/** One of the 256 palette entries as an exact colour, since no token stands for it. */\nfunction paletteColor(index: number): string | undefined {\n if (index < 0 || index >= PALETTE_SIZE) return undefined;\n if (index < PALETTE_CUBE_START) return undefined; // The first sixteen are the named ones.\n if (index >= PALETTE_GREY_START) {\n const level = (index - PALETTE_GREY_START) * GREY_STEP + GREY_OFFSET;\n return rgb(level, level, level);\n }\n const offset = index - PALETTE_CUBE_START;\n const channel = (value: number): number => (value === 0 ? 0 : value * CUBE_STEP + CUBE_OFFSET);\n return rgb(\n channel(Math.floor(offset / (CUBE_SIDE * CUBE_SIDE)) % CUBE_SIDE),\n channel(Math.floor(offset / CUBE_SIDE) % CUBE_SIDE),\n channel(offset % CUBE_SIDE),\n );\n}\n\nfunction rgb(red: number, green: number, blue: number): string {\n const clamp = (value: number): number => Math.max(0, Math.min(MAX_CHANNEL, Math.round(value)));\n return `rgb(${clamp(red)} ${clamp(green)} ${clamp(blue)})`;\n}\n\n/** Reads one extended-colour run (`38;5;n` or `38;2;r;g;b`), answering how many codes it ate. */\nfunction extendedColor(codes: readonly number[], index: number): { color?: string; consumed: number } {\n const selector = codes[index + 1];\n if (selector === TRUECOLOR_SELECTOR) {\n const [red, green, blue] = codes.slice(index + 2, index + 2 + RGB_CHANNELS);\n if (red === undefined || green === undefined || blue === undefined) return { consumed: codes.length };\n return { color: rgb(red, green, blue), consumed: 1 + 1 + RGB_CHANNELS };\n }\n if (selector === PALETTE_SELECTOR) {\n const entry = codes[index + 2];\n return { ...(entry === undefined ? {} : { color: paletteColor(entry) }), consumed: 3 };\n }\n return { consumed: 1 };\n}\n\nfunction applySgr(current: Attributes, parameters: string): Attributes {\n // An empty parameter list is a reset, which is what a bare `ESC[m` means.\n const codes = parameters === '' ? [RESET_CODE] : parameters.split(/[;:]/).map((part) => Number(part) || 0);\n let next = { ...current };\n for (let index = 0; index < codes.length; index += 1) {\n const code = codes[index] as number;\n if (code === RESET_CODE) {\n next = blank();\n } else if (code === BOLD) next.bold = true;\n else if (code === FAINT) next.faint = true;\n else if (code === ITALIC) next.italic = true;\n else if (code === UNDERLINE) next.underline = true;\n else if (code === INVERSE) next.inverse = true;\n else if (code === NOT_BOLD) {\n next.bold = false;\n next.faint = false;\n } else if (code === NOT_ITALIC) next.italic = false;\n else if (code === NOT_UNDERLINE) next.underline = false;\n else if (code === NOT_INVERSE) next.inverse = false;\n else if (code === DEFAULT_FOREGROUND) {\n delete next.className;\n delete next.color;\n } else if (code === EXTENDED_FOREGROUND) {\n const { color, consumed } = extendedColor(codes, index);\n delete next.className;\n if (color === undefined) delete next.color;\n else next.color = color;\n index += consumed - 1;\n } else if (code === EXTENDED_BACKGROUND) {\n // Backgrounds are dropped: a child painting its own background over the\n // cockpit's panel is what makes captured output unreadable in a theme.\n index += extendedColor(codes, index).consumed - 1;\n } else if (\n (code >= BASE_FOREGROUND_START && code <= BASE_FOREGROUND_END) ||\n (code >= BRIGHT_FOREGROUND_START && code <= BRIGHT_FOREGROUND_END)\n ) {\n const className = FOREGROUND_CLASS[code];\n delete next.color;\n if (className === undefined) delete next.className;\n else next.className = className;\n }\n // Background and everything else is read and dropped.\n else if (\n (code >= BACKGROUND_START && code <= BACKGROUND_END) ||\n (code >= BRIGHT_BACKGROUND_START && code <= BRIGHT_BACKGROUND_END)\n ) {\n next.inverse = false;\n }\n }\n return next;\n}\n\nfunction spanOf(text: string, attributes: Attributes): AnsiSpan {\n return {\n text,\n ...(attributes.className === undefined ? {} : { className: attributes.className }),\n ...(attributes.color === undefined ? {} : { color: attributes.color }),\n ...(attributes.bold ? { bold: true } : {}),\n ...(attributes.faint ? { faint: true } : {}),\n ...(attributes.italic ? { italic: true } : {}),\n ...(attributes.underline ? { underline: true } : {}),\n ...(attributes.inverse ? { inverse: true } : {}),\n };\n}\n\n/** One line of captured screen as spans, with every unreadable sequence dropped. */\nexport function ansiSpans(line: string): AnsiSpan[] {\n const spans: AnsiSpan[] = [];\n let attributes = blank();\n let cursor = 0;\n ANSI_PATTERN.lastIndex = 0;\n let match = ANSI_PATTERN.exec(line);\n while (match !== null) {\n if (match.index > cursor) spans.push(spanOf(line.slice(cursor, match.index), attributes));\n if (match[2] === SGR_FINAL) attributes = applySgr(attributes, match[1] ?? '');\n cursor = match.index + match[0].length;\n match = ANSI_PATTERN.exec(line);\n }\n if (cursor < line.length) spans.push(spanOf(line.slice(cursor), attributes));\n return spans;\n}\n"],"mappings":"AAwCA,MAAMA,EAAe,iGAyCfC,EAAqD,CACzD,GAAI,kBACJ,GAAI,gBACJ,GAAI,kBACJ,GAAI,mBACJ,GAAI,iBACJ,GAAI,oBACJ,GAAI,iBACJ,GAAI,iBACJ,GAAI,gBACJ,GAAI,gBACJ,GAAI,kBACJ,GAAI,mBACJ,GAAI,iBACJ,GAAI,mBACJ,GAAI,iBACJ,GAAI,cACN,EAYA,SAASC,GAAoB,CAC3B,MAAO,CAAE,KAAM,GAAO,MAAO,GAAO,OAAQ,GAAO,UAAW,GAAO,QAAS,EAAM,CACtF,CAGA,SAASC,EAAa,EAAmC,CAEvD,GADIC,EAAQ,GAAKA,GAAS,KACtBA,EAAQ,GAAoB,OAChC,GAAIA,GAAS,IAAoB,CAC/B,IAAMC,GAASD,EAAQ,KAAsB,GAAY,EACzD,OAAOE,EAAID,EAAOA,E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QAAU,IAAA,GAAY,CAAC,EAAI,CAAE,MAAOA,EAAW,KAAM,EACpE,GAAIA,EAAW,KAAO,CAAE,KAAM,EAAK,EAAI,CAAC,EACxC,GAAIA,EAAW,MAAQ,CAAE,MAAO,EAAK,EAAI,CAAC,EAC1C,GAAIA,EAAW,OAAS,CAAE,OAAQ,EAAK,EAAI,CAAC,EAC5C,GAAIA,EAAW,UAAY,CAAE,UAAW,EAAK,EAAI,CAAC,EAClD,GAAIA,EAAW,QAAU,CAAE,QAAS,EAAK,EAAI,CAAC,CAChD,CACF,CAGA,SAAgBC,EAAU,EAA0B,CAClD,IAAMC,EAAoB,CAAC,EACvBF,EAAa1B,EAAM,EACnB6B,EAAS,EACb,EAAa,UAAY,EACzB,IAAIC,EAAQhC,EAAa,KAAKiC,CAAI,EAClC,KAAOD,IAAU,MACXA,EAAM,MAAQD,GAAQD,EAAM,KAAKH,EAAOM,EAAK,MAAMF,EAAQC,EAAM,KAAK,EAAGJ,CAAU,CAAC,EACpFI,EAAM,KAAO,MAAW,EAAad,EAASU,EAAYI,EAAM,IAAM,EAAE,GAC5E,EAASA,EAAM,MAAQA,EAAM,EAAE,CAAC,OAChC,EAAQhC,EAAa,KAAKiC,CAAI,EAGhC,OADIF,EAASE,EAAK,QAAQH,EAAM,KAAKH,EAAOM,EAAK,MAAMF,CAAM,EAAGH,CAAU,CAAC,EACpEE,CACT"}
|
|
1
|
+
{"version":3,"file":"ansiSpans.cjs","names":["ANSI_PATTERN","FOREGROUND_CLASS","blank","paletteColor","index","level","rgb","offset","channel","value","clamp","red","green","blue","extendedColor","selector","codes","entry","applySgr","parameters","part","next","current","code","color","consumed","className","spanOf","attributes","ansiSpans","spans","cursor","match","line"],"sources":["../../../src/lib/ansiSpans.ts"],"sourcesContent":["/**\n * The escapes a captured terminal screen carries, turned into spans.\n *\n * WHY THIS EXISTS:\n * Two kinds of output reach the cockpit with a terminal's colour still in it.\n * A workflow captures a tmux pane with `-e`, and a runner's log file keeps the\n * palette on purpose, stripping only cursor moves and redraws. The browser has\n * no terminal, and the cockpit carries no terminal emulator, so the sequences\n * are read here and rendered as ordinary spans. It lives in the component\n * library because both readers need it and neither may import the other.\n *\n * WHAT IT UNDERSTANDS:\n * SGR (`ESC [ … m`) only: the eight base colours and their bright forms, 256\n * colour and truecolour, and bold, faint, italic, underline and inverse. Every\n * other sequence is dropped rather than printed, because a cursor move or a\n * clear that arrives as visible junk is worse than one that arrives as\n * nothing: the screen is a snapshot, and the next one repaints it anyway.\n *\n * The named colours become theme tokens rather than the child's own palette,\n * so a run's output sits in the cockpit's colours instead of fighting them.\n * Only 256-colour and truecolour, which name a colour no token can stand in\n * for, are rendered as themselves.\n */\n\n/** One run of text with the attributes in force when it was printed. */\nexport interface AnsiSpan {\n text: string;\n /** Theme class for a named colour, absent when the colour is the default. */\n className?: string;\n /** An exact colour the child asked for, as `rgb(r g b)`; only 256/truecolour set this. */\n color?: string;\n bold?: boolean;\n faint?: boolean;\n italic?: boolean;\n underline?: boolean;\n /** Foreground and background swapped, which a TUI uses for selection and cursors. */\n inverse?: boolean;\n}\n\n// oxlint-disable-next-line no-control-regex -- reading terminal escapes is the point\nconst ANSI_PATTERN = /\\x1b\\[([0-9;:]*)([A-Za-z])|\\x1b\\][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)|\\x1b[()][A-Za-z0-9]|\\x1b[A-Za-z]/g;\nconst SGR_FINAL = 'm';\nconst RESET_CODE = 0;\nconst DEFAULT_FOREGROUND = 39;\nconst EXTENDED_FOREGROUND = 38;\nconst EXTENDED_BACKGROUND = 48;\nconst TRUECOLOR_SELECTOR = 2;\nconst PALETTE_SELECTOR = 5;\nconst BASE_FOREGROUND_START = 30;\nconst BASE_FOREGROUND_END = 37;\nconst BRIGHT_FOREGROUND_START = 90;\nconst BRIGHT_FOREGROUND_END = 97;\nconst BACKGROUND_START = 40;\nconst BACKGROUND_END = 49;\nconst BRIGHT_BACKGROUND_START = 100;\nconst BRIGHT_BACKGROUND_END = 107;\nconst RGB_CHANNELS = 3;\nconst PALETTE_SIZE = 256;\nconst PALETTE_CUBE_START = 16;\nconst PALETTE_GREY_START = 232;\nconst CUBE_SIDE = 6;\nconst CUBE_STEP = 40;\nconst CUBE_OFFSET = 55;\nconst GREY_STEP = 10;\nconst GREY_OFFSET = 8;\nconst MAX_CHANNEL = 255;\n\nconst BOLD = 1;\nconst FAINT = 2;\nconst ITALIC = 3;\nconst UNDERLINE = 4;\nconst INVERSE = 7;\nconst NOT_BOLD = 22;\nconst NOT_ITALIC = 23;\nconst NOT_UNDERLINE = 24;\nconst NOT_INVERSE = 27;\n\n/**\n * The eight terminal colours as theme tokens, listed as whole class strings so\n * the host's class scanner can see them.\n */\nconst FOREGROUND_CLASS: Readonly<Record<number, string>> = {\n 30: 'text-po-faint',\n 31: 'text-po-red',\n 32: 'text-po-green',\n 33: 'text-po-yellow',\n 34: 'text-po-blue',\n 35: 'text-po-magenta',\n 36: 'text-po-cyan',\n 37: 'text-po-text',\n 90: 'text-po-dim',\n 91: 'text-po-red',\n 92: 'text-po-green',\n 93: 'text-po-orange',\n 94: 'text-po-blue',\n 95: 'text-po-violet',\n 96: 'text-po-cyan',\n 97: 'text-po-hi',\n};\n\ninterface Attributes {\n className?: string;\n color?: string;\n bold: boolean;\n faint: boolean;\n italic: boolean;\n underline: boolean;\n inverse: boolean;\n}\n\nfunction blank(): Attributes {\n return { bold: false, faint: false, italic: false, underline: false, inverse: false };\n}\n\n/** One of the 256 palette entries as an exact colour, since no token stands for it. */\nfunction paletteColor(index: number): string | undefined {\n if (index < 0 || index >= PALETTE_SIZE) return undefined;\n if (index < PALETTE_CUBE_START) return undefined; // The first sixteen are the named ones.\n if (index >= PALETTE_GREY_START) {\n const level = (index - PALETTE_GREY_START) * GREY_STEP + GREY_OFFSET;\n return rgb(level, level, level);\n }\n const offset = index - PALETTE_CUBE_START;\n const channel = (value: number): number => (value === 0 ? 0 : value * CUBE_STEP + CUBE_OFFSET);\n return rgb(\n channel(Math.floor(offset / (CUBE_SIDE * CUBE_SIDE)) % CUBE_SIDE),\n channel(Math.floor(offset / CUBE_SIDE) % CUBE_SIDE),\n channel(offset % CUBE_SIDE),\n );\n}\n\nfunction rgb(red: number, green: number, blue: number): string {\n const clamp = (value: number): number => Math.max(0, Math.min(MAX_CHANNEL, Math.round(value)));\n return `rgb(${clamp(red)} ${clamp(green)} ${clamp(blue)})`;\n}\n\n/** Reads one extended-colour run (`38;5;n` or `38;2;r;g;b`), answering how many codes it ate. */\nfunction extendedColor(codes: readonly number[], index: number): { color?: string; consumed: number } {\n const selector = codes[index + 1];\n if (selector === TRUECOLOR_SELECTOR) {\n const [red, green, blue] = codes.slice(index + 2, index + 2 + RGB_CHANNELS);\n if (red === undefined || green === undefined || blue === undefined) return { consumed: codes.length };\n return { color: rgb(red, green, blue), consumed: 1 + 1 + RGB_CHANNELS };\n }\n if (selector === PALETTE_SELECTOR) {\n const entry = codes[index + 2];\n return { ...(entry === undefined ? {} : { color: paletteColor(entry) }), consumed: 3 };\n }\n return { consumed: 1 };\n}\n\nfunction applySgr(current: Attributes, parameters: string): Attributes {\n // An empty parameter list is a reset, which is what a bare `ESC[m` means.\n const codes = parameters === '' ? [RESET_CODE] : parameters.split(/[;:]/).map((part) => Number(part) || 0);\n let next = { ...current };\n for (let index = 0; index < codes.length; index += 1) {\n const code = codes[index] as number;\n if (code === RESET_CODE) {\n next = blank();\n } else if (code === BOLD) next.bold = true;\n else if (code === FAINT) next.faint = true;\n else if (code === ITALIC) next.italic = true;\n else if (code === UNDERLINE) next.underline = true;\n else if (code === INVERSE) next.inverse = true;\n else if (code === NOT_BOLD) {\n next.bold = false;\n next.faint = false;\n } else if (code === NOT_ITALIC) next.italic = false;\n else if (code === NOT_UNDERLINE) next.underline = false;\n else if (code === NOT_INVERSE) next.inverse = false;\n else if (code === DEFAULT_FOREGROUND) {\n delete next.className;\n delete next.color;\n } else if (code === EXTENDED_FOREGROUND) {\n const { color, consumed } = extendedColor(codes, index);\n delete next.className;\n if (color === undefined) delete next.color;\n else next.color = color;\n index += consumed - 1;\n } else if (code === EXTENDED_BACKGROUND) {\n // Backgrounds are dropped: a child painting its own background over the\n // cockpit's panel is what makes captured output unreadable in a theme.\n index += extendedColor(codes, index).consumed - 1;\n } else if (\n (code >= BASE_FOREGROUND_START && code <= BASE_FOREGROUND_END) ||\n (code >= BRIGHT_FOREGROUND_START && code <= BRIGHT_FOREGROUND_END)\n ) {\n const className = FOREGROUND_CLASS[code];\n delete next.color;\n if (className === undefined) delete next.className;\n else next.className = className;\n }\n // Background and everything else is read and dropped.\n else if (\n (code >= BACKGROUND_START && code <= BACKGROUND_END) ||\n (code >= BRIGHT_BACKGROUND_START && code <= BRIGHT_BACKGROUND_END)\n ) {\n next.inverse = false;\n }\n }\n return next;\n}\n\nfunction spanOf(text: string, attributes: Attributes): AnsiSpan {\n return {\n text,\n ...(attributes.className === undefined ? {} : { className: attributes.className }),\n ...(attributes.color === undefined ? {} : { color: attributes.color }),\n ...(attributes.bold ? { bold: true } : {}),\n ...(attributes.faint ? { faint: true } : {}),\n ...(attributes.italic ? { italic: true } : {}),\n ...(attributes.underline ? { underline: true } : {}),\n ...(attributes.inverse ? { inverse: true } : {}),\n };\n}\n\n/** One line of captured screen as spans, with every unreadable sequence dropped. */\nexport function ansiSpans(line: string): AnsiSpan[] {\n const spans: AnsiSpan[] = [];\n let attributes = blank();\n let cursor = 0;\n ANSI_PATTERN.lastIndex = 0;\n let match = ANSI_PATTERN.exec(line);\n while (match !== null) {\n if (match.index > cursor) spans.push(spanOf(line.slice(cursor, match.index), attributes));\n if (match[2] === SGR_FINAL) attributes = applySgr(attributes, match[1] ?? '');\n cursor = match.index + match[0].length;\n match = ANSI_PATTERN.exec(line);\n }\n if (cursor < line.length) spans.push(spanOf(line.slice(cursor), attributes));\n return spans;\n}\n"],"mappings":"AAwCA,MAAMA,EAAe,iGAyCfC,EAAqD,CACzD,GAAI,gBACJ,GAAI,cACJ,GAAI,gBACJ,GAAI,iBACJ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H,EAAOM,EAAK,MAAMF,CAAM,EAAGH,CAAU,CAAC,EACpEE,CACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={"&":{color:`var(--
|
|
1
|
+
const e={"&":{color:`var(--po-text)`,backgroundColor:`var(--po-deep)`,fontSize:`12px`,height:`100%`},".cm-scroller":{fontFamily:`var(--po-font-mono)`,lineHeight:`1.5`},".cm-content":{caretColor:`var(--po-blue)`,padding:`8px 0`},".cm-cursor, .cm-dropCursor":{borderLeftColor:`var(--po-blue)`,borderLeftWidth:`2px`},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`var(--po-selected)`},".cm-gutters":{backgroundColor:`var(--po-deep)`,color:`var(--po-faint)`,borderRight:`1px solid var(--po-border-soft)`},".cm-activeLine":{backgroundColor:`var(--po-panel)`},".cm-activeLineGutter":{backgroundColor:`var(--po-panel)`,color:`var(--po-dim)`},".cm-foldPlaceholder":{backgroundColor:`var(--po-panel)`,border:`1px solid var(--po-border)`,color:`var(--po-dim)`},".cm-searchMatch":{backgroundColor:`var(--po-tint-yellow)`,outline:`1px solid var(--po-edge-yellow)`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`var(--po-tint-orange)`},".cm-selectionMatch":{backgroundColor:`var(--po-tint-blue)`},".cm-closed-tone":{backgroundColor:`var(--po-tint-green)`,textDecoration:`line-through`,textDecorationColor:`var(--po-edge-green)`},".cm-matchingBracket, &.cm-focused .cm-matchingBracket":{backgroundColor:`var(--po-tint-green)`,outline:`1px solid var(--po-edge-green)`},".cm-nonmatchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`var(--po-tint-red)`},".cm-panels":{backgroundColor:`var(--po-panel)`,color:`var(--po-text)`,fontFamily:`var(--font-sans)`,fontSize:`12px`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid var(--po-border)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid var(--po-border)`},".cm-panel input, .cm-panel button, .cm-panel select":{backgroundColor:`var(--po-deep)`,color:`var(--po-text)`,border:`1px solid var(--po-border)`,borderRadius:`2px`,fontSize:`12px`},".cm-panel input":{fontFamily:`var(--po-font-mono)`},".cm-tooltip":{backgroundColor:`var(--po-panel)`,border:`1px solid var(--po-border)`,color:`var(--po-text)`}},t={comment:{color:`var(--po-faint)`,fontStyle:`italic`},keyword:{color:`var(--po-magenta)`},constant:{color:`var(--po-violet)`},literal:{color:`var(--po-orange)`},string:{color:`var(--po-green)`},regexp:{color:`var(--po-teal)`},operator:{color:`var(--po-blue)`},punctuation:{color:`var(--po-dim)`},variable:{color:`var(--po-text)`},property:{color:`var(--po-cyan)`},callable:{color:`var(--po-blue)`},type:{color:`var(--po-yellow)`},tag:{color:`var(--po-red)`},attribute:{color:`var(--po-yellow)`},meta:{color:`var(--po-faint)`},heading:{color:`var(--po-hi)`,fontWeight:`bold`},link:{color:`var(--po-cyan)`,textDecoration:`underline`},emphasis:{fontStyle:`italic`},strong:{fontWeight:`bold`},strikethrough:{textDecoration:`line-through`},invalid:{color:`var(--po-red)`}};exports.PO_EDITOR_STYLES=e,exports.PO_SYNTAX_STYLES=t;
|
|
2
2
|
//# sourceMappingURL=editorTheme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorTheme.cjs","names":["
|
|
1
|
+
{"version":3,"file":"editorTheme.cjs","names":["PO_EDITOR_STYLES","PO_SYNTAX_STYLES"],"sources":["../../../src/lib/editorTheme.ts"],"sourcesContent":["/**\n * The editor's colours, as plain data.\n *\n * Every value is a CSS custom property rather than a resolved colour, which is\n * what lets a theme swap recolour a mounted editor by rewriting `:root`\n * instead of tearing the editor down and rebuilding it. It is also why this is\n * data and not a built CodeMirror extension: nothing here imports an editor,\n * so a caller pays for the styles only inside the chunk that draws them.\n */\n\n/** The chrome: the surface, the gutter, the cursor, the selection, and the search panel. */\nexport const PO_EDITOR_STYLES: Readonly<Record<string, Readonly<Record<string, string>>>> = {\n '&': {\n color: 'var(--po-text)',\n backgroundColor: 'var(--po-deep)',\n fontSize: '12px',\n height: '100%',\n },\n '.cm-scroller': {\n fontFamily: 'var(--po-font-mono)',\n lineHeight: '1.5',\n },\n '.cm-content': {\n caretColor: 'var(--po-blue)',\n padding: '8px 0',\n },\n '.cm-cursor, .cm-dropCursor': {\n borderLeftColor: 'var(--po-blue)',\n borderLeftWidth: '2px',\n },\n // CodeMirror draws its own selection layer when the editor has focus and\n // leans on the native one when it does not, so both need saying or a\n // selection vanishes the moment a reader clicks the comment box.\n '&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {\n backgroundColor: 'var(--po-selected)',\n },\n '.cm-gutters': {\n backgroundColor: 'var(--po-deep)',\n color: 'var(--po-faint)',\n borderRight: '1px solid var(--po-border-soft)',\n },\n '.cm-activeLine': {\n backgroundColor: 'var(--po-panel)',\n },\n '.cm-activeLineGutter': {\n backgroundColor: 'var(--po-panel)',\n color: 'var(--po-dim)',\n },\n '.cm-foldPlaceholder': {\n backgroundColor: 'var(--po-panel)',\n border: '1px solid var(--po-border)',\n color: 'var(--po-dim)',\n },\n '.cm-searchMatch': {\n backgroundColor: 'var(--po-tint-yellow)',\n outline: '1px solid var(--po-edge-yellow)',\n },\n '.cm-searchMatch.cm-searchMatch-selected': {\n backgroundColor: 'var(--po-tint-orange)',\n },\n '.cm-selectionMatch': {\n backgroundColor: 'var(--po-tint-blue)',\n },\n '.cm-closed-tone': {\n backgroundColor: 'var(--po-tint-green)',\n textDecoration: 'line-through',\n textDecorationColor: 'var(--po-edge-green)',\n },\n '.cm-matchingBracket, &.cm-focused .cm-matchingBracket': {\n backgroundColor: 'var(--po-tint-green)',\n outline: '1px solid var(--po-edge-green)',\n },\n '.cm-nonmatchingBracket, &.cm-focused .cm-nonmatchingBracket': {\n backgroundColor: 'var(--po-tint-red)',\n },\n // Search and replace chrome reads as UI; only what is typed into it is literal.\n '.cm-panels': {\n backgroundColor: 'var(--po-panel)',\n color: 'var(--po-text)',\n fontFamily: 'var(--font-sans)',\n fontSize: '12px',\n },\n '.cm-panels.cm-panels-bottom': {\n borderTop: '1px solid var(--po-border)',\n },\n '.cm-panels.cm-panels-top': {\n borderBottom: '1px solid var(--po-border)',\n },\n '.cm-panel input, .cm-panel button, .cm-panel select': {\n backgroundColor: 'var(--po-deep)',\n color: 'var(--po-text)',\n border: '1px solid var(--po-border)',\n borderRadius: '2px',\n fontSize: '12px',\n },\n '.cm-panel input': {\n fontFamily: 'var(--po-font-mono)',\n },\n '.cm-tooltip': {\n backgroundColor: 'var(--po-panel)',\n border: '1px solid var(--po-border)',\n color: 'var(--po-text)',\n },\n};\n\n/**\n * The syntax colours, named by what they mark rather than by tag, so the\n * pairing with Lezer's tags stays next to the editor that imports them and\n * this table can be read as a palette.\n */\nexport const PO_SYNTAX_STYLES = {\n comment: { color: 'var(--po-faint)', fontStyle: 'italic' },\n keyword: { color: 'var(--po-magenta)' },\n constant: { color: 'var(--po-violet)' },\n literal: { color: 'var(--po-orange)' },\n string: { color: 'var(--po-green)' },\n regexp: { color: 'var(--po-teal)' },\n operator: { color: 'var(--po-blue)' },\n punctuation: { color: 'var(--po-dim)' },\n variable: { color: 'var(--po-text)' },\n property: { color: 'var(--po-cyan)' },\n callable: { color: 'var(--po-blue)' },\n type: { color: 'var(--po-yellow)' },\n tag: { color: 'var(--po-red)' },\n attribute: { color: 'var(--po-yellow)' },\n meta: { color: 'var(--po-faint)' },\n heading: { color: 'var(--po-hi)', fontWeight: 'bold' },\n link: { color: 'var(--po-cyan)', textDecoration: 'underline' },\n emphasis: { fontStyle: 'italic' },\n strong: { fontWeight: 'bold' },\n strikethrough: { textDecoration: 'line-through' },\n invalid: { color: 'var(--po-red)' },\n} as const;\n"],"mappings":"AAWA,MAAaA,EAA+E,CAC1F,IAAK,CACH,MAAO,iBACP,gBAAiB,iBACjB,SAAU,OACV,OAAQ,MACV,EACA,eAAgB,CACd,WAAY,sBACZ,WAAY,KACd,EACA,cAAe,CACb,WAAY,iBACZ,Q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,CAAE,MAAO,gBAAiB,EACpC,KAAM,CAAE,MAAO,kBAAmB,EAClC,IAAK,CAAE,MAAO,eAAgB,EAC9B,UAAW,CAAE,MAAO,kBAAmB,EACvC,KAAM,CAAE,MAAO,iBAAkB,EACjC,QAAS,CAAE,MAAO,eAAgB,WAAY,MAAO,EACrD,KAAM,CAAE,MAAO,iBAAkB,eAAgB,WAAY,EAC7D,SAAU,CAAE,UAAW,QAAS,EAChC,OAAQ,CAAE,WAAY,MAAO,EAC7B,cAAe,CAAE,eAAgB,cAAe,EAChD,QAAS,CAAE,MAAO,eAAgB,CACpC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
function e(e,t){let n=[],r=t,i=[],a=[],o=()=>{i.length>0&&n.push({path:r,indices:i,text:a.join(`
|
|
2
|
-
`)}),i=[],a=[]};for(let[t,n]of e.entries())
|
|
2
|
+
`)}),i=[],a=[]};for(let[t,n]of e.entries())n.type===`tagged`?(i.push(t),a.push(n.value.content)):(o(),n.type===`file`&&(r=n.path));return o(),n}function t(e){return e.map(e=>`${e.path??``}\u0000${e.text}`).join(``)}exports.hashlineGroups=e,exports.hashlineGroupsKey=t;
|
|
3
3
|
//# sourceMappingURL=hashlineHighlight.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashlineHighlight.cjs","names":["hashlineGroups","groups","path","fallbackPath","indices","texts","flush","index","line","lines","hashlineGroupsKey","group"],"sources":["../../../src/lib/hashlineHighlight.ts"],"sourcesContent":["import type { PresentedLine } from './hashlineView';\n\n/**\n * Grouping for highlighted hashline bodies.\n *\n * A read result is one file and a grep result is many, so the lines a card\n * shows have to be cut into runs that belong to the same file before any of\n * them can be parsed. A run is parsed whole because a string or a comment\n * spans lines, and grep's gaps between context blocks are accepted: an excerpt\n * is not the file, and colouring it as if it were is close enough to be worth\n * far more than colouring nothing.\n */\n\nexport interface HashlineGroup {\n /** The file the run came from, when the body named one. */\n readonly path: string | undefined;\n /** Indices into the presented lines, in order, that this run covers. */\n readonly indices: readonly number[];\n /** The run's content, newline-joined, ready to parse. */\n readonly text: string;\n}\n\n/**\n * Consecutive anchored lines, cut at every file heading and at anything that\n * is not code. `fallbackPath` names the file for a body that never states one,\n * which is how a read result arrives.\n */\nexport function hashlineGroups(\n lines: readonly PresentedLine[],\n fallbackPath: string | undefined,\n): readonly HashlineGroup[] {\n const groups: HashlineGroup[] = [];\n let path = fallbackPath;\n let indices: number[] = [];\n let texts: string[] = [];\n\n const flush = (): void => {\n if (indices.length > 0) groups.push({ path, indices, text: texts.join('\\n') });\n indices = [];\n texts = [];\n };\n\n for (const [index, line] of lines.entries()) {\n if (line.type === 'tagged') {\n indices.push(index);\n texts.push(line.value.content);\n continue;\n }\n flush();\n // A heading opens the next file; a plain line is prose between runs.\n if (line.type === 'file') path = line.path;\n }\n flush();\n return groups;\n}\n\n/** One string that changes whenever the groups would highlight differently. */\nexport function hashlineGroupsKey(groups: readonly HashlineGroup[]): string {\n return groups.map((group) => `${group.path ?? ''}\\u0000${group.text}`).join('\\u0001');\n}\n"],"mappings":"AA2BA,SAAgBA,EACd,EACA,EAC0B,CAC1B,IAAMC,EAA0B,CAAC,EAC7BC,EAAOC,EACPC,EAAoB,CAAC,EACrBC,EAAkB,CAAC,EAEjBC,MAAoB,CACpBF,EAAQ,OAAS,GAAGH,EAAO,KAAK,CAAE,OAAM,UAAS,KAAMI,EAAM,KAAK;CAAI,CAAE,CAAC,EAC7E,EAAU,CAAC,EACX,EAAQ,CAAC,CACX,EAEA,IAAK,GAAM,CAACE,EAAOC,KAASC,EAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"hashlineHighlight.cjs","names":["hashlineGroups","groups","path","fallbackPath","indices","texts","flush","index","line","lines","hashlineGroupsKey","group"],"sources":["../../../src/lib/hashlineHighlight.ts"],"sourcesContent":["import type { PresentedLine } from './hashlineView';\n\n/**\n * Grouping for highlighted hashline bodies.\n *\n * A read result is one file and a grep result is many, so the lines a card\n * shows have to be cut into runs that belong to the same file before any of\n * them can be parsed. A run is parsed whole because a string or a comment\n * spans lines, and grep's gaps between context blocks are accepted: an excerpt\n * is not the file, and colouring it as if it were is close enough to be worth\n * far more than colouring nothing.\n */\n\nexport interface HashlineGroup {\n /** The file the run came from, when the body named one. */\n readonly path: string | undefined;\n /** Indices into the presented lines, in order, that this run covers. */\n readonly indices: readonly number[];\n /** The run's content, newline-joined, ready to parse. */\n readonly text: string;\n}\n\n/**\n * Consecutive anchored lines, cut at every file heading and at anything that\n * is not code. `fallbackPath` names the file for a body that never states one,\n * which is how a read result arrives.\n */\nexport function hashlineGroups(\n lines: readonly PresentedLine[],\n fallbackPath: string | undefined,\n): readonly HashlineGroup[] {\n const groups: HashlineGroup[] = [];\n let path = fallbackPath;\n let indices: number[] = [];\n let texts: string[] = [];\n\n const flush = (): void => {\n if (indices.length > 0) groups.push({ path, indices, text: texts.join('\\n') });\n indices = [];\n texts = [];\n };\n\n for (const [index, line] of lines.entries()) {\n if (line.type === 'tagged') {\n indices.push(index);\n texts.push(line.value.content);\n continue;\n }\n flush();\n // A heading opens the next file; a plain line is prose between runs.\n if (line.type === 'file') path = line.path;\n }\n flush();\n return groups;\n}\n\n/** One string that changes whenever the groups would highlight differently. */\nexport function hashlineGroupsKey(groups: readonly HashlineGroup[]): string {\n return groups.map((group) => `${group.path ?? ''}\\u0000${group.text}`).join('\\u0001');\n}\n"],"mappings":"AA2BA,SAAgBA,EACd,EACA,EAC0B,CAC1B,IAAMC,EAA0B,CAAC,EAC7BC,EAAOC,EACPC,EAAoB,CAAC,EACrBC,EAAkB,CAAC,EAEjBC,MAAoB,CACpBF,EAAQ,OAAS,GAAGH,EAAO,KAAK,CAAE,OAAM,UAAS,KAAMI,EAAM,KAAK;CAAI,CAAE,CAAC,EAC7E,EAAU,CAAC,EACX,EAAQ,CAAC,CACX,EAEA,IAAK,GAAM,CAACE,EAAOC,KAASC,EAAM,QAAQ,EACpCD,EAAK,OAAS,UAChBJ,EAAQ,KAAKG,CAAK,EAClBF,EAAM,KAAKG,EAAK,MAAM,OAAO,IAG/BF,EAAM,EAEFE,EAAK,OAAS,SAAQ,EAAOA,EAAK,OAGxC,OADAF,EAAM,EACCL,CACT,CAGA,SAAgBS,EAAkB,EAA0C,CAC1E,OAAOT,EAAO,IAAK,GAAU,GAAGU,EAAM,MAAQ,GAAG,QAAQA,EAAM,MAAM,CAAC,CAAC,KAAK,GAAQ,CACtF"}
|
|
@@ -2,5 +2,5 @@ const e=require("./collapse.cjs"),t=/^@file (.+)#([A-Za-z0-9_-]{8})$/u,n=/^(>> |
|
|
|
2
2
|
`);if(i.length===0)return n.some(e=>e.type===`image`)?[`[Image attached]`]:[];let a=i.replaceAll(` `,` `).replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
4
|
`).split(`
|
|
5
|
-
`);for(;a.at(-1)===``;)a.pop();return a}function a(e){let t=e.at(-1);if(t!==void 0&&t.startsWith(`[`)&&t.endsWith(`]`)){for(e.pop();e.at(-1)===``;)e.pop();return t}}function o(e){let t=n.exec(e),r=t?.[2],i=t?.[3];if(r===void 0||i===void 0)return;let a=Number.parseInt(r,10);if(!Number.isSafeInteger(a)||a<1)return;let o=t?.[1];return{line:a,content:i,marker:o===`>> `?`match`:o===` `?`context`:void 0}}function s(e){return t.exec(e)?.[1]}function c(e,t){let n=[];for(let r of e){let e=s(r);if(e!==void 0){t!==`read`&&n.push({type:`file`,path:e});continue}let i=o(r);
|
|
5
|
+
`);for(;a.at(-1)===``;)a.pop();return a}function a(e){let t=e.at(-1);if(t!==void 0&&t.startsWith(`[`)&&t.endsWith(`]`)){for(e.pop();e.at(-1)===``;)e.pop();return t}}function o(e){let t=n.exec(e),r=t?.[2],i=t?.[3];if(r===void 0||i===void 0)return;let a=Number.parseInt(r,10);if(!Number.isSafeInteger(a)||a<1)return;let o=t?.[1];return{line:a,content:i,marker:o===`>> `?`match`:o===` `?`context`:void 0}}function s(e){return t.exec(e)?.[1]}function c(e,t){let n=[];for(let r of e){let e=s(r);if(e!==void 0){t!==`read`&&n.push({type:`file`,path:e});continue}let i=o(r);i===void 0?n.push({type:`plain`,text:r}):n.push({type:`tagged`,value:i})}return n}function l(t,n,r,o){let s=i(t,n),l=a(s),u=c(s,r),{shown:d,hidden:f}=e.collapseLines(u,r===`read`?10:15,o);return{shown:d,hidden:f,notice:l,gutter:d.reduce((e,t)=>t.type===`tagged`?Math.max(e,String(t.value.line).length):e,1)}}function u(e){return e.filter(e=>e!==void 0&&e.length>0)}exports.GREP_COLLAPSED_LINES=15,exports.READ_COLLAPSED_LINES=10,exports.compactDetails=u,exports.hashlineBody=l,exports.parseFileHeader=s,exports.parseTaggedLine=o,exports.presentHashlineLines=c,exports.resultTextLines=i,exports.takeTrailingNotice=a;
|
|
6
6
|
//# sourceMappingURL=hashlineView.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashlineView.cjs","names":["collapseLines","require_collapse","FILE_HEADER_PATTERN","TAGGED_LINE_PATTERN","isTextBlock","block","resultTextLines","blocks","result","text","output","lines","takeTrailingNotice","last","parseTaggedLine","match","value","lineText","content","line","prefix","parseFileHeader","presentHashlineLines","presented","path","kind","tagged","hashlineBody","notice","expanded","shown","widest","compactDetails","values"],"sources":["../../../src/lib/hashlineView.ts"],"sourcesContent":["import { collapseLines } from './collapse';\n\n/**\n * The hashline wire format, parsed the way the TUI's hashlineRendering does:\n * `@file path#tag` opens a file, `N#abc|content` is an anchored line, and a\n * `>> ` or three-space prefix marks grep matches and their context.\n *\n * It lives here rather than in each tool package because the read and grep\n * cards render the same bytes and had drifted into byte-identical copies of\n * this module. The patterns are still a transcription of po-hashline: a\n * cockpit plugin may import this library and the web contract, but not a\n * runtime package, so the format is stated twice on purpose and only once per\n * side of that line.\n */\nconst FILE_HEADER_PATTERN = /^@file (.+)#([A-Za-z0-9_-]{8})$/u;\nconst TAGGED_LINE_PATTERN = /^(>> | {3})?(\\d+)#[a-z]{3}\\|(.*)$/u;\nconst MATCH_PREFIX = '>> ';\nconst CONTEXT_PREFIX = ' ';\nconst IMAGE_PLACEHOLDER = '[Image attached]';\n\nexport const READ_COLLAPSED_LINES = 10;\nexport const GREP_COLLAPSED_LINES = 15;\n\nexport type HashlineResultKind = 'read' | 'grep';\nexport type TaggedLineMarker = 'match' | 'context';\n\n/**\n * The part of a tool result this parser reads.\n *\n * Named structurally rather than imported: the component library sits below\n * the web contract and must not depend on it, so it states the shape it needs\n * and any `ToolResultView` satisfies it.\n */\nexport interface HashlineResult {\n readonly content: readonly unknown[];\n}\n\nexport interface TaggedLine {\n readonly line: number;\n readonly content: string;\n readonly marker: TaggedLineMarker | undefined;\n}\n\nexport type PresentedLine =\n | { readonly type: 'file'; readonly path: string }\n | { readonly type: 'tagged'; readonly value: TaggedLine }\n | { readonly type: 'plain'; readonly text: string };\n\nexport interface HashlineBody {\n readonly shown: readonly PresentedLine[];\n /** Lines the collapsed view holds back; zero once expanded. */\n readonly hidden: number;\n /** The bracketed pagination or compaction note the tool appends after its lines. */\n readonly notice: string | undefined;\n /** Widest line number among the shown anchored lines, in characters. */\n readonly gutter: number;\n}\n\ninterface TextBlock {\n readonly type: string;\n readonly text?: string;\n}\n\nfunction isTextBlock(block: unknown): block is TextBlock {\n return typeof block === 'object' && block !== null && typeof (block as TextBlock).type === 'string';\n}\n\n/**\n * The result's text as lines: tabs widened, CRLF folded, trailing blanks\n * dropped. A result with no text but an image block reads as the TUI's\n * placeholder. The joined `output` stands in when no result view exists.\n */\nexport function resultTextLines(result: HashlineResult | null, output: string): string[] {\n const blocks = result?.content.filter(isTextBlock) ?? [];\n const text =\n result === null ? output : blocks.flatMap((block) => (block.type === 'text' ? [block.text ?? ''] : [])).join('\\n');\n if (text.length === 0) {\n return blocks.some((block) => block.type === 'image') ? [IMAGE_PLACEHOLDER] : [];\n }\n const lines = text.replaceAll('\\t', ' ').replaceAll('\\r\\n', '\\n').split('\\n');\n while (lines.at(-1) === '') lines.pop();\n return lines;\n}\n\n/** Detaches the tool's trailing `[...]` note so the body numbers file content only. */\nexport function takeTrailingNotice(lines: string[]): string | undefined {\n const last = lines.at(-1);\n if (last === undefined || !last.startsWith('[') || !last.endsWith(']')) return undefined;\n lines.pop();\n while (lines.at(-1) === '') lines.pop();\n return last;\n}\n\nexport function parseTaggedLine(value: string): TaggedLine | undefined {\n const match = TAGGED_LINE_PATTERN.exec(value);\n const lineText = match?.[2];\n const content = match?.[3];\n if (lineText === undefined || content === undefined) return undefined;\n const line = Number.parseInt(lineText, 10);\n if (!Number.isSafeInteger(line) || line < 1) return undefined;\n const prefix = match?.[1];\n const marker = prefix === MATCH_PREFIX ? 'match' : prefix === CONTEXT_PREFIX ? 'context' : undefined;\n return { line, content, marker };\n}\n\nexport function parseFileHeader(value: string): string | undefined {\n return FILE_HEADER_PATTERN.exec(value)?.[1];\n}\n\n/**\n * Lines as the card presents them. A read shows one file, so its header is\n * dropped; a grep groups anchored matches under each file's path.\n */\nexport function presentHashlineLines(lines: readonly string[], kind: HashlineResultKind): PresentedLine[] {\n const presented: PresentedLine[] = [];\n for (const line of lines) {\n const path = parseFileHeader(line);\n if (path !== undefined) {\n if (kind !== 'read') presented.push({ type: 'file', path });\n continue;\n }\n const tagged = parseTaggedLine(line);\n if (tagged !== undefined) {\n presented.push({ type: 'tagged', value: tagged });\n continue;\n }\n presented.push({ type: 'plain', text: line });\n }\n return presented;\n}\n\n/** The body a card shows for one result, collapsed to the kind's line budget unless expanded. */\nexport function hashlineBody(\n result: HashlineResult | null,\n output: string,\n kind: HashlineResultKind,\n expanded: boolean,\n): HashlineBody {\n const lines = resultTextLines(result, output);\n const notice = takeTrailingNotice(lines);\n const presented = presentHashlineLines(lines, kind);\n const budget = kind === 'read' ? READ_COLLAPSED_LINES : GREP_COLLAPSED_LINES;\n const { shown, hidden } = collapseLines(presented, budget, expanded);\n const gutter = shown.reduce(\n (widest, line) => (line.type === 'tagged' ? Math.max(widest, String(line.value.line).length) : widest),\n 1,\n );\n return { shown, hidden, notice, gutter };\n}\n\n/** The `key · key` detail list beside a call's primary argument, with absent values dropped. */\nexport function compactDetails(values: ReadonlyArray<string | undefined>): string[] {\n return values.filter((value): value is string => value !== undefined && value.length > 0);\n}\n"],"mappings":"kCAcME,EAAsB,mCACtBC,EAAsB,qCAgD5B,SAASC,EAAY,EAAoC,CACvD,OAAO,OAAOC,GAAU,YAAYA,GAAkB,OAAQA,EAAoB,MAAS,QAC7F,CAOA,SAAgBC,EAAgB,EAA+B,EAA0B,CACvF,IAAMC,EAASC,GAAQ,QAAQ,OAAOJ,CAAW,GAAK,CAAC,EACjDK,EACJD,IAAW,KAAOE,EAASH,EAAO,QAAS,GAAWF,EAAM,OAAS,OAAS,CAACA,EAAM,MAAQ,EAAE,EAAI,CAAC,CAAE,CAAC,CAAC,KAAK;CAAI,EACnH,GAAII,EAAK,SAAW,EAClB,OAAOF,EAAO,KAAM,GAAUF,EAAM,OAAS,OAAO,EAAI,CAAC,kBAAiB,EAAI,CAAC,EAEjF,IAAMM,EAAQF,EAAK,WAAW,IAAM,IAAI,CAAC,CAAC,WAAW;EAAQ;CAAI,CAAC,CAAC,MAAM;CAAI,EAC7E,KAAOE,EAAM,GAAG,EAAE,IAAM,IAAIA,EAAM,IAAI,EACtC,OAAOA,CACT,CAGA,SAAgBC,EAAmB,EAAqC,CACtE,IAAMC,EAAOF,EAAM,GAAG,EAAE,EACxB,GAAIE,IAAS,IAAA,IAAcA,EAAK,WAAW,GAAG,GAAMA,EAAK,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"hashlineView.cjs","names":["collapseLines","require_collapse","FILE_HEADER_PATTERN","TAGGED_LINE_PATTERN","isTextBlock","block","resultTextLines","blocks","result","text","output","lines","takeTrailingNotice","last","parseTaggedLine","match","value","lineText","content","line","prefix","parseFileHeader","presentHashlineLines","presented","path","kind","tagged","hashlineBody","notice","expanded","shown","widest","compactDetails","values"],"sources":["../../../src/lib/hashlineView.ts"],"sourcesContent":["import { collapseLines } from './collapse';\n\n/**\n * The hashline wire format, parsed the way the TUI's hashlineRendering does:\n * `@file path#tag` opens a file, `N#abc|content` is an anchored line, and a\n * `>> ` or three-space prefix marks grep matches and their context.\n *\n * It lives here rather than in each tool package because the read and grep\n * cards render the same bytes and had drifted into byte-identical copies of\n * this module. The patterns are still a transcription of po-hashline: a\n * cockpit plugin may import this library and the web contract, but not a\n * runtime package, so the format is stated twice on purpose and only once per\n * side of that line.\n */\nconst FILE_HEADER_PATTERN = /^@file (.+)#([A-Za-z0-9_-]{8})$/u;\nconst TAGGED_LINE_PATTERN = /^(>> | {3})?(\\d+)#[a-z]{3}\\|(.*)$/u;\nconst MATCH_PREFIX = '>> ';\nconst CONTEXT_PREFIX = ' ';\nconst IMAGE_PLACEHOLDER = '[Image attached]';\n\nexport const READ_COLLAPSED_LINES = 10;\nexport const GREP_COLLAPSED_LINES = 15;\n\nexport type HashlineResultKind = 'read' | 'grep';\nexport type TaggedLineMarker = 'match' | 'context';\n\n/**\n * The part of a tool result this parser reads.\n *\n * Named structurally rather than imported: the component library sits below\n * the web contract and must not depend on it, so it states the shape it needs\n * and any `ToolResultView` satisfies it.\n */\nexport interface HashlineResult {\n readonly content: readonly unknown[];\n}\n\nexport interface TaggedLine {\n readonly line: number;\n readonly content: string;\n readonly marker: TaggedLineMarker | undefined;\n}\n\nexport type PresentedLine =\n | { readonly type: 'file'; readonly path: string }\n | { readonly type: 'tagged'; readonly value: TaggedLine }\n | { readonly type: 'plain'; readonly text: string };\n\nexport interface HashlineBody {\n readonly shown: readonly PresentedLine[];\n /** Lines the collapsed view holds back; zero once expanded. */\n readonly hidden: number;\n /** The bracketed pagination or compaction note the tool appends after its lines. */\n readonly notice: string | undefined;\n /** Widest line number among the shown anchored lines, in characters. */\n readonly gutter: number;\n}\n\ninterface TextBlock {\n readonly type: string;\n readonly text?: string;\n}\n\nfunction isTextBlock(block: unknown): block is TextBlock {\n return typeof block === 'object' && block !== null && typeof (block as TextBlock).type === 'string';\n}\n\n/**\n * The result's text as lines: tabs widened, CRLF folded, trailing blanks\n * dropped. A result with no text but an image block reads as the TUI's\n * placeholder. The joined `output` stands in when no result view exists.\n */\nexport function resultTextLines(result: HashlineResult | null, output: string): string[] {\n const blocks = result?.content.filter(isTextBlock) ?? [];\n const text =\n result === null ? output : blocks.flatMap((block) => (block.type === 'text' ? [block.text ?? ''] : [])).join('\\n');\n if (text.length === 0) {\n return blocks.some((block) => block.type === 'image') ? [IMAGE_PLACEHOLDER] : [];\n }\n const lines = text.replaceAll('\\t', ' ').replaceAll('\\r\\n', '\\n').split('\\n');\n while (lines.at(-1) === '') lines.pop();\n return lines;\n}\n\n/** Detaches the tool's trailing `[...]` note so the body numbers file content only. */\nexport function takeTrailingNotice(lines: string[]): string | undefined {\n const last = lines.at(-1);\n if (last === undefined || !last.startsWith('[') || !last.endsWith(']')) return undefined;\n lines.pop();\n while (lines.at(-1) === '') lines.pop();\n return last;\n}\n\nexport function parseTaggedLine(value: string): TaggedLine | undefined {\n const match = TAGGED_LINE_PATTERN.exec(value);\n const lineText = match?.[2];\n const content = match?.[3];\n if (lineText === undefined || content === undefined) return undefined;\n const line = Number.parseInt(lineText, 10);\n if (!Number.isSafeInteger(line) || line < 1) return undefined;\n const prefix = match?.[1];\n const marker = prefix === MATCH_PREFIX ? 'match' : prefix === CONTEXT_PREFIX ? 'context' : undefined;\n return { line, content, marker };\n}\n\nexport function parseFileHeader(value: string): string | undefined {\n return FILE_HEADER_PATTERN.exec(value)?.[1];\n}\n\n/**\n * Lines as the card presents them. A read shows one file, so its header is\n * dropped; a grep groups anchored matches under each file's path.\n */\nexport function presentHashlineLines(lines: readonly string[], kind: HashlineResultKind): PresentedLine[] {\n const presented: PresentedLine[] = [];\n for (const line of lines) {\n const path = parseFileHeader(line);\n if (path !== undefined) {\n if (kind !== 'read') presented.push({ type: 'file', path });\n continue;\n }\n const tagged = parseTaggedLine(line);\n if (tagged !== undefined) {\n presented.push({ type: 'tagged', value: tagged });\n continue;\n }\n presented.push({ type: 'plain', text: line });\n }\n return presented;\n}\n\n/** The body a card shows for one result, collapsed to the kind's line budget unless expanded. */\nexport function hashlineBody(\n result: HashlineResult | null,\n output: string,\n kind: HashlineResultKind,\n expanded: boolean,\n): HashlineBody {\n const lines = resultTextLines(result, output);\n const notice = takeTrailingNotice(lines);\n const presented = presentHashlineLines(lines, kind);\n const budget = kind === 'read' ? READ_COLLAPSED_LINES : GREP_COLLAPSED_LINES;\n const { shown, hidden } = collapseLines(presented, budget, expanded);\n const gutter = shown.reduce(\n (widest, line) => (line.type === 'tagged' ? Math.max(widest, String(line.value.line).length) : widest),\n 1,\n );\n return { shown, hidden, notice, gutter };\n}\n\n/** The `key · key` detail list beside a call's primary argument, with absent values dropped. */\nexport function compactDetails(values: ReadonlyArray<string | undefined>): string[] {\n return values.filter((value): value is string => value !== undefined && value.length > 0);\n}\n"],"mappings":"kCAcME,EAAsB,mCACtBC,EAAsB,qCAgD5B,SAASC,EAAY,EAAoC,CACvD,OAAO,OAAOC,GAAU,YAAYA,GAAkB,OAAQA,EAAoB,MAAS,QAC7F,CAOA,SAAgBC,EAAgB,EAA+B,EAA0B,CACvF,IAAMC,EAASC,GAAQ,QAAQ,OAAOJ,CAAW,GAAK,CAAC,EACjDK,EACJD,IAAW,KAAOE,EAASH,EAAO,QAAS,GAAWF,EAAM,OAAS,OAAS,CAACA,EAAM,MAAQ,EAAE,EAAI,CAAC,CAAE,CAAC,CAAC,KAAK;CAAI,EACnH,GAAII,EAAK,SAAW,EAClB,OAAOF,EAAO,KAAM,GAAUF,EAAM,OAAS,OAAO,EAAI,CAAC,kBAAiB,EAAI,CAAC,EAEjF,IAAMM,EAAQF,EAAK,WAAW,IAAM,IAAI,CAAC,CAAC,WAAW;EAAQ;CAAI,CAAC,CAAC,MAAM;CAAI,EAC7E,KAAOE,EAAM,GAAG,EAAE,IAAM,IAAIA,EAAM,IAAI,EACtC,OAAOA,CACT,CAGA,SAAgBC,EAAmB,EAAqC,CACtE,IAAMC,EAAOF,EAAM,GAAG,EAAE,EACxB,GAAIE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AAO,UAAWzB,EAAAA,cAAcuB,EADzBE,IAAS,OAAA,GAAA,GACmCI,CAAQ,EAKnE,MAAO,CAAE,QAAO,SAAQ,SAAQ,OAJjBC,EAAM,QAClB,EAAQ,IAAUX,EAAK,OAAS,SAAW,KAAK,IAAIY,EAAQ,OAAOZ,EAAK,MAAM,IAAI,CAAC,CAAC,MAAM,EAAIY,EAC/F,CAEmC,CAAE,CACzC,CAGA,SAAgBC,EAAe,EAAqD,CAClF,OAAOC,EAAO,OAAQ,GAA2BjB,IAAU,IAAA,IAAaA,EAAM,OAAS,CAAC,CAC1F"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const e=require("./editorLanguage.cjs"),t=require("./editorTheme.cjs"),n=[{pattern:/^#!.*\b(?:bash|sh|zsh|dash|ksh)\b/,grammar:`shell`},{pattern:/^#!.*\bpython[\d.]*\b/,grammar:`python`},{pattern:/^#!.*\b(?:node|bun|deno)\b/,grammar:`javascript`}],r=/^\s*[[{][\s\S]*[\]}]\s*$/;function i(t){let i=t.path===void 0||t.path.length===0?void 0:e.grammarKeyOf(t.path);if(i!==void 0)return i;let a=t.text??``;if(a.length===0)return;let o=a.slice(0,200);if(o.startsWith(`#!`)){let e=o.split(`
|
|
2
|
-
`,1)[0]??``;for(let t of n)if(t.pattern.test(e))return t.grammar;return`shell`}return r.test(a)?`json`:void 0}function a(e){return e===void 0?void 0:t.
|
|
2
|
+
`,1)[0]??``;for(let t of n)if(t.pattern.test(e))return t.grammar;return`shell`}return r.test(a)?`json`:void 0}function a(e){return e===void 0?void 0:t.PO_SYNTAX_STYLES[e]}async function o(){let{tagHighlighter:e,tags:t}=await import(`@lezer/highlight`);return e([{tag:t.comment,class:`comment`},{tag:t.keyword,class:`keyword`},{tag:[t.atom,t.bool,t.null,t.self],class:`constant`},{tag:t.number,class:`literal`},{tag:[t.string,t.special(t.string)],class:`string`},{tag:t.regexp,class:`regexp`},{tag:[t.operator,t.operatorKeyword],class:`operator`},{tag:[t.punctuation,t.separator,t.bracket],class:`punctuation`},{tag:[t.variableName,t.definition(t.variableName)],class:`variable`},{tag:[t.propertyName,t.definition(t.propertyName)],class:`property`},{tag:[t.function(t.variableName),t.function(t.propertyName)],class:`callable`},{tag:[t.typeName,t.className,t.namespace],class:`type`},{tag:[t.tagName,t.angleBracket],class:`tag`},{tag:t.attributeName,class:`attribute`},{tag:[t.meta,t.processingInstruction,t.documentMeta],class:`meta`},{tag:t.heading,class:`heading`},{tag:[t.link,t.url],class:`link`},{tag:t.emphasis,class:`emphasis`},{tag:t.strong,class:`strong`},{tag:t.strikethrough,class:`strikethrough`},{tag:t.invalid,class:`invalid`}])}async function s(t){let[{Language:n,LanguageSupport:r},i]=await Promise.all([import(`@codemirror/language`),e.loadGrammar(t)]);if(i instanceof r)return i.language.parser;if(i instanceof n)return i.parser}async function c(e,t){if(e.length===0||e.length>2e5)return;let[{highlightCode:n},r,i]=await Promise.all([import(`@lezer/highlight`),o(),s(t)]);if(i===void 0)return;let a=[[]];return n(e,i.parse(e),r,(e,t)=>{a[a.length-1]?.push(t===``?{text:e}:{text:e,token:t})},()=>a.push([])),a}exports.detectGrammar=i,exports.highlightToLines=c,exports.syntaxStyleOf=a;
|
|
3
3
|
//# sourceMappingURL=syntaxHighlight.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syntaxHighlight.cjs","names":["grammarKeyOf","DOOM_SYNTAX_STYLES","loadGrammar","require_editorLanguage","require_editorTheme","SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","text","head","firstLine","entry","syntaxStyleOf","token","doomHighlighter","tagHighlighter","tags","parserFor","extension","grammar","LanguageSupport","Language","highlightToLines","highlighter","parser","lines","highlightCode","classes","code"],"sources":["../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { DOOM_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof DOOM_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : DOOM_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function doomHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nexport async function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined> {\n if (text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n doomHighlighter(),\n parserFor(grammar),\n ]);\n if (parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n"],"mappings":"uEAuCMK,EAA8F,CAClG,CAAE,QAAS,oCAAqC,QAAS,OAAQ,EACjE,CAAE,QAAS,wBAAyB,QAAS,QAAS,EACtD,CAAE,QAAS,6BAA8B,QAAS,YAAa,CACjE,EAGMC,EAAa,2BAkBnB,SAAgBC,EAAc,EAA6C,CACzE,IAAMC,EAASC,EAAM,OAAS,IAAA,IAAaA,EAAM,KAAK,SAAW,EAAI,IAAA,GAAYT,EAAAA,aAAaS,EAAM,IAAI,EACxG,GAAID,IAAW,IAAA,GAAW,OAAOA,EACjC,IAAME,EAAOD,EAAM,MAAQ,GAC3B,GAAIC,EAAK,SAAW,EAAG,OACvB,IAAMC,EAAOD,EAAK,MAAM,EAAG,GAAW,EACtC,GAAIC,EAAK,WAAW,IAAI,EAAG,CACzB,IAAMC,EAAYD,EAAK,MAAM;EAAM,CAAC,CAAC,CAAC,IAAM,GAC5C,IAAK,IAAME,KAASR,EAClB,GAAIQ,EAAM,QAAQ,KAAKD,CAAS,EAAG,OAAOC,EAAM,QAGlD,MAAO,OACT,CACA,OAAOP,EAAW,KAAKI,CAAI,EAAI,OAAS,IAAA,EAC1C,CAGA,SAAgBI,EAAc,EAA2D,CACvF,OAAOC,IAAU,IAAA,GAAY,IAAA,GAAYd,EAAAA,mBAAmBc,EAC9D,CAQA,eAAeC,GAAkB,CAC/B,GAAM,CAAE,iBAAgB,QAAS,MAAM,OAAO,oBAC9C,OAAOC,EAAe,CACpB,CAAE,IAAKC,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAKA,EAAK,QAAS,MAAO,SAAgC,EAC5D,CAAE,IAAK,CAACA,EAAK,KAAMA,EAAK,KAAMA,EAAK,KAAMA,EAAK,IAAI,EAAG,MAAO,UAAiC,EAC7F,CAAE,IAAKA,EAAK,OAAQ,MAAO,SAAgC,EAC3D,CAAE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AAI,CACnE,OAAO,wBACPlB,EAAAA,YAAYmB,CAAO,CACrB,CAAC,EACD,GAAID,aAAqBE,EAAiB,OAAOF,EAAU,SAAS,OACpE,GAAIA,aAAqBG,EAAU,OAAOH,EAAU,MAEtD,CAWA,eAAsBI,EAAiB,EAAc,EAAuD,CAC1G,GAAId,EAAK,SAAW,GAAKA,EAAK,OAAS,IAAqB,OAC5D,GAAM,CAAC,CAAE,iBAAiBe,EAAaC,GAAU,MAAM,QAAQ,IAAI,CACjE,OAAO,oBACPV,EAAgB,EAChBG,EAAUE,CAAO,CACnB,CAAC,EACD,GAAIK,IAAW,IAAA,GAAW,OAE1B,IAAMC,EAAwB,CAAC,CAAC,CAAC,EAajC,OAZAC,EACElB,EACAgB,EAAO,MAAMhB,CAAI,EACjBe,GACC,EAAM,IAAY,CAIjBE,EAHsBA,EAAM,OAAS,EAG9B,EAAE,KAAKE,IAAY,GAAK,CAAE,KAAMC,CAAK,EAAI,CAAE,KAAMA,EAAM,MAAOD,CAAuB,CAAC,CAC/F,MACMF,EAAM,KAAK,CAAC,CAAC,CACrB,EACOA,CACT"}
|
|
1
|
+
{"version":3,"file":"syntaxHighlight.cjs","names":["grammarKeyOf","PO_SYNTAX_STYLES","loadGrammar","require_editorLanguage","require_editorTheme","SHEBANG_GRAMMARS","JSON_SHAPE","detectGrammar","byPath","query","text","head","firstLine","entry","syntaxStyleOf","token","poHighlighter","tagHighlighter","tags","parserFor","extension","grammar","LanguageSupport","Language","highlightToLines","highlighter","parser","lines","highlightCode","classes","code"],"sources":["../../../src/lib/syntaxHighlight.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { type GrammarKey, grammarKeyOf, loadGrammar } from './editorLanguage';\nimport { PO_SYNTAX_STYLES } from './editorTheme';\n\n/**\n * Static syntax highlighting for read-only code, the timeline's half of the\n * editor's `syntaxHighlighting`.\n *\n * A tool card shows code it cannot edit, so it needs the colours without the\n * editor: the same grammars `editorLanguage.ts` loads and the same token\n * palette `editorTheme.ts` names, run once over a string and handed back as\n * spans. Everything CodeMirror-shaped is behind a dynamic import, so a session\n * that never opens a code result never downloads a parser, and the caller\n * always has plain text to show first.\n */\n\n/** The palette keys a token can land on; the styles themselves are the editor's. */\nexport type SyntaxToken = keyof typeof PO_SYNTAX_STYLES;\n\n/** One run of same-styled text inside a line. `token` absent means unstyled. */\nexport interface SyntaxSpan {\n text: string;\n token?: SyntaxToken;\n}\n\n/** Lines of spans, one array per source line, so a gutter can pair with them. */\nexport type SyntaxLines = readonly (readonly SyntaxSpan[])[];\n\n/**\n * Above this the parse costs more than the colour is worth. Tool results are\n * bounded well below it; a pasted file is not, and blocking the frame to paint\n * a wall of text nobody reads is the worse outcome.\n */\nconst MAX_HIGHLIGHT_CHARS = 200_000;\n\n/** Only the first line is needed to spot a shebang, and reading more of a big string is waste. */\nconst SNIFF_CHARS = 200;\n\nconst SHEBANG_GRAMMARS: ReadonlyArray<{ readonly pattern: RegExp; readonly grammar: GrammarKey }> = [\n { pattern: /^#!.*\\b(?:bash|sh|zsh|dash|ksh)\\b/, grammar: 'shell' },\n { pattern: /^#!.*\\bpython[\\d.]*\\b/, grammar: 'python' },\n { pattern: /^#!.*\\b(?:node|bun|deno)\\b/, grammar: 'javascript' },\n];\n\n/** JSON is the one shape worth guessing from the body: a document is an object or an array. */\nconst JSON_SHAPE = /^\\s*[[{][\\s\\S]*[\\]}]\\s*$/;\n\nexport interface GrammarQuery {\n /** The file the text came from, when the tool knows one. */\n path?: string | undefined;\n /** The text itself, used only when the path settles nothing. */\n text?: string | undefined;\n}\n\n/**\n * Which grammar to colour a result with.\n *\n * The path decides whenever it can, because a name is evidence and a body is a\n * guess. Sniffing only answers for text that arrived without a usable name: a\n * shebang says what runs the script, and a document that opens and closes with\n * brackets is treated as JSON. Anything else stays plain rather than being\n * coloured as the wrong language.\n */\nexport function detectGrammar(query: GrammarQuery): GrammarKey | undefined {\n const byPath = query.path === undefined || query.path.length === 0 ? undefined : grammarKeyOf(query.path);\n if (byPath !== undefined) return byPath;\n const text = query.text ?? '';\n if (text.length === 0) return undefined;\n const head = text.slice(0, SNIFF_CHARS);\n if (head.startsWith('#!')) {\n const firstLine = head.split('\\n', 1)[0] ?? '';\n for (const entry of SHEBANG_GRAMMARS) {\n if (entry.pattern.test(firstLine)) return entry.grammar;\n }\n // A shebang naming something with no grammar here is still a script.\n return 'shell';\n }\n return JSON_SHAPE.test(text) ? 'json' : undefined;\n}\n\n/** The inline style a token wears. Colours come from the editor palette, which names theme tokens. */\nexport function syntaxStyleOf(token: SyntaxToken | undefined): CSSProperties | undefined {\n return token === undefined ? undefined : PO_SYNTAX_STYLES[token];\n}\n\n/**\n * Every tag the palette answers for, in the order the editor lists them. The\n * class each entry carries is a palette key rather than a CSS class: the\n * result is rendered as inline styles, so nothing has to be mounted in the\n * document for a card to show colour.\n */\nasync function poHighlighter() {\n const { tagHighlighter, tags } = await import('@lezer/highlight');\n return tagHighlighter([\n { tag: tags.comment, class: 'comment' satisfies SyntaxToken },\n { tag: tags.keyword, class: 'keyword' satisfies SyntaxToken },\n { tag: [tags.atom, tags.bool, tags.null, tags.self], class: 'constant' satisfies SyntaxToken },\n { tag: tags.number, class: 'literal' satisfies SyntaxToken },\n { tag: [tags.string, tags.special(tags.string)], class: 'string' satisfies SyntaxToken },\n { tag: tags.regexp, class: 'regexp' satisfies SyntaxToken },\n { tag: [tags.operator, tags.operatorKeyword], class: 'operator' satisfies SyntaxToken },\n { tag: [tags.punctuation, tags.separator, tags.bracket], class: 'punctuation' satisfies SyntaxToken },\n { tag: [tags.variableName, tags.definition(tags.variableName)], class: 'variable' satisfies SyntaxToken },\n { tag: [tags.propertyName, tags.definition(tags.propertyName)], class: 'property' satisfies SyntaxToken },\n {\n tag: [tags.function(tags.variableName), tags.function(tags.propertyName)],\n class: 'callable' satisfies SyntaxToken,\n },\n { tag: [tags.typeName, tags.className, tags.namespace], class: 'type' satisfies SyntaxToken },\n { tag: [tags.tagName, tags.angleBracket], class: 'tag' satisfies SyntaxToken },\n { tag: tags.attributeName, class: 'attribute' satisfies SyntaxToken },\n { tag: [tags.meta, tags.processingInstruction, tags.documentMeta], class: 'meta' satisfies SyntaxToken },\n { tag: tags.heading, class: 'heading' satisfies SyntaxToken },\n { tag: [tags.link, tags.url], class: 'link' satisfies SyntaxToken },\n { tag: tags.emphasis, class: 'emphasis' satisfies SyntaxToken },\n { tag: tags.strong, class: 'strong' satisfies SyntaxToken },\n { tag: tags.strikethrough, class: 'strikethrough' satisfies SyntaxToken },\n { tag: tags.invalid, class: 'invalid' satisfies SyntaxToken },\n ]);\n}\n\n/** The parser behind a grammar. `loadGrammar` hands back an editor extension, which wraps one. */\nasync function parserFor(grammar: GrammarKey) {\n const [{ Language, LanguageSupport }, extension] = await Promise.all([\n import('@codemirror/language'),\n loadGrammar(grammar),\n ]);\n if (extension instanceof LanguageSupport) return extension.language.parser;\n if (extension instanceof Language) return extension.parser;\n return undefined;\n}\n\n/**\n * Colours `text` as `grammar`, as lines of spans.\n *\n * The whole text is parsed at once even though the caller may render it line\n * by line, because a template literal or a block comment only makes sense with\n * its neighbours. Text past the size cap, and a grammar whose extension turns\n * out to carry no parser, come back unhighlighted rather than throwing: colour\n * is decoration, and the caller already has the plain text on screen.\n */\nexport async function highlightToLines(text: string, grammar: GrammarKey): Promise<SyntaxLines | undefined> {\n if (text.length === 0 || text.length > MAX_HIGHLIGHT_CHARS) return undefined;\n const [{ highlightCode }, highlighter, parser] = await Promise.all([\n import('@lezer/highlight'),\n poHighlighter(),\n parserFor(grammar),\n ]);\n if (parser === undefined) return undefined;\n\n const lines: SyntaxSpan[][] = [[]];\n highlightCode(\n text,\n parser.parse(text),\n highlighter,\n (code, classes) => {\n const current = lines[lines.length - 1];\n // `classes` is the palette key this module handed the tag highlighter,\n // or empty for text no tag claimed.\n current?.push(classes === '' ? { text: code } : { text: code, token: classes as SyntaxToken });\n },\n () => lines.push([]),\n );\n return lines;\n}\n"],"mappings":"uEAuCMK,EAA8F,CAClG,CAAE,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OAAOH,EAAU,MAEtD,CAWA,eAAsBI,EAAiB,EAAc,EAAuD,CAC1G,GAAId,EAAK,SAAW,GAAKA,EAAK,OAAS,IAAqB,OAC5D,GAAM,CAAC,CAAE,iBAAiBe,EAAaC,GAAU,MAAM,QAAQ,IAAI,CACjE,OAAO,oBACPV,EAAc,EACdG,EAAUE,CAAO,CACnB,CAAC,EACD,GAAIK,IAAW,IAAA,GAAW,OAE1B,IAAMC,EAAwB,CAAC,CAAC,CAAC,EAajC,OAZAC,EACElB,EACAgB,EAAO,MAAMhB,CAAI,EACjBe,GACC,EAAM,IAAY,CAIjBE,EAHsBA,EAAM,OAAS,EAG9B,EAAE,KAAKE,IAAY,GAAK,CAAE,KAAMC,CAAK,EAAI,CAAE,KAAMA,EAAM,MAAOD,CAAuB,CAAC,CAC/F,MACMF,EAAM,KAAK,CAAC,CAAC,CACrB,EACOA,CACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../themes/
|
|
1
|
+
const e=require("../../themes/po-nord-dark.cjs"),t=require("../../themes/po-one-light.cjs"),n=require("./parse.cjs");function r(e,t){let r=n.parseThemeConfig(e);if(r===null)throw Error(`The shipped theme ${t} is malformed.`);return r}const i=[r(t.default,`po-one-light.json`),r(e.default,`po-nord-dark.json`)],a=i[0];function o(e){return i.find(t=>t.name===e)}exports.BUILTIN_THEMES=i,exports.DEFAULT_THEME=a,exports.DEFAULT_THEME_NAME=`po-one-light`,exports.builtinTheme=o;
|
|
2
2
|
//# sourceMappingURL=builtinThemes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtinThemes.cjs","names":["parseThemeConfig","
|
|
1
|
+
{"version":3,"file":"builtinThemes.cjs","names":["parseThemeConfig","poOneLight","poNordDark","require_po_nord_dark","require_po_one_light","require_parse","shipped","theme","input","file","BUILTIN_THEMES","DEFAULT_THEME","builtinTheme","name"],"sources":["../../../src/theme/builtinThemes.ts"],"sourcesContent":["import poNordDark from '../../themes/po-nord-dark.json' with { type: 'json' };\nimport poOneLight from '../../themes/po-one-light.json' with { type: 'json' };\nimport type { ThemeConfig } from '../types/theme';\nimport { parseThemeConfig } from './parse';\n\nfunction shipped(input: unknown, file: string): ThemeConfig {\n const theme = parseThemeConfig(input);\n if (theme === null) throw new Error(`The shipped theme ${file} is malformed.`);\n return theme;\n}\n\n/** The theme the cockpit renders with until a preference says otherwise. */\nexport const DEFAULT_THEME_NAME = 'po-one-light';\n\n/** The themes this package ships, default first. */\nexport const BUILTIN_THEMES: readonly ThemeConfig[] = [\n shipped(poOneLight, 'po-one-light.json'),\n shipped(poNordDark, 'po-nord-dark.json'),\n];\n\nexport const DEFAULT_THEME: ThemeConfig = BUILTIN_THEMES[0];\n\n/** A shipped theme by name, or undefined for a name nothing shipped under. */\nexport function builtinTheme(name: string): ThemeConfig | undefined {\n return BUILTIN_THEMES.find((theme) => theme.name === name);\n}\n"],"mappings":"qHAKA,SAASM,EAAQ,EAAgB,EAA2B,CAC1D,IAAMC,EAAQP,EAAAA,iBAAiBQ,CAAK,EACpC,GAAID,IAAU,KAAM,MAAU,MAAM,qBAAqBE,EAAK,eAAe,EAC7E,OAAOF,CACT,CAGA,MAGaG,EAAyC,CACpDJ,EAAQL,EAAAA,QAAY,mBAAmB,EACvCK,EAAQJ,EAAAA,QAAY,mBAAmB,CACzC,EAEaS,EAA6BD,EAAe,GAGzD,SAAgBE,EAAa,EAAuC,CAClE,OAAOF,EAAe,KAAM,GAAUH,EAAM,OAASM,CAAI,CAC3D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../types/theme.cjs"),t=`'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function n(e){if(e===`font-mono`)return t;if(e===`on-selected`)return`color-mix(in srgb, var(--
|
|
1
|
+
const e=require("../types/theme.cjs"),t=`'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`;function n(e){if(e===`font-mono`)return t;if(e===`on-selected`)return`color-mix(in srgb, var(--po-selected) 12%, white)`;let[n,r]=e.split(`-`);return n===`tint`?`color-mix(in srgb, var(--po-${r}) 16%, var(--po-panel))`:`color-mix(in srgb, var(--po-${r}) 40%, var(--po-border))`}function r(){let t=[];for(let n of e.ACCENT_TOKENS)t.push(`tint-${n}`);for(let n of e.ACCENT_TOKENS)t.push(`edge-${n}`);return t.push(`on-selected`,`font-mono`),t}function i(e,t){let r=e.tokens[t];return r===void 0?n(t):r}exports.DEFAULT_FONT_MONO=t,exports.derivedFallback=n,exports.derivedTokens=r,exports.tokenValue=i;
|
|
2
2
|
//# sourceMappingURL=derive.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.cjs","names":["ACCENT_TOKENS","require_theme","DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","tokenValue","own","theme"],"sources":["../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--
|
|
1
|
+
{"version":3,"file":"derive.cjs","names":["ACCENT_TOKENS","require_theme","DEFAULT_FONT_MONO","derivedFallback","token","kind","accent","derivedTokens","tokens","tokenValue","own","theme"],"sources":["../../../src/theme/derive.ts"],"sourcesContent":["import { ACCENT_TOKENS, type AccentToken, type DerivedToken, type ThemeConfig, type ThemeToken } from '../types/theme';\n\n/** How much of an accent goes into its tinted background; the rest is the panel. */\nexport const TINT_MIX_PERCENT = 16;\n/** How much of an accent goes into its accented border; the rest is the border. */\nexport const EDGE_MIX_PERCENT = 40;\n/** How much of the selection tints its foreground; the rest is white, so the label stays legible on it. */\nexport const ON_SELECTED_MIX_PERCENT = 12;\n\nexport const DEFAULT_FONT_MONO =\n \"'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace\";\n\n/**\n * A derived token's fallback: a CSS colour expression over the palette, so a\n * theme that supplies only its palette still gets coherent tints and edges.\n */\nexport function derivedFallback(token: DerivedToken): string {\n if (token === 'font-mono') return DEFAULT_FONT_MONO;\n if (token === 'on-selected')\n return `color-mix(in srgb, var(--po-selected) ${String(ON_SELECTED_MIX_PERCENT)}%, white)`;\n const [kind, accent] = token.split('-') as ['tint' | 'edge', AccentToken];\n return kind === 'tint'\n ? `color-mix(in srgb, var(--po-${accent}) ${String(TINT_MIX_PERCENT)}%, var(--po-panel))`\n : `color-mix(in srgb, var(--po-${accent}) ${String(EDGE_MIX_PERCENT)}%, var(--po-border))`;\n}\n\n/** Every derived token, in a stable order. */\nexport function derivedTokens(): DerivedToken[] {\n const tokens: DerivedToken[] = [];\n for (const accent of ACCENT_TOKENS) tokens.push(`tint-${accent}`);\n for (const accent of ACCENT_TOKENS) tokens.push(`edge-${accent}`);\n tokens.push('on-selected', 'font-mono');\n return tokens;\n}\n\n/** The value a theme publishes for a token: its own, or the derived fallback. */\nexport function tokenValue(theme: ThemeConfig, token: ThemeToken): string {\n const own = (theme.tokens as Partial<Record<ThemeToken, string>>)[token];\n if (own !== undefined) return own;\n return derivedFallback(token as DerivedToken);\n}\n"],"mappings":"sCASaE,EACX,mHAMF,SAAgBC,EAAgB,EAA6B,CAC3D,GAAIC,IAAU,YAAa,OAAOF,EAClC,GAAIE,IAAU,cACZ,MAAO,oDACT,GAAM,CAACC,EAAMC,GAAUF,EAAM,MAAM,GAAG,EACtC,OAAOC,IAAS,OACZ,+BAA+BC,EAAO,yBACtC,+BAA+BA,EAAO,yBAC5C,CAGA,SAAgBC,GAAgC,CAC9C,IAAMC,EAAyB,CAAC,EAChC,IAAK,IAAMF,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAChE,IAAK,IAAMA,KAAUN,EAAAA,cAAeQ,EAAO,KAAK,QAAQF,GAAQ,EAEhE,OADAE,EAAO,KAAK,cAAe,WAAW,EAC/BA,CACT,CAGA,SAAgBC,EAAW,EAAoB,EAA2B,CACxE,IAAMC,EAAOC,EAAM,OAA+CP,GAElE,OADIM,IAAQ,IAAA,GACLP,EAAgBC,CAAqB,EADdM,CAEhC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../types/theme.cjs"),t=require("./builtinThemes.cjs");require("./derive.cjs");const n={xs:2,sm:3,md:5,lg:10},r={...n,DEFAULT:4,full:9999},i={"2xs":{size:9,leading:1.45},xs:{size:10,leading:1.45},sm:{size:12,leading:1.45},base:{size:13,leading:1.5},lg:{size:15,leading:1.4},xl:{size:18,leading:1.3},"2xl":{size:22,leading:1.25},"3xl":{size:28,leading:1.2}},a={xl:-.01,"2xl":-.01,"3xl":-.01},o=1.625,s={regular:`400`,medium:`500`,semibold:`600`},c={fade:140,pop:160,rise:160,slide:180,easing:[.16,1,.3,1]},l={sans:{family:`IBM Plex Sans`,ios:`System`,android:`sans-serif`},mono:{family:`JetBrains Mono`,ios:`Menlo`,android:`monospace`}},u=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function d(e){if(!u.test(e))throw Error(`Native themes need hex colours; got "${e}".`);let t=e.length===4?e.slice(1).split(``).map(e=>e+e).join(``):e.slice(1);return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}function f(e,t,n){let r=t/100,i=d(e),a=d(n);return`#${i.map((e,t)=>{let n=Math.round(e*r+a[t]*(1-r));return Math.min(255,Math.max(0,n)).toString(16).padStart(2,`0`)}).join(``)}`}function p(e,t){let n=Math.min(255,Math.max(0,Math.round(t/100*255)));return`#${[...d(e),n].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function m(e){let t={};for(let n of Object.keys(i))t[n]=e(n);return t}function h(t){let n=t.tokens,u={};for(let n of e.PALETTE_TOKENS)u[n]=t.tokens[n];let d=(e,t)=>{u[e]=n[e]??t()};for(let t of e.ACCENT_TOKENS)d(`tint-${t}`,()=>f(u[t],16,u.panel));for(let t of e.ACCENT_TOKENS)d(`edge-${t}`,()=>f(u[t],40,u.border));return d(`on-selected`,()=>f(u.selected,12,`#ffffff`)),{scheme:t.scheme,colors:u,spacing:e=>e*4,borderRadius:r,fontSize:m(e=>i[e].size),lineHeight:m(e=>Math.round(i[e].size*i[e].leading)),lineHeightRelaxed:m(e=>Math.round(i[e].size*o)),letterSpacing:m(e=>{let t=a[e]??0;return Math.round(i[e].size*t*100)/100}),fontWeight:s,fontFamily:l,motion:c}}function g(e){let n=t.builtinTheme(e);if(n===void 0)throw Error(`The shipped theme ${e} is missing.`);return h(n)}const _={dark:g(`
|
|
1
|
+
const e=require("../types/theme.cjs"),t=require("./builtinThemes.cjs");require("./derive.cjs");const n={xs:2,sm:3,md:5,lg:10},r={...n,DEFAULT:4,full:9999},i={"2xs":{size:9,leading:1.45},xs:{size:10,leading:1.45},sm:{size:12,leading:1.45},base:{size:13,leading:1.5},lg:{size:15,leading:1.4},xl:{size:18,leading:1.3},"2xl":{size:22,leading:1.25},"3xl":{size:28,leading:1.2}},a={xl:-.01,"2xl":-.01,"3xl":-.01},o=1.625,s={regular:`400`,medium:`500`,semibold:`600`},c={fade:140,pop:160,rise:160,slide:180,easing:[.16,1,.3,1]},l={sans:{family:`IBM Plex Sans`,ios:`System`,android:`sans-serif`},mono:{family:`JetBrains Mono`,ios:`Menlo`,android:`monospace`}},u=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function d(e){if(!u.test(e))throw Error(`Native themes need hex colours; got "${e}".`);let t=e.length===4?e.slice(1).split(``).map(e=>e+e).join(``):e.slice(1);return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}function f(e,t,n){let r=t/100,i=d(e),a=d(n);return`#${i.map((e,t)=>{let n=Math.round(e*r+a[t]*(1-r));return Math.min(255,Math.max(0,n)).toString(16).padStart(2,`0`)}).join(``)}`}function p(e,t){let n=Math.min(255,Math.max(0,Math.round(t/100*255)));return`#${[...d(e),n].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function m(e){let t={};for(let n of Object.keys(i))t[n]=e(n);return t}function h(t){let n=t.tokens,u={};for(let n of e.PALETTE_TOKENS)u[n]=t.tokens[n];let d=(e,t)=>{u[e]=n[e]??t()};for(let t of e.ACCENT_TOKENS)d(`tint-${t}`,()=>f(u[t],16,u.panel));for(let t of e.ACCENT_TOKENS)d(`edge-${t}`,()=>f(u[t],40,u.border));return d(`on-selected`,()=>f(u.selected,12,`#ffffff`)),{scheme:t.scheme,colors:u,spacing:e=>e*4,borderRadius:r,fontSize:m(e=>i[e].size),lineHeight:m(e=>Math.round(i[e].size*i[e].leading)),lineHeightRelaxed:m(e=>Math.round(i[e].size*o)),letterSpacing:m(e=>{let t=a[e]??0;return Math.round(i[e].size*t*100)/100}),fontWeight:s,fontFamily:l,motion:c}}function g(e){let n=t.builtinTheme(e);if(n===void 0)throw Error(`The shipped theme ${e} is missing.`);return h(n)}const _={dark:g(`po-nord-dark`),light:g(`po-one-light`)};exports.NATIVE_BORDER_RADIUS=r,exports.NATIVE_FONT_FAMILY=l,exports.NATIVE_FONT_WEIGHT=s,exports.NATIVE_LEADING_RELAXED=o,exports.NATIVE_LETTER_SPACING_EM=a,exports.NATIVE_MOTION=c,exports.NATIVE_RADII=n,exports.NATIVE_SPACING_BASE=4,exports.NATIVE_THEMES=_,exports.NATIVE_TYPE_RAMP=i,exports.mixHex=f,exports.nativeTheme=h,exports.withAlpha=p;
|
|
2
2
|
//# sourceMappingURL=nativeTheme.cjs.map
|