@genesislcap/foundation-layout 10.3.1 → 11.3.1
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/README.md +98 -30
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/index.d.ts +0 -1
- package/dist/dts/main/index.d.ts.map +1 -1
- package/dist/dts/main/layout-components.d.ts +1 -1
- package/dist/dts/main/layout-item.d.ts +7 -7
- package/dist/dts/main/layout-item.d.ts.map +1 -1
- package/dist/dts/main/layout-main.d.ts +71 -16
- package/dist/dts/main/layout-main.d.ts.map +1 -1
- package/dist/dts/main/layout-region.d.ts +4 -4
- package/dist/dts/main/layout-region.d.ts.map +1 -1
- package/dist/dts/styles/layout.styles.d.ts +1 -1
- package/dist/dts/utils/constants.d.ts +6 -1
- package/dist/dts/utils/constants.d.ts.map +1 -1
- package/dist/dts/utils/error.d.ts +2 -2
- package/dist/dts/utils/events.d.ts +6 -3
- package/dist/dts/utils/events.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +1 -0
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/dts/utils/logger.d.ts.map +1 -1
- package/dist/dts/utils/types.d.ts +8 -4
- package/dist/dts/utils/types.d.ts.map +1 -1
- package/dist/esm/index.federated.js +0 -1
- package/dist/esm/index.js +1 -2
- package/dist/esm/main/index.js +0 -2
- package/dist/esm/main/layout-components.js +2 -3
- package/dist/esm/main/layout-item.js +3 -4
- package/dist/esm/main/layout-main.js +148 -39
- package/dist/esm/main/layout-region.js +3 -4
- package/dist/esm/styles/constants.js +0 -1
- package/dist/esm/styles/dragging.styles.js +0 -1
- package/dist/esm/styles/index.js +0 -1
- package/dist/esm/styles/layout.styles.js +1 -2
- package/dist/esm/utils/constants.js +6 -2
- package/dist/esm/utils/error.js +2 -3
- package/dist/esm/utils/events.js +5 -3
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/logger.js +0 -1
- package/dist/esm/utils/misc.js +0 -1
- package/dist/esm/utils/templates.js +0 -1
- package/dist/esm/utils/types.js +0 -1
- package/dist/foundation-layout.api.json +180 -73
- package/dist/foundation-layout.d.ts +98 -56
- package/docs/api/foundation-layout.default_reload_buffer.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.additem.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.autosavekey.md +13 -0
- package/docs/api/foundation-layout.foundationlayout.dragging.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.getlayout.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.layoutrequiredregistrations.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.loadlayout.md +4 -6
- package/docs/api/foundation-layout.foundationlayout.md +11 -11
- package/docs/api/foundation-layout.foundationlayout.missingitemplaceholder.md +13 -0
- package/docs/api/foundation-layout.foundationlayout.registereditems.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.registeritem.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.reloadbuffer.md +0 -3
- package/docs/api/foundation-layout.foundationlayout.tryloadlayoutfromlocalstorage.md +27 -0
- package/docs/api/foundation-layout.foundationlayoutcomponents.md +0 -3
- package/docs/api/foundation-layout.foundationlayoutitem.closable.md +0 -3
- package/docs/api/foundation-layout.foundationlayoutitem.md +4 -7
- package/docs/api/foundation-layout.foundationlayoutitem.registration.md +1 -4
- package/docs/api/foundation-layout.foundationlayoutitem.size.md +0 -3
- package/docs/api/foundation-layout.foundationlayoutitem.title.md +0 -3
- package/docs/api/foundation-layout.foundationlayoutregion.md +2 -5
- package/docs/api/foundation-layout.foundationlayoutregion.size.md +0 -3
- package/docs/api/foundation-layout.foundationlayoutregion.type.md +0 -3
- package/docs/api/foundation-layout.layoutemitevents.md +2 -4
- package/docs/api/foundation-layout.layoutreceiveevents.md +0 -3
- package/docs/api/foundation-layout.layoutreceiveeventsdetail.md +0 -3
- package/docs/api/foundation-layout.layoutregiontype.md +0 -3
- package/docs/api/foundation-layout.layoutregistrationerror._constructor_.md +0 -3
- package/docs/api/foundation-layout.layoutregistrationerror.md +1 -4
- package/docs/api/foundation-layout.layoutstyles.md +0 -3
- package/docs/api/foundation-layout.layouttemplate.md +0 -3
- package/docs/api/foundation-layout.layoutusageerror._constructor_.md +0 -3
- package/docs/api/foundation-layout.layoutusageerror.md +1 -4
- package/docs/api/foundation-layout.md +16 -16
- package/docs/api/foundation-layout.placement.md +0 -3
- package/docs/api/foundation-layout.registeredelementconfig.closable.md +0 -3
- package/docs/api/foundation-layout.registeredelementconfig.md +4 -7
- package/docs/api/foundation-layout.registeredelementconfig.registration.md +0 -3
- package/docs/api/foundation-layout.registeredelementconfig.size.md +0 -3
- package/docs/api/foundation-layout.registeredelementconfig.title.md +0 -3
- package/docs/api/foundation-layout.serialisedlayout.md +0 -3
- package/docs/api-report.md +23 -65
- package/docs/img/foundation-layout-example.png +0 -0
- package/jsdom.setup.ts +1 -0
- package/package.json +22 -8
- package/playwright.config.ts +23 -0
- package/test/unit/setupRegisterForTests.ts +30 -0
- package/test/unit/test.ts +1 -0
- package/dist/1.0.0.remoteEntry.js +0 -1
- package/dist/191.191.106ece7a41ded6731029.js +0 -2
- package/dist/191.9a61143c2afb6057ad1bae886d5d1a6e.js.map +0 -1
- package/dist/259.09c601e5288d875caab4df1e2354c0ea.js.map +0 -1
- package/dist/259.259.216fcad43e9a38888e08.js +0 -2
- package/dist/415.415.094780a1a1162c7e5f1c.js +0 -3
- package/dist/415.415.094780a1a1162c7e5f1c.js.LICENSE.txt +0 -4
- package/dist/415.fcfb4f02eaecbfa31fc322639f244245.js.map +0 -1
- package/dist/459.459.6afc33f49546607f9227.js +0 -515
- package/dist/459.57760bcb7fc239af5b5953687ad192ff.js.map +0 -1
- package/dist/623.623.0e7e8f23454ee96ed9c8.js +0 -3
- package/dist/623.623.0e7e8f23454ee96ed9c8.js.LICENSE.txt +0 -4
- package/dist/623.e8f211473f9034c4157d362efb017821.js.map +0 -1
- package/dist/755.718e14af7194fb741f98580b24b2bb8f.js.map +0 -1
- package/dist/755.755.f93ee58c2b836a669ec4.js +0 -2
- package/dist/dashboard.json +0 -1
- package/dist/esm/index.federated.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/main/index.js.map +0 -1
- package/dist/esm/main/layout-components.js.map +0 -1
- package/dist/esm/main/layout-item.js.map +0 -1
- package/dist/esm/main/layout-main.js.map +0 -1
- package/dist/esm/main/layout-region.js.map +0 -1
- package/dist/esm/styles/constants.js.map +0 -1
- package/dist/esm/styles/dragging.styles.js.map +0 -1
- package/dist/esm/styles/index.js.map +0 -1
- package/dist/esm/styles/layout.styles.js.map +0 -1
- package/dist/esm/utils/constants.js.map +0 -1
- package/dist/esm/utils/error.js.map +0 -1
- package/dist/esm/utils/events.js.map +0 -1
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/logger.js.map +0 -1
- package/dist/esm/utils/misc.js.map +0 -1
- package/dist/esm/utils/templates.js.map +0 -1
- package/dist/esm/utils/types.js.map +0 -1
- package/dist/favicon.ico +0 -0
- package/dist/foundationLayout.3cfa4a65fd1f4b6b3ab7671e3356db59.js.map +0 -1
- package/dist/index.ejs +0 -23
- package/dist/index.html +0 -15
- package/dist/info.ejs +0 -13
- package/dist/main.b0ddbf415137dc7a9e92.js +0 -2
- package/dist/main.f141788ee57f3820f1f4f0fc27368847.js.map +0 -1
- package/dist/npm.consola.713.b1e4073e73c71572987a.js +0 -2
- package/dist/npm.consola.a0d3324d3e61dcc430c3029da5f4dcc7.js.map +0 -1
- package/dist/npm.genesis-community.248.9c9900001dbc5ba9c3ed.js +0 -2
- package/dist/npm.genesis-community.2e0cc159dabe113d6fb29bb505c1a0d4.js.map +0 -1
- package/dist/npm.microsoft.127.00f16f24d8da8fd89263.js +0 -1469
- package/dist/npm.microsoft.127.00f16f24d8da8fd89263.js.LICENSE.txt +0 -14
- package/dist/npm.microsoft.be43958facd28231e770c1307660f64d.js.map +0 -1
- package/dist/remoteEntry.js +0 -2
- package/dist/serve.json +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResolvedLayoutConfig } from '@genesis-community/golden-layout';
|
|
2
2
|
import { componentType } from './';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @public
|
|
5
5
|
* Versioned layout config objects. `v` is the version and `c` contains the layout config.
|
|
6
6
|
* @remarks
|
|
7
7
|
* Versioning the layout config in this way allows changes to the config schema while
|
|
@@ -16,7 +16,7 @@ export type SerialisedLayout = {
|
|
|
16
16
|
c: ResolvedLayoutConfig;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* @
|
|
19
|
+
* @public
|
|
20
20
|
* The parameters that can be set on a new item when being added by the {@link FoundationLayout.addItem} API
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
@@ -33,7 +33,7 @@ export interface RegisteredElementConfig {
|
|
|
33
33
|
size?: string;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* @
|
|
36
|
+
* @public
|
|
37
37
|
* Where to add the new item into the layout when using the {@link FoundationLayout.addItem} API
|
|
38
38
|
*/
|
|
39
39
|
export type Placement = {
|
|
@@ -47,7 +47,7 @@ export interface RegistrationConfig {
|
|
|
47
47
|
/** @internal */
|
|
48
48
|
export declare const layoutRegionValue: readonly ["horizontal", "vertical", "tabs"];
|
|
49
49
|
/**
|
|
50
|
-
* @
|
|
50
|
+
* @public
|
|
51
51
|
* Union type describing the three different types of region splits.
|
|
52
52
|
* Set on the `type` attribute on {@link FoundationLayoutRegion}.
|
|
53
53
|
*/
|
|
@@ -60,4 +60,8 @@ export interface LayoutComponent {
|
|
|
60
60
|
cacheElementsAndRegister(config: RegistrationConfig): string;
|
|
61
61
|
requestLayoutReload(): void;
|
|
62
62
|
}
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type AutosavedLayouts = {
|
|
65
|
+
[x: string]: string;
|
|
66
|
+
};
|
|
63
67
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,oBAAoB,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC3C,CAAC;AAEF,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,6CAA8C,CAAC;AAC7E;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhE,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC;IAChC,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAC7D,mBAAmB,IAAI,IAAI,CAAC;CAC7B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,oBAAoB,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;CAC3C,CAAC;AAEF,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,6CAA8C,CAAC;AAC7E;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,gBAAgB;AAChB,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhE,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,CAAC,aAAa,CAAC,EAAE,cAAc,CAAC;IAChC,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAC7D,mBAAmB,IAAI,IAAI,CAAC;CAC7B;AAED,gBAAgB;AAChB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB,CAAC"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/main/index.js
CHANGED
|
@@ -2,5 +2,3 @@ export { FoundationLayoutItem } from './layout-item';
|
|
|
2
2
|
export { FoundationLayoutRegion } from './layout-region';
|
|
3
3
|
export { FoundationLayout, layoutStyles, layoutTemplate } from './layout-main';
|
|
4
4
|
export * from './layout-components';
|
|
5
|
-
export { DEFAULT_RELOAD_BUFFER, LayoutEmitEvents, LayoutReceiveEvents, } from '../utils';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { foundationLayoutItem } from './layout-item';
|
|
1
2
|
import { foundationLayout } from './layout-main';
|
|
2
3
|
import { foundationLayoutRegion } from './layout-region';
|
|
3
|
-
import { foundationLayoutItem } from './layout-item';
|
|
4
4
|
/**
|
|
5
5
|
* Registration object to register the layout with your design system.
|
|
6
6
|
*
|
|
@@ -13,7 +13,7 @@ import { foundationLayoutItem } from './layout-item';
|
|
|
13
13
|
* @example
|
|
14
14
|
* `<zero-layout></zero-layout>` if you are using the layout with the `zero` design-system.
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
16
|
+
* @public
|
|
17
17
|
*/
|
|
18
18
|
export const foundationLayoutComponents = {
|
|
19
19
|
foundationLayout,
|
|
@@ -33,4 +33,3 @@ export const foundationLayoutComponents = {
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=layout-components.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { attr } from '@microsoft/fast-element';
|
|
4
|
-
import { componentType, getParentLayoutComponent, wrapperTemplate, } from '../utils';
|
|
5
4
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
5
|
+
import { componentType, getParentLayoutComponent, wrapperTemplate, } from '../utils';
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
* `FoundationLayoutItem` is a custom element that represents an item in the layout.
|
|
9
9
|
* @remarks
|
|
10
10
|
* This element is used to wrap html elements and configure their layout settings as part of the layout system.
|
|
@@ -17,7 +17,7 @@ export class FoundationLayoutItem extends FoundationElement {
|
|
|
17
17
|
/**
|
|
18
18
|
* Boolean attribute controls whether the window can be closed in the GUI.
|
|
19
19
|
* Defaults to `false`.
|
|
20
|
-
* @
|
|
20
|
+
* @public
|
|
21
21
|
*/
|
|
22
22
|
this.closable = false;
|
|
23
23
|
/** @internal */
|
|
@@ -83,4 +83,3 @@ export const foundationLayoutItem = FoundationLayoutItem.compose({
|
|
|
83
83
|
baseName: 'layout-item',
|
|
84
84
|
template: wrapperTemplate,
|
|
85
85
|
});
|
|
86
|
-
//# sourceMappingURL=layout-item.js.map
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
+
import { GoldenLayout, LayoutConfig, ResolvedLayoutConfig, } from '@genesis-community/golden-layout';
|
|
4
|
+
import { Session } from '@genesislcap/foundation-comms';
|
|
5
|
+
import { UUID } from '@genesislcap/foundation-utils';
|
|
3
6
|
import { html, attr, observable, when, ref } from '@microsoft/fast-element';
|
|
4
7
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
5
|
-
import { logger } from '../utils/logger';
|
|
6
|
-
import { GoldenLayout, LayoutConfig, ResolvedLayoutConfig, } from '@genesis-community/golden-layout';
|
|
7
|
-
import { DEFAULT_RELOAD_BUFFER, LayoutEmitEvents, LayoutReceiveEvents, componentType, } from '../utils/';
|
|
8
|
-
import { LayoutRegistrationError, LayoutUsageError } from '../utils/error';
|
|
9
|
-
import { getMissingArrayItems } from '../utils/';
|
|
10
8
|
import { globalDraggingStyles, glVisualConfig, layoutStyles } from '../styles';
|
|
9
|
+
import { DEFAULT_RELOAD_BUFFER, LayoutEmitEvents, LayoutReceiveEvents, componentType, AUTOSAVE_KEY, } from '../utils/';
|
|
10
|
+
import { getMissingArrayItems } from '../utils/';
|
|
11
|
+
import { LayoutRegistrationError, LayoutUsageError } from '../utils/error';
|
|
12
|
+
import { logger } from '../utils/logger';
|
|
11
13
|
export { layoutStyles } from '../styles';
|
|
12
14
|
/*
|
|
13
15
|
* We only want to apply the global stylesheet required for golden layout
|
|
@@ -16,7 +18,7 @@ export { layoutStyles } from '../styles';
|
|
|
16
18
|
*/
|
|
17
19
|
let appliedGlobalStyles = false;
|
|
18
20
|
/**
|
|
19
|
-
* @
|
|
21
|
+
* @public
|
|
20
22
|
* Top level web component which is used to initialise a custom layout
|
|
21
23
|
* @remarks
|
|
22
24
|
* Can be used in a composition to customise the styles of the layout.
|
|
@@ -31,23 +33,29 @@ export class FoundationLayout extends FoundationElement {
|
|
|
31
33
|
/**
|
|
32
34
|
* Number describing how long to wait in ms before reloading the config when adding items
|
|
33
35
|
* declaratively by the html API. Default 500 (ms).
|
|
34
|
-
* @
|
|
36
|
+
* @public
|
|
35
37
|
*/
|
|
36
38
|
this.reloadBuffer = DEFAULT_RELOAD_BUFFER;
|
|
37
39
|
this.reloadPending = false;
|
|
38
40
|
this.registeredComponents = 0;
|
|
41
|
+
/**
|
|
42
|
+
* Function which is used to generate the placeholder text when a layout is loaded
|
|
43
|
+
* with a missing item.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
this.missingItemPlaceholder = (missingItem) => `"${missingItem}" cannot be loaded as it isn't registered with the layout system`;
|
|
39
47
|
/** @internal */
|
|
40
48
|
this.hasFirstLoaded = false;
|
|
41
49
|
/** @internal */
|
|
42
50
|
this.usingDeclerativeAPI = false;
|
|
43
51
|
/**
|
|
44
|
-
* @
|
|
52
|
+
* @public
|
|
45
53
|
* Set to true when the user is currently dragging the panes inside of the layout
|
|
46
54
|
*/
|
|
47
55
|
this.dragging = false;
|
|
48
56
|
this.onDragStart = this.onDragStart.bind(this);
|
|
49
57
|
this.onDragStop = this.onDragStop.bind(this);
|
|
50
|
-
this.
|
|
58
|
+
this.cacheAndSaveLayout = this.cacheAndSaveLayout.bind(this);
|
|
51
59
|
this.onItemRemoved = this.onItemRemoved.bind(this);
|
|
52
60
|
}
|
|
53
61
|
/** @internal */
|
|
@@ -82,20 +90,28 @@ export class FoundationLayout extends FoundationElement {
|
|
|
82
90
|
/** @internal */
|
|
83
91
|
onDragStop() {
|
|
84
92
|
this.dragging = false;
|
|
93
|
+
this.cacheAndSaveLayout();
|
|
85
94
|
}
|
|
86
95
|
/** @internal */
|
|
87
96
|
onItemAdded() {
|
|
88
97
|
this.$emit(LayoutEmitEvents.itemAdded);
|
|
98
|
+
this.cacheAndSaveLayout();
|
|
89
99
|
}
|
|
90
100
|
/** @internal */
|
|
91
101
|
onItemRemoved() {
|
|
92
102
|
this.$emit(LayoutEmitEvents.itemRemoved);
|
|
103
|
+
this.cacheAndSaveLayout();
|
|
104
|
+
}
|
|
105
|
+
/** @internal */
|
|
106
|
+
onItemResized() {
|
|
107
|
+
this.$emit(LayoutEmitEvents.itemResized);
|
|
108
|
+
this.cacheAndSaveLayout();
|
|
93
109
|
}
|
|
94
110
|
/**
|
|
95
111
|
* JS API, public
|
|
96
112
|
*/
|
|
97
113
|
/**
|
|
98
|
-
* @
|
|
114
|
+
* @public
|
|
99
115
|
* Gets all of the required registration function names for a set of config
|
|
100
116
|
* @remarks
|
|
101
117
|
* You can use this with {@link FoundationLayout.registeredItems | registeredItems} to work out what items you need to register with {@link FoundationLayout.registerItem | registerItem()}
|
|
@@ -118,7 +134,7 @@ export class FoundationLayout extends FoundationElement {
|
|
|
118
134
|
return names.sort();
|
|
119
135
|
}
|
|
120
136
|
/**
|
|
121
|
-
* @
|
|
137
|
+
* @public
|
|
122
138
|
* Gets all of the currently registered names
|
|
123
139
|
* @remarks
|
|
124
140
|
* You can use this with {@link FoundationLayout.layoutRequiredRegistrations | layoutRequiredRegistrations} to work out what items you need to register with {@link FoundationLayout.registerItem | registerItem()}
|
|
@@ -130,7 +146,7 @@ export class FoundationLayout extends FoundationElement {
|
|
|
130
146
|
return this.layout.getRegisteredComponentTypeNames();
|
|
131
147
|
}
|
|
132
148
|
/**
|
|
133
|
-
* @
|
|
149
|
+
* @public
|
|
134
150
|
* Gets a minified string containing the config describing the current layout of the layout object to later restore in {@link FoundationLayout.loadLayout | function}
|
|
135
151
|
* @returns - latest version of {@link SerialisedLayout} describing the layout
|
|
136
152
|
*/
|
|
@@ -138,29 +154,57 @@ export class FoundationLayout extends FoundationElement {
|
|
|
138
154
|
return { v: '1', c: ResolvedLayoutConfig.minifyConfig(this.layout.saveLayout()) };
|
|
139
155
|
}
|
|
140
156
|
/**
|
|
141
|
-
* @
|
|
157
|
+
* Try to load a layout from local storage, or return false. Only required if manually calling {@link FoundationLayout.registerItem}
|
|
158
|
+
* @remarks
|
|
159
|
+
* Attempt to load an autosaved layout from local storage, keyed on the `auto-save-key` attribute.
|
|
160
|
+
* If `auto-save-key` attribute is not set or there is no autosaved layout yet, this will return false. Else, true.
|
|
161
|
+
*
|
|
162
|
+
* This function is automatically called when loading the layout via the declarative API so if you're not registering components via
|
|
163
|
+
* the JavaScript API then you don't need to call this function. If you *are* calling {@link FoundationLayout.registerItem} then you should call this function immediately afterwards.
|
|
164
|
+
*
|
|
165
|
+
* Will load the layout with `handleMissingItem = 'placeholder` so placeholder text will be shown for any missing items.
|
|
166
|
+
* @returns boolean - true if a layout was loaded, false if not
|
|
167
|
+
* @public
|
|
168
|
+
*/
|
|
169
|
+
tryLoadLayoutFromLocalStorage() {
|
|
170
|
+
if (!this.autoSaveKey)
|
|
171
|
+
return false;
|
|
172
|
+
const existingLayouts = JSON.parse(this.session.getLocalStorageItem(AUTOSAVE_KEY) || '{}');
|
|
173
|
+
if (!(this.autoSaveKey in existingLayouts))
|
|
174
|
+
return false;
|
|
175
|
+
const layout = JSON.parse(existingLayouts[this.autoSaveKey]);
|
|
176
|
+
this.loadLayout(layout, 'placeholder');
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* @public
|
|
142
181
|
* Restores a layout described in the config from {@link FoundationLayout.getLayout | getLayout()}
|
|
143
182
|
*
|
|
144
183
|
* @remarks
|
|
145
|
-
* In order to restore a layout you must have registered all of the required panes with the layout system before restoring it. If you are just setting the layout using the declarative API then all of the same components will be registered.
|
|
184
|
+
* In order to restore a layout you must have registered all of the required panes with the layout system before restoring it. If you are just setting the layout using the declarative API then all of the same components will be registered. If you have added any elements using {@link FoundationLayout.registerItem} then you must ensure all of the same items have been added again. To make tracking what items are registered easier it is recommended in this case you explicitly name your registrations using the `id` parameter available on the {@link RegisteredElementConfig} and `foundation-layout-item` APIs. You can use {@link FoundationLayout.layoutRequiredRegistrations} to check which items are registered in a current layout in order to dynamically add any missing items before you can restore the layout
|
|
146
185
|
*
|
|
147
186
|
* @param layout - any version of {@link SerialisedLayout} object describing the layout
|
|
148
|
-
* @
|
|
187
|
+
* @param handleMissingItem - what to do if the layout contains items that are not currently registered with the layout system. Defaults to 'error' which will throw an error. If set to 'placeholder' then any missing items will be replaced with a placeholder element. You can control the text of the placeholder element with {@link FoundationLayout.missingItemPlaceholder}.
|
|
188
|
+
* @throws {@link LayoutUsageError} if you attempt to load a layout with registered items that are not currently registered with the layout system, and handleMissingItem is set to 'error' (default).
|
|
149
189
|
* @throws various errors if the layout string is malformed and cannot be parsed
|
|
150
190
|
*/
|
|
151
|
-
loadLayout(layout) {
|
|
191
|
+
loadLayout(layout, handleMissingItem = 'error') {
|
|
152
192
|
const alreadyRegistered = this.registeredItems();
|
|
153
193
|
const wantedRegistered = FoundationLayout.layoutRequiredRegistrations(layout);
|
|
154
194
|
const missingRegisteredItems = getMissingArrayItems(wantedRegistered, alreadyRegistered);
|
|
155
|
-
if (missingRegisteredItems.length !== 0) {
|
|
195
|
+
if (missingRegisteredItems.length !== 0 && handleMissingItem === 'error') {
|
|
156
196
|
throw new LayoutUsageError(`Trying to load layout with extra components. The component(s) not currently loaded are "${[
|
|
157
197
|
...new Set(missingRegisteredItems),
|
|
158
198
|
]}"`);
|
|
159
199
|
}
|
|
160
|
-
|
|
200
|
+
const layoutConfig = LayoutConfig.fromResolved(ResolvedLayoutConfig.unminifyConfig(layout.c));
|
|
201
|
+
if (missingRegisteredItems.length !== 0 && handleMissingItem === 'placeholder') {
|
|
202
|
+
this.registerPlaceholdersAndSetClosable(layoutConfig, missingRegisteredItems);
|
|
203
|
+
}
|
|
204
|
+
this.loadGLConfigAndSetup(layoutConfig);
|
|
161
205
|
}
|
|
162
206
|
/**
|
|
163
|
-
* @
|
|
207
|
+
* @public
|
|
164
208
|
* Dynamically add a new item to the layout. The user can move the new plane to whenever they want once it has been added.
|
|
165
209
|
* @remarks
|
|
166
210
|
* Adding a new item invokes the registration previously made explicitly via {@link FoundationLayout.registerItem | registerItem()} or implicitly via the html declerative API.
|
|
@@ -189,25 +233,29 @@ export class FoundationLayout extends FoundationElement {
|
|
|
189
233
|
* this new item is the root so set it and return
|
|
190
234
|
*/
|
|
191
235
|
if (typeof this.layoutConfig.root === 'undefined') {
|
|
192
|
-
this.layoutConfig =
|
|
193
|
-
|
|
236
|
+
this.layoutConfig = {
|
|
237
|
+
root: itemConfig,
|
|
238
|
+
};
|
|
239
|
+
this.loadGLConfigAndSetup(this.layoutConfig);
|
|
194
240
|
this.onItemAdded();
|
|
195
241
|
return;
|
|
196
242
|
}
|
|
197
243
|
// Else we add the item relative to existing items
|
|
198
|
-
this.
|
|
244
|
+
this.cacheAndSaveLayout();
|
|
199
245
|
const { area } = placement;
|
|
200
|
-
this.layoutConfig =
|
|
246
|
+
this.layoutConfig = {
|
|
247
|
+
root: {
|
|
201
248
|
type: area === 'top' || area === 'bottom' ? 'column' : 'row',
|
|
202
249
|
content: area === 'right' || area === 'bottom'
|
|
203
250
|
? [this.layoutConfig.root, itemConfig]
|
|
204
251
|
: [itemConfig, this.layoutConfig.root],
|
|
205
|
-
}
|
|
206
|
-
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
this.loadGLConfigAndSetup(this.layoutConfig);
|
|
207
255
|
this.onItemAdded();
|
|
208
256
|
}
|
|
209
257
|
/**
|
|
210
|
-
* @
|
|
258
|
+
* @public
|
|
211
259
|
* Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
|
|
212
260
|
* @remarks
|
|
213
261
|
* You would use this to register elements that you later want to load when using {@link FoundationLayout.loadLayout}.
|
|
@@ -244,11 +292,12 @@ export class FoundationLayout extends FoundationElement {
|
|
|
244
292
|
return;
|
|
245
293
|
this.reloadPending = true;
|
|
246
294
|
setTimeout(() => {
|
|
247
|
-
this.layout.loadLayout(this.layoutConfig);
|
|
248
295
|
this.reloadPending = false;
|
|
296
|
+
this.loadGLConfigAndSetup(this.layoutConfig);
|
|
249
297
|
if (!this.hasFirstLoaded) {
|
|
250
298
|
this.$emit(LayoutEmitEvents.firstLoaded);
|
|
251
299
|
this.hasFirstLoaded = true;
|
|
300
|
+
this.tryLoadLayoutFromLocalStorage();
|
|
252
301
|
}
|
|
253
302
|
}, this.reloadBuffer);
|
|
254
303
|
}
|
|
@@ -265,7 +314,9 @@ export class FoundationLayout extends FoundationElement {
|
|
|
265
314
|
throw new LayoutUsageError('Cannot have multiple layout items as direct descendants of the layout root. You need to put the layout items within a layout region.');
|
|
266
315
|
}
|
|
267
316
|
this.usingDeclerativeAPI = true;
|
|
268
|
-
this.layoutConfig =
|
|
317
|
+
this.layoutConfig = {
|
|
318
|
+
root: item,
|
|
319
|
+
};
|
|
269
320
|
return this.layoutConfig.root;
|
|
270
321
|
}
|
|
271
322
|
/**
|
|
@@ -281,7 +332,6 @@ export class FoundationLayout extends FoundationElement {
|
|
|
281
332
|
if (this.layout.getRegisteredComponentTypeNames().includes(reg)) {
|
|
282
333
|
throw new LayoutRegistrationError(`Cannot register item with already registered name: '${reg}'`);
|
|
283
334
|
}
|
|
284
|
-
const setupEvents = this.setupLayoutReceiveEvents.bind(this);
|
|
285
335
|
/**
|
|
286
336
|
* What we need the registration function to do:
|
|
287
337
|
* "Consume" the registered elements initially, so we don't have duplicate items from the declarative API
|
|
@@ -292,18 +342,16 @@ export class FoundationLayout extends FoundationElement {
|
|
|
292
342
|
* This has the effect of allowing us to create multiple instances of the same registered item, and each
|
|
293
343
|
* created instance is separate allowing it to implement its own serialise and cache of data.
|
|
294
344
|
*/
|
|
295
|
-
const registrationFunction = (
|
|
345
|
+
const registrationFunction = (() => {
|
|
296
346
|
// Use appendChild to consume the elements and save them in the master copy
|
|
297
347
|
const masterCopy = document.createDocumentFragment();
|
|
298
348
|
elements.forEach((e) => masterCopy.appendChild(e));
|
|
299
|
-
let instanceCount = 0;
|
|
300
349
|
const instances = new Map();
|
|
301
350
|
return (container, state) => {
|
|
302
351
|
var _b;
|
|
303
|
-
// If this is a new instance then assign it
|
|
352
|
+
// If this is a new instance then assign it uuid instance
|
|
304
353
|
if (!(state === null || state === void 0 ? void 0 : state['instance'])) {
|
|
305
|
-
|
|
306
|
-
state['instance'] = instanceCount;
|
|
354
|
+
state['instance'] = this.uuid.createId();
|
|
307
355
|
}
|
|
308
356
|
container.state['instance'] = state['instance'];
|
|
309
357
|
container.state['originalTitle'] = (_b = state['originalTitle']) !== null && _b !== void 0 ? _b : container.title;
|
|
@@ -317,7 +365,7 @@ export class FoundationLayout extends FoundationElement {
|
|
|
317
365
|
}
|
|
318
366
|
// get the instance from the map and append it to the container
|
|
319
367
|
instances.get(state['instance']).forEach((e) => container.element.appendChild(e));
|
|
320
|
-
|
|
368
|
+
this.setupLayoutReceiveEvents(container, state);
|
|
321
369
|
};
|
|
322
370
|
})();
|
|
323
371
|
this.layout.registerComponentFactoryFunction(reg, registrationFunction);
|
|
@@ -339,17 +387,79 @@ export class FoundationLayout extends FoundationElement {
|
|
|
339
387
|
}
|
|
340
388
|
/**
|
|
341
389
|
* Saves the stored layout config according to the Golden Layout provider.
|
|
342
|
-
*
|
|
390
|
+
* And caches the layout in local storage if {@link FoundationLayout.autoSaveKey} is set.
|
|
343
391
|
* @internal
|
|
344
392
|
* */
|
|
345
|
-
|
|
393
|
+
cacheAndSaveLayout() {
|
|
346
394
|
this.layoutConfig = LayoutConfig.fromResolved(this.layout.saveLayout());
|
|
395
|
+
if (this.autoSaveKey) {
|
|
396
|
+
const existingLayouts = JSON.parse(this.session.getLocalStorageItem(AUTOSAVE_KEY) || '{}');
|
|
397
|
+
existingLayouts[this.autoSaveKey] = JSON.stringify(this.getLayout());
|
|
398
|
+
this.session.setLocalStorageItem(AUTOSAVE_KEY, JSON.stringify(existingLayouts));
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Used when we are trying to load a layout with missing registrations and we want to add placeholder items
|
|
403
|
+
* @remarks
|
|
404
|
+
* This function will register the items with placeholder text, and set them to be closeable if they were not already
|
|
405
|
+
* As config is passed by reference it is updated directly
|
|
406
|
+
* @param config - The layout config to update
|
|
407
|
+
* @param missingRegisteredItems - The items which were missing from the registrations
|
|
408
|
+
* @internal
|
|
409
|
+
*/
|
|
410
|
+
registerPlaceholdersAndSetClosable(config, missingRegisteredItems) {
|
|
411
|
+
const placeholderElement = document.createElement('p');
|
|
412
|
+
placeholderElement.style.textAlign = 'center';
|
|
413
|
+
placeholderElement.style.position = 'relative';
|
|
414
|
+
placeholderElement.style.top = '50%';
|
|
415
|
+
const recurseSetClosable = (node) => {
|
|
416
|
+
var _b;
|
|
417
|
+
if (node.type === 'component' &&
|
|
418
|
+
missingRegisteredItems.includes(node.componentType.toString())) {
|
|
419
|
+
const nodeName = node.componentType.toString();
|
|
420
|
+
node.isClosable = true;
|
|
421
|
+
const placeholderCopy = placeholderElement.cloneNode();
|
|
422
|
+
placeholderCopy.textContent = this.missingItemPlaceholder(nodeName);
|
|
423
|
+
this.registerItem(nodeName, [placeholderCopy]);
|
|
424
|
+
}
|
|
425
|
+
(_b = node.content) === null || _b === void 0 ? void 0 : _b.forEach(recurseSetClosable);
|
|
426
|
+
};
|
|
427
|
+
recurseSetClosable(config.root);
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Loads the provided config into Golden Layout and does other setup
|
|
431
|
+
* @remarks
|
|
432
|
+
* Loads the config into Golden Layout, and then sets up the event listeners for the layout
|
|
433
|
+
* When loading the layout the visual configuration is loaded
|
|
434
|
+
* Event listeners are added to the drag handles to emulate resizing events
|
|
435
|
+
*
|
|
436
|
+
* **This is the only function which should call this.layout.loadLayout() directly.**
|
|
437
|
+
* @internal
|
|
438
|
+
*/
|
|
439
|
+
loadGLConfigAndSetup(config) {
|
|
440
|
+
this.layout.loadLayout(Object.assign(Object.assign({}, config), glVisualConfig));
|
|
441
|
+
const onItemResized = this.onItemResized.bind(this);
|
|
442
|
+
this.shadowRoot
|
|
443
|
+
.querySelectorAll('div.lm_drag_handle')
|
|
444
|
+
.forEach((h) => h.addEventListener('click', () => onItemResized()));
|
|
347
445
|
}
|
|
348
446
|
}
|
|
349
447
|
_a = componentType;
|
|
350
448
|
__decorate([
|
|
351
449
|
attr({ attribute: 'reload-buffer' })
|
|
352
450
|
], FoundationLayout.prototype, "reloadBuffer", void 0);
|
|
451
|
+
__decorate([
|
|
452
|
+
UUID
|
|
453
|
+
], FoundationLayout.prototype, "uuid", void 0);
|
|
454
|
+
__decorate([
|
|
455
|
+
Session
|
|
456
|
+
], FoundationLayout.prototype, "session", void 0);
|
|
457
|
+
__decorate([
|
|
458
|
+
attr({ attribute: 'auto-save-key' })
|
|
459
|
+
], FoundationLayout.prototype, "autoSaveKey", void 0);
|
|
460
|
+
__decorate([
|
|
461
|
+
observable
|
|
462
|
+
], FoundationLayout.prototype, "missingItemPlaceholder", void 0);
|
|
353
463
|
__decorate([
|
|
354
464
|
observable
|
|
355
465
|
], FoundationLayout.prototype, "hasFirstLoaded", void 0);
|
|
@@ -366,7 +476,7 @@ const loadingTemplate = html `
|
|
|
366
476
|
* `ViewTemplate` which defines the html for {@link FoundationLayout}.
|
|
367
477
|
* @remarks
|
|
368
478
|
* Can be used in a composition to customise the styles of the layout.
|
|
369
|
-
* @
|
|
479
|
+
* @public
|
|
370
480
|
*/
|
|
371
481
|
export const layoutTemplate = html `
|
|
372
482
|
<template>
|
|
@@ -388,4 +498,3 @@ export const foundationLayout = FoundationLayout.compose({
|
|
|
388
498
|
styles: layoutStyles,
|
|
389
499
|
template: layoutTemplate,
|
|
390
500
|
});
|
|
391
|
-
//# sourceMappingURL=layout-main.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { attr } from '@microsoft/fast-element';
|
|
4
|
-
import { logger } from '../utils/logger';
|
|
5
|
-
import { componentType, getParentLayoutComponent, layoutRegionValue, wrapperTemplate, } from '../utils';
|
|
6
4
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
5
|
+
import { componentType, getParentLayoutComponent, layoutRegionValue, wrapperTemplate, } from '../utils';
|
|
6
|
+
import { logger } from '../utils/logger';
|
|
7
7
|
const defaultLayoutType = layoutRegionValue[0];
|
|
8
8
|
const regionConveter = (x) => {
|
|
9
9
|
const t = {
|
|
@@ -14,7 +14,7 @@ const regionConveter = (x) => {
|
|
|
14
14
|
return t[x];
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
* `FoundationLayoutRegion` is a custom element that represents a region in the layout.
|
|
19
19
|
* @remarks
|
|
20
20
|
* This element is used to create a region in the layout. It can be used to create a horizontal or vertical split, or a tabbed region.
|
|
@@ -95,4 +95,3 @@ export const foundationLayoutRegion = FoundationLayoutRegion.compose({
|
|
|
95
95
|
baseName: 'layout-region',
|
|
96
96
|
template: wrapperTemplate,
|
|
97
97
|
});
|
|
98
|
-
//# sourceMappingURL=layout-region.js.map
|
|
@@ -13,4 +13,3 @@ export const maximisSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d
|
|
|
13
13
|
export const minimiseSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMCA0NjRDMCA0NTUuMiA3LjE2NCA0NDggMTYgNDQ4SDQ5NkM1MDQuOCA0NDggNTEyIDQ1NS4yIDUxMiA0NjRDNTEyIDQ3Mi44IDUwNC44IDQ4MCA0OTYgNDgwSDE2QzcuMTY0IDQ4MCAwIDQ3Mi44IDAgNDY0eiIgZmlsbD0iIzg3OWJhNiIvPjwvc3ZnPg==';
|
|
14
14
|
export const closeSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMjAgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNMzE1LjMgNDExLjNjLTYuMjUzIDYuMjUzLTE2LjM3IDYuMjUzLTIyLjYzIDBMMTYwIDI3OC42bC0xMzIuNyAxMzIuN2MtNi4yNTMgNi4yNTMtMTYuMzcgNi4yNTMtMjIuNjMgMGMtNi4yNTMtNi4yNTMtNi4yNTMtMTYuMzcgMC0yMi42M0wxMzcuNCAyNTZMNC42OSAxMjMuM2MtNi4yNTMtNi4yNTMtNi4yNTMtMTYuMzcgMC0yMi42M2M2LjI1My02LjI1MyAxNi4zNy02LjI1MyAyMi42MyAwTDE2MCAyMzMuNGwxMzIuNy0xMzIuN2M2LjI1My02LjI1MyAxNi4zNy02LjI1MyAyMi42MyAwYzYuMjUzIDYuMjUzIDYuMjUzIDE2LjM3IDAgMjIuNjNMMTgyLjYgMjU2bDEzMi43IDEzMi43QzMyMS42IDM5NC45IDMyMS42IDQwNS4xIDMxNS4zIDQxMS4zeiIgZmlsbD0iIzg3OWJhNiIvPjwvc3ZnPg==';
|
|
15
15
|
export const tabDropdownSVG = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLiAtLT48cGF0aCBkPSJNNC4yNTEgMTgxLjFDNy4zOTIgMTc3LjcgMTEuNjkgMTc1LjEgMTYgMTc1LjFjMy44OTEgMCA3Ljc4MSAxLjQwNiAxMC44NiA0LjI1bDE5Ny4xIDE4MS4xbDE5Ny4xLTE4MS4xYzYuNS02IDE2LjY0LTUuNjI1IDIyLjYxIC45MDYyYzYgNi41IDUuNTk0IDE2LjU5LS44OTA2IDIyLjU5bC0yMDggMTkyYy02LjE1NiA1LjY4OC0xNS41NiA1LjY4OC0yMS43MiAwbC0yMDgtMTkyQy0xLjM0MyAxOTcuNy0xLjc0OSAxODcuNiA0LjI1MSAxODEuMXoiIGZpbGw9IiM4NzliYTYiLz48L3N2Zz4=';
|
|
16
|
-
//# sourceMappingURL=constants.js.map
|
package/dist/esm/styles/index.js
CHANGED
|
@@ -90,7 +90,7 @@ const loadingSpinnerStyles = css `
|
|
|
90
90
|
* `ElementStyles` which defines the css for {@link FoundationLayout}.
|
|
91
91
|
* @remarks
|
|
92
92
|
* Can be used in a composition to customise the styles of the layout.
|
|
93
|
-
* @
|
|
93
|
+
* @public
|
|
94
94
|
*/
|
|
95
95
|
export const layoutStyles = css `
|
|
96
96
|
${containerStyles}
|
|
@@ -527,4 +527,3 @@ export const layoutStyles = css `
|
|
|
527
527
|
z-index: 20;
|
|
528
528
|
} /*# sourceMappingURL=goldenlayout-base.css.map */
|
|
529
529
|
`;
|
|
530
|
-
//# sourceMappingURL=layout.styles.js.map
|
|
@@ -8,7 +8,11 @@ export const componentType = Symbol('component-type');
|
|
|
8
8
|
* the layout while the declarative API is loading.
|
|
9
9
|
*
|
|
10
10
|
* During the first load of the layout, a loading spinner will be shown.
|
|
11
|
-
* @
|
|
11
|
+
* @public
|
|
12
12
|
*/
|
|
13
13
|
export const DEFAULT_RELOAD_BUFFER = 500;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Key to cache autosaved layouts in local storage
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export const AUTOSAVE_KEY = 'foundation-layout-autosave';
|
package/dist/esm/utils/error.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @public
|
|
3
3
|
*/
|
|
4
4
|
export class LayoutUsageError extends Error {
|
|
5
5
|
constructor(message) {
|
|
@@ -7,11 +7,10 @@ export class LayoutUsageError extends Error {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* @
|
|
10
|
+
* @public
|
|
11
11
|
*/
|
|
12
12
|
export class LayoutRegistrationError extends Error {
|
|
13
13
|
constructor(message) {
|
|
14
14
|
super(message);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=error.js.map
|
package/dist/esm/utils/events.js
CHANGED
|
@@ -7,20 +7,22 @@
|
|
|
7
7
|
* 'itemAdded' - emitted when an item is added to the layout'
|
|
8
8
|
* <br/>
|
|
9
9
|
* 'itemRemoved' - emitted when an item is removed from the layout'
|
|
10
|
-
*
|
|
10
|
+
* <br/>
|
|
11
|
+
* 'itemResized' - emitted when the user drags the divider to resize elements
|
|
12
|
+
* @public
|
|
11
13
|
*/
|
|
12
14
|
export const LayoutEmitEvents = {
|
|
13
15
|
firstLoaded: 'first-loaded',
|
|
14
16
|
itemAdded: 'item-added',
|
|
15
17
|
itemRemoved: 'item-removed',
|
|
18
|
+
itemResized: 'item-resized',
|
|
16
19
|
};
|
|
17
20
|
/**
|
|
18
21
|
* Defines events that the layout system listens for
|
|
19
22
|
*
|
|
20
23
|
* 'changeTitle' - emit this from a contained item to update the title of the window that contains it.
|
|
21
|
-
* @
|
|
24
|
+
* @public
|
|
22
25
|
*/
|
|
23
26
|
export const LayoutReceiveEvents = {
|
|
24
27
|
changeTitle: 'change-title',
|
|
25
28
|
};
|
|
26
|
-
//# sourceMappingURL=events.js.map
|
package/dist/esm/utils/index.js
CHANGED
package/dist/esm/utils/logger.js
CHANGED
package/dist/esm/utils/misc.js
CHANGED
package/dist/esm/utils/types.js
CHANGED