@openfin/fdc3-api 44.101.1 → 44.101.3

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/out/fdc3-api.d.ts CHANGED
@@ -42,6 +42,16 @@ declare type Accelerator = {
42
42
  zoom: boolean;
43
43
  };
44
44
 
45
+ /**
46
+ * @interface
47
+ * Shared context available to all aria label functions.
48
+ */
49
+ declare type AccessibilityContext = {
50
+ arrowNavigationEnabled: boolean;
51
+ deleteKeyCloseEnabled: boolean;
52
+ homeEndNavigationEnabled: boolean;
53
+ };
54
+
45
55
  /**
46
56
  * Generated when a View is added to a layout.
47
57
  * @interface
@@ -51,6 +61,14 @@ declare type AddedToLayoutEvent = BaseEvent_4 & {
51
61
  layoutIdentity: OpenFin.LayoutIdentity;
52
62
  };
53
63
 
64
+ /**
65
+ * @interface
66
+ * Context for add tab button aria-label functions.
67
+ */
68
+ declare type AddTabButtonAriaLabelContext = AccessibilityContext & {
69
+ tabCount: number;
70
+ };
71
+
54
72
  /**
55
73
  * Options to use when adding a view to a {@link TabStack}.
56
74
  *
@@ -1610,6 +1628,17 @@ declare type AppVersionTypeFromIdEvent<T extends IdEventType> = Extract<AppVersi
1610
1628
  type: WithoutId<T>;
1611
1629
  }>;
1612
1630
 
1631
+ /**
1632
+ * @interface
1633
+ * Custom aria-label providers for accessibility.
1634
+ */
1635
+ declare type AriaLabelOptions = {
1636
+ activeTab?: string | ((ctx: TabAriaLabelContext) => string);
1637
+ inactiveTab?: string | ((ctx: TabAriaLabelContext) => string);
1638
+ closeButton?: string | ((ctx: CloseButtonAriaLabelContext) => string);
1639
+ addTabButton?: string | ((ctx: AddTabButtonAriaLabelContext) => string);
1640
+ };
1641
+
1613
1642
  declare interface AuthorizationPayload {
1614
1643
  token: string;
1615
1644
  file: string;
@@ -3168,6 +3197,11 @@ declare type ClearCacheOption = {
3168
3197
  * browser data that can be used across sessions
3169
3198
  */
3170
3199
  localStorage?: boolean;
3200
+ /**
3201
+ * Clears saved window-state data written for windows that use `saveWindowState`.
3202
+ * After this data is cleared, previously persisted bounds and state (Maximized/Minimized) will not be restored until new state is written again.
3203
+ */
3204
+ windowState?: boolean;
3171
3205
  };
3172
3206
 
3173
3207
  /**
@@ -3210,6 +3244,11 @@ declare type ClearDataOptions = {
3210
3244
  * - `origin-in-all-contexts` - Storage is matched on origin only in all contexts.
3211
3245
  */
3212
3246
  originMatchingMode?: 'third-parties-included' | 'origin-in-all-contexts';
3247
+ /**
3248
+ * Clears saved window-state data written for windows that use `saveWindowState`.
3249
+ * After this data is cleared, previously persisted bounds and state (Maximized/Minimized) will not be restored until new state is written again.
3250
+ */
3251
+ windowState?: boolean;
3213
3252
  };
3214
3253
 
3215
3254
  /**
@@ -3497,6 +3536,15 @@ declare type ClipboardPermissions = {
3497
3536
  */
3498
3537
  declare type ClipboardSelectionType = 'clipboard' | 'selection';
3499
3538
 
3539
+ /**
3540
+ * @interface
3541
+ * Context for close button aria-label functions.
3542
+ */
3543
+ declare type CloseButtonAriaLabelContext = AccessibilityContext & {
3544
+ title: string;
3545
+ isActive: boolean;
3546
+ };
3547
+
3500
3548
  /**
3501
3549
  * Generated when an application is closed.
3502
3550
  * @interface
@@ -4512,6 +4560,10 @@ declare type CreateLayoutOptions = {
4512
4560
  * @experimental
4513
4561
  */
4514
4562
  renderCustomHeaderControls?: (controlsElement: HTMLElement, context: HeaderControlsContext) => (() => void) | void;
4563
+ /**
4564
+ * Accessibility options for the layout. Controls ARIA attributes and keyboard navigation.
4565
+ */
4566
+ accessibilityOptions?: LayoutAccessibilityOptions;
4515
4567
  };
4516
4568
 
4517
4569
  /**
@@ -5200,7 +5252,7 @@ declare interface Environment {
5200
5252
  layoutAllowedInContext(fin: OpenFin.Fin<OpenFin.EntityType>): boolean;
5201
5253
  initLayoutManager(fin: OpenFin.Fin<OpenFin.EntityType>, wire: Transport, options: OpenFin.InitLayoutOptions): Promise<OpenFin.LayoutManager<OpenFin.LayoutSnapshot>>;
5202
5254
  applyLayoutSnapshot(fin: OpenFin.Fin<OpenFin.EntityType>, layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.InitLayoutOptions): Promise<void>;
5203
- createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<void>;
5255
+ createLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, options: OpenFin.CreateLayoutOptions): Promise<OpenFin.LayoutSyncApi>;
5204
5256
  destroyLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<void>;
5205
5257
  resolveLayout(layoutManager: OpenFin.LayoutManager<OpenFin.LayoutSnapshot>, layoutIdentity: OpenFin.LayoutIdentity): Promise<any>;
5206
5258
  initPlatform(fin: OpenFin.Fin<OpenFin.EntityType>, ...args: Parameters<OpenFin.Fin['Platform']['init']>): ReturnType<OpenFin.Fin['Platform']['init']>;
@@ -8860,6 +8912,27 @@ declare class Layout extends Base {
8860
8912
  closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8861
8913
  }
8862
8914
 
8915
+ /**
8916
+ * @interface
8917
+ * Accessibility options for layout tab navigation and ARIA support.
8918
+ */
8919
+ declare type LayoutAccessibilityOptions = {
8920
+ viewTabOptions?: ViewTabAccessibilityOptions;
8921
+ /**
8922
+ * Keyboard shortcut used to move focus from a tab header element into the active tab's web content.
8923
+ *
8924
+ * - Accepts an accelerator-like string, e.g. `'Ctrl+Enter'`, `'Meta+Enter'`, `'Alt+Enter'`, `'Mod+Enter'`.
8925
+ * - `'Mod'`/`'CmdOrCtrl'`/`'CtrlOrMeta'` means Ctrl on Windows/Linux or Meta on macOS.
8926
+ * - Set to `false` to disable this shortcut.
8927
+ * - In core-web, reverse focus transfer (from iframe web content back to tab header) is not reliably supportable
8928
+ * due to browser iframe security and cross-origin focus restrictions. This hotkey is intentionally one-way:
8929
+ * tab header -> web content.
8930
+ *
8931
+ * @defaultValue 'Mod+Enter'
8932
+ */
8933
+ focusContentHotkey?: string | false;
8934
+ };
8935
+
8863
8936
  /**
8864
8937
  * @interface
8865
8938
  */
@@ -9243,7 +9316,7 @@ declare class LayoutModule extends Base {
9243
9316
  * @returns
9244
9317
  */
9245
9318
  getCurrentLayoutManagerSync: <UserSnapshotType extends OpenFin.LayoutSnapshot>() => OpenFin.LayoutManager<UserSnapshotType>;
9246
- create: (options: OpenFin.CreateLayoutOptions) => Promise<void>;
9319
+ create: (options: OpenFin.CreateLayoutOptions) => Promise<OpenFin.LayoutSyncApi>;
9247
9320
  destroy: (layoutIdentity: OpenFin.LayoutIdentity) => Promise<void>;
9248
9321
  }
9249
9322
 
@@ -9628,6 +9701,19 @@ declare type LayoutStateChangedEvent = LayoutDOMEvent & {
9628
9701
  type: 'layout-state-changed';
9629
9702
  };
9630
9703
 
9704
+ /**
9705
+ * @interface
9706
+ * Sync API returned from Layout.create() for operations that don't require IPC.
9707
+ * Only available in the window context that owns the layout.
9708
+ */
9709
+ declare type LayoutSyncApi = {
9710
+ /**
9711
+ * Updates accessibility options at runtime without recreating the layout.
9712
+ * @param options Partial accessibility options to merge with existing options
9713
+ */
9714
+ updateAccessibilityOptions(options: Partial<LayoutAccessibilityOptions>): void;
9715
+ };
9716
+
9631
9717
  /**
9632
9718
  * @interface
9633
9719
  */
@@ -11166,6 +11252,15 @@ declare namespace OpenFin {
11166
11252
  HeaderControlsContext,
11167
11253
  CreateLayoutOptions,
11168
11254
  MultiInstanceViewBehavior,
11255
+ LayoutAccessibilityOptions,
11256
+ ViewTabElements,
11257
+ ViewTabAccessibilityOptions,
11258
+ AccessibilityContext,
11259
+ TabAriaLabelContext,
11260
+ CloseButtonAriaLabelContext,
11261
+ AddTabButtonAriaLabelContext,
11262
+ AriaLabelOptions,
11263
+ LayoutSyncApi,
11169
11264
  PresetLayoutOptions_2 as PresetLayoutOptions,
11170
11265
  ResultBehavior,
11171
11266
  PopupBaseBehavior,
@@ -12980,6 +13075,38 @@ declare interface PlatformProvider {
12980
13075
  * @returns A promise resolving to `true` if the window should prevent the app from quitting, otherwise `false`.
12981
13076
  */
12982
13077
  shouldWindowPreventQuit(windowIdentity: OpenFin.Identity): Promise<boolean>;
13078
+ /**
13079
+ * Returns the platform's keyboard commands. Default implementation returns the manifest's
13080
+ * `platform.commands`. Override to inject additional default commands.
13081
+ * Called once during Platform.init; the result is cached for the lifetime
13082
+ * of the platform.
13083
+ *
13084
+ * @remarks
13085
+ * The returned commands are merged with core's built-in default commands
13086
+ * (unless `disableDefaultCommands` is set).
13087
+ * Overriders receive the raw manifest commands from `super` and can prepend
13088
+ * their own defaults — returned commands override default commands by command name.
13089
+ *
13090
+ * @example
13091
+ * ```js
13092
+ * const overrideCallback = (PlatformProvider) => {
13093
+ * class Override extends PlatformProvider {
13094
+ * getKeyboardCommands() {
13095
+ * const manifestCommands = super.getKeyboardCommands();
13096
+ * const myCommands = [{ command: 'myApp.search', keys: 'Ctrl+K' }];
13097
+ * return [
13098
+ * ...myCommands,
13099
+ * ...manifestCommands
13100
+ * ];
13101
+ * }
13102
+ * }
13103
+ * return new Override();
13104
+ * }
13105
+ *
13106
+ * fin.Platform.init({ overrideCallback });
13107
+ * ```
13108
+ */
13109
+ getKeyboardCommands(): OpenFin.ShortcutOverride[];
12983
13110
  /**
12984
13111
  * Method that is called every time an error occurs when processing an action in the Platform Provider. It is meant to be overriden, as a means to debug Platform applications
12985
13112
  */
@@ -15593,13 +15720,15 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
15593
15720
  * * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
15594
15721
  * * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
15595
15722
  * * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
15723
+ * * windowState: clears data written for windows using `saveWindowState`; after clearing, previously saved bounds and state will not be restored until new state is written
15596
15724
  * @example
15597
15725
  * ```js
15598
15726
  * const clearCacheOptions = {
15599
15727
  * appcache: true,
15600
15728
  * cache: true,
15601
15729
  * cookies: true,
15602
- * localStorage: true
15730
+ * localStorage: true,
15731
+ * windowState: true
15603
15732
  * };
15604
15733
  * fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
15605
15734
  * ```
@@ -15624,12 +15753,16 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
15624
15753
  *
15625
15754
  * @param options - Optional configuration for what data to clear
15626
15755
  *
15756
+ * @remarks Set `windowState: true` to also clear data written for windows using `saveWindowState`.
15757
+ * After this data is cleared, previously saved bounds and state will not be restored until new state is written again.
15758
+ *
15627
15759
  * @example
15628
15760
  * ```js
15629
15761
  * // Clear only cookies and localStorage for a specific origin
15630
15762
  * await fin.System.clearCacheData({
15631
15763
  * dataTypes: ['cookies', 'localStorage'],
15632
- * origins: ['http://localhost:8081']
15764
+ * origins: ['http://localhost:8081'],
15765
+ * windowState: true
15633
15766
  * });
15634
15767
  *
15635
15768
  * // Clear everything except for a specific origin
@@ -17209,6 +17342,13 @@ declare class System extends EmitterBase<OpenFin.SystemEvent> {
17209
17342
  declare class SystemContentTracing extends Base {
17210
17343
  /**
17211
17344
  * Gets the currently known tracing category groups.
17345
+ *
17346
+ * @example
17347
+ * ```ts
17348
+ * const categories = await fin.System.ContentTracing.getCategories();
17349
+ * const sorted = [...new Set(categories)].sort((a, b) => a.localeCompare(b));
17350
+ * console.log(`Loaded ${sorted.length} tracing categories`);
17351
+ * ```
17212
17352
  */
17213
17353
  getCategories(): Promise<string[]>;
17214
17354
  /**
@@ -17216,6 +17356,29 @@ declare class SystemContentTracing extends Base {
17216
17356
  *
17217
17357
  * Only one content tracing session may be active across the runtime at a time.
17218
17358
  * This method rejects if another identity already owns the active session.
17359
+ *
17360
+ * @example
17361
+ * ```ts
17362
+ * await fin.System.ContentTracing.startRecording({
17363
+ * recording_mode: 'record-as-much-as-possible',
17364
+ * included_categories: [
17365
+ * '*',
17366
+ * 'disabled-by-default-blink.invalidation',
17367
+ * 'disabled-by-default-cc.debug',
17368
+ * 'disabled-by-default-viz.surface_id_flow'
17369
+ * ]
17370
+ * });
17371
+ *
17372
+ * console.log('Content tracing started. Call stopRecording() when ready to collect the trace.');
17373
+ * ```
17374
+ *
17375
+ * @example
17376
+ * ```ts
17377
+ * await fin.System.ContentTracing.startRecording({
17378
+ * categoryFilter: 'electron,blink,cc',
17379
+ * traceOptions: 'record-until-full,enable-sampling'
17380
+ * });
17381
+ * ```
17219
17382
  */
17220
17383
  startRecording(options: OpenFin.TraceConfig | OpenFin.TraceCategoriesAndOptions): Promise<void>;
17221
17384
  /**
@@ -17223,12 +17386,29 @@ declare class SystemContentTracing extends Base {
17223
17386
  *
17224
17387
  * The calling identity must match the identity that started the active tracing session.
17225
17388
  * This method rejects if tracing is not active or is owned by another identity.
17389
+ *
17390
+ * @example
17391
+ * ```ts
17392
+ * const tracePath = await fin.System.ContentTracing.stopRecording();
17393
+ * console.log('Trace written to:', tracePath);
17394
+ * // Load the file in chrome://tracing or https://ui.perfetto.dev/
17395
+ * ```
17226
17396
  */
17227
17397
  stopRecording(): Promise<string>;
17228
17398
  /**
17229
17399
  * Returns the current maximum trace buffer usage across processes.
17230
17400
  *
17231
17401
  * This method is not supported on macOS and rejects on that platform.
17402
+ *
17403
+ * @example
17404
+ * ```ts
17405
+ * try {
17406
+ * const usage = await fin.System.ContentTracing.getTraceBufferUsage();
17407
+ * console.log(`Buffer usage: ${usage.percentage}% (${usage.value})`);
17408
+ * } catch (error) {
17409
+ * console.warn('Trace buffer usage is not available on this platform.', error);
17410
+ * }
17411
+ * ```
17232
17412
  */
17233
17413
  getTraceBufferUsage(): Promise<OpenFin.TraceBufferUsage>;
17234
17414
  }
@@ -17357,6 +17537,17 @@ declare type SystemShutdownHandler = (shutdownEvent: {
17357
17537
  proceed: () => void;
17358
17538
  }) => void;
17359
17539
 
17540
+ /**
17541
+ * @interface
17542
+ * Context for tab aria-label functions.
17543
+ */
17544
+ declare type TabAriaLabelContext = AccessibilityContext & {
17545
+ title: string;
17546
+ isActive: boolean;
17547
+ tabIndex: number;
17548
+ tabCount: number;
17549
+ };
17550
+
17360
17551
  /**
17361
17552
  * Generated when a Layout Tab Component was closed.
17362
17553
  * @interface
@@ -18869,6 +19060,53 @@ declare interface ViewStatuses {
18869
19060
  viewsNotPreventingUnload: Identity_4[];
18870
19061
  }
18871
19062
 
19063
+ /**
19064
+ * @interface
19065
+ * Accessibility options for view tab navigation.
19066
+ */
19067
+ declare type ViewTabAccessibilityOptions = {
19068
+ /**
19069
+ * Controls which elements are reachable via Tab key navigation.
19070
+ * Uses roving tabindex pattern - only one element focusable at a time.
19071
+ * @default ['active-tab', 'add-tab-button']
19072
+ */
19073
+ tabNavigation?: ViewTabElements[];
19074
+ /**
19075
+ * Controls which elements are navigable via Arrow keys.
19076
+ * @default ['inactive-tab', 'active-tab', 'active-tab-close-button', 'inactive-tab-close-button', 'add-tab-button']
19077
+ */
19078
+ arrowNavigation?: ViewTabElements[];
19079
+ /**
19080
+ * Whether Delete/Backspace keys close the focused tab.
19081
+ * @default false
19082
+ */
19083
+ enableDeleteKeyClose?: boolean;
19084
+ /**
19085
+ * Whether Home/End keys jump to first/last navigable element.
19086
+ * @default false
19087
+ */
19088
+ enableHomeEndNavigation?: boolean;
19089
+ /**
19090
+ * Custom aria-label providers. Can be a static string or a function receiving context.
19091
+ */
19092
+ ariaLabels?: AriaLabelOptions;
19093
+ /**
19094
+ * Whether to announce tab changes via aria-live.
19095
+ * @default true
19096
+ */
19097
+ announceTabChanges?: boolean;
19098
+ /**
19099
+ * Focus behavior when a tab is closed via keyboard.
19100
+ * @default 'next'
19101
+ */
19102
+ focusOnCloseStrategy?: 'next' | 'previous' | 'active';
19103
+ };
19104
+
19105
+ /**
19106
+ * Elements that can be navigated in view tabs.
19107
+ */
19108
+ declare type ViewTabElements = 'active-tab' | 'inactive-tab' | 'active-tab-close-button' | 'inactive-tab-close-button' | 'add-tab-button';
19109
+
18872
19110
  /**
18873
19111
  * View throttling state.
18874
19112
  *
package/out/fdc3-api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var isEqual = require('lodash/isEqual');
3
+ var esToolkit = require('es-toolkit');
4
4
 
5
5
  const generateId = () => `${Math.random()}${Date.now()}`;
6
6
  const wrapInTryCatch = (f, prefix) => (...args) => {
@@ -163,7 +163,7 @@ const createV1Channel = (sessionContextGroup) => {
163
163
  const wrappedHandler = (context, contextMetadata) => {
164
164
  if (first) {
165
165
  first = false;
166
- if (isEqual(currentContext, context)) {
166
+ if (esToolkit.isEqual(currentContext, context)) {
167
167
  return;
168
168
  }
169
169
  }
@@ -1453,7 +1453,7 @@ class FDC3ModuleBase {
1453
1453
  const wrappedHandler = (context, contextMetadata) => {
1454
1454
  if (first) {
1455
1455
  first = false;
1456
- if (isEqual(currentContext, context)) {
1456
+ if (esToolkit.isEqual(currentContext, context)) {
1457
1457
  return;
1458
1458
  }
1459
1459
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/fdc3-api",
3
- "version": "44.101.1",
3
+ "version": "44.101.3",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "author": "OpenFin",
16
16
  "dependencies": {
17
- "lodash": "^4.17.21",
17
+ "es-toolkit": "^1.39.3",
18
18
  "tslib": "2.8.1"
19
19
  },
20
20
  "scripts": {