@salesforce/platform-sdk 11.1.3 → 11.3.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.
@@ -1,4 +1,4 @@
1
- import { A as s, I as A, P as E, c as t, v as I } from "../analytics-ygoSv0Cj.js";
1
+ import { A as s, I as A, P as E, c as t, v as I } from "../analytics-CY_NdbkB.js";
2
2
  export {
3
3
  s as AXL_PFT_ID,
4
4
  A as INTERNAL_SESSION_META_KEY,
@@ -1,5 +1,5 @@
1
1
  import { registerInstrumentedApp as P } from "o11y/client";
2
- import { g as h, S as T } from "./surface-CEErnCgI.js";
2
+ import { g as h, S as T } from "./surface-Dd2tqrPi.js";
3
3
  import { w as x } from "./sdk-promise-D0sy7OW1.js";
4
4
  import { getChatSDK as v } from "./chat/index.js";
5
5
  import { r as _ } from "./TelemetryUploader-DKkdppe9.js";
@@ -1,4 +1,4 @@
1
- import { S as e } from "./surface-CEErnCgI.js";
1
+ import { S as e } from "./surface-Dd2tqrPi.js";
2
2
  const s = {
3
3
  callTool: !0,
4
4
  sendMessageToHost: !0,
@@ -1,4 +1,4 @@
1
- import { g as c, S as n, a as d } from "../surface-CEErnCgI.js";
1
+ import { g as c, S as n, a as d } from "../surface-Dd2tqrPi.js";
2
2
  import { w as p } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as h } from "../sf-embedding/index.js";
4
4
  class a {
@@ -1,5 +1,5 @@
1
- import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-CEErnCgI.js";
2
- import { g as c } from "../capabilities-CBmOyHnc.js";
1
+ import { M as r, a as s, S as i, g as p, i as f, b as o, r as t } from "../surface-Dd2tqrPi.js";
2
+ import { g as c } from "../capabilities-5BWkCbcP.js";
3
3
  import { w as g } from "../sdk-promise-D0sy7OW1.js";
4
4
  export {
5
5
  r as McpAppsNotAvailableError,
@@ -190,23 +190,28 @@ export interface ViewSDK {
190
190
  * display a visual indicator (e.g., asterisk in title) and prompt the user before
191
191
  * navigating away or closing the application.
192
192
  *
193
+ * @param label - Optional dirty-source id; lets hosts disambiguate multiple concurrent dirty regions.
193
194
  * @returns Promise that resolves when the dirty state is marked
194
195
  *
195
196
  * @example
196
197
  * ```typescript
197
198
  * // User made changes to a form
198
- * formInput.addEventListener('input', async () => {
199
+ * formInput.addEventListener('input1', async () => {
199
200
  * await viewSDK.markDirtyState?.();
200
201
  * });
202
+ * formInput.addEventListener('input2', async () => {
203
+ * await viewSDK.markDirtyState?.('PrimaryForm');
204
+ * });
201
205
  * ```
202
206
  */
203
- markDirtyState?(): Promise<void>;
207
+ markDirtyState?(label?: string): Promise<void>;
204
208
  /**
205
209
  * Clear the application's "dirty" state (no unsaved changes)
206
210
  *
207
211
  * This notifies the host that all changes have been saved. Should be called
208
212
  * after successfully persisting data to remove unsaved change indicators.
209
213
  *
214
+ * @param label - Optional identifier matching the prior `markDirtyState`.
210
215
  * @returns Promise that resolves when the dirty state is cleared
211
216
  *
212
217
  * @example
@@ -215,10 +220,11 @@ export interface ViewSDK {
215
220
  * async function saveForm(data) {
216
221
  * await api.save(data);
217
222
  * await viewSDK.clearDirtyState?.();
223
+ * await viewSDK.clearDirtyState?.('PrimaryForm');
218
224
  * }
219
225
  * ```
220
226
  */
221
- clearDirtyState?(): Promise<void>;
227
+ clearDirtyState?(label?: string): Promise<void>;
222
228
  /**
223
229
  * Dispatch a custom event to the host environment
224
230
  *
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,SAAS,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpE;;;;;GA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IAAI,KAAK,IAAI,CAAC;KACxE,CAAC;IAEF;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC;CAC1B"}
@@ -1,4 +1,4 @@
1
- import { g as L, S as m } from "../surface-CEErnCgI.js";
1
+ import { g as L, S as m } from "../surface-Dd2tqrPi.js";
2
2
  import { w as V } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { buildServiceDescriptor as _, setHeader as y } from "@conduit-client/service-fetch-network/v1";
4
4
  import { resolvedPromiseLike as u, ok as w, err as C, stableJSONStringify as x, DataNotFoundError as Q, UserVisibleError as H, deepFreeze as b, isUserVisibleError as G } from "@conduit-client/utils";
@@ -196,7 +196,7 @@ class ie {
196
196
  })).structuredContent;
197
197
  }
198
198
  }
199
- const ce = "X-SFDC-Client-Name", ue = "X-SFDC-Client-Version", he = "@salesforce/platform-sdk", le = "11.1.3", de = (t) => {
199
+ const ce = "X-SFDC-Client-Name", ue = "X-SFDC-Client-Version", he = "@salesforce/platform-sdk", le = "11.3.0", de = (t) => {
200
200
  let e = y(ce, he, t);
201
201
  return e = y(ue, le, e), u(e);
202
202
  }, pe = "X-CSRF-Token";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { M as a, a as t, S as s, g as o, i, b as p, r as S } from "./surface-CEErnCgI.js";
2
- import { g as c } from "./capabilities-CBmOyHnc.js";
1
+ import { M as a, a as t, S as s, g as o, i, b as p, r as S } from "./surface-Dd2tqrPi.js";
2
+ import { g as c } from "./capabilities-5BWkCbcP.js";
3
3
  import { w as D } from "./sdk-promise-D0sy7OW1.js";
4
4
  import { MCPAppsChatSDK as g, createChatSDK as l, getChatSDK as A, getChatSDKSync as x, resetChatSDK as T } from "./chat/index.js";
5
5
  import { MCPAppsViewSDK as C, createViewSDK as E, getViewSDK as d, getViewSDKSync as w, resetViewSDK as M } from "./view/index.js";
@@ -7,7 +7,7 @@ import { createDataSDK as _, gql as h } from "./data/index.js";
7
7
  import { createLightningSDK as I } from "./lightning/index.js";
8
8
  import { c as b } from "./transport-CdXFRgRc.js";
9
9
  import { T as N, r as v } from "./TelemetryUploader-DKkdppe9.js";
10
- import { A as F, I as U, P as Y, c as q, v as z } from "./analytics-ygoSv0Cj.js";
10
+ import { A as F, I as U, P as Y, c as q, v as z } from "./analytics-CY_NdbkB.js";
11
11
  export {
12
12
  F as AXL_PFT_ID,
13
13
  U as INTERNAL_SESSION_META_KEY,
@@ -1,4 +1,4 @@
1
- import { g as a, S as r } from "../surface-CEErnCgI.js";
1
+ import { g as a, S as r } from "../surface-Dd2tqrPi.js";
2
2
  import { w as n } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as c } from "../sf-embedding/index.js";
4
4
  class t {
@@ -1,4 +1,4 @@
1
- import { SessionHandle } from '@sf-embedding/sf-embedding-bridge';
1
+ import { SessionHandle } from '@salesforce/sf-embedding-bridge';
2
2
  /** Thrown when a host-mediated SDK is requested but no session is available. */
3
3
  export declare class SfEmbeddingNotAvailableError extends Error {
4
4
  constructor(factoryName: string, cause?: Error);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sf-embedding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,mCAAmC,CAAC;AA+BzF,gFAAgF;AAChF,qBAAa,4BAA6B,SAAQ,KAAK;gBAC1C,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAc9C;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoBhF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sf-embedding/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AA+BvF,gFAAgF;AAChF,qBAAa,4BAA6B,SAAQ,KAAK;gBAC1C,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAc9C;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoBhF"}
@@ -1,5 +1,5 @@
1
- import { bootstrapSession as t } from "@sf-embedding/sf-embedding-bridge";
2
- import { b as i } from "../surface-CEErnCgI.js";
1
+ import { bootstrapSession as t } from "@salesforce/sf-embedding-bridge";
2
+ import { b as i } from "../surface-Dd2tqrPi.js";
3
3
  let r;
4
4
  if (i()) {
5
5
  const s = t();
@@ -1,4 +1,4 @@
1
- import { readHostMetaData as p } from "@sf-embedding/sf-embedding-bridge";
1
+ import { readHostMetaData as p } from "@salesforce/sf-embedding-bridge";
2
2
  import { JsonRpcClient as d, WindowPostMessageTransport as f } from "@salesforce/jsonrpc";
3
3
  class h extends Error {
4
4
  constructor() {
@@ -1,7 +1,15 @@
1
1
  import { ViewSDK } from '../core';
2
+ /** Pixel-only dimension string: bare number or `Npx`. The empty string is allowed so a caller can omit one axis. */
3
+ export type PixelSize = `${number}` | `${number}px` | "";
4
+ /** ViewSDK for the sf-embedding surface; wraps bridge wire-layer primitives. */
2
5
  export declare class EmbeddingViewSDK implements ViewSDK {
3
6
  private readonly session;
4
7
  static create(): Promise<EmbeddingViewSDK>;
5
8
  private constructor();
9
+ markDirtyState(label?: string): Promise<void>;
10
+ clearDirtyState(label?: string): Promise<void>;
11
+ /** Resize the embedded surface. Pass `""` for either axis to leave it unchanged; both empty is a no-op. */
12
+ resize(width: PixelSize, height: PixelSize): Promise<void>;
13
+ private setDirty;
6
14
  }
7
15
  //# sourceMappingURL=embedding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMvC,qBAAa,gBAAiB,YAAW,OAAO;IAO3B,OAAO,CAAC,QAAQ,CAAC,OAAO;WAN/B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAMhD,OAAO;CACP"}
1
+ {"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../../src/view/embedding.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMvC,oHAAoH;AACpH,MAAM,MAAM,SAAS,GAAG,GAAG,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;AAEzD,gFAAgF;AAChF,qBAAa,gBAAiB,YAAW,OAAO;IAM3B,OAAO,CAAC,QAAQ,CAAC,OAAO;WAL/B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKhD,OAAO;IAED,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,2GAA2G;IACrG,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAYhE,OAAO,CAAC,QAAQ;CAOhB"}
@@ -1,18 +1,8 @@
1
- import { g as d, S as a, a as p } from "../surface-CEErnCgI.js";
2
- import { w } from "../sdk-promise-D0sy7OW1.js";
1
+ import { g as w, S as a, a as h } from "../surface-Dd2tqrPi.js";
2
+ import { w as m } from "../sdk-promise-D0sy7OW1.js";
3
3
  import { requireSharedSession as f } from "../sf-embedding/index.js";
4
- class u {
5
- // @ts-expect-error TS6138: `session` is unread until the first method body lands
6
- constructor(e) {
7
- this.session = e;
8
- }
9
- static async create() {
10
- const e = await f("EmbeddingViewSDK");
11
- return new u(e);
12
- }
13
- }
14
- function h(t) {
15
- switch (t) {
4
+ function p(n) {
5
+ switch (n) {
16
6
  case "info":
17
7
  return "ℹ️";
18
8
  case "success":
@@ -25,26 +15,60 @@ function h(t) {
25
15
  return "ℹ️";
26
16
  }
27
17
  }
28
- function c(t, e) {
29
- return `${h(e)} ${t}`;
18
+ function u(n, e) {
19
+ return `${p(e)} ${n}`;
30
20
  }
31
- function m(t, e) {
32
- const r = t.trim();
33
- if (r === "")
21
+ function o(n, e) {
22
+ const t = n.trim();
23
+ if (t === "")
34
24
  return { success: !0, value: void 0 };
35
- const s = r.match(/^(\d+(?:\.\d+)?)(px)?$/);
25
+ const s = t.match(/^(\d+(?:\.\d+)?)(px)?$/);
36
26
  if (!s || !s[1])
37
27
  return {
38
28
  success: !1,
39
- error: `Invalid ${e}: "${t}". Only pixel values are supported (e.g., "800px" or "800").`
29
+ error: `Invalid ${e}: "${n}". Only pixel values are supported (e.g., "800px" or "800").`
40
30
  };
41
- const n = parseFloat(s[1]);
42
- return n < 0 || !isFinite(n) ? {
31
+ const r = parseFloat(s[1]);
32
+ return r < 0 || !isFinite(r) ? {
43
33
  success: !1,
44
- error: `Invalid ${e}: "${t}". Value must be a positive number.`
45
- } : { success: !0, value: n };
34
+ error: `Invalid ${e}: "${n}". Value must be a positive number.`
35
+ } : { success: !0, value: r };
36
+ }
37
+ const g = "trackdirtystate";
38
+ class l {
39
+ constructor(e) {
40
+ this.session = e;
41
+ }
42
+ static async create() {
43
+ const e = await f("EmbeddingViewSDK");
44
+ return new l(e);
45
+ }
46
+ async markDirtyState(e) {
47
+ this.setDirty(!0, e);
48
+ }
49
+ async clearDirtyState(e) {
50
+ this.setDirty(!1, e);
51
+ }
52
+ /** Resize the embedded surface. Pass `""` for either axis to leave it unchanged; both empty is a no-op. */
53
+ async resize(e, t) {
54
+ const s = o(e, "width");
55
+ if (!s.success) throw new Error(s.error);
56
+ const r = o(t, "height");
57
+ if (!r.success) throw new Error(r.error);
58
+ s.value === void 0 && r.value === void 0 || this.session.bridge.sendResize({
59
+ ...s.value !== void 0 ? { width: s.value } : {},
60
+ ...r.value !== void 0 ? { height: r.value } : {}
61
+ });
62
+ }
63
+ setDirty(e, t) {
64
+ this.session.bridge.sendEventDispatch(g, {
65
+ isDirty: e,
66
+ instanceId: this.session.hostMetaData.instanceId,
67
+ label: t ?? ""
68
+ });
69
+ }
46
70
  }
47
- class g {
71
+ class v {
48
72
  constructor(e) {
49
73
  this.session = e;
50
74
  }
@@ -53,8 +77,8 @@ class g {
53
77
  * @param message - The message text
54
78
  * @param level - The message severity level (defaults to "info")
55
79
  */
56
- async sendMessage(e, r = "info") {
57
- const s = c(e, r);
80
+ async sendMessage(e, t = "info") {
81
+ const s = u(e, t);
58
82
  await this.session.request("ui/message", {
59
83
  role: "user",
60
84
  content: [
@@ -78,24 +102,24 @@ class g {
78
102
  const e = this.session.getHostContext().theme;
79
103
  return e ? { mode: e } : null;
80
104
  }
81
- async resize(e, r) {
82
- const s = m(e, "width");
105
+ async resize(e, t) {
106
+ const s = o(e, "width");
83
107
  if (!s.success)
84
108
  return Promise.reject(new Error(s.error));
85
- const n = m(r, "height");
86
- if (!n.success)
87
- return Promise.reject(new Error(n.error));
88
- const o = {};
89
- return s.value !== void 0 && (o.width = s.value), n.value !== void 0 && (o.height = n.value), this.session.sendNotification("ui/notifications/size-changed", o), Promise.resolve();
109
+ const r = o(t, "height");
110
+ if (!r.success)
111
+ return Promise.reject(new Error(r.error));
112
+ const c = {};
113
+ return s.value !== void 0 && (c.width = s.value), r.value !== void 0 && (c.height = r.value), this.session.sendNotification("ui/notifications/size-changed", c), Promise.resolve();
90
114
  }
91
115
  }
92
- class v {
116
+ class y {
93
117
  async displayAlert(e) {
94
- const r = e.level || "info", s = c(e.message, r);
118
+ const t = e.level || "info", s = u(e.message, t);
95
119
  await window.openai.sendFollowUpMessage({ prompt: s });
96
120
  }
97
121
  async displayToast(e) {
98
- const r = e.level || "info", s = c(e.message, r);
122
+ const t = e.level || "info", s = u(e.message, t);
99
123
  await window.openai.sendFollowUpMessage({ prompt: s });
100
124
  }
101
125
  async displayModal(e) {
@@ -109,31 +133,31 @@ class v {
109
133
  return e ? { mode: e } : null;
110
134
  }
111
135
  }
112
- let i = null, l = null;
113
- function D(t) {
114
- return i || (i = y(t).then((e) => (l = e, e))), i;
136
+ let i = null, d = null;
137
+ function A(n) {
138
+ return i || (i = S(n).then((e) => (d = e, e))), i;
115
139
  }
116
- function K() {
117
- return l;
140
+ function E() {
141
+ return d;
118
142
  }
119
- function A() {
120
- i = null, l = null;
143
+ function I() {
144
+ i = null, d = null;
121
145
  }
122
- function y(t) {
123
- return w(
146
+ function S(n) {
147
+ return m(
124
148
  (async () => {
125
149
  try {
126
- switch (await d(t?.surface)) {
150
+ switch (await w(n?.surface)) {
127
151
  case a.OpenAI:
128
- return new v();
152
+ return new y();
129
153
  case a.WebApp:
130
154
  case a.Mosaic:
131
155
  return {};
132
156
  case a.MicroFrontend:
133
- return await u.create();
157
+ return await l.create();
134
158
  case a.MCPApps: {
135
- const r = await p.getInstance();
136
- return new g(r);
159
+ const t = await h.getInstance();
160
+ return new v(t);
137
161
  }
138
162
  default:
139
163
  return {};
@@ -146,9 +170,9 @@ function y(t) {
146
170
  );
147
171
  }
148
172
  export {
149
- g as MCPAppsViewSDK,
150
- y as createViewSDK,
151
- D as getViewSDK,
152
- K as getViewSDKSync,
153
- A as resetViewSDK
173
+ v as MCPAppsViewSDK,
174
+ S as createViewSDK,
175
+ A as getViewSDK,
176
+ E as getViewSDKSync,
177
+ I as resetViewSDK
154
178
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/platform-sdk",
3
- "version": "11.1.3",
3
+ "version": "11.3.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -107,8 +107,8 @@
107
107
  "@conduit-client/service-pubsub": "3.19.6",
108
108
  "@conduit-client/service-retry": "3.19.6",
109
109
  "@conduit-client/utils": "3.19.6",
110
- "@salesforce/jsonrpc": "^11.1.3",
111
- "@sf-embedding/sf-embedding-bridge": "2.2.1-rc.4"
110
+ "@salesforce/jsonrpc": "^11.3.0",
111
+ "@salesforce/sf-embedding-bridge": "2.2.4-rc.1"
112
112
  },
113
113
  "peerDependencies": {
114
114
  "o11y": ">=260.0.0",