@salesforce/metadata-core-sdk 1.4.0 → 1.6.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/README.md +25 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/sdk/abstractions/core/IPlatformContext.d.ts +1 -1
- package/dist/sdk/abstractions/core/IPlatformContext.js +1 -1
- package/dist/sdk/abstractions/core/index.d.ts +1 -1
- package/dist/sdk/abstractions/core/index.js +1 -1
- package/dist/sdk/abstractions/index.d.ts +1 -1
- package/dist/sdk/abstractions/index.js +1 -1
- package/dist/sdk/abstractions/services/IFileSystem.d.ts +1 -1
- package/dist/sdk/abstractions/services/IFileSystem.js +1 -1
- package/dist/sdk/abstractions/services/ILogger.d.ts +1 -1
- package/dist/sdk/abstractions/services/ILogger.js +1 -1
- package/dist/sdk/abstractions/services/ITelemetry.d.ts +1 -1
- package/dist/sdk/abstractions/services/ITelemetry.js +1 -1
- package/dist/sdk/abstractions/services/index.d.ts +1 -1
- package/dist/sdk/abstractions/services/index.js +1 -1
- package/dist/sdk/abstractions/types/FileMetadata.d.ts +1 -1
- package/dist/sdk/abstractions/types/FileMetadata.js +1 -1
- package/dist/sdk/abstractions/types/Result.d.ts +1 -1
- package/dist/sdk/abstractions/types/Result.js +1 -1
- package/dist/sdk/abstractions/types/index.d.ts +1 -1
- package/dist/sdk/abstractions/types/index.js +1 -1
- package/dist/sdk/components/LegendPanel/index.d.ts +1 -1
- package/dist/sdk/components/LegendPanel/index.js +1 -1
- package/dist/sdk/components/ZoomBar/ZoomBar.d.ts.map +1 -1
- package/dist/sdk/components/ZoomBar/ZoomBar.js +2 -1
- package/dist/sdk/components/ZoomBar/ZoomBar.js.map +1 -1
- package/dist/sdk/components/ZoomBar/index.d.ts +1 -1
- package/dist/sdk/components/ZoomBar/index.js +1 -1
- package/dist/sdk/components/index.d.ts +1 -1
- package/dist/sdk/components/index.js +1 -1
- package/dist/sdk/constants.d.ts +1 -1
- package/dist/sdk/constants.js +1 -1
- package/dist/sdk/contracts/core/IMetadataParser.d.ts +23 -1
- package/dist/sdk/contracts/core/IMetadataParser.d.ts.map +1 -1
- package/dist/sdk/contracts/core/IMetadataParser.js +1 -1
- package/dist/sdk/contracts/core/IVisualizationPlugin.d.ts +1 -1
- package/dist/sdk/contracts/core/IVisualizationPlugin.js +1 -1
- package/dist/sdk/contracts/core/index.d.ts +1 -1
- package/dist/sdk/contracts/core/index.js +1 -1
- package/dist/sdk/contracts/index.d.ts +1 -1
- package/dist/sdk/contracts/index.js +1 -1
- package/dist/sdk/contracts/types/MetadataFileInfo.d.ts +1 -1
- package/dist/sdk/contracts/types/MetadataFileInfo.js +1 -1
- package/dist/sdk/contracts/types/MetadataPluginInfo.d.ts +1 -1
- package/dist/sdk/contracts/types/MetadataPluginInfo.js +1 -1
- package/dist/sdk/contracts/types/PluginConfig.d.ts +1 -1
- package/dist/sdk/contracts/types/PluginConfig.js +1 -1
- package/dist/sdk/contracts/types/PluginContext.d.ts +1 -1
- package/dist/sdk/contracts/types/PluginContext.js +1 -1
- package/dist/sdk/contracts/types/PluginError.d.ts +1 -1
- package/dist/sdk/contracts/types/PluginError.js +1 -1
- package/dist/sdk/contracts/types/SelectableNode.d.ts +62 -0
- package/dist/sdk/contracts/types/SelectableNode.d.ts.map +1 -0
- package/dist/sdk/contracts/types/SelectableNode.js +8 -0
- package/dist/sdk/contracts/types/SelectableNode.js.map +1 -0
- package/dist/sdk/contracts/types/ValidationResult.d.ts +1 -1
- package/dist/sdk/contracts/types/ValidationResult.js +1 -1
- package/dist/sdk/contracts/types/VersionInfo.d.ts +1 -1
- package/dist/sdk/contracts/types/VersionInfo.js +1 -1
- package/dist/sdk/contracts/types/index.d.ts +2 -1
- package/dist/sdk/contracts/types/index.d.ts.map +1 -1
- package/dist/sdk/contracts/types/index.js +2 -1
- package/dist/sdk/contracts/types/index.js.map +1 -1
- package/dist/sdk/design-system/index.d.ts +3 -1
- package/dist/sdk/design-system/index.d.ts.map +1 -1
- package/dist/sdk/design-system/index.js +3 -1
- package/dist/sdk/design-system/index.js.map +1 -1
- package/dist/sdk/design-system/light-design-system.css +724 -0
- package/dist/sdk/design-system/themes.d.ts +32 -0
- package/dist/sdk/design-system/themes.d.ts.map +1 -0
- package/dist/sdk/design-system/themes.js +32 -0
- package/dist/sdk/design-system/themes.js.map +1 -0
- package/dist/sdk/design-system/tokens/colors.d.ts +1 -1
- package/dist/sdk/design-system/tokens/colors.js +1 -1
- package/dist/sdk/design-system/tokens/spacing.d.ts +1 -1
- package/dist/sdk/design-system/tokens/spacing.js +1 -1
- package/dist/sdk/design-system/tokens/typography.d.ts +1 -1
- package/dist/sdk/design-system/tokens/typography.js +1 -1
- package/dist/sdk/design-system/utils.d.ts +1 -1
- package/dist/sdk/design-system/utils.js +1 -1
- package/dist/sdk/hooks/vibe-edit/index.d.ts +39 -0
- package/dist/sdk/hooks/vibe-edit/index.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/index.js +42 -0
- package/dist/sdk/hooks/vibe-edit/index.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGeometry.d.ts +56 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGeometry.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGeometry.js +138 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGeometry.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraph.d.ts +66 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraph.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraph.js +73 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraph.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraphEngine.d.ts +64 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraphEngine.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraphEngine.js +161 -0
- package/dist/sdk/hooks/vibe-edit/selection/selectionGraphEngine.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/types.d.ts +47 -0
- package/dist/sdk/hooks/vibe-edit/selection/types.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/types.js +40 -0
- package/dist/sdk/hooks/vibe-edit/selection/types.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/useMarqueeSelection.d.ts +30 -0
- package/dist/sdk/hooks/vibe-edit/selection/useMarqueeSelection.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/selection/useMarqueeSelection.js +50 -0
- package/dist/sdk/hooks/vibe-edit/selection/useMarqueeSelection.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.css +26 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.d.ts +84 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js +256 -0
- package/dist/sdk/hooks/vibe-edit/ui/MarqueeSelection.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.css +207 -0
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.d.ts +43 -0
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js +80 -0
- package/dist/sdk/hooks/vibe-edit/ui/VibeEditPanel.js.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.css +79 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts +116 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.d.ts.map +1 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js +264 -0
- package/dist/sdk/hooks/vibe-edit/ui/useVibeEdit.js.map +1 -0
- package/dist/sdk/utils/HostCommunicationUtils.d.ts +1 -1
- package/dist/sdk/utils/HostCommunicationUtils.js +1 -1
- package/dist/sdk/utils/errors/ErrorBuilder.d.ts +1 -1
- package/dist/sdk/utils/errors/ErrorBuilder.js +1 -1
- package/dist/sdk/utils/errors/setupHandlers.d.ts +1 -1
- package/dist/sdk/utils/errors/setupHandlers.js +1 -1
- package/dist/sdk/utils/logger.d.ts +1 -1
- package/dist/sdk/utils/logger.js +1 -1
- package/dist/sdk/utils/test-helpers/architecture-test-utils.d.ts +1 -1
- package/dist/sdk/utils/test-helpers/architecture-test-utils.js +1 -1
- package/dist/sdk/utils/test-helpers/index.d.ts +1 -1
- package/dist/sdk/utils/test-helpers/index.js +1 -1
- package/dist/sdk/utils/xmlParser.d.ts +1 -1
- package/dist/sdk/utils/xmlParser.js +1 -1
- package/dist/sdk/webviewMessageTypes.d.ts +78 -1
- package/dist/sdk/webviewMessageTypes.d.ts.map +1 -1
- package/dist/sdk/webviewMessageTypes.js +8 -5
- package/dist/sdk/webviewMessageTypes.js.map +1 -1
- package/package.json +11 -3
- package/src/sdk/utils/test-helpers/architecture-test-utils.ts +1 -1
- package/src/sdk/utils/test-helpers/index.ts +1 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
/* Select-mode toggle button shipped by useVibeEdit(). Per the design spec this
|
|
9
|
+
is a NEUTRAL rounded-rectangle button in the resting state (not a blue pill):
|
|
10
|
+
the blue is reserved for the ACTIVE (selecting) state, giving a clear
|
|
11
|
+
neutral→blue on/off signal. */
|
|
12
|
+
.mv-vibe-edit-toggle {
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
gap: var(--mv-spacing-xs);
|
|
16
|
+
padding: var(--mv-spacing-xs) var(--mv-spacing-md);
|
|
17
|
+
font-size: var(--mv-font-size-xs);
|
|
18
|
+
font-weight: var(--mv-font-weight-medium);
|
|
19
|
+
/* Resting = neutral secondary button: dark text, gray border, subtle surface
|
|
20
|
+
fill. Rounded rectangle (radius-md), NOT a full pill. */
|
|
21
|
+
color: var(--mv-text-primary);
|
|
22
|
+
background: var(--mv-bg-surface);
|
|
23
|
+
border: 1px solid var(--mv-border-default);
|
|
24
|
+
border-radius: var(--mv-radius-md);
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
transition: all var(--mv-transition-fast);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.mv-vibe-edit-toggle:hover {
|
|
30
|
+
background: var(--mv-bg-surface-hover);
|
|
31
|
+
border-color: var(--mv-border-hover, var(--mv-border-default));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Active (selecting) state: blue OUTLINE — blue text + border over a light
|
|
35
|
+
fill (not a solid blue fill), matching the design's active variant. */
|
|
36
|
+
.mv-vibe-edit-toggle--active {
|
|
37
|
+
color: var(--mv-interactive-primary);
|
|
38
|
+
background: var(--mv-interactive-primary-subtle, color-mix(in srgb, var(--mv-interactive-primary) 10%, transparent));
|
|
39
|
+
border-color: var(--mv-interactive-primary);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Hover + selection outline reflected by useVibeEdit onto the matching
|
|
43
|
+
[data-mv-id] element. The literals MUST mirror HOVER_ATTR / SELECTED_ATTR in
|
|
44
|
+
selection/types.ts. outline (not border) avoids layout shift.
|
|
45
|
+
|
|
46
|
+
Hover and selected are DELIBERATELY distinct (design spec):
|
|
47
|
+
- hover / bulk-preview → prominent DASHED 2px line (what WILL be selected)
|
|
48
|
+
- selected → bold SOLID 2px line + light-blue fill (committed)
|
|
49
|
+
The earlier 1px lines read as "almost invisible" over the busy canvas, and
|
|
50
|
+
the dotted bulk-preview was too faint to see mid-drag; both are now 2px and
|
|
51
|
+
the committed selection gets a translucent blue fill so it reads clearly
|
|
52
|
+
(matching the desired Image #4 selection style).
|
|
53
|
+
|
|
54
|
+
outline-offset is NEGATIVE so the line is drawn just INSIDE the element edge.
|
|
55
|
+
A positive offset draws the outline OUTSIDE the box, where an ancestor with
|
|
56
|
+
overflow:hidden (e.g. a React Flow node card / scroll container) clips its
|
|
57
|
+
left & right sides — the "selection box cut off on the sides" rendering bug.
|
|
58
|
+
Insetting the line by 2px keeps it fully within the clipping rect. */
|
|
59
|
+
[data-mv-hover] {
|
|
60
|
+
outline: 2px dashed var(--mv-interactive-primary);
|
|
61
|
+
outline-offset: -2px;
|
|
62
|
+
border-radius: var(--mv-radius-sm);
|
|
63
|
+
/* Faint tint so the bulk-selection preview is visible mid-drag, not just an
|
|
64
|
+
outline that gets lost against node chrome. */
|
|
65
|
+
background-color: color-mix(in srgb, var(--mv-interactive-primary) 8%, transparent);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Selected wins over hover on an element that is both: this rule follows the
|
|
69
|
+
hover rule, so at equal specificity the solid outline takes precedence. */
|
|
70
|
+
[data-mv-selected] {
|
|
71
|
+
outline: 2px solid var(--mv-interactive-primary);
|
|
72
|
+
outline-offset: -2px;
|
|
73
|
+
border-radius: var(--mv-radius-sm);
|
|
74
|
+
/* Bold blue border + light-blue fill — the prominent committed-selection look
|
|
75
|
+
from the design (Image #4). color-mix keeps it theme-driven off the single
|
|
76
|
+
interactive-primary token, so it tracks light/dark automatically. */
|
|
77
|
+
background-color: color-mix(in srgb, var(--mv-interactive-primary) 16%, transparent);
|
|
78
|
+
box-shadow: 0 0 0 1px color-mix(in srgb, var(--mv-interactive-primary) 40%, transparent);
|
|
79
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
* useVibeEdit — the drop-in vibe-edit hook (plugin-side, core-sdk).
|
|
9
|
+
*
|
|
10
|
+
* SelectionGraph (C1 + C4) — the single, final selection path. The plugin's
|
|
11
|
+
* parser emits a normalized `SelectableNode[]` (via IMetadataParser.getSelectableNodes),
|
|
12
|
+
* and each node is rendered with `data-mv-id={node.id}`. Given those nodes the
|
|
13
|
+
* hook does EVERYTHING generically:
|
|
14
|
+
*
|
|
15
|
+
* - stamps the hit-test contract (data-mv-selectable / -type) onto the tagged
|
|
16
|
+
* elements, kept live across re-renders via a MutationObserver, and
|
|
17
|
+
* - builds SpatialContext by a pure `Map.get(id)` over the nodes — no
|
|
18
|
+
* per-plugin buildContext, no descriptors, no shape traversal.
|
|
19
|
+
*
|
|
20
|
+
* The plugin's only residue is the parser's one-time node projection plus the
|
|
21
|
+
* `data-mv-id` render — there is no plugin-side selection logic.
|
|
22
|
+
*
|
|
23
|
+
* The hook internally owns: the useMarqueeSelection state machine, the
|
|
24
|
+
* MarqueeSelection overlay (active when select-mode is on), the VibeEditPanel,
|
|
25
|
+
* a select-mode toggle button, chip generation from the current selection, and
|
|
26
|
+
* the handoff — building the EditRequest and calling
|
|
27
|
+
* sendToHost({ type: SUBMIT_EDIT, payload }).
|
|
28
|
+
*
|
|
29
|
+
* Because plugins render their own React DOM inside an iframe the framework
|
|
30
|
+
* cannot reach, a plugin-side hook is the only architecturally valid home for
|
|
31
|
+
* this logic (ARCHITECTURE.md §3).
|
|
32
|
+
*/
|
|
33
|
+
import React from 'react';
|
|
34
|
+
import type { SelectableNode } from '../selection/selectionGraph.js';
|
|
35
|
+
import { type VibeEditChip } from './VibeEditPanel.js';
|
|
36
|
+
import type { SpatialContext } from '../../../webviewMessageTypes.js';
|
|
37
|
+
import './useVibeEdit.css';
|
|
38
|
+
/** Optional ergonomics for the hook's built-in UI pieces. */
|
|
39
|
+
export interface UseVibeEditOptions {
|
|
40
|
+
/** Placeholder for the VibeEditPanel prompt textarea. */
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/** Label shown on the toggle when select-mode is OFF. Default: 'Select'. */
|
|
43
|
+
selectLabel?: string;
|
|
44
|
+
/** Label shown on the toggle when select-mode is ON. Default: 'Selecting'. */
|
|
45
|
+
selectingLabel?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Builds a chip for a selected element. Defaults to label = apiName, title =
|
|
48
|
+
* `${elementType}: ${apiName}`, variant = 'primary' for `field` elements.
|
|
49
|
+
*/
|
|
50
|
+
chipFor?: (ctx: SpatialContext) => VibeEditChip;
|
|
51
|
+
/**
|
|
52
|
+
* Called when the user double-clicks a selectable element while in select-mode.
|
|
53
|
+
* Lets the plugin drill into a nested view (e.g. open a subagent's detail) WITHOUT
|
|
54
|
+
* leaving select-mode. Receives the node id (data-mv-id) of the activated element.
|
|
55
|
+
*/
|
|
56
|
+
onActivate?: (nodeId: string) => void;
|
|
57
|
+
}
|
|
58
|
+
export interface UseVibeEditResult {
|
|
59
|
+
/** Select-mode toggle button — mount in the toolbar. */
|
|
60
|
+
toggleButton: React.ReactNode;
|
|
61
|
+
/** Marquee overlay — mount over the (positioned) canvas. */
|
|
62
|
+
overlay: React.ReactNode;
|
|
63
|
+
/** The prompt / chip / submit panel — mount once near the canvas. */
|
|
64
|
+
panel: React.ReactNode;
|
|
65
|
+
/** Whether select-mode is currently active. */
|
|
66
|
+
selectMode: boolean;
|
|
67
|
+
/** True if a given type::id is currently selected. */
|
|
68
|
+
isSelected: (type: string, id: string) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Imperatively toggle a node's membership in the current selection by its
|
|
71
|
+
* `type` + `id` (the same `data-mv-type` / `data-mv-id` the node renders).
|
|
72
|
+
*
|
|
73
|
+
* The marquee overlay only covers the positioned canvas, so selectable
|
|
74
|
+
* elements rendered OUTSIDE it (e.g. the flow inspector sidebar's
|
|
75
|
+
* detail rows, a sibling flex column) can never be reached by a click/drag
|
|
76
|
+
* hit-test. Those elements are still tagged (the engine's tagger scans the
|
|
77
|
+
* whole document) and still get the `[data-mv-selected]` CSS, but they need
|
|
78
|
+
* this explicit write path to actually join the one unified selection set —
|
|
79
|
+
* so a single SUBMIT_EDIT carries canvas + sidebar picks together. A no-op
|
|
80
|
+
* when select-mode is off.
|
|
81
|
+
*/
|
|
82
|
+
toggle: (type: string, id: string) => void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Vibe-edit availability predicate — the feature-gate contract.
|
|
86
|
+
*
|
|
87
|
+
* The host (VS Code engine / framework web path) forwards `SelectableNode[]`
|
|
88
|
+
* ONLY when vibe-edit is wired end-to-end AND enabled: it withholds them when
|
|
89
|
+
* the feature is gated off (e.g. App Studio's SPA drops `selectableNodes` when
|
|
90
|
+
* the `vibeEdit` gate is closed). So the presence of nodes IS the on-signal and
|
|
91
|
+
* their absence is graceful degradation — no separate flag rides the wire.
|
|
92
|
+
*
|
|
93
|
+
* Pure so it can be unit-tested in core-sdk's node-env jest project (no DOM /
|
|
94
|
+
* testing-library); the hook branches on it to render no selection UI when off.
|
|
95
|
+
*/
|
|
96
|
+
export declare function isVibeEditAvailable(nodes: SelectableNode[]): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The vibe-edit hook. Mount the three returned nodes (toggleButton, overlay,
|
|
99
|
+
* panel) and render `data-mv-id={node.id}` on each selectable element; pass the
|
|
100
|
+
* same `nodes` the parser emitted.
|
|
101
|
+
*/
|
|
102
|
+
export declare function useVibeEdit(args: {
|
|
103
|
+
/** The normalized node list emitted by the plugin's parser (SelectionGraph). */
|
|
104
|
+
nodes: SelectableNode[];
|
|
105
|
+
/**
|
|
106
|
+
* File-level name of the current metadata file (from the plugin data
|
|
107
|
+
* context's `fileName`). Stamped onto every SpatialContext as the fallback so
|
|
108
|
+
* the always-available `fileName` contract holds even for nodes that carry no
|
|
109
|
+
* per-node `filePath` (e.g. flexipage region/component nodes). Optional; when
|
|
110
|
+
* omitted, only nodes with their own `filePath` surface a fileName.
|
|
111
|
+
*/
|
|
112
|
+
fileName?: string;
|
|
113
|
+
/** Optional UI ergonomics. */
|
|
114
|
+
options?: UseVibeEditOptions;
|
|
115
|
+
}): UseVibeEditResult;
|
|
116
|
+
//# sourceMappingURL=useVibeEdit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVibeEdit.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/hooks/vibe-edit/ui/useVibeEdit.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGtE,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,mBAAmB,CAAC;AAE3B,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,YAAY,CAAC;IAChD;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,4DAA4D;IAC5D,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,qEAAqE;IACrE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAClD;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAEpE;AA0CD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,gFAAgF;IAChF,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B,GAAG,iBAAiB,CA+OpB"}
|
|
@@ -0,0 +1,264 @@
|
|
|
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
|
+
* useVibeEdit — the drop-in vibe-edit hook (plugin-side, core-sdk).
|
|
9
|
+
*
|
|
10
|
+
* SelectionGraph (C1 + C4) — the single, final selection path. The plugin's
|
|
11
|
+
* parser emits a normalized `SelectableNode[]` (via IMetadataParser.getSelectableNodes),
|
|
12
|
+
* and each node is rendered with `data-mv-id={node.id}`. Given those nodes the
|
|
13
|
+
* hook does EVERYTHING generically:
|
|
14
|
+
*
|
|
15
|
+
* - stamps the hit-test contract (data-mv-selectable / -type) onto the tagged
|
|
16
|
+
* elements, kept live across re-renders via a MutationObserver, and
|
|
17
|
+
* - builds SpatialContext by a pure `Map.get(id)` over the nodes — no
|
|
18
|
+
* per-plugin buildContext, no descriptors, no shape traversal.
|
|
19
|
+
*
|
|
20
|
+
* The plugin's only residue is the parser's one-time node projection plus the
|
|
21
|
+
* `data-mv-id` render — there is no plugin-side selection logic.
|
|
22
|
+
*
|
|
23
|
+
* The hook internally owns: the useMarqueeSelection state machine, the
|
|
24
|
+
* MarqueeSelection overlay (active when select-mode is on), the VibeEditPanel,
|
|
25
|
+
* a select-mode toggle button, chip generation from the current selection, and
|
|
26
|
+
* the handoff — building the EditRequest and calling
|
|
27
|
+
* sendToHost({ type: SUBMIT_EDIT, payload }).
|
|
28
|
+
*
|
|
29
|
+
* Because plugins render their own React DOM inside an iframe the framework
|
|
30
|
+
* cannot reach, a plugin-side hook is the only architecturally valid home for
|
|
31
|
+
* this logic (ARCHITECTURE.md §3).
|
|
32
|
+
*/
|
|
33
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
34
|
+
import { MarqueeSelection } from './MarqueeSelection.js';
|
|
35
|
+
import { useMarqueeSelection } from '../selection/useMarqueeSelection.js';
|
|
36
|
+
import { TYPE_ATTR, SELECTED_ATTR, HOVER_ATTR } from '../selection/types.js';
|
|
37
|
+
import { tagSelectionGraphLive, buildContextsFromNodes, } from '../selection/selectionGraphEngine.js';
|
|
38
|
+
import { VibeEditPanel } from './VibeEditPanel.js';
|
|
39
|
+
import { sendToHost } from '../../../utils/HostCommunicationUtils.js';
|
|
40
|
+
import { WebviewMessageType } from '../../../webviewMessageTypes.js';
|
|
41
|
+
import './useVibeEdit.css';
|
|
42
|
+
/**
|
|
43
|
+
* Vibe-edit availability predicate — the feature-gate contract.
|
|
44
|
+
*
|
|
45
|
+
* The host (VS Code engine / framework web path) forwards `SelectableNode[]`
|
|
46
|
+
* ONLY when vibe-edit is wired end-to-end AND enabled: it withholds them when
|
|
47
|
+
* the feature is gated off (e.g. App Studio's SPA drops `selectableNodes` when
|
|
48
|
+
* the `vibeEdit` gate is closed). So the presence of nodes IS the on-signal and
|
|
49
|
+
* their absence is graceful degradation — no separate flag rides the wire.
|
|
50
|
+
*
|
|
51
|
+
* Pure so it can be unit-tested in core-sdk's node-env jest project (no DOM /
|
|
52
|
+
* testing-library); the hook branches on it to render no selection UI when off.
|
|
53
|
+
*/
|
|
54
|
+
export function isVibeEditAvailable(nodes) {
|
|
55
|
+
return nodes.length > 0;
|
|
56
|
+
}
|
|
57
|
+
/** Default chip projection from a SpatialContext. */
|
|
58
|
+
function defaultChipFor(ctx) {
|
|
59
|
+
return {
|
|
60
|
+
label: ctx.apiName,
|
|
61
|
+
title: `${ctx.elementType}: ${ctx.apiName}`,
|
|
62
|
+
variant: ctx.elementType === 'field' ? 'primary' : 'default',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Toggle glyph: a pointer/cursor arrow sitting inside a dashed marquee box —
|
|
67
|
+
* "select (drag a box) to edit". Matches the design's Select-to-Edit icon
|
|
68
|
+
* (cursor + marquee), replacing the earlier dashed-box-with-checkmark.
|
|
69
|
+
*/
|
|
70
|
+
function ToggleIcon() {
|
|
71
|
+
return (React.createElement("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true" },
|
|
72
|
+
React.createElement("rect", { x: "1.5", y: "1.5", width: "9", height: "9", stroke: "currentColor", strokeWidth: "1.25", strokeDasharray: "2 1.75" }),
|
|
73
|
+
React.createElement("path", { d: "M7 7l7 2.6-2.9 0.9-0.9 2.9L7 7z", fill: "currentColor", stroke: "currentColor", strokeWidth: "0.5", strokeLinejoin: "round" })));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The vibe-edit hook. Mount the three returned nodes (toggleButton, overlay,
|
|
77
|
+
* panel) and render `data-mv-id={node.id}` on each selectable element; pass the
|
|
78
|
+
* same `nodes` the parser emitted.
|
|
79
|
+
*/
|
|
80
|
+
export function useVibeEdit(args) {
|
|
81
|
+
const { nodes, fileName, options } = args;
|
|
82
|
+
const placeholder = options?.placeholder;
|
|
83
|
+
const selectLabel = options?.selectLabel ?? 'Select';
|
|
84
|
+
const selectingLabel = options?.selectingLabel ?? 'Selecting';
|
|
85
|
+
const chipFor = options?.chipFor ?? defaultChipFor;
|
|
86
|
+
const onActivate = options?.onActivate;
|
|
87
|
+
const [selectMode, setSelectMode] = useState(false);
|
|
88
|
+
const [hovered, setHovered] = useState(null);
|
|
89
|
+
// Elements the in-progress marquee currently covers (bulk-selection preview).
|
|
90
|
+
// Keyed by `type::id`; reflected onto the DOM as the dotted hover mark so the
|
|
91
|
+
// user sees what WILL be selected while still dragging. Empty when not dragging.
|
|
92
|
+
const [previewed, setPreviewed] = useState([]);
|
|
93
|
+
const marquee = useMarqueeSelection();
|
|
94
|
+
// The plugin rendered data-mv-id={node.id}; the engine stamps the hit-test
|
|
95
|
+
// contract (data-mv-selectable / -type) onto those elements and keeps it live
|
|
96
|
+
// across re-renders via a MutationObserver (childList + subtree only).
|
|
97
|
+
const graphTagRef = useRef(new Map());
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (!selectMode) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
return tagSelectionGraphLive(nodes, graphTagRef.current);
|
|
103
|
+
}, [selectMode, nodes]);
|
|
104
|
+
// Reflect the current selection onto the DOM as `data-mv-selected` so the
|
|
105
|
+
// plugin's CSS can render a visible selected state (issue: selection was
|
|
106
|
+
// invisible, so click-to-deselect had no feedback). Keyed off the selection
|
|
107
|
+
// map + selectMode; when select-mode turns off, all marks are removed. Uses
|
|
108
|
+
// data-mv-id to find the elements — the same ids the marquee selection holds.
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (typeof document === 'undefined') {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const marked = [];
|
|
114
|
+
if (selectMode) {
|
|
115
|
+
// Iterate the tagged-element map the engine already maintains
|
|
116
|
+
// (id -> element, kept live by the MutationObserver) rather than
|
|
117
|
+
// re-scanning the whole document on every selection change — this effect
|
|
118
|
+
// fires per pointer event during a drag, so a full querySelectorAll here
|
|
119
|
+
// is O(DOM) per mousemove.
|
|
120
|
+
for (const [id, el] of graphTagRef.current) {
|
|
121
|
+
const type = el.getAttribute(TYPE_ATTR) ?? '';
|
|
122
|
+
// Selection is keyed by `type::id`; an element only counts as selected
|
|
123
|
+
// when both match (guards against id collisions across node types).
|
|
124
|
+
if (id && marquee.isSelected(type, id)) {
|
|
125
|
+
el.setAttribute(SELECTED_ATTR, '');
|
|
126
|
+
marked.push(el);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return () => {
|
|
131
|
+
for (const el of marked) {
|
|
132
|
+
el.removeAttribute(SELECTED_ATTR);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}, [selectMode, marquee.selected, nodes]);
|
|
136
|
+
// Reflect the hover affordance onto the DOM as `data-mv-hover` (the dotted
|
|
137
|
+
// outline) so the plugin's CSS renders it. Marks the union of:
|
|
138
|
+
// - the single element under the pointer (`hovered`), and
|
|
139
|
+
// - every element the in-progress marquee covers (`previewed`) — the
|
|
140
|
+
// bulk-selection preview, so the user sees what WILL be selected mid-drag.
|
|
141
|
+
// Keyed by `type::id`; all marks cleared when the set changes, hover leaves,
|
|
142
|
+
// or select-mode turns off. (Single hover and drag preview are mutually
|
|
143
|
+
// exclusive in practice — hover is suppressed during a drag — but marking the
|
|
144
|
+
// union keeps this one effect the sole owner of the hover attribute.)
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (typeof document === 'undefined' || !selectMode) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
const wanted = new Set();
|
|
150
|
+
if (hovered) {
|
|
151
|
+
wanted.add(`${hovered.type}::${hovered.id}`);
|
|
152
|
+
}
|
|
153
|
+
for (const p of previewed) {
|
|
154
|
+
wanted.add(`${p.type}::${p.id}`);
|
|
155
|
+
}
|
|
156
|
+
if (wanted.size === 0) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
// Same optimization as the selection effect: walk the engine's tagged map
|
|
160
|
+
// (id -> element) instead of re-querying the document. This effect fires on
|
|
161
|
+
// every hover/preview change — i.e. per mousemove during a marquee drag.
|
|
162
|
+
const marked = [];
|
|
163
|
+
for (const [id, el] of graphTagRef.current) {
|
|
164
|
+
const type = el.getAttribute(TYPE_ATTR) ?? '';
|
|
165
|
+
if (id && wanted.has(`${type}::${id}`)) {
|
|
166
|
+
el.setAttribute(HOVER_ATTR, '');
|
|
167
|
+
marked.push(el);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return () => {
|
|
171
|
+
for (const el of marked) {
|
|
172
|
+
el.removeAttribute(HOVER_ATTR);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [selectMode, hovered, previewed, nodes]);
|
|
176
|
+
// Map the raw selection → SpatialContext[] once by a pure Map.get(id) over the
|
|
177
|
+
// nodes; both chips and the handoff derive from it so they never drift.
|
|
178
|
+
const contexts = useMemo(() => buildContextsFromNodes(marquee.items, nodes, fileName), [nodes, marquee.items, fileName]);
|
|
179
|
+
const chips = useMemo(() => contexts.map(chipFor), [contexts, chipFor]);
|
|
180
|
+
const handleSubmit = useCallback((prompt) => {
|
|
181
|
+
const request = {
|
|
182
|
+
prompt: prompt.trim(),
|
|
183
|
+
attachments: contexts,
|
|
184
|
+
};
|
|
185
|
+
const sent = sendToHost({
|
|
186
|
+
type: WebviewMessageType.SUBMIT_EDIT,
|
|
187
|
+
payload: request,
|
|
188
|
+
});
|
|
189
|
+
// Reset locally as soon as the request is handed off — the user gets
|
|
190
|
+
// immediate feedback (overlay + panel disappear, selection cleared) rather
|
|
191
|
+
// than waiting on the host's async edit to complete. Only reset on a
|
|
192
|
+
// successful send so a failed handoff leaves the selection intact to retry.
|
|
193
|
+
if (sent) {
|
|
194
|
+
marquee.clear();
|
|
195
|
+
setSelectMode(false);
|
|
196
|
+
}
|
|
197
|
+
return sent;
|
|
198
|
+
}, [contexts, marquee]);
|
|
199
|
+
// Explicit, gesture-free deselect: remove one selected element by its chip
|
|
200
|
+
// index. chips/contexts are derived from marquee.items in order, so the chip
|
|
201
|
+
// index maps directly to marquee.items[index]. toggle() removes it (it's
|
|
202
|
+
// already selected). This is the reliable deselect path — canvas click-timing
|
|
203
|
+
// competes with double-click-to-drill-in, so the chip ✕ is authoritative.
|
|
204
|
+
const handleRemove = useCallback((index) => {
|
|
205
|
+
const item = marquee.items[index];
|
|
206
|
+
if (item) {
|
|
207
|
+
marquee.toggle(item);
|
|
208
|
+
}
|
|
209
|
+
}, [marquee]);
|
|
210
|
+
// Imperative select/deselect for selectable elements that live OUTSIDE the
|
|
211
|
+
// marquee overlay's reach (e.g. the flow inspector sidebar's detail rows).
|
|
212
|
+
// Routes through the same `marquee.toggle` the overlay's click gesture uses,
|
|
213
|
+
// so canvas and off-canvas picks share one selection set and one handoff.
|
|
214
|
+
// Gated on select-mode so a stray sidebar click while NOT selecting can't
|
|
215
|
+
// silently build a hidden selection.
|
|
216
|
+
const toggle = useCallback((type, id) => {
|
|
217
|
+
if (!selectMode) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
marquee.toggle({ type, id });
|
|
221
|
+
}, [selectMode, marquee]);
|
|
222
|
+
const handleToggleSelectMode = useCallback(() => {
|
|
223
|
+
setSelectMode((prev) => {
|
|
224
|
+
const next = !prev;
|
|
225
|
+
// Leaving select-mode clears the selection (matches prior plugin behavior)
|
|
226
|
+
// and drops any lingering hover / marquee preview so no outline persists.
|
|
227
|
+
if (!next) {
|
|
228
|
+
marquee.clear();
|
|
229
|
+
setHovered(null);
|
|
230
|
+
setPreviewed([]);
|
|
231
|
+
}
|
|
232
|
+
return next;
|
|
233
|
+
});
|
|
234
|
+
}, [marquee]);
|
|
235
|
+
// Graceful degradation: when the host forwarded no selectable nodes, vibe-edit
|
|
236
|
+
// is gated off (or unsupported) for this host/file — render NOTHING (no toggle,
|
|
237
|
+
// overlay, or panel) so the visualization is a plain diagram. Placed after all
|
|
238
|
+
// hook calls above to keep hook order stable across renders (rules of hooks);
|
|
239
|
+
// only the returned UI is withheld.
|
|
240
|
+
if (!isVibeEditAvailable(nodes)) {
|
|
241
|
+
return {
|
|
242
|
+
toggleButton: null,
|
|
243
|
+
overlay: null,
|
|
244
|
+
panel: null,
|
|
245
|
+
selectMode: false,
|
|
246
|
+
isSelected: () => false,
|
|
247
|
+
toggle: () => { },
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
const toggleButton = (React.createElement("button", { className: `mv-vibe-edit-toggle ${selectMode ? 'mv-vibe-edit-toggle--active' : ''}`, onClick: handleToggleSelectMode, "aria-label": "Select components to edit with AI", title: "Select components to edit with AI", type: "button" },
|
|
251
|
+
React.createElement(ToggleIcon, null),
|
|
252
|
+
React.createElement("span", null, selectMode ? selectingLabel : selectLabel)));
|
|
253
|
+
const overlay = (React.createElement(MarqueeSelection, { active: selectMode, selected: marquee.selected, onReplace: marquee.replace, onAdd: marquee.add, onToggle: marquee.toggle, onClear: marquee.clear, onActivate: onActivate ? (item) => onActivate(item.id) : undefined, onHover: setHovered, onMarqueePreview: setPreviewed }));
|
|
254
|
+
const panel = (React.createElement(VibeEditPanel, { chips: chips, onSubmit: handleSubmit, onClear: marquee.clear, onRemove: handleRemove, placeholder: placeholder }));
|
|
255
|
+
return {
|
|
256
|
+
toggleButton,
|
|
257
|
+
overlay,
|
|
258
|
+
panel,
|
|
259
|
+
selectMode,
|
|
260
|
+
isSelected: marquee.isSelected,
|
|
261
|
+
toggle,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=useVibeEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVibeEdit.js","sourceRoot":"","sources":["../../../../../src/sdk/hooks/vibe-edit/ui/useVibeEdit.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,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