@salesforce/metadata-plugins 1.15.0 → 1.16.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.
@@ -4,7 +4,7 @@
4
4
  * Licensed under the BSD 3-Clause license.
5
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  **/
7
- import { IMetadataParser, MetadataFileInfo, ValidationResult, IPlatformContext, SalesforceXMLParser, VersionInfo } from '@salesforce/metadata-core-sdk';
7
+ import { IMetadataParser, MetadataFileInfo, ValidationResult, IPlatformContext, SalesforceXMLParser, VersionInfo, type SelectableNode } from '@salesforce/metadata-core-sdk';
8
8
  import { KeyValueTableData } from './types/KeyValueTableData.js';
9
9
  /**
10
10
  * Decode predefined XML entities and numeric character references.
@@ -26,6 +26,7 @@ export declare class KeyValueTableParser implements IMetadataParser<KeyValueTabl
26
26
  setPlatformContext(context: IPlatformContext): void;
27
27
  parse(filePath: string, _versionInfo: VersionInfo): Promise<KeyValueTableData>;
28
28
  extractMetadataInfo(data: KeyValueTableData): MetadataFileInfo | null;
29
+ getSelectableNodes(data: KeyValueTableData): SelectableNode[];
29
30
  validate(data: KeyValueTableData): ValidationResult;
30
31
  private transform;
31
32
  private deriveStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"KeyValueTableParser.d.ts","sourceRoot":"","sources":["../../../src/plugins/keyvaluetable/KeyValueTableParser.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAYJ,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAGhB,mBAAmB,EACnB,WAAW,EAGZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AA+EtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWnD;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAOD,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA2BzD;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjD;AA6HD,qBAAa,mBAAoB,YAAW,eAAe,CAAC,iBAAiB,CAAC;IAC5E,OAAO,CAAC,eAAe,CAAC,CAAmB;IAC3C,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,SAAS,CAAC,CAAa;IAG/B,QAAQ,CAAC,SAAS,sBAAqD;IAEvE,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAM7C,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8EpF,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,IAAI;IAIrE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB;IAUnD,OAAO,CAAC,SAAS;IAyGjB,OAAO,CAAC,YAAY;IASpB,qGAAqG;IACrG,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,SAAS;CAqBlB"}
1
+ {"version":3,"file":"KeyValueTableParser.d.ts","sourceRoot":"","sources":["../../../src/plugins/keyvaluetable/KeyValueTableParser.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAYJ,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAGhB,mBAAmB,EACnB,WAAW,EAGX,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAGL,iBAAiB,EAIlB,MAAM,8BAA8B,CAAC;AA+EtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWnD;AAED,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAOD,mFAAmF;AACnF,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA2BzD;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEjD;AA6HD,qBAAa,mBAAoB,YAAW,eAAe,CAAC,iBAAiB,CAAC;IAC5E,OAAO,CAAC,eAAe,CAAC,CAAmB;IAC3C,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,SAAS,CAAC,CAAa;IAG/B,QAAQ,CAAC,SAAS,sBAAqD;IAEvE,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAM7C,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA8EpF,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,IAAI;IAIrE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,EAAE;IAI7D,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,gBAAgB;IAUnD,OAAO,CAAC,SAAS;IAyGjB,OAAO,CAAC,YAAY;IASpB,qGAAqG;IACrG,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,SAAS;CAqBlB"}
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import { humanize } from './humanize.js';
16
16
  import { SalesforceXMLParser, ErrorBuilder, ErrorCategory, } from '@salesforce/metadata-core-sdk';
17
+ import { keyvaluetableSelectableNodes } from './keyvaluetableSelectionGraph.js';
17
18
  import { isPluginError } from '../../shared/utils/isPluginError.js';
18
19
  /** A lone object with more keys than this reads better as a Field / Value table than as one wide row. */
19
20
  const MAX_ROW_COLUMNS = 4;
@@ -292,6 +293,9 @@ export class KeyValueTableParser {
292
293
  extractMetadataInfo(data) {
293
294
  return data.apiName ? { label: data.title } : null;
294
295
  }
296
+ getSelectableNodes(data) {
297
+ return keyvaluetableSelectableNodes(data);
298
+ }
295
299
  validate(data) {
296
300
  const warnings = [];
297
301
  if (data.status && !data.status.active) {
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /**
8
+ * KeyValueTable's SelectionGraph projection (vibe-edit).
9
+ *
10
+ * SELF-CONTAINED: imports only `./types/*`, the pure root-level `./panelModel.js`
11
+ * and `@salesforce/metadata-core-sdk`. It never value-imports `ui/` (Vite wipes it
12
+ * from the published package) or `react`.
13
+ *
14
+ * The id helpers below are used by BOTH the parser (via `keyvaluetableSelectableNodes`)
15
+ * and the panel (`data-mv-id`), so ids agree byte-for-byte by construction.
16
+ *
17
+ * Node kinds: `metadata` (the file) > `section` (a Field/Value, list or tree table)
18
+ * > `property` (a Field/Value row) | `row` (a list row) | `treeNode` (a tree row, which
19
+ * nests further `treeNode`s under its expandable detail).
20
+ */
21
+ import { type SelectableNode } from '@salesforce/metadata-core-sdk';
22
+ import type { KeyValueTableData } from './types/KeyValueTableData.js';
23
+ export declare function metadataNodeId(apiName: string): string;
24
+ export declare function sectionNodeId(apiName: string, sectionKey: string): string;
25
+ export declare function propertyNodeId(sectionId: string, entryKey: string): string;
26
+ /** `rowKey` comes from `listRowKeys` — content-addressed, so it survives search and paging. */
27
+ export declare function listRowNodeId(sectionId: string, rowKey: string): string;
28
+ /**
29
+ * `scopeId` is the owning section (top-level table) or the parent tree row (nested table);
30
+ * `name` is the table's name; `rowKey` comes from `treeRowKeys`.
31
+ */
32
+ export declare function treeNodeId(scopeId: string, name: string, rowKey: string): string;
33
+ /**
34
+ * Flat node list matching, 1:1, the elements the panel stamps with `data-mv-id`.
35
+ *
36
+ * NOTE: Nodes are emitted for all list rows and tree nodes, including those not currently
37
+ * in the DOM (paged list rows, collapsed tree nodes). Marquee selection can only reach
38
+ * rendered elements, so unopened/unpaged rows cannot be selected even though their nodes
39
+ * exist. Node count is capped to prevent unbounded payloads in very large files.
40
+ */
41
+ export declare function keyvaluetableSelectableNodes(data: KeyValueTableData): SelectableNode[];
42
+ //# sourceMappingURL=keyvaluetableSelectionGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyvaluetableSelectionGraph.d.ts","sourceRoot":"","sources":["../../../src/plugins/keyvaluetable/keyvaluetableSelectionGraph.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAoB,MAAM,8BAA8B,CAAC;AAgBxF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhF;AAsCD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,EAAE,CA+FtF"}
@@ -0,0 +1,167 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /**
8
+ * KeyValueTable's SelectionGraph projection (vibe-edit).
9
+ *
10
+ * SELF-CONTAINED: imports only `./types/*`, the pure root-level `./panelModel.js`
11
+ * and `@salesforce/metadata-core-sdk`. It never value-imports `ui/` (Vite wipes it
12
+ * from the published package) or `react`.
13
+ *
14
+ * The id helpers below are used by BOTH the parser (via `keyvaluetableSelectableNodes`)
15
+ * and the panel (`data-mv-id`), so ids agree byte-for-byte by construction.
16
+ *
17
+ * Node kinds: `metadata` (the file) > `section` (a Field/Value, list or tree table)
18
+ * > `property` (a Field/Value row) | `row` (a list row) | `treeNode` (a tree row, which
19
+ * nests further `treeNode`s under its expandable detail).
20
+ */
21
+ import { structuralId } from '@salesforce/metadata-core-sdk';
22
+ import { SETTINGS_KEY, entrySectionKey, entrySectionTitle, listRowKeys, sectionKeys, treeGroupsOf, treeRowKeys, visibleEntries, } from './panelModel.js';
23
+ // Caps to prevent unbounded payloads in large files
24
+ const MAX_NODES = 5000; // Hard cap; most files won't reach this
25
+ const MAX_ATTRIBUTE_LENGTH = 1024; // Truncate attribute values beyond this
26
+ export function metadataNodeId(apiName) {
27
+ return structuralId('', 'metadata', apiName);
28
+ }
29
+ export function sectionNodeId(apiName, sectionKey) {
30
+ return structuralId(metadataNodeId(apiName), 'section', sectionKey);
31
+ }
32
+ export function propertyNodeId(sectionId, entryKey) {
33
+ return structuralId(sectionId, 'property', entryKey);
34
+ }
35
+ /** `rowKey` comes from `listRowKeys` — content-addressed, so it survives search and paging. */
36
+ export function listRowNodeId(sectionId, rowKey) {
37
+ return structuralId(sectionId, 'row', rowKey);
38
+ }
39
+ /**
40
+ * `scopeId` is the owning section (top-level table) or the parent tree row (nested table);
41
+ * `name` is the table's name; `rowKey` comes from `treeRowKeys`.
42
+ */
43
+ export function treeNodeId(scopeId, name, rowKey) {
44
+ return structuralId(scopeId, 'treeNode', `${name}:${rowKey}`);
45
+ }
46
+ function treeRows(items, name, scopeId, out) {
47
+ const keys = treeRowKeys(items);
48
+ items.forEach((item, i) => {
49
+ const id = treeNodeId(scopeId, name, keys[i]);
50
+ out.push({
51
+ id,
52
+ type: 'treeNode',
53
+ apiName: item.summary ?? `${name} ${i + 1}`,
54
+ parentId: scopeId,
55
+ attributes: { element: name },
56
+ });
57
+ for (const [groupName, children] of treeGroupsOf(item)) {
58
+ treeRows(children, groupName, id, out);
59
+ }
60
+ });
61
+ }
62
+ function rowAttributes(columns, row) {
63
+ const attrs = {};
64
+ columns.forEach((c, j) => {
65
+ if (row[j]) {
66
+ // Truncate long attribute values to avoid unbounded payload
67
+ attrs[c] =
68
+ row[j].length > MAX_ATTRIBUTE_LENGTH
69
+ ? row[j].substring(0, MAX_ATTRIBUTE_LENGTH) + '…'
70
+ : row[j];
71
+ }
72
+ });
73
+ return attrs;
74
+ }
75
+ /**
76
+ * Flat node list matching, 1:1, the elements the panel stamps with `data-mv-id`.
77
+ *
78
+ * NOTE: Nodes are emitted for all list rows and tree nodes, including those not currently
79
+ * in the DOM (paged list rows, collapsed tree nodes). Marquee selection can only reach
80
+ * rendered elements, so unopened/unpaged rows cannot be selected even though their nodes
81
+ * exist. Node count is capped to prevent unbounded payloads in very large files.
82
+ */
83
+ export function keyvaluetableSelectableNodes(data) {
84
+ const out = [];
85
+ const rootId = metadataNodeId(data.apiName);
86
+ out.push({
87
+ id: rootId,
88
+ type: 'metadata',
89
+ apiName: data.apiName,
90
+ attributes: { metadataType: data.metadataType, title: data.title },
91
+ });
92
+ // Field / Value tables: ungrouped first, then one per named group (as the panel orders them).
93
+ const tables = [];
94
+ for (const e of visibleEntries(data)) {
95
+ const key = entrySectionKey(e);
96
+ let table = tables.find((t) => t.key === key);
97
+ if (!table) {
98
+ table = { key, title: entrySectionTitle(e), entries: [] };
99
+ tables.push(table);
100
+ }
101
+ table.entries.push(e);
102
+ }
103
+ tables.sort((a, b) => Number(a.key !== SETTINGS_KEY) - Number(b.key !== SETTINGS_KEY));
104
+ for (const table of tables) {
105
+ const sectionId = sectionNodeId(data.apiName, table.key);
106
+ out.push({
107
+ id: sectionId,
108
+ type: 'section',
109
+ apiName: table.title,
110
+ parentId: rootId,
111
+ attributes: { kind: 'properties' },
112
+ });
113
+ for (const e of table.entries) {
114
+ out.push({
115
+ id: propertyNodeId(sectionId, e.key),
116
+ type: 'property',
117
+ apiName: e.key,
118
+ parentId: sectionId,
119
+ attributes: { value: e.value },
120
+ });
121
+ }
122
+ }
123
+ const listKeys = sectionKeys('list', data.lists.map((l) => l.title));
124
+ data.lists.forEach((list, i) => {
125
+ if (out.length >= MAX_NODES) {
126
+ return;
127
+ } // Stop emitting if cap reached
128
+ const sectionId = sectionNodeId(data.apiName, listKeys[i]);
129
+ out.push({
130
+ id: sectionId,
131
+ type: 'section',
132
+ apiName: list.title,
133
+ parentId: rootId,
134
+ attributes: { kind: 'list' },
135
+ });
136
+ const rowKeys = listRowKeys(list.rows);
137
+ list.rows.forEach((row, r) => {
138
+ if (out.length >= MAX_NODES) {
139
+ return;
140
+ } // Stop emitting if cap reached
141
+ out.push({
142
+ id: listRowNodeId(sectionId, rowKeys[r]),
143
+ type: 'row',
144
+ apiName: row[0] || `${list.title} ${r + 1}`,
145
+ parentId: sectionId,
146
+ attributes: rowAttributes(list.columns, row),
147
+ });
148
+ });
149
+ });
150
+ const trees = data.trees ?? [];
151
+ const treeKeys = sectionKeys('tree', trees.map((t) => t.title));
152
+ trees.forEach((tree, i) => {
153
+ if (out.length >= MAX_NODES) {
154
+ return;
155
+ } // Stop emitting if cap reached
156
+ const sectionId = sectionNodeId(data.apiName, treeKeys[i]);
157
+ out.push({
158
+ id: sectionId,
159
+ type: 'section',
160
+ apiName: tree.title,
161
+ parentId: rootId,
162
+ attributes: { kind: 'tree' },
163
+ });
164
+ treeRows(tree.nodes, tree.title, sectionId, out);
165
+ });
166
+ return out;
167
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /**
8
+ * The SINGLE source of truth for how the key/value panel slices parsed data into
9
+ * sections and rows — shared by BOTH the host-side SelectionGraph projection
10
+ * (`keyvaluetableSelectionGraph.ts`) and the panel UI (`ui/components/*`).
11
+ *
12
+ * Selection works by pure `Map.get(id)`: the id the SelectionGraph emits and the
13
+ * `data-mv-id` the panel stamps must match byte-for-byte. Those ids are scoped by
14
+ * the section keys, the visible-entry filter and the tree-row identity defined
15
+ * here, so keeping ONE copy means the two sides cannot drift apart.
16
+ *
17
+ * This module is PURE (no `ui/`, no `react`), so the SelectionGraph may import it
18
+ * without dragging the Vite-wiped `ui/` tree or `react` into the parser graph —
19
+ * `__tests__/selectionGraphModuleGraph.test.ts` enforces that boundary.
20
+ */
21
+ import type { KeyValueEntry, KeyValueTableData, KeyValueTreeNode } from './types/KeyValueTableData.js';
22
+ /** Section key of the ungrouped Field / Value table. */
23
+ export declare const SETTINGS_KEY = "__settings__";
24
+ /** Title of the ungrouped Field / Value table. */
25
+ export declare const SETTINGS_TITLE = "Properties";
26
+ /** The entry the header card shows as the title, so the Fields table can skip it. */
27
+ export declare function titleKey(entries: KeyValueEntry[], title: string): string | undefined;
28
+ /**
29
+ * The scalar entries the panel lists in its Field / Value tables. The header card
30
+ * already shows the title, description, status and license, so those rows are skipped.
31
+ */
32
+ export declare function visibleEntries(data: KeyValueTableData): KeyValueEntry[];
33
+ /** Section key of the Field / Value table an entry belongs to. */
34
+ export declare function entrySectionKey(entry: KeyValueEntry): string;
35
+ /** Title of the Field / Value table an entry belongs to. */
36
+ export declare function entrySectionTitle(entry: KeyValueEntry): string;
37
+ /**
38
+ * Section keys that stay unique when titles repeat (a list and a tree can share a name):
39
+ * `<prefix>:<title>`, with `#n` appended for the second and later occurrences.
40
+ */
41
+ export declare function sectionKeys(prefix: string, titles: string[]): string[];
42
+ /**
43
+ * Identity of each row that survives a data refresh, a search filter and paging: its
44
+ * cells, with a counter so identical rows stay distinct. Not the row number — a filter
45
+ * or a page boundary changes that, and a row must keep its id.
46
+ * Uses JSON encoding to avoid ambiguity from unescaped separators.
47
+ */
48
+ export declare function listRowKeys(rows: string[][]): string[];
49
+ /** A child that holds more elements (a nested collection), as opposed to a plain field. */
50
+ export declare const isTreeGroup: (n: KeyValueTreeNode) => boolean;
51
+ /** Nested children grouped by element name, in first-seen order. */
52
+ export declare function treeGroupsOf(item: KeyValueTreeNode): Array<[string, KeyValueTreeNode[]]>;
53
+ /** The plain-field children of a tree row: the values shown in its columns. */
54
+ export declare function treeFieldsOf(item: KeyValueTreeNode): KeyValueTreeNode[];
55
+ /**
56
+ * Identity of each tree row that survives a data refresh: its summary and field values,
57
+ * with a counter so identical rows stay distinct. Open state keys off this, not the row number.
58
+ * Uses JSON encoding to avoid ambiguity from unescaped separators.
59
+ */
60
+ export declare function treeRowKeys(items: KeyValueTreeNode[]): string[];
61
+ //# sourceMappingURL=panelModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panelModel.d.ts","sourceRoot":"","sources":["../../../src/plugins/keyvaluetable/panelModel.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAEtC,wDAAwD;AACxD,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,kDAAkD;AAClD,eAAO,MAAM,cAAc,eAAe,CAAC;AAK3C,qFAAqF;AACrF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,EAAE,CAOvE;AAED,kEAAkE;AAClE,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE5D;AAED,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAOtE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAStD;AAED,2FAA2F;AAC3F,eAAO,MAAM,WAAW,GAAI,GAAG,gBAAgB,KAAG,OACK,CAAC;AAExD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAaxF;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAU/D"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Copyright (c) 2026, Salesforce, Inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ **/
7
+ /** Section key of the ungrouped Field / Value table. */
8
+ export const SETTINGS_KEY = '__settings__';
9
+ /** Title of the ungrouped Field / Value table. */
10
+ export const SETTINGS_TITLE = 'Properties';
11
+ /** Same precedence as the parser's header title. */
12
+ const TITLE_KEYS = ['label', 'masterLabel', 'name', 'fullName'];
13
+ /** The entry the header card shows as the title, so the Fields table can skip it. */
14
+ export function titleKey(entries, title) {
15
+ return TITLE_KEYS.find((k) => entries.some((e) => e.key === k && e.value === title));
16
+ }
17
+ /**
18
+ * The scalar entries the panel lists in its Field / Value tables. The header card
19
+ * already shows the title, description, status and license, so those rows are skipped.
20
+ */
21
+ export function visibleEntries(data) {
22
+ const shownAsTitle = titleKey(data.entries, data.title);
23
+ const inHeader = (e) => (e.key === 'description' && e.value === data.description) ||
24
+ (e.key === 'isActive' && data.status !== undefined) ||
25
+ ((e.key === 'license' || e.key === 'userLicense') && e.value === data.license);
26
+ return data.entries.filter((e) => e.key !== shownAsTitle && !inHeader(e));
27
+ }
28
+ /** Section key of the Field / Value table an entry belongs to. */
29
+ export function entrySectionKey(entry) {
30
+ return entry.group ? `group:${entry.group}` : SETTINGS_KEY;
31
+ }
32
+ /** Title of the Field / Value table an entry belongs to. */
33
+ export function entrySectionTitle(entry) {
34
+ return entry.group ?? SETTINGS_TITLE;
35
+ }
36
+ /**
37
+ * Section keys that stay unique when titles repeat (a list and a tree can share a name):
38
+ * `<prefix>:<title>`, with `#n` appended for the second and later occurrences.
39
+ */
40
+ export function sectionKeys(prefix, titles) {
41
+ const seen = new Map();
42
+ return titles.map((t) => {
43
+ const n = seen.get(t) ?? 0;
44
+ seen.set(t, n + 1);
45
+ return n === 0 ? `${prefix}:${t}` : `${prefix}:${t}#${n}`;
46
+ });
47
+ }
48
+ /**
49
+ * Identity of each row that survives a data refresh, a search filter and paging: its
50
+ * cells, with a counter so identical rows stay distinct. Not the row number — a filter
51
+ * or a page boundary changes that, and a row must keep its id.
52
+ * Uses JSON encoding to avoid ambiguity from unescaped separators.
53
+ */
54
+ export function listRowKeys(rows) {
55
+ const seen = new Map();
56
+ return rows.map((row) => {
57
+ // JSON.stringify ensures cells with separators are unambiguous
58
+ const sig = JSON.stringify(row);
59
+ const n = seen.get(sig) ?? 0;
60
+ seen.set(sig, n + 1);
61
+ return `${sig}#${n}`;
62
+ });
63
+ }
64
+ /** A child that holds more elements (a nested collection), as opposed to a plain field. */
65
+ export const isTreeGroup = (n) => (n.children?.length ?? 0) > 0 || n.truncated === true;
66
+ /** Nested children grouped by element name, in first-seen order. */
67
+ export function treeGroupsOf(item) {
68
+ const groups = new Map();
69
+ for (const child of item.children ?? []) {
70
+ if (isTreeGroup(child)) {
71
+ const list = groups.get(child.key);
72
+ if (list) {
73
+ list.push(child);
74
+ }
75
+ else {
76
+ groups.set(child.key, [child]);
77
+ }
78
+ }
79
+ }
80
+ return [...groups.entries()];
81
+ }
82
+ /** The plain-field children of a tree row: the values shown in its columns. */
83
+ export function treeFieldsOf(item) {
84
+ return (item.children ?? []).filter((c) => !isTreeGroup(c) && c.value !== undefined);
85
+ }
86
+ /**
87
+ * Identity of each tree row that survives a data refresh: its summary and field values,
88
+ * with a counter so identical rows stay distinct. Open state keys off this, not the row number.
89
+ * Uses JSON encoding to avoid ambiguity from unescaped separators.
90
+ */
91
+ export function treeRowKeys(items) {
92
+ const seen = new Map();
93
+ return items.map((item) => {
94
+ const fields = treeFieldsOf(item).map((f) => ({ key: f.key, value: f.value }));
95
+ // JSON.stringify ensures field names/values with separators are unambiguous
96
+ const sig = JSON.stringify({ summary: item.summary ?? '', fields });
97
+ const n = seen.get(sig) ?? 0;
98
+ seen.set(sig, n + 1);
99
+ return `${sig}#${n}`;
100
+ });
101
+ }
@@ -0,0 +1 @@
1
+ .vibe-edit-composer{--vec-canvas: var(--vscode-editor-background, light-dark(#ffffff, #181818));--vec-elevated: light-dark( color-mix(in srgb, var(--vec-canvas), var(--vec-text) 12%), color-mix(in srgb, var(--vec-canvas), var(--vec-text) 7%) );--vec-hover: var(--vscode-list-hoverBackground, light-dark(#e5e5e5, #2e2e2e));--vec-text: var(--vscode-editor-foreground, light-dark(#2e2e2e, #c9c9c9));--vec-text-secondary: var(--vscode-descriptionForeground, light-dark(#5c5c5c, #939393));--vec-text-tertiary: var(--vscode-descriptionForeground, light-dark(#696969, #848484));--vec-border: var(--vscode-panel-border, light-dark(#e5e5e5, #2e2e2e));--vec-interactive: var(--vscode-textLink-foreground, light-dark(#0250d9, #7cb1fe));--vec-info: var(--vscode-problemsInfoIcon-foreground, light-dark(#0b5cab, #78b0fd));--vec-danger: var(--vscode-list-errorForeground, light-dark(#a00449, #fe8aa7));--vec-primary: var(--vscode-button-background, light-dark(#0176d3, #0176d3));--vec-primary-fg: var(--vscode-button-foreground, light-dark(#ffffff, #ffffff));--vec-radius: .625rem;--vec-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .06);position:fixed;z-index:50;bottom:16px;left:50%;transform:translate(-50%);box-sizing:border-box;width:min(520px,calc(100% - 24px));min-width:min(280px,calc(100% - 24px));font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Noto Sans,Arial,sans-serif;font-size:.8125rem;line-height:1.45;color:var(--vec-text)}.vibe-edit-composer--positioned{bottom:auto;transform:none}.vibe-edit-composer *,.vibe-edit-composer *:before,.vibe-edit-composer *:after{box-sizing:border-box}.vibe-edit-composer__card{display:flex;flex-direction:column;gap:8px;padding-top:8px;background:var(--vec-canvas);border:1px solid var(--vec-border);border-radius:calc(var(--vec-radius) + 4px);box-shadow:var(--vec-shadow-xl)}.vibe-edit-composer__header{display:flex;align-items:center;justify-content:space-between;padding:2px 16px;color:var(--vec-text-secondary)}.vibe-edit-composer__header-actions{display:inline-flex;align-items:center;gap:2px}.vibe-edit-composer__move-handle{cursor:grab;touch-action:none}.vibe-edit-composer__move-handle:active{cursor:grabbing}.vibe-edit-composer__move-controls{display:flex;gap:4px;padding:0 16px 4px}.vibe-edit-composer__move-controls button{padding:2px 6px;color:var(--vec-text-secondary);background:transparent;border:1px solid var(--vec-border);border-radius:calc(var(--vec-radius) - 4px);cursor:pointer}.vibe-edit-composer__move-controls button:hover{background:var(--vec-hover);color:var(--vec-text)}.vibe-edit-composer__move-controls button:focus-visible{outline:1px solid var(--vscode-focusBorder, var(--vec-interactive));outline-offset:2px}.vibe-edit-composer__title{display:inline-flex;align-items:center;gap:8px}.vibe-edit-composer__title-icon{display:inline-flex;flex-shrink:0}.vibe-edit-composer__title-text{font-size:13px;font-weight:500}.vibe-edit-composer__icon-button{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:none;border-radius:calc(var(--vec-radius) - 2px);background:transparent;color:var(--vec-text-tertiary);cursor:pointer;transition:background-color .15s,color .15s}.vibe-edit-composer__icon-button--sm{width:24px;height:24px}.vibe-edit-composer__icon-button:hover:not(:disabled){background:var(--vec-hover);color:var(--vec-text)}.vibe-edit-composer__icon-button:disabled{opacity:.5;cursor:not-allowed}.vibe-edit-composer__send{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:6px 14px;font-family:inherit;font-size:.8125rem;font-weight:500;line-height:1.45;color:var(--vec-primary-fg);background:var(--vec-primary);border:none;border-radius:var(--vec-radius);cursor:pointer;transition:background-color .15s,color .15s,opacity .15s}.vibe-edit-composer__send:hover:not(:disabled){opacity:.9}.vibe-edit-composer__send:disabled{opacity:.5;cursor:not-allowed}.vibe-edit-composer__send-icon{display:flex;flex-shrink:0;align-items:center}.vibe-edit-composer__send-icon svg{display:block;width:16px;height:16px}.vibe-edit-composer__icon-button:focus,.vibe-edit-composer__send:focus{outline:none}.vibe-edit-composer__icon-button:focus-visible,.vibe-edit-composer__send:focus-visible{box-shadow:0 0 0 2px var(--vec-interactive)}@media (forced-colors: active){.vibe-edit-composer__icon-button:focus-visible,.vibe-edit-composer__send:focus-visible,.vibe-edit-composer__chip-icon-wrap:focus-visible{outline:2px solid Highlight;outline-offset:2px}.vibe-edit-composer__input-container:focus-within{outline:2px solid Highlight}.vibe-edit-composer__send{border:1px solid ButtonText}}.vibe-edit-composer__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.vibe-edit-composer__error{padding:0 16px;font-size:13px;color:var(--vec-danger)}.vibe-edit-composer__panel{position:relative}.vibe-edit-composer__input-container{position:relative;display:flex;flex-direction:column;background:var(--vec-elevated);border:1px solid var(--vec-border);border-width:1px 0 0;border-radius:calc(var(--vec-radius) + 4px);transition:border-color .15s}.vibe-edit-composer__input-container:focus-within{border-top-color:var(--vec-border);box-shadow:none}.vibe-edit-composer__editable{width:100%;min-height:64px;max-height:78px;padding:12px 16px 0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;font-size:.8125rem;font-weight:400;line-height:22px;color:var(--vec-text);white-space:pre-wrap;overflow-wrap:break-word;cursor:text}.vibe-edit-composer__text{display:inline-block;min-width:1px;min-height:22px;margin-left:6px;vertical-align:top;outline:none;caret-color:var(--vec-text)}.vibe-edit-composer__text:first-child{margin-left:0}.vibe-edit-composer__placeholder{color:var(--vec-text-secondary);pointer-events:none;-webkit-user-select:none;user-select:none}.vibe-edit-composer__text[contenteditable=false]{cursor:not-allowed}.vibe-edit-composer__chip{position:relative;top:-1px;display:inline-flex;align-items:center;gap:3px;max-width:100%;margin:0 2px;padding:2px 8px 2px 4px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.75rem;font-weight:500;line-height:16px;color:var(--vec-text-secondary);white-space:nowrap;vertical-align:middle;-webkit-user-select:none;user-select:none;background:var(--vec-canvas);border:1px solid var(--vec-border);border-radius:calc(var(--vec-radius) - 4px)}.vibe-edit-composer__chip-icon-wrap{position:relative;display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:16px;height:16px;padding:0;color:inherit;background:transparent;border:none}.vibe-edit-composer__chip-icon,.vibe-edit-composer__chip-x{position:absolute;top:50%;left:50%;width:12px;height:12px;transform:translate(-50%,-50%)}.vibe-edit-composer__chip-icon{color:var(--vec-info);opacity:.7}.vibe-edit-composer__chip-x{cursor:pointer;opacity:0}.vibe-edit-composer__chip:hover .vibe-edit-composer__chip-icon,.vibe-edit-composer__chip-icon-wrap:focus-visible .vibe-edit-composer__chip-icon{opacity:0}.vibe-edit-composer__chip:hover .vibe-edit-composer__chip-x,.vibe-edit-composer__chip-icon-wrap:focus-visible .vibe-edit-composer__chip-x{opacity:.7}.vibe-edit-composer__chip-icon-wrap:disabled{cursor:not-allowed}.vibe-edit-composer__chip-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vibe-edit-composer__footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;padding:4px 12px 12px}.vibe-edit-composer__controls{position:relative;display:flex;flex-shrink:0;align-items:center;gap:6px}.vibe-edit-composer__pulse-layer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30;pointer-events:none}.vibe-edit-composer__pulse{position:fixed;box-sizing:border-box;border:2px solid var(--vscode-button-background, #0176d3);border-radius:6px;box-shadow:0 0 0 4px color-mix(in srgb,var(--vscode-button-background, #0176d3) 25%,transparent);animation:vibe-edit-composer-pulse 1.1s ease-in-out infinite}@keyframes vibe-edit-composer-pulse{0%,to{opacity:1}50%{opacity:.45}}@media (prefers-reduced-motion: reduce){.vibe-edit-composer__pulse{animation:none}}
@@ -0,0 +1 @@
1
+ import{r,R as t,S as he,A as be}from"./index-CKi34Iea.js";const k=12,re=12;function ce(o,u,c){const b=Math.max(c.left+k,c.left+c.width-u.width-k),a=Math.max(c.top+k,c.top+c.height-u.height-k);return{left:Math.min(Math.max(o.left,c.left+k),b),top:Math.min(Math.max(o.top,c.top+k),a)}}function ve(o,u,c){const b=o.left+o.width+re,a=o.left-u.width-re,m=b+u.width<=c.left+c.width-k;return ce({left:m?b:a,top:o.top},u,c)}function Ee(){return t.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true"},he.map(o=>t.createElement("path",{key:o,d:o,fill:"currentColor"})))}function ge(){return t.createElement("svg",{width:"40",height:"48",viewBox:"0 0 40 48.3291",preserveAspectRatio:"xMidYMid meet",overflow:"visible",fill:"none","aria-hidden":"true"},be.map(o=>t.createElement("path",{key:o,d:o,fill:"currentColor"})))}function O({size:o,className:u,children:c}){return t.createElement("svg",{className:u,width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},c)}const oe=t.createElement(t.Fragment,null,t.createElement("path",{d:"M18 6 6 18"}),t.createElement("path",{d:"m6 6 12 12"})),_e=t.createElement(t.Fragment,null,t.createElement("circle",{cx:"8",cy:"6",r:"1",fill:"currentColor",stroke:"none"}),t.createElement("circle",{cx:"16",cy:"6",r:"1",fill:"currentColor",stroke:"none"}),t.createElement("circle",{cx:"8",cy:"12",r:"1",fill:"currentColor",stroke:"none"}),t.createElement("circle",{cx:"16",cy:"12",r:"1",fill:"currentColor",stroke:"none"}),t.createElement("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),t.createElement("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"}));function X(o){return{left:o.left,top:o.top,width:o.width,height:o.height}}function ie(){return{left:0,top:0,width:window.innerWidth,height:window.innerHeight}}function we({ids:o,nodeFor:u}){const[c,b]=r.useState([]);return r.useEffect(()=>{let a=0;const m=()=>{const f=[];for(const p of o){const h=u(p);if(!h)continue;const s=h.getBoundingClientRect();f.push({id:p,x:s.x,y:s.y,width:s.width,height:s.height})}b(p=>p.length===f.length&&p.every((h,s)=>h.id===f[s].id&&h.x===f[s].x&&h.y===f[s].y&&h.width===f[s].width&&h.height===f[s].height)?p:f),a=requestAnimationFrame(m)};return a=requestAnimationFrame(m),()=>cancelAnimationFrame(a)},[o,u]),c.length===0?null:t.createElement("div",{className:"vibe-edit-composer__pulse-layer","aria-hidden":"true"},c.map(a=>t.createElement("div",{key:a.id,className:"vibe-edit-composer__pulse",style:{left:a.x,top:a.y,width:a.width,height:a.height}})))}function ke({elements:o,nodeFor:u,onEdit:c,onDeselect:b,onSent:a,onClose:m,onDraftChange:f}){const[p,h]=r.useState(""),[s,I]=r.useState("idle"),[ae,z]=r.useState(""),[A,Y]=r.useState([]),[F,G]=r.useState(""),C=r.useRef(null),T=r.useRef(null),[L,P]=r.useState(null),v=r.useRef(null),[H,K]=r.useState(!1),W=r.useId(),g=r.useRef(!1),V=r.useRef(null),_=r.useRef(null),U=r.useRef(!1),M=r.useRef(null),$=r.useRef(!1),S=r.useRef(!0);r.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const x=o.length,y=x>0,R=s==="applying",q=y&&p.trim().length>0&&!R,j=y&&p.trim().length>0;r.useEffect(()=>{f==null||f(j)},[j,f]);const w=r.useCallback(e=>{const n=T.current;if(!n)return;const l=ce(e,X(n.getBoundingClientRect()),ie());v.current=l,P(i=>i&&i.left===l.left&&i.top===l.top?i:l)},[]);r.useLayoutEffect(()=>{if(!y){g.current=!1,v.current=null,P(null),K(!1);return}const e=T.current;if(!e)return;const n=o[0].id;V.current!==n&&(V.current=n,g.current=!1);const l=()=>{if(g.current){v.current&&w(v.current);return}const ne=u(o[0].id);if(!ne)return;const D=ve(X(ne.getBoundingClientRect()),X(e.getBoundingClientRect()),ie());v.current=D,P(B=>B&&B.left===D.left&&B.top===D.top?B:D)};l();let i=0;const d=()=>{i===0&&(i=requestAnimationFrame(()=>{i=0,l()}))};window.addEventListener("resize",d),window.addEventListener("scroll",d,!0),window.addEventListener("pointermove",d,!0),window.addEventListener("wheel",d,!0);const E=typeof ResizeObserver>"u"?null:new ResizeObserver(l);return E==null||E.observe(e),E==null||E.observe(u(o[0].id)??e),()=>{cancelAnimationFrame(i),window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0),window.removeEventListener("pointermove",d,!0),window.removeEventListener("wheel",d,!0),E==null||E.disconnect()}},[o,y,u,w]);const N=r.useCallback((e,n)=>{g.current=!0;const l=v.current??{left:12,top:12};w({left:l.left+e,top:l.top+n})},[w]),se=r.useCallback(e=>{if(e.button!==0)return;const n=T.current;if(!n)return;const l=X(n.getBoundingClientRect()),i=g.current,d=v.current??{left:l.left,top:l.top};w(d),_.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,position:d,wasManuallyPositioned:i,moved:!1},e.currentTarget.setPointerCapture(e.pointerId),e.currentTarget.focus(),e.preventDefault(),e.stopPropagation()},[w]),le=r.useCallback(e=>{const n=_.current;!n||n.pointerId!==e.pointerId||(!n.moved&&Math.hypot(e.clientX-n.startX,e.clientY-n.startY)>3&&(g.current=!0,n.moved=!0),w({left:n.position.left+e.clientX-n.startX,top:n.position.top+e.clientY-n.startY}),e.preventDefault(),e.stopPropagation())},[w]),ue=r.useCallback(e=>{const n=_.current;!n||n.pointerId!==e.pointerId||(_.current=null,U.current=n.moved,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),J=r.useCallback(e=>{const n=_.current;!n||n.pointerId!==e.pointerId||(_.current=null,g.current=n.wasManuallyPositioned,v.current=n.position,P(n.position),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))},[]),de=r.useCallback(e=>{const n=e.shiftKey?32:16,i={ArrowLeft:{left:-n,top:0},ArrowRight:{left:n,top:0},ArrowUp:{left:0,top:-n},ArrowDown:{left:0,top:n}}[e.key];if(i)e.preventDefault(),N(i.left,i.top);else if(e.key==="Escape"){e.preventDefault(),e.stopPropagation();const d=_.current;d&&(g.current=d.wasManuallyPositioned,v.current=d.position,P(d.position),_.current=null),K(!1)}},[N]);r.useEffect(()=>{var e;y&&((e=C.current)==null||e.focus())},[y]);const Q=r.useCallback(()=>{h(""),C.current&&(C.current.textContent="")},[]),Z=r.useCallback(async()=>{if(!q||$.current)return;$.current=!0;const e=p.trim(),n=o.map(i=>i.id),l=M.current?{kind:"existing",id:M.current.id,label:M.current.label}:{kind:"new"};I("applying"),Y(n);try{const i=await c(n,e,l);i&&i.chatId&&(M.current={id:i.chatId,label:i.chatLabel??"Edits"}),S.current&&(Q(),I("idle"),z(""),G("Sent to Agentforce Vibes"),a==null||a())}catch(i){S.current&&(Y([]),z(i instanceof Error&&i.message.length>0?i.message:"That edit couldn’t be sent. Try again."),I("error"))}finally{$.current=!1}},[q,Q,p,o,c,a]);r.useEffect(()=>{var e;s==="error"&&((e=C.current)==null||e.focus())},[s]),r.useEffect(()=>{if(!F)return;const e=setTimeout(()=>G(""),4e3);return()=>clearTimeout(e)},[F]),r.useEffect(()=>{if(s!=="idle"||A.length===0)return;const e=setTimeout(()=>Y([]),1200);return()=>clearTimeout(e)},[s,A]);const ee=()=>{o.forEach(e=>b(e.id)),m==null||m()},te=e=>{b(e.id),G(`Removed ${e.label}, ${x-1} selected`),x===1&&(m==null||m())},fe=e=>{h(e.currentTarget.textContent??""),s==="error"&&(z(""),I("idle"))},pe=e=>{e.key==="Enter"&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),Z()):e.key==="Escape"?(e.preventDefault(),ee()):e.key==="Backspace"&&p.length===0&&x>0&&(e.preventDefault(),te(o[x-1]))},me=e=>{var n;e.target===e.currentTarget&&((n=C.current)==null||n.focus())};return t.createElement(t.Fragment,null,t.createElement("span",{className:"vibe-edit-composer__sr-only",role:"status","aria-live":"polite"},F),A.length>0&&t.createElement(we,{ids:A,nodeFor:u}),y&&t.createElement("div",{className:`vibe-edit-composer${L?" vibe-edit-composer--positioned":""}`,role:"dialog","aria-label":"Edit selected metadata with the agent",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),style:L?{left:L.left,top:L.top}:void 0},t.createElement("div",{ref:T,className:"vibe-edit-composer__card"},t.createElement("div",{className:"vibe-edit-composer__header"},t.createElement("span",{className:"vibe-edit-composer__title"},t.createElement("span",{className:"vibe-edit-composer__title-icon"},t.createElement(Ee,null)),t.createElement("span",{className:"vibe-edit-composer__title-text"},x," selected")),t.createElement("span",{className:"vibe-edit-composer__header-actions"},t.createElement("button",{type:"button",className:"vibe-edit-composer__icon-button vibe-edit-composer__icon-button--sm vibe-edit-composer__move-handle","aria-label":"Move composer","aria-expanded":H,"aria-controls":H?W:void 0,title:"Drag to move composer. Arrow keys move it when focused.",onClick:()=>{if(U.current){U.current=!1;return}K(e=>!e)},onPointerDown:se,onPointerMove:le,onPointerUp:ue,onPointerCancel:J,onLostPointerCapture:J,onKeyDown:de,disabled:R},t.createElement(O,{size:16},_e)),t.createElement("button",{type:"button",className:"vibe-edit-composer__icon-button vibe-edit-composer__icon-button--sm","aria-label":"Exit select to edit",title:"Exit",onClick:ee,disabled:R},t.createElement(O,{size:16},oe)))),H&&t.createElement("div",{id:W,className:"vibe-edit-composer__move-controls",role:"group","aria-label":"Move composer controls"},t.createElement("button",{type:"button",onClick:()=>N(0,-16),"aria-label":"Move composer up"},"Up"),t.createElement("button",{type:"button",onClick:()=>N(-16,0),"aria-label":"Move composer left"},"Left"),t.createElement("button",{type:"button",onClick:()=>N(16,0),"aria-label":"Move composer right"},"Right"),t.createElement("button",{type:"button",onClick:()=>N(0,16),"aria-label":"Move composer down"},"Down")),s==="error"&&t.createElement("div",{className:"vibe-edit-composer__error",role:"alert"},ae),t.createElement("div",{className:"vibe-edit-composer__panel"},t.createElement("div",{className:"vibe-edit-composer__input-container"},t.createElement("div",{className:"vibe-edit-composer__editable",onClick:me},o.map(e=>t.createElement("span",{key:e.id,className:"vibe-edit-composer__chip",role:"group","aria-label":e.label,title:e.label},t.createElement("button",{type:"button",className:"vibe-edit-composer__chip-icon-wrap","aria-label":`Remove ${e.label} from selection`,onClick:()=>te(e),disabled:R},t.createElement(O,{size:12,className:"vibe-edit-composer__chip-icon"},t.createElement("path",{d:"M16 18l6-6-6-6"}),t.createElement("path",{d:"M8 6l-6 6 6 6"})),t.createElement(O,{size:12,className:"vibe-edit-composer__chip-x"},oe)),t.createElement("span",{className:"vibe-edit-composer__chip-label"},e.label))),t.createElement("span",{ref:C,className:"vibe-edit-composer__text",contentEditable:R?!1:"plaintext-only",suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":"Describe your edits…","aria-busy":R||void 0,onInput:fe,onKeyDown:pe}),p.length===0&&t.createElement("span",{className:"vibe-edit-composer__placeholder","aria-hidden":"true"},"Describe your edits…")),t.createElement("div",{className:"vibe-edit-composer__footer"},t.createElement("div",{className:"vibe-edit-composer__controls"},t.createElement("button",{type:"button",className:"vibe-edit-composer__send",disabled:!q,onClick:()=>void Z(),"aria-label":"Send to Agent",title:M.current?"Adds to the edits chat":"Opens in a new chat"},t.createElement("span",{className:"vibe-edit-composer__send-icon"},t.createElement(ge,null)),"Send to Agent"))))))))}export{ke as default};
@@ -0,0 +1 @@
1
+ .mv-marquee-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:15;cursor:crosshair;background:transparent}.mv-marquee-overlay--panning{pointer-events:none}.mv-marquee-box{position:absolute;pointer-events:none;background:color-mix(in srgb,var(--mv-interactive-primary) 14%,transparent);border:1px solid var(--mv-interactive-primary);border-radius:var(--mv-radius-sm)}:root[data-mv-host-chrome] .mv-marquee-box{background:color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 12%,transparent);border:1px dashed color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 90%,transparent);border-radius:4px}.mv-select-glow-layer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9998;pointer-events:none}.mv-select-glow{position:fixed;border-radius:var(--mv-radius-md, 8px);box-shadow:0 0 0 0 transparent;transition:box-shadow .45s ease}.mv-select-glow--on{box-shadow:0 0 0 1.5px color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 30%,transparent),0 0 14px 3px color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 26%,transparent)}.mv-select-hint{position:fixed;top:56px;left:50%;z-index:10000;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 32px);padding:8px 8px 8px 14px;border:1px solid var(--mv-border-default, #454545);border-radius:var(--mv-radius-lg, 8px);background:var(--mv-bg-surface, #252526);color:var(--mv-text-primary, #cccccc);box-shadow:0 4px 16px #0000005c;font-size:13px;font-weight:500;opacity:0;transform:translate(-50%) translateY(-4px);transition:opacity .34s ease,transform .34s ease;pointer-events:none}.mv-select-hint--visible{opacity:1;transform:translate(-50%) translateY(0);pointer-events:auto}.mv-select-hint__icon{display:inline-flex;color:var(--mv-text-secondary, #999999)}.mv-select-hint__dismiss{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--mv-text-secondary, #999999);cursor:pointer}.mv-select-hint__dismiss:hover{background:color-mix(in srgb,currentColor 12%,transparent)}.mv-select-hint__dismiss:focus-visible{outline:2px solid var(--mv-interactive-primary, #2864f6);outline-offset:1px}@media (prefers-reduced-motion: reduce){.mv-select-glow,.mv-select-hint{transition:none}}.vibe-edit-panel{position:absolute;bottom:var(--mv-spacing-md);left:50%;transform:translate(-50%);z-index:20;width:min(560px,calc(100% - 2 * var(--mv-spacing-md)));max-height:calc(100% - 2 * var(--mv-spacing-md));display:flex;flex-direction:column;gap:var(--mv-spacing-sm);padding:var(--mv-spacing-md);overflow:hidden;background:var(--mv-panel-bg);border:1px solid var(--mv-panel-border);border-radius:var(--mv-radius-lg);box-shadow:var(--mv-shadow-xl);font-family:var(--mv-font-family)}.vibe-edit-panel__header{display:flex;align-items:center;justify-content:space-between}.vibe-edit-panel__title{font-size:var(--mv-font-size-sm);font-weight:var(--mv-font-weight-semibold);color:var(--mv-text-primary)}.vibe-edit-panel__close{border:none;background:transparent;color:var(--mv-text-secondary);cursor:pointer;font-size:var(--mv-font-size-sm);line-height:1;padding:var(--mv-spacing-xs);border-radius:var(--mv-radius-sm);transition:background var(--mv-transition-fast)}.vibe-edit-panel__close:hover{background:var(--mv-bg-surface-hover);color:var(--mv-text-primary)}.vibe-edit-panel__chips{display:flex;flex-wrap:wrap;gap:var(--mv-spacing-xs);flex:1 1 auto;min-height:0;max-height:96px;overflow-y:auto}.vibe-edit-panel__chip{display:inline-flex;align-items:center;gap:var(--mv-spacing-xs);max-width:180px;padding:2px 2px 2px var(--mv-spacing-sm);font-size:var(--mv-font-size-2xs);font-family:var(--mv-font-family-mono);color:var(--mv-text-primary);background:var(--mv-panel-bg);border:1px solid var(--mv-border-default);border-radius:var(--mv-radius-full)}.vibe-edit-panel__chip-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.vibe-edit-panel__chip-remove{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:16px;height:16px;padding:0;border:none;border-radius:var(--mv-radius-full);background:var(--mv-bg-surface-hover);color:var(--mv-text-secondary);font-size:10px;line-height:1;cursor:pointer;transition:background var(--mv-transition-fast),color var(--mv-transition-fast)}.vibe-edit-panel__chip-remove:hover{background:var(--mv-interactive-primary);color:var(--mv-button-primary-fg)}.vibe-edit-panel__chip-remove:focus-visible{outline:2px solid var(--mv-border-focus);outline-offset:1px}.vibe-edit-panel__chip--field{color:var(--mv-text-secondary);border-color:var(--mv-border-hover, var(--mv-border-default));background:var(--mv-panel-bg)}.vibe-edit-panel__input-wrap{position:relative;display:flex}.vibe-edit-panel__input{width:100%;resize:vertical;min-height:48px;padding:var(--mv-spacing-sm);padding-bottom:calc(var(--mv-spacing-md) + 24px);font-family:var(--mv-font-family);font-size:var(--mv-font-size-sm);line-height:var(--mv-line-height-normal);color:var(--mv-text-primary);background:var(--mv-bg-input);border:1px solid var(--mv-border-input);border-radius:var(--mv-radius-md);box-sizing:border-box}.vibe-edit-panel__input:focus{outline:none;border-color:var(--mv-border-focus)}.vibe-edit-panel__footer{display:flex;align-items:center;justify-content:space-between}.vibe-edit-panel__hint{font-size:var(--mv-font-size-2xs);color:var(--mv-text-muted)}.vibe-edit-panel__submit{position:absolute;right:var(--mv-spacing-sm);bottom:var(--mv-spacing-sm);display:inline-flex;align-items:center;gap:var(--mv-spacing-xs);padding:var(--mv-spacing-2xs, 4px) var(--mv-spacing-sm);font-size:var(--mv-font-size-xs);font-weight:var(--mv-font-weight-medium);color:var(--mv-button-primary-fg);background:var(--mv-interactive-primary);border:none;border-radius:var(--mv-radius-md);cursor:pointer;transition:opacity var(--mv-transition-fast)}.vibe-edit-panel__submit:disabled{opacity:.5;cursor:not-allowed}.vibe-edit-panel__submit:not(:disabled):hover{opacity:.9}.mv-vibe-edit-toggle{display:inline-flex;align-items:center;gap:var(--mv-spacing-xs);padding:var(--mv-spacing-xs) var(--mv-spacing-md);font-size:var(--mv-font-size-xs);font-weight:var(--mv-font-weight-medium);color:var(--mv-text-primary);background:var(--mv-bg-surface);border:1px solid var(--mv-border-default);border-radius:var(--mv-radius-md);cursor:pointer;transition:all var(--mv-transition-fast)}.mv-vibe-edit-toggle:hover{background:var(--mv-bg-surface-hover);border-color:var(--mv-border-hover, var(--mv-border-default))}.mv-vibe-edit-toggle--active{color:var(--mv-interactive-primary);background:var(--mv-interactive-primary-subtle, color-mix(in srgb, var(--mv-interactive-primary) 10%, transparent));border-color:var(--mv-interactive-primary)}[data-mv-hover]{outline:2px dashed var(--mv-interactive-primary);outline-offset:-2px;border-radius:var(--mv-radius-sm);background-color:color-mix(in srgb,var(--mv-interactive-primary) 8%,transparent)}[data-mv-selected]{outline:2px solid var(--mv-interactive-primary);outline-offset:-2px;border-radius:var(--mv-radius-sm);background-color:color-mix(in srgb,var(--mv-interactive-primary) 16%,transparent);box-shadow:0 0 0 1px color-mix(in srgb,var(--mv-interactive-primary) 40%,transparent)}:root[data-mv-host-chrome] [data-mv-hover]{outline:2px solid color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 60%,transparent);outline-offset:-2px;background-color:transparent}:root[data-mv-host-chrome] [data-mv-selected]{outline:2px solid var(--mv-interactive-primary, #2864f6);outline-offset:-2px;background-color:color-mix(in srgb,var(--mv-interactive-primary, #2864f6) 6%,transparent);box-shadow:none}html,body,#root,.keyvaluetable-app{height:100%;margin:0;padding:0}