@salesforce/ui-bundle 1.117.2
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/LICENSE.txt +82 -0
- package/README.md +3 -0
- package/dist/api/clients.d.ts +22 -0
- package/dist/api/clients.d.ts.map +1 -0
- package/dist/api/clients.js +84 -0
- package/dist/api/graphql-operations-types.d.ts +225 -0
- package/dist/api/graphql-operations-types.d.ts.map +1 -0
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +13 -0
- package/dist/api/utils/accounts.d.ts +33 -0
- package/dist/api/utils/accounts.d.ts.map +1 -0
- package/dist/api/utils/accounts.js +47 -0
- package/dist/api/utils/records.d.ts +16 -0
- package/dist/api/utils/records.d.ts.map +1 -0
- package/dist/api/utils/records.js +26 -0
- package/dist/api/utils/user.d.ts +17 -0
- package/dist/api/utils/user.d.ts.map +1 -0
- package/dist/api/utils/user.js +25 -0
- package/dist/app/index.d.ts +10 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +7 -0
- package/dist/app/manifest.d.ts +34 -0
- package/dist/app/manifest.d.ts.map +1 -0
- package/dist/app/manifest.js +28 -0
- package/dist/app/org.d.ts +28 -0
- package/dist/app/org.d.ts.map +1 -0
- package/dist/app/org.js +67 -0
- package/dist/design/design-mode-interactions.js +761 -0
- package/dist/design/index.d.ts +12 -0
- package/dist/design/index.d.ts.map +1 -0
- package/dist/design/index.js +14 -0
- package/dist/design/interactions/communicationManager.d.ts +25 -0
- package/dist/design/interactions/communicationManager.d.ts.map +1 -0
- package/dist/design/interactions/componentMatcher.d.ts +43 -0
- package/dist/design/interactions/componentMatcher.d.ts.map +1 -0
- package/dist/design/interactions/editableManager.d.ts +25 -0
- package/dist/design/interactions/editableManager.d.ts.map +1 -0
- package/dist/design/interactions/eventHandlers.d.ts +40 -0
- package/dist/design/interactions/eventHandlers.d.ts.map +1 -0
- package/dist/design/interactions/index.d.ts +7 -0
- package/dist/design/interactions/index.d.ts.map +1 -0
- package/dist/design/interactions/interactionsController.d.ts +36 -0
- package/dist/design/interactions/interactionsController.d.ts.map +1 -0
- package/dist/design/interactions/styleManager.d.ts +49 -0
- package/dist/design/interactions/styleManager.d.ts.map +1 -0
- package/dist/design/interactions/utils/cssUtils.d.ts +54 -0
- package/dist/design/interactions/utils/cssUtils.d.ts.map +1 -0
- package/dist/design/interactions/utils/sourceUtils.d.ts +36 -0
- package/dist/design/interactions/utils/sourceUtils.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/package.json.js +4 -0
- package/dist/proxy/handler.d.ts +38 -0
- package/dist/proxy/handler.d.ts.map +1 -0
- package/dist/proxy/handler.js +530 -0
- package/dist/proxy/index.d.ts +8 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/index.js +7 -0
- package/dist/proxy/livePreviewScript.d.ts +21 -0
- package/dist/proxy/livePreviewScript.d.ts.map +1 -0
- package/dist/proxy/livePreviewScript.js +16 -0
- package/dist/proxy/routing.d.ts +35 -0
- package/dist/proxy/routing.d.ts.map +1 -0
- package/dist/proxy/routing.js +83 -0
- package/dist/proxy/templates/livePreviewScript.js +553 -0
- package/package.json +65 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
export interface UIBundleManifest {
|
|
7
|
+
name?: string;
|
|
8
|
+
outputDir: string;
|
|
9
|
+
routing?: RoutingConfig;
|
|
10
|
+
}
|
|
11
|
+
export interface RoutingConfig {
|
|
12
|
+
rewrites?: RewriteRule[];
|
|
13
|
+
redirects?: RedirectRule[];
|
|
14
|
+
trailingSlash?: "always" | "never" | "auto";
|
|
15
|
+
fallback?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RewriteRule {
|
|
18
|
+
route: string;
|
|
19
|
+
target: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RedirectRule {
|
|
22
|
+
route: string;
|
|
23
|
+
target: string;
|
|
24
|
+
statusCode: 301 | 302 | 307 | 308;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Load and parse UI Bundle manifest (ui-bundle.json)
|
|
28
|
+
*
|
|
29
|
+
* @param manifestPath - Path to the ui-bundle.json file
|
|
30
|
+
* @returns Promise resolving to the parsed manifest
|
|
31
|
+
* @throws Error if manifest file not found or validation fails
|
|
32
|
+
*/
|
|
33
|
+
export declare function loadManifest(manifestPath: string): Promise<UIBundleManifest>;
|
|
34
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/app/manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,gBAAgB;IAEhC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,CAAC,EAAE,aAAa,CAAC;CACxB;AAGD,MAAM,WAAW,aAAa;IAE7B,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAE3B,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAE5C,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,WAAW;IAE3B,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,YAAY;IAE5B,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,MAAM,CAAC;IAEf,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;CAClC;AAsBD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAclF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
function validateManifest(manifest) {
|
|
3
|
+
const errors = [];
|
|
4
|
+
if (!manifest.outputDir) {
|
|
5
|
+
errors.push("outputDir");
|
|
6
|
+
}
|
|
7
|
+
if (errors.length > 0) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`Manifest missing required field${errors.length > 1 ? "s" : ""}: ${errors.join(", ")}`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function loadManifest(manifestPath) {
|
|
14
|
+
try {
|
|
15
|
+
const content = await readFile(manifestPath, "utf-8");
|
|
16
|
+
const manifest = JSON.parse(content);
|
|
17
|
+
validateManifest(manifest);
|
|
18
|
+
return manifest;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
21
|
+
throw new Error(`Manifest not found at: ${manifestPath}`);
|
|
22
|
+
}
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
loadManifest
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
export interface OrgInfo {
|
|
7
|
+
orgId: string;
|
|
8
|
+
apiVersion: string;
|
|
9
|
+
instanceUrl: string;
|
|
10
|
+
rawInstanceUrl: string;
|
|
11
|
+
username: string;
|
|
12
|
+
accessToken: string;
|
|
13
|
+
orgAlias?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get Salesforce org info and authentication details
|
|
17
|
+
*
|
|
18
|
+
* @param orgAlias - Optional org alias or username, uses default org if not provided
|
|
19
|
+
* @returns Promise resolving to org info or null if authentication fails
|
|
20
|
+
*/
|
|
21
|
+
export declare function getOrgInfo(orgAlias?: string): Promise<OrgInfo | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Refresh Salesforce org authentication
|
|
24
|
+
*
|
|
25
|
+
* @param orgAlias
|
|
26
|
+
*/
|
|
27
|
+
export declare function refreshOrgAuth(orgAlias: string): Promise<OrgInfo | undefined>;
|
|
28
|
+
//# sourceMappingURL=org.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/app/org.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAmBhF;AAuBD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAQnF"}
|
package/dist/app/org.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Org } from "@salesforce/core";
|
|
2
|
+
async function getOrgInfo(orgAlias) {
|
|
3
|
+
const org = await createOrg(orgAlias);
|
|
4
|
+
if (!org) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const connection = org.getConnection();
|
|
8
|
+
const authInfo = connection.getAuthInfo();
|
|
9
|
+
const authFields = authInfo.getFields();
|
|
10
|
+
return {
|
|
11
|
+
apiVersion: connection.getApiVersion(),
|
|
12
|
+
orgId: authFields.orgId ?? "",
|
|
13
|
+
instanceUrl: toLightningDomain(connection.instanceUrl),
|
|
14
|
+
rawInstanceUrl: connection.instanceUrl,
|
|
15
|
+
username: authFields.username ?? "",
|
|
16
|
+
accessToken: connection.accessToken ?? "",
|
|
17
|
+
orgAlias
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function createOrg(orgAlias) {
|
|
21
|
+
try {
|
|
22
|
+
if (!orgAlias) {
|
|
23
|
+
return await Org.create({});
|
|
24
|
+
}
|
|
25
|
+
return await Org.create({ aliasOrUsername: orgAlias });
|
|
26
|
+
} catch (error) {
|
|
27
|
+
const target = orgAlias ? `org "${orgAlias}"` : "default org";
|
|
28
|
+
if (error instanceof Error && error.name === "NoUsernameFoundError") {
|
|
29
|
+
console.warn(
|
|
30
|
+
`No ${target} found. Run "sf org login" to authenticate an org, or "sf config set target-org=<username>" to set a default.`
|
|
31
|
+
);
|
|
32
|
+
} else {
|
|
33
|
+
console.warn(
|
|
34
|
+
`Failed to connect to ${target}: ${error instanceof Error ? error.message : error}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function refreshOrgAuth(orgAlias) {
|
|
40
|
+
const org = await createOrg(orgAlias);
|
|
41
|
+
if (!org) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
await org.refreshAuth();
|
|
45
|
+
return getOrgInfo(orgAlias);
|
|
46
|
+
}
|
|
47
|
+
function replaceLast(originalString, searchString, replacementString) {
|
|
48
|
+
const lastIndex = originalString.lastIndexOf(searchString);
|
|
49
|
+
if (lastIndex === -1) {
|
|
50
|
+
return originalString;
|
|
51
|
+
}
|
|
52
|
+
const before = originalString.slice(0, lastIndex);
|
|
53
|
+
const after = originalString.slice(lastIndex + searchString.length);
|
|
54
|
+
return before + replacementString + after;
|
|
55
|
+
}
|
|
56
|
+
function toLightningDomain(instanceUrl) {
|
|
57
|
+
if (!instanceUrl.includes(".my.")) {
|
|
58
|
+
return instanceUrl;
|
|
59
|
+
}
|
|
60
|
+
let url = replaceLast(instanceUrl, ".my.", ".lightning.");
|
|
61
|
+
url = replaceLast(url, ".salesforce", ".force");
|
|
62
|
+
return url;
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
getOrgInfo,
|
|
66
|
+
refreshOrgAuth
|
|
67
|
+
};
|