@salesforce/metadata-plugins 1.0.2 → 1.2.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.map +1 -1
- package/dist/index.js +2 -1
- package/dist/plugins/flexipage/FlexipageParser.d.ts +7 -1
- package/dist/plugins/flexipage/FlexipageParser.d.ts.map +1 -1
- package/dist/plugins/flexipage/FlexipageParser.js +13 -5
- package/dist/plugins/flexipage/transformer/FlexipageTransformerUtils.d.ts +1 -1
- package/dist/plugins/flexipage/transformer/FlexipageTransformerUtils.d.ts.map +1 -1
- package/dist/plugins/flexipage/ui/assets/index-DT5lcUwK.js +48 -0
- package/dist/plugins/flexipage/ui/index.html +1 -1
- package/dist/plugins/schema/SchemaParser.d.ts +9 -1
- package/dist/plugins/schema/SchemaParser.d.ts.map +1 -1
- package/dist/plugins/schema/SchemaParser.js +56 -18
- package/dist/plugins/schema/SchemaVisualizer.d.ts.map +1 -1
- package/dist/plugins/schema/SchemaVisualizer.js +3 -7
- package/dist/plugins/schema/types/SchemaERDData.d.ts +8 -0
- package/dist/plugins/schema/types/SchemaERDData.d.ts.map +1 -1
- package/dist/plugins/schema/ui/assets/index-DCLgZby3.css +1 -0
- package/dist/plugins/schema/ui/assets/index-jqcasNAD.js +70 -0
- package/dist/plugins/schema/ui/index.html +2 -2
- package/dist/shared/bootstrap/createPluginApp.d.ts +86 -0
- package/dist/shared/bootstrap/createPluginApp.d.ts.map +1 -0
- package/dist/shared/bootstrap/createPluginApp.js +281 -0
- package/dist/shared/components/ErrorBoundary.d.ts +35 -0
- package/dist/shared/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/shared/components/ErrorBoundary.js +63 -0
- package/dist/shared/uem/transformer/TransformerRegistry.d.ts +0 -8
- package/dist/shared/uem/transformer/TransformerRegistry.d.ts.map +1 -1
- package/dist/shared/uem/transformer/TransformerRegistry.js +2 -16
- package/dist/shared/uem/transformer/UemBasedVisualizer.d.ts.map +1 -1
- package/dist/shared/uem/transformer/UemBasedVisualizer.js +3 -7
- package/dist/shared/uem/types/UemMetadata.d.ts +13 -2
- package/dist/shared/uem/types/UemMetadata.d.ts.map +1 -1
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.d.ts +16 -0
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.d.ts.map +1 -0
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.js +194 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.d.ts +20 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.d.ts.map +1 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.js +381 -0
- package/dist/shared/utils/isPluginError.d.ts +11 -0
- package/dist/shared/utils/isPluginError.d.ts.map +1 -0
- package/dist/shared/utils/isPluginError.js +18 -0
- package/dist/shared/utils/patternMatcher.d.ts +34 -0
- package/dist/shared/utils/patternMatcher.d.ts.map +1 -0
- package/dist/shared/utils/patternMatcher.js +44 -0
- package/dist/shared/utils/uemTreeUtils.d.ts +2 -1
- package/dist/shared/utils/uemTreeUtils.d.ts.map +1 -1
- package/dist/shared/utils/uemTreeUtils.js +12 -6
- package/dist/shared/utils/vizDependentPathsHelper.d.ts +0 -9
- package/dist/shared/utils/vizDependentPathsHelper.d.ts.map +1 -1
- package/dist/shared/utils/vizDependentPathsHelper.js +3 -19
- package/package.json +5 -4
- package/dist/plugins/flexipage/ui/assets/index-DUDC29Wu.js +0 -55
- package/dist/plugins/schema/ui/assets/index-BbY653nW.js +0 -62
- package/dist/plugins/schema/ui/assets/index-CbNHuvPl.css +0 -1
|
@@ -4,8 +4,8 @@
|
|
|
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-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-jqcasNAD.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DCLgZby3.css">
|
|
9
9
|
<link rel="stylesheet" href="@dist/design-system/platform.css" data-platform-styles="true">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Context passed to the plugin's render function. Provides file metadata from the host.
|
|
10
|
+
*/
|
|
11
|
+
export interface PluginAppContext {
|
|
12
|
+
filePath: string;
|
|
13
|
+
fileName: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options for bootstrapping a plugin app via runPluginAppWhenReady or createPluginApp.
|
|
17
|
+
*
|
|
18
|
+
* @typeParam T - Type of the plugin data received from the host (e.g. flow data, flexipage data).
|
|
19
|
+
*/
|
|
20
|
+
export interface CreatePluginAppOptions<T = unknown> {
|
|
21
|
+
/** Plugin name for logs and error reporting (e.g. "Flow", "FlexiPage"). */
|
|
22
|
+
pluginName: string;
|
|
23
|
+
/** CSS class applied to the root/error container for scoped styling. */
|
|
24
|
+
rootClass: string;
|
|
25
|
+
/** Renders the main visualization. Called only after data is loaded and validated. */
|
|
26
|
+
render: (data: T, context: PluginAppContext) => React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Optional validator. Return a string (error message to show) or null if data is valid.
|
|
29
|
+
* Use to fail fast with a clear message when required fields or shape are missing.
|
|
30
|
+
*/
|
|
31
|
+
validateData?: (data: T) => string | null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Bootstraps the plugin React app: fetches data from the host, validates it, manages the
|
|
35
|
+
* React root lifecycle, and renders your component inside StrictMode and ErrorBoundary.
|
|
36
|
+
*
|
|
37
|
+
* Flow:
|
|
38
|
+
* 1. Resolves the #root element (exits if missing).
|
|
39
|
+
* 2. Tears down any prior subscription and root from a previous bootstrap.
|
|
40
|
+
* 3. Subscribes to onDataUpdate *before* fetching initial data, buffering events that
|
|
41
|
+
* arrive during the await (latest wins) and replaying them after initial render.
|
|
42
|
+
* 4. Fetches initial data via getPluginData(); on missing response, shows an error and
|
|
43
|
+
* leaves the subscription installed so the host can push corrected data to recover.
|
|
44
|
+
* 5. Validates data (if validator provided); on failure, shows error.
|
|
45
|
+
* 6. Creates a React root keyed by filePath: same file → re-render into existing root
|
|
46
|
+
* (preserves component state); different file → unmount + recreate.
|
|
47
|
+
* 7. Live updates flow through the same handler, so initial and update paths share
|
|
48
|
+
* validation, error handling, and remount logic.
|
|
49
|
+
*
|
|
50
|
+
* Prefer calling this indirectly via runPluginAppWhenReady so DOM readiness and global
|
|
51
|
+
* error handlers are set up first.
|
|
52
|
+
*
|
|
53
|
+
* @typeParam T - Type of the plugin data.
|
|
54
|
+
* @param options - Plugin name, root class, render function, and optional validateData.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createPluginApp<T = unknown>(options: CreatePluginAppOptions<T>): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Entry point for plugin UIs. Sets up global error handlers, waits for DOM readiness, then
|
|
59
|
+
* runs createPluginApp so the plugin fetches data and renders.
|
|
60
|
+
*
|
|
61
|
+
* Why use it:
|
|
62
|
+
* - Ensures the document (and #root) exist before running; avoids "root not found" in fast loads.
|
|
63
|
+
* - Registers setupErrorHandlers() so uncaught errors are reported to the host instead of failing silently.
|
|
64
|
+
* - Single call in main.tsx is all that's needed; no manual DOMContentLoaded or error handling.
|
|
65
|
+
*
|
|
66
|
+
* Behavior:
|
|
67
|
+
* 1. Calls setupErrorHandlers() once (from @salesforce/metadata-core-sdk).
|
|
68
|
+
* 2. If document.readyState === 'loading', schedules createPluginApp on 'DOMContentLoaded'.
|
|
69
|
+
* 3. Otherwise runs createPluginApp immediately (e.g. script deferred or loaded after DOM ready).
|
|
70
|
+
*
|
|
71
|
+
* Usage in main.tsx:
|
|
72
|
+
* @example
|
|
73
|
+
* import { runPluginAppWhenReady } from '@shared/bootstrap/createPluginApp';
|
|
74
|
+
*
|
|
75
|
+
* runPluginAppWhenReady({
|
|
76
|
+
* pluginName: 'MyPlugin',
|
|
77
|
+
* rootClass: 'myplugin-app',
|
|
78
|
+
* render: (data, context) => <MyVisualization data={data} context={context} />,
|
|
79
|
+
* validateData: (data) => (data?.id ? null : 'Missing required field: id'),
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* @typeParam T - Type of the plugin data (inferred from render/validateData if used).
|
|
83
|
+
* @param options - Same as CreatePluginAppOptions; passed through to createPluginApp.
|
|
84
|
+
*/
|
|
85
|
+
export declare function runPluginAppWhenReady<T = unknown>(options: CreatePluginAppOptions<T>): void;
|
|
86
|
+
//# sourceMappingURL=createPluginApp.d.ts.map
|
|
@@ -0,0 +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;AAkB1B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAuED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,OAAO;IACjD,2EAA2E;IAC3E,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC;IAChE;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,eAAe,CAAC,CAAC,GAAG,OAAO,EAC/C,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CA8Kf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EAC/C,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,IAAI,CAoBN"}
|
|
@@ -0,0 +1,281 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import ReactDOM from 'react-dom/client';
|
|
9
|
+
import { ErrorBoundary } from '@shared/components/ErrorBoundary';
|
|
10
|
+
import { ErrorBuilder, ErrorCategory, getPluginData, onDataUpdate, setupErrorHandlers, } from '@salesforce/metadata-core-sdk';
|
|
11
|
+
let currentRoot = null;
|
|
12
|
+
let currentFilePath = null;
|
|
13
|
+
let currentUnsubscribe = null;
|
|
14
|
+
let pageHideListenerInstalled = false;
|
|
15
|
+
/**
|
|
16
|
+
* Renders a user-visible error message into the root element when the plugin cannot render
|
|
17
|
+
* (e.g. missing data, validation failure). Uses innerHTML so the app shows a clear message
|
|
18
|
+
* instead of a blank or broken UI. The rootClass ensures error styling matches the plugin's theme.
|
|
19
|
+
*/
|
|
20
|
+
function showErrorInDOM(rootElement, options) {
|
|
21
|
+
const { rootClass, title, message, filePath } = options;
|
|
22
|
+
const fileLine = filePath ? `<p>File: ${filePath}</p>` : '';
|
|
23
|
+
rootElement.innerHTML = `
|
|
24
|
+
<div class="${rootClass}">
|
|
25
|
+
<div class="error-message">
|
|
26
|
+
<h2>${title}</h2>
|
|
27
|
+
<p>${message}</p>
|
|
28
|
+
${fileLine}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Logs the error, reports it via ErrorBuilder, then shows a friendly
|
|
35
|
+
* message in the DOM. Use for any bootstrap failure (no data, invalid data, host error) so
|
|
36
|
+
* users see what went wrong and the host can track rendering failures.
|
|
37
|
+
*/
|
|
38
|
+
function reportAndShowError(rootElement, opts) {
|
|
39
|
+
const { logPrefix, rootClass, title, consoleMessage, errorBuilderMessage, context = {}, domMessage, filePath, } = opts;
|
|
40
|
+
console.error(`${logPrefix} ${consoleMessage}`);
|
|
41
|
+
ErrorBuilder.create()
|
|
42
|
+
.category(ErrorCategory.Rendering)
|
|
43
|
+
.message(errorBuilderMessage)
|
|
44
|
+
.context(context)
|
|
45
|
+
.send();
|
|
46
|
+
showErrorInDOM(rootElement, {
|
|
47
|
+
rootClass,
|
|
48
|
+
title,
|
|
49
|
+
message: domMessage,
|
|
50
|
+
filePath,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Bootstraps the plugin React app: fetches data from the host, validates it, manages the
|
|
55
|
+
* React root lifecycle, and renders your component inside StrictMode and ErrorBoundary.
|
|
56
|
+
*
|
|
57
|
+
* Flow:
|
|
58
|
+
* 1. Resolves the #root element (exits if missing).
|
|
59
|
+
* 2. Tears down any prior subscription and root from a previous bootstrap.
|
|
60
|
+
* 3. Subscribes to onDataUpdate *before* fetching initial data, buffering events that
|
|
61
|
+
* arrive during the await (latest wins) and replaying them after initial render.
|
|
62
|
+
* 4. Fetches initial data via getPluginData(); on missing response, shows an error and
|
|
63
|
+
* leaves the subscription installed so the host can push corrected data to recover.
|
|
64
|
+
* 5. Validates data (if validator provided); on failure, shows error.
|
|
65
|
+
* 6. Creates a React root keyed by filePath: same file → re-render into existing root
|
|
66
|
+
* (preserves component state); different file → unmount + recreate.
|
|
67
|
+
* 7. Live updates flow through the same handler, so initial and update paths share
|
|
68
|
+
* validation, error handling, and remount logic.
|
|
69
|
+
*
|
|
70
|
+
* Prefer calling this indirectly via runPluginAppWhenReady so DOM readiness and global
|
|
71
|
+
* error handlers are set up first.
|
|
72
|
+
*
|
|
73
|
+
* @typeParam T - Type of the plugin data.
|
|
74
|
+
* @param options - Plugin name, root class, render function, and optional validateData.
|
|
75
|
+
*/
|
|
76
|
+
export async function createPluginApp(options) {
|
|
77
|
+
const { pluginName, rootClass, render, validateData } = options;
|
|
78
|
+
const logPrefix = `[${pluginName} React App]`;
|
|
79
|
+
const rootElement = document.getElementById('root');
|
|
80
|
+
if (!rootElement) {
|
|
81
|
+
console.error(`${logPrefix} Root element not found`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
// Tear down any prior subscription. The new one is installed below, before the await,
|
|
85
|
+
// so updates arriving during async bootstrap are not silently dropped: events that
|
|
86
|
+
// fire before the handler is wired up are buffered (latest wins) and replayed.
|
|
87
|
+
// Error return paths leave the subscription in place so the host can push corrected
|
|
88
|
+
// data to recover.
|
|
89
|
+
if (currentUnsubscribe) {
|
|
90
|
+
currentUnsubscribe();
|
|
91
|
+
currentUnsubscribe = null;
|
|
92
|
+
}
|
|
93
|
+
// Unmount any previous root synchronously. Doing this up front (rather than after the
|
|
94
|
+
// await) avoids a window where two roots could try to render into the same element.
|
|
95
|
+
if (currentRoot) {
|
|
96
|
+
try {
|
|
97
|
+
currentRoot.unmount();
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
console.warn(`${logPrefix} Error unmounting previous root:`, e);
|
|
101
|
+
}
|
|
102
|
+
currentRoot = null;
|
|
103
|
+
currentFilePath = null;
|
|
104
|
+
}
|
|
105
|
+
const handlerRef = { fn: null };
|
|
106
|
+
let pendingUpdate = null;
|
|
107
|
+
const unsubscribe = onDataUpdate((freshPluginData) => {
|
|
108
|
+
if (handlerRef.fn) {
|
|
109
|
+
try {
|
|
110
|
+
handlerRef.fn(freshPluginData);
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
console.error(`${logPrefix} Update handler threw:`, e);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
pendingUpdate = freshPluginData;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
currentUnsubscribe = unsubscribe;
|
|
121
|
+
const renderInto = (target, data, ctx) => {
|
|
122
|
+
target.render(React.createElement(React.StrictMode, null,
|
|
123
|
+
React.createElement(ErrorBoundary, null, render(data, ctx))));
|
|
124
|
+
};
|
|
125
|
+
// Unmount the current React root before painting an error message via innerHTML.
|
|
126
|
+
// showErrorInDOM wipes the container React owns; if we leave currentRoot live, a later
|
|
127
|
+
// valid update would render into a root whose DOM was clobbered, producing React
|
|
128
|
+
// warnings and transient glitches. Clearing currentFilePath also forces the next
|
|
129
|
+
// valid update to take the recreate-root branch in handleData.
|
|
130
|
+
const tearDownRootForError = () => {
|
|
131
|
+
if (currentRoot) {
|
|
132
|
+
try {
|
|
133
|
+
currentRoot.unmount();
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
console.warn(`${logPrefix} Error unmounting previous root:`, e);
|
|
137
|
+
}
|
|
138
|
+
currentRoot = null;
|
|
139
|
+
}
|
|
140
|
+
currentFilePath = null;
|
|
141
|
+
};
|
|
142
|
+
const handleData = (incoming, isUpdate) => {
|
|
143
|
+
const incomingContext = incoming?.context;
|
|
144
|
+
const incomingData = incoming?.data;
|
|
145
|
+
if (!incomingContext || incomingData == null) {
|
|
146
|
+
tearDownRootForError();
|
|
147
|
+
reportAndShowError(rootElement, {
|
|
148
|
+
logPrefix,
|
|
149
|
+
rootClass,
|
|
150
|
+
title: isUpdate ? 'Error: No updated data provided' : 'Error: No data provided',
|
|
151
|
+
consoleMessage: 'No data provided',
|
|
152
|
+
errorBuilderMessage: `${pluginName} data is missing or invalid`,
|
|
153
|
+
context: {
|
|
154
|
+
filePath: incomingContext?.filePath,
|
|
155
|
+
reason: 'No data provided in response',
|
|
156
|
+
},
|
|
157
|
+
domMessage: `${pluginName} data is missing or invalid.`,
|
|
158
|
+
filePath: incomingContext?.filePath || 'Unknown',
|
|
159
|
+
});
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const validationError = validateData != null ? validateData(incomingData) : null;
|
|
163
|
+
if (validationError != null) {
|
|
164
|
+
tearDownRootForError();
|
|
165
|
+
reportAndShowError(rootElement, {
|
|
166
|
+
logPrefix,
|
|
167
|
+
rootClass,
|
|
168
|
+
title: isUpdate ? 'Error: Invalid Updated Data' : 'Error: Invalid Data',
|
|
169
|
+
consoleMessage: `Validation failed: ${validationError}`,
|
|
170
|
+
errorBuilderMessage: `${pluginName} data structure is invalid`,
|
|
171
|
+
context: {
|
|
172
|
+
filePath: incomingContext.filePath,
|
|
173
|
+
reason: validationError,
|
|
174
|
+
},
|
|
175
|
+
domMessage: validationError,
|
|
176
|
+
});
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const ctx = {
|
|
180
|
+
filePath: incomingContext.filePath,
|
|
181
|
+
fileName: incomingContext.fileName,
|
|
182
|
+
};
|
|
183
|
+
// If the underlying file changed (or no root yet), unmount and recreate so React
|
|
184
|
+
// state doesn't bleed across distinct files. Compare on filePath rather than fileId
|
|
185
|
+
// because fileId is a host-side counter that changes on every push, which would
|
|
186
|
+
// force a remount on each update and discard scroll/expand/selection state.
|
|
187
|
+
if (currentRoot == null || ctx.filePath !== currentFilePath) {
|
|
188
|
+
if (currentRoot) {
|
|
189
|
+
try {
|
|
190
|
+
currentRoot.unmount();
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
console.warn(`${logPrefix} Error unmounting previous root:`, e);
|
|
194
|
+
}
|
|
195
|
+
currentRoot = null;
|
|
196
|
+
}
|
|
197
|
+
rootElement.innerHTML = '';
|
|
198
|
+
currentRoot = ReactDOM.createRoot(rootElement);
|
|
199
|
+
currentFilePath = ctx.filePath;
|
|
200
|
+
}
|
|
201
|
+
renderInto(currentRoot, incomingData, ctx);
|
|
202
|
+
};
|
|
203
|
+
const pluginData = await getPluginData();
|
|
204
|
+
if (!pluginData) {
|
|
205
|
+
reportAndShowError(rootElement, {
|
|
206
|
+
logPrefix,
|
|
207
|
+
rootClass,
|
|
208
|
+
title: 'Error: Failed to load data',
|
|
209
|
+
consoleMessage: 'Failed to receive plugin data from host',
|
|
210
|
+
errorBuilderMessage: `${pluginName} data is missing or invalid`,
|
|
211
|
+
context: { reason: 'Failed to receive plugin data from host' },
|
|
212
|
+
domMessage: `Could not receive ${pluginName} data from the extension host.`,
|
|
213
|
+
});
|
|
214
|
+
// Leave the subscription installed so the host can push corrected data later.
|
|
215
|
+
handlerRef.fn = (fresh) => handleData(fresh, true);
|
|
216
|
+
if (pendingUpdate) {
|
|
217
|
+
const buffered = pendingUpdate;
|
|
218
|
+
pendingUpdate = null;
|
|
219
|
+
handlerRef.fn(buffered);
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
handleData(pluginData, false);
|
|
224
|
+
// Install the live update handler and replay any update buffered during the await.
|
|
225
|
+
handlerRef.fn = (fresh) => handleData(fresh, true);
|
|
226
|
+
if (pendingUpdate) {
|
|
227
|
+
const buffered = pendingUpdate;
|
|
228
|
+
pendingUpdate = null;
|
|
229
|
+
handlerRef.fn(buffered);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Entry point for plugin UIs. Sets up global error handlers, waits for DOM readiness, then
|
|
234
|
+
* runs createPluginApp so the plugin fetches data and renders.
|
|
235
|
+
*
|
|
236
|
+
* Why use it:
|
|
237
|
+
* - Ensures the document (and #root) exist before running; avoids "root not found" in fast loads.
|
|
238
|
+
* - Registers setupErrorHandlers() so uncaught errors are reported to the host instead of failing silently.
|
|
239
|
+
* - Single call in main.tsx is all that's needed; no manual DOMContentLoaded or error handling.
|
|
240
|
+
*
|
|
241
|
+
* Behavior:
|
|
242
|
+
* 1. Calls setupErrorHandlers() once (from @salesforce/metadata-core-sdk).
|
|
243
|
+
* 2. If document.readyState === 'loading', schedules createPluginApp on 'DOMContentLoaded'.
|
|
244
|
+
* 3. Otherwise runs createPluginApp immediately (e.g. script deferred or loaded after DOM ready).
|
|
245
|
+
*
|
|
246
|
+
* Usage in main.tsx:
|
|
247
|
+
* @example
|
|
248
|
+
* import { runPluginAppWhenReady } from '@shared/bootstrap/createPluginApp';
|
|
249
|
+
*
|
|
250
|
+
* runPluginAppWhenReady({
|
|
251
|
+
* pluginName: 'MyPlugin',
|
|
252
|
+
* rootClass: 'myplugin-app',
|
|
253
|
+
* render: (data, context) => <MyVisualization data={data} context={context} />,
|
|
254
|
+
* validateData: (data) => (data?.id ? null : 'Missing required field: id'),
|
|
255
|
+
* });
|
|
256
|
+
*
|
|
257
|
+
* @typeParam T - Type of the plugin data (inferred from render/validateData if used).
|
|
258
|
+
* @param options - Same as CreatePluginAppOptions; passed through to createPluginApp.
|
|
259
|
+
*/
|
|
260
|
+
export function runPluginAppWhenReady(options) {
|
|
261
|
+
setupErrorHandlers();
|
|
262
|
+
// Ensure the subscription is cleaned up on page teardown so listeners do not leak.
|
|
263
|
+
// Guard against multiple bootstraps in the same page registering duplicate listeners.
|
|
264
|
+
if (!pageHideListenerInstalled) {
|
|
265
|
+
window.addEventListener('pagehide', () => {
|
|
266
|
+
if (currentUnsubscribe) {
|
|
267
|
+
currentUnsubscribe();
|
|
268
|
+
currentUnsubscribe = null;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
pageHideListenerInstalled = true;
|
|
272
|
+
}
|
|
273
|
+
if (document.readyState === 'loading') {
|
|
274
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
275
|
+
void createPluginApp(options);
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
void createPluginApp(options);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
interface ErrorBoundaryState {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
error?: Error;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Standalone React Error Boundary component
|
|
14
|
+
*
|
|
15
|
+
* This component can be used directly in JSX to wrap sections of your UI.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* <ErrorBoundary>
|
|
20
|
+
* <ObjectDiagram data={data} />
|
|
21
|
+
* </ErrorBoundary>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ErrorBoundary extends React.Component<{
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}, ErrorBoundaryState> {
|
|
27
|
+
constructor(props: {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
});
|
|
30
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
31
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
32
|
+
render(): React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/shared/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAmCD;;;;;;;;;;;GAWG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAChD;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,EAC7B,kBAAkB,CACnB;gBACa,KAAK,EAAE;QAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;KAAE;IAKhD,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIjE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAIjE,MAAM,IAAI,KAAK,CAAC,SAAS;CAM1B"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import { ErrorBuilder, ErrorCategory } from '@salesforce/metadata-core-sdk';
|
|
9
|
+
/**
|
|
10
|
+
* Report a React error to the framework (shared logic).
|
|
11
|
+
*/
|
|
12
|
+
function reportReactError(error, errorInfo) {
|
|
13
|
+
ErrorBuilder.create()
|
|
14
|
+
.category(ErrorCategory.Rendering)
|
|
15
|
+
.message(error.message)
|
|
16
|
+
.stackTrace(error.stack)
|
|
17
|
+
.context({
|
|
18
|
+
componentStack: errorInfo.componentStack,
|
|
19
|
+
errorName: error.name,
|
|
20
|
+
})
|
|
21
|
+
.send();
|
|
22
|
+
console.error('[ErrorBoundary] Rendering error:', error, errorInfo);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Minimal error fallback; error is already reported to the host via ErrorBuilder.
|
|
26
|
+
*/
|
|
27
|
+
function ErrorFallbackUI({ error }) {
|
|
28
|
+
return (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement("p", null, "Something went wrong. Check the error panel for details."),
|
|
30
|
+
error && (React.createElement(React.Fragment, null,
|
|
31
|
+
error.message && React.createElement("p", null, error.message),
|
|
32
|
+
error.stack && React.createElement("pre", null, error.stack)))));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Standalone React Error Boundary component
|
|
36
|
+
*
|
|
37
|
+
* This component can be used directly in JSX to wrap sections of your UI.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* <ErrorBoundary>
|
|
42
|
+
* <ObjectDiagram data={data} />
|
|
43
|
+
* </ErrorBoundary>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export class ErrorBoundary extends React.Component {
|
|
47
|
+
constructor(props) {
|
|
48
|
+
super(props);
|
|
49
|
+
this.state = { hasError: false };
|
|
50
|
+
}
|
|
51
|
+
static getDerivedStateFromError(error) {
|
|
52
|
+
return { hasError: true, error };
|
|
53
|
+
}
|
|
54
|
+
componentDidCatch(error, errorInfo) {
|
|
55
|
+
reportReactError(error, errorInfo);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
if (this.state.hasError) {
|
|
59
|
+
return React.createElement(ErrorFallbackUI, { error: this.state.error });
|
|
60
|
+
}
|
|
61
|
+
return this.props.children;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -38,14 +38,6 @@ export declare class TransformerRegistry implements ITransformerRegistry {
|
|
|
38
38
|
* @returns Array of registered file patterns
|
|
39
39
|
*/
|
|
40
40
|
getRegisteredPatterns(): string[];
|
|
41
|
-
/**
|
|
42
|
-
* Check if a file path matches a pattern
|
|
43
|
-
*
|
|
44
|
-
* @param filePath - The file path to check
|
|
45
|
-
* @param pattern - The pattern to match (e.g., '*.flexipage-meta.xml', '.flow-meta.xml')
|
|
46
|
-
* @returns True if the file path matches the pattern
|
|
47
|
-
*/
|
|
48
|
-
private matchesPattern;
|
|
49
41
|
}
|
|
50
42
|
/**
|
|
51
43
|
* Global transformer registry instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransformerRegistry.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/transformer/TransformerRegistry.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"TransformerRegistry.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/transformer/TransformerRegistry.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGvE;;GAEG;AACH,qBAAa,mBAAoB,YAAW,oBAAoB;IAC9D,OAAO,CAAC,YAAY,CAAwC;IAE5D;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI;IAI9D;;;;;;OAMG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAS1D;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIzC;;;;OAIG;IACH,qBAAqB,IAAI,MAAM,EAAE;CAGlC;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,qBAA4B,CAAC"}
|
|
@@ -4,6 +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 { matchesFilePattern } from '../../utils/patternMatcher.js';
|
|
7
8
|
/**
|
|
8
9
|
* Implementation of the transformer registry
|
|
9
10
|
*/
|
|
@@ -29,7 +30,7 @@ export class TransformerRegistry {
|
|
|
29
30
|
*/
|
|
30
31
|
getTransformer(filePath) {
|
|
31
32
|
for (const [pattern, transformer] of this.transformers.entries()) {
|
|
32
|
-
if (
|
|
33
|
+
if (matchesFilePattern(filePath, pattern)) {
|
|
33
34
|
return transformer;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -52,21 +53,6 @@ export class TransformerRegistry {
|
|
|
52
53
|
getRegisteredPatterns() {
|
|
53
54
|
return Array.from(this.transformers.keys());
|
|
54
55
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Check if a file path matches a pattern
|
|
57
|
-
*
|
|
58
|
-
* @param filePath - The file path to check
|
|
59
|
-
* @param pattern - The pattern to match (e.g., '*.flexipage-meta.xml', '.flow-meta.xml')
|
|
60
|
-
* @returns True if the file path matches the pattern
|
|
61
|
-
*/
|
|
62
|
-
matchesPattern(filePath, pattern) {
|
|
63
|
-
// Handle wildcard patterns (e.g., *.flexipage-meta.xml)
|
|
64
|
-
if (pattern.startsWith('*')) {
|
|
65
|
-
return filePath.endsWith(pattern.slice(1));
|
|
66
|
-
}
|
|
67
|
-
// Handle exact match or suffix match (e.g., .flexipage-meta.xml)
|
|
68
|
-
return filePath === pattern || filePath.endsWith(pattern);
|
|
69
|
-
}
|
|
70
56
|
}
|
|
71
57
|
/**
|
|
72
58
|
* Global transformer registry instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UemBasedVisualizer.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/transformer/UemBasedVisualizer.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UemBasedVisualizer.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/transformer/UemBasedVisualizer.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAEjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD;;;;;;;GAOG;AACH,8BAAsB,kBAAmB,YAAW,oBAAoB,CAAC,WAAW,CAAC;IACnF,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;IACtD,kBAAyB,MAAM,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;IAE9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,qBAAqB,CAAS;gBAE1B,QAAQ,EAAE,kBAAkB;IAIxC;;;OAGG;IACH,qBAAqB,IAAI,kBAAkB;IAI3C;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMpC;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB1D;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI;CAGjB"}
|
|
@@ -5,6 +5,7 @@
|
|
|
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 { transformerRegistry } from './TransformerRegistry.js';
|
|
8
|
+
import { matchesFilePattern } from '../../utils/patternMatcher.js';
|
|
8
9
|
/**
|
|
9
10
|
* Base class for visualizers that use transformers to convert metadata to UEM format
|
|
10
11
|
*
|
|
@@ -29,12 +30,7 @@ export class UemBasedVisualizer {
|
|
|
29
30
|
* Check if this visualizer can handle the given file path
|
|
30
31
|
*/
|
|
31
32
|
canHandle(filePath) {
|
|
32
|
-
return this.pluginMetadata.filePatterns.some((pattern) =>
|
|
33
|
-
if (pattern.startsWith('*')) {
|
|
34
|
-
return filePath.endsWith(pattern.slice(1));
|
|
35
|
-
}
|
|
36
|
-
return filePath === pattern || filePath.endsWith(pattern);
|
|
37
|
-
});
|
|
33
|
+
return this.pluginMetadata.filePatterns.some((pattern) => matchesFilePattern(filePath, pattern));
|
|
38
34
|
}
|
|
39
35
|
/**
|
|
40
36
|
* Initialize the visualizer with platform context
|
|
@@ -51,7 +47,7 @@ export class UemBasedVisualizer {
|
|
|
51
47
|
this.logger = context.logger.createChild(this.getMetadataPluginInfo().id);
|
|
52
48
|
this.logger.info(`${this.getMetadataPluginInfo().name} initialized with UEM transformer`);
|
|
53
49
|
// Pass context to parser
|
|
54
|
-
this.parser.setPlatformContext(context);
|
|
50
|
+
this.parser.setPlatformContext?.(context);
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
57
53
|
* Dispose of the visualizer
|
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @author UEM Team
|
|
11
11
|
*/
|
|
12
|
+
/** Visibility rule criteria for conditional rendering */
|
|
13
|
+
export interface UemVisibilityRuleCriteria {
|
|
14
|
+
leftValue: string;
|
|
15
|
+
operator: string;
|
|
16
|
+
rightValue: string;
|
|
17
|
+
}
|
|
18
|
+
/** Visibility rule for conditional rendering of components */
|
|
19
|
+
export interface UemVisibilityRule {
|
|
20
|
+
booleanFilter?: string;
|
|
21
|
+
criteria: UemVisibilityRuleCriteria[];
|
|
22
|
+
}
|
|
12
23
|
export interface UemMetadata {
|
|
13
24
|
filePath: string;
|
|
14
25
|
name?: string;
|
|
@@ -37,7 +48,7 @@ export interface Block {
|
|
|
37
48
|
attributes?: Record<string, unknown>;
|
|
38
49
|
children?: (Block | Region | Field)[];
|
|
39
50
|
/** Optional: Visibility rule for conditional rendering */
|
|
40
|
-
visibilityRule?:
|
|
51
|
+
visibilityRule?: UemVisibilityRule;
|
|
41
52
|
}
|
|
42
53
|
export interface Region {
|
|
43
54
|
type: 'region';
|
|
@@ -54,7 +65,7 @@ export interface Field {
|
|
|
54
65
|
attributes?: Record<string, unknown>;
|
|
55
66
|
children?: (Block | Region | Field)[];
|
|
56
67
|
/** Optional: Visibility rule for conditional rendering */
|
|
57
|
-
visibilityRule?:
|
|
68
|
+
visibilityRule?: UemVisibilityRule;
|
|
58
69
|
}
|
|
59
70
|
export interface DataProvider {
|
|
60
71
|
definition: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UemMetadata.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/types/UemMetadata.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IAEnB,+BAA+B;IAC/B,IAAI,EAAE,OAAO,CAAC;IAEd,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,+BAA+B;IAC/B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAE/B,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;IACtC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"UemMetadata.d.ts","sourceRoot":"","sources":["../../../../src/shared/uem/types/UemMetadata.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import './PropertyRenderer.css';
|
|
9
|
+
interface PropertyRendererProps {
|
|
10
|
+
name: string;
|
|
11
|
+
value: unknown;
|
|
12
|
+
depth?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const PropertyRenderer: React.FC<PropertyRendererProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=PropertyRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyRenderer.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,wBAAwB,CAAC;AAEhC,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6I5D,CAAC"}
|