@kortix/ui 0.14.19 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_vendor/kortix-shared.js +1188 -202
- package/dist/_vendor/shared/artifact-annotations.d.ts +85 -607
- package/dist/_vendor/shared/artifact-comments.d.ts +53 -489
- package/dist/_vendor/shared/code-language.d.ts +2 -2
- package/dist/_vendor/shared/html.d.ts +7 -0
- package/dist/_vendor/shared/index.d.ts +1 -1
- package/dist/_vendor/shared/peer-message-prompt.d.ts +7 -1
- package/dist/_vendor/shared/pixel-mark.d.ts +28 -0
- package/dist/_vendor/shared/project-glyphs.d.ts +103 -20
- package/dist/_vendor/shared/runtime-versions.d.ts +2 -6
- package/dist/_vendor/shared/tool-output/media-path.d.ts +1 -6
- package/dist/_vendor/shared/tool-output/scan.d.ts +2 -0
- package/dist/_vendor/shared/utils/string.d.ts +6 -0
- package/dist/_vendor/shared/webhook-signing.d.ts +3 -1
- package/dist/access/access/access-dialog-share.d.ts +3 -28
- package/dist/access/access/access-dialog-share.js +3 -75
- package/dist/artifacts/artifact-frame.js +26 -2
- package/dist/artifacts/artifact-session.js +8 -3
- package/dist/artifacts/frame-policy.d.ts +2 -9
- package/dist/artifacts/frame-policy.js +2 -25
- package/dist/customize/agents/agent-page.js +5 -5
- package/dist/customize/agents/agent-status.js +1 -1
- package/dist/customize/agents/agents-page.js +4 -4
- package/dist/customize/agents/create-agent-modal.js +1 -1
- package/dist/customize/connectors/connector-filter.d.ts +2 -1
- package/dist/customize/connectors/connector-filter.js +2 -3
- package/dist/customize/connectors/connectors-page.js +15 -24
- package/dist/customize/connectors/detail/connector-status.d.ts +3 -24
- package/dist/customize/connectors/detail/connector-status.js +2 -42
- package/dist/customize/connectors/detail/use-connector-detail.d.ts +2 -6
- package/dist/customize/connectors/detail/use-connector-detail.js +3 -13
- package/dist/customize/connectors/install/install.d.ts +2 -6
- package/dist/customize/connectors/install/install.js +2 -16
- package/dist/customize/connectors/provider-label.d.ts +4 -17
- package/dist/customize/connectors/provider-label.js +4 -37
- package/dist/customize/connectors/use-agent-access.d.ts +3 -3
- package/dist/customize/providers/provider-connect.d.ts +6 -15
- package/dist/customize/providers/provider-connect.js +5 -36
- package/dist/customize/sections/connector-connection-form.d.ts +3 -7
- package/dist/customize/sections/connector-connection-form.js +2 -33
- package/dist/customize/sections/connector-oauth2-auto.d.ts +3 -33
- package/dist/customize/sections/connector-oauth2-auto.js +2 -64
- package/dist/customize/sections/connectors-view.js +50 -37
- package/dist/customize/sections/gateway-view.d.ts +6 -5
- package/dist/customize/sections/gateway-view.js +31 -13
- package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +21 -18
- package/dist/customize/sections/llm-provider/constants.d.ts +1 -2
- package/dist/customize/sections/llm-provider/constants.js +1 -2
- package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
- package/dist/customize/sections/llm-provider/device-grant.js +27 -0
- package/dist/customize/sections/llm-provider/utils.d.ts +1 -41
- package/dist/customize/sections/llm-provider/utils.js +1 -52
- package/dist/customize/sections/view/account-secret-resources-panel.js +4 -1
- package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
- package/dist/customize/sections/view/agent-editor.d.ts +2 -2
- package/dist/customize/sections/view/agent-editor.js +2 -2
- package/dist/customize/sections/view/channel-settings-patch.js +1 -1
- package/dist/customize/sections/view/channels-view.js +8 -8
- package/dist/customize/sections/view/connector-connections.d.ts +5 -85
- package/dist/customize/sections/view/connector-connections.js +5 -99
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +42 -3
- package/dist/customize/sections/view/gateway/gateway-logs.js +212 -15
- package/dist/customize/sections/view/gateway/gateway-overview.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-routing.d.ts +3 -3
- package/dist/customize/sections/view/gateway/gateway-routing.js +81 -200
- package/dist/customize/sections/view/gateway/routing-parts.d.ts +101 -0
- package/dist/customize/sections/view/gateway/routing-parts.js +154 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.d.ts +2 -0
- package/dist/customize/sections/view/gateway/routing-sentence-layout.js +82 -0
- package/dist/customize/sections/view/review-center-connected.js +54 -21
- package/dist/customize/sections/view/review-view.d.ts +7 -0
- package/dist/customize/sections/view/review-view.js +11 -0
- package/dist/customize/sections/view/secret-delivery.d.ts +4 -5
- package/dist/customize/sections/view/secret-delivery.js +6 -5
- package/dist/customize/sections/view/secrets-view.js +1 -1
- package/dist/customize/sections/view/subscription-usage-tab.d.ts +14 -0
- package/dist/customize/sections/view/subscription-usage-tab.js +122 -0
- package/dist/customize/sections/view/subscription-usage.d.ts +34 -0
- package/dist/customize/sections/view/subscription-usage.js +98 -0
- package/dist/customize/settings/tabs/experimental-tab.js +3 -3
- package/dist/customize/settings/tabs/general-tab.js +65 -10
- package/dist/customize/shared/catalog/catalog-card.d.ts +9 -4
- package/dist/customize/shared/catalog/catalog-card.js +3 -3
- package/dist/customize/shared/channels-switch-dialog.d.ts +1 -1
- package/dist/customize/shared/channels-switch-dialog.js +1 -1
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/post-to-field.d.ts +1 -1
- package/dist/customize/triggers/schedule/post-to-field.js +2 -2
- package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +1 -1
- package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +6 -0
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +13 -0
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +9 -2
- package/dist/files/drives/conflict-marks.d.ts +28 -0
- package/dist/files/drives/conflict-marks.js +39 -0
- package/dist/files/drives/session-drives-chip.js +15 -10
- package/dist/files/project/api/runtime-files.d.ts +2 -2
- package/dist/files/project/api/runtime-files.js +2 -2
- package/dist/files/project/components/drive-explorer.js +1 -1
- package/dist/files/project/components/drive-grid-view.js +0 -1
- package/dist/files/project/components/drive-list-view.js +0 -1
- package/dist/files/project/components/file-explorer-page.js +1 -1
- package/dist/files/project/hooks/index.d.ts +1 -1
- package/dist/files/project/hooks/index.js +1 -1
- package/dist/files/project/hooks/use-server-health.d.ts +1 -1
- package/dist/files/project/hooks/use-server-health.js +1 -1
- package/dist/files/project/search/workspace-search-service.d.ts +1 -1
- package/dist/files/project/search/workspace-search-service.js +1 -1
- package/dist/files/runtime/hooks/index.d.ts +1 -1
- package/dist/files/runtime/hooks/index.js +1 -1
- package/dist/files/runtime/hooks/server-health-state.d.ts +2 -2
- package/dist/files/runtime/hooks/server-health-state.js +2 -2
- package/dist/files/runtime/hooks/system-dir.js +2 -2
- package/dist/files/runtime/hooks/use-file-content.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-content.js +1 -1
- package/dist/files/runtime/hooks/use-file-list.d.ts +1 -1
- package/dist/files/runtime/hooks/use-file-list.js +3 -3
- package/dist/files/runtime/hooks/use-server-health.d.ts +2 -2
- package/dist/files/runtime/hooks/use-server-health.js +3 -3
- package/dist/files/runtime/hooks/use-workspace-search.d.ts +1 -2
- package/dist/files/runtime/hooks/use-workspace-search.js +0 -1
- package/dist/files/runtime/index.d.ts +2 -2
- package/dist/files/runtime/index.js +2 -2
- package/dist/files/runtime/path-utils.d.ts +1 -1
- package/dist/files/runtime/path-utils.js +1 -1
- package/dist/files/runtime/sandbox-explorer-source.d.ts +1 -1
- package/dist/files/runtime/sandbox-explorer-source.js +1 -1
- package/dist/files/runtime/sandbox-file-explorer.d.ts +1 -1
- package/dist/files/runtime/sandbox-file-explorer.js +2 -2
- package/dist/files/tree/components/file-tree-item.js +0 -1
- package/dist/files/tree/hooks/use-file-events.d.ts +1 -1
- package/dist/files/tree/hooks/use-file-events.js +1 -1
- package/dist/files/viewer/index.d.ts +1 -1
- package/dist/files/viewer/index.js +1 -1
- package/dist/i18n/en.d.ts +513 -203
- package/dist/i18n/en.js +610 -300
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/sections.d.ts +1 -1
- package/dist/internal/capture/use-capture-area.d.ts +5 -1
- package/dist/internal/capture/use-capture-area.js +16 -9
- package/dist/internal/files/file-read-retry.js +1 -1
- package/dist/internal/files/types.d.ts +2 -2
- package/dist/internal/files/types.js +2 -2
- package/dist/internal/goals/goal-meta.d.ts +76 -10
- package/dist/internal/goals/goal-meta.js +191 -14
- package/dist/internal/hooks/connectors/use-add-account.d.ts +3 -9
- package/dist/internal/hooks/connectors/use-add-account.js +3 -18
- package/dist/internal/hooks/connectors/use-connect-link.d.ts +3 -2
- package/dist/internal/hooks/connectors/use-connect-link.js +15 -24
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.d.ts +3 -56
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +3 -87
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +3 -2
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -3
- package/dist/internal/hooks/projects/use-project-can-run.d.ts +7 -0
- package/dist/internal/hooks/projects/use-project-can-run.js +12 -5
- package/dist/internal/hooks/projects/use-restart-project-session.d.ts +0 -1
- package/dist/internal/hooks/projects/use-restart-project-session.js +0 -1
- package/dist/internal/layout/nav-hover-card.d.ts +1 -1
- package/dist/internal/layout/nav-hover-card.js +1 -1
- package/dist/internal/layout/project-capability-nav.d.ts +1 -1
- package/dist/internal/layout/project-capability-nav.js +7 -3
- package/dist/internal/layout/project-page-header.d.ts +3 -1
- package/dist/internal/layout/project-page-header.js +2 -2
- package/dist/internal/lib/account-secret-access.d.ts +1 -41
- package/dist/internal/lib/account-secret-access.js +3 -46
- package/dist/internal/lib/browser-error-noise.d.ts +2 -2
- package/dist/internal/lib/browser-error-noise.js +2 -2
- package/dist/internal/lib/browser-noise/rules/expected-states.d.ts +2 -15
- package/dist/internal/lib/browser-noise/rules/expected-states.js +6 -56
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +18 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +1 -0
- package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
- package/dist/internal/lib/browser-noise/rules/rejections.d.ts +0 -9
- package/dist/internal/lib/browser-noise/rules/rejections.js +0 -14
- package/dist/internal/lib/capability-tab-routes.d.ts +3 -3
- package/dist/internal/lib/capability-tab-routes.js +11 -3
- package/dist/internal/lib/delivered-but-disconnected.js +3 -5
- package/dist/internal/lib/error-handler.js +8 -3
- package/dist/internal/lib/llm-providers.d.ts +4 -110
- package/dist/internal/lib/llm-providers.js +5 -102
- package/dist/internal/lib/navigation/message-link.d.ts +32 -0
- package/dist/internal/lib/navigation/message-link.js +51 -0
- package/dist/internal/lib/navigation/session-href.d.ts +11 -0
- package/dist/internal/lib/navigation/session-href.js +20 -0
- package/dist/internal/lib/navigation/session-spawn-urls.d.ts +17 -0
- package/dist/internal/lib/navigation/session-spawn-urls.js +26 -0
- package/dist/internal/lib/pixel-mark.d.ts +4 -17
- package/dist/internal/lib/pixel-mark.js +5 -148
- package/dist/internal/lib/sounds.d.ts +4 -4
- package/dist/internal/lib/sounds.js +4 -4
- package/dist/internal/lib/space-scope.d.ts +3 -3
- package/dist/internal/lib/space-scope.js +3 -3
- package/dist/internal/lib/use-project-feature-flags.js +9 -7
- package/dist/internal/lib/web-notifications.d.ts +1 -1
- package/dist/internal/lib/web-notifications.js +0 -3
- package/dist/internal/notifications/notification-bell.js +1 -3
- package/dist/internal/notifications/notification-rows.d.ts +2 -2
- package/dist/internal/notifications/notification-rows.js +2 -3
- package/dist/internal/session-types/index.d.ts +5 -7
- package/dist/internal/session-types/index.js +5 -7
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/active-space-store.js +1 -1
- package/dist/internal/stores/composer-prefill-store.js +4 -1
- package/dist/internal/stores/kortix-computer-store.d.ts +15 -0
- package/dist/internal/stores/kortix-computer-store.js +12 -0
- package/dist/internal/stores/sound-store.d.ts +4 -4
- package/dist/internal/stores/sound-store.js +10 -0
- package/dist/lib/routes.d.ts +17 -7
- package/dist/lib/routes.js +18 -2
- package/dist/markdown/app-link-icons.d.ts +7 -0
- package/dist/markdown/app-link-icons.js +20 -0
- package/dist/markdown/app-links.d.ts +9 -0
- package/dist/markdown/app-links.js +112 -0
- package/dist/markdown/code/shiki-highlighter.js +14 -5
- package/dist/markdown/doc-editor/doc-attrs.d.ts +28 -0
- package/dist/markdown/doc-editor/doc-attrs.js +156 -0
- package/dist/markdown/doc-editor/doc-embed.d.ts +6 -0
- package/dist/markdown/doc-editor/doc-embed.js +26 -8
- package/dist/markdown/doc-editor/doc-extensions.d.ts +10 -0
- package/dist/markdown/doc-editor/doc-extensions.js +55 -8
- package/dist/markdown/doc-editor/doc-fidelity.d.ts +72 -0
- package/dist/markdown/doc-editor/doc-fidelity.js +135 -0
- package/dist/markdown/doc-editor/doc-node-view.d.ts +9 -0
- package/dist/markdown/doc-editor/doc-node-view.js +29 -0
- package/dist/markdown/doc-editor/markdown.d.ts +20 -0
- package/dist/markdown/doc-editor/markdown.js +455 -18
- package/dist/markdown/file-links.js +12 -3
- package/dist/markdown/markdown-frontmatter.d.ts +6 -6
- package/dist/markdown/markdown-frontmatter.js +3 -3
- package/dist/markdown/unified-markdown.d.ts +1 -1
- package/dist/markdown/unified-markdown.js +129 -10
- package/dist/primitives/button.js +2 -1
- package/dist/primitives/emoji-picker.js +16 -100
- package/dist/primitives/emoji-tint.js +12 -12
- package/dist/primitives/entity-avatar.js +14 -9
- package/dist/primitives/glyph-face.d.ts +19 -12
- package/dist/primitives/glyph-face.js +59 -20
- package/dist/primitives/glyph-paths-source.d.ts +7 -0
- package/dist/primitives/glyph-paths-source.js +14 -6
- package/dist/primitives/glyph-paths.generated.d.ts +1 -1
- package/dist/primitives/glyph-paths.generated.js +947 -204
- package/dist/primitives/glyph-picker.d.ts +6 -10
- package/dist/primitives/glyph-picker.js +147 -98
- package/dist/primitives/glyph-registry.js +1604 -1
- package/dist/primitives/glyph-tint.d.ts +28 -3
- package/dist/primitives/glyph-tint.js +41 -83
- package/dist/primitives/kortix-glyphs.d.ts +32 -0
- package/dist/primitives/kortix-glyphs.js +157 -0
- package/dist/primitives/project-icon-picker.d.ts +8 -1
- package/dist/primitives/project-icon-picker.js +13 -5
- package/dist/primitives/user-avatar.d.ts +8 -1
- package/dist/primitives/user-avatar.js +2 -2
- package/dist/providers/ui-provider.d.ts +1 -8
- package/dist/session/actions/project-session-list-helpers.js +1 -1
- package/dist/session/agents/agent-model.js +4 -0
- package/dist/session/agents/agent-state-mark.d.ts +12 -7
- package/dist/session/agents/agent-state-mark.js +37 -15
- package/dist/session/agents/agent-strip.js +8 -2
- package/dist/session/agents/agent-surface.d.ts +81 -0
- package/dist/session/agents/agent-surface.js +97 -0
- package/dist/session/agents/held-messages.d.ts +1 -5
- package/dist/session/agents/held-messages.js +8 -25
- package/dist/session/agents/legacy-subagent-chat.js +1 -1
- package/dist/session/agents/session-peek.js +24 -12
- package/dist/session/agents/steer-session.d.ts +2 -0
- package/dist/session/agents/steer-session.js +3 -2
- package/dist/session/agents/subagent-dialog-content.d.ts +30 -1
- package/dist/session/agents/subagent-dialog-content.js +147 -33
- package/dist/session/agents/subagent-view.d.ts +15 -5
- package/dist/session/agents/subagent-view.js +28 -6
- package/dist/session/agents/tasks-panel.js +2 -12
- package/dist/session/agents/workflow-run-controls.d.ts +3 -1
- package/dist/session/agents/workflow-run-controls.js +12 -7
- package/dist/session/composer/ComposerAboveCard.d.ts +4 -1
- package/dist/session/composer/ComposerAboveCard.js +2 -2
- package/dist/session/composer/ComposerCard.d.ts +7 -1
- package/dist/session/composer/ComposerCard.js +74 -9
- package/dist/session/composer/agent-selector.d.ts +16 -0
- package/dist/session/composer/agent-selector.js +19 -11
- package/dist/session/composer/chat-input/chat-input-control.d.ts +64 -0
- package/dist/session/composer/chat-input/chat-input-control.js +578 -0
- package/dist/session/composer/chat-input/chat-input-overrides.d.ts +76 -0
- package/dist/session/composer/chat-input/chat-input-overrides.js +40 -0
- package/dist/session/composer/chat-input/chat-input-panes.d.ts +56 -0
- package/dist/session/composer/chat-input/chat-input-panes.js +148 -0
- package/dist/session/composer/chat-input/chat-input-summary.d.ts +67 -0
- package/dist/session/composer/chat-input/chat-input-summary.js +67 -0
- package/dist/session/composer/chat-queue-lines.d.ts +20 -0
- package/dist/session/composer/chat-queue-lines.js +20 -0
- package/dist/session/composer/composer-chat-input.d.ts +9 -2
- package/dist/session/composer/composer-chat-input.js +14 -6
- package/dist/session/composer/composer-focus-context.d.ts +7 -0
- package/dist/session/composer/composer-focus-context.js +9 -0
- package/dist/session/composer/composer-toolbar.d.ts +3 -1
- package/dist/session/composer/composer-toolbar.js +3 -3
- package/dist/session/composer/composer-underbar.d.ts +10 -1
- package/dist/session/composer/composer-underbar.js +10 -2
- package/dist/session/composer/composer.d.ts +12 -0
- package/dist/session/composer/composer.js +71 -2
- package/dist/session/composer/editor/composer-editor.d.ts +10 -2
- package/dist/session/composer/editor/composer-editor.js +22 -6
- package/dist/session/composer/editor/first-visual-line.d.ts +2 -0
- package/dist/session/composer/editor/first-visual-line.js +9 -0
- package/dist/session/composer/editor/mention-node.js +2 -0
- package/dist/session/composer/editor/serialize.js +9 -1
- package/dist/session/composer/hooks/use-file-search.d.ts +16 -16
- package/dist/session/composer/hooks/use-file-search.js +17 -17
- package/dist/session/composer/menus/mention-controller.d.ts +3 -11
- package/dist/session/composer/menus/mention-controller.js +54 -16
- package/dist/session/composer/menus/mention-menu.d.ts +7 -2
- package/dist/session/composer/menus/mention-menu.js +17 -9
- package/dist/session/composer/menus/menu-items.d.ts +9 -0
- package/dist/session/composer/menus/space-mentions.d.ts +58 -0
- package/dist/session/composer/menus/space-mentions.js +99 -0
- package/dist/session/composer/prompt-history.d.ts +9 -0
- package/dist/session/composer/prompt-history.js +45 -0
- package/dist/session/composer/queue-projection.d.ts +2 -0
- package/dist/session/composer/queue-projection.js +1 -0
- package/dist/session/composer/queued-prompt-list.js +53 -4
- package/dist/session/composer/reasoning-effort-selector.d.ts +20 -0
- package/dist/session/composer/reasoning-effort-selector.js +3 -3
- package/dist/session/composer/types.d.ts +2 -1
- package/dist/session/composer/use-instant-session-send.js +2 -2
- package/dist/session/header/session-goal-indicator.js +4 -4
- package/dist/session/header/session-site-header.js +7 -3
- package/dist/session/header/subagent-hover-card.d.ts +7 -4
- package/dist/session/header/subagent-hover-card.js +62 -11
- package/dist/session/list/session-status-mark.d.ts +42 -0
- package/dist/{workspace/sidebar → session/list}/session-status-mark.js +37 -2
- package/dist/session/models/model-selector.d.ts +7 -2
- package/dist/session/models/model-selector.js +39 -31
- package/dist/session/overrides/provider-secret-pool-editor.d.ts +11 -0
- package/dist/session/overrides/provider-secret-pool-editor.js +17 -0
- package/dist/session/overrides/session-overrides-control.d.ts +5 -0
- package/dist/session/overrides/session-overrides-toolbar.js +147 -7
- package/dist/session/panel/easy/plan-card.d.ts +2 -2
- package/dist/session/panel/easy/plan-card.js +2 -2
- package/dist/session/panel/model-switch-event.d.ts +8 -0
- package/dist/session/panel/model-switch-event.js +19 -0
- package/dist/session/panel/session-audit-panel.js +3 -2
- package/dist/session/panel/session-desktop.js +11 -1
- package/dist/session/panel/session-panel-provider.js +1 -1
- package/dist/session/panel/shared/use-panel-handoffs.d.ts +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +21 -2
- package/dist/session/panel/use-session-panel-state.js +2 -2
- package/dist/session/prompts/ask-deck.d.ts +21 -0
- package/dist/session/prompts/ask-deck.js +253 -0
- package/dist/session/prompts/session-permission-prompt.d.ts +7 -1
- package/dist/session/prompts/session-permission-prompt.js +3 -3
- package/dist/session/status/sandbox-loading-boundary.js +2 -2
- package/dist/session/status/session-load-state.d.ts +0 -1
- package/dist/session/status/session-load-state.js +2 -4
- package/dist/session/status/session-terminal-state.d.ts +47 -0
- package/dist/session/status/session-terminal-state.js +56 -0
- package/dist/session/thread/message-parsing.d.ts +0 -1
- package/dist/session/thread/message-parsing.js +0 -1
- package/dist/session/thread/plan-surface.d.ts +1 -1
- package/dist/session/thread/plan-surface.js +1 -1
- package/dist/session/thread/session-chat.d.ts +4 -2
- package/dist/session/thread/session-chat.js +547 -409
- package/dist/session/thread/session-context-metrics.d.ts +0 -1
- package/dist/session/thread/session-context-metrics.js +1 -1
- package/dist/session/thread/session-context-sub-sessions.js +3 -1
- package/dist/session/thread/show-work.d.ts +38 -0
- package/dist/session/thread/show-work.js +115 -0
- package/dist/session/thread/stop-sequence.d.ts +51 -0
- package/dist/session/thread/stop-sequence.js +55 -0
- package/dist/session/thread/thread-boot-rows.d.ts +2 -1
- package/dist/session/thread/thread-boot-rows.js +7 -3
- package/dist/session/thread/transcript-rows.d.ts +36 -0
- package/dist/session/thread/transcript.d.ts +48 -4
- package/dist/session/thread/transcript.js +228 -36
- package/dist/session/thread/typing-indicator.d.ts +21 -0
- package/dist/session/thread/typing-indicator.js +46 -0
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +12 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +6 -0
- package/dist/session/tool/tool-part-renderer.d.ts +2 -0
- package/dist/session/tool/tool-part-renderer.js +16 -2
- package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -1
- package/dist/session/tool/tools/apply-patch-tool.js +1 -1
- package/dist/session/tool/tools/kortix-action-tool.js +8 -1
- package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +19 -0
- package/dist/session/tool/tools/multi-agent-tool-bodies.js +35 -14
- package/dist/session/tool/tools/multi-agent-tools.js +1 -1
- package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-kill-tool.js +1 -1
- package/dist/session/tool/tools/pty-read-tool.d.ts +2 -2
- package/dist/session/tool/tools/pty-read-tool.js +2 -2
- package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
- package/dist/session/tool/tools/pty-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/pty-write-tool.js +1 -1
- package/dist/session/tool/tools/session-spawn-urls.d.ts +1 -16
- package/dist/session/tool/tools/session-spawn-urls.js +4 -26
- package/dist/session/tool/tools/task-tool.d.ts +5 -18
- package/dist/session/tool/tools/task-tool.js +47 -86
- package/dist/session/tool/tools/todo-write-tool.d.ts +1 -1
- package/dist/session/tool/tools/todo-write-tool.js +1 -1
- package/dist/session/tool/tools/workflow-progress.d.ts +14 -18
- package/dist/session/tool/tools/workflow-progress.js +24 -179
- package/dist/session/tool/tools/workflow-result-text.d.ts +15 -0
- package/dist/session/tool/tools/workflow-result-text.js +34 -0
- package/dist/session/tool/tools/workflow-run-card.d.ts +35 -0
- package/dist/session/tool/tools/workflow-run-card.js +157 -0
- package/dist/session/tool/tools/workflow-tool.js +45 -58
- package/dist/session/turn/activity-burst.d.ts +2 -2
- package/dist/session/turn/activity-burst.js +11 -5
- package/dist/session/turn/answered-question-step.d.ts +29 -0
- package/dist/session/turn/answered-question-step.js +48 -3
- package/dist/session/turn/notice-batch-group.d.ts +4 -4
- package/dist/session/turn/notice-batch-group.js +5 -8
- package/dist/session/turn/peer-message-row.d.ts +14 -8
- package/dist/session/turn/peer-message-row.js +38 -64
- package/dist/session/turn/plan-anchor.d.ts +3 -3
- package/dist/session/turn/plan-anchor.js +3 -3
- package/dist/session/turn/plan-card.d.ts +7 -7
- package/dist/session/turn/plan-card.js +7 -7
- package/dist/session/turn/subagent-notice-row.d.ts +16 -1
- package/dist/session/turn/subagent-notice-row.js +47 -35
- package/dist/session/turn/throttled-markdown.js +4 -1
- package/dist/session/turn/turn-work-accordion.d.ts +10 -3
- package/dist/session/turn/turn-work-accordion.js +18 -11
- package/dist/session/turn/user-message.js +16 -42
- package/dist/session/turn/voice-turn.d.ts +22 -0
- package/dist/session/turn/voice-turn.js +32 -0
- package/dist/session/voice/call-ring.d.ts +10 -0
- package/dist/session/voice/call-ring.js +52 -0
- package/dist/session/voice/use-voice-call.d.ts +4 -4
- package/dist/session/voice/use-voice-call.js +6 -9
- package/dist/session/voice/voice-call-card.d.ts +6 -0
- package/dist/session/voice/voice-call-card.js +113 -0
- package/dist/session/voice/voice-call-state.d.ts +3 -0
- package/dist/session/voice/voice-call-state.js +2 -1
- package/dist/session/voice/voice-call-store.d.ts +16 -6
- package/dist/session/voice/voice-call-store.js +5 -5
- package/dist/session/voice/voice-call.d.ts +4 -8
- package/dist/session/voice/voice-call.js +33 -36
- package/dist/styles/components.css +33 -0
- package/dist/styles/theme.css +26 -0
- package/dist/styles.css +1 -1
- package/dist/terminal/terminal-card-gate.d.ts +6 -3
- package/dist/terminal/terminal-card-gate.js +21 -4
- package/dist/workspace/admin/project-admin-dashboard.d.ts +1 -1
- package/dist/workspace/admin/project-admin-dashboard.js +12 -9
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +2 -1
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +5 -3
- package/dist/workspace/memory/company-memory-page.d.ts +1 -1
- package/dist/workspace/memory/company-memory-page.js +1 -1
- package/dist/workspace/new/use-creatable-accounts.js +13 -4
- package/dist/workspace/projects/modal/project-icon-field.js +49 -34
- package/dist/workspace/review/review-center.d.ts +12 -3
- package/dist/workspace/review/review-center.js +50 -16
- package/dist/workspace/review/review-reducer.d.ts +7 -0
- package/dist/workspace/review/review-reducer.js +11 -0
- package/dist/workspace/sessions/project-sessions-helpers.js +1 -1
- package/dist/workspace/sessions/project-sessions-view.js +1 -1
- package/dist/workspace/sessions/session-row.js +6 -4
- package/dist/workspace/sessions/sessions-toolbar.d.ts +1 -1
- package/dist/workspace/sessions/sessions-toolbar.js +4 -4
- package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -1
- package/dist/workspace/sidebar/footer/project-artifacts-nav.js +47 -4
- package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +1 -1
- package/dist/workspace/sidebar/footer/project-memory-nav.js +1 -1
- package/dist/workspace/sidebar/project-nav-items.js +13 -17
- package/dist/workspace/sidebar/project-session-list.d.ts +7 -1
- package/dist/workspace/sidebar/project-session-list.js +63 -24
- package/dist/workspace/sidebar/project-sidebar.js +10 -7
- package/dist/workspace/sidebar/project-spaces-nav.d.ts +7 -3
- package/dist/workspace/sidebar/project-spaces-nav.js +77 -46
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +4 -2
- package/dist/workspace/sidebar/session-brief-hover-card.js +47 -28
- package/dist/workspace/sidebar/session-group-sections.js +12 -4
- package/dist/workspace/sidebar/sidebar-more-group.d.ts +13 -0
- package/dist/workspace/sidebar/sidebar-more-group.js +27 -0
- package/dist/workspace/space/space-blocks.d.ts +3 -1
- package/dist/workspace/space/space-blocks.js +4 -7
- package/dist/workspace/space/space-page.d.ts +4 -6
- package/dist/workspace/space/space-page.js +10 -24
- package/dist/workspace/space/space-tab-panels.d.ts +14 -1
- package/dist/workspace/space/space-tab-panels.js +12 -21
- package/dist/workspace/space/space-templates.d.ts +4 -5
- package/dist/workspace/space/space-templates.js +2 -7
- package/dist/workspace/space/use-space-filter.d.ts +1 -1
- package/dist/workspace/space/use-space-filter.js +1 -1
- package/dist/workspace/spaces/channels-onboarding.d.ts +2 -2
- package/dist/workspace/spaces/channels-onboarding.js +4 -3
- package/dist/workspace/spaces/create-channel-dialog.js +4 -2
- package/dist/workspace/spaces/principal-card.d.ts +73 -0
- package/dist/workspace/spaces/principal-card.js +246 -0
- package/dist/workspace/spaces/space-agent-ask.d.ts +14 -0
- package/dist/workspace/spaces/space-agent-ask.js +36 -0
- package/dist/workspace/spaces/space-auto-open.d.ts +8 -0
- package/dist/workspace/spaces/space-auto-open.js +18 -0
- package/dist/workspace/spaces/space-avatar.d.ts +44 -0
- package/dist/workspace/spaces/space-avatar.js +41 -0
- package/dist/workspace/spaces/space-details-dialog.js +1 -1
- package/dist/workspace/spaces/space-details-panel.d.ts +27 -0
- package/dist/workspace/spaces/space-details-panel.js +173 -0
- package/dist/workspace/spaces/space-identity.d.ts +49 -0
- package/dist/workspace/spaces/space-identity.js +104 -0
- package/dist/workspace/spaces/space-members.js +1 -1
- package/dist/workspace/spaces/space-mention-source.d.ts +13 -0
- package/dist/workspace/spaces/space-mention-source.js +71 -0
- package/dist/workspace/spaces/space-people.d.ts +29 -0
- package/dist/workspace/spaces/space-people.js +87 -0
- package/dist/workspace/spaces/space-roster.d.ts +3 -2
- package/dist/workspace/spaces/space-roster.js +7 -4
- package/dist/workspace/spaces/space-tab-list.d.ts +37 -0
- package/dist/workspace/spaces/space-tab-list.js +82 -0
- package/dist/workspace/spaces/space-tabs.d.ts +74 -0
- package/dist/workspace/spaces/space-tabs.js +199 -0
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/dist/workspace/spaces/space-timeline-view.js +126 -17
- package/dist/workspace/spaces/space-timeline.d.ts +44 -9
- package/dist/workspace/spaces/space-timeline.js +120 -12
- package/dist/workspace/spaces/space-view.d.ts +19 -12
- package/dist/workspace/spaces/space-view.js +203 -68
- package/dist/workspace/spaces/use-personal-space-name.d.ts +2 -0
- package/dist/workspace/spaces/use-personal-space-name.js +10 -0
- package/package.json +11 -7
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +2 -3
- package/skills/kortix-ui/references/modules.md +4 -4
- package/dist/_vendor/shared/room-prompt.d.ts +0 -66
- package/dist/session/tool/tools/multi-agent-tool-data.d.ts +0 -63
- package/dist/session/tool/tools/multi-agent-tool-data.js +0 -118
- package/dist/session/voice/voice-call-bar.d.ts +0 -4
- package/dist/session/voice/voice-call-bar.js +0 -39
- package/dist/workspace/sidebar/footer/project-rooms-nav.d.ts +0 -9
- package/dist/workspace/sidebar/footer/project-rooms-nav.js +0 -32
- package/dist/workspace/sidebar/session-status-mark.d.ts +0 -19
- package/dist/workspace/space/space-room.d.ts +0 -20
- package/dist/workspace/space/space-room.js +0 -27
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.d.ts +0 -0
- /package/dist/{workspace/sidebar → session/list}/session-list-chrome.js +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { appLink } from './app-links.js';
|
|
4
|
+
import { Github } from '../internal/icons/github.js';
|
|
5
|
+
import { SlackLogoIcon } from '@phosphor-icons/react';
|
|
6
|
+
import { LinearMark, FigmaMark, NotionMark, GoogleDocsMark, GoogleSheetsMark, GoogleSlidesMark } from './app-link-icons.js';
|
|
3
7
|
import { toSandboxAbsolutePath } from '@kortix/sdk';
|
|
4
8
|
import { useTranslations } from '../i18n/index.js';
|
|
5
9
|
import { ClickablePath, wrapChildrenWithPaths } from '../internal/components/clickable-path.js';
|
|
@@ -24,7 +28,62 @@ import { ImageIcon } from '@phosphor-icons/react';
|
|
|
24
28
|
import { useUiLink } from '../providers/ui-provider.js';
|
|
25
29
|
import React, { useCallback, useContext, useMemo, useState } from 'react';
|
|
26
30
|
import { parseMarkdownIntoBlocks, Streamdown } from 'streamdown';
|
|
31
|
+
function SlackMark({ className }) {
|
|
32
|
+
return _jsx(SlackLogoIcon, { weight: "fill", className: className });
|
|
33
|
+
}
|
|
27
34
|
const LINK_CLASS = cn('font-medium text-kortix-blue', 'underline decoration-kortix-blue/40 decoration-[1px] underline-offset-[3px]', 'transition-colors hover:decoration-kortix-blue', '[overflow-wrap:anywhere]');
|
|
35
|
+
// No underline at rest: the app mark is the link affordance. Hover underlines
|
|
36
|
+
// the label only. The mark is inline-block, so the underline skips it, and its
|
|
37
|
+
// color stays fixed.
|
|
38
|
+
const APP_LINK_CLASS = cn('font-medium text-kortix-blue no-underline', 'decoration-kortix-blue decoration-[1px] underline-offset-[3px] hover:underline', '[overflow-wrap:anywhere]');
|
|
39
|
+
const TEXT_WRAPPER_TAGS = new Set(['strong', 'em', 'b', 'i', 'del', 's']);
|
|
40
|
+
/** The first user-perceived character: a flag or a vowel sign stays whole. */
|
|
41
|
+
function firstGrapheme(text) {
|
|
42
|
+
if (typeof Intl.Segmenter === 'function') {
|
|
43
|
+
return new Intl.Segmenter(undefined, { granularity: 'grapheme' })
|
|
44
|
+
.segment(text)[Symbol.iterator]().next().value?.segment;
|
|
45
|
+
}
|
|
46
|
+
return Array.from(text)[0];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Splits a link label after its first character: `"PR #123"` → `["P", "R #123"]`.
|
|
50
|
+
* A text wrapper (a stream-word span, `**bold**`) is copied around each half,
|
|
51
|
+
* so the label renders the same while it streams and after. Any other element
|
|
52
|
+
* (inline code) stays whole and keeps its own wrapping. There is no break
|
|
53
|
+
* opportunity between the halves: whole words still wrap together, and the
|
|
54
|
+
* rest still breaks anywhere. Returns null when the label opens with no text.
|
|
55
|
+
*/
|
|
56
|
+
function splitLeadingChar(label) {
|
|
57
|
+
const [first, ...others] = React.Children.toArray(label);
|
|
58
|
+
let lead;
|
|
59
|
+
let tail;
|
|
60
|
+
if (typeof first === 'string' || typeof first === 'number') {
|
|
61
|
+
const text = String(first);
|
|
62
|
+
const char = firstGrapheme(text);
|
|
63
|
+
if (!char)
|
|
64
|
+
return null;
|
|
65
|
+
lead = char;
|
|
66
|
+
tail = text.slice(char.length);
|
|
67
|
+
}
|
|
68
|
+
else if (React.isValidElement(first)) {
|
|
69
|
+
const tag = typeof first.type === 'string' ? first.type : first.props.node?.tagName;
|
|
70
|
+
if (first.props.className === STREAM_WORD_CLASS || (tag && TEXT_WRAPPER_TAGS.has(tag))) {
|
|
71
|
+
const inner = splitLeadingChar(first.props.children);
|
|
72
|
+
if (!inner)
|
|
73
|
+
return null;
|
|
74
|
+
lead = React.cloneElement(first, { key: 'lead' }, inner[0]);
|
|
75
|
+
tail = React.cloneElement(first, { key: 'tail' }, inner[1]);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
lead = _jsx("span", { className: "whitespace-normal", children: first }, "lead");
|
|
79
|
+
tail = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return [lead, _jsxs(_Fragment, { children: [tail, others] })];
|
|
86
|
+
}
|
|
28
87
|
function handleHashClick(e, href) {
|
|
29
88
|
if (!href.startsWith('#'))
|
|
30
89
|
return;
|
|
@@ -39,7 +98,26 @@ const MarkdownRenderContext = React.createContext({
|
|
|
39
98
|
variant: 'message',
|
|
40
99
|
genui: false,
|
|
41
100
|
});
|
|
42
|
-
|
|
101
|
+
/** Only streaming word wrappers are transparent; formatting remains custom content. */
|
|
102
|
+
function bareLinkText(children) {
|
|
103
|
+
let text = '';
|
|
104
|
+
for (const child of React.Children.toArray(children)) {
|
|
105
|
+
if (typeof child === 'string') {
|
|
106
|
+
text += child;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (!React.isValidElement(child) ||
|
|
110
|
+
child.props.className !== STREAM_WORD_CLASS)
|
|
111
|
+
return null;
|
|
112
|
+
const word = bareLinkText(child.props.children);
|
|
113
|
+
if (word === null)
|
|
114
|
+
return null;
|
|
115
|
+
text += word;
|
|
116
|
+
}
|
|
117
|
+
return text;
|
|
118
|
+
}
|
|
119
|
+
export function MarkdownLink({ href, children, }) {
|
|
120
|
+
const tAppLink = useTranslations('markdownAppLinks');
|
|
43
121
|
const Link = useUiLink();
|
|
44
122
|
const { proxy, policy, variant } = useContext(MarkdownRenderContext);
|
|
45
123
|
const openPreview = useOpenPreviewLink();
|
|
@@ -51,41 +129,82 @@ export function MarkdownLink({ href, children }) {
|
|
|
51
129
|
}
|
|
52
130
|
// A setup link whose URL is still streaming: the card it will
|
|
53
131
|
// become, with nothing to click yet (see `holdPendingSetupLink`).
|
|
54
|
-
const pendingSetupLink = policy.setupLinks
|
|
132
|
+
const pendingSetupLink = policy.setupLinks
|
|
133
|
+
? parsePendingSetupLinkHref(href)
|
|
134
|
+
: null;
|
|
55
135
|
if (pendingSetupLink) {
|
|
56
136
|
return (_jsx(SetupLinkButton, { kind: pendingSetupLink, token: null, children: children }));
|
|
57
137
|
}
|
|
58
138
|
// A file in the session's workspace opens the file preview, the same
|
|
59
139
|
// as a path in prose (see `remarkWorkspaceFileLinks`).
|
|
60
140
|
const decodedFilePath = policy.fileLinks ? parseFileLinkHref(href) : null;
|
|
61
|
-
const filePath = policy.fileLinks
|
|
141
|
+
const filePath = policy.fileLinks
|
|
142
|
+
? parseFileLinkHref(href, variant === 'document')
|
|
143
|
+
: null;
|
|
62
144
|
if (decodedFilePath && !filePath) {
|
|
63
|
-
return _jsx("span", { className: LINK_CLASS, children: children });
|
|
145
|
+
return _jsx("span", { className: cn(LINK_CLASS, 'group'), children: children });
|
|
64
146
|
}
|
|
65
147
|
if (filePath) {
|
|
66
|
-
return (_jsx(ClickablePath, { filePath: filePath, className: LINK_CLASS, children: children }));
|
|
148
|
+
return (_jsx(ClickablePath, { filePath: filePath, className: cn(LINK_CLASS, 'group'), children: children }));
|
|
67
149
|
}
|
|
68
150
|
// The URL is still streaming: show the label in link style, with
|
|
69
151
|
// nothing to click until the real href arrives.
|
|
70
152
|
if (isStreamingLinkPlaceholder(href)) {
|
|
71
|
-
return _jsx("span", { className: LINK_CLASS, children: children });
|
|
153
|
+
return _jsx("span", { className: cn(LINK_CLASS, 'group'), children: children });
|
|
72
154
|
}
|
|
73
155
|
const resolvedHref = proxy(href) ?? href ?? '#';
|
|
156
|
+
const presentation = href === resolvedHref ? appLink(resolvedHref) : null;
|
|
157
|
+
const Mark = presentation
|
|
158
|
+
? {
|
|
159
|
+
github: Github,
|
|
160
|
+
slack: SlackMark,
|
|
161
|
+
linear: LinearMark,
|
|
162
|
+
figma: FigmaMark,
|
|
163
|
+
notion: NotionMark,
|
|
164
|
+
google: presentation.kind === 'googleDoc' ? GoogleDocsMark : presentation.kind === 'googleSheet' ? GoogleSheetsMark : GoogleSlidesMark,
|
|
165
|
+
}[presentation.app]
|
|
166
|
+
: null;
|
|
167
|
+
const plainText = bareLinkText(children);
|
|
168
|
+
const compactLabel = presentation?.name ?? (presentation &&
|
|
169
|
+
presentation.kind !== 'commit' && presentation.kind !== 'linearIssue'
|
|
170
|
+
? tAppLink(presentation.kind, { number: presentation.number ?? '' }) : '');
|
|
171
|
+
const appName = presentation ? {
|
|
172
|
+
github: 'GitHub', linear: 'Linear', slack: 'Slack', figma: 'Figma', notion: 'Notion', google: 'Google',
|
|
173
|
+
}[presentation.app] : '';
|
|
174
|
+
const labelNamesApp = plainText === href && !presentation?.name && presentation && ['slack', 'notion', 'figma', 'google'].includes(presentation.app);
|
|
175
|
+
// A compact app link is the app mark plus a short label, never underlined.
|
|
176
|
+
// The mark is 1em and sits at -0.15em: Roobert cap height is 0.7em, so the
|
|
177
|
+
// mark centers on the cap height at every text size. A label built from an
|
|
178
|
+
// identifier ("PR #123", "ENG-42", a commit) is short and never breaks. A title or
|
|
179
|
+
// custom label (Notion and Figma allow 48 characters, CJK has no spaces) is
|
|
180
|
+
// glued to the mark by its first character only, so the mark never ends a
|
|
181
|
+
// line alone and the title still wraps inside the column.
|
|
182
|
+
const label = plainText === href ? compactLabel : children;
|
|
183
|
+
// Figma, Notion and GitHub account labels are titles; every other compact label is an
|
|
184
|
+
// identifier, even when `appLink` stores it as `name` (ENG-42, a commit).
|
|
185
|
+
// GitHub account and repo names (up to 39 and 140 characters) wrap like titles.
|
|
186
|
+
const isTitle = presentation?.app === 'figma' || presentation?.app === 'notion' ||
|
|
187
|
+
presentation?.kind === 'githubUser' || presentation?.kind === 'githubRepo';
|
|
188
|
+
const split = plainText === href && !isTitle
|
|
189
|
+
? [label, null]
|
|
190
|
+
: splitLeadingChar(label);
|
|
191
|
+
const linkContent = presentation && Mark ? (_jsxs(_Fragment, { children: [_jsxs("span", { className: "whitespace-nowrap", children: [_jsx("span", { "aria-hidden": "true", className: "pointer-events-none mr-1 inline-block size-[1em] align-[-0.15em] text-muted-foreground", children: _jsx(Mark, { className: "block size-full" }) }), !labelNamesApp && _jsxs("span", { className: "sr-only", children: [appName, ": "] }), split ? split[0] : null] }), split ? split[1] : label] })) : children;
|
|
192
|
+
const anchorClass = presentation && Mark ? APP_LINK_CLASS : LINK_CLASS;
|
|
74
193
|
const isHash = resolvedHref.startsWith('#');
|
|
75
194
|
const isExternal = !isInternalUrl(resolvedHref);
|
|
76
195
|
// A sandbox address under a host preview resolver: the proxied href would
|
|
77
196
|
// land on the host's own origin, so the click opens the host's URL.
|
|
78
197
|
if (openPreview && href && resolvedHref !== href) {
|
|
79
|
-
return (_jsx("a", { href: href, className:
|
|
198
|
+
return (_jsx("a", { href: href, className: anchorClass, title: presentation ? resolvedHref : undefined, target: "_blank", rel: "noopener noreferrer", onClick: (e) => openPreview(e, href, resolvedHref), children: _jsx(InsideLinkContext.Provider, { value: true, children: linkContent }) }));
|
|
80
199
|
}
|
|
81
200
|
// Markdown can contain arbitrary same-origin absolute URLs. Next.js
|
|
82
201
|
// treats those as app routes and prefetches them, including typos such
|
|
83
202
|
// as `/legal/terms.`. Only trusted root-relative/hash paths belong in
|
|
84
203
|
// the app router; every other href stays a plain anchor.
|
|
85
204
|
if (!shouldUseNextLink(resolvedHref)) {
|
|
86
|
-
return (_jsx("a", { href: resolvedHref, className:
|
|
205
|
+
return (_jsx("a", { href: resolvedHref, className: anchorClass, title: presentation ? resolvedHref : undefined, ...(isExternal && !isHash ? { target: '_blank', rel: 'noopener noreferrer' } : {}), children: _jsx(InsideLinkContext.Provider, { value: true, children: linkContent }) }));
|
|
87
206
|
}
|
|
88
|
-
return (_jsx(Link, { href: resolvedHref, onClick: isHash ? (e) => handleHashClick(e, resolvedHref) : undefined, className:
|
|
207
|
+
return (_jsx(Link, { href: resolvedHref, onClick: isHash ? (e) => handleHashClick(e, resolvedHref) : undefined, className: anchorClass, title: presentation ? resolvedHref : undefined, ...(isExternal && !isHash ? { target: '_blank', rel: 'noopener noreferrer' } : {}), children: _jsx(InsideLinkContext.Provider, { value: true, children: linkContent }) }));
|
|
89
208
|
}
|
|
90
209
|
/**
|
|
91
210
|
* `flush`: no vertical margin, for an image inside a generative UI block that spaces its own children.
|
|
@@ -40,7 +40,8 @@ const buttonVariants = cva("flex items-center justify-center gap-2 whitespace-no
|
|
|
40
40
|
},
|
|
41
41
|
size: {
|
|
42
42
|
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
43
|
-
|
|
43
|
+
// In a group, the radius of its icon neighbours (`icon-sm`, `icon`), so the group's outer corners match.
|
|
44
|
+
xs: 'h-7 gap-1.5 px-2.5 rounded-sm in-data-[slot=button-group]:rounded-md has-[>svg]:px-2',
|
|
44
45
|
base: "h-7 gap-1 px-2.5 in-data-[slot=button-group]:rounded-2xl has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
45
46
|
sm: 'h-8 gap-1.5 px-3 has-[>svg]:px-2.5',
|
|
46
47
|
lg: 'h-10 px-6 has-[>svg]:px-4',
|
|
@@ -1,101 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
import { MagnifyingGlassIcon } from '@phosphor-icons/react';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { EmojiPicker as Frimousse } from 'frimousse';
|
|
5
4
|
import Hint from './hint.js';
|
|
6
|
-
import { InputGroupSearch, InputGroupSearchIcon } from './input-group.js';
|
|
7
5
|
import Loading from './loading.js';
|
|
8
6
|
import { cn } from '../lib/utils.js';
|
|
9
7
|
/**
|
|
10
|
-
* Emoji picker built on frimousse
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* function of (nth-child mod 6, row parity).
|
|
19
|
-
*
|
|
20
|
-
* Colours come from two paired token families in globals.css: a pale
|
|
21
|
-
* `--color-emoji-fill-*` and a stronger `--color-emoji-ring-*` per hue. The
|
|
22
|
-
* active cell is the ONLY visible cue for which emoji is selected — frimousse
|
|
23
|
-
* gives every emoji button tabIndex={-1} and no focus ring — so the state
|
|
24
|
-
* indicator has to clear WCAG 1.4.11's 3:1 against --popover. A pale fill
|
|
25
|
-
* cannot reach that on white at any saturation, so the 1px inset ring carries
|
|
26
|
-
* the contrast (measured 3.03–3.19:1) and the fill stays quiet.
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* Every variant is written out as a LITERAL string. Do not generate these with
|
|
30
|
-
* a template literal or a .map() — Tailwind v4 extracts class names by scanning
|
|
31
|
-
* source text, so an interpolated class name produces no CSS at all and the
|
|
32
|
-
* hover backgrounds silently never appear.
|
|
33
|
-
*
|
|
34
|
-
* There is no `dark:` set: every token is a light-dark() pair, and :root /
|
|
35
|
-
* .dark set color-scheme, so one class covers both themes.
|
|
36
|
-
*
|
|
37
|
-
* The ring GEOMETRY is declared once, as a single `data-[active]:inset-ring-1`
|
|
38
|
-
* — only the colour is slot-specific. Repeating the width on all twelve slots
|
|
39
|
-
* would be twelve chances for one to drift.
|
|
40
|
-
*
|
|
41
|
-
* VARIANT ORDER: `data-[active]` LAST, i.e.
|
|
42
|
-
* `group-data-[row=even]/row:nth-[6n+1]:data-[active]:bg-…`. Verified against
|
|
43
|
-
* tailwindcss 4.3.2, which compiles that to
|
|
44
|
-
* `:is(:where(.group\/row)[data-row="even"] *):nth-child(6n+1)[data-active]`.
|
|
45
|
-
* Leading with `data-[active]` also compiles to a working selector, so either
|
|
46
|
-
* order emits CSS — this one just reads in the order the cascade applies.
|
|
47
|
-
*
|
|
48
|
-
* `nth-[6n+k]` counts the emoji button among its row's children, which is
|
|
49
|
-
* exactly the column: frimousse renders nothing into a row but emoji buttons.
|
|
50
|
-
*
|
|
51
|
-
* WHY `data-row` AND NOT `group-odd/row:` / `group-even/row:` (the obvious
|
|
52
|
-
* CSS-only choice): frimousse virtualises the list, so a row's `:nth-child()`
|
|
53
|
-
* index counts only the rows currently mounted, offset by a hidden measurement
|
|
54
|
-
* <div> that is always the first child and by a spacer <div> inserted before
|
|
55
|
-
* every row that starts a category. `:nth-child(odd)` on a row therefore tracks
|
|
56
|
-
* neither the logical row nor any stable value — it flips as you scroll.
|
|
57
|
-
* `aria-rowindex`, which frimousse derives from the logical row index, is the
|
|
58
|
-
* one stable source, so `<Row>` reads it and stamps the parity as an attribute.
|
|
8
|
+
* Emoji picker built on frimousse: 12 columns of `size-8` cells at `text-xl`
|
|
9
|
+
* (20px), so about 80 emoji show at once inside the 388px panel.
|
|
10
|
+
*
|
|
11
|
+
* The hovered or keyboard-active cell takes a neutral wash
|
|
12
|
+
* (`bg-foreground/8`). It replaced a six-hue tinted fill with a 1px ring: the
|
|
13
|
+
* new picker draws no borders on cells. The wash is the only cue for the
|
|
14
|
+
* keyboard-active emoji, and it is below WCAG 1.4.11's 3:1, which the old ring
|
|
15
|
+
* cleared.
|
|
59
16
|
*/
|
|
60
|
-
const EMOJI_BUTTON = cn('flex size-8 items-center justify-center rounded-md text-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// box-shadow is in the list because Tailwind draws inset-ring-* with it.
|
|
64
|
-
'transition-[background-color,box-shadow,scale] duration-fast active:scale-[0.96]',
|
|
65
|
-
// Ring geometry, declared once. Only the colour varies per slot below.
|
|
66
|
-
'data-[active]:inset-ring-1',
|
|
67
|
-
// Fill — even rows: 1→red, 2→amber, 3→green, 4→teal, 5→blue, 6→violet
|
|
68
|
-
'group-data-[row=even]/row:nth-[6n+1]:data-[active]:bg-emoji-fill-red', 'group-data-[row=even]/row:nth-[6n+2]:data-[active]:bg-emoji-fill-amber', 'group-data-[row=even]/row:nth-[6n+3]:data-[active]:bg-emoji-fill-green', 'group-data-[row=even]/row:nth-[6n+4]:data-[active]:bg-emoji-fill-teal', 'group-data-[row=even]/row:nth-[6n+5]:data-[active]:bg-emoji-fill-blue', 'group-data-[row=even]/row:nth-[6n+6]:data-[active]:bg-emoji-fill-violet',
|
|
69
|
-
// Fill — odd rows: same six, rotated by three
|
|
70
|
-
'group-data-[row=odd]/row:nth-[6n+1]:data-[active]:bg-emoji-fill-teal', 'group-data-[row=odd]/row:nth-[6n+2]:data-[active]:bg-emoji-fill-blue', 'group-data-[row=odd]/row:nth-[6n+3]:data-[active]:bg-emoji-fill-violet', 'group-data-[row=odd]/row:nth-[6n+4]:data-[active]:bg-emoji-fill-red', 'group-data-[row=odd]/row:nth-[6n+5]:data-[active]:bg-emoji-fill-amber', 'group-data-[row=odd]/row:nth-[6n+6]:data-[active]:bg-emoji-fill-green',
|
|
71
|
-
// Ring colour — same rotation, paired with the fill by hue
|
|
72
|
-
'group-data-[row=even]/row:nth-[6n+1]:data-[active]:inset-ring-emoji-ring-red', 'group-data-[row=even]/row:nth-[6n+2]:data-[active]:inset-ring-emoji-ring-amber', 'group-data-[row=even]/row:nth-[6n+3]:data-[active]:inset-ring-emoji-ring-green', 'group-data-[row=even]/row:nth-[6n+4]:data-[active]:inset-ring-emoji-ring-teal', 'group-data-[row=even]/row:nth-[6n+5]:data-[active]:inset-ring-emoji-ring-blue', 'group-data-[row=even]/row:nth-[6n+6]:data-[active]:inset-ring-emoji-ring-violet', 'group-data-[row=odd]/row:nth-[6n+1]:data-[active]:inset-ring-emoji-ring-teal', 'group-data-[row=odd]/row:nth-[6n+2]:data-[active]:inset-ring-emoji-ring-blue', 'group-data-[row=odd]/row:nth-[6n+3]:data-[active]:inset-ring-emoji-ring-violet', 'group-data-[row=odd]/row:nth-[6n+4]:data-[active]:inset-ring-emoji-ring-red', 'group-data-[row=odd]/row:nth-[6n+5]:data-[active]:inset-ring-emoji-ring-amber', 'group-data-[row=odd]/row:nth-[6n+6]:data-[active]:inset-ring-emoji-ring-green');
|
|
73
|
-
let warnedMissingRowIndex = false;
|
|
74
|
-
/**
|
|
75
|
-
* Row parity, from frimousse's `aria-rowindex`.
|
|
76
|
-
*
|
|
77
|
-
* The fallback is deliberately noisy rather than silent: if frimousse ever
|
|
78
|
-
* stopped emitting `aria-rowindex`, every row would fall back to `even`, the
|
|
79
|
-
* rotation would collapse to a single set, and nothing would fail. The hidden
|
|
80
|
-
* measurement row legitimately has neither `role` nor `aria-rowindex`, so only
|
|
81
|
-
* a real row (`role="row"`) missing the index is a regression worth warning on.
|
|
82
|
-
*
|
|
83
|
-
* Note frimousse's `aria-rowindex` is 0-based, which is against ARIA's 1-based
|
|
84
|
-
* convention. This code is correct against what it ships today; if frimousse
|
|
85
|
-
* ever conforms, every parity flips and the rotation shifts by three.
|
|
86
|
-
*/
|
|
87
|
-
function rowParity(props) {
|
|
88
|
-
const rowIndex = props['aria-rowindex'];
|
|
89
|
-
if (typeof rowIndex !== 'number') {
|
|
90
|
-
if (process.env.NODE_ENV !== 'production' && props.role === 'row' && !warnedMissingRowIndex) {
|
|
91
|
-
warnedMissingRowIndex = true;
|
|
92
|
-
console.warn('[EmojiPicker] a frimousse row is missing aria-rowindex; the active-cell ' +
|
|
93
|
-
'tint rotation has collapsed to one set. Check the frimousse version.');
|
|
94
|
-
}
|
|
95
|
-
return 'even';
|
|
96
|
-
}
|
|
97
|
-
return rowIndex % 2 === 0 ? 'even' : 'odd';
|
|
98
|
-
}
|
|
17
|
+
const EMOJI_BUTTON = cn('flex size-8 items-center justify-center rounded-md text-xl leading-none', 'cursor-pointer select-none', 'transition-[background-color,scale] duration-fast active:scale-[0.96]', 'data-[active]:bg-foreground/8');
|
|
18
|
+
/** 12 columns of size-8 cells: 20px emoji, about 80 visible at once. */
|
|
19
|
+
const EMOJI_COLUMNS = 12;
|
|
99
20
|
export function EmojiPicker({ onEmojiSelect, className, emojibaseUrl = '/emojibase', }) {
|
|
100
21
|
return (_jsxs(Frimousse.Root, { onEmojiSelect: onEmojiSelect,
|
|
101
22
|
// Self-hosted, not frimousse's default CDN. Left unset, frimousse fetches
|
|
@@ -119,19 +40,14 @@ export function EmojiPicker({ onEmojiSelect, className, emojibaseUrl = '/emojiba
|
|
|
119
40
|
// together: a build script cannot import a client component's constants.
|
|
120
41
|
// `locale` is written out rather than left to frimousse's `en` default so
|
|
121
42
|
// the coupling is visible at the place someone would change it.
|
|
122
|
-
emojibaseUrl: emojibaseUrl, locale: "en", className: cn('isolate flex h-[
|
|
123
|
-
// frimousse hardcodes type="search". Tailwind's preflight resets
|
|
124
|
-
// ::-webkit-search-decoration but not ::-webkit-search-cancel-button,
|
|
125
|
-
// so without this WebKit paints its native clear X inside the field.
|
|
126
|
-
// Same reset input.tsx already carries for type="search".
|
|
127
|
-
'[&::-webkit-search-cancel-button]:appearance-none') })] }) }), _jsxs(Frimousse.Viewport, { className: "relative flex-1 overflow-y-auto outline-none", children: [_jsx(Frimousse.Loading, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center", children: _jsx(Loading, {}) }), _jsx(Frimousse.Empty, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center px-6 text-center text-sm text-balance", children: ({ search }) => _jsxs(_Fragment, { children: ["No emoji for \u201C", search, "\u201D"] }) }), _jsx(Frimousse.List, { "aria-label": "Emoji", className: "pb-1.5 select-none", components: {
|
|
43
|
+
emojibaseUrl: emojibaseUrl, locale: "en", columns: EMOJI_COLUMNS, className: cn('isolate flex h-[388px] w-full flex-col', className), children: [_jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx(Frimousse.Search, { "aria-label": "Search emoji", placeholder: "Search emoji\u2026", className: cn('text-foreground placeholder:text-muted-foreground/70 h-full w-full bg-transparent text-sm outline-none', '[&::-webkit-search-cancel-button]:appearance-none') }) }), _jsxs(Frimousse.Viewport, { className: "relative flex-1 overflow-y-auto outline-none", children: [_jsx(Frimousse.Loading, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center", children: _jsx(Loading, {}) }), _jsx(Frimousse.Empty, { className: "text-muted-foreground absolute inset-0 flex items-center justify-center px-6 text-center text-sm text-balance", children: ({ search }) => _jsxs(_Fragment, { children: ["No emoji for \u201C", search, "\u201D"] }) }), _jsx(Frimousse.List, { "aria-label": "Emoji", className: "pb-1.5 select-none", components: {
|
|
128
44
|
// In each of these, `className` comes AFTER `{...props}` and merges
|
|
129
45
|
// `props.className`. All three prop types extend ComponentProps, so
|
|
130
46
|
// className is in the type; frimousse does not pass one today, but
|
|
131
47
|
// if it ever did, a className before the spread would be replaced
|
|
132
48
|
// outright and the whole tint system would go dead silently.
|
|
133
|
-
CategoryHeader: ({ category, ...props }) => (_jsx("div", { ...props, className: cn('bg-popover text-muted-foreground px-
|
|
134
|
-
Row: ({ children, ...props }) => (_jsx("div", { ...props,
|
|
49
|
+
CategoryHeader: ({ category, ...props }) => (_jsx("div", { ...props, className: cn('bg-popover text-muted-foreground px-4 pt-3 pb-1.5 text-xs font-medium', props.className), children: category.label })),
|
|
50
|
+
Row: ({ children, ...props }) => (_jsx("div", { ...props, className: cn('flex px-3', props.className), children: children })),
|
|
135
51
|
Emoji: ({ emoji, ...props }) => (_jsx("button", { type: "button", ...props, className: cn(EMOJI_BUTTON, props.className), children: emoji.emoji })),
|
|
136
|
-
} })] }), _jsxs("div", { className: "border-border
|
|
52
|
+
} })] }), _jsxs("div", { className: "border-border flex h-11 shrink-0 items-center gap-2 border-t px-4", children: [_jsx(Frimousse.ActiveEmoji, { children: ({ emoji }) => emoji ? (_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "text-lg leading-none", children: emoji.emoji }), _jsx("span", { className: "text-muted-foreground truncate text-xs", children: emoji.label })] })) : (_jsx("span", { className: "text-muted-foreground text-xs", children: "Pick an emoji" })) }), _jsx(Hint, { label: "Change skin tone", side: "top", children: _jsx(Frimousse.SkinToneSelector, { className: "hover:bg-muted ml-auto flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-md text-base transition-[background-color,scale] duration-fast active:scale-[0.96]" }) })] })] }));
|
|
137
53
|
}
|
|
@@ -98,12 +98,12 @@ export function emojiHue(emoji) {
|
|
|
98
98
|
* picker cell has no border at all, and matching it is the point.
|
|
99
99
|
*/
|
|
100
100
|
const TINT = {
|
|
101
|
-
red: 'border-0 bg-emoji-
|
|
102
|
-
amber: 'border-0 bg-emoji-
|
|
103
|
-
green: 'border-0 bg-emoji-
|
|
104
|
-
teal: 'border-0 bg-emoji-
|
|
105
|
-
blue: 'border-0 bg-emoji-
|
|
106
|
-
violet: 'border-0 bg-emoji-
|
|
101
|
+
red: 'border-0 bg-emoji-ring-red/15 dark:bg-emoji-ring-red/30',
|
|
102
|
+
amber: 'border-0 bg-emoji-ring-amber/15 dark:bg-emoji-ring-amber/30',
|
|
103
|
+
green: 'border-0 bg-emoji-ring-green/15 dark:bg-emoji-ring-green/30',
|
|
104
|
+
teal: 'border-0 bg-emoji-ring-teal/15 dark:bg-emoji-ring-teal/30',
|
|
105
|
+
blue: 'border-0 bg-emoji-ring-blue/15 dark:bg-emoji-ring-blue/30',
|
|
106
|
+
violet: 'border-0 bg-emoji-ring-violet/15 dark:bg-emoji-ring-violet/30',
|
|
107
107
|
};
|
|
108
108
|
/**
|
|
109
109
|
* The resting fill again, under `hover:`.
|
|
@@ -114,12 +114,12 @@ const TINT = {
|
|
|
114
114
|
* to a neutral wash. Restating the fill at the same modifier is what holds it.
|
|
115
115
|
*/
|
|
116
116
|
const TINT_HOVER = {
|
|
117
|
-
red: 'hover:bg-emoji-
|
|
118
|
-
amber: 'hover:bg-emoji-
|
|
119
|
-
green: 'hover:bg-emoji-
|
|
120
|
-
teal: 'hover:bg-emoji-
|
|
121
|
-
blue: 'hover:bg-emoji-
|
|
122
|
-
violet: 'hover:bg-emoji-
|
|
117
|
+
red: 'hover:bg-emoji-ring-red/15 dark:hover:bg-emoji-ring-red/30',
|
|
118
|
+
amber: 'hover:bg-emoji-ring-amber/15 dark:hover:bg-emoji-ring-amber/30',
|
|
119
|
+
green: 'hover:bg-emoji-ring-green/15 dark:hover:bg-emoji-ring-green/30',
|
|
120
|
+
teal: 'hover:bg-emoji-ring-teal/15 dark:hover:bg-emoji-ring-teal/30',
|
|
121
|
+
blue: 'hover:bg-emoji-ring-blue/15 dark:hover:bg-emoji-ring-blue/30',
|
|
122
|
+
violet: 'hover:bg-emoji-ring-violet/15 dark:hover:bg-emoji-ring-violet/30',
|
|
123
123
|
};
|
|
124
124
|
/** The picker's active-cell treatment, at rest: fill + 1px inset ring. */
|
|
125
125
|
export function emojiTint(emoji) {
|
|
@@ -3,7 +3,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import { Hint } from './hint.js';
|
|
4
4
|
import { emojiTint } from './emoji-tint.js';
|
|
5
5
|
import { glyphFace } from './glyph-face.js';
|
|
6
|
-
import { glyphForeground, glyphTint } from './glyph-tint.js';
|
|
6
|
+
import { glyphForeground, glyphStyle, glyphTint } from './glyph-tint.js';
|
|
7
|
+
import { FULL_BLEED_BORDER, useFullBleedGlyph } from './kortix-glyphs.js';
|
|
7
8
|
import { cn } from '../lib/utils.js';
|
|
8
9
|
import { chalkColors } from '../_vendor/kortix-shared.js';
|
|
9
10
|
/**
|
|
@@ -54,6 +55,8 @@ export function EntityAvatar({ hint, label, glyph, emoji, icon: IconComponent, s
|
|
|
54
55
|
const initial = (label?.trim()?.charAt(0) || '?').toUpperCase();
|
|
55
56
|
const chalk = chalkColors(`${label?.trim()}` || initial);
|
|
56
57
|
const resolvedGlyph = resolveGlyph(glyph);
|
|
58
|
+
// An Enterprise brand icon fills the whole tile, edge to edge.
|
|
59
|
+
const fullBleed = useFullBleedGlyph(resolvedGlyph ? glyph?.name : undefined);
|
|
57
60
|
const tile = (_jsx("span", { "data-slot": "entity-avatar",
|
|
58
61
|
// chalkColors() is an inline style, so it beats any class a caller
|
|
59
62
|
// passes. A glyph or an emoji is already the colour — sitting either on
|
|
@@ -61,13 +64,15 @@ export function EntityAvatar({ hint, label, glyph, emoji, icon: IconComponent, s
|
|
|
61
64
|
// pastel is a bright square in an otherwise dark grid. So a glyph or
|
|
62
65
|
// emoji tile drops the style entirely and rebuilds itself from its own
|
|
63
66
|
// tint tokens. See the class list.
|
|
64
|
-
style: resolvedGlyph
|
|
65
|
-
?
|
|
66
|
-
:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
style: resolvedGlyph
|
|
68
|
+
? glyphStyle(resolvedGlyph.color)
|
|
69
|
+
: emoji
|
|
70
|
+
? undefined
|
|
71
|
+
: {
|
|
72
|
+
backgroundColor: chalk.background,
|
|
73
|
+
color: chalk.foreground,
|
|
74
|
+
borderColor: chalk.border,
|
|
75
|
+
}, className: cn('inline-flex shrink-0 items-center justify-center border font-semibold', sizes.box, fullBleed && FULL_BLEED_BORDER,
|
|
71
76
|
// After `sizes.box`, so tailwind-merge resolves `sizes.emoji` over the
|
|
72
77
|
// initial's text size — and so `border-0` resolves over the base
|
|
73
78
|
// `border`, which is what stops a neutral hairline being drawn OUTSIDE
|
|
@@ -98,7 +103,7 @@ export function EntityAvatar({ hint, label, glyph, emoji, icon: IconComponent, s
|
|
|
98
103
|
// `sizes.icon`, not `sizes.emoji` — a glyph is a drawn Phosphor icon,
|
|
99
104
|
// sized like the plain `icon` prop below, not like a text-rendered
|
|
100
105
|
// emoji grapheme.
|
|
101
|
-
_jsx(resolvedGlyph.GlyphComponent, { className: cn(sizes.icon, glyphForeground(resolvedGlyph.color)) })) : emoji ? (
|
|
106
|
+
_jsx(resolvedGlyph.GlyphComponent, { weight: "fill", className: cn(fullBleed ? 'size-full' : sizes.icon, glyphForeground(resolvedGlyph.color)) })) : emoji ? (
|
|
102
107
|
// The tile always sits beside the name it belongs to, so the glyph is
|
|
103
108
|
// decorative: announced, it reads the emoji's CLDR name immediately
|
|
104
109
|
// before the label that says the same thing. Same treatment as the
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* name -> a component that draws a catalogue glyph
|
|
3
|
-
*
|
|
2
|
+
* name -> a component that draws a catalogue glyph solid, without the Phosphor
|
|
3
|
+
* component behind it.
|
|
4
4
|
*
|
|
5
|
-
* EntityAvatar is on every app page.
|
|
6
|
-
* `glyph-registry
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* glyph.
|
|
5
|
+
* EntityAvatar is on every app page. It draws a project's glyph through this
|
|
6
|
+
* module rather than `glyph-registry`, which carries every Phosphor weight of
|
|
7
|
+
* every catalogue glyph. The path data itself (`glyph-paths.generated.ts`,
|
|
8
|
+
* ~950 glyphs, 365 KB raw / 114 KB gzip on 2026-11-05) is ALSO too big for
|
|
9
|
+
* every page, so it loads on first use: the face renders an empty `<path>` in
|
|
10
|
+
* the same `IconBase` shell (same size, colour, mirroring and ref) and fills it
|
|
11
|
+
* in when the module arrives. A page with no glyph project never fetches it.
|
|
13
12
|
*
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
13
|
+
* The server always renders the empty shell, so server and client markup
|
|
14
|
+
* agree at hydration; the path paints one tick later.
|
|
15
|
+
*
|
|
16
|
+
* The three Kortix marks are their own small components and draw at once.
|
|
16
17
|
*/
|
|
17
18
|
import { type Icon } from '@phosphor-icons/react';
|
|
19
|
+
type GlyphPaths = Readonly<Record<string, string>>;
|
|
20
|
+
/** Fetch the path module once; every caller shares the same promise. */
|
|
21
|
+
export declare function loadGlyphPaths(): Promise<GlyphPaths>;
|
|
22
|
+
/** The path data of one glyph, or undefined until `loadGlyphPaths` resolves. */
|
|
23
|
+
export declare function glyphPathData(name: string): string | undefined;
|
|
18
24
|
export declare function glyphFace(name: string): Icon | null;
|
|
25
|
+
export {};
|
|
@@ -1,36 +1,75 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
/**
|
|
3
|
-
* name -> a component that draws a catalogue glyph
|
|
4
|
-
*
|
|
3
|
+
* name -> a component that draws a catalogue glyph solid, without the Phosphor
|
|
4
|
+
* component behind it.
|
|
5
5
|
*
|
|
6
|
-
* EntityAvatar is on every app page.
|
|
7
|
-
* `glyph-registry
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* glyph.
|
|
6
|
+
* EntityAvatar is on every app page. It draws a project's glyph through this
|
|
7
|
+
* module rather than `glyph-registry`, which carries every Phosphor weight of
|
|
8
|
+
* every catalogue glyph. The path data itself (`glyph-paths.generated.ts`,
|
|
9
|
+
* ~950 glyphs, 365 KB raw / 114 KB gzip on 2026-11-05) is ALSO too big for
|
|
10
|
+
* every page, so it loads on first use: the face renders an empty `<path>` in
|
|
11
|
+
* the same `IconBase` shell (same size, colour, mirroring and ref) and fills it
|
|
12
|
+
* in when the module arrives. A page with no glyph project never fetches it.
|
|
14
13
|
*
|
|
15
|
-
* The
|
|
16
|
-
*
|
|
14
|
+
* The server always renders the empty shell, so server and client markup
|
|
15
|
+
* agree at hydration; the path paints one tick later.
|
|
16
|
+
*
|
|
17
|
+
* The three Kortix marks are their own small components and draw at once.
|
|
17
18
|
*/
|
|
18
19
|
import { IconBase } from '@phosphor-icons/react';
|
|
19
|
-
import { createElement, forwardRef } from 'react';
|
|
20
|
-
import {
|
|
20
|
+
import { createElement, forwardRef, useEffect, useSyncExternalStore } from 'react';
|
|
21
|
+
import { isProjectGlyphName } from '../_vendor/kortix-shared.js';
|
|
22
|
+
import { KORTIX_GLYPH_COMPONENTS } from './kortix-glyphs.js';
|
|
21
23
|
import { ICON_WEIGHTS } from '../lib/icon-config.js';
|
|
24
|
+
let paths = null;
|
|
25
|
+
let pending = null;
|
|
26
|
+
const listeners = new Set();
|
|
27
|
+
/** Fetch the path module once; every caller shares the same promise. */
|
|
28
|
+
export function loadGlyphPaths() {
|
|
29
|
+
if (paths)
|
|
30
|
+
return Promise.resolve(paths);
|
|
31
|
+
pending ??= import('./glyph-paths.generated.js').then((module) => {
|
|
32
|
+
paths = module.GLYPH_PATHS;
|
|
33
|
+
for (const listener of listeners)
|
|
34
|
+
listener();
|
|
35
|
+
return paths;
|
|
36
|
+
});
|
|
37
|
+
return pending;
|
|
38
|
+
}
|
|
39
|
+
/** The path data of one glyph, or undefined until `loadGlyphPaths` resolves. */
|
|
40
|
+
export function glyphPathData(name) {
|
|
41
|
+
return paths && Object.hasOwn(paths, name) ? paths[name] : undefined;
|
|
42
|
+
}
|
|
43
|
+
const subscribe = (listener) => {
|
|
44
|
+
listeners.add(listener);
|
|
45
|
+
return () => listeners.delete(listener);
|
|
46
|
+
};
|
|
47
|
+
const clientSnapshot = () => paths;
|
|
48
|
+
const serverSnapshot = () => null;
|
|
22
49
|
const faces = new Map();
|
|
23
50
|
export function glyphFace(name) {
|
|
24
51
|
const cached = faces.get(name);
|
|
25
52
|
if (cached)
|
|
26
53
|
return cached;
|
|
27
|
-
|
|
54
|
+
// The Kortix marks are drawn by their own components, not one Phosphor path.
|
|
55
|
+
if (Object.hasOwn(KORTIX_GLYPH_COMPONENTS, name))
|
|
56
|
+
return KORTIX_GLYPH_COMPONENTS[name];
|
|
57
|
+
// Existence comes from the shared catalogue, which is small and already on
|
|
58
|
+
// every page; the path data is not needed to answer "is this a glyph?".
|
|
59
|
+
if (!isProjectGlyphName(name))
|
|
28
60
|
return null;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
61
|
+
const Face = forwardRef((props, ref) => {
|
|
62
|
+
const loaded = useSyncExternalStore(subscribe, clientSnapshot, serverSnapshot);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!paths)
|
|
65
|
+
void loadGlyphPaths();
|
|
66
|
+
}, []);
|
|
67
|
+
const path = createElement('path', { d: loaded?.[name] ?? '' });
|
|
68
|
+
// Every weight draws the generated one: a project glyph is always solid
|
|
69
|
+
// (GLYPH_WEIGHT in glyph-paths-source.tsx), whatever the app's icon weight.
|
|
70
|
+
const weights = new Map(ICON_WEIGHTS.map((weight) => [weight, path]));
|
|
71
|
+
return createElement(IconBase, { ref, ...props, weights });
|
|
72
|
+
});
|
|
34
73
|
Face.displayName = `${name}Glyph`;
|
|
35
74
|
faces.set(name, Face);
|
|
36
75
|
return Face;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import type { IconWeight } from '@phosphor-icons/react';
|
|
2
|
+
/**
|
|
3
|
+
* Project glyphs are always SOLID, independent of the app's icon weight
|
|
4
|
+
* (DEFAULT_ICON_WEIGHT): a filled shape carries the chosen colour on its tinted
|
|
5
|
+
* tile, where a stroke reads thin.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GLYPH_WEIGHT: IconWeight;
|
|
1
8
|
export declare function glyphPathsInDefaultWeight(): Record<string, string>;
|
|
2
9
|
export declare function renderGlyphPathsModule(): string;
|