@exagone313/dsh-podman 1.7.0 → 1.8.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.
Files changed (117) hide show
  1. package/cordis.patch.yml +3 -1
  2. package/dist/approval-reasons.d.ts +37 -0
  3. package/dist/approval-reasons.js +128 -0
  4. package/dist/approval-template-summary.d.ts +8 -0
  5. package/dist/approval-template-summary.js +163 -0
  6. package/dist/approval.d.ts +8 -4
  7. package/dist/approval.js +104 -10
  8. package/dist/client/ContainerCard.js +8 -2
  9. package/dist/client/container-card-controller.d.ts +13 -5
  10. package/dist/client/container-card-controller.js +60 -24
  11. package/dist/client/container-card-create-config.d.ts +23 -0
  12. package/dist/client/container-card-create-config.js +48 -0
  13. package/dist/client/container-card-create-modal.d.ts +9 -1
  14. package/dist/client/container-card-create-modal.js +37 -41
  15. package/dist/client/container-card-create-volume.d.ts +10 -0
  16. package/dist/client/container-card-create-volume.js +34 -0
  17. package/dist/client/container-card-dialog-styles.d.ts +4 -2
  18. package/dist/client/container-card-dialog-styles.js +47 -4
  19. package/dist/client/container-card-edit-modal.d.ts +5 -1
  20. package/dist/client/container-card-edit-modal.js +55 -19
  21. package/dist/client/container-card-editors.d.ts +9 -0
  22. package/dist/client/container-card-editors.js +300 -43
  23. package/dist/client/container-card-form.d.ts +2 -1
  24. package/dist/client/container-card-form.js +26 -8
  25. package/dist/client/container-card-images.js +9 -31
  26. package/dist/client/container-card-mount-actions.d.ts +12 -0
  27. package/dist/client/container-card-mount-actions.js +35 -0
  28. package/dist/client/container-card-mount-sources.d.ts +34 -0
  29. package/dist/client/container-card-mount-sources.js +180 -0
  30. package/dist/client/container-card-names.d.ts +2 -0
  31. package/dist/client/container-card-names.js +12 -0
  32. package/dist/client/container-card-row.d.ts +16 -1
  33. package/dist/client/container-card-row.js +69 -25
  34. package/dist/client/container-card-secrets.d.ts +2 -0
  35. package/dist/client/container-card-secrets.js +60 -17
  36. package/dist/client/container-card-shared.d.ts +17 -9
  37. package/dist/client/container-card-shared.js +122 -93
  38. package/dist/client/container-card-styles.d.ts +6 -0
  39. package/dist/client/container-card-styles.js +22 -0
  40. package/dist/client/container-card-table-styles.d.ts +2 -1
  41. package/dist/client/container-card-table-styles.js +14 -0
  42. package/dist/client/container-card-templates.d.ts +81 -0
  43. package/dist/client/container-card-templates.js +1004 -0
  44. package/dist/client/container-card-toast.js +1 -1
  45. package/dist/client/container-card-volumes.js +6 -20
  46. package/dist/client/container-card-workspace.d.ts +10 -2
  47. package/dist/client/container-card-workspace.js +98 -5
  48. package/dist/client/container-template-ui.d.ts +163 -0
  49. package/dist/client/container-template-ui.js +579 -0
  50. package/dist/client/download.d.ts +1 -0
  51. package/dist/client/download.js +23 -0
  52. package/dist/client/image-facts.d.ts +18 -0
  53. package/dist/client/image-facts.js +44 -0
  54. package/dist/client/index.js +13478 -3438
  55. package/dist/client/locales.d.ts +1 -1
  56. package/dist/client/locales.js +120 -0
  57. package/dist/client/podman-containers.js +47 -18
  58. package/dist/client/podman-terminal-guide.js +4 -2
  59. package/dist/client/podman-terminal.js +4 -2
  60. package/dist/client/template-client.d.ts +9 -0
  61. package/dist/client/template-client.js +52 -0
  62. package/dist/client/template-protocol.d.ts +60 -0
  63. package/dist/client/template-protocol.js +4 -0
  64. package/dist/client/terminal-errors.d.ts +11 -0
  65. package/dist/client/terminal-errors.js +26 -0
  66. package/dist/client/terminal-protocol.d.ts +5 -0
  67. package/dist/client/terminal-protocol.js +5 -0
  68. package/dist/client/terminal-styles.d.ts +2 -1
  69. package/dist/client/terminal-styles.js +9 -1
  70. package/dist/client/terminal-transport.d.ts +17 -2
  71. package/dist/client/terminal-transport.js +31 -8
  72. package/dist/client/tool-presentations.d.ts +32 -0
  73. package/dist/client/tool-presentations.js +33 -0
  74. package/dist/client/tool-views.js +17 -7
  75. package/dist/client/workspace-target.d.ts +54 -0
  76. package/dist/client/workspace-target.js +86 -0
  77. package/dist/container-template.d.ts +153 -0
  78. package/dist/container-template.js +1058 -0
  79. package/dist/generated/version.d.ts +2 -2
  80. package/dist/generated/version.js +2 -2
  81. package/dist/grpc/proto/dshguest/v1/guest.proto +11 -0
  82. package/dist/guest-rpc.d.ts +1 -0
  83. package/dist/guest-rpc.js +12 -0
  84. package/dist/index.js +7 -1
  85. package/dist/mount-enums.d.ts +2 -0
  86. package/dist/mount-enums.js +17 -0
  87. package/dist/mount-order.d.ts +14 -0
  88. package/dist/mount-order.js +49 -0
  89. package/dist/project-path.d.ts +14 -0
  90. package/dist/project-path.js +25 -0
  91. package/dist/template-apply.d.ts +21 -0
  92. package/dist/template-apply.js +102 -0
  93. package/dist/template-files.d.ts +23 -0
  94. package/dist/template-files.js +186 -0
  95. package/dist/template-image.d.ts +22 -0
  96. package/dist/template-image.js +80 -0
  97. package/dist/template-route.d.ts +9 -0
  98. package/dist/template-route.js +278 -0
  99. package/dist/terminal-route.js +49 -7
  100. package/dist/tool-defs.js +27 -1
  101. package/dist/tool-handlers.js +69 -1
  102. package/dist/tool-params.d.ts +38 -0
  103. package/dist/tool-params.js +30 -0
  104. package/docs/README.md +4 -3
  105. package/docs/architecture.md +42 -12
  106. package/docs/architecture.zh.md +22 -8
  107. package/docs/configuration.md +19 -20
  108. package/docs/configuration.zh.md +3 -4
  109. package/docs/development-prompt.md +49 -45
  110. package/docs/development-prompt.zh.md +47 -43
  111. package/docs/development.md +45 -28
  112. package/docs/development.zh.md +59 -46
  113. package/docs/uninstall.md +3 -3
  114. package/docs/uninstall.zh.md +2 -2
  115. package/docs/usage.md +155 -23
  116. package/docs/usage.zh.md +104 -14
  117. package/package.json +6 -5
@@ -9,9 +9,10 @@ import { scopedActionKey } from "./card-protocol.js";
9
9
  import { cardList, cardRow, greyId, hint, imageSelect, rowActions, rowDivider, rowMain, rowName, } from "./container-card-styles.js";
10
10
  import { ROW_LIST_CLASS } from "./container-card-table-styles.js";
11
11
  import { COMPACT_DIALOG_CLASS } from "./container-card-dialog-styles.js";
12
+ import { missingSecretNames } from "./container-template-ui.js";
12
13
  import { conflictingEnvNames, emptyEnvRow, envEditRows, envRecordFromRows, firstDuplicateEnvName, } from "../env-rows.js";
13
14
  import { Button, Input, Modal } from "@deepseek-ai/dsh-client-ui-primitives";
14
- import { useEffect, useId, useMemo, useRef, useState, } from "react";
15
+ import { useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
15
16
  // One secret row: its name and the two actions that act on it — Edit, which
16
17
  // opens the one secret form on this secret's write-only value, then the
17
18
  // confirm-gated Remove. The value itself never leaves the browser.
@@ -34,7 +35,7 @@ export function SecretRow(props) {
34
35
  // that was created (to list it, or to select it in its own picker) or the value
35
36
  // that was applied.
36
37
  export function SecretModal(props) {
37
- const { t, mode, name, open, busy, writable, onCreate, onSet, onClose, } = props;
38
+ const { t, mode, name, initialName, open, busy, writable, onCreate, onSet, onClose, } = props;
38
39
  const [newName, setNewName] = useState("");
39
40
  const [length, setLength] = useState("32");
40
41
  const [charset, setCharset] = useState("alphanumeric");
@@ -57,11 +58,11 @@ export function SecretModal(props) {
57
58
  useEffect(() => {
58
59
  if (!open)
59
60
  return;
60
- setNewName("");
61
+ setNewName(editing ? "" : (initialName ?? ""));
61
62
  setLength("32");
62
63
  setCharset("alphanumeric");
63
64
  setValue("");
64
- }, [open]);
65
+ }, [open, editing, initialName]);
65
66
  const submit = () => {
66
67
  if (editing) {
67
68
  if (value === "" || name === undefined)
@@ -102,7 +103,7 @@ export function SecretModal(props) {
102
103
  // own, and selects the new secret as soon as the snapshot lists it, so the
103
104
  // caller's draft is never disturbed.
104
105
  export function SecretEnvEditor(props) {
105
- const { t, secretEnv, secrets, busy, enabled, writable, onCreateSecret, onChange, onBlockingError, otherNames, onNames, } = props;
106
+ const { t, secretEnv, secrets, busy, enabled, writable, onCreateSecret, onChange, onBlockingError, otherNames, onNames, rowError, } = props;
106
107
  // The rows are the editor's own: a row keeps its place while its name is
107
108
  // retyped, so clearing a key never drops the row — it stays, red, until its
108
109
  // own Remove — and renaming one onto a name another row already holds keeps
@@ -116,6 +117,10 @@ export function SecretEnvEditor(props) {
116
117
  setRows(envEditRows(secretEnv));
117
118
  }
118
119
  const [createOpen, setCreateOpen] = useState(false);
120
+ // The name the create form opens on: a missing requirement's own name, or
121
+ // empty for the generic Create secret button.
122
+ const [createName, setCreateName] = useState("");
123
+ const missingSecrets = missingSecretNames(secretEnv, secrets);
119
124
  const [pendingSecret, setPendingSecret] = useState("");
120
125
  // The row the user appended, where a newly created secret is selected; it is
121
126
  // kept while that row exists, so the secret lands where the user was working.
@@ -154,24 +159,62 @@ export function SecretEnvEditor(props) {
154
159
  useEffect(() => {
155
160
  onNames?.(names);
156
161
  }, [names, onNames]);
157
- const update = (next) => {
162
+ // The rows are memoized, so their callbacks keep one identity while the list
163
+ // holds the same row ids. Each one reads the latest rows and handler through a
164
+ // ref, so typing in one row re-renders that row alone.
165
+ const onChangeRef = useRef(onChange);
166
+ onChangeRef.current = onChange;
167
+ const writeRows = useCallback((next) => {
158
168
  setRows(next);
159
- onChange(envRecordFromRows(next));
160
- };
169
+ onChangeRef.current(envRecordFromRows(next));
170
+ }, []);
171
+ const updateRowAt = useCallback((id, patch) => {
172
+ writeRows(rowsRef.current.map((row) => row.id === id ? { ...row, ...patch } : row));
173
+ }, [writeRows]);
174
+ const removeRowAt = useCallback((id) => {
175
+ setDraftRowId((previous) => previous === id ? undefined : previous);
176
+ writeRows(rowsRef.current.filter((row) => row.id !== id));
177
+ }, [writeRows]);
178
+ // Opens the create form on the secret the row still names, so a template's
179
+ // missing requirement can be satisfied in place.
180
+ const openCreateFor = useCallback((id) => {
181
+ const row = rowsRef.current.find((candidate) => candidate.id === id);
182
+ if (row === undefined || row.value === "")
183
+ return;
184
+ setDraftRowId(id);
185
+ setCreateName(row.value);
186
+ setCreateOpen(true);
187
+ }, []);
188
+ const rowIds = rows.map((row) => row.id).join(",");
189
+ const rowCallbacks = useMemo(() => {
190
+ const callbacks = new Map();
191
+ for (const row of rowsRef.current) {
192
+ const id = row.id;
193
+ callbacks.set(id, {
194
+ changeName: (name) => updateRowAt(id, { key: name }),
195
+ changeSecret: (secret) => updateRowAt(id, { value: secret }),
196
+ remove: () => removeRowAt(id),
197
+ createSecret: () => openCreateFor(id),
198
+ });
199
+ }
200
+ return callbacks;
201
+ }, [rowIds, updateRowAt, removeRowAt, openCreateFor]);
202
+ const update = (next) => writeRows(next);
161
203
  const addRow = () => {
162
204
  const row = { ...emptyEnvRow(), value: secrets[0]?.name ?? "" };
163
205
  setDraftRowId(row.id);
164
206
  update([...rows, row]);
165
207
  };
166
- const updateRow = (id, patch) => {
167
- update(rows.map((row) => (row.id === id ? { ...row, ...patch } : row)));
168
- };
169
- const removeRow = (id) => {
170
- if (id === draftRowId)
171
- setDraftRowId(undefined);
172
- update(rows.filter((row) => row.id !== id));
173
- };
174
- return (_jsxs("div", { className: ROW_LIST_CLASS, style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [rows.map((row) => (_jsx(SecretEnvRow, { t: t, mode: "edit", name: row.key, secret: row.value, secrets: secrets, disabled: !enabled, autoFocus: row.id === draftRowId, keyInvalid: conflicts.has(row.key), onChangeName: (name) => updateRow(row.id, { key: name }), onChangeSecret: (secret) => updateRow(row.id, { value: secret }), onRemove: () => removeRow(row.id) }, row.id))), secrets.length === 0 ? null : (_jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !enabled, onClick: addRow, children: t("addSecretEnv") }) })), _jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !writable || busy, onClick: () => setCreateOpen(true), children: t("createSecret") }) }), _jsx(SecretModal, { t: t, mode: "create", open: createOpen, busy: busy, writable: writable, onCreate: (name, length, charset) => {
208
+ return (_jsxs("div", { className: ROW_LIST_CLASS, style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [rows.map((row) => {
209
+ const callbacks = rowCallbacks.get(row.id);
210
+ return (_jsx(SecretEnvRow, { t: t, mode: "edit", name: row.key, secret: row.value, secrets: secrets, disabled: !enabled, autoFocus: row.id === draftRowId, keyInvalid: conflicts.has(row.key), error: rowError?.(row.key, row.value), onChangeName: callbacks?.changeName, onChangeSecret: callbacks?.changeSecret, onRemove: callbacks?.remove, onCreateSecret: row.value !== "" &&
211
+ missingSecrets.includes(row.value)
212
+ ? callbacks?.createSecret
213
+ : undefined }, row.id));
214
+ }), secrets.length === 0 ? null : (_jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !enabled, onClick: addRow, children: t("addSecretEnv") }) })), _jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !writable || busy, onClick: () => {
215
+ setCreateName("");
216
+ setCreateOpen(true);
217
+ }, children: t("createSecret") }) }), _jsx(SecretModal, { t: t, mode: "create", initialName: createName, open: createOpen, busy: busy, writable: writable, onCreate: (name, length, charset) => {
175
218
  setPendingSecret(name);
176
219
  onCreateSecret(name, length, charset);
177
220
  }, onClose: () => setCreateOpen(false) })] }));
@@ -29,7 +29,7 @@ export declare function CopyButton(props: {
29
29
  value: string;
30
30
  label: string;
31
31
  }): ReactNode;
32
- export declare const namePattern: RegExp;
32
+ export { namePattern } from "./container-card-names.js";
33
33
  export declare const imageIdPattern: RegExp;
34
34
  export type StatusTone = "ok" | "warn" | "error" | "business" | "violet" | "muted";
35
35
  export declare function StatusChip(props: {
@@ -84,7 +84,7 @@ export declare function EnvRow(props: {
84
84
  removeLabel?: string;
85
85
  keyInvalid?: boolean;
86
86
  }): ReactNode;
87
- export declare function MountRow(props: {
87
+ export declare const MountRow: import("react").MemoExoticComponent<(props: {
88
88
  t: Translate;
89
89
  mode: RowMode;
90
90
  mount: MountInput;
@@ -100,10 +100,19 @@ export declare function MountRow(props: {
100
100
  onUpdate?: (patch: Partial<MountInput>) => void;
101
101
  onBrowse?: () => void;
102
102
  browseError?: string;
103
+ onProjectBrowse?: () => void;
104
+ projectBrowseLabel?: string;
105
+ error?: string;
106
+ onProjectBlur?: () => void;
107
+ writable?: boolean;
108
+ busy?: boolean;
109
+ onCreateVolume?: (name: string) => Promise<boolean>;
110
+ onCreateSecret?: (name: string, length?: number, charset?: string) => Promise<boolean>;
103
111
  onRemove?: () => void;
104
112
  confirmRemove?: boolean;
105
113
  removeDisabledReason?: string;
106
- }): ReactNode;
114
+ projectPathLocked?: boolean;
115
+ }) => ReactNode>;
107
116
  export declare function PathRow(props: {
108
117
  t: Translate;
109
118
  mode: RowMode;
@@ -118,7 +127,7 @@ export declare function PathRow(props: {
118
127
  onDragStart?: () => void;
119
128
  onDrop?: () => void;
120
129
  }): ReactNode;
121
- export declare function SecretEnvRow(props: {
130
+ export declare const SecretEnvRow: import("react").MemoExoticComponent<(props: {
122
131
  t: Translate;
123
132
  mode: RowMode;
124
133
  name: string;
@@ -131,8 +140,10 @@ export declare function SecretEnvRow(props: {
131
140
  onChangeName?: (name: string) => void;
132
141
  onChangeSecret?: (secret: string) => void;
133
142
  onRemove?: () => void;
143
+ onCreateSecret?: () => void;
134
144
  keyInvalid?: boolean;
135
- }): ReactNode;
145
+ error?: string;
146
+ }) => ReactNode>;
136
147
  export declare function PortRow(props: {
137
148
  t: Translate;
138
149
  mode: RowMode;
@@ -164,10 +175,7 @@ export declare const mountSourceName: (mount: MountInput) => string;
164
175
  export declare const mountHasSource: (kind: string) => boolean;
165
176
  export declare const mountHasMode: (kind: string) => boolean;
166
177
  export declare const mountViewToInput: (mount: ProjectMountView) => MountInput;
167
- export declare function orderedMounts(mounts: readonly MountInput[], mainProject: string): {
168
- mount: MountInput;
169
- index: number;
170
- }[];
178
+ export declare function mountDestination(mount: MountInput, projectsRoot: string): string;
171
179
  export declare const mountLabel: (t: (key: ContainerPluginKey) => string, mount: MountInput, withMode?: boolean) => string;
172
180
  export declare function containerStatusLabel(t: Translate, status: string): string;
173
181
  export declare function imageStatusLabel(t: Translate, status: string): string;
@@ -2,12 +2,15 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
3
  //
4
4
  // SPDX-License-Identifier: MIT
5
- import { destructiveAction, editorGroup, emphasisAction, envField, envFieldLabel, envRow, fieldHint, fieldLine, hint, imageSelect, mountField, mountKindField, rowActions, sectionTitle, slotSelect, statusChip, } from "./container-card-styles.js";
5
+ import { destructiveAction, editorGroup, emphasisAction, envField, envFieldLabel, envRow, fieldHint, fieldLine, hint, imageSelect, mountField, mountKindField, rowActions, sectionTitle, slotSelect, statusChip, violetTone, } from "./container-card-styles.js";
6
6
  import { FIELD_CLASS, SLOT_CLASS, SLOT_INVALID_CLASS, } from "./container-card-field-styles.js";
7
- import { MOUNT_ACTIONS_CLASS, MOUNT_DESTINATION_CLASS, MOUNT_FIELD_CLASS, MOUNT_KIND_CLASS, MOUNT_KIND_VALUE_CLASS, MOUNT_ROW_CLASS, } from "./container-card-table-styles.js";
7
+ import { MOUNT_ACTIONS_CLASS, MOUNT_DESTINATION_CLASS, MOUNT_ERROR_CLASS, MOUNT_FIELD_CLASS, MOUNT_KIND_CLASS, MOUNT_KIND_VALUE_CLASS, MOUNT_ROW_CLASS, } from "./container-card-table-styles.js";
8
8
  import { normalizeMountKind, normalizeMountMode } from "../mount-enums.js";
9
+ import { hostPathForProjectName } from "../project-path.js";
10
+ import { createdMountSource, mountRowBrowseDisabled, mountRowBrowseOffered, mountSourceOptions, revertCreatedMountSource, } from "./container-card-mount-sources.js";
11
+ import { MountSourceActions } from "./container-card-mount-actions.js";
9
12
  import { Button, IconCheckOutlineRegular, IconCopyOutlineRegular, Input, Modal, writeClipboard, } from "@deepseek-ai/dsh-client-ui-primitives";
10
- import { useEffect, useId, useRef, useState } from "react";
13
+ import { memo, useEffect, useId, useRef, useState, } from "react";
11
14
  // Localized cardinal count: the singular key renders only at exactly one, so
12
15
  // both languages can word the count their own way.
13
16
  export function countLabel(t, n, one, many) {
@@ -70,11 +73,11 @@ export function CopyButton(props) {
70
73
  const name = copied ? t("copied") : label;
71
74
  return (_jsx(Button, { variant: "ghost", size: "sm", icon: copied ? _jsx(IconCheckOutlineRegular, {}) : _jsx(IconCopyOutlineRegular, {}), "aria-label": name, disabled: value === "", onClick: copy }));
72
75
  }
73
- export const namePattern = /^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,63}$/;
76
+ export { namePattern } from "./container-card-names.js";
74
77
  export const imageIdPattern = /^[a-zA-Z0-9_][a-zA-Z0-9_.\-/:]{0,127}$/;
75
78
  // Each tone's foreground and fill come from the design system's state palette.
76
79
  // No error- or business-tertiary fill exists, so those tones tint their own
77
- // primary; violet has no token at all, so it tints its own literal.
80
+ // primary; violet has no token at all, so it reads the shared violet literal.
78
81
  const STATUS_TONES = {
79
82
  ok: {
80
83
  color: "var(--dsw-alias-state-success-primary)",
@@ -92,10 +95,7 @@ const STATUS_TONES = {
92
95
  color: "var(--dsw-alias-state-business-primary)",
93
96
  background: "color-mix(in srgb, var(--dsw-alias-state-business-primary) 12%, transparent)",
94
97
  },
95
- violet: {
96
- color: "#a78bfa",
97
- background: "color-mix(in srgb, #a78bfa 12%, transparent)",
98
- },
98
+ violet: violetTone,
99
99
  muted: {
100
100
  color: "var(--dsw-alias-label-tertiary)",
101
101
  background: "var(--dsw-alias-bg-layer-3)",
@@ -131,10 +131,9 @@ export function MountKindField(props) {
131
131
  // copy control in the container block, an editable control in an editor — with
132
132
  // the label naming that control through its id.
133
133
  export function FieldSlot(props) {
134
- const { className } = props;
135
- return (_jsxs("div", { className: className === undefined
134
+ return (_jsxs("div", { className: props.className === undefined
136
135
  ? MOUNT_FIELD_CLASS
137
- : `${MOUNT_FIELD_CLASS} ${className}`, style: mountField, children: [_jsx("label", { htmlFor: props.htmlFor, style: envFieldLabel, children: props.label }), props.children] }));
136
+ : `${MOUNT_FIELD_CLASS} ${props.className}`, style: mountField, children: [_jsx("label", { htmlFor: props.htmlFor, style: envFieldLabel, children: props.label }), props.children] }));
138
137
  }
139
138
  // The canonical field row the container block, the Mounts editor and the three
140
139
  // other editors all render through: an optional leading Kind slot, the labelled
@@ -217,32 +216,26 @@ const mountModeLabel = (t, mode) => normalizeMountMode(mode) === "read_only" ? t
217
216
  // the text field beside it, so switching a mount's kind never resizes the row.
218
217
  function MountSourceControl(props) {
219
218
  const { t, id, kind, disabled } = props;
219
+ const projectLocked = props.projectPathLocked === true;
220
220
  const normalized = normalizeMountKind(kind);
221
221
  if (normalized === "volume") {
222
222
  // A volume the snapshot no longer lists stays selectable rather than being
223
223
  // silently replaced by the first candidate.
224
- const missing = props.volume !== "" &&
225
- !props.volumes.some((volume) => volume.name === props.volume);
226
- return (_jsxs("select", { id: id, style: slotSelect, value: props.volume, disabled: disabled, onChange: (event) => props.onVolume(event.target.value), children: [missing ? _jsx("option", { value: props.volume, children: props.volume }) : null, props.volumes.length === 0
224
+ const options = mountSourceOptions(props.volume, props.volumes);
225
+ return (_jsxs("select", { id: id, style: slotSelect, value: props.volume, disabled: disabled, onChange: (event) => props.onVolume(event.target.value), children: [options.names.length === 0
227
226
  ? _jsx("option", { value: "", children: t("none") })
228
- : null, props.volumes.map((volume) => (_jsx("option", { value: volume.name, children: volume.name }, volume.name)))] }));
227
+ : null, options.names.map((name) => (_jsx("option", { value: name, children: name }, name)))] }));
229
228
  }
230
229
  if (normalized === "secret") {
231
- const missing = props.secret !== "" &&
232
- !props.secrets.some((secret) => secret.name === props.secret);
233
- return (_jsxs("select", { id: id, style: slotSelect, value: props.secret, disabled: disabled, onChange: (event) => props.onSecret(event.target.value), children: [missing ? _jsx("option", { value: props.secret, children: props.secret }) : null, props.secrets.length === 0
230
+ const options = mountSourceOptions(props.secret, props.secrets);
231
+ return (_jsxs("select", { id: id, style: slotSelect, value: props.secret, disabled: disabled, onChange: (event) => props.onSecret(event.target.value), children: [options.names.length === 0
234
232
  ? _jsx("option", { value: "", children: t("none") })
235
- : null, props.secrets.map((secret) => (_jsx("option", { value: secret.name, children: secret.name }, secret.name)))] }));
233
+ : null, options.names.map((name) => (_jsx("option", { value: name, children: name }, name)))] }));
236
234
  }
237
- return (_jsx(Input, { id: id, className: props.projectReadOnlyReason === undefined
238
- ? SLOT_CLASS
239
- : `${SLOT_CLASS} ${FIELD_CLASS}`, icon: props.projectReadOnlyReason === undefined
240
- ? undefined
241
- : _jsx(LockGlyph, {}), value: props.project,
242
- // The path of a mount that cannot be removed cannot be typed into either:
243
- // it stays readable and selectable, on the fixed value's own surface, with
244
- // the reason as its tooltip.
245
- readOnly: props.projectReadOnlyReason !== undefined, title: props.projectReadOnlyReason, disabled: disabled, onChange: (event) => props.onProject(event.target.value) }));
235
+ return (_jsx(Input, { id: id, className: projectLocked ? `${SLOT_CLASS} ${FIELD_CLASS}` : SLOT_CLASS, icon: projectLocked ? _jsx(LockGlyph, {}) : undefined, value: props.project,
236
+ // A locked path stays readable, selectable and copyable: readOnly rather
237
+ // than disabled, so its text can be selected and copied out.
238
+ readOnly: projectLocked, disabled: disabled, onChange: (event) => props.onProject(event.target.value), onBlur: props.onProjectBlur }));
246
239
  }
247
240
  // The canonical mount row: Kind, Destination, the source field the kind takes
248
241
  // and Mode, in that order, plus the editor's own trailing actions, through the
@@ -250,10 +243,16 @@ function MountSourceControl(props) {
250
243
  // tmpfs mounts no source, and a secret or tmpfs carries no mode. The block
251
244
  // fills each field with the container's own value; an editor fills it with the
252
245
  // control that changes it.
253
- export function MountRow(props) {
254
- const { t, mode, mount, destination, kindValue, disabled, volumes, secrets, onUpdate, onBrowse, browseError, onRemove, confirmRemove, removeDisabledReason, } = props;
246
+ export const MountRow = memo(function MountRow(props) {
247
+ const { t, mode, mount, destination, kindValue, disabled, volumes, secrets, onUpdate, onBrowse, browseError, onProjectBrowse, projectBrowseLabel, error, onProjectBlur, writable = false, busy = false, onCreateVolume, onCreateSecret, onRemove, confirmRemove, removeDisabledReason, projectPathLocked, } = props;
255
248
  const disabledField = disabled === true;
256
249
  const update = (patch) => onUpdate?.(patch);
250
+ // The row's own value and patch entry as they now stand, read when an
251
+ // asynchronous create settles so a refusal only undoes the selection it made.
252
+ const mountRef = useRef(mount);
253
+ mountRef.current = mount;
254
+ const updateRef = useRef(update);
255
+ updateRef.current = update;
257
256
  // A project mount never takes a destination of its own — the host derives its
258
257
  // mirror under the projects root — so the preview of it is a fixed value.
259
258
  const destinationFixed = normalizeMountKind(mount.kind) === "project";
@@ -270,15 +269,38 @@ export function MountRow(props) {
270
269
  ];
271
270
  const source = mountSourceName(mount);
272
271
  if (mountHasSource(mount.kind)) {
272
+ // Creating a volume or a secret from the row selects it immediately: the
273
+ // refreshed snapshot may not list it yet, and the picker keeps the row's own
274
+ // value among its options until it does. A refusal — a duplicate name — is
275
+ // resolved by the creator, which then puts the previous source back.
276
+ const adopt = (name, previous, accepted) => {
277
+ const patch = createdMountSource(mount.kind, name);
278
+ if (patch !== undefined)
279
+ update(patch);
280
+ return accepted.then((ok) => {
281
+ if (ok)
282
+ return true;
283
+ const revert = revertCreatedMountSource(mountRef.current, name, previous);
284
+ if (revert !== undefined)
285
+ updateRef.current(revert);
286
+ return false;
287
+ });
288
+ };
273
289
  fields.push({
274
290
  label: mountSourceLabel(t, mount.kind),
275
- render: (id) => (_jsxs(ValueField, { t: t, mode: mode, id: id, value: source, copyLabel: t("copyMountName", { name: source }), below: browseError === undefined || browseError === ""
276
- ? undefined
277
- : (_jsx("p", { style: { margin: 0, fontSize: "13px" }, role: "alert", children: browseError })), children: [_jsx(MountSourceControl, { t: t, id: id, kind: mount.kind, project: mount.project, volume: mount.volume, secret: mount.secret, volumes: volumes ?? [], secrets: secrets ?? [], disabled: disabledField, projectReadOnlyReason: removeDisabledReason, onProject: (project) => update({ project }), onVolume: (volume) => update({ volume }), onSecret: (secret) => update({ secret }) }), onBrowse === undefined ? null : (_jsx(Button, { variant: "outline", size: "sm",
278
- // The path that cannot be typed into cannot be browsed to either:
279
- // the Browse stays in place, greyed out and disabled, with the
280
- // reason as its tooltip.
281
- disabled: disabledField || removeDisabledReason !== undefined, title: removeDisabledReason, "aria-label": removeDisabledReason, onClick: onBrowse, children: t("browse") }))] })),
291
+ render: (id) => (_jsxs(ValueField, { t: t, mode: mode, id: id, value: source, copyLabel: t("copyMountName", { name: source }), below: browseError !== undefined && browseError !== ""
292
+ ? (_jsx("p", { className: MOUNT_ERROR_CLASS, role: "alert", children: browseError }))
293
+ : undefined, children: [_jsx(MountSourceControl, { t: t, id: id, kind: mount.kind, project: mount.project, volume: mount.volume, secret: mount.secret, volumes: volumes ?? [], secrets: secrets ?? [], disabled: disabledField, projectPathLocked: projectPathLocked, onProjectBlur: onProjectBlur, onProject: (project) => update({ project }), onVolume: (volume) => update({ volume }), onSecret: (secret) => update({ secret }) }), _jsx(MountSourceActions, { t: t, kind: mount.kind, writable: writable, busy: busy, disabled: disabledField, onBrowse: onBrowse, onCreateVolume: onCreateVolume === undefined
294
+ ? undefined
295
+ : (name) => {
296
+ const accepted = onCreateVolume(name);
297
+ return adopt(name, mount.volume, accepted);
298
+ }, onCreateSecret: onCreateSecret === undefined
299
+ ? undefined
300
+ : (name, length, charset) => {
301
+ const accepted = onCreateSecret(name, length, charset);
302
+ return adopt(name, mount.secret, accepted);
303
+ } })] })),
282
304
  });
283
305
  }
284
306
  const modeLabel = mountModeLabel(t, mount.mode);
@@ -288,7 +310,7 @@ export function MountRow(props) {
288
310
  render: (id) => (_jsx(ValueField, { t: t, mode: mode, id: id, value: modeLabel, copyLabel: t("copyMountMode", { mode: modeLabel }), children: _jsxs("select", { id: id, style: slotSelect, value: normalizeMountMode(mount.mode), disabled: disabledField, onChange: (event) => update({ mode: event.target.value }), children: [_jsx("option", { value: "read_only", children: t("readOnly") }), _jsx("option", { value: "read_write", children: t("readWrite") })] }) })),
289
311
  });
290
312
  }
291
- const actions = mode === "view"
313
+ const removeAction = mode === "view"
292
314
  ? undefined
293
315
  : removeDisabledReason !== undefined
294
316
  ? (_jsx(Button, { variant: "outline", size: "sm", disabled: true, title: removeDisabledReason, "aria-label": removeDisabledReason, children: t("remove") }))
@@ -299,7 +321,28 @@ export function MountRow(props) {
299
321
  mount: mountLabel(t, mount, false),
300
322
  }), confirmLabel: t("removeMountTitle"), disabled: disabledField, onConfirm: onRemove }))
301
323
  : (_jsx(Button, { variant: "outline", size: "sm", disabled: disabledField, style: destructiveAction, onClick: onRemove, children: t("remove") }));
302
- return (_jsx(FieldRow, { leading: _jsx(MountKindField, { t: t, kind: mount.kind, children: kindValue }), fields: fields, actions: actions }));
324
+ // Browse is the row's own action rather than a control on the label's line, so
325
+ // it shares the Remove button's line and weight. It exists only for an editor
326
+ // project row whose caller supplied a browser, and a read-only or busy
327
+ // session disables it like the row's other writes.
328
+ const browseAction = mountRowBrowseOffered(mode, mount.kind, onProjectBrowse) &&
329
+ onProjectBrowse !== undefined
330
+ ? (_jsx(Button, { variant: "outline", size: "sm", disabled: mountRowBrowseDisabled(disabledField, writable, busy), onClick: onProjectBrowse, children: projectBrowseLabel ?? t("templateBrowse") }))
331
+ : undefined;
332
+ // One fragment, Browse first: the row actions line carries both without
333
+ // changing where Remove sits, including a disabled Remove kept in place.
334
+ const actions = browseAction === undefined && removeAction === undefined
335
+ ? undefined
336
+ : (_jsxs(_Fragment, { children: [browseAction, removeAction] }));
337
+ return (_jsxs(_Fragment, { children: [_jsx(FieldRow, { leading: _jsx(MountKindField, { t: t, kind: mount.kind, children: kindValue }), fields: fields, actions: actions }), _jsx(RowValidationError, { message: error })] }));
338
+ });
339
+ // The validation message a row raises after itself: it belongs to the whole
340
+ // entry, so it sits under the row at the list's full width rather than inside
341
+ // the narrow source slot. The editor dialogs never pass one.
342
+ function RowValidationError(props) {
343
+ if (props.message === undefined || props.message === "")
344
+ return null;
345
+ return (_jsx("p", { className: MOUNT_ERROR_CLASS, style: { width: "100%", textAlign: "left" }, role: "alert", children: props.message }));
303
346
  }
304
347
  // The compact controls a PATH row carries beside its field: the drag handle and
305
348
  // the move/remove buttons are symbols, so their meaning lives in the title and
@@ -334,30 +377,40 @@ export function PathRow(props) {
334
377
  // the row's own Remove at the value line's end, exactly where the block puts
335
378
  // that field's copy control, so both render the same two fields at the same
336
379
  // widths. Removing one only stages the change, so it needs no confirmation.
337
- export function SecretEnvRow(props) {
338
- const { t, mode, name, secret, secrets, disabled, autoFocus, onChangeName, onChangeSecret, onRemove, keyInvalid, } = props;
380
+ export const SecretEnvRow = memo(function SecretEnvRow(props) {
381
+ const { t, mode, name, secret, secrets, disabled, autoFocus, onChangeName, onChangeSecret, onRemove, onCreateSecret, keyInvalid, error, } = props;
339
382
  const disabledField = disabled === true;
340
383
  const candidates = secrets ?? [];
384
+ // A named secret the snapshot no longer lists is a requirement a template can
385
+ // bring in; the row offers creating it, and its own Remove drops the
386
+ // requirement.
387
+ const missing = mode === "edit" && secret !== "" && !candidates.some((candidate) => candidate.name === secret);
341
388
  const removeControl = mode === "edit" && onRemove !== undefined
342
389
  ? (_jsx(Button, { variant: "outline", size: "sm", disabled: disabledField, style: destructiveAction, onClick: onRemove, children: t("remove") }))
343
390
  : undefined;
344
- return (_jsx(FieldRow, { fields: [
345
- {
346
- label: t("envKey"),
347
- render: (id) => (_jsx(ValueField, { t: t, mode: mode, id: id, value: name, copyLabel: t("copyEnvKey", { key: name }), children: _jsx(Input, { id: id, className: keyInvalid === true
348
- ? `${SLOT_CLASS} ${SLOT_INVALID_CLASS}`
349
- : SLOT_CLASS, value: name, disabled: disabledField, placeholder: t("secretEnvName"), autoFocus: autoFocus, onChange: (event) => onChangeName?.(event.target.value) }) })),
350
- },
351
- {
352
- label: t("envValue"),
353
- render: (id) => (_jsx(ValueField, { t: t, mode: mode, id: id, value: secret, copyLabel: t("copyEnvValue", { key: name }), trailing: removeControl, children: _jsxs("select", { id: id, style: slotSelect, value: secret, disabled: disabledField, onChange: (event) => onChangeSecret?.(event.target.value), children: [candidates.some((candidate) => candidate.name === secret)
354
- ? null
355
- : _jsx("option", { value: secret, children: secret }), candidates.length === 0
356
- ? _jsx("option", { value: "", children: t("none") })
357
- : null, candidates.map((candidate) => (_jsx("option", { value: candidate.name, children: candidate.name }, candidate.name)))] }) })),
358
- },
359
- ] }));
360
- }
391
+ const createControl = missing && onCreateSecret !== undefined
392
+ ? (_jsx(Button, { variant: "outline", size: "sm", disabled: disabledField, "aria-label": t("templateSecretMissing", { secret }), onClick: onCreateSecret, children: t("createSecret") }))
393
+ : undefined;
394
+ const trailing = createControl === undefined && removeControl === undefined
395
+ ? undefined
396
+ : (_jsxs("div", { style: { display: "flex", gap: "4px" }, children: [createControl, removeControl] }));
397
+ return (_jsxs(_Fragment, { children: [_jsx(FieldRow, { fields: [
398
+ {
399
+ label: t("envKey"),
400
+ render: (id) => (_jsx(ValueField, { t: t, mode: mode, id: id, value: name, copyLabel: t("copyEnvKey", { key: name }), children: _jsx(Input, { id: id, className: keyInvalid === true
401
+ ? `${SLOT_CLASS} ${SLOT_INVALID_CLASS}`
402
+ : SLOT_CLASS, value: name, disabled: disabledField, placeholder: t("secretEnvName"), autoFocus: autoFocus, onChange: (event) => onChangeName?.(event.target.value) }) })),
403
+ },
404
+ {
405
+ label: t("secretName"),
406
+ render: (id) => (_jsx(ValueField, { t: t, mode: mode, id: id, value: secret, copyLabel: t("copyEnvValue", { key: name }), trailing: trailing, children: _jsxs("select", { id: id, style: slotSelect, value: secret, disabled: disabledField, onChange: (event) => onChangeSecret?.(event.target.value), children: [candidates.some((candidate) => candidate.name === secret)
407
+ ? null
408
+ : _jsx("option", { value: secret, children: secret }), candidates.length === 0
409
+ ? _jsx("option", { value: "", children: t("none") })
410
+ : null, candidates.map((candidate) => (_jsx("option", { value: candidate.name, children: candidate.name }, candidate.name)))] }) })),
411
+ },
412
+ ] }), _jsx(RowValidationError, { message: error })] }));
413
+ });
361
414
  // One published port, shared by the container block and the port editor: the
362
415
  // container port, then the host port the gateway bound — or, while the gateway
363
416
  // has not bound one yet, the host port the user asked for with "(pending)"
@@ -511,40 +564,16 @@ export const mountViewToInput = (mount) => {
511
564
  secret: mount.secret,
512
565
  };
513
566
  };
514
- // The category a mount sorts under in an ordered mounts list: the workspace's
515
- // main project mount first, then read-write projects, read-only projects,
516
- // read-write volumes, read-only volumes, secrets and tmpfs.
517
- function mountRank(mount, mainProject) {
518
- if (mount.kind === "project" && mainProject !== "" &&
519
- mount.project === mainProject) {
520
- return 0;
521
- }
522
- if (mount.kind === "project")
523
- return mount.mode === "read_write" ? 1 : 2;
524
- if (mount.kind === "volume")
525
- return mount.mode === "read_write" ? 3 : 4;
526
- if (mount.kind === "secret")
527
- return 5;
528
- return 6;
529
- }
530
- // The mounts in the one order both the editors and a container block list them
531
- // in: one category at a time, sorted by mounted path inside the category. Each
532
- // entry keeps the index it has in the draft, so an edit or a removal still
533
- // targets the entry behind the row.
534
- export function orderedMounts(mounts, mainProject) {
535
- return mounts
536
- .map((mount, index) => ({ mount, index }))
537
- .sort((left, right) => {
538
- const rank = mountRank(left.mount, mainProject) -
539
- mountRank(right.mount, mainProject);
540
- if (rank !== 0)
541
- return rank;
542
- // A stable sort keeps the draft order inside a category when two mounts
543
- // share a destination.
544
- const a = left.mount.destination;
545
- const b = right.mount.destination;
546
- return a < b ? -1 : a > b ? 1 : 0;
547
- });
567
+ // The destination a mount row shows: a project mount's derived mirror under
568
+ // the projects root, or the destination the other kinds carry. The editor, the
569
+ // container block and the template preview all render a mount through the same
570
+ // row, so they also share this one mapping.
571
+ export function mountDestination(mount, projectsRoot) {
572
+ if (mount.kind !== "project")
573
+ return mount.destination;
574
+ return mount.project.trim() === ""
575
+ ? ""
576
+ : hostPathForProjectName(projectsRoot, mount.project);
548
577
  }
549
578
  export const mountLabel = (t, mount, withMode = true) => {
550
579
  const destination = mount.destination !== "" ? ` → ${mount.destination}` : "";
@@ -13,6 +13,12 @@ export type ActionEmphasis = "warn" | "business" | "success";
13
13
  export declare const warnAction: React.CSSProperties;
14
14
  export declare const businessAction: React.CSSProperties;
15
15
  export declare const successAction: React.CSSProperties;
16
+ export declare const violetTone: {
17
+ color: string;
18
+ background: string;
19
+ };
20
+ export declare const templateAction: React.CSSProperties;
21
+ export declare const templateActionSelected: React.CSSProperties;
16
22
  export declare const emphasisAction: Record<ActionEmphasis, React.CSSProperties>;
17
23
  export declare const cardRow: React.CSSProperties;
18
24
  export declare const cardBlockRow: React.CSSProperties;
@@ -128,6 +128,28 @@ export const successAction = {
128
128
  borderColor: "var(--dsw-alias-state-success-primary)",
129
129
  background: "color-mix(in srgb, var(--dsw-alias-state-success-primary) 12%, transparent)",
130
130
  };
131
+ // The violet the PTC chip, the tmpfs mount marker and the template actions all
132
+ // read with. The harness ships no violet accent token — its accent pair is blue
133
+ // — so all three tint this one literal, at the chip's 12% fill, rather than
134
+ // each carrying its own copy. One literal is what keeps them identical.
135
+ export const violetTone = {
136
+ color: "#a78bfa",
137
+ background: "color-mix(in srgb, #a78bfa 12%, transparent)",
138
+ };
139
+ // A template action: its ink, stroke and fill are the violet shared with the PTC
140
+ // and tmpfs styling, so the three stay identical in colour.
141
+ export const templateAction = {
142
+ color: violetTone.color,
143
+ borderColor: violetTone.color,
144
+ background: violetTone.background,
145
+ };
146
+ // The chosen destination in the load popup: the same shared violet with a
147
+ // stronger tint, so the selected mode stays visible without becoming a second
148
+ // filled primary control.
149
+ export const templateActionSelected = {
150
+ ...templateAction,
151
+ background: `color-mix(in srgb, ${violetTone.color} 20%, transparent)`,
152
+ };
131
153
  // The emphasis styles by name, so a caller that renders a plain Button can paint
132
154
  // it the same way ConfirmButton's own emphasis prop does.
133
155
  export const emphasisAction = {
@@ -9,7 +9,8 @@ export declare const MOUNT_KIND_VALUE_CLASS = "dsh-podman-mount-kind-value";
9
9
  export declare const MOUNT_FIELD_CLASS = "dsh-podman-mount-field";
10
10
  export declare const MOUNT_DESTINATION_CLASS = "dsh-podman-mount-destination";
11
11
  export declare const MOUNT_ACTIONS_CLASS = "dsh-podman-mount-actions";
12
+ export declare const MOUNT_ERROR_CLASS = "dsh-podman-mount-error";
12
13
  export declare const ROW_LIST_CLASS = "dsh-podman-row-list";
13
- export declare const TABLE_STYLES = "\n.dsh-podman-table-card {\n align-self: start;\n box-sizing: border-box;\n width: 100%;\n}\n.dsh-podman-table-card-content {\n container-type: inline-size;\n}\n.dsh-podman-table {\n width: 100%;\n border-collapse: collapse;\n}\n.dsh-podman-table th,\n.dsh-podman-table td {\n padding: 12px 12px 12px 0;\n text-align: left;\n vertical-align: top;\n overflow-wrap: anywhere;\n}\n.dsh-podman-table th:last-child,\n.dsh-podman-table td:last-child {\n padding-right: 0;\n}\n.dsh-podman-table thead th {\n padding-top: 0;\n padding-bottom: 8px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-table tbody tr + tr > td {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.dsh-podman-field-row {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 8px;\n font-size: 13px;\n line-height: 20px;\n}\n.dsh-podman-mount-row {\n container-type: inline-size;\n}\n/* One labelled field of a mount row shares the line while there is room; the\n container query below gives it a line of its own on a narrow row. */\n.dsh-podman-mount-field {\n flex: 1 1 160px;\n}\n/* The Destination field grows twice as much as the fields beside it and starts\n from a wider basis, so a wide row spends its free space on the destination\n instead of leaving it unused. It keeps width: 100% on its input and carries\n no cap. */\n.dsh-podman-mount-destination {\n flex: 2 1 240px;\n}\n/* The Kind field's value line reserves the line an input occupies beside it \u2014\n 32px of control box plus its 0.5px stroke on each side \u2014 so the chip centres\n on the inputs' line instead of hugging the top of the row. */\n.dsh-podman-mount-kind-value {\n min-height: 33px;\n}\n/* The list is its own containment context, so the query below resolves against\n the width its rows are given even when the list renders in a dialog portaled\n to the body, which no card wraps and which would otherwise leave the rows\n with nothing to measure. Because the list spans the same width its rows had,\n every other query still measures what it measured before. */\n.dsh-podman-row-list {\n container-type: inline-size;\n}\n@container (max-width: 560px) {\n .dsh-podman-table,\n .dsh-podman-table tbody,\n .dsh-podman-table tr,\n .dsh-podman-table td {\n display: block;\n }\n .dsh-podman-table thead {\n display: none;\n }\n .dsh-podman-table tbody tr {\n padding: 12px 0;\n }\n .dsh-podman-table tbody tr + tr {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n }\n .dsh-podman-table tbody tr + tr > td {\n border-top: 0;\n }\n .dsh-podman-table td {\n padding: 0 0 8px;\n }\n .dsh-podman-table td:last-child {\n padding-bottom: 0;\n }\n .dsh-podman-table td::before {\n content: attr(data-label);\n display: block;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n }\n /* A field line whose label sits beside its value on a wide card stacks the\n label above the value once the card is narrow. */\n .dsh-podman-field-row {\n flex-direction: column;\n gap: 0;\n }\n /* A mount row's Kind field stops hugging its chip and takes a line of its\n own, like the fields beside it. Its flex basis is auto, so the width is\n what gives the field that line. */\n .dsh-podman-mount-kind {\n width: 100%;\n }\n /* The Kind field now owns its line: with no input beside it to align with,\n its value line drops the height it reserved, so a stacked chip leaves no\n empty space under itself. */\n .dsh-podman-mount-kind-value {\n min-height: 0;\n }\n /* Every other field of a mount row \u2014 the Destination included \u2014 takes a full\n line of its own too, so the label always reads above its value on a narrow\n row. */\n .dsh-podman-mount-field,\n .dsh-podman-mount-destination {\n flex-basis: 100%;\n }\n /* A mount row's actions become that row's own full-width footer. */\n .dsh-podman-mount-actions {\n flex-basis: 100%;\n width: 100%;\n }\n /* Consecutive rows of one list \u2014 a container block's field group and the\n editor that changes the same list \u2014 take a hairline once they stack. Side\n by side on a wide pane the gap alone separates them, which is why the rule\n lives in this query alone, and the padding above each ruled row keeps the\n line in the gap instead of against the row it introduces. A group's label,\n its empty-state line and its own add controls carry no row class, so they\n never take a rule of their own. */\n .dsh-podman-row-list > .dsh-podman-mount-row + .dsh-podman-mount-row {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n /* The margin adds to the list's own gap, so the ruled row sits further from\n the row above it than from the one below: the line reads as the boundary\n of the row it introduces rather than as that row's top edge. */\n margin-top: 4px;\n padding-top: 8px;\n }\n}\n";
14
+ export declare const TABLE_STYLES = "\n.dsh-podman-table-card {\n align-self: start;\n box-sizing: border-box;\n width: 100%;\n}\n.dsh-podman-table-card-content {\n container-type: inline-size;\n}\n.dsh-podman-table {\n width: 100%;\n border-collapse: collapse;\n}\n.dsh-podman-table th,\n.dsh-podman-table td {\n padding: 12px 12px 12px 0;\n text-align: left;\n vertical-align: top;\n overflow-wrap: anywhere;\n}\n.dsh-podman-table th:last-child,\n.dsh-podman-table td:last-child {\n padding-right: 0;\n}\n.dsh-podman-table thead th {\n padding-top: 0;\n padding-bottom: 8px;\n font-size: 12px;\n font-weight: 500;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n}\n.dsh-podman-table tbody tr + tr > td {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n}\n.dsh-podman-field-row {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 8px;\n font-size: 13px;\n line-height: 20px;\n}\n.dsh-podman-mount-row {\n container-type: inline-size;\n}\n/* A mount row's error line sits under the value it belongs to, at the value's\n size, in the error state's colour: the words name the failure and the colour\n repeats it, so it reads in either theme. */\n.dsh-podman-mount-error {\n margin: 0;\n font-size: 13px;\n color: var(--dsw-alias-state-error-primary);\n}\n/* One labelled field of a mount row shares the line while there is room; the\n container query below gives it a line of its own on a narrow row. */\n.dsh-podman-mount-field {\n flex: 1 1 160px;\n}\n/* The Destination field grows twice as much as the fields beside it and starts\n from a wider basis, so a wide row spends its free space on the destination\n instead of leaving it unused. It keeps width: 100% on its input and carries\n no cap. */\n.dsh-podman-mount-destination {\n flex: 2 1 240px;\n}\n/* The Kind field's value line reserves the line an input occupies beside it \u2014\n 32px of control box plus its 0.5px stroke on each side \u2014 so the chip centres\n on the inputs' line instead of hugging the top of the row. */\n.dsh-podman-mount-kind-value {\n min-height: 33px;\n}\n/* The list is its own containment context, so the query below resolves against\n the width its rows are given even when the list renders in a dialog portaled\n to the body, which no card wraps and which would otherwise leave the rows\n with nothing to measure. Because the list spans the same width its rows had,\n every other query still measures what it measured before. */\n.dsh-podman-row-list {\n container-type: inline-size;\n}\n@container (max-width: 560px) {\n .dsh-podman-table,\n .dsh-podman-table tbody,\n .dsh-podman-table tr,\n .dsh-podman-table td {\n display: block;\n }\n .dsh-podman-table thead {\n display: none;\n }\n .dsh-podman-table tbody tr {\n padding: 12px 0;\n }\n .dsh-podman-table tbody tr + tr {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n }\n .dsh-podman-table tbody tr + tr > td {\n border-top: 0;\n }\n .dsh-podman-table td {\n padding: 0 0 8px;\n }\n .dsh-podman-table td:last-child {\n padding-bottom: 0;\n }\n .dsh-podman-table td::before {\n content: attr(data-label);\n display: block;\n font-size: 12px;\n line-height: 18px;\n color: var(--dsw-alias-label-tertiary);\n }\n /* A field line whose label sits beside its value on a wide card stacks the\n label above the value once the card is narrow. */\n .dsh-podman-field-row {\n flex-direction: column;\n gap: 0;\n }\n /* A mount row's Kind field stops hugging its chip and takes a line of its\n own, like the fields beside it. Its flex basis is auto, so the width is\n what gives the field that line. */\n .dsh-podman-mount-kind {\n width: 100%;\n }\n /* The Kind field now owns its line: with no input beside it to align with,\n its value line drops the height it reserved, so a stacked chip leaves no\n empty space under itself. */\n .dsh-podman-mount-kind-value {\n min-height: 0;\n }\n /* Every other field of a mount row \u2014 the Destination included \u2014 takes a full\n line of its own too, so the label always reads above its value on a narrow\n row. */\n .dsh-podman-mount-field,\n .dsh-podman-mount-destination {\n flex-basis: 100%;\n }\n /* A mount row's actions become that row's own full-width footer. */\n .dsh-podman-mount-actions {\n flex-basis: 100%;\n width: 100%;\n }\n /* Consecutive rows of one list \u2014 a container block's field group and the\n editor that changes the same list \u2014 take a hairline once they stack. Side\n by side on a wide pane the gap alone separates them, which is why the rule\n lives in this query alone, and the padding above each ruled row keeps the\n line in the gap instead of against the row it introduces. A group's label,\n its empty-state line and its own add controls carry no row class, so they\n never take a rule of their own. */\n .dsh-podman-row-list > .dsh-podman-mount-row + .dsh-podman-mount-row {\n border-top: 0.5px solid var(--dsw-alias-border-l2);\n /* The margin adds to the list's own gap, so the ruled row sits further from\n the row above it than from the one below: the line reads as the boundary\n of the row it introduces rather than as that row's top edge. */\n margin-top: 4px;\n padding-top: 8px;\n }\n}\n";
14
15
  /** Inject the responsive table's stylesheet for the owning plugin lifetime. */
15
16
  export declare function installTableStyles(ctx: ClientContext): void;