@kortix/ui 0.16.2 → 0.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_vendor/kortix-shared.js +1 -4
- package/dist/customize/settings/rail-copy-context.d.ts +2 -0
- package/dist/customize/settings/rail-copy-context.js +2 -0
- package/dist/customize/settings/tabs/chrome-connections-tab.js +1 -1
- package/dist/files/renderers/show-content-renderer.js +3 -1
- package/dist/i18n/en.d.ts +14 -9
- package/dist/i18n/en.js +15 -10
- package/dist/internal/chrome/chrome-connect.d.ts +3 -5
- package/dist/internal/chrome/chrome-connect.js +7 -10
- package/dist/internal/chrome/extension.d.ts +1 -8
- package/dist/internal/chrome/extension.js +1 -8
- package/dist/internal/chrome/use-chrome-offered.d.ts +6 -12
- package/dist/internal/chrome/use-chrome-offered.js +13 -15
- package/dist/internal/layout/project-page-header.js +5 -4
- package/dist/internal/stores/user-preferences-store.d.ts +17 -0
- package/dist/internal/stores/user-preferences-store.js +5 -0
- package/dist/primitives/color-picker.d.ts +19 -0
- package/dist/primitives/color-picker.js +27 -0
- package/dist/primitives/faded-scroll-area.js +4 -0
- package/dist/primitives/glyph-picker.d.ts +11 -0
- package/dist/primitives/glyph-picker.js +10 -6
- package/dist/primitives/gradient-wallpaper-gl.d.ts +61 -0
- package/dist/primitives/gradient-wallpaper-gl.js +446 -0
- package/dist/primitives/gradient-wallpaper.d.ts +20 -0
- package/dist/primitives/gradient-wallpaper.js +242 -0
- package/dist/primitives/resizable.d.ts +1 -1
- package/dist/session/composer/ComposerCard.js +0 -3
- package/dist/session/panel/easy/detail-view.js +3 -2
- package/dist/session/panel/shared/collect-tool-parts.js +2 -2
- package/dist/session/panel/shared/use-panel-handoffs.js +23 -2
- package/dist/session/thread/session-body.js +1 -1
- package/dist/session/tool/shared/infrastructure-contexts.d.ts +5 -0
- package/dist/session/tool/shared/infrastructure-contexts.js +7 -0
- package/dist/session/tool/show-group-renderer.d.ts +5 -5
- package/dist/session/tool/show-group-renderer.js +7 -4
- package/dist/session/tool/tool-part-renderer.js +3 -1
- package/dist/session/tool/tool-renderers.d.ts +1 -1
- package/dist/session/tool/tool-renderers.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +14 -9
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/wallpaper-gradients.d.ts +106 -0
- package/dist/theme/wallpaper-gradients.js +347 -0
- package/dist/theme/wallpapers.d.ts +23 -3
- package/dist/theme/wallpapers.js +53 -29
- package/dist/workspace/admin/project-admin-dashboard.js +1 -1
- package/dist/workspace/layout/project-home.js +1 -1
- package/dist/workspace/new/use-create-workspace.d.ts +5 -3
- package/dist/workspace/new/use-create-workspace.js +1 -1
- package/dist/workspace/session-spaces/space-picker.js +3 -3
- package/dist/workspace/setup/setup-banner-snooze.d.ts +10 -0
- package/dist/workspace/setup/setup-banner-snooze.js +44 -0
- package/dist/workspace/setup/setup-banner.js +19 -36
- package/dist/workspace/setup/setup-steps.d.ts +0 -5
- package/dist/workspace/setup/setup-steps.js +0 -7
- package/dist/workspace/setup/workspace-setup-modal.d.ts +39 -0
- package/dist/workspace/setup/workspace-setup-modal.js +202 -0
- package/dist/workspace/sidebar/project-session-list.js +2 -1
- package/dist/workspace/sidebar/project-sidebar.js +6 -5
- package/package.json +14 -10
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/modules.md +3 -1
- package/dist/primitives/toast-clearance.d.ts +0 -36
- package/dist/primitives/toast-clearance.js +0 -94
- package/dist/workspace/setup/workspace-setup-page.d.ts +0 -10
- package/dist/workspace/setup/workspace-setup-page.js +0 -91
|
@@ -3740,9 +3740,6 @@ var ARTIFACT_DOC_CSS = `
|
|
|
3740
3740
|
.kx-doc .kx-code>figcaption button{display:none}}
|
|
3741
3741
|
`;
|
|
3742
3742
|
|
|
3743
|
-
// ../shared/src/chrome-launch.ts
|
|
3744
|
-
var CHROME_LAUNCHED = false;
|
|
3745
|
-
|
|
3746
3743
|
// ../shared/src/code-language.ts
|
|
3747
3744
|
var LANGUAGE_ALIASES = {
|
|
3748
3745
|
// web
|
|
@@ -6675,4 +6672,4 @@ function parseWorkspaceSettingsSection(raw) {
|
|
|
6675
6672
|
return Object.prototype.hasOwnProperty.call(WORKSPACE_SETTINGS_SECTION_ALIASES, value) ? WORKSPACE_SETTINGS_SECTION_ALIASES[value] : null;
|
|
6676
6673
|
}
|
|
6677
6674
|
|
|
6678
|
-
export { AGENT_TITLE_MAX_LENGTH, ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS,
|
|
6675
|
+
export { AGENT_TITLE_MAX_LENGTH, ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS, COMMIT_CONFIRM_ATTEMPTS, COMMIT_CONFIRM_DELAY_MS, CREDITS_PER_DOLLAR, CURATED_SECTIONS, HUMAN_ONLY, KATEX_FENCE_LANGUAGES, LANGUAGE_ALIASES, LONG_NAME_THRESHOLD, MAX_PROMPT_ATTACHMENTS_BYTES, MAX_PROMPT_ATTACHMENT_BYTES, MAX_PROMPT_ATTACHMENT_FILES, MAX_PROMPT_UPLOAD_FILENAME_BYTES, MERMAID_DIAGRAM_STARTERS, MY_KORTIX_AGENT_NAME, MY_KORTIX_SANDBOX_SLUG, NAME_TAIL_CHARS, NOT_TURN_PROMPTER, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, PIXEL_MARK_TONES, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, STALE_RUNTIME_DELIVERY_ERROR, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, agentDisplayName, appAdminsOnly, attachmentExtension, autoLinkUrls, avatarFill, bashRowTitle, buildWebhookSampleRequest, cardImageShape, cardListLayout, chalkColors, channelPromptTail, classifySessionStarter, confirmCommitted, countInSection, dedentCommand, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, filenameBreakSegments, fixManifestText, formatDurationSeconds, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isPreviewableImage, isProjectGlyphColor, isProjectGlyphName, isProjectGlyphPaletteColor, languageLabel, looksLikeMarkdown, masonryColumns, neutralizePastedTags, newConfigPrompt, newPastedContentId, normalizeLanguage, normalizeLatexDelimiters, normalizeProjectGlyphColor, openMarkdownLinkAtEnd, parseBackgroundWorkers, parseBalanceUsd, parseChannelMessage, parseDurationSeconds, parseGrepOutput, parseManifestText, parseMemoryEntryOutput, parseMemorySearchOutput, parsePeerMessagePrompt, parseReminderPrompt, parseSessionGetOutput, parseSessionMessagesOutput, parseSessionMetadataOutput, parseSessionSearchHits, parseTriggerEvent, parseTriggerLines, parseWorkspaceSettingsSection, passesPixelMarkGate, peerHandleLabel, pixelMark, policySetNameError, prefersPreviewLink, prepareMarkdownForKatex, prepareMarkdownForMath, promptFileReferenceXml, ptyOutputBlock, ptySpawnedBody, pushTypeOf, referenceHeaders, removeSpans, replaceSpans, resolveRegisteredKey, safeHttpUrl, sandboxMediaPath, sanitizePromptUploadFilename, sectionKeyForCategory, sectionKeysForEntry, sectionTitle, selfClosingTags, serializePromptWithPastes, sessionGroupDriveFolder, setupPrompt, setupTarget, shouldTilePaste, skillDocumentBody, slackPlainText, slugifySlug, spaceDriveFolders, spaceSlug, splitFilenameForTile, splitPastedContent, stopRefusalMessage, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, suggestSpaceIcon, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
|
|
@@ -6,6 +6,8 @@ export interface SettingsRailChromeCopy {
|
|
|
6
6
|
backToApp: string;
|
|
7
7
|
close: string;
|
|
8
8
|
docs: string;
|
|
9
|
+
search: string;
|
|
10
|
+
searchNoResults: string;
|
|
9
11
|
}
|
|
10
12
|
export declare const DEFAULT_SETTINGS_RAIL_CHROME_COPY: SettingsRailChromeCopy;
|
|
11
13
|
interface SettingsRailCopyValue {
|
|
@@ -45,7 +45,7 @@ export function ChromeConnectionsTab() {
|
|
|
45
45
|
/** No browser yet: the steps stand inline, the one action is in the header. */
|
|
46
46
|
function ChromeEmptyTab() {
|
|
47
47
|
const state = useChromeConnect();
|
|
48
|
-
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-5", children: [_jsx(SettingsTabHeader, { tab: "chrome", action: state.environment === 'unsupported' ? (_jsx(ChromeCopyLink, {})) : (_jsx(ChromeInstallActions, { state: state
|
|
48
|
+
return (_jsxs("div", { className: "mx-auto w-full max-w-2xl space-y-5", children: [_jsx(SettingsTabHeader, { tab: "chrome", action: state.environment === 'unsupported' ? (_jsx(ChromeCopyLink, {})) : (_jsx(ChromeInstallActions, { state: state })) }), _jsxs("div", { className: "space-y-4", children: [_jsx(ChromeMock, { className: "mx-auto max-w-md" }), _jsx("div", { className: "bg-popover flex flex-col gap-5 rounded-md border px-4 py-5", children: _jsx(ChromeConnectSteps, { state: state, showActions: false }) })] })] }));
|
|
49
49
|
}
|
|
50
50
|
/** "Chromium on macOS · Work · v1.0.0": what tells two browsers apart. The name is not repeated. */
|
|
51
51
|
function chromeMeta(chrome, displayName) {
|
|
@@ -740,10 +740,12 @@ export function ShowCarousel({ items, LocalhostPreview, onIndexChange, fill = fa
|
|
|
740
740
|
const currentItem = items[currentIndex];
|
|
741
741
|
if (!currentItem)
|
|
742
742
|
return null;
|
|
743
|
+
// The 420px slot holds media steady while paging; link cards are one row each and need none.
|
|
744
|
+
const linkCardsOnly = items.every((item) => item.type === 'url' && !(item.url && parseLocalhostUrl(item.url) && !isAppRouteUrl(item.url)));
|
|
743
745
|
return (_jsxs("div", { role: "group", className: cn('outline-none', fill && 'flex h-full flex-col'),
|
|
744
746
|
// -1: a click on the content focuses the card, so ←/→ page it next,
|
|
745
747
|
// without adding a Tab stop. Tab still reaches the chevrons inside.
|
|
746
|
-
tabIndex: fill || count < 2 ? undefined : -1, onKeyDown: fill || count < 2 ? undefined : (e) => handleArrowKey(e), children: [_jsx("div", { className: cn(fill ? 'min-h-0 flex-1 overflow-hidden' : 'min-h-[420px]'), children: currentItem.status === 'pending' ? (_jsxs("div", { className: cn('flex items-center justify-center gap-3', fill ? 'h-full' : 'min-h-[420px]'), children: [_jsx(Loading, { className: "text-muted-foreground size-4" }), _jsx(TextShimmer, { duration: 1, spread: 2, className: "text-sm", children: tHardcodedUi.raw('componentsSessionToolRenderers.line4935JsxTextPreparingOutput') })] })) : (_jsx(ShowContentRenderer, { type: currentItem.type, title: currentItem.title, description: currentItem.description, path: currentItem.path, url: currentItem.url, content: currentItem.content, language: currentItem.language, aspectRatio: currentItem.aspect_ratio, attachment: currentItem.attachment, sha256: currentItem.sha256, LocalhostPreview: LocalhostPreview, toolbarActions: toolbarActions, fill: fill })) }), count > 1 && !hideNav && (_jsxs("div", { className: "border-border flex shrink-0 items-center gap-2 border-t px-2 py-1.5 pr-3.5", children: [_jsxs("div", { className: "flex shrink-0 items-center", children: [_jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: prev, className: "hit-area-2 hit-area-r-0 transition-transform active:scale-[0.96]", disabled: currentIndex === 0, "aria-label": tI18nComplete.raw('text81b35f1b4332'), children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: next, className: "hit-area-2 hit-area-l-0 transition-transform active:scale-[0.96]", disabled: currentIndex >= count - 1, "aria-label": tI18nComplete.raw('text1e47d4f7a1a3'), children: _jsx(ChevronRight, { className: "size-4" }) })] }), _jsx(FadedScrollArea, { ref: stripRef, orientation: "horizontal", fadeColor: "from-secondary", className: "min-w-0 flex-1 overscroll-x-contain", children: _jsx("div", { className: "flex w-max min-w-0 items-center gap-1", children: items.map((item, i) => {
|
|
748
|
+
tabIndex: fill || count < 2 ? undefined : -1, onKeyDown: fill || count < 2 ? undefined : (e) => handleArrowKey(e), children: [_jsx("div", { className: cn(fill ? 'min-h-0 flex-1 overflow-hidden' : !linkCardsOnly && 'min-h-[420px]'), children: currentItem.status === 'pending' ? (_jsxs("div", { className: cn('flex items-center justify-center gap-3', fill ? 'h-full' : 'min-h-[420px]'), children: [_jsx(Loading, { className: "text-muted-foreground size-4" }), _jsx(TextShimmer, { duration: 1, spread: 2, className: "text-sm", children: tHardcodedUi.raw('componentsSessionToolRenderers.line4935JsxTextPreparingOutput') })] })) : (_jsx(ShowContentRenderer, { type: currentItem.type, title: currentItem.title, description: currentItem.description, path: currentItem.path, url: currentItem.url, content: currentItem.content, language: currentItem.language, aspectRatio: currentItem.aspect_ratio, attachment: currentItem.attachment, sha256: currentItem.sha256, LocalhostPreview: LocalhostPreview, toolbarActions: toolbarActions, fill: fill })) }), count > 1 && !hideNav && (_jsxs("div", { className: "border-border flex shrink-0 items-center gap-2 border-t px-2 py-1.5 pr-3.5", children: [_jsxs("div", { className: "flex shrink-0 items-center", children: [_jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: prev, className: "hit-area-2 hit-area-r-0 transition-transform active:scale-[0.96]", disabled: currentIndex === 0, "aria-label": tI18nComplete.raw('text81b35f1b4332'), children: _jsx(ChevronLeft, { className: "size-4" }) }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: next, className: "hit-area-2 hit-area-l-0 transition-transform active:scale-[0.96]", disabled: currentIndex >= count - 1, "aria-label": tI18nComplete.raw('text1e47d4f7a1a3'), children: _jsx(ChevronRight, { className: "size-4" }) })] }), _jsx(FadedScrollArea, { ref: stripRef, orientation: "horizontal", fadeColor: "from-secondary", className: "min-w-0 flex-1 overscroll-x-contain", children: _jsx("div", { className: "flex w-max min-w-0 items-center gap-1", children: items.map((item, i) => {
|
|
747
749
|
const label = labels[i] ?? 'Item';
|
|
748
750
|
const isPortLabel = label.startsWith(':');
|
|
749
751
|
return (_jsx("button", { ref: (el) => {
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -353,6 +353,8 @@ declare const catalog: {
|
|
|
353
353
|
backToApp: string;
|
|
354
354
|
close: string;
|
|
355
355
|
docs: string;
|
|
356
|
+
search: string;
|
|
357
|
+
searchNoResults: string;
|
|
356
358
|
groups: {
|
|
357
359
|
workspace: string;
|
|
358
360
|
personal: string;
|
|
@@ -7326,7 +7328,6 @@ declare const catalog: {
|
|
|
7326
7328
|
title: string;
|
|
7327
7329
|
description: string;
|
|
7328
7330
|
done: string;
|
|
7329
|
-
descriptionUnlisted: string;
|
|
7330
7331
|
};
|
|
7331
7332
|
connect: {
|
|
7332
7333
|
title: string;
|
|
@@ -7380,7 +7381,6 @@ declare const catalog: {
|
|
|
7380
7381
|
control: string;
|
|
7381
7382
|
own: string;
|
|
7382
7383
|
};
|
|
7383
|
-
howToInstall: string;
|
|
7384
7384
|
copyLink: string;
|
|
7385
7385
|
linkCopied: string;
|
|
7386
7386
|
copyFailed: string;
|
|
@@ -10613,27 +10613,32 @@ declare const catalog: {
|
|
|
10613
10613
|
};
|
|
10614
10614
|
workspaceSetup: {
|
|
10615
10615
|
title: string;
|
|
10616
|
-
|
|
10617
|
-
|
|
10616
|
+
subtitle: string;
|
|
10617
|
+
progress: string;
|
|
10618
|
+
liveNote: string;
|
|
10619
|
+
later: string;
|
|
10618
10620
|
tryAgain: string;
|
|
10619
10621
|
loadFailed: string;
|
|
10620
10622
|
emptyTitle: string;
|
|
10621
10623
|
emptyDescription: string;
|
|
10622
|
-
openWorkspace: string;
|
|
10623
10624
|
completeTitle: string;
|
|
10624
10625
|
completeDescription: string;
|
|
10625
10626
|
slackName: string;
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
kindSlack: string;
|
|
10627
|
+
sectionOpen: string;
|
|
10628
|
+
doneSummary: string;
|
|
10629
10629
|
done: string;
|
|
10630
10630
|
connect: string;
|
|
10631
|
+
connectShort: string;
|
|
10631
10632
|
reconnect: string;
|
|
10633
|
+
reconnectShort: string;
|
|
10632
10634
|
setSecret: string;
|
|
10635
|
+
setShort: string;
|
|
10633
10636
|
addSlack: string;
|
|
10634
10637
|
connectSlack: string;
|
|
10635
10638
|
bannerTitle: string;
|
|
10636
|
-
|
|
10639
|
+
bannerNamed: string;
|
|
10640
|
+
bannerStart: string;
|
|
10641
|
+
bannerContinue: string;
|
|
10637
10642
|
};
|
|
10638
10643
|
sessionSpaces: {
|
|
10639
10644
|
title: string;
|
package/dist/i18n/en.js
CHANGED
|
@@ -354,6 +354,8 @@ const catalog = {
|
|
|
354
354
|
"backToApp": "Back to app",
|
|
355
355
|
"close": "Close",
|
|
356
356
|
"docs": "Docs",
|
|
357
|
+
"search": "Search preferences",
|
|
358
|
+
"searchNoResults": "No matches",
|
|
357
359
|
"groups": {
|
|
358
360
|
"workspace": "Workspace",
|
|
359
361
|
"personal": "Personal",
|
|
@@ -7326,8 +7328,7 @@ const catalog = {
|
|
|
7326
7328
|
"install": {
|
|
7327
7329
|
"title": "Add the extension",
|
|
7328
7330
|
"description": "From the Chrome Web Store.",
|
|
7329
|
-
"done": "Kortix is in Chrome."
|
|
7330
|
-
"descriptionUnlisted": "Load it in Chrome."
|
|
7331
|
+
"done": "Kortix is in Chrome."
|
|
7331
7332
|
},
|
|
7332
7333
|
"connect": {
|
|
7333
7334
|
"title": "Sign in",
|
|
@@ -7381,7 +7382,6 @@ const catalog = {
|
|
|
7381
7382
|
"control": "Take over or Stop from the bar on the page at any time.",
|
|
7382
7383
|
"own": "Only your own sessions can use your browser."
|
|
7383
7384
|
},
|
|
7384
|
-
"howToInstall": "How to install",
|
|
7385
7385
|
"copyLink": "Copy link",
|
|
7386
7386
|
"linkCopied": "Link copied",
|
|
7387
7387
|
"copyFailed": "Could not copy the link. Try again.",
|
|
@@ -10614,27 +10614,32 @@ const catalog = {
|
|
|
10614
10614
|
},
|
|
10615
10615
|
"workspaceSetup": {
|
|
10616
10616
|
"title": "Finish setup",
|
|
10617
|
-
"
|
|
10618
|
-
"
|
|
10617
|
+
"subtitle": "Your agents need these before they can work.",
|
|
10618
|
+
"progress": "{done} of {total} done",
|
|
10619
|
+
"liveNote": "Updates as you connect.",
|
|
10620
|
+
"later": "Later",
|
|
10619
10621
|
"tryAgain": "Try again",
|
|
10620
10622
|
"loadFailed": "Could not load the setup steps.",
|
|
10621
10623
|
"emptyTitle": "Nothing left to set up",
|
|
10622
10624
|
"emptyDescription": "This workspace needs no sign-in, secret or Slack from you.",
|
|
10623
|
-
"openWorkspace": "Open workspace",
|
|
10624
10625
|
"completeTitle": "Setup is complete",
|
|
10625
10626
|
"completeDescription": "If you started the setup in a terminal, it continues there by itself.",
|
|
10626
10627
|
"slackName": "Slack",
|
|
10627
|
-
"
|
|
10628
|
-
"
|
|
10629
|
-
"kindSlack": "Channel",
|
|
10628
|
+
"sectionOpen": "Needs you",
|
|
10629
|
+
"doneSummary": "{count} already set up",
|
|
10630
10630
|
"done": "Done",
|
|
10631
10631
|
"connect": "Connect {name}",
|
|
10632
|
+
"connectShort": "Connect",
|
|
10632
10633
|
"reconnect": "Reconnect {name}",
|
|
10634
|
+
"reconnectShort": "Reconnect",
|
|
10633
10635
|
"setSecret": "Set {name}",
|
|
10636
|
+
"setShort": "Set value",
|
|
10634
10637
|
"addSlack": "Add Kortix to Slack",
|
|
10635
10638
|
"connectSlack": "Connect Slack",
|
|
10636
10639
|
"bannerTitle": "{left, plural, one {# setup step is left} other {# setup steps are left}}",
|
|
10637
|
-
"
|
|
10640
|
+
"bannerNamed": "{action} to finish setup",
|
|
10641
|
+
"bannerStart": "Start setup",
|
|
10642
|
+
"bannerContinue": "Continue setup"
|
|
10638
10643
|
},
|
|
10639
10644
|
"sessionSpaces": {
|
|
10640
10645
|
"title": "Spaces",
|
|
@@ -36,15 +36,13 @@ export declare function ChromeCopyLink({ size, className }: {
|
|
|
36
36
|
}): import("react").JSX.Element;
|
|
37
37
|
/**
|
|
38
38
|
* The action that moves this browser forward: Connect once the extension is
|
|
39
|
-
* there, otherwise
|
|
40
|
-
*
|
|
39
|
+
* there, otherwise "Add to Chrome" (the Web Store listing). Renders nothing for
|
|
40
|
+
* a connected browser.
|
|
41
41
|
*/
|
|
42
|
-
export declare function ChromeInstallActions({ state, size, className,
|
|
42
|
+
export declare function ChromeInstallActions({ state, size, className, }: {
|
|
43
43
|
state: ChromeConnectState;
|
|
44
44
|
size?: 'sm' | 'lg';
|
|
45
45
|
className?: string;
|
|
46
|
-
/** The "How to install" link. Off where the page already links the docs. */
|
|
47
|
-
showGuide?: boolean;
|
|
48
46
|
}): import("react").JSX.Element | null;
|
|
49
47
|
/**
|
|
50
48
|
* The three steps and the one action that moves them. Used in the connect
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { platformConfig } from '@kortix/sdk';
|
|
4
4
|
import { useChromeConnections } from '@kortix/sdk/react';
|
|
5
|
-
import { AppWindowIcon,
|
|
5
|
+
import { AppWindowIcon, LinkSimpleIcon, PuzzlePieceIcon, SignInIcon, } from '@phosphor-icons/react';
|
|
6
6
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
7
7
|
import { useState, useSyncExternalStore } from 'react';
|
|
8
8
|
import { Button } from '../../primitives/button.js';
|
|
@@ -16,7 +16,7 @@ import { useTranslations } from '../../i18n/index.js';
|
|
|
16
16
|
import { isDesktop } from '../lib/desktop.js';
|
|
17
17
|
import { cn } from '../lib/utils.js';
|
|
18
18
|
import { BrowserIcon, BrowserLogoTile } from './browser-icon.js';
|
|
19
|
-
import { apiOrigin,
|
|
19
|
+
import { apiOrigin, chromeSettingsLink, connectExtension, isChromiumBrowser, KORTIX_EXTENSION_STORE_URL, pingExtension, } from './extension.js';
|
|
20
20
|
const subscribeNever = () => () => { };
|
|
21
21
|
function detectEnvironment() {
|
|
22
22
|
return isChromiumBrowser(navigator.userAgent) && !isDesktop() ? 'supported' : 'unsupported';
|
|
@@ -101,10 +101,10 @@ export function ChromeCopyLink({ size = 'sm', className }) {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* The action that moves this browser forward: Connect once the extension is
|
|
104
|
-
* there, otherwise
|
|
105
|
-
*
|
|
104
|
+
* there, otherwise "Add to Chrome" (the Web Store listing). Renders nothing for
|
|
105
|
+
* a connected browser.
|
|
106
106
|
*/
|
|
107
|
-
export function ChromeInstallActions({ state, size = 'sm', className,
|
|
107
|
+
export function ChromeInstallActions({ state, size = 'sm', className, }) {
|
|
108
108
|
const t = useTranslations('chrome');
|
|
109
109
|
const { checking, installed, connected, connect } = state;
|
|
110
110
|
const [openedStore, setOpenedStore] = useState(false);
|
|
@@ -114,10 +114,7 @@ export function ChromeInstallActions({ state, size = 'sm', className, showGuide
|
|
|
114
114
|
const connectButton = (_jsxs(Button, { size: size, className: full, disabled: connect.isPending, onClick: () => connect.mutate(), children: [connect.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, connect.isPending ? t('connecting') : t('connect')] }));
|
|
115
115
|
if (installed)
|
|
116
116
|
return _jsx("div", { className: className, children: connectButton });
|
|
117
|
-
|
|
118
|
-
return (_jsxs("div", { className: cn('space-y-2', className), children: [_jsx(Button, { asChild: true, size: size, className: full, "aria-disabled": checking, children: _jsxs("a", { href: KORTIX_EXTENSION_STORE_URL, target: "_blank", rel: "noreferrer", onClick: () => setOpenedStore(true), children: [_jsx(ChromeButtonMark, {}), t('addToChrome')] }) }), openedStore ? (_jsx("p", { className: "text-muted-foreground text-center text-xs text-pretty", children: t('finishInChrome') })) : null] }));
|
|
119
|
-
}
|
|
120
|
-
return (_jsxs("div", { className: cn(size === 'lg' ? 'flex flex-col gap-2' : 'flex flex-wrap items-center gap-x-3 gap-y-2', className), children: [connectButton, showGuide ? (_jsx(Button, { asChild: true, variant: "ghost", size: size, className: cn('gap-1.5', size === 'sm' && 'text-muted-foreground'), children: _jsxs("a", { href: CHROME_INSTALL_DOCS_PATH, target: "_blank", rel: "noreferrer", children: [t('howToInstall'), _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0" })] }) })) : null] }));
|
|
117
|
+
return (_jsxs("div", { className: cn('space-y-2', className), children: [_jsx(Button, { asChild: true, size: size, className: full, "aria-disabled": checking, children: _jsxs("a", { href: KORTIX_EXTENSION_STORE_URL, target: "_blank", rel: "noreferrer", onClick: () => setOpenedStore(true), children: [_jsx(ChromeButtonMark, {}), t('addToChrome')] }) }), openedStore ? (_jsx("p", { className: "text-muted-foreground text-center text-xs text-pretty", children: t('finishInChrome') })) : null] }));
|
|
121
118
|
}
|
|
122
119
|
/**
|
|
123
120
|
* The three steps and the one action that moves them. Used in the connect
|
|
@@ -135,7 +132,7 @@ export function ChromeConnectSteps({ state, onDone, showActions = true, }) {
|
|
|
135
132
|
key: 'install',
|
|
136
133
|
icon: PuzzlePieceIcon,
|
|
137
134
|
done: installed,
|
|
138
|
-
description: installed ?
|
|
135
|
+
description: t(installed ? 'steps.install.done' : 'steps.install.description'),
|
|
139
136
|
},
|
|
140
137
|
{
|
|
141
138
|
key: 'connect',
|
|
@@ -8,15 +8,8 @@
|
|
|
8
8
|
* and the desktop shell never expose it, so `pingExtension` answers `null`.
|
|
9
9
|
*/
|
|
10
10
|
export declare const KORTIX_EXTENSION_ID: string;
|
|
11
|
+
/** The public Chrome Web Store listing (since 2026-11-21). */
|
|
11
12
|
export declare const KORTIX_EXTENSION_STORE_URL: string;
|
|
12
|
-
/**
|
|
13
|
-
* The Web Store listing is public. While `false`, no surface offers "Add to
|
|
14
|
-
* Chrome": each one shows "Connect" and a "How to install" link to the docs.
|
|
15
|
-
* Flip it with the listing, nothing else changes.
|
|
16
|
-
*/
|
|
17
|
-
export declare const CHROME_STORE_LISTED = false;
|
|
18
|
-
/** Where "How to install" points: the docs page that explains Load unpacked. */
|
|
19
|
-
export declare const CHROME_INSTALL_DOCS_PATH = "/docs/connect/chrome";
|
|
20
13
|
/** Opens Settings → Kortix in Chrome. The link a person copies to open it in Chrome. */
|
|
21
14
|
export declare function chromeSettingsLink(origin: string): string;
|
|
22
15
|
export interface ExtensionStatus {
|
|
@@ -7,15 +7,8 @@
|
|
|
7
7
|
* and the desktop shell never expose it, so `pingExtension` answers `null`.
|
|
8
8
|
*/
|
|
9
9
|
export const KORTIX_EXTENSION_ID = process.env.NEXT_PUBLIC_KORTIX_EXTENSION_ID || 'gefbbnjgoiljpbnalgafbhbfdhikgjek';
|
|
10
|
+
/** The public Chrome Web Store listing (since 2026-11-21). */
|
|
10
11
|
export const KORTIX_EXTENSION_STORE_URL = `https://chromewebstore.google.com/detail/${KORTIX_EXTENSION_ID}`;
|
|
11
|
-
/**
|
|
12
|
-
* The Web Store listing is public. While `false`, no surface offers "Add to
|
|
13
|
-
* Chrome": each one shows "Connect" and a "How to install" link to the docs.
|
|
14
|
-
* Flip it with the listing, nothing else changes.
|
|
15
|
-
*/
|
|
16
|
-
export const CHROME_STORE_LISTED = false;
|
|
17
|
-
/** Where "How to install" points: the docs page that explains Load unpacked. */
|
|
18
|
-
export const CHROME_INSTALL_DOCS_PATH = '/docs/connect/chrome';
|
|
19
12
|
/** Opens Settings → Kortix in Chrome. The link a person copies to open it in Chrome. */
|
|
20
13
|
export function chromeSettingsLink(origin) {
|
|
21
14
|
return `${origin}/settings/chrome`;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
-
/**
|
|
3
|
-
* The web app's master switch for Kortix in Chrome. Off, no surface renders
|
|
4
|
-
* and nothing calls /v1/chrome/*: no Settings page, no command-palette entry,
|
|
5
|
-
* no sidebar row and no card in Apps and extensions. Off on every deployment
|
|
6
|
-
* until launch: a person must not see a Chrome surface before the Chrome Web
|
|
7
|
-
* Store listing is public. Set true to bring the
|
|
8
|
-
* surfaces back where the API serves the routes. The value is
|
|
9
|
-
* `CHROME_LAUNCHED`, which the API and the CLI read too.
|
|
10
|
-
*/
|
|
11
|
-
export declare const CHROME_UI_ENABLED = false;
|
|
12
2
|
/**
|
|
13
3
|
* Whether this platform offers Kortix in Chrome at all. The API answers 404
|
|
14
4
|
* on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (a self-hosted server), so the
|
|
15
5
|
* account-level surfaces — Settings → Kortix in Chrome and its command-palette
|
|
16
6
|
* entry — show only once the browser list answers. Project surfaces read the
|
|
17
|
-
* project's `chrome` flag
|
|
7
|
+
* project's `chrome` flag instead.
|
|
8
|
+
*
|
|
9
|
+
* `true` once the browser list answers, `false` when it fails, `undefined`
|
|
10
|
+
* while it loads: a page opened at `/settings/chrome` waits for the answer
|
|
11
|
+
* instead of falling back to another tab.
|
|
18
12
|
*
|
|
19
13
|
* `enabled`: ask only while the surface that needs the answer is open.
|
|
20
14
|
*/
|
|
21
|
-
export declare function useChromeOffered(enabled?: boolean): boolean;
|
|
15
|
+
export declare function useChromeOffered(enabled?: boolean): boolean | undefined;
|
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { listChromeConnections } from '@kortix/sdk';
|
|
3
3
|
import { chromeKeys } from '@kortix/sdk/react';
|
|
4
|
-
import { CHROME_LAUNCHED } from '../../_vendor/kortix-shared.js';
|
|
5
4
|
import { useQuery } from '@tanstack/react-query';
|
|
6
|
-
/**
|
|
7
|
-
* The web app's master switch for Kortix in Chrome. Off, no surface renders
|
|
8
|
-
* and nothing calls /v1/chrome/*: no Settings page, no command-palette entry,
|
|
9
|
-
* no sidebar row and no card in Apps and extensions. Off on every deployment
|
|
10
|
-
* until launch: a person must not see a Chrome surface before the Chrome Web
|
|
11
|
-
* Store listing is public. Set true to bring the
|
|
12
|
-
* surfaces back where the API serves the routes. The value is
|
|
13
|
-
* `CHROME_LAUNCHED`, which the API and the CLI read too.
|
|
14
|
-
*/
|
|
15
|
-
export const CHROME_UI_ENABLED = CHROME_LAUNCHED;
|
|
16
5
|
/**
|
|
17
6
|
* Whether this platform offers Kortix in Chrome at all. The API answers 404
|
|
18
7
|
* on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (a self-hosted server), so the
|
|
19
8
|
* account-level surfaces — Settings → Kortix in Chrome and its command-palette
|
|
20
9
|
* entry — show only once the browser list answers. Project surfaces read the
|
|
21
|
-
* project's `chrome` flag
|
|
10
|
+
* project's `chrome` flag instead.
|
|
11
|
+
*
|
|
12
|
+
* `true` once the browser list answers, `false` when it fails, `undefined`
|
|
13
|
+
* while it loads: a page opened at `/settings/chrome` waits for the answer
|
|
14
|
+
* instead of falling back to another tab.
|
|
22
15
|
*
|
|
23
16
|
* `enabled`: ask only while the surface that needs the answer is open.
|
|
24
17
|
*/
|
|
25
18
|
export function useChromeOffered(enabled = true) {
|
|
26
|
-
|
|
19
|
+
const query = useQuery({
|
|
27
20
|
queryKey: chromeKeys.list(),
|
|
28
21
|
queryFn: listChromeConnections,
|
|
29
|
-
enabled
|
|
22
|
+
enabled,
|
|
30
23
|
staleTime: 60_000,
|
|
31
24
|
retry: false,
|
|
32
|
-
})
|
|
25
|
+
});
|
|
26
|
+
if (query.isSuccess)
|
|
27
|
+
return true;
|
|
28
|
+
if (query.isError)
|
|
29
|
+
return false;
|
|
30
|
+
return undefined;
|
|
33
31
|
}
|
|
@@ -21,8 +21,9 @@ import { SidebarToggle } from './sidebar-toggle.js';
|
|
|
21
21
|
export const PROJECT_PAGE_HEADER_CLASS = 'kx-titlebar-row kx-capability-titlebar border-border relative flex h-12 shrink-0 items-center gap-2 border-b px-3';
|
|
22
22
|
export function ProjectPageHeader({ title, titleAccessory, breadcrumb, children, }) {
|
|
23
23
|
const sidebar = useOptionalSidebar();
|
|
24
|
-
// Inside Workspace settings (Repository) the
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
// Inside Workspace settings (Repository) this row is the page header: its
|
|
25
|
+
// h1 reads the settings rail word, so no second heading sits above it, and
|
|
26
|
+
// the settings title bar owns the one sidebar opener.
|
|
27
|
+
const settingsTitle = useSettingsPageTitle();
|
|
28
|
+
return (_jsxs("div", { className: PROJECT_PAGE_HEADER_CLASS, "data-sidebar-collapsed": sidebar?.state === 'collapsed' || undefined, children: [settingsTitle === null ? _jsx(SidebarToggle, {}) : null, _jsxs("div", { className: "kx-titlebar-tabs flex h-full min-w-0 flex-1 items-center gap-1.5", children: [breadcrumb, _jsx("h1", { className: "text-foreground truncate text-sm font-medium", children: settingsTitle ?? title }), titleAccessory] }), children ? _jsx("div", { className: "flex shrink-0 items-center gap-2", children: children }) : null] }));
|
|
28
29
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
2
|
import { type DarkThemeId, type LightThemeId } from '../lib/interface-theme-defaults.js';
|
|
3
|
+
import type { CustomWallpaperConfig, GradientWallpaperId, PresetOverride, PresetOverrides } from '../../theme/wallpaper-gradients.js';
|
|
3
4
|
/** Which modifier key is used for tab switching (Cmd+1..9 or Ctrl+1..9) */
|
|
4
5
|
export type TabSwitchModifier = 'meta' | 'ctrl';
|
|
5
6
|
/** Session panel presentation: 'easy' = plain-language cards, 'advanced' = the tool stepper */
|
|
@@ -30,6 +31,18 @@ export interface UserPreferences {
|
|
|
30
31
|
darkTheme: DarkThemeId;
|
|
31
32
|
/** Selected desktop wallpaper ID */
|
|
32
33
|
wallpaperId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The user's own gradient, drawn when `wallpaperId` is 'custom'. Legacy
|
|
36
|
+
* persisted preferences predate this key: read sites go through
|
|
37
|
+
* `normalizeCustomWallpaper`.
|
|
38
|
+
*/
|
|
39
|
+
customWallpaper?: CustomWallpaperConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Colours and finish picked for a gradient preset, by preset id. Legacy
|
|
42
|
+
* persisted preferences predate this key: read sites go through
|
|
43
|
+
* `normalizePresetOverrides`.
|
|
44
|
+
*/
|
|
45
|
+
wallpaperOverrides?: PresetOverrides;
|
|
33
46
|
/** Session action panel mode — defaults to 'easy' for all users */
|
|
34
47
|
panelMode: PanelMode;
|
|
35
48
|
/**
|
|
@@ -61,6 +74,10 @@ interface UserPreferencesState {
|
|
|
61
74
|
setDarkTheme: (theme: DarkThemeId) => void;
|
|
62
75
|
/** Set the active desktop wallpaper by ID */
|
|
63
76
|
setWallpaperId: (wallpaperId: string) => void;
|
|
77
|
+
/** Replace the custom wallpaper's pattern, finish and colors */
|
|
78
|
+
setCustomWallpaper: (customWallpaper: CustomWallpaperConfig) => void;
|
|
79
|
+
/** Change a gradient preset's colours or finish; null restores it as shipped */
|
|
80
|
+
setWallpaperOverride: (id: GradientWallpaperId, override: PresetOverride | null) => void;
|
|
64
81
|
/** Flip between easy and advanced */
|
|
65
82
|
togglePanelMode: () => void;
|
|
66
83
|
/** Set the conversation density */
|
|
@@ -39,6 +39,11 @@ export const useUserPreferencesStore = create()(persist((set, get) => ({
|
|
|
39
39
|
setLightTheme: (lightTheme) => get().patchPreferences({ lightTheme }),
|
|
40
40
|
setDarkTheme: (darkTheme) => get().patchPreferences({ darkTheme }),
|
|
41
41
|
setWallpaperId: (wallpaperId) => get().patchPreferences({ wallpaperId }),
|
|
42
|
+
setCustomWallpaper: (customWallpaper) => get().patchPreferences({ customWallpaper }),
|
|
43
|
+
setWallpaperOverride: (id, override) => {
|
|
44
|
+
const { [id]: _removed, ...rest } = get().preferences.wallpaperOverrides ?? {};
|
|
45
|
+
get().patchPreferences({ wallpaperOverrides: override ? { ...rest, [id]: override } : rest });
|
|
46
|
+
},
|
|
42
47
|
togglePanelMode: () => {
|
|
43
48
|
const current = get().preferences;
|
|
44
49
|
// Legacy users' persisted preferences predate this key entirely, so
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A colour picker panel with the same shape as the project icon picker's
|
|
3
|
+
* colour row (`glyph-picker.tsx`): a row of preset dots, a divider, and a
|
|
4
|
+
* rainbow dot that swaps the row for the custom field. The selected dot
|
|
5
|
+
* carries a ring in its own colour; no glyph is drawn on it (HEX, a
|
|
6
|
+
* saturation/value square, a hue rail). Built for a `PopoverContent`.
|
|
7
|
+
*
|
|
8
|
+
* `value` and every preset are `#rrggbb`. A pick never closes the panel, so
|
|
9
|
+
* the result can be judged live; clicking outside closes it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ColorPickerPanel({ value, presets, onChange, customLabel, presetLabel, }: {
|
|
12
|
+
value: string;
|
|
13
|
+
presets: readonly string[];
|
|
14
|
+
onChange: (color: string) => void;
|
|
15
|
+
/** Accessible name of the rainbow dot. */
|
|
16
|
+
customLabel: string;
|
|
17
|
+
/** Accessible name of a preset dot, given its hex value. */
|
|
18
|
+
presetLabel: (color: string) => string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { COLOR_DOT, COLOR_DOT_RAINBOW, CustomColor } from './glyph-picker.js';
|
|
5
|
+
import { cn } from '../lib/utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* A colour picker panel with the same shape as the project icon picker's
|
|
8
|
+
* colour row (`glyph-picker.tsx`): a row of preset dots, a divider, and a
|
|
9
|
+
* rainbow dot that swaps the row for the custom field. The selected dot
|
|
10
|
+
* carries a ring in its own colour; no glyph is drawn on it (HEX, a
|
|
11
|
+
* saturation/value square, a hue rail). Built for a `PopoverContent`.
|
|
12
|
+
*
|
|
13
|
+
* `value` and every preset are `#rrggbb`. A pick never closes the panel, so
|
|
14
|
+
* the result can be judged live; clicking outside closes it.
|
|
15
|
+
*/
|
|
16
|
+
export function ColorPickerPanel({ value, presets, onChange, customLabel, presetLabel, }) {
|
|
17
|
+
const current = value.toLowerCase();
|
|
18
|
+
const isPreset = presets.some((preset) => preset.toLowerCase() === current);
|
|
19
|
+
const [customOpen, setCustomOpen] = useState(!isPreset);
|
|
20
|
+
if (customOpen) {
|
|
21
|
+
return _jsx(CustomColor, { color: current, onChange: onChange, onClose: () => setCustomOpen(false) });
|
|
22
|
+
}
|
|
23
|
+
return (_jsxs("div", { className: "flex h-12 items-center justify-between gap-2 px-4", children: [presets.map((preset) => {
|
|
24
|
+
const selected = preset.toLowerCase() === current;
|
|
25
|
+
return (_jsx("button", { type: "button", "aria-pressed": selected, "aria-label": presetLabel(preset), onClick: () => onChange(preset.toLowerCase()), style: { background: preset, '--glyph': preset }, className: cn(COLOR_DOT, selected && 'ring-offset-popover ring-[1.5px] ring-[color:var(--glyph)] ring-offset-2') }, preset));
|
|
26
|
+
}), _jsx("span", { "aria-hidden": true, className: "bg-border h-5 w-px shrink-0" }), _jsx("button", { type: "button", "aria-pressed": !isPreset, "aria-label": customLabel, onClick: () => setCustomOpen(true), className: cn(COLOR_DOT, COLOR_DOT_RAINBOW, !isPreset && 'ring-foreground ring-offset-popover ring-[1.5px] ring-offset-2') })] }));
|
|
27
|
+
}
|
|
@@ -57,6 +57,10 @@ export const FadedScrollArea = React.forwardRef(function FadedScrollArea({ child
|
|
|
57
57
|
return;
|
|
58
58
|
const ro = new ResizeObserver(updateScrollFades);
|
|
59
59
|
ro.observe(el);
|
|
60
|
+
// Rows that load after mount grow the content, not the box: watch both.
|
|
61
|
+
// Assumes stable direct children (one list element, as the callers use).
|
|
62
|
+
for (const child of el.children)
|
|
63
|
+
ro.observe(child);
|
|
60
64
|
el.addEventListener('scroll', updateScrollFades, { passive: true });
|
|
61
65
|
window.addEventListener('resize', updateScrollFades);
|
|
62
66
|
// Stop wheel/touch events here, so a scroll lock listening on an ancestor
|
|
@@ -2,6 +2,8 @@ export interface GlyphSelection {
|
|
|
2
2
|
name: string;
|
|
3
3
|
color: string;
|
|
4
4
|
}
|
|
5
|
+
export declare const COLOR_DOT: string;
|
|
6
|
+
export declare const COLOR_DOT_RAINBOW = "bg-[conic-gradient(from_180deg,#f25f5c,#f7b32b,#a6d96a,#4fc3f7,#7e57c2,#e05fbf,#f25f5c)]";
|
|
5
7
|
/**
|
|
6
8
|
* A glyph's keyword list always includes its own lowercased name, so an empty
|
|
7
9
|
* query matches everything. `startsWith`, not `includes`: a substring test
|
|
@@ -16,3 +18,12 @@ export declare function GlyphPicker({ color, selected, onColorChange, onGlyphSel
|
|
|
16
18
|
onGlyphSelect: (glyph: GlyphSelection) => void;
|
|
17
19
|
className?: string;
|
|
18
20
|
}): import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* The custom colour field: a HEX input, a saturation/value square and a hue
|
|
23
|
+
* rail. Shared with `color-picker.tsx`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function CustomColor({ color, onChange, onClose, }: {
|
|
26
|
+
color: string;
|
|
27
|
+
onChange: (color: string) => void;
|
|
28
|
+
onClose: () => void;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -38,10 +38,10 @@ const SWATCH = {
|
|
|
38
38
|
purple: 'bg-glyph-solid-purple',
|
|
39
39
|
magenta: 'bg-glyph-solid-magenta',
|
|
40
40
|
};
|
|
41
|
-
const
|
|
41
|
+
export const COLOR_DOT = cn('relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full', 'transition-[scale,box-shadow] duration-fast active:scale-[0.92]', 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover');
|
|
42
42
|
/** Selected dot: a ring one gap away, in the dot's own colour. */
|
|
43
43
|
const DOT_SELECTED = 'ring-[1.5px] ring-offset-2 ring-offset-popover ring-[color:var(--glyph)]';
|
|
44
|
-
const
|
|
44
|
+
export const COLOR_DOT_RAINBOW = 'bg-[conic-gradient(from_180deg,#f25f5c,#f7b32b,#a6d96a,#4fc3f7,#7e57c2,#e05fbf,#f25f5c)]';
|
|
45
45
|
/**
|
|
46
46
|
* A glyph's keyword list always includes its own lowercased name, so an empty
|
|
47
47
|
* query matches everything. `startsWith`, not `includes`: a substring test
|
|
@@ -70,8 +70,8 @@ export function GlyphPicker({ color, selected, onColorChange, onGlyphSelect, cla
|
|
|
70
70
|
.filter((group) => group.names.length > 0);
|
|
71
71
|
return (_jsxs("div", { style: glyphStyle(resolved), className: cn('isolate flex h-[388px] w-full flex-col', className), children: [customOpen ? (_jsx(CustomColor, { color: isCustom ? resolved : presetHex(resolved), onChange: onColorChange, onClose: () => setCustomOpen(false) })) : (_jsxs("div", { className: "border-border flex h-12 shrink-0 items-center justify-between border-b px-4", children: [PROJECT_GLYPH_COLORS.map((preset) => {
|
|
72
72
|
const selected = preset === resolved;
|
|
73
|
-
return (_jsx("button", { type: "button", "data-swatch": preset, "aria-pressed": selected, "aria-label": `Colour: ${preset}`, onClick: () => onColorChange(preset), style: selected ? { '--glyph': `var(--glyph-solid-${preset})` } : undefined, className: cn(
|
|
74
|
-
}), _jsx("span", { "aria-hidden": true, className: "bg-border h-5 w-px" }), _jsx("button", { type: "button", "data-swatch": "custom", "aria-pressed": isCustom, "aria-label": "Custom colour", onClick: () => setCustomOpen(true), className: cn(
|
|
73
|
+
return (_jsx("button", { type: "button", "data-swatch": preset, "aria-pressed": selected, "aria-label": `Colour: ${preset}`, onClick: () => onColorChange(preset), style: selected ? { '--glyph': `var(--glyph-solid-${preset})` } : undefined, className: cn(COLOR_DOT, SWATCH[preset], selected && DOT_SELECTED), children: selected ? _jsx(CheckIcon, { weight: "bold", className: "size-3 text-white" }) : null }, preset));
|
|
74
|
+
}), _jsx("span", { "aria-hidden": true, className: "bg-border h-5 w-px" }), _jsx("button", { type: "button", "data-swatch": "custom", "aria-pressed": isCustom, "aria-label": "Custom colour", onClick: () => setCustomOpen(true), className: cn(COLOR_DOT, COLOR_DOT_RAINBOW, isCustom && 'ring-foreground ring-offset-popover ring-[1.5px] ring-offset-2') })] })), _jsx("div", { className: "border-border flex h-11 shrink-0 items-center border-b px-4", children: _jsx("input", { type: "search", "aria-label": "Search icons", placeholder: "Search icons\u2026", value: search, onChange: (event) => setSearch(event.target.value), className: "text-foreground placeholder:text-muted-foreground h-full w-full bg-transparent text-sm outline-none [&::-webkit-search-cancel-button]:appearance-none" }) }), _jsx("div", { className: "relative flex-1 overflow-y-auto px-3 pb-3 select-none", children: groups.length > 0 ? (groups.map((group) => (_jsxs("section", { "aria-label": group.label, children: [_jsx("h3", { className: "text-muted-foreground px-1 pt-3 pb-1.5 text-xs font-medium", children: group.label }), _jsx("div", { className: "grid grid-cols-10", children: group.names.map((name) => {
|
|
75
75
|
const Glyph = glyphComponent(name);
|
|
76
76
|
if (!Glyph)
|
|
77
77
|
return null;
|
|
@@ -141,7 +141,11 @@ function useDrag(onMove) {
|
|
|
141
141
|
},
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
/**
|
|
145
|
+
* The custom colour field: a HEX input, a saturation/value square and a hue
|
|
146
|
+
* rail. Shared with `color-picker.tsx`.
|
|
147
|
+
*/
|
|
148
|
+
export function CustomColor({ color, onChange, onClose, }) {
|
|
145
149
|
const [hsv, setHsv] = useState(() => hexToHsv(color));
|
|
146
150
|
const [draft, setDraft] = useState(color.slice(1).toUpperCase());
|
|
147
151
|
const hex = hsvToHex(hsv);
|
|
@@ -161,7 +165,7 @@ function CustomColor({ color, onChange, onClose, }) {
|
|
|
161
165
|
setHsv(hexToHsv(value));
|
|
162
166
|
onChange(value);
|
|
163
167
|
}
|
|
164
|
-
}, className: "text-foreground -ml-2 w-20 bg-transparent font-mono text-sm tabular-nums outline-none" })] }), _jsx("button", { type: "button", "aria-label": "Back to preset colours", onClick: onClose, className: cn(
|
|
168
|
+
}, className: "text-foreground -ml-2 w-20 bg-transparent font-mono text-sm tabular-nums outline-none" })] }), _jsx("button", { type: "button", "aria-label": "Back to preset colours", onClick: onClose, className: cn(COLOR_DOT, COLOR_DOT_RAINBOW, 'ring-foreground ring-offset-popover ring-[1.5px] ring-offset-2') })] }), _jsxs("div", { className: "flex gap-3", children: [_jsx("div", { ...square, role: "slider", "aria-label": "Saturation and brightness", "aria-valuenow": Math.round(hsv.s * 100), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuetext": hex, className: "relative h-32 flex-1 cursor-crosshair touch-none rounded-md", style: {
|
|
165
169
|
background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${hsvToHex({ h: hsv.h, s: 1, v: 1 })})`,
|
|
166
170
|
}, children: _jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.25),0_1px_3px_rgb(0_0_0/0.4)]", style: { left: `${hsv.s * 100}%`, top: `${(1 - hsv.v) * 100}%`, background: hex } }) }), _jsx("div", { ...rail, role: "slider", "aria-label": "Hue", "aria-valuenow": Math.round(hsv.h), "aria-valuemin": 0, "aria-valuemax": 360, className: "relative h-32 w-2.5 cursor-ns-resize touch-none rounded-full bg-[linear-gradient(to_bottom,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)]", children: _jsx("span", { "aria-hidden": true, className: "pointer-events-none absolute left-1/2 size-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgb(0_0_0/0.25)]", style: { top: `${(hsv.h / 360) * 100}%`, background: hsvToHex({ h: hsv.h, s: 1, v: 1 }) } }) })] })] }));
|
|
167
171
|
}
|