zidane-ui 9.3.1 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/live.d.ts +2 -0
- package/dist/adapters/live.js +3 -0
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +17 -11
- package/dist/adapters/server-machines-host.js +7 -0
- package/dist/adapters/server-session-host.js +49 -0
- package/dist/adapters/server-settings-sections.js +4 -1
- package/dist/adapters/sse-host.js +3 -0
- package/dist/adapters/sse-protocol.d.ts +10 -0
- package/dist/appearance/ZoomIndicator.js +5 -8
- package/dist/chat/HostTranscript.js +15 -1
- package/dist/chat/SessionStreamsProvider.d.ts +1 -1
- package/dist/chat/Transcript.d.ts +3 -2
- package/dist/chat/Transcript.js +26 -7
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ModelOptionsPicker.js +6 -2
- package/dist/chat/composer/ModelPicker.d.ts +1 -1
- package/dist/chat/composer/PlacePicker.d.ts +3 -1
- package/dist/chat/composer/PlacePicker.js +5 -1
- package/dist/chat/composer/use-draft-target.js +15 -3
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/draft-target.d.ts +28 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +25 -25
- package/dist/chat/headless/index.js +6 -6
- package/dist/chat/headless/markdown-scan.d.ts +0 -2
- package/dist/chat/headless/markdown-scan.js +3 -8
- package/dist/chat/headless/markdown-stream.js +3 -3
- package/dist/chat/headless/prompt-origin.d.ts +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/sidebar/directory.d.ts +10 -1
- package/dist/chat/headless/sidebar/directory.js +9 -1
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -9
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +9 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- package/dist/chat/headless/streams/actions.d.ts +2 -2
- package/dist/chat/headless/streams/actions.js +1 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
- package/dist/chat/headless/streams/event-bytes.js +13 -1
- package/dist/chat/headless/streams/store.d.ts +21 -5
- package/dist/chat/headless/streams/store.js +36 -7
- package/dist/chat/headless/streams/transcript-map.js +2 -5
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/collapse.js +3 -0
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +2 -2
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
- package/dist/chat/sidebar/SessionSidebar.js +23 -16
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
- package/dist/chat/sidebar/session-menu.d.ts +4 -0
- package/dist/chat/sidebar/session-menu.js +14 -2
- package/dist/chat/sidebar/sidebar-live.js +28 -4
- package/dist/chat/sidebar/useInboxRows.js +6 -6
- package/dist/chat/sidebar/useInboxTriage.js +50 -47
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +1 -1
- package/dist/chat/transcript/LazyRow.js +3 -4
- package/dist/chat/transcript/PromptEcho.js +3 -11
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/TranscriptRail.d.ts +1 -1
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/fold-worker.js +2 -1
- package/dist/chat/transcript/fold.js +11 -3
- package/dist/chat/transcript/index.d.ts +2 -2
- package/dist/chat/transcript/index.js +2 -2
- package/dist/chat/transcript/markdown-cache.d.ts +10 -1
- package/dist/chat/transcript/markdown-cache.js +37 -4
- package/dist/chat/transcript/markdown.js +27 -34
- package/dist/chat/transcript/media-gallery.js +13 -16
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/row-mount.d.ts +27 -8
- package/dist/chat/transcript/row-mount.js +114 -80
- package/dist/chat/transcript/row-parking.d.ts +27 -0
- package/dist/chat/transcript/row-parking.js +37 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tool-parts.js +0 -1
- package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useTranscriptFind.js +2 -4
- package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
- package/dist/chat/transcript/useTranscriptScroll.js +12 -1
- package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
- package/dist/chat/transcript/useTranscriptSearch.js +6 -6
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -25
- package/dist/code/editor/find/useFind.js +17 -17
- package/dist/code/editor/useCodeDocument.js +22 -19
- package/dist/code/editor/useDetachCleanup.js +4 -3
- package/dist/code/use-highlighted-html.js +12 -13
- package/dist/components/IconButton.d.ts +3 -1
- package/dist/components/IconButton.js +7 -2
- package/dist/components/IconButtonTip.d.ts +3 -1
- package/dist/components/IconButtonTip.js +2 -1
- package/dist/components/RowActionsMenu.js +7 -14
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +8 -6
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
- package/dist/components/floating/useAnchoredPosition.js +7 -7
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.js +2 -7
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +3 -3
- package/dist/dist/{index-C6-t1SS9.d.ts → index-BheVJOLc.d.ts} +1 -0
- package/dist/dist/index.d.ts +2 -2
- package/dist/files/FilesTab.js +0 -1
- package/dist/files/TreeColumn.d.ts +2 -4
- package/dist/files/TreeColumn.js +0 -5
- package/dist/files/headless/host.d.ts +3 -7
- package/dist/files/headless/labels.d.ts +0 -1
- package/dist/files/headless/labels.js +0 -1
- package/dist/files/headless/workspace-diff.js +1 -1
- package/dist/files/useCodeReview.js +1 -3
- package/dist/files/useFilesDiagnostics.d.ts +1 -1
- package/dist/files/useFilesDiagnostics.js +4 -11
- package/dist/files/useOpenFiles.js +9 -12
- package/dist/files/useWorkspace.d.ts +5 -7
- package/dist/files/useWorkspace.js +4 -15
- package/dist/git/GitBar.js +5 -3
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +32 -53
- package/dist/git/MoveToDialog.d.ts +61 -0
- package/dist/git/MoveToDialog.js +240 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +69 -0
- package/dist/git/TeleportSessionDialog.js +440 -0
- package/dist/git/headless/host.d.ts +14 -0
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +44 -1
- package/dist/git/headless/labels.js +50 -0
- package/dist/git/headless/sandboxes.d.ts +1 -1
- package/dist/git/headless/sandboxes.js +4 -3
- package/dist/git/headless/teleport.d.ts +76 -0
- package/dist/git/headless/teleport.js +19 -0
- package/dist/git/index.d.ts +4 -2
- package/dist/git/index.js +4 -2
- package/dist/git/useEnvironmentChoices.d.ts +5 -2
- package/dist/git/useEnvironmentChoices.js +12 -4
- package/dist/hooks/useLatest.d.ts +8 -0
- package/dist/hooks/useLatest.js +17 -0
- package/dist/hooks/useMinuteTick.d.ts +6 -2
- package/dist/hooks/useMinuteTick.js +12 -6
- package/dist/hooks/useNearViewport.js +11 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/keybindings/KeybindingsProvider.js +3 -4
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +18 -0
- package/dist/machines/AddServerForm.js +55 -3
- package/dist/machines/Banners.d.ts +2 -2
- package/dist/machines/Banners.js +3 -3
- package/dist/machines/DaemonMenu.js +1 -3
- package/dist/machines/HostsSection.js +5 -1
- package/dist/machines/OrganizationPanel.d.ts +25 -0
- package/dist/machines/OrganizationPanel.js +266 -0
- package/dist/machines/PersonalLayerPanel.d.ts +32 -0
- package/dist/machines/PersonalLayerPanel.js +360 -0
- package/dist/machines/headless/fixture-host.d.ts +10 -0
- package/dist/machines/headless/fixture-host.js +44 -0
- package/dist/machines/headless/host.d.ts +21 -1
- package/dist/machines/headless/index.d.ts +3 -1
- package/dist/machines/headless/index.js +3 -1
- package/dist/machines/headless/labels.d.ts +55 -0
- package/dist/machines/headless/labels.js +58 -1
- package/dist/machines/headless/layer.d.ts +64 -0
- package/dist/machines/headless/layer.js +56 -0
- package/dist/machines/headless/organization.d.ts +38 -0
- package/dist/machines/headless/organization.js +44 -0
- package/dist/machines/index.d.ts +3 -1
- package/dist/machines/index.js +3 -1
- package/dist/machines/testing/contract.d.ts +25 -1
- package/dist/machines/testing/contract.js +97 -1
- package/dist/motion/grow.js +12 -13
- package/dist/motion/swap.js +2 -5
- package/dist/motion/use-flip-list.d.ts +14 -0
- package/dist/motion/use-flip-list.js +17 -12
- package/dist/palette/headless/app-sources.js +37 -0
- package/dist/palette/headless/labels.js +3 -0
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +170 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectHome.js +10 -9
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionPeopleStack.d.ts +23 -0
- package/dist/session/SessionPeopleStack.js +65 -0
- package/dist/session/SessionPlaceMenu.js +5 -4
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +342 -0
- package/dist/session/TypingLine.d.ts +22 -0
- package/dist/session/TypingLine.js +31 -0
- package/dist/session/headless/host.d.ts +40 -1
- package/dist/session/headless/index.d.ts +4 -2
- package/dist/session/headless/index.js +3 -1
- package/dist/session/headless/labels.d.ts +49 -0
- package/dist/session/headless/labels.js +56 -0
- package/dist/session/headless/people.d.ts +29 -0
- package/dist/session/headless/people.js +53 -0
- package/dist/session/headless/place.d.ts +5 -0
- package/dist/session/headless/place.js +5 -1
- package/dist/session/headless/typing.d.ts +37 -0
- package/dist/session/headless/typing.js +60 -0
- package/dist/session/index.d.ts +5 -1
- package/dist/session/index.js +5 -1
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/section.d.ts +15 -3
- package/dist/settings/section.js +15 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- package/dist/settings/sections/keybindings/labels.d.ts +3 -0
- package/dist/settings/sections/keybindings/labels.js +3 -0
- package/dist/settings/sections/keybindings/rows.js +12 -0
- package/dist/settings/sections/logs/LogsSection.js +5 -8
- package/dist/styles.css +32 -7
- package/dist/terminal/HostTerminalSurface.js +28 -30
- package/dist/terminal/TerminalPanel.js +4 -12
- package/dist/terminal/TerminalProvider.d.ts +10 -2
- package/dist/terminal/TerminalProvider.js +10 -2
- package/dist/terminal/headless/labels.d.ts +0 -1
- package/dist/terminal/headless/labels.js +1 -2
- package/dist/terminal/headless/store.js +5 -1
- package/dist/workspace/LayoutBudget.js +1 -7
- package/package.json +2 -2
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +3 -3
- package/src/styles/transcript.css +17 -3
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -138,6 +138,55 @@ const DEFAULT_GIT_LABELS = {
|
|
|
138
138
|
gitMoveDone: "Done",
|
|
139
139
|
gitMoveListFailed: "Couldn't list where it can run.",
|
|
140
140
|
gitMoveFailed: "Couldn't move the session.",
|
|
141
|
+
gitTeleportTitle: "Teleport this session",
|
|
142
|
+
gitTeleportWhere: "Pick the host to move it to.",
|
|
143
|
+
gitTeleportLoading: "Comparing the hosts…",
|
|
144
|
+
gitTeleportNone: "No other host is connected.",
|
|
145
|
+
gitTeleportMarkFixable: "to set up",
|
|
146
|
+
gitTeleportMarkChanges: "changes",
|
|
147
|
+
gitTeleportMarkBlocked: "can't run it",
|
|
148
|
+
gitTeleportConfirm: (name) => `Teleport to ${name}?`,
|
|
149
|
+
gitTeleportCarryWork: (count) => `Bring the work in progress (${count} ${count === 1 ? "file" : "files"})`,
|
|
150
|
+
gitTeleportNoWork: "No uncommitted work to bring.",
|
|
151
|
+
gitTeleportNotRepo: "The folder is not a git repository. Only the conversation moves.",
|
|
152
|
+
gitTeleportCheckout: (name) => `Checkout on ${name}`,
|
|
153
|
+
gitTeleportCheckoutPlaceholder: "path to the same project",
|
|
154
|
+
gitTeleportFolder: (name) => `Folder on ${name}`,
|
|
155
|
+
gitTeleportFolderPlaceholder: "path on that host",
|
|
156
|
+
gitTeleportBrowse: "Browse…",
|
|
157
|
+
gitTeleportIgnored: "Files git ignores stay here. Tick the ones to bring:",
|
|
158
|
+
gitTeleportSecret: "secret?",
|
|
159
|
+
gitTeleportLfs: "Git LFS files move only if that host can fetch them.",
|
|
160
|
+
gitTeleportSubmodules: (count) => `${count} submodule${count === 1 ? "" : "s"} will not move.`,
|
|
161
|
+
gitTeleportDetail: "The conversation moves with its history. The folder here stays as it is.",
|
|
162
|
+
gitTeleportSubmit: "Teleport",
|
|
163
|
+
gitTeleporting: "Teleporting…",
|
|
164
|
+
/** Where a teleport is, under the dialog's content while it runs. */
|
|
165
|
+
gitTeleportStage: (stage, done, total) => ({
|
|
166
|
+
export: "Packing the session…",
|
|
167
|
+
transfer: total !== void 0 && total > 1 ? `Sending it… ${Math.min(done ?? 0, total)} of ${total}` : "Sending it…",
|
|
168
|
+
prepare: "Preparing it there…",
|
|
169
|
+
commit: "Starting it there…",
|
|
170
|
+
complete: "Finishing…"
|
|
171
|
+
})[stage],
|
|
172
|
+
gitTeleportStop: "Stop",
|
|
173
|
+
gitTeleportStopped: "Stopped. Nothing changed.",
|
|
174
|
+
gitTeleportFailed: "The teleport failed. Nothing changed.",
|
|
175
|
+
/** The target stopped answering during the switch: the session may be on it already. */
|
|
176
|
+
gitTeleportUnknown: "The other host stopped answering, and the session can already be there. Look for it there before you try again.",
|
|
177
|
+
/** The session moved, but its old host could not be told yet (the host's words under Details). */
|
|
178
|
+
gitTeleportSourceNotTold: "The session moved. Its old host still keeps a copy for now.",
|
|
179
|
+
gitTeleportListFailed: "Comparing the hosts failed.",
|
|
180
|
+
/** The host picked in Move to… can't take the session: why, from its comparison. */
|
|
181
|
+
gitTeleportCannot: (name) => `${name} cannot run this session.`,
|
|
182
|
+
/** In the teleport step of Move to…, when an isolation was picked on the target too. */
|
|
183
|
+
gitTeleportThen: (isolation) => `Then it sets up ${isolation} there.`,
|
|
184
|
+
gitMoveContinue: "Continue",
|
|
185
|
+
gitMoveHere: "It runs here now. Pick another place.",
|
|
186
|
+
gitMoveUnavailable: "It cannot run there now.",
|
|
187
|
+
/** After a teleport, before its isolation is set up on the new host. */
|
|
188
|
+
gitMoveThen: (host, isolation) => `It is on ${host} now, in its folder. Set up ${isolation} there:`,
|
|
189
|
+
gitMoveKeepThere: "Keep it in its folder",
|
|
141
190
|
gitWhereLabel: "Choose where the session runs",
|
|
142
191
|
gitWhereTitle: (place, isolation, branch) => `Runs on ${place}${isolation ? `, ${isolation.toLowerCase()}` : ""}${branch ? ` (${branch})` : ""}`,
|
|
143
192
|
gitRunsOn: "Runs on",
|
|
@@ -215,6 +264,7 @@ const DEFAULT_GIT_LABELS = {
|
|
|
215
264
|
sandboxStates: {
|
|
216
265
|
running: "Running",
|
|
217
266
|
paused: "Paused",
|
|
267
|
+
failed: "Failed",
|
|
218
268
|
other: "Unknown"
|
|
219
269
|
},
|
|
220
270
|
sandboxCpu: (count) => `${count} CPU`,
|
|
@@ -29,7 +29,7 @@ export declare function sandboxMatches(sandbox: EnvironmentSandboxSummary, filte
|
|
|
29
29
|
*/
|
|
30
30
|
export declare function sandboxCounts(sandboxes: readonly EnvironmentSandboxSummary[]): Record<SandboxFilter, number>;
|
|
31
31
|
/**
|
|
32
|
-
* Running first (they cost), then paused, then the rest; a session's before a stray one; newest first.
|
|
32
|
+
* Running first (they cost), then failed (they need a look), then paused, then the rest; a session's before a stray one; newest first.
|
|
33
33
|
*
|
|
34
34
|
* @param sandboxes - The sandboxes.
|
|
35
35
|
*/
|
|
@@ -24,11 +24,12 @@ function sandboxCounts(sandboxes) {
|
|
|
24
24
|
}
|
|
25
25
|
const STATE_ORDER = {
|
|
26
26
|
running: 0,
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
failed: 1,
|
|
28
|
+
paused: 2,
|
|
29
|
+
other: 3
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
|
-
* Running first (they cost), then paused, then the rest; a session's before a stray one; newest first.
|
|
32
|
+
* Running first (they cost), then failed (they need a look), then paused, then the rest; a session's before a stray one; newest first.
|
|
32
33
|
*
|
|
33
34
|
* @param sandboxes - The sandboxes.
|
|
34
35
|
*/
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Teleport in the kit (docs/TELEPORT.md): what the dialog reads from a
|
|
3
|
+
* `GitHost` and the pure rules it renders by. The comparison itself comes
|
|
4
|
+
* from the host (`checkTeleportTarget` in `zidane/ipc`).
|
|
5
|
+
*/
|
|
6
|
+
import { movingCount, shownRows, workTarget } from "zidane/chat/pure";
|
|
7
|
+
import { CompareRow, Readiness } from "zidane/ipc";
|
|
8
|
+
/** A host a session could go to, compared with it. `error`: it could not be asked. */
|
|
9
|
+
export interface TeleportTargetView {
|
|
10
|
+
/** The host's id. */
|
|
11
|
+
hostId: string;
|
|
12
|
+
/** The host's name, as people see it. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** A server (absent or `false`: This computer). */
|
|
15
|
+
remote?: boolean;
|
|
16
|
+
/** The differences with the session, worst first. */
|
|
17
|
+
rows: readonly CompareRow[];
|
|
18
|
+
/** The worst of them, as the picker shows it. */
|
|
19
|
+
readiness: Readiness;
|
|
20
|
+
/** Why it could not be asked. */
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
/** What a teleport asks for. */
|
|
24
|
+
export interface TeleportRequestView {
|
|
25
|
+
/** The target's id. */
|
|
26
|
+
hostId: string;
|
|
27
|
+
/** Carry the git work into a new worktree of `repo` at `path` on `branch` (on the target). */
|
|
28
|
+
work?: {
|
|
29
|
+
repo: string;
|
|
30
|
+
path: string;
|
|
31
|
+
branch: string;
|
|
32
|
+
};
|
|
33
|
+
/** Ignored files the person ticked. */
|
|
34
|
+
carryIgnored?: string[];
|
|
35
|
+
/** The session's folder on the target when no work is carried. */
|
|
36
|
+
cwd?: string;
|
|
37
|
+
}
|
|
38
|
+
/** Where a teleport is: its stage, and while it sends the session the chunks sent of all. */
|
|
39
|
+
export interface TeleportProgressView {
|
|
40
|
+
/** The step it is at. */
|
|
41
|
+
stage: 'export' | 'transfer' | 'prepare' | 'commit' | 'complete';
|
|
42
|
+
/** The chunks sent so far, during `transfer`. */
|
|
43
|
+
done?: number;
|
|
44
|
+
/** All the chunks to send, during `transfer`. */
|
|
45
|
+
total?: number;
|
|
46
|
+
}
|
|
47
|
+
/** A teleport's progress, and a stop before its commit (nothing changes then). */
|
|
48
|
+
export interface TeleportCallView {
|
|
49
|
+
/** Gets each step, and the chunks sent during `transfer`. */
|
|
50
|
+
onProgress?: (progress: TeleportProgressView) => void;
|
|
51
|
+
/** Stops the teleport before its commit. */
|
|
52
|
+
signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Until the commit, a teleport can stop with nothing changed.
|
|
56
|
+
*
|
|
57
|
+
* @param progress - Where the teleport is; `null` before it starts.
|
|
58
|
+
*/
|
|
59
|
+
export declare function teleportStoppable(progress: TeleportProgressView | null): boolean;
|
|
60
|
+
/** What a teleport answered: the session's id on the target, and a notice to show when the source could not be told. */
|
|
61
|
+
export type TeleportOutcome = {
|
|
62
|
+
ok: true;
|
|
63
|
+
sessionId: string;
|
|
64
|
+
notice?: string;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
message: string;
|
|
68
|
+
unknown?: true;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* A target can be picked unless something blocks it or it could not be asked.
|
|
72
|
+
*
|
|
73
|
+
* @param target - The target, compared with the session.
|
|
74
|
+
*/
|
|
75
|
+
export declare function canTeleportTo(target: TeleportTargetView): boolean;
|
|
76
|
+
export { movingCount, shownRows, workTarget };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { movingCount, shownRows, workTarget } from "zidane/chat/pure";
|
|
2
|
+
// src/git/headless/teleport.ts
|
|
3
|
+
/**
|
|
4
|
+
* Until the commit, a teleport can stop with nothing changed.
|
|
5
|
+
*
|
|
6
|
+
* @param progress - Where the teleport is; `null` before it starts.
|
|
7
|
+
*/
|
|
8
|
+
function teleportStoppable(progress) {
|
|
9
|
+
return progress === null || progress.stage === "export" || progress.stage === "transfer" || progress.stage === "prepare";
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A target can be picked unless something blocks it or it could not be asked.
|
|
13
|
+
*
|
|
14
|
+
* @param target - The target, compared with the session.
|
|
15
|
+
*/
|
|
16
|
+
function canTeleportTo(target) {
|
|
17
|
+
return target.error === void 0 && target.readiness !== "blocked";
|
|
18
|
+
}
|
|
19
|
+
export { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget };
|
package/dist/git/index.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { BranchMenu, BranchMenuProps, BranchMenuWorktree } from "./BranchMenu.js
|
|
|
2
2
|
import { GitBar, GitBarBranchMenuProps, GitBarProps } from "./GitBar.js";
|
|
3
3
|
import { GitProvider, GitProviderProps, useGitHost, useGitLabels } from "./GitProvider.js";
|
|
4
4
|
import { ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, useImportRepo } from "./ImportRepoDialog.js";
|
|
5
|
-
import { MoveSessionDialog, MoveSessionDialogProps
|
|
5
|
+
import { MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveSessionDialogProps } from "./MoveSessionDialog.js";
|
|
6
|
+
import { MoveSessionOptions, MoveToDialog, MoveToDialogProps, useMoveSession } from "./MoveToDialog.js";
|
|
6
7
|
import { RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps } from "./RemoteFolderPicker.js";
|
|
7
8
|
import { SandboxManager, SandboxManagerKind, SandboxManagerProps } from "./SandboxManager.js";
|
|
8
9
|
import { GIT_BAR_ITEM, SyncChip, SyncChipProps } from "./SyncChip.js";
|
|
10
|
+
import { TeleportDone, TeleportSessionDialog, TeleportSessionDialogProps, TeleportSubject, useTeleportSession } from "./TeleportSessionDialog.js";
|
|
9
11
|
import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
|
|
10
12
|
import { GitBarState, useGitBar } from "./useGitBar.js";
|
|
11
13
|
import { StartFromPanelDraft, StartFromPanelResult, useStartFromPanel } from "./useStartFromPanel.js";
|
|
12
14
|
import { WhereMenu, WhereMenuProps, WherePicker, WherePickerProps } from "./WherePicker.js";
|
|
13
|
-
export { BranchMenu, BranchMenuProps, BranchMenuWorktree, GIT_BAR_ITEM, GitBar, GitBarBranchMenuProps, GitBarProps, GitBarState, GitProvider, GitProviderProps, ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, MoveSessionDialog, MoveSessionDialogProps, RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps, SandboxManager, SandboxManagerKind, SandboxManagerProps, StartFromPanelDraft, StartFromPanelResult, SyncChip, SyncChipProps, WhereMenu, WhereMenuProps, WherePicker, WherePickerProps, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
|
|
15
|
+
export { BranchMenu, BranchMenuProps, BranchMenuWorktree, GIT_BAR_ITEM, GitBar, GitBarBranchMenuProps, GitBarProps, GitBarState, GitProvider, GitProviderProps, ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveSessionDialogProps, MoveSessionOptions, MoveToDialog, MoveToDialogProps, RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps, SandboxManager, SandboxManagerKind, SandboxManagerProps, StartFromPanelDraft, StartFromPanelResult, SyncChip, SyncChipProps, TeleportDone, TeleportSessionDialog, TeleportSessionDialogProps, TeleportSubject, WhereMenu, WhereMenuProps, WherePicker, WherePickerProps, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel, useTeleportSession };
|
package/dist/git/index.js
CHANGED
|
@@ -2,12 +2,14 @@ import { BranchMenu } from "./BranchMenu.js";
|
|
|
2
2
|
import { GitBar } from "./GitBar.js";
|
|
3
3
|
import { GitProvider, useGitHost, useGitLabels } from "./GitProvider.js";
|
|
4
4
|
import { ImportRepoDialog, useImportRepo } from "./ImportRepoDialog.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MOVE_SESSION_TITLE_ID, MoveSessionDialog } from "./MoveSessionDialog.js";
|
|
6
|
+
import { MoveToDialog, useMoveSession } from "./MoveToDialog.js";
|
|
6
7
|
import { RemoteFolderBrowser, RemoteFolderPicker } from "./RemoteFolderPicker.js";
|
|
7
8
|
import { SandboxManager } from "./SandboxManager.js";
|
|
8
9
|
import { GIT_BAR_ITEM, SyncChip } from "./SyncChip.js";
|
|
10
|
+
import { TeleportSessionDialog, useTeleportSession } from "./TeleportSessionDialog.js";
|
|
9
11
|
import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
|
|
10
12
|
import { useGitBar } from "./useGitBar.js";
|
|
11
13
|
import { useStartFromPanel } from "./useStartFromPanel.js";
|
|
12
14
|
import { WhereMenu, WherePicker } from "./WherePicker.js";
|
|
13
|
-
export { BranchMenu, GIT_BAR_ITEM, GitBar, GitProvider, ImportRepoDialog, MoveSessionDialog, RemoteFolderBrowser, RemoteFolderPicker, SandboxManager, SyncChip, WhereMenu, WherePicker, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
|
|
15
|
+
export { BranchMenu, GIT_BAR_ITEM, GitBar, GitProvider, ImportRepoDialog, MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveToDialog, RemoteFolderBrowser, RemoteFolderPicker, SandboxManager, SyncChip, TeleportSessionDialog, WhereMenu, WherePicker, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel, useTeleportSession };
|
|
@@ -13,6 +13,9 @@ import { EnvironmentDescriptor } from "zidane/chat";
|
|
|
13
13
|
*
|
|
14
14
|
* @param cwd - The draft's folder (`''`: none); `null` reads nothing (no draft on screen).
|
|
15
15
|
* @param hostId - The saved server the draft runs on (absent: this host).
|
|
16
|
-
* @param options - Whether an offline machine's kinds stay usable (a new chat waits for it)
|
|
16
|
+
* @param options - Whether an offline machine's kinds stay usable (a new chat waits for it), and whether to list
|
|
17
|
+
* what the host can run whatever the folder (`machineOnly`: a default for many folders).
|
|
17
18
|
*/
|
|
18
|
-
export declare function useEnvironmentChoices(cwd: string | null, hostId?: string, options?: WithMachinesOptions
|
|
19
|
+
export declare function useEnvironmentChoices(cwd: string | null, hostId?: string, options?: WithMachinesOptions & {
|
|
20
|
+
machineOnly?: boolean;
|
|
21
|
+
}): readonly EnvironmentDescriptor[];
|
|
@@ -9,19 +9,26 @@ const NO_DESCRIPTORS = [];
|
|
|
9
9
|
*
|
|
10
10
|
* @param cwd - The draft's folder (`''`: none); `null` reads nothing (no draft on screen).
|
|
11
11
|
* @param hostId - The saved server the draft runs on (absent: this host).
|
|
12
|
-
* @param options - Whether an offline machine's kinds stay usable (a new chat waits for it)
|
|
12
|
+
* @param options - Whether an offline machine's kinds stay usable (a new chat waits for it), and whether to list
|
|
13
|
+
* what the host can run whatever the folder (`machineOnly`: a default for many folders).
|
|
13
14
|
*/
|
|
14
15
|
function useEnvironmentChoices(cwd, hostId, options = {}) {
|
|
15
16
|
const offlineWaits = options.offlineWaits === true;
|
|
17
|
+
const machineOnly = options.machineOnly === true;
|
|
16
18
|
const host = useGitHost();
|
|
17
19
|
const [listed, setListed] = useState(null);
|
|
18
|
-
const key = cwd === null ? null : JSON.stringify([
|
|
20
|
+
const key = cwd === null ? null : JSON.stringify([
|
|
21
|
+
cwd,
|
|
22
|
+
hostId ?? null,
|
|
23
|
+
machineOnly
|
|
24
|
+
]);
|
|
19
25
|
useEffect(() => {
|
|
20
26
|
const list = host?.environments;
|
|
21
27
|
if (key === null || cwd === null || !list) return void 0;
|
|
22
28
|
const query = {
|
|
23
29
|
cwd,
|
|
24
|
-
...hostId ? { hostId } : {}
|
|
30
|
+
...hostId ? { hostId } : {},
|
|
31
|
+
...machineOnly ? { machineOnly: true } : {}
|
|
25
32
|
};
|
|
26
33
|
let read = 0;
|
|
27
34
|
let live = true;
|
|
@@ -45,7 +52,8 @@ function useEnvironmentChoices(cwd, hostId, options = {}) {
|
|
|
45
52
|
key,
|
|
46
53
|
cwd,
|
|
47
54
|
hostId,
|
|
48
|
-
offlineWaits
|
|
55
|
+
offlineWaits,
|
|
56
|
+
machineOnly
|
|
49
57
|
]);
|
|
50
58
|
return listed && listed.key === key ? listed.descriptors : NO_DESCRIPTORS;
|
|
51
59
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stable function returning `value` as of the last commit, for what is built once (a store, a palette
|
|
3
|
+
* source, a listener) and reads the current value when it runs. Never call it during render.
|
|
4
|
+
*
|
|
5
|
+
* @param value - What the function returns.
|
|
6
|
+
* @returns The same function for the component's life.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useLatest<T>(value: T): () => T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback, useInsertionEffect, useRef } from "react";
|
|
2
|
+
// src/hooks/useLatest.ts
|
|
3
|
+
/**
|
|
4
|
+
* A stable function returning `value` as of the last commit, for what is built once (a store, a palette
|
|
5
|
+
* source, a listener) and reads the current value when it runs. Never call it during render.
|
|
6
|
+
*
|
|
7
|
+
* @param value - What the function returns.
|
|
8
|
+
* @returns The same function for the component's life.
|
|
9
|
+
*/
|
|
10
|
+
function useLatest(value) {
|
|
11
|
+
const ref = useRef(value);
|
|
12
|
+
useInsertionEffect(() => {
|
|
13
|
+
ref.current = value;
|
|
14
|
+
});
|
|
15
|
+
return useCallback(() => ref.current, []);
|
|
16
|
+
}
|
|
17
|
+
export { useLatest };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Re-renders the caller once a minute (and when the window shows again).
|
|
3
|
+
*
|
|
4
|
+
* @returns The time to measure from: the last tick's, or the caller's first render's when later.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMinuteTick(): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSyncExternalStore } from "react";
|
|
1
|
+
import { useState, useSyncExternalStore } from "react";
|
|
2
2
|
// src/hooks/useMinuteTick.ts
|
|
3
3
|
/**
|
|
4
4
|
* One shared minute tick for relative times ("now", "5m", "2h"): a single
|
|
@@ -6,11 +6,12 @@ import { useSyncExternalStore } from "react";
|
|
|
6
6
|
* visible. A window coming back into view ticks at once.
|
|
7
7
|
*/
|
|
8
8
|
const MINUTE_MS = 6e4;
|
|
9
|
-
|
|
9
|
+
/** When the last tick happened (0 before the first). */
|
|
10
|
+
let tickedAt = 0;
|
|
10
11
|
let timer = null;
|
|
11
12
|
const listeners = /* @__PURE__ */ new Set();
|
|
12
13
|
function tick() {
|
|
13
|
-
|
|
14
|
+
tickedAt = Date.now();
|
|
14
15
|
for (const listener of [...listeners]) listener();
|
|
15
16
|
}
|
|
16
17
|
function sync() {
|
|
@@ -35,9 +36,14 @@ function subscribe(listener) {
|
|
|
35
36
|
sync();
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
const read = () =>
|
|
39
|
-
/**
|
|
39
|
+
const read = () => tickedAt;
|
|
40
|
+
/**
|
|
41
|
+
* Re-renders the caller once a minute (and when the window shows again).
|
|
42
|
+
*
|
|
43
|
+
* @returns The time to measure from: the last tick's, or the caller's first render's when later.
|
|
44
|
+
*/
|
|
40
45
|
function useMinuteTick() {
|
|
41
|
-
|
|
46
|
+
const [mountedAt] = useState(() => Date.now());
|
|
47
|
+
return Math.max(useSyncExternalStore(subscribe, read, read), mountedAt);
|
|
42
48
|
}
|
|
43
49
|
export { useMinuteTick };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AllNearViewportContext } from "./near-viewport-all.js";
|
|
2
|
-
import { useContext, useEffect, useState } from "react";
|
|
2
|
+
import { useContext, useEffect, useState, useSyncExternalStore } from "react";
|
|
3
3
|
// src/hooks/useNearViewport.ts
|
|
4
4
|
const listeners = /* @__PURE__ */ new WeakMap();
|
|
5
5
|
const observers = /* @__PURE__ */ new WeakMap();
|
|
@@ -62,6 +62,11 @@ function shared(margin, root) {
|
|
|
62
62
|
byMargin.set(margin, io);
|
|
63
63
|
return io;
|
|
64
64
|
}
|
|
65
|
+
const noSubscribe = () => () => {};
|
|
66
|
+
/** No `IntersectionObserver` to watch with (an old engine, jsdom): everything counts as near. */
|
|
67
|
+
const noObserver = () => typeof IntersectionObserver === "undefined";
|
|
68
|
+
/** While hydrating: as the server rendered, not near. */
|
|
69
|
+
const notYet = () => false;
|
|
65
70
|
/**
|
|
66
71
|
* Reports whether an element has come within `margin` of the viewport. It turns true once
|
|
67
72
|
* and stays true, so it suits lazy work such as highlighting code that scrolls into reach.
|
|
@@ -75,13 +80,10 @@ function shared(margin, root) {
|
|
|
75
80
|
function useNearViewport(ref, margin = "600px 0px") {
|
|
76
81
|
const [near, setNear] = useState(false);
|
|
77
82
|
const all = useContext(AllNearViewportContext);
|
|
83
|
+
const unwatched = useSyncExternalStore(noSubscribe, noObserver, notYet);
|
|
78
84
|
useEffect(() => {
|
|
79
85
|
const el = ref.current;
|
|
80
|
-
if (!el || near || all) return void 0;
|
|
81
|
-
if (typeof IntersectionObserver === "undefined") {
|
|
82
|
-
setNear(true);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
86
|
+
if (!el || near || all || unwatched) return void 0;
|
|
85
87
|
const io = shared(margin, scrollRootOf(el));
|
|
86
88
|
listeners.set(el, () => setNear(true));
|
|
87
89
|
io.observe(el);
|
|
@@ -93,8 +95,9 @@ function useNearViewport(ref, margin = "600px 0px") {
|
|
|
93
95
|
ref,
|
|
94
96
|
near,
|
|
95
97
|
margin,
|
|
96
|
-
all
|
|
98
|
+
all,
|
|
99
|
+
unwatched
|
|
97
100
|
]);
|
|
98
|
-
return near || all;
|
|
101
|
+
return near || all || unwatched;
|
|
99
102
|
}
|
|
100
103
|
export { scrollRootOf, useNearViewport };
|
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ import { ZidaneMark, ZidaneMarkProps } from "./components/ZidaneMark.js";
|
|
|
86
86
|
import { ZoomableImage, ZoomableImageHandle, ZoomableImageProps } from "./components/ZoomableImage.js";
|
|
87
87
|
import { KeyedStore, createKeyedStore, useKeyedValue } from "./hooks/keyed-store.js";
|
|
88
88
|
import { PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, useDisplayPath } from "./hooks/useDisplayPath.js";
|
|
89
|
+
import { useLatest } from "./hooks/useLatest.js";
|
|
89
90
|
import { useMinuteTick } from "./hooks/useMinuteTick.js";
|
|
90
91
|
import { scrollRootOf, useNearViewport } from "./hooks/useNearViewport.js";
|
|
91
92
|
import { oneOf, parseBoolean, readPersisted, usePersistedState, writePersisted } from "./hooks/usePersistedState.js";
|
|
@@ -106,7 +107,7 @@ import { ApplyMotionOptions, DEFAULT_PANEL_MS, FADE_KEYS, HOVER_MOTION, INSTANT,
|
|
|
106
107
|
import { Crossfade, CrossfadeProps, Presence, PresenceProps, useCadencedValue } from "./motion/swap.js";
|
|
107
108
|
import { SwapIcon, SwapIconProps } from "./motion/SwapIcon.js";
|
|
108
109
|
import { TitleText, TitleTextProps } from "./motion/title-text.js";
|
|
109
|
-
import { FlipSnapshot, FlipSnapshotProps, UseFlipList, UseFlipListOptions, useFlipList } from "./motion/use-flip-list.js";
|
|
110
|
+
import { FlipPlan, FlipSnapshot, FlipSnapshotProps, UseFlipList, UseFlipListOptions, useFlipList } from "./motion/use-flip-list.js";
|
|
110
111
|
import { basename, compactPath, formatPathForCwd, splitPath, tildePath, tildeText } from "./path.js";
|
|
111
112
|
import { ACCENT_PRESETS, AccentPreset, presetFor } from "./theme/accents.js";
|
|
112
113
|
import { DARK_LUMINANCE_THRESHOLD, Oklch, Rgb, capChroma, contrastRatio, ensureContrast, formatColor, isDark, luminance, mix, oklch, oklchToRgb, parseColor, readableOn, rgbToOklch, tintedNeutral, toOklch, withAlpha, withLightness } from "./theme/color.js";
|
|
@@ -117,4 +118,4 @@ import { IconCollection, RuntimeIconsOptions, watchRuntimeIcons } from "./theme/
|
|
|
117
118
|
import { themeCssVars, themeStylesheet } from "./theme/stylesheet.js";
|
|
118
119
|
import { BUILTIN_THEMES, DEFAULT_THEME, SyntaxStyles, SyntaxTokenStyle, Theme, ThemeColors, ThemeDiff, ThemeSelect, ThemeSurfaces, resolveTheme } from "./theme/themes.js";
|
|
119
120
|
import { withoutTransitions } from "./theme/without-transitions.js";
|
|
120
|
-
export { ACCENT_PRESETS, AccentPreset, Accordion, AccordionItem, AccordionProps, AddressBar, AddressBarProps, Align, Anchor, Appearance, ApplyMotionOptions, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BadgeTone, BrandMark, BrandMarkData, BrandMarkPath, BrandMarkProps, BrandMarkSize, Breadcrumb, BreadcrumbProps, Breakdown, BreakdownPart, BreakdownProps, BreakdownSlice, BrowserSignIn, BrowserSignInProps, BrowserSignInState, ButtonVariant, CONFIRM_TITLE_ID, CONTRAST, Callout, CalloutProps, CalloutTone, CalloutVariant, Checkbox, CheckboxProps, Checklist, ChecklistGroup, ChecklistItem, ChecklistProps, ChecklistStatus, ChipColors, ChipKind, ChoiceCardOption, ChoiceCards, ChoiceCardsProps, CodeFrame, CodeFrameProps, CodeHighlightProvider, CodeHighlightProviderProps, CodeHighlighter, CodeHighlighterOptions, CodePanel, CodePanelProps, CodeWrapProvider, CodeWrapProviderProps, Compare, CompareProps, CompareRow, CompareVerdict, ConfirmDialog, ConfirmDialogProps, ConfirmOptions, CopyButton, CopyButtonProps, CopyValue, CopyValueProps, CountBadge, CountBadgeProps, CountTone, Crossfade, CrossfadeProps, CssVarMap, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DeltaProps, DeltaTone, DiffColors, DiffCounts, DiffCountsProps, DismissHandlers, DotColors, EditableTitle, EditableTitleProps, EditorEnvironment, EditorEnvironmentProvider, EditorEnvironmentProviderProps, EditorSettings, EmptyState, EmptyStateProps, ErrorBoundary, ErrorBoundaryProps, ErrorDetails, ErrorDetailsProps, ErrorFallback, ErrorFallbackFrameProps, ErrorFallbackProps, ErrorNote, ErrorNoteProps, ErrorReport, ErrorReportOptions, ErrorReportSink, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipLanding, FlipList, FlipListOptions, FlipMode, FlipSnapshot, FlipSnapshotProps, FloatingSurface, FloatingSurfaceProps, FormCard, FormCardProps, FormSection, FormSectionProps, Grow, GrowPresence, GrowProps, HOVER_MOTION, HeldWidth, HeldWidthProps, HighlightRequest, HighlightResponse, Highlighted, HighlightedCode, HighlightedCodeProps, HighlightedProps, HostRow, HostRowProps, HoverCard, HoverCardProps, HoverCardTriggerProps, HowItWorks, HowItWorksProps, HowItWorksStep, INPUT_CLASS, INSTANT, IconButton, IconButtonLook, IconButtonProps, IconButtonRenderProps, IconButtonSize, IconCollection, IconToggle, IconToggleProps, KeyCombo, KeyComboProps, KeyValue, KeyValueItem, KeyValueProps, Keycap, KeycapProps, KeyedStore, LabelOverrides, Labels, LabelsProvider, LabelsProviderProps, LayerOptions, LightboxItem, LoadError, LoadErrorProps, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MatchedTitleProps, MediaNav, type MediaNavProps, Menu, MenuNote, MenuNoteProps, MenuProps, MenuRow, MenuRowProps, MenuRowRenderProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSwitch, MenuSwitchProps, Meta, MetaChip, MetaChipProps, MetaProps, MotionLevel, MotionName, MotionPrefs, MotionProvider, MotionProviderProps, NavButton, NavButtonProps, NavRow, NavRowProps, Notice, NoticeProps, NoticeTone, NumberFormats, Oklch, OpLine, OpLineProps, Overlay, OverlayProps, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteEntry, PaletteIcon, PaletteIconProps, PaletteKeys, PaletteList, PaletteListProps, PaletteNotice, PaletteOption, PaletteOptionProps, PalettePanel, PalettePanelProps, PaletteRow, PaletteRowData, PaletteRowProps, PaletteSection, PanelEmpty, PanelEmptyProps, PanelLoading, PanelLoadingProps, PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, Placement, Popover, PopoverProps, PopoverState, PopoverTriggerProps, Presence, type Presence$1 as PresenceHandle, type PresenceOptions, PresenceProps, type PresenceState, PreviewWindow, PreviewWindowProps, Progress, ProgressProps, ProgressTone, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, RaisedProps, Rect, ReorderTabState, ReorderTabs, ReorderTabsProps, ResizeDrag, ResizeDragHandleProps, ResizeDragOptions, ResolvedPalette, Restricted, RestrictedProps, Rgb, RollDirection, RollingText, RollingTextProps, RowActionItem, RowActionsMenu, RowActionsMenuProps, RowBadge, RowBadgeProps, RowMenuButton, RowMenuButtonProps, RowText, RowTextProps, RuntimeIconsOptions, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SectionLabelProps, SegmentSpinner, SegmentSpinnerProps, Segmented, SegmentedOption, SegmentedProps, SegmentedRow, SegmentedRowProps, Side, Skeleton, SkeletonProps, SliderRow, SliderRowProps, SmoothHeight, SmoothHeightProps, SmoothWidth, SmoothWidthProps, SphereShading, Stat, StatProps, StatRow, StatRowProps, StatSize, StatTone, StepActions, StepActionsProps, StepFrame, StepFrameProps, StepStatus, Stepper, StepperProps, StepperStep, Steps, StepsItem, StepsProps, SurfaceLadder, SwapIcon, SwapIconProps, Swatch, SwatchPicker, SwatchPickerProps, Switch, SwitchGlyph, SwitchGlyphProps, SwitchProps, SwitchRow, SwitchRowProps, SyntaxStyles, SyntaxTokenStyle, TEXTAREA_CLASS, TabDragBounds, TabPill, TabPillProps, Table, TableCellValue, TableColumn, TableFilterBar, TableProps, TableSort, Tabs, TabsItem, TabsProps, Theme, ThemeColors, ThemeDiff, ThemeSeed, ThemeSelect, ThemeSurfaces, ThemeThumb, ThemeThumbProps, TitleText, TitleTextProps, ToggleCard, ToggleCardProps, ToggleSwitch, ToggleSwitchProps, Tooltip, type TooltipProps, Tray, TrayProps, UseFlipList, UseFlipListOptions, type UseTooltip, type UseTooltipOptions, WaapiTiming, ZidaneMark, ZidaneMarkProps, ZoomableImage, type ZoomableImageHandle, type ZoomableImageProps, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
|
|
121
|
+
export { ACCENT_PRESETS, AccentPreset, Accordion, AccordionItem, AccordionProps, AddressBar, AddressBarProps, Align, Anchor, Appearance, ApplyMotionOptions, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BadgeTone, BrandMark, BrandMarkData, BrandMarkPath, BrandMarkProps, BrandMarkSize, Breadcrumb, BreadcrumbProps, Breakdown, BreakdownPart, BreakdownProps, BreakdownSlice, BrowserSignIn, BrowserSignInProps, BrowserSignInState, ButtonVariant, CONFIRM_TITLE_ID, CONTRAST, Callout, CalloutProps, CalloutTone, CalloutVariant, Checkbox, CheckboxProps, Checklist, ChecklistGroup, ChecklistItem, ChecklistProps, ChecklistStatus, ChipColors, ChipKind, ChoiceCardOption, ChoiceCards, ChoiceCardsProps, CodeFrame, CodeFrameProps, CodeHighlightProvider, CodeHighlightProviderProps, CodeHighlighter, CodeHighlighterOptions, CodePanel, CodePanelProps, CodeWrapProvider, CodeWrapProviderProps, Compare, CompareProps, CompareRow, CompareVerdict, ConfirmDialog, ConfirmDialogProps, ConfirmOptions, CopyButton, CopyButtonProps, CopyValue, CopyValueProps, CountBadge, CountBadgeProps, CountTone, Crossfade, CrossfadeProps, CssVarMap, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DeltaProps, DeltaTone, DiffColors, DiffCounts, DiffCountsProps, DismissHandlers, DotColors, EditableTitle, EditableTitleProps, EditorEnvironment, EditorEnvironmentProvider, EditorEnvironmentProviderProps, EditorSettings, EmptyState, EmptyStateProps, ErrorBoundary, ErrorBoundaryProps, ErrorDetails, ErrorDetailsProps, ErrorFallback, ErrorFallbackFrameProps, ErrorFallbackProps, ErrorNote, ErrorNoteProps, ErrorReport, ErrorReportOptions, ErrorReportSink, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipLanding, FlipList, FlipListOptions, FlipMode, FlipPlan, FlipSnapshot, FlipSnapshotProps, FloatingSurface, FloatingSurfaceProps, FormCard, FormCardProps, FormSection, FormSectionProps, Grow, GrowPresence, GrowProps, HOVER_MOTION, HeldWidth, HeldWidthProps, HighlightRequest, HighlightResponse, Highlighted, HighlightedCode, HighlightedCodeProps, HighlightedProps, HostRow, HostRowProps, HoverCard, HoverCardProps, HoverCardTriggerProps, HowItWorks, HowItWorksProps, HowItWorksStep, INPUT_CLASS, INSTANT, IconButton, IconButtonLook, IconButtonProps, IconButtonRenderProps, IconButtonSize, IconCollection, IconToggle, IconToggleProps, KeyCombo, KeyComboProps, KeyValue, KeyValueItem, KeyValueProps, Keycap, KeycapProps, KeyedStore, LabelOverrides, Labels, LabelsProvider, LabelsProviderProps, LayerOptions, LightboxItem, LoadError, LoadErrorProps, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MatchedTitleProps, MediaNav, type MediaNavProps, Menu, MenuNote, MenuNoteProps, MenuProps, MenuRow, MenuRowProps, MenuRowRenderProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSwitch, MenuSwitchProps, Meta, MetaChip, MetaChipProps, MetaProps, MotionLevel, MotionName, MotionPrefs, MotionProvider, MotionProviderProps, NavButton, NavButtonProps, NavRow, NavRowProps, Notice, NoticeProps, NoticeTone, NumberFormats, Oklch, OpLine, OpLineProps, Overlay, OverlayProps, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteEntry, PaletteIcon, PaletteIconProps, PaletteKeys, PaletteList, PaletteListProps, PaletteNotice, PaletteOption, PaletteOptionProps, PalettePanel, PalettePanelProps, PaletteRow, PaletteRowData, PaletteRowProps, PaletteSection, PanelEmpty, PanelEmptyProps, PanelLoading, PanelLoadingProps, PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, Placement, Popover, PopoverProps, PopoverState, PopoverTriggerProps, Presence, type Presence$1 as PresenceHandle, type PresenceOptions, PresenceProps, type PresenceState, PreviewWindow, PreviewWindowProps, Progress, ProgressProps, ProgressTone, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, RaisedProps, Rect, ReorderTabState, ReorderTabs, ReorderTabsProps, ResizeDrag, ResizeDragHandleProps, ResizeDragOptions, ResolvedPalette, Restricted, RestrictedProps, Rgb, RollDirection, RollingText, RollingTextProps, RowActionItem, RowActionsMenu, RowActionsMenuProps, RowBadge, RowBadgeProps, RowMenuButton, RowMenuButtonProps, RowText, RowTextProps, RuntimeIconsOptions, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SectionLabelProps, SegmentSpinner, SegmentSpinnerProps, Segmented, SegmentedOption, SegmentedProps, SegmentedRow, SegmentedRowProps, Side, Skeleton, SkeletonProps, SliderRow, SliderRowProps, SmoothHeight, SmoothHeightProps, SmoothWidth, SmoothWidthProps, SphereShading, Stat, StatProps, StatRow, StatRowProps, StatSize, StatTone, StepActions, StepActionsProps, StepFrame, StepFrameProps, StepStatus, Stepper, StepperProps, StepperStep, Steps, StepsItem, StepsProps, SurfaceLadder, SwapIcon, SwapIconProps, Swatch, SwatchPicker, SwatchPickerProps, Switch, SwitchGlyph, SwitchGlyphProps, SwitchProps, SwitchRow, SwitchRowProps, SyntaxStyles, SyntaxTokenStyle, TEXTAREA_CLASS, TabDragBounds, TabPill, TabPillProps, Table, TableCellValue, TableColumn, TableFilterBar, TableProps, TableSort, Tabs, TabsItem, TabsProps, Theme, ThemeColors, ThemeDiff, ThemeSeed, ThemeSelect, ThemeSurfaces, ThemeThumb, ThemeThumbProps, TitleText, TitleTextProps, ToggleCard, ToggleCardProps, ToggleSwitch, ToggleSwitchProps, Tooltip, type TooltipProps, Tray, TrayProps, UseFlipList, UseFlipListOptions, type UseTooltip, type UseTooltipOptions, WaapiTiming, ZidaneMark, ZidaneMarkProps, ZoomableImage, type ZoomableImageHandle, type ZoomableImageProps, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLatest, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,7 @@ import { ZidaneMark } from "./components/ZidaneMark.js";
|
|
|
73
73
|
import { ZoomableImage } from "./components/ZoomableImage.js";
|
|
74
74
|
import { createKeyedStore, useKeyedValue } from "./hooks/keyed-store.js";
|
|
75
75
|
import { PathDisplayProvider, PathDisplayScope, useDisplayPath } from "./hooks/useDisplayPath.js";
|
|
76
|
+
import { useLatest } from "./hooks/useLatest.js";
|
|
76
77
|
import { useMinuteTick } from "./hooks/useMinuteTick.js";
|
|
77
78
|
import { scrollRootOf, useNearViewport } from "./hooks/useNearViewport.js";
|
|
78
79
|
import { oneOf, parseBoolean, readPersisted, usePersistedState, writePersisted } from "./hooks/usePersistedState.js";
|
|
@@ -104,4 +105,4 @@ import { watchRuntimeIcons } from "./theme/runtime-icons.js";
|
|
|
104
105
|
import { themeCssVars, themeStylesheet } from "./theme/stylesheet.js";
|
|
105
106
|
import { BUILTIN_THEMES, DEFAULT_THEME, resolveTheme } from "./theme/themes.js";
|
|
106
107
|
import { withoutTransitions } from "./theme/without-transitions.js";
|
|
107
|
-
export { ACCENT_PRESETS, Accordion, AddressBar, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BrandMark, Breadcrumb, Breakdown, BrowserSignIn, CONFIRM_TITLE_ID, CONTRAST, Callout, Checkbox, Checklist, ChoiceCards, CodeFrame, CodeHighlightProvider, CodePanel, CodeWrapProvider, Compare, ConfirmDialog, CopyButton, CopyValue, CountBadge, Crossfade, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DiffCounts, EditableTitle, EditorEnvironmentProvider, EmptyState, ErrorBoundary, ErrorDetails, ErrorFallback, ErrorNote, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipSnapshot, FloatingSurface, FormCard, FormSection, Grow, GrowPresence, HOVER_MOTION, HeldWidth, Highlighted, HighlightedCode, HostRow, HoverCard, HowItWorks, INPUT_CLASS, INSTANT, IconButton, IconToggle, KeyCombo, KeyValue, Keycap, LabelsProvider, LoadError, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MediaNav, Menu, MenuNote, MenuRow, MenuSection, MenuSeparator, MenuSwitch, Meta, MetaChip, MotionProvider, NavButton, NavRow, Notice, OpLine, Overlay, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteIcon, PaletteList, PaletteOption, PalettePanel, PaletteRow, PanelEmpty, PanelLoading, PathDisplayProvider, PathDisplayScope, Popover, Presence, PreviewWindow, Progress, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, ReorderTabs, Restricted, RollingText, RowActionsMenu, RowBadge, RowMenuButton, RowText, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SegmentSpinner, Segmented, SegmentedRow, Skeleton, SliderRow, SmoothHeight, SmoothWidth, Stat, StatRow, StepActions, StepFrame, Stepper, Steps, SwapIcon, SwatchPicker, Switch, SwitchGlyph, SwitchRow, TEXTAREA_CLASS, TabPill, Table, Tabs, ThemeThumb, TitleText, ToggleCard, ToggleSwitch, Tooltip, Tray, ZidaneMark, ZoomableImage, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
|
|
108
|
+
export { ACCENT_PRESETS, Accordion, AddressBar, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BrandMark, Breadcrumb, Breakdown, BrowserSignIn, CONFIRM_TITLE_ID, CONTRAST, Callout, Checkbox, Checklist, ChoiceCards, CodeFrame, CodeHighlightProvider, CodePanel, CodeWrapProvider, Compare, ConfirmDialog, CopyButton, CopyValue, CountBadge, Crossfade, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DiffCounts, EditableTitle, EditorEnvironmentProvider, EmptyState, ErrorBoundary, ErrorDetails, ErrorFallback, ErrorNote, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipSnapshot, FloatingSurface, FormCard, FormSection, Grow, GrowPresence, HOVER_MOTION, HeldWidth, Highlighted, HighlightedCode, HostRow, HoverCard, HowItWorks, INPUT_CLASS, INSTANT, IconButton, IconToggle, KeyCombo, KeyValue, Keycap, LabelsProvider, LoadError, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MediaNav, Menu, MenuNote, MenuRow, MenuSection, MenuSeparator, MenuSwitch, Meta, MetaChip, MotionProvider, NavButton, NavRow, Notice, OpLine, Overlay, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteIcon, PaletteList, PaletteOption, PalettePanel, PaletteRow, PanelEmpty, PanelLoading, PathDisplayProvider, PathDisplayScope, Popover, Presence, PreviewWindow, Progress, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, ReorderTabs, Restricted, RollingText, RowActionsMenu, RowBadge, RowMenuButton, RowText, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SegmentSpinner, Segmented, SegmentedRow, Skeleton, SliderRow, SmoothHeight, SmoothWidth, Stat, StatRow, StepActions, StepFrame, Stepper, Steps, SwapIcon, SwatchPicker, Switch, SwitchGlyph, SwitchRow, TEXTAREA_CLASS, TabPill, Table, Tabs, ThemeThumb, TitleText, ToggleCard, ToggleSwitch, Tooltip, Tray, ZidaneMark, ZoomableImage, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLatest, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
|
|
@@ -4,7 +4,7 @@ import { bindingAllowedIn, keyScopeOf } from "./headless/key-scope.js";
|
|
|
4
4
|
import { getMergedKeybindings } from "./headless/overrides.js";
|
|
5
5
|
import { loadOnce } from "./load-once.js";
|
|
6
6
|
import { matchesBinding } from "./match.js";
|
|
7
|
-
import { createContext, startTransition, useContext, useEffect, useMemo, useReducer,
|
|
7
|
+
import { createContext, startTransition, useContext, useEffect, useEffectEvent, useMemo, useReducer, useSyncExternalStore } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { parseBindingSpecs } from "zidane/chat/pure";
|
|
10
10
|
// src/keybindings/KeybindingsProvider.tsx
|
|
@@ -65,8 +65,7 @@ function runKeyHandler(action, handler) {
|
|
|
65
65
|
function useKeybindings(handlers) {
|
|
66
66
|
const host = useKeybindingsHost();
|
|
67
67
|
const [tick, bump] = useReducer((n) => n + 1, 0);
|
|
68
|
-
const
|
|
69
|
-
handlersRef.current = handlers;
|
|
68
|
+
const handlerOf = useEffectEvent((action) => handlers[action]);
|
|
70
69
|
const actionsKey = Object.keys(handlers).join(" ");
|
|
71
70
|
useEffect(() => {
|
|
72
71
|
loadOnce(host);
|
|
@@ -76,7 +75,7 @@ function useKeybindings(handlers) {
|
|
|
76
75
|
unsubscribe();
|
|
77
76
|
};
|
|
78
77
|
}, [host]);
|
|
79
|
-
useEffect(() => bindKeyListeners(actionsKey ? actionsKey.split(" ") : [], getMergedKeybindings(host), (action) =>
|
|
78
|
+
useEffect(() => bindKeyListeners(actionsKey ? actionsKey.split(" ") : [], getMergedKeybindings(host), (action) => handlerOf(action)), [
|
|
80
79
|
actionsKey,
|
|
81
80
|
tick,
|
|
82
81
|
host
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { ParsedBinding, bindingAlternatives, parseBindingSpec, parseBindingSpecs } from "zidane/chat/pure";
|
|
13
13
|
/** Every action a key binding can fire. */
|
|
14
|
-
export type KeyAction = 'openSettings' | 'openSessionDetails' | 'openModelPicker' | 'openEffortPicker' | 'openTodos' | 'openArtifacts' | 'openMainSession' | 'openUsagePanel' | 'newSession' | 'openKeybindings' | 'openPalette' | 'cancelToolCall' | 'cycleAgent' | 'enterSelectTurnMode' | 'previousPrompt' | 'nextPrompt' | 'toggleSidebar' | 'navigateBack' | 'navigateForward' | 'sessionGenerateTitle' | 'sessionCompact' | 'sessionExportMarkdown' | 'sessionExportJson' | 'sessionDelete' | 'sessionCopyId' | 'sessionFavorite' | 'zoomIn' | 'zoomOut' | 'zoomReset' | 'panelNext' | 'panelPrev' | 'tabNext' | 'tabPrev' | 'closeTab' | 'toggleTerminal' | 'newTerminal' | 'annotatePage' | 'splitTabRight' | 'splitTabDown';
|
|
14
|
+
export type KeyAction = 'openSettings' | 'openSessionDetails' | 'openModelPicker' | 'openEffortPicker' | 'openTodos' | 'openArtifacts' | 'openMainSession' | 'openUsagePanel' | 'newSession' | 'openKeybindings' | 'openPalette' | 'cancelToolCall' | 'cycleAgent' | 'enterSelectTurnMode' | 'previousPrompt' | 'nextPrompt' | 'toggleSidebar' | 'navigateBack' | 'navigateForward' | 'sessionGenerateTitle' | 'sessionCompact' | 'sessionExportMarkdown' | 'sessionExportJson' | 'sessionDelete' | 'sessionCopyId' | 'sessionFavorite' | 'sessionMove' | 'sessionShare' | 'openSessions' | 'zoomIn' | 'zoomOut' | 'zoomReset' | 'panelNext' | 'panelPrev' | 'tabNext' | 'tabPrev' | 'closeTab' | 'toggleTerminal' | 'newTerminal' | 'annotatePage' | 'splitTabRight' | 'splitTabDown';
|
|
15
15
|
/** One action of the catalog. */
|
|
16
16
|
export interface KeyBindingDef {
|
|
17
17
|
/** The action. */
|
|
@@ -171,6 +171,24 @@ const KEYBINDING_DEFS = [
|
|
|
171
171
|
label: "favorite",
|
|
172
172
|
description: "add the session to favorites, or remove it"
|
|
173
173
|
},
|
|
174
|
+
{
|
|
175
|
+
action: "sessionMove",
|
|
176
|
+
default: "",
|
|
177
|
+
label: "move to",
|
|
178
|
+
description: "move the session to another host, machine or sandbox (teleport)"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
action: "sessionShare",
|
|
182
|
+
default: "",
|
|
183
|
+
label: "share",
|
|
184
|
+
description: "share the session with people of your organization"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
action: "openSessions",
|
|
188
|
+
default: "",
|
|
189
|
+
label: "open sessions",
|
|
190
|
+
description: "the sessions open to join on your organization's servers"
|
|
191
|
+
},
|
|
174
192
|
{
|
|
175
193
|
action: "panelNext",
|
|
176
194
|
default: "ctrl+shift+]",
|