@salesforce/metadata-plugins 1.9.0 → 1.11.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 +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/plugins/agent/AgentParser.d.ts.map +1 -1
- package/dist/plugins/agent/AgentParser.js +70 -27
- package/dist/plugins/agent/ui/assets/index-BpnirPMA.js +71 -0
- package/dist/plugins/agent/ui/index.html +1 -1
- package/dist/plugins/flexipage/ui/assets/index-DJj6fJsw.js +48 -0
- package/dist/plugins/flexipage/ui/index.html +1 -1
- package/dist/plugins/flow/ui/assets/index-B-Cn56iR.js +48 -0
- package/dist/plugins/flow/ui/index.html +1 -1
- package/dist/plugins/flowintent/FlowIntentParser.d.ts +56 -0
- package/dist/plugins/flowintent/FlowIntentParser.d.ts.map +1 -0
- package/dist/plugins/flowintent/FlowIntentParser.js +144 -0
- package/dist/plugins/flowintent/FlowIntentVisualizer.d.ts +41 -0
- package/dist/plugins/flowintent/FlowIntentVisualizer.d.ts.map +1 -0
- package/dist/plugins/flowintent/FlowIntentVisualizer.js +43 -0
- package/dist/plugins/flowintent/types/IntentFlow.d.ts +139 -0
- package/dist/plugins/flowintent/types/IntentFlow.d.ts.map +1 -0
- package/dist/plugins/flowintent/types/IntentFlow.js +89 -0
- package/dist/plugins/flowintent/types/analyzeFlowBuilderGraph.d.ts +42 -0
- package/dist/plugins/flowintent/types/analyzeFlowBuilderGraph.d.ts.map +1 -0
- package/dist/plugins/flowintent/types/analyzeFlowBuilderGraph.js +226 -0
- package/dist/plugins/flowintent/types/analyzeIntentFlowGraph.d.ts +27 -0
- package/dist/plugins/flowintent/types/analyzeIntentFlowGraph.d.ts.map +1 -0
- package/dist/plugins/flowintent/types/analyzeIntentFlowGraph.js +80 -0
- package/dist/plugins/flowintent/types/index.d.ts +17 -0
- package/dist/plugins/flowintent/types/index.d.ts.map +1 -0
- package/dist/plugins/flowintent/types/index.js +16 -0
- package/dist/plugins/flowintent/types/validateIntentFlow.d.ts +32 -0
- package/dist/plugins/flowintent/types/validateIntentFlow.d.ts.map +1 -0
- package/dist/plugins/flowintent/types/validateIntentFlow.js +438 -0
- package/dist/plugins/flowintent/ui/assets/index-BkuUZejF.js +48 -0
- package/dist/plugins/flowintent/ui/assets/index-Di3MtBl5.css +1 -0
- package/dist/plugins/flowintent/ui/index.html +18 -0
- package/dist/plugins/permissionset/ui/assets/index-BCcTde0G.js +48 -0
- package/dist/plugins/permissionset/ui/index.html +1 -1
- package/dist/plugins/schema/ui/assets/index-BBcLTTbn.js +70 -0
- package/dist/plugins/schema/ui/index.html +1 -1
- package/dist/shared/bootstrap/createPluginApp.d.ts +14 -10
- package/dist/shared/bootstrap/createPluginApp.d.ts.map +1 -1
- package/dist/shared/bootstrap/createPluginApp.js +78 -17
- package/dist/shared/components/FlowIcons.d.ts +107 -0
- package/dist/shared/components/FlowIcons.d.ts.map +1 -0
- package/dist/shared/components/FlowIcons.js +243 -0
- package/package.json +4 -4
- package/dist/plugins/agent/ui/assets/index-C_Q6Mc2L.js +0 -71
- package/dist/plugins/flexipage/ui/assets/index-CuJYcAx_.js +0 -48
- package/dist/plugins/flow/ui/assets/index-OhJU6yxp.js +0 -48
- package/dist/plugins/permissionset/ui/assets/index-CMInRbR2.js +0 -48
- package/dist/plugins/schema/ui/assets/index-CWvLR0Fz.js +0 -70
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Schema ERD Visualizer</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-BBcLTTbn.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-EHPZb2E3.css">
|
|
9
9
|
<link rel="stylesheet" href="@dist/design-system/platform.css" data-platform-styles="true">
|
|
10
10
|
</head>
|
|
@@ -5,14 +5,15 @@
|
|
|
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
7
|
import React from 'react';
|
|
8
|
-
import { getPluginData } from '@salesforce/metadata-core-sdk';
|
|
8
|
+
import { getPluginData, type PluginDataContext } from '@salesforce/metadata-core-sdk';
|
|
9
9
|
type PluginDataResponseT = NonNullable<Awaited<ReturnType<typeof getPluginData>>>;
|
|
10
|
+
type PluginSourceKind = PluginDataContext['kind'];
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Source-specific context passed to a plugin render function.
|
|
12
13
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
export type PluginAppContext<K extends PluginSourceKind> = Extract<PluginDataContext, {
|
|
15
|
+
kind: K;
|
|
16
|
+
}> & {
|
|
16
17
|
/**
|
|
17
18
|
* SelectionGraph (vibe-edit): the host-forwarded selectable nodes for this
|
|
18
19
|
* file, taken verbatim from `PLUGIN_DATA_RESPONSE.selectableNodes`. Present
|
|
@@ -24,19 +25,21 @@ export interface PluginAppContext {
|
|
|
24
25
|
* / hosts that don't participate in the SelectionGraph path.
|
|
25
26
|
*/
|
|
26
27
|
selectableNodes?: PluginDataResponseT['selectableNodes'];
|
|
27
|
-
}
|
|
28
|
+
};
|
|
28
29
|
/**
|
|
29
30
|
* Options for bootstrapping a plugin app via runPluginAppWhenReady or createPluginApp.
|
|
30
31
|
*
|
|
31
32
|
* @typeParam T - Type of the plugin data received from the host (e.g. flow data, flexipage data).
|
|
32
33
|
*/
|
|
33
|
-
export interface CreatePluginAppOptions<T = unknown> {
|
|
34
|
+
export interface CreatePluginAppOptions<T = unknown, K extends PluginSourceKind = PluginSourceKind> {
|
|
34
35
|
/** Plugin name for logs and error reporting (e.g. "Flow", "FlexiPage"). */
|
|
35
36
|
pluginName: string;
|
|
36
37
|
/** CSS class applied to the root/error container for scoped styling. */
|
|
37
38
|
rootClass: string;
|
|
39
|
+
/** Host source contract this bundle supports. Enforced before rendering. */
|
|
40
|
+
expectedSourceKind: K;
|
|
38
41
|
/** Renders the main visualization. Called only after data is loaded and validated. */
|
|
39
|
-
render: (data: T, context: PluginAppContext) => React.ReactNode;
|
|
42
|
+
render: (data: T, context: PluginAppContext<K>) => React.ReactNode;
|
|
40
43
|
/**
|
|
41
44
|
* Optional validator. Return a string (error message to show) or null if data is valid.
|
|
42
45
|
* Use to fail fast with a clear message when required fields or shape are missing.
|
|
@@ -66,7 +69,7 @@ export interface CreatePluginAppOptions<T = unknown> {
|
|
|
66
69
|
* @typeParam T - Type of the plugin data.
|
|
67
70
|
* @param options - Plugin name, root class, render function, and optional validateData.
|
|
68
71
|
*/
|
|
69
|
-
export declare function createPluginApp<T = unknown>(options: CreatePluginAppOptions<T>): Promise<void>;
|
|
72
|
+
export declare function createPluginApp<T = unknown, K extends PluginSourceKind = PluginSourceKind>(options: CreatePluginAppOptions<T, K>): Promise<void>;
|
|
70
73
|
/**
|
|
71
74
|
* Entry point for plugin UIs. Sets up global error handlers, waits for DOM readiness, then
|
|
72
75
|
* runs createPluginApp so the plugin fetches data and renders.
|
|
@@ -88,6 +91,7 @@ export declare function createPluginApp<T = unknown>(options: CreatePluginAppOpt
|
|
|
88
91
|
* runPluginAppWhenReady({
|
|
89
92
|
* pluginName: 'MyPlugin',
|
|
90
93
|
* rootClass: 'myplugin-app',
|
|
94
|
+
* expectedSourceKind: 'file',
|
|
91
95
|
* render: (data, context) => <MyVisualization data={data} context={context} />,
|
|
92
96
|
* validateData: (data) => (data?.id ? null : 'Missing required field: id'),
|
|
93
97
|
* });
|
|
@@ -95,6 +99,6 @@ export declare function createPluginApp<T = unknown>(options: CreatePluginAppOpt
|
|
|
95
99
|
* @typeParam T - Type of the plugin data (inferred from render/validateData if used).
|
|
96
100
|
* @param options - Same as CreatePluginAppOptions; passed through to createPluginApp.
|
|
97
101
|
*/
|
|
98
|
-
export declare function runPluginAppWhenReady<T = unknown>(options: CreatePluginAppOptions<T>): void;
|
|
102
|
+
export declare function runPluginAppWhenReady<T = unknown, K extends PluginSourceKind = PluginSourceKind>(options: CreatePluginAppOptions<T, K>): void;
|
|
99
103
|
export {};
|
|
100
104
|
//# sourceMappingURL=createPluginApp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPluginApp.d.ts","sourceRoot":"","sources":["../../../src/shared/bootstrap/createPluginApp.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,aAAa,
|
|
1
|
+
{"version":3,"file":"createPluginApp.d.ts","sourceRoot":"","sources":["../../../src/shared/bootstrap/createPluginApp.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,aAAa,EAGb,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAOvC,KAAK,mBAAmB,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC;AAClF,KAAK,gBAAgB,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AA2BlD;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,IAAI,OAAO,CAChE,iBAAiB,EACjB;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CACZ,GAAG;IACF;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;CAC1D,CAAC;AAuEF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CACrC,CAAC,GAAG,OAAO,EACX,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IAE7C,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,kBAAkB,EAAE,CAAC,CAAC;IACtB,sFAAsF;IACtF,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IACnE;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,eAAe,CACnC,CAAC,GAAG,OAAO,EACX,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAE7C,OAAO,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CAgOf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,GAAG,OAAO,EACX,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAE7C,OAAO,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC,IAAI,CAoBN"}
|
|
@@ -9,9 +9,31 @@ import ReactDOM from 'react-dom/client';
|
|
|
9
9
|
import { ErrorBoundary } from '@shared/components/ErrorBoundary';
|
|
10
10
|
import { ErrorBuilder, ErrorCategory, getPluginData, onDataUpdate, setupErrorHandlers, } from '@salesforce/metadata-core-sdk';
|
|
11
11
|
let currentRoot = null;
|
|
12
|
-
let
|
|
12
|
+
let currentSourceIdentity = null;
|
|
13
13
|
let currentUnsubscribe = null;
|
|
14
14
|
let pageHideListenerInstalled = false;
|
|
15
|
+
/**
|
|
16
|
+
* Normalizes the file context shape sent by hosts that predate the source-kind
|
|
17
|
+
* discriminator. Keep this compatibility at the untrusted message boundary so
|
|
18
|
+
* every downstream consumer still receives the current discriminated union.
|
|
19
|
+
*/
|
|
20
|
+
function normalizeLegacyFileContext(context) {
|
|
21
|
+
if (typeof context !== 'object' || context === null) {
|
|
22
|
+
return context;
|
|
23
|
+
}
|
|
24
|
+
const runtimeContext = context;
|
|
25
|
+
if (runtimeContext.kind === undefined &&
|
|
26
|
+
typeof runtimeContext.filePath === 'string' &&
|
|
27
|
+
typeof runtimeContext.fileName === 'string') {
|
|
28
|
+
return {
|
|
29
|
+
...runtimeContext,
|
|
30
|
+
kind: 'file',
|
|
31
|
+
filePath: runtimeContext.filePath,
|
|
32
|
+
fileName: runtimeContext.fileName,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
return context;
|
|
36
|
+
}
|
|
15
37
|
/**
|
|
16
38
|
* Renders a user-visible error message into the root element when the plugin cannot render
|
|
17
39
|
* (e.g. missing data, validation failure). Uses innerHTML so the app shows a clear message
|
|
@@ -74,7 +96,7 @@ function reportAndShowError(rootElement, opts) {
|
|
|
74
96
|
* @param options - Plugin name, root class, render function, and optional validateData.
|
|
75
97
|
*/
|
|
76
98
|
export async function createPluginApp(options) {
|
|
77
|
-
const { pluginName, rootClass, render, validateData } = options;
|
|
99
|
+
const { pluginName, rootClass, expectedSourceKind, render, validateData } = options;
|
|
78
100
|
const logPrefix = `[${pluginName} React App]`;
|
|
79
101
|
const rootElement = document.getElementById('root');
|
|
80
102
|
if (!rootElement) {
|
|
@@ -100,11 +122,15 @@ export async function createPluginApp(options) {
|
|
|
100
122
|
console.warn(`${logPrefix} Error unmounting previous root:`, e);
|
|
101
123
|
}
|
|
102
124
|
currentRoot = null;
|
|
103
|
-
|
|
125
|
+
currentSourceIdentity = null;
|
|
104
126
|
}
|
|
105
127
|
const handlerRef = { fn: null };
|
|
106
128
|
let pendingUpdate = null;
|
|
129
|
+
let sourceContractFailed = false;
|
|
107
130
|
const unsubscribe = onDataUpdate((freshPluginData) => {
|
|
131
|
+
if (sourceContractFailed) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
108
134
|
if (handlerRef.fn) {
|
|
109
135
|
try {
|
|
110
136
|
handlerRef.fn(freshPluginData);
|
|
@@ -125,7 +151,7 @@ export async function createPluginApp(options) {
|
|
|
125
151
|
// Unmount the current React root before painting an error message via innerHTML.
|
|
126
152
|
// showErrorInDOM wipes the container React owns; if we leave currentRoot live, a later
|
|
127
153
|
// valid update would render into a root whose DOM was clobbered, producing React
|
|
128
|
-
// warnings and transient glitches. Clearing
|
|
154
|
+
// warnings and transient glitches. Clearing currentSourceIdentity also forces the next
|
|
129
155
|
// valid update to take the recreate-root branch in handleData.
|
|
130
156
|
const tearDownRootForError = () => {
|
|
131
157
|
if (currentRoot) {
|
|
@@ -137,13 +163,23 @@ export async function createPluginApp(options) {
|
|
|
137
163
|
}
|
|
138
164
|
currentRoot = null;
|
|
139
165
|
}
|
|
140
|
-
|
|
166
|
+
currentSourceIdentity = null;
|
|
167
|
+
};
|
|
168
|
+
const hasExpectedSourceKind = (context) => context.kind === expectedSourceKind;
|
|
169
|
+
const stopAfterSourceMismatch = () => {
|
|
170
|
+
sourceContractFailed = true;
|
|
171
|
+
currentUnsubscribe?.();
|
|
172
|
+
currentUnsubscribe = null;
|
|
173
|
+
pendingUpdate = null;
|
|
141
174
|
};
|
|
142
175
|
const handleData = (incoming, isUpdate) => {
|
|
143
|
-
const incomingContext = incoming?.context
|
|
176
|
+
const incomingContext = incoming?.context
|
|
177
|
+
? normalizeLegacyFileContext(incoming.context)
|
|
178
|
+
: undefined;
|
|
144
179
|
const incomingData = incoming?.data;
|
|
145
180
|
if (!incomingContext || incomingData == null) {
|
|
146
181
|
tearDownRootForError();
|
|
182
|
+
const filePath = incomingContext?.kind === 'file' ? incomingContext.filePath : undefined;
|
|
147
183
|
reportAndShowError(rootElement, {
|
|
148
184
|
logPrefix,
|
|
149
185
|
rootClass,
|
|
@@ -151,14 +187,32 @@ export async function createPluginApp(options) {
|
|
|
151
187
|
consoleMessage: 'No data provided',
|
|
152
188
|
errorBuilderMessage: `${pluginName} data is missing or invalid`,
|
|
153
189
|
context: {
|
|
154
|
-
|
|
190
|
+
sourceKind: incomingContext?.kind,
|
|
155
191
|
reason: 'No data provided in response',
|
|
156
192
|
},
|
|
157
193
|
domMessage: `${pluginName} data is missing or invalid.`,
|
|
158
|
-
filePath
|
|
194
|
+
filePath,
|
|
159
195
|
});
|
|
160
196
|
return;
|
|
161
197
|
}
|
|
198
|
+
if (!hasExpectedSourceKind(incomingContext)) {
|
|
199
|
+
tearDownRootForError();
|
|
200
|
+
stopAfterSourceMismatch();
|
|
201
|
+
reportAndShowError(rootElement, {
|
|
202
|
+
logPrefix,
|
|
203
|
+
rootClass,
|
|
204
|
+
title: 'Error: Unsupported visualization source',
|
|
205
|
+
consoleMessage: `Expected ${expectedSourceKind} context but received ${incomingContext.kind}`,
|
|
206
|
+
errorBuilderMessage: `${pluginName} received an incompatible visualization source`,
|
|
207
|
+
context: {
|
|
208
|
+
expectedSourceKind,
|
|
209
|
+
actualSourceKind: incomingContext.kind,
|
|
210
|
+
},
|
|
211
|
+
domMessage: `${pluginName} cannot render data from this source.`,
|
|
212
|
+
});
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const sourceContext = incomingContext;
|
|
162
216
|
const validationError = validateData != null ? validateData(incomingData) : null;
|
|
163
217
|
if (validationError != null) {
|
|
164
218
|
tearDownRootForError();
|
|
@@ -169,26 +223,29 @@ export async function createPluginApp(options) {
|
|
|
169
223
|
consoleMessage: `Validation failed: ${validationError}`,
|
|
170
224
|
errorBuilderMessage: `${pluginName} data structure is invalid`,
|
|
171
225
|
context: {
|
|
172
|
-
|
|
226
|
+
sourceKind: sourceContext.kind,
|
|
173
227
|
reason: validationError,
|
|
174
228
|
},
|
|
175
229
|
domMessage: validationError,
|
|
230
|
+
filePath: sourceContext.kind === 'file' ? sourceContext.filePath : undefined,
|
|
176
231
|
});
|
|
177
232
|
return;
|
|
178
233
|
}
|
|
179
234
|
const ctx = {
|
|
180
|
-
|
|
181
|
-
fileName: incomingContext.fileName,
|
|
235
|
+
...sourceContext,
|
|
182
236
|
// Forward the host's selectable nodes verbatim (undefined when the host
|
|
183
237
|
// gated vibe-edit off or produced none). Both the initial and live-update
|
|
184
238
|
// paths run through handleData, so a gate flip on a later push is honored.
|
|
185
239
|
selectableNodes: incoming.selectableNodes,
|
|
186
240
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
//
|
|
191
|
-
|
|
241
|
+
const sourceIdentity = sourceContext.kind === 'file'
|
|
242
|
+
? `file:${sourceContext.filePath}`
|
|
243
|
+
: `payload:${sourceContext.pluginId}`;
|
|
244
|
+
// Remount only when the source identity changes. File identity is its path;
|
|
245
|
+
// payload identity is kind + plugin id. The page/bootstrap render envelope
|
|
246
|
+
// owns generation correlation, so fileId/renderId must not become component
|
|
247
|
+
// identity and discard state on every update.
|
|
248
|
+
if (currentRoot == null || sourceIdentity !== currentSourceIdentity) {
|
|
192
249
|
if (currentRoot) {
|
|
193
250
|
try {
|
|
194
251
|
currentRoot.unmount();
|
|
@@ -200,7 +257,7 @@ export async function createPluginApp(options) {
|
|
|
200
257
|
}
|
|
201
258
|
rootElement.innerHTML = '';
|
|
202
259
|
currentRoot = ReactDOM.createRoot(rootElement);
|
|
203
|
-
|
|
260
|
+
currentSourceIdentity = sourceIdentity;
|
|
204
261
|
}
|
|
205
262
|
renderInto(currentRoot, incomingData, ctx);
|
|
206
263
|
};
|
|
@@ -225,6 +282,9 @@ export async function createPluginApp(options) {
|
|
|
225
282
|
return;
|
|
226
283
|
}
|
|
227
284
|
handleData(pluginData, false);
|
|
285
|
+
if (sourceContractFailed) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
228
288
|
// Install the live update handler and replay any update buffered during the await.
|
|
229
289
|
handlerRef.fn = (fresh) => handleData(fresh, true);
|
|
230
290
|
if (pendingUpdate) {
|
|
@@ -254,6 +314,7 @@ export async function createPluginApp(options) {
|
|
|
254
314
|
* runPluginAppWhenReady({
|
|
255
315
|
* pluginName: 'MyPlugin',
|
|
256
316
|
* rootClass: 'myplugin-app',
|
|
317
|
+
* expectedSourceKind: 'file',
|
|
257
318
|
* render: (data, context) => <MyVisualization data={data} context={context} />,
|
|
258
319
|
* validateData: (data) => (data?.id ? null : 'Missing required field: id'),
|
|
259
320
|
* });
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
* Full-tile SVG icons for Flow Builder elements. Each icon is a colored tile
|
|
9
|
+
* (circle for Start/End, rounded square for elements, rotated rhombus for
|
|
10
|
+
* Decision) with a white glyph baked on.
|
|
11
|
+
*
|
|
12
|
+
* The tile chrome — the svg wrapper, optional `<title>`, background shape, and
|
|
13
|
+
* fill color — is shared through the `<FlowTile>` helper below. Each per-icon
|
|
14
|
+
* component only supplies the glyph path(s), keeping the definitions readable
|
|
15
|
+
* and the color registry centralized.
|
|
16
|
+
*
|
|
17
|
+
* Sizing: pass a `size` prop; the SVG viewBox scales the artwork. Decision
|
|
18
|
+
* uses a 68×68 viewBox (its rotated rhombus needs extra room); all others use
|
|
19
|
+
* 48×48. Callers should account for that when they want the visual weight to
|
|
20
|
+
* match — passing a size for the tile footprint (e.g. 42) works for both.
|
|
21
|
+
*/
|
|
22
|
+
import React from 'react';
|
|
23
|
+
export interface FlowIconProps {
|
|
24
|
+
size?: number;
|
|
25
|
+
title?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function IconStart(props: FlowIconProps): React.JSX.Element;
|
|
28
|
+
export declare function IconEnd(props: FlowIconProps): React.JSX.Element;
|
|
29
|
+
export declare function IconScreen(props: FlowIconProps): React.JSX.Element;
|
|
30
|
+
export declare function IconAssignment(props: FlowIconProps): React.JSX.Element;
|
|
31
|
+
export declare function IconDecision(props: FlowIconProps): React.JSX.Element;
|
|
32
|
+
export declare function IconLoop(props: FlowIconProps): React.JSX.Element;
|
|
33
|
+
export declare function IconRecordCreate(props: FlowIconProps): React.JSX.Element;
|
|
34
|
+
export declare function IconRecordLookup(props: FlowIconProps): React.JSX.Element;
|
|
35
|
+
export declare function IconRecordUpdate(props: FlowIconProps): React.JSX.Element;
|
|
36
|
+
export declare function IconRecordDelete(props: FlowIconProps): React.JSX.Element;
|
|
37
|
+
export declare function IconRecordRollback(props: FlowIconProps): React.JSX.Element;
|
|
38
|
+
export declare function IconManagedContentStep(props: FlowIconProps): React.JSX.Element;
|
|
39
|
+
export declare function IconSubflow(props: FlowIconProps): React.JSX.Element;
|
|
40
|
+
export declare function IconWait(props: FlowIconProps): React.JSX.Element;
|
|
41
|
+
export declare function IconCollectionFilter(props: FlowIconProps): React.JSX.Element;
|
|
42
|
+
export declare function IconCollectionSort(props: FlowIconProps): React.JSX.Element;
|
|
43
|
+
export declare function IconTransform(props: FlowIconProps): React.JSX.Element;
|
|
44
|
+
export declare function IconCoreAction(props: FlowIconProps): React.JSX.Element;
|
|
45
|
+
export declare function IconApexAction(props: FlowIconProps): React.JSX.Element;
|
|
46
|
+
export declare function IconApexLegacy(props: FlowIconProps): React.JSX.Element;
|
|
47
|
+
export declare function IconEmailAction(props: FlowIconProps): React.JSX.Element;
|
|
48
|
+
export declare function IconStage(props: FlowIconProps): React.JSX.Element;
|
|
49
|
+
export declare function IconInteractiveStep(props: FlowIconProps): React.JSX.Element;
|
|
50
|
+
export declare function IconAddScreenProp(props: FlowIconProps): React.JSX.Element;
|
|
51
|
+
export declare function IconAddSkillRequirement({ size, title }: FlowIconProps): React.JSX.Element;
|
|
52
|
+
export declare function IconCheckAvailability(props: FlowIconProps): React.JSX.Element;
|
|
53
|
+
export declare function IconExternalConnector(props: FlowIconProps): React.JSX.Element;
|
|
54
|
+
export declare function IconCustomError(props: FlowIconProps): React.JSX.Element;
|
|
55
|
+
export declare function IconAddPromptInstructions(props: FlowIconProps): React.JSX.Element;
|
|
56
|
+
export declare function IconRouteWork(props: FlowIconProps): React.JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* Master registry: shared icon kind → full-tile icon component. Callers should
|
|
59
|
+
* render via `<FlowIcon kind={...} size={...} />` so future additions live in
|
|
60
|
+
* one place. `collectionProcessor` maps to the Filter glyph; the Sort variant
|
|
61
|
+
* remains exported for callers that want it explicitly. `group` is the
|
|
62
|
+
* renderer-only collapsed-group kind and intentionally uses the core-action
|
|
63
|
+
* fallback as an explicit registry entry.
|
|
64
|
+
*/
|
|
65
|
+
declare const ICONS: {
|
|
66
|
+
readonly start: typeof IconStart;
|
|
67
|
+
readonly end: typeof IconEnd;
|
|
68
|
+
readonly screen: typeof IconScreen;
|
|
69
|
+
readonly action: typeof IconCoreAction;
|
|
70
|
+
readonly apexAction: typeof IconApexAction;
|
|
71
|
+
readonly apexPluginCall: typeof IconApexLegacy;
|
|
72
|
+
readonly emailAction: typeof IconEmailAction;
|
|
73
|
+
readonly externalCallout: typeof IconExternalConnector;
|
|
74
|
+
readonly routeWork: typeof IconRouteWork;
|
|
75
|
+
readonly addScreenPop: typeof IconAddScreenProp;
|
|
76
|
+
readonly addSkillRequirement: typeof IconAddSkillRequirement;
|
|
77
|
+
readonly checkAvailability: typeof IconCheckAvailability;
|
|
78
|
+
readonly setScreenProperty: typeof IconAddScreenProp;
|
|
79
|
+
readonly assignment: typeof IconAssignment;
|
|
80
|
+
readonly addPromptInstructions: typeof IconAddPromptInstructions;
|
|
81
|
+
readonly decision: typeof IconDecision;
|
|
82
|
+
readonly loop: typeof IconLoop;
|
|
83
|
+
readonly recordCreate: typeof IconRecordCreate;
|
|
84
|
+
readonly recordLookup: typeof IconRecordLookup;
|
|
85
|
+
readonly recordUpdate: typeof IconRecordUpdate;
|
|
86
|
+
readonly recordDelete: typeof IconRecordDelete;
|
|
87
|
+
readonly recordRollback: typeof IconRecordRollback;
|
|
88
|
+
readonly subflow: typeof IconSubflow;
|
|
89
|
+
readonly wait: typeof IconWait;
|
|
90
|
+
readonly collectionProcessor: typeof IconCollectionFilter;
|
|
91
|
+
readonly collectionSort: typeof IconCollectionSort;
|
|
92
|
+
readonly transform: typeof IconTransform;
|
|
93
|
+
readonly customError: typeof IconCustomError;
|
|
94
|
+
readonly stage: typeof IconStage;
|
|
95
|
+
readonly interactiveStep: typeof IconInteractiveStep;
|
|
96
|
+
readonly managedContentStep: typeof IconManagedContentStep;
|
|
97
|
+
readonly group: typeof IconCoreAction;
|
|
98
|
+
};
|
|
99
|
+
export type FlowIconKind = keyof typeof ICONS;
|
|
100
|
+
/** Stable runtime list used by registry/render contract tests. */
|
|
101
|
+
export declare const FLOW_ICON_KINDS: readonly ("group" | "start" | "end" | "action" | "screen" | "apexAction" | "apexPluginCall" | "emailAction" | "externalCallout" | "routeWork" | "addScreenPop" | "addSkillRequirement" | "checkAvailability" | "setScreenProperty" | "assignment" | "addPromptInstructions" | "decision" | "loop" | "recordCreate" | "recordLookup" | "recordUpdate" | "recordDelete" | "recordRollback" | "subflow" | "wait" | "collectionProcessor" | "collectionSort" | "transform" | "customError" | "stage" | "interactiveStep" | "managedContentStep")[];
|
|
102
|
+
export interface FlowIconKindProps extends FlowIconProps {
|
|
103
|
+
kind: FlowIconKind;
|
|
104
|
+
}
|
|
105
|
+
export declare function FlowIcon({ kind, size, title }: FlowIconKindProps): React.JSX.Element;
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=FlowIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowIcons.d.ts","sourceRoot":"","sources":["../../../src/shared/components/FlowIcons.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkDD,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,qBAW7C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,aAAa,qBAW3C;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,qBAS9C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,qBASlD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,qBAShD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAS5C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,qBASpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,qBASpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,qBASpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,qBAiBpD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,qBAatD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,qBAS1D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,qBAS/C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAS5C;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,qBASxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,qBAStD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,qBASjD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,qBASlD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,qBASlD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,qBASlD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,qBASnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,qBAS7C;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,aAAa,qBAavD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,qBASrD;AAED,wBAAgB,uBAAuB,CAAC,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,aAAa,qBAqB1E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,qBAiBzD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,qBASzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,qBAenD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,qBAa7D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,qBASjD;AAED;;;;;;;GAOG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCiD,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,kEAAkE;AAClE,eAAO,MAAM,eAAe,ghBAAsD,CAAC;AAEnF,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAS,EAAE,KAAK,EAAE,EAAE,iBAAiB,qBAGrE"}
|