@salesforce/platform-sdk 12.8.0 → 12.9.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/analytics/analytics.d.ts +19 -15
- package/dist/analytics/analytics.d.ts.map +1 -1
- package/dist/analytics/error-listener.d.ts +3 -3
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +1 -1
- package/dist/analytics/method-configs.d.ts +8 -4
- package/dist/analytics/method-configs.d.ts.map +1 -1
- package/dist/analytics/pft.d.ts +22 -16
- package/dist/analytics/pft.d.ts.map +1 -1
- package/dist/analytics/proxy.d.ts +10 -8
- package/dist/analytics/proxy.d.ts.map +1 -1
- package/dist/analytics/types.d.ts +57 -43
- package/dist/analytics/types.d.ts.map +1 -1
- package/dist/{analytics-Dpz22kda.js → analytics-wESbWdca.js} +1 -1
- package/dist/app/index.d.ts +18 -13
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +5 -3
- package/dist/app/webapp.d.ts +5 -2
- package/dist/app/webapp.d.ts.map +1 -1
- package/dist/{capabilities-CKe8z6kZ.js → capabilities-B0mU0_G0.js} +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/core/app.d.ts +31 -22
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/capabilities.d.ts +26 -17
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/chat.d.ts +155 -125
- package/dist/core/chat.d.ts.map +1 -1
- package/dist/core/data.d.ts +146 -107
- package/dist/core/data.d.ts.map +1 -1
- package/dist/core/extension-attach.d.ts +65 -51
- package/dist/core/extension-attach.d.ts.map +1 -1
- package/dist/core/extension-types.d.ts +214 -153
- package/dist/core/extension-types.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -2
- package/dist/core/lightning.d.ts +11 -19
- package/dist/core/lightning.d.ts.map +1 -1
- package/dist/core/mcpapps-session.d.ts +63 -52
- package/dist/core/mcpapps-session.d.ts.map +1 -1
- package/dist/core/options.d.ts +6 -4
- package/dist/core/options.d.ts.map +1 -1
- package/dist/core/platforms.d.ts +29 -29
- package/dist/core/sdk-promise.d.ts +7 -4
- package/dist/core/sdk-promise.d.ts.map +1 -1
- package/dist/core/surface.d.ts +89 -67
- package/dist/core/surface.d.ts.map +1 -1
- package/dist/core/view.d.ts +164 -113
- package/dist/core/view.d.ts.map +1 -1
- package/dist/data/extensions/index.d.ts +5 -2
- package/dist/data/extensions/index.d.ts.map +1 -1
- package/dist/data/extensions/labels/index.d.ts +72 -49
- package/dist/data/extensions/labels/index.d.ts.map +1 -1
- package/dist/data/extensions/labels/query.d.ts +38 -29
- package/dist/data/extensions/labels/query.d.ts.map +1 -1
- package/dist/data/gql.d.ts +8 -4
- package/dist/data/gql.d.ts.map +1 -1
- package/dist/data/index.d.ts +67 -48
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +265 -242
- package/dist/data/mosaic/fetch.d.ts +24 -15
- package/dist/data/mosaic/fetch.d.ts.map +1 -1
- package/dist/data/mosaic/index.d.ts +13 -9
- package/dist/data/mosaic/index.d.ts.map +1 -1
- package/dist/data/openai/index.d.ts +11 -5
- package/dist/data/openai/index.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/command.d.ts +60 -46
- package/dist/data/shared/graphql/cache/command.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/invoker.d.ts.map +1 -1
- package/dist/data/shared/graphql/cache/services.d.ts +21 -11
- package/dist/data/shared/graphql/cache/services.d.ts.map +1 -1
- package/dist/data/shared/graphql/cached-graphql.d.ts +9 -4
- package/dist/data/shared/graphql/cached-graphql.d.ts.map +1 -1
- package/dist/data/shared/graphql/graphql-parse.d.ts +6 -3
- package/dist/data/shared/graphql/graphql-parse.d.ts.map +1 -1
- package/dist/data/shared/graphql/headers.d.ts +34 -27
- package/dist/data/shared/graphql/headers.d.ts.map +1 -1
- package/dist/data/shared/graphql/parse-response.d.ts +31 -23
- package/dist/data/shared/graphql/parse-response.d.ts.map +1 -1
- package/dist/data/shared/graphql/uncached-graphql.d.ts +10 -6
- package/dist/data/shared/graphql/uncached-graphql.d.ts.map +1 -1
- package/dist/data/shared/url-utils.d.ts +1 -1
- package/dist/data/shared/url-utils.d.ts.map +1 -1
- package/dist/data/webapp/accept-language.interceptor.d.ts +26 -9
- package/dist/data/webapp/accept-language.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/client-headers.interceptor.d.ts +4 -3
- package/dist/data/webapp/client-headers.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/csrf/header.interceptor.d.ts +4 -4
- package/dist/data/webapp/csrf/header.interceptor.d.ts.map +1 -1
- package/dist/data/webapp/csrf/retry.policy.d.ts +12 -11
- package/dist/data/webapp/csrf/retry.policy.d.ts.map +1 -1
- package/dist/data/webapp/csrf/token-manager.d.ts +18 -12
- package/dist/data/webapp/csrf/token-manager.d.ts.map +1 -1
- package/dist/data/webapp/fetch.d.ts +12 -8
- package/dist/data/webapp/fetch.d.ts.map +1 -1
- package/dist/data/webapp/index.d.ts +12 -7
- package/dist/data/webapp/index.d.ts.map +1 -1
- package/dist/i18n/locale-format.d.ts +23 -21
- package/dist/i18n/locale-format.d.ts.map +1 -1
- package/dist/i18n/salesforce-backend.d.ts +19 -11
- package/dist/i18n/salesforce-backend.d.ts.map +1 -1
- package/dist/i18n/salesforce-detector.d.ts +22 -14
- package/dist/i18n/salesforce-detector.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/lightning/embedding.d.ts.map +1 -1
- package/dist/lightning/index.d.ts +4 -4
- package/dist/lightning/index.d.ts.map +1 -1
- package/dist/lightning/index.js +2 -2
- package/dist/{surface-Dd2tqrPi.js → surface-DWDgqdpN.js} +18 -13
- package/dist/telemetry/tool-adapter.d.ts.map +1 -1
- package/dist/telemetry/uploader/TelemetryUploader.d.ts.map +1 -1
- package/dist/ui-embedding/index.d.ts.map +1 -1
- package/dist/ui-embedding/session.d.ts +7 -2
- package/dist/ui-embedding/session.d.ts.map +1 -1
- package/dist/ui-embedding/session.js +1 -1
- package/dist/view/index.js +1 -1
- package/package.json +2 -2
package/dist/core/view.d.ts
CHANGED
|
@@ -4,135 +4,163 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* CSS-adjacent styling the host publishes for the embedded
|
|
7
|
+
* The CSS-adjacent styling that the host publishes for the embedded
|
|
8
|
+
* surface.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* `variables` are CSS custom properties, `--*`, read from the host
|
|
12
|
+
* element's inline style. `attributes` are mirrored accessibility,
|
|
13
|
+
* internationalization, and input attributes from the host LWC.
|
|
11
14
|
*/
|
|
12
15
|
export interface UiStyles {
|
|
13
16
|
variables?: Record<string, string>;
|
|
14
17
|
attributes?: Record<string, string>;
|
|
15
18
|
}
|
|
16
19
|
/**
|
|
17
|
-
*
|
|
20
|
+
* The host-to-embedding rendering snapshot exposed to bundles through
|
|
21
|
+
* {@link ViewSDK.getUiState}.
|
|
18
22
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* `props` are host-configurable inputs, such as theme, locale, and
|
|
25
|
+
* mode. `styles` are the CSS custom properties and attributes that the
|
|
26
|
+
* host wants mirrored onto the surface.
|
|
21
27
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
28
|
+
* This interface is declared locally, not re-exported from
|
|
29
|
+
* `@salesforce/sf-embedding-bridge`, to keep the wire-layer package off
|
|
30
|
+
* the SDK's public type graph. Its shape mirrors the bridge's, so
|
|
31
|
+
* surface-side code assigns it without a cast.
|
|
25
32
|
*
|
|
26
|
-
* This is the open, fully
|
|
27
|
-
* declare a narrower type that
|
|
28
|
-
*
|
|
33
|
+
* This is the open, fully permissive shape. A bundle that knows its
|
|
34
|
+
* host contract can declare a narrower type that extends `UiState`,
|
|
35
|
+
* with tighter `props` and `styles`, and pass it to
|
|
36
|
+
* {@link ViewSDK.getUiState}'s single type parameter for precise
|
|
37
|
+
* typing.
|
|
29
38
|
*/
|
|
30
39
|
export interface UiState {
|
|
31
40
|
props: Record<string, unknown>;
|
|
32
41
|
styles: UiStyles;
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
|
-
*
|
|
44
|
+
* The theme mode.
|
|
36
45
|
*/
|
|
37
46
|
export type ThemeMode = "light" | "dark";
|
|
38
47
|
/**
|
|
39
|
-
*
|
|
48
|
+
* The theme.
|
|
40
49
|
*/
|
|
41
50
|
export interface Theme {
|
|
42
51
|
mode: ThemeMode;
|
|
43
52
|
}
|
|
44
53
|
/**
|
|
45
|
-
*
|
|
54
|
+
* The severity level of an alert or a toast.
|
|
46
55
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* - `
|
|
51
|
-
* - `
|
|
56
|
+
* @remarks
|
|
57
|
+
* This type determines the visual styling and importance of a
|
|
58
|
+
* notification.
|
|
59
|
+
* - `info` — an informational message, shown in blue or a neutral color.
|
|
60
|
+
* - `success` — a successful operation, shown in green.
|
|
61
|
+
* - `warning` — a warning that needs attention, shown in yellow or orange.
|
|
62
|
+
* - `error` — an error for a failed operation, shown in red.
|
|
52
63
|
*/
|
|
53
64
|
export type MessageLevel = "info" | "success" | "warning" | "error";
|
|
54
65
|
/**
|
|
55
|
-
*
|
|
66
|
+
* The configuration for displaying an alert.
|
|
56
67
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* An alert is a modal notification that typically requires user
|
|
70
|
+
* acknowledgment. It blocks interaction until the user dismisses it, so
|
|
71
|
+
* use it for important messages.
|
|
59
72
|
*/
|
|
60
73
|
export interface AlertOptions {
|
|
61
74
|
/**
|
|
62
|
-
* The message content to display in the alert
|
|
75
|
+
* The message content to display in the alert.
|
|
63
76
|
*/
|
|
64
77
|
message: string;
|
|
65
78
|
/**
|
|
66
|
-
* The severity level of the alert
|
|
79
|
+
* The severity level of the alert.
|
|
67
80
|
*
|
|
68
|
-
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* This value determines the visual styling and icon. It defaults to
|
|
83
|
+
* `info` when you omit it.
|
|
69
84
|
*/
|
|
70
85
|
level?: MessageLevel;
|
|
71
86
|
}
|
|
72
87
|
/**
|
|
73
|
-
*
|
|
88
|
+
* The configuration for displaying a toast notification.
|
|
74
89
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* A toast is a non-blocking, temporary notification that dismisses
|
|
92
|
+
* automatically after a short duration. Use it for status updates and
|
|
93
|
+
* confirmations.
|
|
77
94
|
*/
|
|
78
95
|
export interface ToastOptions {
|
|
79
96
|
/**
|
|
80
|
-
* The message content to display in the toast
|
|
97
|
+
* The message content to display in the toast.
|
|
81
98
|
*/
|
|
82
99
|
message: string;
|
|
83
100
|
/**
|
|
84
|
-
* The severity level of the toast
|
|
101
|
+
* The severity level of the toast.
|
|
85
102
|
*
|
|
86
|
-
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* This value determines the visual styling and icon. It defaults to
|
|
105
|
+
* `info` when you omit it.
|
|
87
106
|
*/
|
|
88
107
|
level?: MessageLevel;
|
|
89
108
|
}
|
|
90
109
|
/**
|
|
91
|
-
*
|
|
110
|
+
* The configuration for displaying a modal dialog.
|
|
92
111
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* A modal displays custom HTML content in an overlay dialog. The SDK
|
|
114
|
+
* loads the template from a UI resource, and the template can receive
|
|
115
|
+
* parameters.
|
|
95
116
|
*/
|
|
96
117
|
export interface ModalOptions {
|
|
97
118
|
/**
|
|
98
|
-
* URI of the HTML template to load in the modal
|
|
119
|
+
* The URI of the HTML template to load in the modal, in the form
|
|
120
|
+
* `ui://widget/[name].html`.
|
|
99
121
|
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
122
|
+
* @remarks
|
|
123
|
+
* Include the template file in your application's UI resources.
|
|
102
124
|
*
|
|
103
125
|
* @example "ui://widget/confirmation.html"
|
|
104
126
|
* @example "ui://widget/settings.html"
|
|
105
127
|
*/
|
|
106
128
|
componentReference: string;
|
|
107
129
|
/**
|
|
108
|
-
*
|
|
130
|
+
* The parameters to pass to the modal template.
|
|
109
131
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* The modal can access these parameters through the host's API. For
|
|
134
|
+
* example, on the OpenAI surface, through `window.openai.view.params`.
|
|
112
135
|
*
|
|
113
136
|
* @example { userId: "123", mode: "edit" }
|
|
114
137
|
*/
|
|
115
138
|
params?: Record<string, unknown>;
|
|
116
139
|
}
|
|
117
140
|
/**
|
|
118
|
-
*
|
|
141
|
+
* The View SDK API for displaying UI elements and managing view state.
|
|
119
142
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* This SDK lets UI Bundles interact with the host's UI layer. It
|
|
145
|
+
* displays alerts, toast notifications, and modal dialogs, and it
|
|
146
|
+
* manages application state. Every method is optional and may be
|
|
147
|
+
* unavailable, depending on the runtime surface.
|
|
123
148
|
*
|
|
124
149
|
* ## Events
|
|
125
150
|
*
|
|
126
|
-
* A ViewSDK is a DOM {@link EventTarget}
|
|
127
|
-
* `addEventListener
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
151
|
+
* A `ViewSDK` is a DOM {@link EventTarget}. Its event API is the native
|
|
152
|
+
* `addEventListener`, `removeEventListener`, and `dispatchEvent`. On
|
|
153
|
+
* surfaces backed by a host bridge, for example the embedded
|
|
154
|
+
* MicroFrontend surface, `dispatchEvent` both notifies local listeners
|
|
155
|
+
* and forwards the event to the host. Events that the host pushes are
|
|
156
|
+
* re-dispatched onto the SDK, so `addEventListener` hears them too.
|
|
157
|
+
* This gives one unified stream of host-pushed and same-document
|
|
158
|
+
* events.
|
|
132
159
|
*
|
|
133
|
-
* The `EventTarget` members are declared
|
|
134
|
-
*
|
|
135
|
-
*
|
|
160
|
+
* The `EventTarget` members are declared through {@link Partial}, so
|
|
161
|
+
* surfaces without an event bus, for example the WebApp and Mosaic
|
|
162
|
+
* degraded SDK, which is a bare `{}`, still satisfy the type.
|
|
163
|
+
* Feature-detect before use, with `viewSDK.dispatchEvent?.(...)`.
|
|
136
164
|
*
|
|
137
165
|
* @example
|
|
138
166
|
* ```typescript
|
|
@@ -156,13 +184,15 @@ export interface ModalOptions {
|
|
|
156
184
|
*/
|
|
157
185
|
export type ViewSDK = Partial<EventTarget> & {
|
|
158
186
|
/**
|
|
159
|
-
*
|
|
187
|
+
* Displays an alert message in the host environment.
|
|
160
188
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* An alert is typically modal and requires user acknowledgment before
|
|
191
|
+
* it dismisses. Use alerts for important messages that need
|
|
192
|
+
* immediate attention.
|
|
163
193
|
*
|
|
164
|
-
* @param options -
|
|
165
|
-
* @returns
|
|
194
|
+
* @param options - The alert configuration.
|
|
195
|
+
* @returns Resolves once the host displays the alert.
|
|
166
196
|
*
|
|
167
197
|
* @example
|
|
168
198
|
* ```typescript
|
|
@@ -174,14 +204,15 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
174
204
|
*/
|
|
175
205
|
displayAlert?(options: AlertOptions): Promise<void>;
|
|
176
206
|
/**
|
|
177
|
-
*
|
|
207
|
+
* Displays a toast notification in the host environment.
|
|
178
208
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
209
|
+
* @remarks
|
|
210
|
+
* A toast is a non-blocking, temporary notification that dismisses
|
|
211
|
+
* automatically. Use toasts for success confirmations, status
|
|
212
|
+
* updates, and informational messages that need no user interaction.
|
|
182
213
|
*
|
|
183
|
-
* @param options -
|
|
184
|
-
* @returns
|
|
214
|
+
* @param options - The toast configuration.
|
|
215
|
+
* @returns Resolves once the host displays the toast.
|
|
185
216
|
*
|
|
186
217
|
* @example
|
|
187
218
|
* ```typescript
|
|
@@ -193,14 +224,15 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
193
224
|
*/
|
|
194
225
|
displayToast?(options: ToastOptions): Promise<void>;
|
|
195
226
|
/**
|
|
196
|
-
*
|
|
227
|
+
* Displays a modal dialog with custom UI in the host environment.
|
|
197
228
|
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
229
|
+
* @remarks
|
|
230
|
+
* A modal displays custom HTML content in a dialog overlay. The SDK
|
|
231
|
+
* loads the template from a UI resource URI, and you can pass
|
|
232
|
+
* parameters to the modal for dynamic content.
|
|
201
233
|
*
|
|
202
|
-
* @param options -
|
|
203
|
-
* @returns
|
|
234
|
+
* @param options - The modal configuration.
|
|
235
|
+
* @returns Resolves once the host displays the modal.
|
|
204
236
|
*
|
|
205
237
|
* @example
|
|
206
238
|
* ```typescript
|
|
@@ -215,13 +247,15 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
215
247
|
*/
|
|
216
248
|
displayModal?(options: ModalOptions): Promise<void>;
|
|
217
249
|
/**
|
|
218
|
-
*
|
|
250
|
+
* Navigates to a different URL within the application.
|
|
219
251
|
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
252
|
+
* @remarks
|
|
253
|
+
* This method triggers navigation in the host environment. The
|
|
254
|
+
* behavior may vary depending on the surface, through full-page
|
|
255
|
+
* navigation or iframe navigation.
|
|
222
256
|
*
|
|
223
|
-
* @param url - The URL to navigate to
|
|
224
|
-
* @returns
|
|
257
|
+
* @param url - The URL to navigate to, relative or absolute.
|
|
258
|
+
* @returns Resolves once the host starts navigation.
|
|
225
259
|
*
|
|
226
260
|
* @example
|
|
227
261
|
* ```typescript
|
|
@@ -231,14 +265,18 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
231
265
|
*/
|
|
232
266
|
navigateTo?(url: string): Promise<void>;
|
|
233
267
|
/**
|
|
234
|
-
*
|
|
268
|
+
* Marks the application state as dirty, meaning it has unsaved
|
|
269
|
+
* changes.
|
|
235
270
|
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
271
|
+
* @remarks
|
|
272
|
+
* This method notifies the host that the application has unsaved
|
|
273
|
+
* changes. The host may display a visual indicator, for example an
|
|
274
|
+
* asterisk in the title, and prompt the user before it navigates
|
|
275
|
+
* away or closes the application.
|
|
239
276
|
*
|
|
240
|
-
* @param label -
|
|
241
|
-
*
|
|
277
|
+
* @param label - A dirty-source ID that lets hosts tell apart multiple
|
|
278
|
+
* concurrent dirty regions.
|
|
279
|
+
* @returns Resolves once the host marks the dirty state.
|
|
242
280
|
*
|
|
243
281
|
* @example
|
|
244
282
|
* ```typescript
|
|
@@ -253,13 +291,16 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
253
291
|
*/
|
|
254
292
|
markDirtyState?(label?: string): Promise<void>;
|
|
255
293
|
/**
|
|
256
|
-
*
|
|
294
|
+
* Clears the application's dirty state, meaning it has no unsaved
|
|
295
|
+
* changes.
|
|
257
296
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
297
|
+
* @remarks
|
|
298
|
+
* This method notifies the host that the application has saved
|
|
299
|
+
* every change. Call it after you successfully persist data, to
|
|
300
|
+
* remove unsaved-change indicators.
|
|
260
301
|
*
|
|
261
|
-
* @param label -
|
|
262
|
-
* @returns
|
|
302
|
+
* @param label - The identifier that matches the prior `markDirtyState` call.
|
|
303
|
+
* @returns Resolves once the host clears the dirty state.
|
|
263
304
|
*
|
|
264
305
|
* @example
|
|
265
306
|
* ```typescript
|
|
@@ -273,24 +314,30 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
273
314
|
*/
|
|
274
315
|
clearDirtyState?(label?: string): Promise<void>;
|
|
275
316
|
/**
|
|
276
|
-
*
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
317
|
+
* Gets the current host UI state and a `subscribe` function for
|
|
318
|
+
* future changes.
|
|
319
|
+
*
|
|
320
|
+
* @remarks
|
|
321
|
+
* This method returns the latest known snapshot synchronously. The
|
|
322
|
+
* underlying wire subscription opens once, is session-scoped, and is
|
|
323
|
+
* shared across every caller. {@link getTheme} is its synchronous
|
|
324
|
+
* sibling. Call `subscribe` with a handler to receive every later
|
|
325
|
+
* host push. `subscribe` returns an `unsubscribe` function that
|
|
326
|
+
* detaches that one handler. Detaching only affects local fan-out;
|
|
327
|
+
* the shared wire subscription stays open.
|
|
328
|
+
*
|
|
329
|
+
* The `State` type parameter describes the host contract that this
|
|
330
|
+
* caller expects. Pass a type that extends `UiState`, with narrower
|
|
331
|
+
* `props` and `styles`, and both `state` and the `subscribe`
|
|
332
|
+
* handler's argument are typed as it. It defaults to the open
|
|
333
|
+
* {@link UiState}, so `getUiState()` with no type argument returns
|
|
334
|
+
* the fully permissive snapshot. `State` is erased at runtime. It is
|
|
335
|
+
* purely a compile-time convenience, so pin only what the host
|
|
289
336
|
* actually guarantees.
|
|
290
337
|
*
|
|
291
|
-
* @typeParam State - The expected snapshot shape
|
|
292
|
-
* @returns
|
|
293
|
-
* return value is the per-handler `unsubscribe`.
|
|
338
|
+
* @typeParam State - The expected snapshot shape. Must extend {@link UiState}.
|
|
339
|
+
* @returns The current snapshot and a subscribe function. The
|
|
340
|
+
* subscribe function's return value is the per-handler `unsubscribe`.
|
|
294
341
|
*
|
|
295
342
|
* @example
|
|
296
343
|
* ```typescript
|
|
@@ -319,14 +366,16 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
319
366
|
subscribe: (handler: (state: State) => void) => () => void;
|
|
320
367
|
};
|
|
321
368
|
/**
|
|
322
|
-
*
|
|
369
|
+
* Resizes the application viewport.
|
|
323
370
|
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
371
|
+
* @remarks
|
|
372
|
+
* This method requests that the host resize the application
|
|
373
|
+
* container to the specified dimensions. Use it for adaptive
|
|
374
|
+
* layouts or when content size changes dynamically.
|
|
326
375
|
*
|
|
327
|
-
* @param width - The desired width
|
|
328
|
-
* @param height - The desired height
|
|
329
|
-
* @returns
|
|
376
|
+
* @param width - The desired width, for example `500px`, `100%`, or `auto`.
|
|
377
|
+
* @param height - The desired height, for example `300px`, `100%`, or `auto`.
|
|
378
|
+
* @returns Resolves once the resize completes.
|
|
330
379
|
*
|
|
331
380
|
* @example
|
|
332
381
|
* ```typescript
|
|
@@ -339,12 +388,14 @@ export type ViewSDK = Partial<EventTarget> & {
|
|
|
339
388
|
*/
|
|
340
389
|
resize?(width: string, height: string): Promise<void>;
|
|
341
390
|
/**
|
|
342
|
-
*
|
|
391
|
+
* Gets the current theme from the host environment.
|
|
343
392
|
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
393
|
+
* @remarks
|
|
394
|
+
* This method returns the current theme, light or dark mode, as the
|
|
395
|
+
* host reports it. It returns `null` when the host has not provided
|
|
396
|
+
* theme information.
|
|
346
397
|
*
|
|
347
|
-
* @returns The current theme or null
|
|
398
|
+
* @returns The current theme, or `null` when it is not available.
|
|
348
399
|
*
|
|
349
400
|
* @example
|
|
350
401
|
* ```typescript
|
package/dist/core/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/core/view.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* The catalog of first-party `DataSDK` extensions.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Import an extension from this subpath, and attach it with
|
|
11
|
+
* `createDataSDK({ extensions: [...] })`.
|
|
9
12
|
*
|
|
10
13
|
* ```typescript
|
|
11
14
|
* import { createDataSDK } from "@salesforce/platform-sdk/data";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/extensions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/extensions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|