@salesforce/metadata-core-sdk 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.
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.css +5 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.d.ts.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js +39 -2
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.d.ts.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js +3 -6
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.css +460 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.d.ts +65 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.js +456 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.d.ts +19 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.js +23 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.d.ts +8 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.js +33 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/composerPlacement.test.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.d.ts +12 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.js +29 -0
- package/dist/sdk/hooks/vibe-edit/ui/composer/iconPaths.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts +10 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts.map +1 -1
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js +154 -9
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js.map +1 -1
- package/dist/sdk/utils/HostCommunicationUtils.d.ts +28 -1
- package/dist/sdk/utils/HostCommunicationUtils.d.ts.map +1 -1
- package/dist/sdk/utils/HostCommunicationUtils.js +67 -1
- package/dist/sdk/utils/HostCommunicationUtils.js.map +1 -1
- package/dist/sdk/webviewMessageTypes.d.ts +43 -7
- package/dist/sdk/webviewMessageTypes.d.ts.map +1 -1
- package/dist/sdk/webviewMessageTypes.js +2 -0
- package/dist/sdk/webviewMessageTypes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,460 @@
|
|
|
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
|
+
/* VS Code vibe-edit composer — the "Select to Edit" popover.
|
|
9
|
+
Styled to match the Agentforce Vibes select-to-edit composer: the same
|
|
10
|
+
VS Code theme variables, radii, spacing and type scale. Every rule is a plain
|
|
11
|
+
class selector (unlayered) so it also beats the host's global element resets
|
|
12
|
+
such as `button { background: none }`. */
|
|
13
|
+
|
|
14
|
+
.vibe-edit-composer {
|
|
15
|
+
--vec-canvas: var(--vscode-editor-background, light-dark(#ffffff, #181818));
|
|
16
|
+
/* The composer panel sits one step off the canvas. Derived from the canvas and
|
|
17
|
+
text colours so it tracks any theme and lands on the reference's #e5e5e5 /
|
|
18
|
+
#242424 on the default light / dark palettes. */
|
|
19
|
+
--vec-elevated: light-dark(
|
|
20
|
+
color-mix(in srgb, var(--vec-canvas), var(--vec-text) 12%),
|
|
21
|
+
color-mix(in srgb, var(--vec-canvas), var(--vec-text) 7%)
|
|
22
|
+
);
|
|
23
|
+
--vec-hover: var(--vscode-list-hoverBackground, light-dark(#e5e5e5, #2e2e2e));
|
|
24
|
+
--vec-text: var(--vscode-editor-foreground, light-dark(#2e2e2e, #c9c9c9));
|
|
25
|
+
--vec-text-secondary: var(--vscode-descriptionForeground, light-dark(#5c5c5c, #939393));
|
|
26
|
+
--vec-text-tertiary: var(--vscode-descriptionForeground, light-dark(#696969, #848484));
|
|
27
|
+
--vec-border: var(--vscode-panel-border, light-dark(#e5e5e5, #2e2e2e));
|
|
28
|
+
--vec-interactive: var(--vscode-textLink-foreground, light-dark(#0250d9, #7cb1fe));
|
|
29
|
+
--vec-info: var(--vscode-problemsInfoIcon-foreground, light-dark(#0b5cab, #78b0fd));
|
|
30
|
+
--vec-danger: var(--vscode-list-errorForeground, light-dark(#a00449, #fe8aa7));
|
|
31
|
+
--vec-primary: var(--vscode-button-background, light-dark(#0176d3, #0176d3));
|
|
32
|
+
--vec-primary-fg: var(--vscode-button-foreground, light-dark(#ffffff, #ffffff));
|
|
33
|
+
--vec-radius: 0.625rem;
|
|
34
|
+
--vec-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
|
|
35
|
+
|
|
36
|
+
position: fixed;
|
|
37
|
+
z-index: 50;
|
|
38
|
+
bottom: 16px;
|
|
39
|
+
left: 50%;
|
|
40
|
+
transform: translateX(-50%);
|
|
41
|
+
box-sizing: border-box;
|
|
42
|
+
width: min(520px, calc(100% - 24px));
|
|
43
|
+
min-width: min(280px, calc(100% - 24px));
|
|
44
|
+
font-family:
|
|
45
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial,
|
|
46
|
+
sans-serif;
|
|
47
|
+
font-size: 0.8125rem;
|
|
48
|
+
line-height: 1.45;
|
|
49
|
+
color: var(--vec-text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.vibe-edit-composer--positioned {
|
|
53
|
+
bottom: auto;
|
|
54
|
+
transform: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.vibe-edit-composer *,
|
|
58
|
+
.vibe-edit-composer *::before,
|
|
59
|
+
.vibe-edit-composer *::after {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.vibe-edit-composer__card {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
gap: 8px;
|
|
67
|
+
padding-top: 8px;
|
|
68
|
+
background: var(--vec-canvas);
|
|
69
|
+
border: 1px solid var(--vec-border);
|
|
70
|
+
border-radius: calc(var(--vec-radius) + 4px);
|
|
71
|
+
box-shadow: var(--vec-shadow-xl);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ---- Header ---------------------------------------------------------- */
|
|
75
|
+
|
|
76
|
+
.vibe-edit-composer__header {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
padding: 2px 16px;
|
|
81
|
+
color: var(--vec-text-secondary);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.vibe-edit-composer__header-actions {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 2px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.vibe-edit-composer__move-handle {
|
|
91
|
+
cursor: grab;
|
|
92
|
+
touch-action: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.vibe-edit-composer__move-handle:active {
|
|
96
|
+
cursor: grabbing;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.vibe-edit-composer__move-controls {
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: 4px;
|
|
102
|
+
padding: 0 16px 4px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.vibe-edit-composer__move-controls button {
|
|
106
|
+
padding: 2px 6px;
|
|
107
|
+
color: var(--vec-text-secondary);
|
|
108
|
+
background: transparent;
|
|
109
|
+
border: 1px solid var(--vec-border);
|
|
110
|
+
border-radius: calc(var(--vec-radius) - 4px);
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.vibe-edit-composer__move-controls button:hover {
|
|
115
|
+
background: var(--vec-hover);
|
|
116
|
+
color: var(--vec-text);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.vibe-edit-composer__move-controls button:focus-visible {
|
|
120
|
+
outline: 1px solid var(--vscode-focusBorder, var(--vec-interactive));
|
|
121
|
+
outline-offset: 2px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.vibe-edit-composer__title {
|
|
125
|
+
display: inline-flex;
|
|
126
|
+
align-items: center;
|
|
127
|
+
gap: 8px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.vibe-edit-composer__title-icon {
|
|
131
|
+
display: inline-flex;
|
|
132
|
+
flex-shrink: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.vibe-edit-composer__title-text {
|
|
136
|
+
font-size: 13px;
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ---- Buttons (icon + primary) --------------------------------------- */
|
|
141
|
+
|
|
142
|
+
.vibe-edit-composer__icon-button {
|
|
143
|
+
display: inline-flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
padding: 4px;
|
|
147
|
+
border: none;
|
|
148
|
+
border-radius: calc(var(--vec-radius) - 2px);
|
|
149
|
+
background: transparent;
|
|
150
|
+
color: var(--vec-text-tertiary);
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
transition:
|
|
153
|
+
background-color 150ms,
|
|
154
|
+
color 150ms;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.vibe-edit-composer__icon-button--sm {
|
|
158
|
+
width: 24px;
|
|
159
|
+
height: 24px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.vibe-edit-composer__icon-button:hover:not(:disabled) {
|
|
163
|
+
background: var(--vec-hover);
|
|
164
|
+
color: var(--vec-text);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.vibe-edit-composer__icon-button:disabled {
|
|
168
|
+
opacity: 0.5;
|
|
169
|
+
cursor: not-allowed;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.vibe-edit-composer__send {
|
|
173
|
+
display: inline-flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: center;
|
|
176
|
+
gap: 8px;
|
|
177
|
+
padding: 6px 14px;
|
|
178
|
+
font-family: inherit;
|
|
179
|
+
font-size: 0.8125rem;
|
|
180
|
+
font-weight: 500;
|
|
181
|
+
line-height: 1.45;
|
|
182
|
+
color: var(--vec-primary-fg);
|
|
183
|
+
background: var(--vec-primary);
|
|
184
|
+
border: none;
|
|
185
|
+
border-radius: var(--vec-radius);
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
transition:
|
|
188
|
+
background-color 150ms,
|
|
189
|
+
color 150ms,
|
|
190
|
+
opacity 150ms;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.vibe-edit-composer__send:hover:not(:disabled) {
|
|
194
|
+
opacity: 0.9;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.vibe-edit-composer__send:disabled {
|
|
198
|
+
opacity: 0.5;
|
|
199
|
+
cursor: not-allowed;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.vibe-edit-composer__send-icon {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
align-items: center;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.vibe-edit-composer__send-icon svg {
|
|
209
|
+
display: block;
|
|
210
|
+
width: 16px;
|
|
211
|
+
height: 16px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.vibe-edit-composer__icon-button:focus,
|
|
215
|
+
.vibe-edit-composer__send:focus {
|
|
216
|
+
outline: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.vibe-edit-composer__icon-button:focus-visible,
|
|
220
|
+
.vibe-edit-composer__send:focus-visible {
|
|
221
|
+
box-shadow: 0 0 0 2px var(--vec-interactive);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* box-shadow is dropped in forced-colors / high-contrast modes; use real outlines. */
|
|
225
|
+
@media (forced-colors: active) {
|
|
226
|
+
.vibe-edit-composer__icon-button:focus-visible,
|
|
227
|
+
.vibe-edit-composer__send:focus-visible,
|
|
228
|
+
.vibe-edit-composer__chip-icon-wrap:focus-visible {
|
|
229
|
+
outline: 2px solid Highlight;
|
|
230
|
+
outline-offset: 2px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.vibe-edit-composer__input-container:focus-within {
|
|
234
|
+
outline: 2px solid Highlight;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.vibe-edit-composer__send {
|
|
238
|
+
border: 1px solid ButtonText;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.vibe-edit-composer__sr-only {
|
|
243
|
+
position: absolute;
|
|
244
|
+
width: 1px;
|
|
245
|
+
height: 1px;
|
|
246
|
+
padding: 0;
|
|
247
|
+
margin: -1px;
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
clip-path: inset(50%);
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
border: 0;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* ---- Error ----------------------------------------------------------- */
|
|
255
|
+
|
|
256
|
+
.vibe-edit-composer__error {
|
|
257
|
+
padding: 0 16px;
|
|
258
|
+
font-size: 13px;
|
|
259
|
+
color: var(--vec-danger);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* ---- Composer panel -------------------------------------------------- */
|
|
263
|
+
|
|
264
|
+
.vibe-edit-composer__panel {
|
|
265
|
+
position: relative;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.vibe-edit-composer__input-container {
|
|
269
|
+
position: relative;
|
|
270
|
+
display: flex;
|
|
271
|
+
flex-direction: column;
|
|
272
|
+
background: var(--vec-elevated);
|
|
273
|
+
border: 1px solid var(--vec-border);
|
|
274
|
+
border-width: 1px 0 0;
|
|
275
|
+
border-radius: calc(var(--vec-radius) + 4px);
|
|
276
|
+
transition: border-color 150ms;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* The composer programmatically returns focus after a failed send. */
|
|
280
|
+
.vibe-edit-composer__input-container:focus-within {
|
|
281
|
+
border-top-color: var(--vec-border);
|
|
282
|
+
box-shadow: none;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.vibe-edit-composer__editable {
|
|
286
|
+
width: 100%;
|
|
287
|
+
min-height: 64px;
|
|
288
|
+
/* Three 22px lines plus the top inset keep long selections within the composer. */
|
|
289
|
+
max-height: 78px;
|
|
290
|
+
padding: 12px 16px 0;
|
|
291
|
+
overflow-y: auto;
|
|
292
|
+
overscroll-behavior: contain;
|
|
293
|
+
scrollbar-gutter: stable;
|
|
294
|
+
font-size: 0.8125rem;
|
|
295
|
+
font-weight: 400;
|
|
296
|
+
line-height: 22px;
|
|
297
|
+
color: var(--vec-text);
|
|
298
|
+
white-space: pre-wrap;
|
|
299
|
+
overflow-wrap: break-word;
|
|
300
|
+
cursor: text;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* An empty inline span cannot show a caret in Chrome, so the field is a 1px
|
|
304
|
+
inline-block and the placeholder is a separate, non-interactive sibling. */
|
|
305
|
+
.vibe-edit-composer__text {
|
|
306
|
+
display: inline-block;
|
|
307
|
+
min-width: 1px;
|
|
308
|
+
min-height: 22px;
|
|
309
|
+
margin-left: 6px;
|
|
310
|
+
vertical-align: top;
|
|
311
|
+
outline: none;
|
|
312
|
+
caret-color: var(--vec-text);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.vibe-edit-composer__text:first-child {
|
|
316
|
+
margin-left: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.vibe-edit-composer__placeholder {
|
|
320
|
+
color: var(--vec-text-secondary);
|
|
321
|
+
pointer-events: none;
|
|
322
|
+
user-select: none;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.vibe-edit-composer__text[contenteditable='false'] {
|
|
326
|
+
cursor: not-allowed;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* ---- Selection chip (inline @mention token) ------------------------- */
|
|
330
|
+
|
|
331
|
+
.vibe-edit-composer__chip {
|
|
332
|
+
position: relative;
|
|
333
|
+
top: -1px;
|
|
334
|
+
display: inline-flex;
|
|
335
|
+
align-items: center;
|
|
336
|
+
gap: 3px;
|
|
337
|
+
max-width: 100%;
|
|
338
|
+
margin: 0 2px;
|
|
339
|
+
padding: 2px 8px 2px 4px;
|
|
340
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
341
|
+
font-size: 0.75rem;
|
|
342
|
+
font-weight: 500;
|
|
343
|
+
line-height: 16px;
|
|
344
|
+
color: var(--vec-text-secondary);
|
|
345
|
+
white-space: nowrap;
|
|
346
|
+
vertical-align: middle;
|
|
347
|
+
user-select: none;
|
|
348
|
+
background: var(--vec-canvas);
|
|
349
|
+
border: 1px solid var(--vec-border);
|
|
350
|
+
border-radius: calc(var(--vec-radius) - 4px);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.vibe-edit-composer__chip-icon-wrap {
|
|
354
|
+
position: relative;
|
|
355
|
+
display: inline-flex;
|
|
356
|
+
flex-shrink: 0;
|
|
357
|
+
align-items: center;
|
|
358
|
+
justify-content: center;
|
|
359
|
+
width: 16px;
|
|
360
|
+
height: 16px;
|
|
361
|
+
padding: 0;
|
|
362
|
+
color: inherit;
|
|
363
|
+
background: transparent;
|
|
364
|
+
border: none;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.vibe-edit-composer__chip-icon,
|
|
368
|
+
.vibe-edit-composer__chip-x {
|
|
369
|
+
position: absolute;
|
|
370
|
+
top: 50%;
|
|
371
|
+
left: 50%;
|
|
372
|
+
width: 12px;
|
|
373
|
+
height: 12px;
|
|
374
|
+
transform: translate(-50%, -50%);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.vibe-edit-composer__chip-icon {
|
|
378
|
+
color: var(--vec-info);
|
|
379
|
+
opacity: 0.7;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.vibe-edit-composer__chip-x {
|
|
383
|
+
cursor: pointer;
|
|
384
|
+
opacity: 0;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.vibe-edit-composer__chip:hover .vibe-edit-composer__chip-icon,
|
|
388
|
+
.vibe-edit-composer__chip-icon-wrap:focus-visible .vibe-edit-composer__chip-icon {
|
|
389
|
+
opacity: 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.vibe-edit-composer__chip:hover .vibe-edit-composer__chip-x,
|
|
393
|
+
.vibe-edit-composer__chip-icon-wrap:focus-visible .vibe-edit-composer__chip-x {
|
|
394
|
+
opacity: 0.7;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.vibe-edit-composer__chip-icon-wrap:disabled {
|
|
398
|
+
cursor: not-allowed;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.vibe-edit-composer__chip-label {
|
|
402
|
+
min-width: 0;
|
|
403
|
+
overflow: hidden;
|
|
404
|
+
text-overflow: ellipsis;
|
|
405
|
+
white-space: nowrap;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* ---- Footer ---------------------------------------------------------- */
|
|
409
|
+
|
|
410
|
+
.vibe-edit-composer__footer {
|
|
411
|
+
display: flex;
|
|
412
|
+
align-items: center;
|
|
413
|
+
justify-content: flex-end;
|
|
414
|
+
gap: 8px;
|
|
415
|
+
min-width: 0;
|
|
416
|
+
padding: 4px 12px 12px;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.vibe-edit-composer__controls {
|
|
420
|
+
position: relative;
|
|
421
|
+
display: flex;
|
|
422
|
+
flex-shrink: 0;
|
|
423
|
+
align-items: center;
|
|
424
|
+
gap: 6px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/* ---- Applying pulse -------------------------------------------------- */
|
|
428
|
+
|
|
429
|
+
.vibe-edit-composer__pulse-layer {
|
|
430
|
+
position: fixed;
|
|
431
|
+
inset: 0;
|
|
432
|
+
z-index: 30;
|
|
433
|
+
pointer-events: none;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.vibe-edit-composer__pulse {
|
|
437
|
+
position: fixed;
|
|
438
|
+
box-sizing: border-box;
|
|
439
|
+
border: 2px solid var(--vscode-button-background, #0176d3);
|
|
440
|
+
border-radius: 6px;
|
|
441
|
+
box-shadow: 0 0 0 4px
|
|
442
|
+
color-mix(in srgb, var(--vscode-button-background, #0176d3) 25%, transparent);
|
|
443
|
+
animation: vibe-edit-composer-pulse 1.1s ease-in-out infinite;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@keyframes vibe-edit-composer-pulse {
|
|
447
|
+
0%,
|
|
448
|
+
100% {
|
|
449
|
+
opacity: 1;
|
|
450
|
+
}
|
|
451
|
+
50% {
|
|
452
|
+
opacity: 0.45;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
@media (prefers-reduced-motion: reduce) {
|
|
457
|
+
.vibe-edit-composer__pulse {
|
|
458
|
+
animation: none;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* VibeEditComposer — the VS Code vibe-edit "Select to Edit" composer: a
|
|
9
|
+
* bottom-docked card with a "N selected" header, @element chips inline with the
|
|
10
|
+
* instruction, an inline error + draft-restore retry, a "Send to Agent" CTA, and
|
|
11
|
+
* an applying pulse around the just-sent elements. Looks and behaves like the
|
|
12
|
+
* Agentforce Vibes select-to-edit composer.
|
|
13
|
+
*
|
|
14
|
+
* Self-contained and dependency-free (React only), styled with the VS Code
|
|
15
|
+
* theme variables so it follows the active theme. The engine
|
|
16
|
+
* (useVibeEdit) stays the single source of truth for WHAT is selected; this
|
|
17
|
+
* component only renders that selection and reports edits and chip-deletes back.
|
|
18
|
+
*
|
|
19
|
+
* Lazily imported for the VS Code host only — the classic web / Builder-Central
|
|
20
|
+
* path renders VibeEditPanel and never fetches this chunk.
|
|
21
|
+
*/
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import type { ChatTarget } from '../../../../webviewMessageTypes.js';
|
|
24
|
+
import './VibeEditComposer.css';
|
|
25
|
+
/** One selected element, as the engine hands it to the composer. */
|
|
26
|
+
export interface VibeEditComposerElement {
|
|
27
|
+
/** Stable element id — the same `data-mv-id` the plugin rendered. */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Semantic kind ('object' | 'field' | 'region' | …), plugin-defined. */
|
|
30
|
+
elementType: string;
|
|
31
|
+
/** Human-readable name shown in the composer's @mention chip. */
|
|
32
|
+
label: string;
|
|
33
|
+
/** Structured payload surfaced to the agent (the element's SpatialContext). */
|
|
34
|
+
data: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface VibeEditComposerProps {
|
|
37
|
+
/** The engine's current selection. */
|
|
38
|
+
elements: VibeEditComposerElement[];
|
|
39
|
+
/** Whether select-mode is active. */
|
|
40
|
+
active: boolean;
|
|
41
|
+
/** Resolve a selected element's live DOM node — for the applying pulse. */
|
|
42
|
+
nodeFor: (id: string) => HTMLElement | null | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Dispatch the edit with the (possibly chip-trimmed) element ids, the
|
|
45
|
+
* instruction and the chat routing. Resolve on a successful handoff — return
|
|
46
|
+
* `{ chatId }` to route later edits into the same chat. Reject to drive the
|
|
47
|
+
* inline error and draft-restored retry.
|
|
48
|
+
*/
|
|
49
|
+
onEdit: (elementIds: string[], instruction: string, chatTarget: ChatTarget) => Promise<void | {
|
|
50
|
+
chatId?: string;
|
|
51
|
+
chatLabel?: string;
|
|
52
|
+
}>;
|
|
53
|
+
/** Drop one element from the engine's selection (chip ✕ / close). */
|
|
54
|
+
onDeselect: (id: string) => void;
|
|
55
|
+
/** Called after a successful send, e.g. to return focus to the select toggle. */
|
|
56
|
+
onSent?: () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Called when a user action empties the selection and dismisses the card
|
|
59
|
+
* (Escape, Exit, or removing the last chip). Lets the host move focus back to
|
|
60
|
+
* the select toggle so it never falls to document.body (WCAG 2.4.3).
|
|
61
|
+
*/
|
|
62
|
+
onClose?: () => void;
|
|
63
|
+
}
|
|
64
|
+
export default function VibeEditComposer({ elements, nodeFor, onEdit, onDeselect, onSent, onClose, }: VibeEditComposerProps): React.ReactElement | null;
|
|
65
|
+
//# sourceMappingURL=VibeEditComposer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VibeEditComposer.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/hooks/vibe-edit/ui/composer/VibeEditComposer.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAQrE,OAAO,wBAAwB,CAAC;AAEhC,oEAAoE;AACpE,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,QAAQ,EAAE,uBAAuB,EAAE,CAAC;IACpC,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IACxD;;;;;OAKG;IACH,MAAM,EAAE,CACN,UAAU,EAAE,MAAM,EAAE,EACpB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,UAAU,KACnB,OAAO,CAAC,IAAI,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,qEAAqE;IACrE,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AA2JD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,QAAQ,EACR,OAAO,EACP,MAAM,EACN,UAAU,EACV,MAAM,EACN,OAAO,GACR,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAgiBnD"}
|