@kortix/ui 0.15.7 → 0.15.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/_vendor/kortix-shared.js +36 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
- package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
- package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
- package/dist/customize/connectors/catalog/connector-categories.js +2 -2
- package/dist/customize/connectors/detail/connector-modal.js +1 -1
- package/dist/customize/sections/gateway-view.d.ts +1 -1
- package/dist/customize/sections/gateway-view.js +1 -1
- package/dist/customize/sections/view/account-secret-resources-panel.js +4 -2
- package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/sections/view/permission-editor.js +1 -1
- package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
- package/dist/customize/sections/view/subscription-usage.js +2 -86
- package/dist/customize/shared/entity/entity-modal.js +8 -10
- package/dist/files/project/components/drive-toolbar.d.ts +1 -1
- package/dist/files/project/components/drive-toolbar.js +1 -1
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
- package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
- package/dist/files/renderers/shared/select-compat.js +3 -7
- package/dist/files/viewer/file-preview-modal.d.ts +10 -11
- package/dist/files/viewer/file-preview-modal.js +17 -18
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.js +7 -4
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-location.js +2 -2
- package/dist/internal/account-hub/use-account-members.d.ts +28 -1
- package/dist/internal/account-hub/use-account-members.js +27 -10
- package/dist/internal/components/agent-mark.d.ts +1 -8
- package/dist/internal/components/agent-mark.js +2 -19
- package/dist/internal/lib/navigation/modified-click.js +2 -2
- package/dist/internal/lib/pixel-mark.d.ts +3 -20
- package/dist/internal/lib/pixel-mark.js +3 -34
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.js +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +1 -1
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.d.ts +149 -0
- package/dist/lib/base-ui-compat.js +339 -0
- package/dist/lib/portal-container.d.ts +3 -7
- package/dist/lib/portal-container.js +5 -3
- package/dist/lib/z-stack.d.ts +4 -4
- package/dist/lib/z-stack.js +5 -5
- package/dist/primitives/accordion.d.ts +36 -5
- package/dist/primitives/accordion.js +41 -8
- package/dist/primitives/alert-dialog.d.ts +33 -11
- package/dist/primitives/alert-dialog.js +41 -19
- package/dist/primitives/avatar.d.ts +5 -2
- package/dist/primitives/avatar.js +3 -3
- package/dist/primitives/badge.js +1 -1
- package/dist/primitives/breadcrumb.js +1 -1
- package/dist/primitives/button-group.js +3 -3
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox.d.ts +14 -5
- package/dist/primitives/checkbox.js +24 -9
- package/dist/primitives/collapsible.d.ts +16 -4
- package/dist/primitives/collapsible.js +18 -7
- package/dist/primitives/command-core.d.ts +121 -0
- package/dist/primitives/command-core.js +642 -0
- package/dist/primitives/command.d.ts +38 -4
- package/dist/primitives/command.js +22 -13
- package/dist/primitives/context-menu.d.ts +61 -31
- package/dist/primitives/context-menu.js +40 -53
- package/dist/primitives/dialog.d.ts +48 -10
- package/dist/primitives/dialog.js +48 -19
- package/dist/primitives/disclosure.d.ts +1 -1
- package/dist/primitives/disclosure.js +2 -2
- package/dist/primitives/drawer.d.ts +28 -9
- package/dist/primitives/drawer.js +42 -18
- package/dist/primitives/dropdown-menu.d.ts +55 -33
- package/dist/primitives/dropdown-menu.js +46 -82
- package/dist/primitives/faded-scroll-area.js +2 -1
- package/dist/primitives/hint.js +3 -3
- package/dist/primitives/hover-card.d.ts +17 -5
- package/dist/primitives/hover-card.js +45 -8
- package/dist/primitives/item.js +2 -2
- package/dist/primitives/label.d.ts +5 -2
- package/dist/primitives/label.js +10 -3
- package/dist/primitives/menu-base.d.ts +150 -0
- package/dist/primitives/menu-base.js +171 -0
- package/dist/primitives/menu-recipe.d.ts +1 -1
- package/dist/primitives/menu-recipe.js +2 -7
- package/dist/primitives/modal.d.ts +19 -52
- package/dist/primitives/modal.js +24 -28
- package/dist/primitives/navigation-menu.d.ts +36 -11
- package/dist/primitives/navigation-menu.js +31 -12
- package/dist/primitives/popover.d.ts +31 -6
- package/dist/primitives/popover.js +79 -12
- package/dist/primitives/preview-image.d.ts +18 -7
- package/dist/primitives/preview-image.js +14 -11
- package/dist/primitives/progress.d.ts +4 -2
- package/dist/primitives/progress.js +4 -3
- package/dist/primitives/project-icon-picker.js +2 -2
- package/dist/primitives/radio-group.d.ts +28 -5
- package/dist/primitives/radio-group.js +18 -10
- package/dist/primitives/scroll-area.d.ts +2 -2
- package/dist/primitives/scroll-area.js +8 -3
- package/dist/primitives/select.d.ts +55 -12
- package/dist/primitives/select.js +93 -36
- package/dist/primitives/separator.d.ts +6 -2
- package/dist/primitives/separator.js +10 -2
- package/dist/primitives/sheet.d.ts +17 -10
- package/dist/primitives/sheet.js +19 -22
- package/dist/primitives/sidebar-menu-primitives.js +8 -8
- package/dist/primitives/slider-native.d.ts +2 -2
- package/dist/primitives/slider-native.js +11 -9
- package/dist/primitives/slider.d.ts +24 -6
- package/dist/primitives/slider.js +26 -24
- package/dist/primitives/slot.d.ts +6 -0
- package/dist/primitives/slot.js +7 -0
- package/dist/primitives/split-sheet.js +1 -1
- package/dist/primitives/stepper.js +1 -1
- package/dist/primitives/switch.d.ts +16 -3
- package/dist/primitives/switch.js +7 -6
- package/dist/primitives/tabs.d.ts +36 -20
- package/dist/primitives/tabs.js +131 -102
- package/dist/primitives/toggle.d.ts +16 -3
- package/dist/primitives/toggle.js +8 -3
- package/dist/primitives/tooltip.d.ts +24 -5
- package/dist/primitives/tooltip.js +32 -10
- package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
- package/dist/primitives/type-to-confirm-dialog.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +3 -3
- package/dist/session/composer/editor/composer-editor.js +1 -1
- package/dist/session/composer/menus/menu-shell.d.ts +1 -1
- package/dist/session/composer/menus/menu-shell.js +1 -1
- package/dist/session/composer/menus/mount.js +1 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/header/subagent-hover-card.js +2 -2
- package/dist/session/media/image-preview.js +1 -1
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +18 -12
- package/dist/session/models/subscription-switcher.d.ts +37 -0
- package/dist/session/models/subscription-switcher.js +97 -0
- package/dist/session/models/subscription-windows.d.ts +40 -0
- package/dist/session/models/subscription-windows.js +86 -0
- package/dist/session/overrides/session-overrides-control.js +3 -3
- package/dist/session/panel/diff-dialog.js +1 -1
- package/dist/session/panel/easy/detail-view.js +3 -3
- package/dist/session/panel/mobile-tool-drawer.js +2 -2
- package/dist/session/panel/panel-fallback.js +1 -1
- package/dist/session/panel/session-files-explorer.d.ts +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/thread/session-chat.js +2 -2
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/turn-share.js +3 -4
- package/dist/session/tool/shared/show-helpers.js +1 -1
- package/dist/session/turn/message-time-label.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +3 -0
- package/dist/workspace/projects/modal/project-icon-field.js +9 -23
- package/dist/workspace/review/review-center.js +1 -1
- package/dist/workspace/sessions/session-row.js +1 -1
- package/dist/workspace/sidebar/project-session-list.js +2 -2
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
- package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
- package/dist/workspace/sidebar/session-title.d.ts +2 -2
- package/dist/workspace/sidebar/session-title.js +2 -2
- package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
- package/dist/workspace/spaces/space-links.js +1 -1
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/package.json +16 -35
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +1 -1
package/README.md
CHANGED
|
@@ -310,9 +310,9 @@ How it stays themable:
|
|
|
310
310
|
with their variable (`--text-sm`, `--shadow-md`, `--ease-default`, bare
|
|
311
311
|
`rounded`) live in `@theme inline reference`, so Tailwind never emits the
|
|
312
312
|
`--x: var(--x)` cycle into `:root`.
|
|
313
|
-
- Every
|
|
313
|
+
- Every overlay portal goes through `withPortalContainer`
|
|
314
314
|
(`src/lib/portal-container.tsx`). Without a `ThemeScope` it portals to
|
|
315
|
-
`document.body
|
|
315
|
+
`document.body`.
|
|
316
316
|
- A new component reads tokens only: no hex, no palette class, no fixed
|
|
317
317
|
radius. `apps/web` must look identical: every new variable defaults to the
|
|
318
318
|
value it replaces.
|
|
@@ -320,11 +320,11 @@ How it stays themable:
|
|
|
320
320
|
## Known issues
|
|
321
321
|
|
|
322
322
|
- Server rendering: the entries that render sessions or files (`session`, `composer`, `session-panel`, `workspace`, `files`, `file-viewer`, `markdown`, `genui`, `customize`) import CSS (KaTeX and others) from JS, so plain Node cannot evaluate them (`ERR_UNKNOWN_FILE_EXTENSION ".css"`). A Vite SSR host adds `ssr: { noExternal: ['@kortix/ui'] }`. A Next.js host lists `@kortix/ui` in `transpilePackages`. Or load those blocks on the client only (`lazyClient`). The root, `theme`, `i18n`, `icons`, `diff`, `changes`, `terminal`, `browser`, `apps` and `access` entries evaluate in Node.
|
|
323
|
-
- `
|
|
324
|
-
|
|
325
|
-
`cmdk`
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
- `Command` does not depend on the `cmdk` package. `src/primitives/command-core.tsx`
|
|
324
|
+
is a vendored MIT port of `cmdk` 0.2.1 without its Radix dialog. It keeps cmdk's
|
|
325
|
+
selection model, filter scoring and `[cmdk-*]` attributes, which `command.tsx`
|
|
326
|
+
and the ⌘K palette are tuned to. `useCommandState` is exported from
|
|
327
|
+
`@kortix/ui/command`.
|
|
328
328
|
|
|
329
329
|
## Rules
|
|
330
330
|
|
|
@@ -629,6 +629,12 @@ function peerHandleLabel(handle) {
|
|
|
629
629
|
function isMyKortixAgentName(name) {
|
|
630
630
|
return name === MY_KORTIX_AGENT_NAME || name === LEGACY_MY_KORTIX_AGENT_NAME;
|
|
631
631
|
}
|
|
632
|
+
function agentDisplayName(slug) {
|
|
633
|
+
if (isMyKortixAgentName(slug)) return MY_KORTIX_DISPLAY_NAME;
|
|
634
|
+
if (typeof slug !== "string") return String(slug);
|
|
635
|
+
const words = slug.replace(/[-_]+/g, " ").trim();
|
|
636
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
637
|
+
}
|
|
632
638
|
|
|
633
639
|
// ../manifest-schema/src/slug.ts
|
|
634
640
|
var SLUG_MAX_LENGTH = 128;
|
|
@@ -4256,6 +4262,35 @@ function pixelMarkShape(slug) {
|
|
|
4256
4262
|
height: PIXEL_MARK_SIZE
|
|
4257
4263
|
};
|
|
4258
4264
|
}
|
|
4265
|
+
var tone = (name, tile, ink) => ({
|
|
4266
|
+
name,
|
|
4267
|
+
tile,
|
|
4268
|
+
ink,
|
|
4269
|
+
tileDark: ink,
|
|
4270
|
+
inkDark: tile
|
|
4271
|
+
});
|
|
4272
|
+
var PIXEL_MARK_TONES = [
|
|
4273
|
+
tone("graphite", "#EDEDED", "#191919"),
|
|
4274
|
+
tone("sand", "#F1EBDD", "#6B5A3A"),
|
|
4275
|
+
tone("moss", "#E6EDE0", "#3F5A33"),
|
|
4276
|
+
tone("sea", "#E2ECF0", "#2E5566"),
|
|
4277
|
+
tone("blue", "#E6EEFF", "#2457C5"),
|
|
4278
|
+
tone("plum", "#EEE6F0", "#5E3A68"),
|
|
4279
|
+
tone("clay", "#F3E6E0", "#7A4532"),
|
|
4280
|
+
tone("slate", "#E4E7EC", "#3B4656")
|
|
4281
|
+
];
|
|
4282
|
+
var BRAND = {
|
|
4283
|
+
name: "brand",
|
|
4284
|
+
tile: "#1F1F1F",
|
|
4285
|
+
ink: "#FFFFFF",
|
|
4286
|
+
tileDark: "#2C2C2C",
|
|
4287
|
+
inkDark: "#FFFFFF"
|
|
4288
|
+
};
|
|
4289
|
+
var RESERVED_TONES = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
|
|
4290
|
+
function pixelMark(slug) {
|
|
4291
|
+
const tone2 = RESERVED_TONES[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
|
|
4292
|
+
return { ...pixelMarkShape(slug), tone: tone2 };
|
|
4293
|
+
}
|
|
4259
4294
|
|
|
4260
4295
|
// ../shared/src/preview-state-page.ts
|
|
4261
4296
|
var PREVIEW_BUILDING_STATES = /* @__PURE__ */ new Set([
|
|
@@ -5767,4 +5802,4 @@ function parseWorkspaceSettingsSection(raw) {
|
|
|
5767
5802
|
return Object.prototype.hasOwnProperty.call(WORKSPACE_SETTINGS_SECTION_ALIASES, value) ? WORKSPACE_SETTINGS_SECTION_ALIASES[value] : null;
|
|
5768
5803
|
}
|
|
5769
5804
|
|
|
5770
|
-
export { 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, 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_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText,
|
|
5805
|
+
export { 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, 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_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, 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, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, agentDisplayName, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isProjectGlyphColor, isProjectGlyphName, isProjectGlyphPaletteColor, languageLabel, looksLikeMarkdown, masonryColumns, neutralizePastedTags, newConfigPrompt, newPastedContentId, normalizeLanguage, normalizeLatexDelimiters, normalizeProjectGlyphColor, openMarkdownLinkAtEnd, parseBackgroundWorkers, parseBalanceUsd, parseChannelMessage, 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, shouldTilePaste, skillDocumentBody, slackPlainText, slugifySlug, spaceDriveFolders, spaceSlug, splitPastedContent, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
|
|
@@ -38,3 +38,10 @@ export type BuiltinAgentKey = keyof typeof BUILTIN_AGENTS;
|
|
|
38
38
|
export declare const BUILTIN_AGENT_KEYS: BuiltinAgentKey[];
|
|
39
39
|
/** The `builtin_agents` key of a built-in agent slug (legacy `meta` included), or `null` for a declared agent. */
|
|
40
40
|
export declare function builtinAgentKeyOf(agentName: string | null | undefined): BuiltinAgentKey | null;
|
|
41
|
+
/**
|
|
42
|
+
* An agent's name as a person reads it: My Kortix for the built-in agent,
|
|
43
|
+
* otherwise the manifest key in sentence case with its separators as spaces
|
|
44
|
+
* (`session-reviewer` → "Session reviewer"). One helper, so the web app, the
|
|
45
|
+
* sidebar and channel posts (Slack) name an agent the same way.
|
|
46
|
+
*/
|
|
47
|
+
export declare function agentDisplayName(slug: string): string;
|
|
@@ -36,4 +36,22 @@ export declare function pixelMarkShape(slug: string): {
|
|
|
36
36
|
width: number;
|
|
37
37
|
height: number;
|
|
38
38
|
};
|
|
39
|
+
export interface PixelMarkTone {
|
|
40
|
+
name: string;
|
|
41
|
+
tile: string;
|
|
42
|
+
ink: string;
|
|
43
|
+
/** Dark theme: the pair inverts, so the tile stays visible on a dark page. */
|
|
44
|
+
tileDark: string;
|
|
45
|
+
inkDark: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
|
|
48
|
+
/** The agent's mark: its shape and its tile tone. */
|
|
49
|
+
export declare function pixelMark(slug: string): {
|
|
50
|
+
tone: PixelMarkTone;
|
|
51
|
+
grid: boolean[][];
|
|
52
|
+
path: string;
|
|
53
|
+
ditherPath: string;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
};
|
|
39
57
|
export {};
|
|
@@ -10,8 +10,8 @@ export type { CatalogSectionDef } from '../../../_vendor/shared/connector-sectio
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const CATEGORY_ROW_CAP = 6;
|
|
12
12
|
/**
|
|
13
|
-
* The category `Select`'s "no category" value.
|
|
14
|
-
*
|
|
13
|
+
* The category `Select`'s "no category" value. `Select` reads an empty string
|
|
14
|
+
* as "no value", so this needs a sentinel no real category can collide with.
|
|
15
15
|
* `groupIntoSections` trims every key and every curated key is
|
|
16
16
|
* lowercase-kebab, so a leading space is unreachable by construction — this is
|
|
17
17
|
* provably distinct rather than merely unlikely.
|
|
@@ -13,8 +13,8 @@ export { OTHER, POPULAR_SECTION, CURATED_SECTIONS, sectionKeyForCategory, sectio
|
|
|
13
13
|
*/
|
|
14
14
|
export const CATEGORY_ROW_CAP = 6;
|
|
15
15
|
/**
|
|
16
|
-
* The category `Select`'s "no category" value.
|
|
17
|
-
*
|
|
16
|
+
* The category `Select`'s "no category" value. `Select` reads an empty string
|
|
17
|
+
* as "no value", so this needs a sentinel no real category can collide with.
|
|
18
18
|
* `groupIntoSections` trims every key and every curated key is
|
|
19
19
|
* lowercase-kebab, so a leading space is unreachable by construction — this is
|
|
20
20
|
* provably distinct rather than merely unlikely.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
-
import { VisuallyHidden } from '
|
|
4
|
+
import { VisuallyHidden } from '../../../lib/base-ui-compat.js';
|
|
5
5
|
import { Button } from '../../../primitives/button.js';
|
|
6
6
|
import { Modal, ModalClose, ModalContent, ModalTitle } from '../../../primitives/modal.js';
|
|
7
7
|
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
@@ -135,7 +135,7 @@ export declare function ProjectDefaultPicker({ projectId }: {
|
|
|
135
135
|
* character.
|
|
136
136
|
*
|
|
137
137
|
* One section at a time, by the caller's state — NOT seven `TabsContent`
|
|
138
|
-
* panels.
|
|
138
|
+
* panels. `Tabs` keeps every panel element in the tree and each one used to open its
|
|
139
139
|
* own `overflow-y-auto`, which is how this page ended up with three nested
|
|
140
140
|
* scroll containers under a shell that already had one.
|
|
141
141
|
*
|
|
@@ -193,7 +193,7 @@ export function ProjectDefaultPicker({ projectId }) {
|
|
|
193
193
|
* character.
|
|
194
194
|
*
|
|
195
195
|
* One section at a time, by the caller's state — NOT seven `TabsContent`
|
|
196
|
-
* panels.
|
|
196
|
+
* panels. `Tabs` keeps every panel element in the tree and each one used to open its
|
|
197
197
|
* own `overflow-y-auto`, which is how this page ended up with three nested
|
|
198
198
|
* scroll containers under a shell that already had one.
|
|
199
199
|
*
|
|
@@ -233,7 +233,9 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
|
|
|
233
233
|
if (reconnecting && reconnecting.label !== reconnectLabel)
|
|
234
234
|
setReconnectLabel(reconnecting.label);
|
|
235
235
|
const [sharing, setSharing] = useState(null);
|
|
236
|
-
//
|
|
236
|
+
// A new connection is shared with everyone in the workspace. A viewer who may
|
|
237
|
+
// not share gets "Only you", the one choice the API accepts from them.
|
|
238
|
+
// `openCreate` sets it from the probe's answer when the dialog opens.
|
|
237
239
|
const [createMode, setCreateMode] = useState('private');
|
|
238
240
|
const [sharingMode, setSharingMode] = useState('project');
|
|
239
241
|
const [selectedMembers, setSelectedMembers] = useState(NO_MEMBERS);
|
|
@@ -351,7 +353,7 @@ export function AccountSecretResourcesPanel({ accountId, projectId, providerId,
|
|
|
351
353
|
},
|
|
352
354
|
});
|
|
353
355
|
const openCreate = () => {
|
|
354
|
-
setCreateMode('private');
|
|
356
|
+
setCreateMode(canShare ? 'project' : 'private');
|
|
355
357
|
setSelectedMembers(NO_MEMBERS);
|
|
356
358
|
setLabel(defaultLabel());
|
|
357
359
|
save.reset();
|
|
@@ -30,7 +30,7 @@ import { modelRefToKey } from '@kortix/sdk';
|
|
|
30
30
|
import { flattenModels, modelKeyToWire, modelProviderMode, useRuntimeProviders, } from '@kortix/sdk/react';
|
|
31
31
|
import { AGENT_MODE_HELP, AGENT_MODE_LABEL, AGENT_MODES } from './agent-editor-catalog.js';
|
|
32
32
|
import { EditorSection, InlineAction, SettingBlock, SettingRow } from './agent-editor-primitives.js';
|
|
33
|
-
/** Matches the access section's inherit sentinel —
|
|
33
|
+
/** Matches the access section's inherit sentinel — `Select` reads `""` as no value. */
|
|
34
34
|
const INHERIT = '__inherit__';
|
|
35
35
|
export function BasicsSection({ draft, set, oc, setOc, showDescription = true, }) {
|
|
36
36
|
const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
|
|
@@ -9,7 +9,7 @@ import type { GatewayLogFilters, GatewayLogRow } from '@kortix/sdk';
|
|
|
9
9
|
* roving tabindex, and controls no panel. Assistive tech saw three unselected
|
|
10
10
|
* tabs; keyboard users got no arrow-key movement. It is also not the house
|
|
11
11
|
* filter control. Replaced with the sanctioned `Tabs`/`TabsList` pair
|
|
12
|
-
* (
|
|
12
|
+
* (real `aria-selected`, real roving tabindex), same as the analytics
|
|
13
13
|
* range picker.
|
|
14
14
|
* 2. The header read `Live · {logs.length}`, which looked like a total but was
|
|
15
15
|
* the page size. `All` and `Success` both showed `100` (the server caps a
|
|
@@ -181,7 +181,7 @@ function SaveStatus() {
|
|
|
181
181
|
* The default-branch picker: a searchable list, not a `<Select>`.
|
|
182
182
|
*
|
|
183
183
|
* A long-lived project's remote holds one branch per session, thousands of
|
|
184
|
-
* refs. A
|
|
184
|
+
* refs. A `<Select>` mounts every option, so opening this pane on such
|
|
185
185
|
* a project froze the tab and then crashed it. This list renders at most
|
|
186
186
|
* `BRANCH_PICKER_LIMIT` rows (`filterBranchNames`) and filters as the person
|
|
187
187
|
* types. The current value always renders, also before `/branches` answers.
|
|
@@ -14,7 +14,7 @@ import { PERMISSION_ACTION_LABEL, PERMISSION_ACTION_ONLY_GROUP_LABEL, PERMISSION
|
|
|
14
14
|
import { SettingsRow, SettingsRowGroup } from '../../../primitives/settings-row.js';
|
|
15
15
|
import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
|
|
16
16
|
import { EditorSection } from './agent-editor-primitives.js';
|
|
17
|
-
/**
|
|
17
|
+
/** `Select` reads `""` as no value, so the inherit state carries a sentinel. */
|
|
18
18
|
const INHERIT = '__inherit__';
|
|
19
19
|
/**
|
|
20
20
|
* The one allow/ask/deny picker, bound to `PermissionAction`.
|
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import type { AccountSecretResource,
|
|
2
|
-
import {
|
|
1
|
+
import type { AccountSecretResource, SubscriptionConnection, SubscriptionUsage, SubscriptionUsageWindow } from '@kortix/sdk';
|
|
2
|
+
import { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, type UsageTone } from '../../../session/models/subscription-windows.js';
|
|
3
|
+
export { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, type UsageTone };
|
|
3
4
|
/** The provider-list row that carries each subscription login's usage. */
|
|
4
5
|
export declare const SUBSCRIPTION_ROW: Readonly<Record<string, string>>;
|
|
5
|
-
export type UsageTone = 'ok' | 'near' | 'critical' | 'limited';
|
|
6
|
-
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
7
|
-
export declare function usageTone(window: SubscriptionUsageWindow, limited: boolean): UsageTone;
|
|
8
|
-
/**
|
|
9
|
-
* Windows that never stop the login's model calls: code review, paid extra
|
|
10
|
-
* usage, and one model's own limit (ChatGPT `model_*`, Claude `seven_day_opus`,
|
|
11
|
-
* `7d_sonnet`). Claude's OAuth-apps window stays blocking. The server's twin
|
|
12
|
-
* is `isBlockingWindow` in packages/llm-gateway/src/usage/subscription-usage.ts.
|
|
13
|
-
*/
|
|
14
|
-
export declare function isBlockingWindow(id: string): boolean;
|
|
15
|
-
/** The model name of a model-specific weekly window (`seven_day_opus` → `Opus`), or null. */
|
|
16
|
-
export declare function weeklyModel(id: string): string | null;
|
|
17
|
-
/** A model limit's id fragment read back as its name: `gpt_5_3_codex_spark` → `GPT-5.3 Codex Spark`. */
|
|
18
|
-
export declare function modelName(slug: string): string;
|
|
19
|
-
type Translate = ReturnType<typeof useTranslations>;
|
|
20
|
-
/** A window's name: `5-hour`, `Weekly`, `Weekly · Opus`, `Code review · Weekly`, `Extra usage`. */
|
|
21
|
-
export declare function windowLabel(id: string, t: Translate, options?: {
|
|
22
|
-
modelWeekly?: boolean;
|
|
23
|
-
}): string;
|
|
24
6
|
/**
|
|
25
7
|
* A reset time a person reads at a glance: the clock time today, the weekday
|
|
26
8
|
* and time within a week, else the date.
|
|
@@ -28,11 +10,6 @@ export declare function windowLabel(id: string, t: Translate, options?: {
|
|
|
28
10
|
export declare function formatReset(iso: string, now: number, locale: string): string;
|
|
29
11
|
/** The usage to show: the live read when it answered, else the snapshot the list carried. */
|
|
30
12
|
export declare function shownUsage(live: SubscriptionUsage | null | undefined, listed: SubscriptionUsage | null | undefined): SubscriptionUsage | null;
|
|
31
|
-
/**
|
|
32
|
-
* `person@example.test · Pro`: who the login signs in as. The email is left out
|
|
33
|
-
* when the label already shows it; null when the provider says nothing.
|
|
34
|
-
*/
|
|
35
|
-
export declare function accountLine(account: SubscriptionAccount | null | undefined, label: string): string | null;
|
|
36
13
|
/** The login's email and plan, under its name: the live read when it answered, else the list's. */
|
|
37
14
|
export declare function SubscriptionAccountLine({ accountId, projectId, secret }: {
|
|
38
15
|
accountId: string;
|
|
@@ -42,11 +19,6 @@ export declare function SubscriptionAccountLine({ accountId, projectId, secret }
|
|
|
42
19
|
export declare function isSubscriptionLogin(secret: Pick<AccountSecretResource, 'provider_id'>): boolean;
|
|
43
20
|
/** A login the gateway can route to: active, readable, signed in. */
|
|
44
21
|
export declare function usable(secret: Pick<SubscriptionConnection, 'active' | 'needs_reauth_at' | 'status'>): boolean;
|
|
45
|
-
/** A login that cannot take a model call now, and when that ends (null: unknown). */
|
|
46
|
-
export declare function loginLimit(usage: SubscriptionUsage | null, now: number): {
|
|
47
|
-
limited: boolean;
|
|
48
|
-
until: string | null;
|
|
49
|
-
};
|
|
50
22
|
export interface SubscriptionSummary {
|
|
51
23
|
total: number;
|
|
52
24
|
/** Logins that can take a model call now, by their reported usage. */
|
|
@@ -312,4 +284,3 @@ export declare function LegacyChatGptUsage({ accountId, projectId }: {
|
|
|
312
284
|
accountId: string;
|
|
313
285
|
projectId: string;
|
|
314
286
|
}): import("react").JSX.Element | null;
|
|
315
|
-
export {};
|
|
@@ -6,70 +6,15 @@ import { useLocale, useTranslations } from '../../../i18n/index.js';
|
|
|
6
6
|
import { cn } from '../../../lib/utils.js';
|
|
7
7
|
import { Badge } from '../../../primitives/badge.js';
|
|
8
8
|
import { Progress } from '../../../primitives/progress.js';
|
|
9
|
+
import { accountLine, currentWindows as current, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel, } from '../../../session/models/subscription-windows.js';
|
|
10
|
+
export { accountLine, isBlockingWindow, loginLimit, modelName, usageTone, weeklyModel, windowLabel };
|
|
9
11
|
/** Providers whose stored value is a subscription login with plan windows. */
|
|
10
12
|
const SUBSCRIPTION_PROVIDERS = new Set(['codex', 'claude-agent']);
|
|
11
13
|
/** The provider-list row that carries each subscription login's usage. */
|
|
12
14
|
export const SUBSCRIPTION_ROW = { codex: 'openai', 'claude-agent': 'anthropic' };
|
|
13
15
|
/** A snapshot older than this says when it was observed. */
|
|
14
16
|
const STALE_MS = 10 * 60 * 1000;
|
|
15
|
-
/** Warn at 80%, turn red at 95%, and distinguish a provider-enforced limit. */
|
|
16
|
-
export function usageTone(window, limited) {
|
|
17
|
-
if (window.used_percent >= 100 || (limited && window.used_percent >= 90))
|
|
18
|
-
return 'limited';
|
|
19
|
-
if (window.used_percent >= 95)
|
|
20
|
-
return 'critical';
|
|
21
|
-
return window.used_percent >= 80 ? 'near' : 'ok';
|
|
22
|
-
}
|
|
23
17
|
const TONE_BAR = { ok: 'bg-primary', near: 'bg-kortix-orange', critical: 'bg-kortix-red', limited: 'bg-kortix-red' };
|
|
24
|
-
/**
|
|
25
|
-
* Windows that never stop the login's model calls: code review, paid extra
|
|
26
|
-
* usage, and one model's own limit (ChatGPT `model_*`, Claude `seven_day_opus`,
|
|
27
|
-
* `7d_sonnet`). Claude's OAuth-apps window stays blocking. The server's twin
|
|
28
|
-
* is `isBlockingWindow` in packages/llm-gateway/src/usage/subscription-usage.ts.
|
|
29
|
-
*/
|
|
30
|
-
export function isBlockingWindow(id) {
|
|
31
|
-
return !/^(?:code_review|extra_usage|model_|seven_day_(?!oauth_apps$)|7d_(?!oauth_apps$))/.test(id);
|
|
32
|
-
}
|
|
33
|
-
/** The model name of a model-specific weekly window (`seven_day_opus` → `Opus`), or null. */
|
|
34
|
-
export function weeklyModel(id) {
|
|
35
|
-
const model = /^(?:seven_day|7d)_([a-z]+)$/.exec(id)?.[1];
|
|
36
|
-
return model ? model[0].toUpperCase() + model.slice(1) : null;
|
|
37
|
-
}
|
|
38
|
-
const title = (value) => value.replaceAll('_', ' ').replace(/^./, (first) => first.toUpperCase());
|
|
39
|
-
/** A model limit's id fragment read back as its name: `gpt_5_3_codex_spark` → `GPT-5.3 Codex Spark`. */
|
|
40
|
-
export function modelName(slug) {
|
|
41
|
-
const words = [];
|
|
42
|
-
for (const token of slug.split('_').filter(Boolean)) {
|
|
43
|
-
const last = words.at(-1);
|
|
44
|
-
if (/^\d+$/.test(token) && last && /\d$/.test(last))
|
|
45
|
-
words[words.length - 1] = `${last}.${token}`;
|
|
46
|
-
else
|
|
47
|
-
words.push(token === 'gpt' ? 'GPT' : /^\d/.test(token) ? token : token[0].toUpperCase() + token.slice(1));
|
|
48
|
-
}
|
|
49
|
-
return words.join(' ').replace(/^GPT (\d)/, 'GPT-$1');
|
|
50
|
-
}
|
|
51
|
-
/** A window's name: `5-hour`, `Weekly`, `Weekly · Opus`, `Code review · Weekly`, `Extra usage`. */
|
|
52
|
-
export function windowLabel(id, t, options = {}) {
|
|
53
|
-
if (id === 'five_hour')
|
|
54
|
-
return t('fiveHour');
|
|
55
|
-
// Beside `Weekly · Opus`, the plain weekly window is the one every model shares.
|
|
56
|
-
if (id === 'weekly')
|
|
57
|
-
return options.modelWeekly ? t('weeklyAll') : t('weekly');
|
|
58
|
-
if (id === 'extra_usage')
|
|
59
|
-
return t('extraUsage');
|
|
60
|
-
if (id === 'seven_day_oauth_apps' || id === '7d_oauth_apps')
|
|
61
|
-
return t('weeklyModel', { model: t('apps') });
|
|
62
|
-
const model = weeklyModel(id);
|
|
63
|
-
if (model)
|
|
64
|
-
return t('weeklyModel', { model });
|
|
65
|
-
const scoped = /^(code_review|model_[a-z0-9_]+?)_(five_hour|weekly|primary|secondary)$/.exec(id);
|
|
66
|
-
if (scoped) {
|
|
67
|
-
const scope = scoped[1] === 'code_review' ? t('codeReview') : modelName(scoped[1].slice('model_'.length));
|
|
68
|
-
const span = scoped[2] === 'five_hour' ? t('fiveHour') : scoped[2] === 'weekly' ? t('weekly') : null;
|
|
69
|
-
return span ? `${scope} · ${span}` : scope;
|
|
70
|
-
}
|
|
71
|
-
return title(id);
|
|
72
|
-
}
|
|
73
18
|
/**
|
|
74
19
|
* A reset time a person reads at a glance: the clock time today, the weekday
|
|
75
20
|
* and time within a week, else the date.
|
|
@@ -91,17 +36,6 @@ export function shownUsage(live, listed) {
|
|
|
91
36
|
return Date.parse(live.observed_at) >= Date.parse(listed.observed_at) ? live : listed;
|
|
92
37
|
return live ?? listed ?? null;
|
|
93
38
|
}
|
|
94
|
-
/**
|
|
95
|
-
* `person@example.test · Pro`: who the login signs in as. The email is left out
|
|
96
|
-
* when the label already shows it; null when the provider says nothing.
|
|
97
|
-
*/
|
|
98
|
-
export function accountLine(account, label) {
|
|
99
|
-
if (!account)
|
|
100
|
-
return null;
|
|
101
|
-
const email = account.email && !label.toLowerCase().includes(account.email.toLowerCase()) ? account.email : null;
|
|
102
|
-
const plan = account.plan ? account.plan[0].toUpperCase() + account.plan.slice(1) : null;
|
|
103
|
-
return [email, plan].filter(Boolean).join(' · ') || null;
|
|
104
|
-
}
|
|
105
39
|
/** The login's email and plan, under its name: the live read when it answered, else the list's. */
|
|
106
40
|
export function SubscriptionAccountLine({ accountId, projectId, secret }) {
|
|
107
41
|
const live = useSubscriptionUsage(accountId, secret.secret_id, { projectId, storage: 'account_resource', enabled: isSubscriptionLogin(secret) && usable(secret) });
|
|
@@ -115,24 +49,6 @@ export function isSubscriptionLogin(secret) {
|
|
|
115
49
|
export function usable(secret) {
|
|
116
50
|
return secret.active && !secret.needs_reauth_at && secret.status !== 'undecryptable';
|
|
117
51
|
}
|
|
118
|
-
/** The windows still in force: a window whose reset passed no longer limits anything. */
|
|
119
|
-
function current(usage, now) {
|
|
120
|
-
return usage.windows.filter((window) => !window.resets_at || Date.parse(window.resets_at) > now);
|
|
121
|
-
}
|
|
122
|
-
/** A login that cannot take a model call now, and when that ends (null: unknown). */
|
|
123
|
-
export function loginLimit(usage, now) {
|
|
124
|
-
if (!usage)
|
|
125
|
-
return { limited: false, until: null };
|
|
126
|
-
const blocking = current(usage, now).filter((window) => isBlockingWindow(window.id));
|
|
127
|
-
const full = blocking.filter((window) => window.used_percent >= 100);
|
|
128
|
-
// A rejection whose window already reset is history, not a limit.
|
|
129
|
-
const rejected = usage.limited && blocking.length === usage.windows.filter((window) => isBlockingWindow(window.id)).length;
|
|
130
|
-
if (!full.length && !rejected)
|
|
131
|
-
return { limited: false, until: null };
|
|
132
|
-
const resets = (full.length ? full : blocking).map((window) => window.resets_at).filter((at) => Boolean(at));
|
|
133
|
-
// Capacity is back only when the LAST full window resets.
|
|
134
|
-
return { limited: true, until: resets.length ? resets.reduce((a, b) => (Date.parse(a) > Date.parse(b) ? a : b)) : null };
|
|
135
|
-
}
|
|
136
52
|
/**
|
|
137
53
|
* One provider's logins in one line: how many can work now, when the next
|
|
138
54
|
* one is back, and the fullest window of the ones that can.
|
|
@@ -62,13 +62,11 @@ const OWNS_ITS_DIRECTORY = {
|
|
|
62
62
|
* drop focus trap continuity.
|
|
63
63
|
*/
|
|
64
64
|
export function EntityDetailModal({ projectId, entity, kind, open, isResolving = false, aside, meta, paneOverride, removable = false, source, onOpenChange, }) {
|
|
65
|
-
// A skill/command with no description renders no `ModalDescription
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
// message itself names this exact fix. Only applied when there truly is no
|
|
71
|
-
// description; when one exists, `ModalDescription` wires up normally.
|
|
65
|
+
// A skill/command with no description renders no `ModalDescription`.
|
|
66
|
+
// Passing `aria-describedby={undefined}` explicitly (as its own prop key,
|
|
67
|
+
// not just omitting the attribute) states that the dialog has no
|
|
68
|
+
// description. Only applied when there truly is no description; when one
|
|
69
|
+
// exists, `ModalDescription` wires up `aria-describedby` normally.
|
|
72
70
|
const suppressDescriptionWarning = !entity?.description;
|
|
73
71
|
return (_jsx(Modal, { open: open, onOpenChange: onOpenChange, children: _jsx(ModalContent, { className: "bg-popover space-y-0 lg:max-w-6xl", ...(suppressDescriptionWarning ? { 'aria-describedby': undefined } : {}), children: entity ? (_jsx(EntityModalBody, { projectId: projectId, entity: entity, kind: kind, aside: aside, meta: meta, paneOverride: paneOverride, removable: removable, source: source }, entity.path)) : isResolving ? (_jsx(EntityModalSkeleton, { kind: kind })) : null }) }));
|
|
74
72
|
}
|
|
@@ -77,8 +75,8 @@ export function EntityDetailModal({ projectId, entity, kind, open, isResolving =
|
|
|
77
75
|
* has not arrived. Shape-matched to `EntityModalBody` — same header, same
|
|
78
76
|
* `lg:w-64` file rail — so the handover fills placeholders in place.
|
|
79
77
|
*
|
|
80
|
-
* `ModalTitle` is real, not decorative:
|
|
81
|
-
*
|
|
78
|
+
* `ModalTitle` is real, not decorative: a dialog needs an accessible name for
|
|
79
|
+
* the whole time it is open, including this window.
|
|
82
80
|
*/
|
|
83
81
|
function EntityModalSkeleton({ kind }) {
|
|
84
82
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
@@ -123,7 +121,7 @@ function EntityModalBody({ projectId, entity, kind, aside, meta, paneOverride, r
|
|
|
123
121
|
// The click does not send the prompt directly — `configure.start` opens a
|
|
124
122
|
// whole new chat, which is a bigger commitment than a pencil icon implies,
|
|
125
123
|
// so an AlertDialog confirms first. The dialog nests inside this modal's
|
|
126
|
-
// React tree on purpose: rendered as a sibling,
|
|
124
|
+
// React tree on purpose: rendered as a sibling, the modal would read every
|
|
127
125
|
// click in the alert as an outside-click and dismiss the modal underneath
|
|
128
126
|
// (see packages/ui/src/primitives/alert-dialog.tsx).
|
|
129
127
|
// Kortix's own files (a `source`) are read-only here.
|
|
@@ -120,7 +120,7 @@ type DriveMenuItemComponent = ComponentType<{
|
|
|
120
120
|
}>;
|
|
121
121
|
/**
|
|
122
122
|
* Contents of the "New" menu, injectable like `FolderDriveMenuItems` so the
|
|
123
|
-
* entries can be rendered — and their handlers driven — without a live
|
|
123
|
+
* entries can be rendered — and their handlers driven — without a live
|
|
124
124
|
* portal.
|
|
125
125
|
*/
|
|
126
126
|
export declare function DriveNewMenuItems({ Item, Separator: MenuSeparator, onUpload, onUploadFolder, onNewFile, onNewFolder, }: {
|
|
@@ -178,7 +178,7 @@ export function hasWriteActions(props) {
|
|
|
178
178
|
}
|
|
179
179
|
/**
|
|
180
180
|
* Contents of the "New" menu, injectable like `FolderDriveMenuItems` so the
|
|
181
|
-
* entries can be rendered — and their handlers driven — without a live
|
|
181
|
+
* entries can be rendered — and their handlers driven — without a live
|
|
182
182
|
* portal.
|
|
183
183
|
*/
|
|
184
184
|
export function DriveNewMenuItems({ Item, Separator: MenuSeparator, onUpload, onUploadFolder, onNewFile, onNewFolder, }) {
|
|
@@ -2,7 +2,7 @@ interface VersionStore {
|
|
|
2
2
|
selectedByProject: Record<string, string | undefined>;
|
|
3
3
|
setVersion: (projectId: string, ref: string | null) => void;
|
|
4
4
|
}
|
|
5
|
-
export declare const useVersionStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<VersionStore>, "
|
|
5
|
+
export declare const useVersionStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<VersionStore>, "persist" | "setState"> & {
|
|
6
6
|
setState(partial: VersionStore | Partial<VersionStore> | ((state: VersionStore) => VersionStore | Partial<VersionStore>), replace?: false | undefined): unknown;
|
|
7
7
|
setState(state: VersionStore | ((state: VersionStore) => VersionStore), replace: true): unknown;
|
|
8
8
|
persist: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
type ScrollAreaCompatProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Root>, 'children'> & {
|
|
4
4
|
children?: React.ReactNode;
|
|
@@ -6,16 +6,16 @@ type ScrollAreaCompatProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitiv
|
|
|
6
6
|
/** Cosmetic-only in this shim (no CSS mask fade); accepted for API parity. */
|
|
7
7
|
scrollFade?: boolean;
|
|
8
8
|
/**
|
|
9
|
-
* Cosmetic-only in this shim:
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Cosmetic-only in this shim: the overlay scrollbar doesn't reflow layout
|
|
10
|
+
* the way a native scrollbar does, so there's no gutter to reserve.
|
|
11
|
+
* Accepted for API parity with extend.ai's ScrollArea.
|
|
12
12
|
*/
|
|
13
13
|
scrollbarGutter?: boolean;
|
|
14
14
|
viewportClassName?: string;
|
|
15
15
|
/**
|
|
16
16
|
* `ref` is typed by hand here (a plain `(instance) => void` callback plus
|
|
17
17
|
* `RefObject`) instead of via `React.ComponentProps<typeof
|
|
18
|
-
* ScrollAreaPrimitive.Viewport>`:
|
|
18
|
+
* ScrollAreaPrimitive.Viewport>`: the library's ref type is baked into its own
|
|
19
19
|
* compiled `.d.ts`, independently instantiated from whatever callers pass
|
|
20
20
|
* (e.g. `@extend-ai/react-xlsx`'s `viewportProps.ref`), and `@types/react`
|
|
21
21
|
* 19.2's ref-cleanup-return branding makes those two independently
|
|
@@ -26,7 +26,7 @@ type ScrollAreaCompatProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitiv
|
|
|
26
26
|
* returning anything is assignable where `void` is expected" rule then
|
|
27
27
|
* accepts any caller's ref callback. `ref` is destructured out below and
|
|
28
28
|
* merged with `viewportRef` — see `mergeRefs` — so it never needs to
|
|
29
|
-
* satisfy
|
|
29
|
+
* satisfy the library's own nominal type anyway.
|
|
30
30
|
*/
|
|
31
31
|
viewportProps?: React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Viewport> & {
|
|
32
32
|
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement | null> | null;
|
|
@@ -3,13 +3,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
// Vendored extend.ai viewers (e.g. pdf-viewer.tsx) are written against
|
|
4
4
|
// extend.ai's own `ScrollArea`, which wraps `@base-ui/react/scroll-area` and
|
|
5
5
|
// exposes a richer prop surface (`orientation`, `scrollFade`,
|
|
6
|
-
// `viewportClassName`, `viewportProps`, `viewportRef`) than
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
|
|
11
|
-
// app, so the vendor diff in pdf-viewer.tsx stays a single import swap.
|
|
12
|
-
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
6
|
+
// `viewportClassName`, `viewportProps`, `viewportRef`) than the app-wide
|
|
7
|
+
// `@kortix/ui/scroll-area`. This shim implements just the props the vendored
|
|
8
|
+
// viewers use on the same Base UI primitive, so the vendor diff in
|
|
9
|
+
// pdf-viewer.tsx stays a single import swap.
|
|
10
|
+
import { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area';
|
|
13
11
|
import * as React from 'react';
|
|
14
12
|
import { cn } from '../../../lib/utils.js';
|
|
15
13
|
/**
|
|
@@ -34,8 +32,8 @@ export function mergeRefs(...refs) {
|
|
|
34
32
|
export function ScrollArea({ className, children, orientation = 'both', scrollFade: _scrollFade, scrollbarGutter: _scrollbarGutter, viewportClassName, viewportProps, viewportRef, ...props }) {
|
|
35
33
|
const { className: viewportPropsClassName, ref: viewportPropsRef, ...restViewportProps } = viewportProps ?? {};
|
|
36
34
|
const mergedViewportRef = React.useMemo(() => mergeRefs(viewportPropsRef, viewportRef), [viewportPropsRef, viewportRef]);
|
|
37
|
-
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn('relative overflow-hidden', className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { ...restViewportProps, ref: mergedViewportRef, "data-slot": "scroll-area-viewport", className: cn('focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1
|
|
35
|
+
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn('relative overflow-hidden', className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { ...restViewportProps, ref: mergedViewportRef, "data-slot": "scroll-area-viewport", className: cn('focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1', viewportPropsClassName, viewportClassName), children: children }), orientation !== 'horizontal' ? _jsx(ScrollBar, { orientation: "vertical" }) : null, orientation !== 'vertical' ? _jsx(ScrollBar, { orientation: "horizontal" }) : null, orientation === 'both' ? _jsx(ScrollAreaPrimitive.Corner, {}) : null] }));
|
|
38
36
|
}
|
|
39
37
|
function ScrollBar({ className, orientation = 'vertical', ...props }) {
|
|
40
|
-
return (_jsx(ScrollAreaPrimitive.
|
|
38
|
+
return (_jsx(ScrollAreaPrimitive.Scrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn('flex touch-none p-px select-none opacity-0 transition-opacity duration-moderate data-hovering:opacity-100 data-scrolling:opacity-100 data-scrolling:duration-0', orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent', orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent', className), ...props, children: _jsx(ScrollAreaPrimitive.Thumb, { "data-slot": "scroll-area-thumb", className: "bg-border relative flex-1 cursor-grab rounded-full active:cursor-grabbing" }) }));
|
|
41
39
|
}
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
// Vendored extend.ai viewers (e.g. pdf-viewer.tsx) are written against
|
|
4
4
|
// extend.ai's own base-ui-powered `Select` (`modal` on the root,
|
|
5
|
-
// `alignItemWithTrigger` on the content/popup)
|
|
6
|
-
// this
|
|
7
|
-
//
|
|
8
|
-
// `alignItemWithTrigger` concept — both are already effectively "off" in the
|
|
9
|
-
// Radix version, so this shim just accepts (and drops) those two props for
|
|
10
|
-
// API parity instead of widening the app-wide select component or pulling
|
|
11
|
-
// in `@base-ui/react`.
|
|
5
|
+
// `alignItemWithTrigger` on the content/popup). `@kortix/ui`'s `Select` runs
|
|
6
|
+
// on Base UI too and accepts both props, but this shim drops them, so these
|
|
7
|
+
// viewers keep the non-modal, popper-positioned select they have always had.
|
|
12
8
|
import { SelectContent as SelectContentPrimitive, SelectItem, Select as SelectPrimitive, SelectTrigger, SelectValue, } from '../../../primitives/select.js';
|
|
13
9
|
export { SelectItem, SelectTrigger, SelectValue };
|
|
14
10
|
export function Select({ modal: _modal, ...props }) {
|
|
@@ -48,16 +48,15 @@ export interface FilePreviewModalProps extends FilePreviewState {
|
|
|
48
48
|
* source down; this component owns all the chrome so every surface looks and
|
|
49
49
|
* behaves identically (one full-bleed brand style, no variants).
|
|
50
50
|
*
|
|
51
|
-
* It portals to <body
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* `
|
|
60
|
-
*
|
|
61
|
-
* Z-index is dialog-depth aware so it always stacks above its host overlay.
|
|
51
|
+
* It portals to <body>, also when nested inside a parent modal dialog (the
|
|
52
|
+
* Customize overlay). That dialog blocks outside pointer input with a
|
|
53
|
+
* full-screen backdrop and locks page scroll. Three things keep this preview
|
|
54
|
+
* usable on top of it:
|
|
55
|
+
* 1. Z-index is dialog-depth aware, so it stacks above the host's backdrop.
|
|
56
|
+
* 2. `pointer-events-auto` on the backdrop + surface, so an ancestor that
|
|
57
|
+
* sets `pointer-events:none` cannot make it inert.
|
|
58
|
+
* 3. A native `wheel`/`touchmove` listener that stops propagation before the
|
|
59
|
+
* event reaches `document`, so no document-level wheel handler can cancel
|
|
60
|
+
* scrolling here.
|
|
62
61
|
*/
|
|
63
62
|
export declare function FilePreviewModal({ selectedFilePath, panelMode, filePathList, currentFileIndex, onClose: closePreview, onNext: nextPreview, onPrev: prevPreview, source, HistoryContent, renderFileIcon, statusSlot, extraActions, shareContext, historyLabel, embedded, targetLine, }: FilePreviewModalProps): import("react").JSX.Element | null;
|