@genesislcap/foundation-layout 14.393.2 → 14.393.3-FUI-2471.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.
Files changed (32) hide show
  1. package/dist/custom-elements.json +318 -24
  2. package/dist/dts/index.d.ts +1 -1
  3. package/dist/dts/index.d.ts.map +1 -1
  4. package/dist/dts/main/layout-main.d.ts +12 -5
  5. package/dist/dts/main/layout-main.d.ts.map +1 -1
  6. package/dist/dts/main/layout-popout-controller.d.ts +40 -0
  7. package/dist/dts/main/layout-popout-controller.d.ts.map +1 -0
  8. package/dist/dts/utils/constants.d.ts +7 -1
  9. package/dist/dts/utils/constants.d.ts.map +1 -1
  10. package/dist/dts/utils/index.d.ts +1 -0
  11. package/dist/dts/utils/index.d.ts.map +1 -1
  12. package/dist/dts/utils/popout-events.d.ts +37 -0
  13. package/dist/dts/utils/popout-events.d.ts.map +1 -0
  14. package/dist/dts/utils/types.d.ts +28 -0
  15. package/dist/dts/utils/types.d.ts.map +1 -1
  16. package/dist/esm/index.js +1 -1
  17. package/dist/esm/main/layout-main.js +47 -21
  18. package/dist/esm/main/layout-popout-controller.js +243 -0
  19. package/dist/esm/utils/constants.js +7 -1
  20. package/dist/esm/utils/index.js +1 -0
  21. package/dist/esm/utils/popout-events.js +5 -0
  22. package/dist/foundation-layout.api.json +94 -10
  23. package/dist/foundation-layout.d.ts +96 -4
  24. package/docs/api/foundation-layout.foundationlayout.md +3 -3
  25. package/docs/api/foundation-layout.foundationlayout.popoutconfig.md +2 -2
  26. package/docs/api/foundation-layout.foundationlayout.tryactivatepopoutmode.md +38 -1
  27. package/docs/api/foundation-layout.layout_popout_control_key.md +16 -0
  28. package/docs/api/foundation-layout.layoutpopoutconfig.md +22 -0
  29. package/docs/api/foundation-layout.md +22 -0
  30. package/docs/api/foundation-layout.serialisedlayout.md +3 -0
  31. package/docs/api-report.md.api.md +29 -2
  32. package/package.json +15 -13
@@ -1,5 +1,6 @@
1
1
  import type { Container } from '@microsoft/fast-foundation';
2
2
  import { ElementStyles } from '@microsoft/fast-element';
3
+ import { FASTElement } from '@microsoft/fast-element';
3
4
  import { FoundationElement } from '@microsoft/fast-foundation';
4
5
  import { FoundationElementRegistry } from '@microsoft/fast-foundation';
5
6
  import { LayoutConfig } from '@genesis-community/golden-layout';
@@ -170,13 +171,16 @@ export declare class FoundationLayout extends FoundationElement implements Layou
170
171
  * has changed and know you potentially need to gate some of your lifecycle functionality.
171
172
  */
172
173
  lifecycleUpdateToken: string | undefined;
174
+ /** @internal */
175
+ popupMode: boolean;
176
+ /** @internal */
177
+ popoutController: FoundationLayoutPopoutController;
173
178
  /**
174
179
  * Controls whether popout functionality is enabled on the layout. Defaults to disabled.
175
- * Set this attribute to any string to enable popout functionality. If this string is of format `number;number` then this will be interpreted as the width and height of the popout window.
180
+ * Pass an empty object `{}` to use default configurations, or a {@link LayoutPopoutConfig} object to further customise.
176
181
  * @beta
177
182
  */
178
- popoutConfig: string | undefined;
179
- private popupMode;
183
+ popoutConfig: LayoutPopoutConfig | undefined;
180
184
  /** @internal */
181
185
  constructor();
182
186
  /** @internal */
@@ -247,9 +251,12 @@ export declare class FoundationLayout extends FoundationElement implements Layou
247
251
  * If you set the `LAYOUT_POPOUT_CONTAINER_CLASS` on an element which is a DOM parent of the layout,
248
252
  * then if the layout goes into popout mode then it will place itself as the only child for the popout container you set.
249
253
  * It is likely you'll want to attach this class to your design system provider.
254
+ *
255
+ * @param autoloading - If true, this respects the {@link LayoutPopoutConfig.loadAutomatically} property.
256
+ * You might want to set this to false and call it manually if you're manually registering components to the layout in order to avoid race conditions.
250
257
  * @beta
251
258
  */
252
- tryActivatePopoutMode(): boolean;
259
+ tryActivatePopoutMode(autoloading?: boolean): boolean;
253
260
  /**
254
261
  * Try to load a layout from local storage, or return false. Only required if manually calling {@link FoundationLayout.registerItem}
255
262
  * @remarks
@@ -583,6 +590,44 @@ export declare class FoundationLayout extends FoundationElement implements Layou
583
590
  cacheElementsAndRegister(config: RegistrationConfig): string;
584
591
  }
585
592
 
593
+ declare class FoundationLayoutPopoutController extends FASTElement {
594
+ channelName: string;
595
+ private layoutKey;
596
+ private channel;
597
+ private pollInterval;
598
+ private unloadHandler;
599
+ private lastGeometry;
600
+ private popoutRegistry;
601
+ connectedCallback(): void;
602
+ disconnectedCallback(): void;
603
+ private setupChannel;
604
+ private setupListener;
605
+ private setupUnloadListener;
606
+ private teardownUnloadListener;
607
+ private emitAutosave;
608
+ private startPolling;
609
+ private stopPolling;
610
+ private getGeometry;
611
+ private broadcastGeometry;
612
+ /**
613
+ * Opens a component in a popout window.
614
+ * @param registration - The registration ID of the component to pop out.
615
+ * @param geometry - Optional geometry to use for the new window.
616
+ * @param uuid - UUID generator from parent layout
617
+ */
618
+ openPopout(registration: string, geometry?: any, uuid?: any): Promise<Window>;
619
+ getRegistry(): {
620
+ [layoutKey: string]: PopoutState;
621
+ };
622
+ /**
623
+ * Restores popouts from a registry
624
+ */
625
+ restorePopouts(registry: {
626
+ [layoutKey: string]: PopoutState;
627
+ }, uuid: any): Promise<void>;
628
+ closeAllPopouts(): void;
629
+ }
630
+
586
631
  /**
587
632
  * @public
588
633
  * `FoundationLayoutRegion` is a custom element that represents a region in the layout.
@@ -674,6 +719,12 @@ export declare class FoundationLayout extends FoundationElement implements Layou
674
719
  */
675
720
  export declare const LAYOUT_POPOUT_CONTAINER_CLASS = "f-layout-popout";
676
721
 
722
+ /**
723
+ * Key to be used for controlling popout behaviour
724
+ * @beta
725
+ */
726
+ export declare const LAYOUT_POPOUT_CONTROL_KEY = "f-layout-key";
727
+
677
728
  /** @internal */
678
729
  declare interface LayoutComponent {
679
730
  [componentType]: ComponentTypes;
@@ -765,6 +816,20 @@ export declare class FoundationLayout extends FoundationElement implements Layou
765
816
  readonly itemResized: "item-resized";
766
817
  };
767
818
 
819
+ /** @beta */
820
+ export declare type LayoutPopoutConfig = {
821
+ /**
822
+ * The name of the broadcast channel to use for communication between the main window and popout windows.
823
+ * Defaults to 'f-layout-popout-channel'.
824
+ */
825
+ channelName?: string;
826
+ loadAutomatically?: boolean;
827
+ popoutDimension?: {
828
+ width: number;
829
+ height: number;
830
+ };
831
+ };
832
+
768
833
  /**
769
834
  * Defines events that the layout system listens for
770
835
  *
@@ -850,6 +915,26 @@ export declare class FoundationLayout extends FoundationElement implements Layou
850
915
  };
851
916
  };
852
917
 
918
+ /**
919
+ * Geometry details for a popout window
920
+ * @public
921
+ */
922
+ declare type PopoutGeometry = {
923
+ screenX: number;
924
+ screenY: number;
925
+ outerWidth: number;
926
+ outerHeight: number;
927
+ screenId?: string;
928
+ };
929
+
930
+ /**
931
+ * @beta
932
+ * State of a popped out window
933
+ */
934
+ declare type PopoutState = {
935
+ geometry: PopoutGeometry;
936
+ };
937
+
853
938
  /**
854
939
  * @public
855
940
  * The parameters that can be set on a new item when being added by the {@link FoundationLayout.addItem} API
@@ -923,6 +1008,13 @@ export declare class FoundationLayout extends FoundationElement implements Layou
923
1008
  export declare type SerialisedLayout = {
924
1009
  v: '1';
925
1010
  c: ResolvedLayoutConfig;
1011
+ /**
1012
+ * Optional registry of popped out components and their window geometry.
1013
+ * @beta
1014
+ */
1015
+ popouts?: {
1016
+ [layoutKey: string]: PopoutState;
1017
+ };
926
1018
  };
927
1019
 
928
1020
  /**
@@ -206,12 +206,12 @@ Function which is used to generate the placeholder text when a layout is loaded
206
206
 
207
207
  </td><td>
208
208
 
209
- string \| undefined
209
+ [LayoutPopoutConfig](./foundation-layout.layoutpopoutconfig.md) \| undefined
210
210
 
211
211
 
212
212
  </td><td>
213
213
 
214
- **_(BETA)_** Controls whether popout functionality is enabled on the layout. Defaults to disabled. Set this attribute to any string to enable popout functionality. If this string is of format `number;number` then this will be interpreted as the width and height of the popout window.
214
+ **_(BETA)_** Controls whether popout functionality is enabled on the layout. Defaults to disabled. Pass an empty object `{}` to use default configurations, or a [LayoutPopoutConfig](./foundation-layout.layoutpopoutconfig.md) object to further customise.
215
215
 
216
216
 
217
217
  </td></tr>
@@ -370,7 +370,7 @@ Removes all instances of a specified registered item from the layout.
370
370
  </td></tr>
371
371
  <tr><td>
372
372
 
373
- [tryActivatePopoutMode()](./foundation-layout.foundationlayout.tryactivatepopoutmode.md)
373
+ [tryActivatePopoutMode(autoloading)](./foundation-layout.foundationlayout.tryactivatepopoutmode.md)
374
374
 
375
375
 
376
376
  </td><td>
@@ -7,10 +7,10 @@
7
7
  > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
8
  >
9
9
 
10
- Controls whether popout functionality is enabled on the layout. Defaults to disabled. Set this attribute to any string to enable popout functionality. If this string is of format `number;number` then this will be interpreted as the width and height of the popout window.
10
+ Controls whether popout functionality is enabled on the layout. Defaults to disabled. Pass an empty object `{}` to use default configurations, or a [LayoutPopoutConfig](./foundation-layout.layoutpopoutconfig.md) object to further customise.
11
11
 
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- popoutConfig: string | undefined;
15
+ popoutConfig: LayoutPopoutConfig | undefined;
16
16
  ```
@@ -12,8 +12,45 @@ If in a popout window from the dynamic layout, this function will run the flow t
12
12
  **Signature:**
13
13
 
14
14
  ```typescript
15
- tryActivatePopoutMode(): boolean;
15
+ tryActivatePopoutMode(autoloading?: boolean): boolean;
16
16
  ```
17
+
18
+ ## Parameters
19
+
20
+ <table><thead><tr><th>
21
+
22
+ Parameter
23
+
24
+
25
+ </th><th>
26
+
27
+ Type
28
+
29
+
30
+ </th><th>
31
+
32
+ Description
33
+
34
+
35
+ </th></tr></thead>
36
+ <tbody><tr><td>
37
+
38
+ autoloading
39
+
40
+
41
+ </td><td>
42
+
43
+ boolean
44
+
45
+
46
+ </td><td>
47
+
48
+ _(Optional)_ If true, this respects the property. You might want to set this to false and call it manually if you're manually registering components to the layout in order to avoid race conditions.
49
+
50
+
51
+ </td></tr>
52
+ </tbody></table>
53
+
17
54
  **Returns:**
18
55
 
19
56
  boolean
@@ -0,0 +1,16 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-layout](./foundation-layout.md) &gt; [LAYOUT\_POPOUT\_CONTROL\_KEY](./foundation-layout.layout_popout_control_key.md)
4
+
5
+ ## LAYOUT\_POPOUT\_CONTROL\_KEY variable
6
+
7
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
+ >
9
+
10
+ Key to be used for controlling popout behaviour
11
+
12
+ **Signature:**
13
+
14
+ ```typescript
15
+ LAYOUT_POPOUT_CONTROL_KEY = "f-layout-key"
16
+ ```
@@ -0,0 +1,22 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-layout](./foundation-layout.md) &gt; [LayoutPopoutConfig](./foundation-layout.layoutpopoutconfig.md)
4
+
5
+ ## LayoutPopoutConfig type
6
+
7
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
8
+ >
9
+
10
+
11
+ **Signature:**
12
+
13
+ ```typescript
14
+ export type LayoutPopoutConfig = {
15
+ channelName?: string;
16
+ loadAutomatically?: boolean;
17
+ popoutDimension?: {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ };
22
+ ```
@@ -215,6 +215,17 @@ A collection of SVG icons in base64 format.
215
215
  **_(BETA)_** Put this classname on an element which is a DOM parent of the layout, and if the layout goes into popout mode then it will place itself as the only child for the popout container you set.
216
216
 
217
217
 
218
+ </td></tr>
219
+ <tr><td>
220
+
221
+ [LAYOUT\_POPOUT\_CONTROL\_KEY](./foundation-layout.layout_popout_control_key.md)
222
+
223
+
224
+ </td><td>
225
+
226
+ **_(BETA)_** Key to be used for controlling popout behaviour
227
+
228
+
218
229
  </td></tr>
219
230
  <tr><td>
220
231
 
@@ -300,6 +311,17 @@ Factory function for creating component instances in the layout.
300
311
  Definition of a custom button which will be added to all layout items.
301
312
 
302
313
 
314
+ </td></tr>
315
+ <tr><td>
316
+
317
+ [LayoutPopoutConfig](./foundation-layout.layoutpopoutconfig.md)
318
+
319
+
320
+ </td><td>
321
+
322
+ **_(BETA)_**
323
+
324
+
303
325
  </td></tr>
304
326
  <tr><td>
305
327
 
@@ -12,6 +12,9 @@ Versioned layout config objects. `v` is the version and `c` contains the layout
12
12
  export type SerialisedLayout = {
13
13
  v: '1';
14
14
  c: ResolvedLayoutConfig;
15
+ popouts?: {
16
+ [layoutKey: string]: PopoutState;
17
+ };
15
18
  };
16
19
  ```
17
20
 
@@ -6,6 +6,7 @@
6
6
 
7
7
  import type { Container } from '@microsoft/fast-foundation';
8
8
  import { ElementStyles } from '@microsoft/fast-element';
9
+ import { FASTElement } from '@microsoft/fast-element';
9
10
  import { FoundationElement } from '@microsoft/fast-foundation';
10
11
  import { FoundationElementRegistry } from '@microsoft/fast-foundation';
11
12
  import { LayoutConfig } from '@genesis-community/golden-layout';
@@ -60,7 +61,13 @@ export class FoundationLayout extends FoundationElement implements LayoutCompone
60
61
  loadLayout(layout: SerialisedLayout, handleMissingItem?: 'placeholder' | 'error', disableCache?: boolean): void;
61
62
  missingItemPlaceholder: (missingItem: string) => string;
62
63
  // @beta
63
- popoutConfig: string | undefined;
64
+ popoutConfig: LayoutPopoutConfig | undefined;
65
+ // Warning: (ae-forgotten-export) The symbol "FoundationLayoutPopoutController" needs to be exported by the entry point index.d.ts
66
+ //
67
+ // @internal (undocumented)
68
+ popoutController: FoundationLayoutPopoutController;
69
+ // @internal (undocumented)
70
+ popupMode: boolean;
64
71
  registeredItems(): string[];
65
72
  registerItem(registration: string, elementsOrFactory: Element[] | ComponentFactory): string;
66
73
  reloadBuffer: number;
@@ -68,7 +75,7 @@ export class FoundationLayout extends FoundationElement implements LayoutCompone
68
75
  // @internal
69
76
  requestLayoutReload(): void;
70
77
  // @beta
71
- tryActivatePopoutMode(): boolean;
78
+ tryActivatePopoutMode(autoloading?: boolean): boolean;
72
79
  tryLoadLayoutFromLocalStorage(): boolean;
73
80
  // @internal (undocumented)
74
81
  usingDeclerativeAPI: boolean;
@@ -150,6 +157,9 @@ export const LAYOUT_ICONS: {
150
157
  // @beta
151
158
  export const LAYOUT_POPOUT_CONTAINER_CLASS = "f-layout-popout";
152
159
 
160
+ // @beta
161
+ export const LAYOUT_POPOUT_CONTROL_KEY = "f-layout-key";
162
+
153
163
  // @public
154
164
  export interface LayoutComponentWithState<T> {
155
165
  applyState(state: T | null): void;
@@ -164,6 +174,16 @@ export const LayoutEmitEvents: {
164
174
  readonly itemResized: "item-resized";
165
175
  };
166
176
 
177
+ // @beta (undocumented)
178
+ export type LayoutPopoutConfig = {
179
+ channelName?: string;
180
+ loadAutomatically?: boolean;
181
+ popoutDimension?: {
182
+ width: number;
183
+ height: number;
184
+ };
185
+ };
186
+
167
187
  // @public
168
188
  export const LayoutReceiveEvents: {
169
189
  readonly changeTitle: "change-title";
@@ -241,11 +261,18 @@ export type RegistrationConfig = {
241
261
  export type SerialisedLayout = {
242
262
  v: '1';
243
263
  c: ResolvedLayoutConfig;
264
+ popouts?: {
265
+ [layoutKey: string]: PopoutState;
266
+ };
244
267
  };
245
268
 
246
269
  // @public
247
270
  export function unregisterFactory(key: string): boolean;
248
271
 
272
+ // Warnings were encountered during analysis:
273
+ //
274
+ // src/utils/types.ts:36:5 - (ae-forgotten-export) The symbol "PopoutState" needs to be exported by the entry point index.d.ts
275
+
249
276
  // (No @packageDocumentation comment for this package)
250
277
 
251
278
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-layout",
3
3
  "description": "Genesis Foundation UI App Layout",
4
- "version": "14.393.2",
4
+ "version": "14.393.3-FUI-2471.2",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/foundation-layout.d.ts",
@@ -38,20 +38,22 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@genesislcap/foundation-testing": "14.393.2",
42
- "@genesislcap/genx": "14.393.2",
43
- "@genesislcap/rollup-builder": "14.393.2",
44
- "@genesislcap/ts-builder": "14.393.2",
45
- "@genesislcap/uvu-playwright-builder": "14.393.2",
46
- "@genesislcap/vite-builder": "14.393.2",
47
- "@genesislcap/webpack-builder": "14.393.2"
41
+ "@genesislcap/foundation-testing": "14.393.3-FUI-2471.2",
42
+ "@genesislcap/genx": "14.393.3-FUI-2471.2",
43
+ "@genesislcap/rollup-builder": "14.393.3-FUI-2471.2",
44
+ "@genesislcap/ts-builder": "14.393.3-FUI-2471.2",
45
+ "@genesislcap/uvu-playwright-builder": "14.393.3-FUI-2471.2",
46
+ "@genesislcap/vite-builder": "14.393.3-FUI-2471.2",
47
+ "@genesislcap/webpack-builder": "14.393.3-FUI-2471.2"
48
48
  },
49
49
  "dependencies": {
50
50
  "@genesis-community/golden-layout": "^2.11.0",
51
- "@genesislcap/foundation-comms": "14.393.2",
52
- "@genesislcap/foundation-logger": "14.393.2",
53
- "@genesislcap/foundation-ui": "14.393.2",
54
- "@genesislcap/foundation-utils": "14.393.2",
51
+ "@genesislcap/foundation-broadcast-channel": "14.393.3-FUI-2471.2",
52
+ "@genesislcap/foundation-comms": "14.393.3-FUI-2471.2",
53
+ "@genesislcap/foundation-events": "14.393.3-FUI-2471.2",
54
+ "@genesislcap/foundation-logger": "14.393.3-FUI-2471.2",
55
+ "@genesislcap/foundation-ui": "14.393.3-FUI-2471.2",
56
+ "@genesislcap/foundation-utils": "14.393.3-FUI-2471.2",
55
57
  "@microsoft/fast-components": "2.30.6",
56
58
  "@microsoft/fast-element": "1.14.0",
57
59
  "@microsoft/fast-foundation": "2.50.0"
@@ -65,5 +67,5 @@
65
67
  "access": "public"
66
68
  },
67
69
  "customElements": "dist/custom-elements.json",
68
- "gitHead": "2448f444f9684f2fd2209843677ccaa342af1234"
70
+ "gitHead": "8d5276ff6ff9d909b67f0095a7cc2df458d1e8eb"
69
71
  }