@genesislcap/foundation-layout 14.367.0 → 14.367.1-FUI-2341-3.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 +245 -106
  2. package/dist/dts/index.d.ts +2 -1
  3. package/dist/dts/index.d.ts.map +1 -1
  4. package/dist/dts/main/layout-item.d.ts +20 -0
  5. package/dist/dts/main/layout-item.d.ts.map +1 -1
  6. package/dist/dts/main/layout-main.d.ts +36 -8
  7. package/dist/dts/main/layout-main.d.ts.map +1 -1
  8. package/dist/dts/utils/factory-registry.d.ts +64 -0
  9. package/dist/dts/utils/factory-registry.d.ts.map +1 -0
  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/types.d.ts +44 -3
  13. package/dist/dts/utils/types.d.ts.map +1 -1
  14. package/dist/esm/index.js +1 -0
  15. package/dist/esm/main/layout-item.js +26 -4
  16. package/dist/esm/main/layout-main.js +145 -46
  17. package/dist/esm/utils/factory-registry.js +89 -0
  18. package/dist/esm/utils/index.js +1 -0
  19. package/dist/foundation-layout.api.json +206 -9
  20. package/dist/foundation-layout.d.ts +157 -9
  21. package/docs/FRAMEWORK_COMPONENTS.md +568 -0
  22. package/docs/api/foundation-layout.componentfactory.md +46 -0
  23. package/docs/api/foundation-layout.foundationlayout.md +2 -2
  24. package/docs/api/foundation-layout.foundationlayout.registeritem.md +31 -7
  25. package/docs/api/foundation-layout.foundationlayoutitem.md +2 -0
  26. package/docs/api/foundation-layout.foundationlayoutitem.registration.md +18 -0
  27. package/docs/api/foundation-layout.getfactory.md +56 -0
  28. package/docs/api/foundation-layout.md +59 -0
  29. package/docs/api/foundation-layout.registerfactory.md +95 -0
  30. package/docs/api/foundation-layout.unregisterfactory.md +63 -0
  31. package/docs/api-report.md.api.md +20 -7
  32. package/package.json +12 -12
@@ -23,6 +23,14 @@
23
23
  "module": "./styles"
24
24
  }
25
25
  },
26
+ {
27
+ "kind": "js",
28
+ "name": "ComponentFactory",
29
+ "declaration": {
30
+ "name": "ComponentFactory",
31
+ "module": "./utils"
32
+ }
33
+ },
26
34
  {
27
35
  "kind": "js",
28
36
  "name": "CustomButton",
@@ -134,123 +142,29 @@
134
142
  "name": "LAYOUT_POPOUT_CONTAINER_CLASS",
135
143
  "module": "./utils"
136
144
  }
137
- }
138
- ]
139
- },
140
- {
141
- "kind": "javascript-module",
142
- "path": "src/styles/constants.ts",
143
- "declarations": [
144
- {
145
- "kind": "variable",
146
- "name": "glVisualConfig",
147
- "type": {
148
- "text": "Omit<LayoutConfig, 'root'>"
149
- },
150
- "default": "{\n dimensions: {\n headerHeight: 38,\n borderWidth: 12,\n },\n header: {\n maximise: 'maximise',\n minimise: 'minimise',\n popout: false,\n },\n}"
151
145
  },
152
- {
153
- "kind": "variable",
154
- "name": "LAYOUT_ICONS",
155
- "type": {
156
- "text": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n popoutSVG,\n}"
157
- },
158
- "default": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n popoutSVG,\n}",
159
- "description": "A collection of SVG icons in base64 format.",
160
- "privacy": "public"
161
- }
162
- ],
163
- "exports": [
164
146
  {
165
147
  "kind": "js",
166
- "name": "glVisualConfig",
148
+ "name": "registerFactory",
167
149
  "declaration": {
168
- "name": "glVisualConfig",
169
- "module": "src/styles/constants.ts"
150
+ "name": "registerFactory",
151
+ "module": "./utils/factory-registry"
170
152
  }
171
153
  },
172
154
  {
173
155
  "kind": "js",
174
- "name": "LAYOUT_ICONS",
175
- "declaration": {
176
- "name": "LAYOUT_ICONS",
177
- "module": "src/styles/constants.ts"
178
- }
179
- }
180
- ]
181
- },
182
- {
183
- "kind": "javascript-module",
184
- "path": "src/styles/dragging.styles.ts",
185
- "declarations": [
186
- {
187
- "kind": "variable",
188
- "name": "globalDraggingStyles",
189
- "default": "`\n .lm_dragProxy .lm_content {\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);\n }\n .lm_dropTargetIndicator {\n outline: 1px dashed #cccccc;\n transition: all 200ms ease;\n }\n .lm_dropTargetIndicator .lm_inner {\n background: var(${neutralFillStealthRest.cssCustomProperty});\n opacity: 0.2;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_dragProxy {\n cursor: move;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_title {\n color: white;\n padding-left: 10px;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n`",
190
- "description": "This is defined as a string rather than a css template\nbecause it is applied to a CSSStyleSheet object rather than\nused as a FAST template"
191
- }
192
- ],
193
- "exports": [
194
- {
195
- "kind": "js",
196
- "name": "globalDraggingStyles",
156
+ "name": "getFactory",
197
157
  "declaration": {
198
- "name": "globalDraggingStyles",
199
- "module": "src/styles/dragging.styles.ts"
200
- }
201
- }
202
- ]
203
- },
204
- {
205
- "kind": "javascript-module",
206
- "path": "src/styles/index.ts",
207
- "declarations": [],
208
- "exports": [
209
- {
210
- "kind": "js",
211
- "name": "*",
212
- "declaration": {
213
- "name": "*",
214
- "package": "./constants"
158
+ "name": "getFactory",
159
+ "module": "./utils/factory-registry"
215
160
  }
216
161
  },
217
162
  {
218
163
  "kind": "js",
219
- "name": "*",
164
+ "name": "unregisterFactory",
220
165
  "declaration": {
221
- "name": "*",
222
- "package": "./dragging.styles"
223
- }
224
- },
225
- {
226
- "kind": "js",
227
- "name": "*",
228
- "declaration": {
229
- "name": "*",
230
- "package": "./layout.styles"
231
- }
232
- }
233
- ]
234
- },
235
- {
236
- "kind": "javascript-module",
237
- "path": "src/styles/layout.styles.ts",
238
- "declarations": [
239
- {
240
- "kind": "variable",
241
- "name": "layoutStyles",
242
- "default": "css`\n ${containerStyles}\n ${loadingSpinnerStyles}\n\n .lm_goldenlayout {\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n }\n\n .lm_stack.lm_item {\n background-color: var(--neutral-layer-3);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n }\n .lm_maximised .lm_header {\n background-color: var(--neutral-layer-3);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n position: unset;\n }\n\n .lm_maximised .lm_header .lm_tabs {\n z-index: 3;\n }\n\n .lm_content {\n background-color: var(--neutral-layer-card-container);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n box-sizing: border-box;\n color: var(--neutral-foreground-rest);\n }\n\n .lm_header .lm_tabs {\n padding: 0 16px;\n }\n\n .lm_stack > .lm_items {\n box-shadow: 0px -1px 15px rgba(0, 0, 0, 0.15);\n }\n\n .lm_header .lm_tab.lm_active.lm_focused {\n background-color: var(--neutral-layer-card-container);\n }\n .lm_header .lm_tab.lm_active {\n background-color: var(--neutral-layer-card-container);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n border-bottom: 0;\n color: var(--accent-foreground-rest);\n }\n\n .lm_header .lm_tab {\n align-items: center;\n background-color: var(--neutral-layer-4);\n border: 0;\n border-bottom-color: transparent;\n border-bottom: 0px solid;\n border-color: var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px) calc(var(--control-corner-radius) * 1.5px) 0 0;\n color: var(--accent-foreground-rest);\n display: flex;\n font-family: inherit;\n font-size: 13px;\n font-weight: 400;\n height: 30px;\n margin-right: 2px;\n margin-top: 3px;\n padding: 2px 16px;\n }\n\n .lm_header .lm_tab:not(.lm_active):hover {\n background-color: var(--neutral-layer-card-container);\n color: var(--accent-foreground-rest);\n }\n\n .lm_header .lm_controls {\n top: 4px;\n display: flex;\n }\n .lm_header .lm_controls > * {\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px;\n background-color: color-mix(in srgb, var(--neutral-fill-strong-rest), transparent 90%);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n margin-right: 4px;\n top: 3px;\n opacity: 1;\n }\n .lm_header .lm_controls > *:hover {\n background-color: color-mix(in srgb, var(--neutral-fill-strong-hover), transparent 75%);\n cursor: pointer;\n }\n\n .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.maximiseSVG}');\n }\n .lm_maximised .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.minimiseSVG}');\n }\n .lm_controls .lm_close {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n }\n .lm_header .lm_tab .lm_close_tab {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n background-size: 10px;\n background-repeat: no-repeat;\n margin-left: 12px;\n position: relative;\n top: 0;\n right: 0;\n }\n\n .lm_header .lm_tab.lm_active {\n padding: 4px 25px 3px 10px;\n }\n\n .lm_header .lm_tab:not(.lm_active) .lm_title {\n color: var(--neutral-foreground-hint);\n }\n\n .lm_header .lm_controls .lm_tabdropdown::before {\n content: none;\n }\n .lm_header .lm_controls .lm_tabdropdown {\n background-image: url('${LAYOUT_ICONS.tabDropdownSVG}');\n }\n .lm_header .lm_tabdropdown_list {\n top: 38px;\n right: 108px;\n background-color: var(--neutral-layer-3);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.35);\n }\n .lm_header .lm_tabdropdown_list > .lm_tab {\n box-shadow: none;\n padding: 0 16px;\n white-space: nowrap;\n background-color: transparent;\n color: var(--neutral-foreground-rest);\n height: 36px;\n border-radius: 0;\n overflow: visible;\n text-overflow: normal;\n }\n .lm_header .lm_tabdropdown_list > .lm_tab:last-child {\n border-bottom: 0;\n }\n\n /* gl base styles start */\n .lm_root {\n position: relative;\n }\n .lm_row > .lm_item {\n float: left;\n }\n .lm_content {\n overflow: hidden;\n position: relative;\n }\n .lm_dragging,\n .lm_dragging * {\n cursor: move !important;\n user-select: none;\n }\n .lm_maximised {\n left: 0;\n padding: 1px;\n position: absolute;\n top: 0;\n z-index: 40;\n }\n .lm_maximise_placeholder {\n display: none;\n }\n .lm_splitter {\n position: relative;\n z-index: 20;\n }\n .lm_splitter:hover,\n .lm_splitter.lm_dragging {\n background: var(--accent-fill-rest);\n border-radius: calc(var(--control-corner-radius) * 4px);\n }\n .lm_splitter.lm_vertical .lm_drag_handle {\n width: 100%;\n height: 15px;\n position: absolute;\n top: -5px;\n cursor: ns-resize !important;\n }\n .lm_splitter.lm_horizontal {\n float: left;\n height: 100%;\n }\n .lm_splitter.lm_horizontal .lm_drag_handle {\n width: 15px;\n height: 100%;\n position: absolute;\n left: -5px;\n cursor: ew-resize !important;\n }\n .lm_header {\n overflow: visible;\n position: relative;\n }\n .lm_header [class^='lm_'] {\n box-sizing: content-box !important;\n }\n .lm_header .lm_controls {\n position: absolute;\n right: 3px;\n }\n .lm_header .lm_controls > li {\n cursor: pointer;\n float: left;\n width: 18px;\n height: 18px;\n text-align: center;\n }\n .lm_header ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n .lm_header .lm_tabs {\n position: absolute;\n }\n .lm_header .lm_tab {\n cursor: pointer;\n float: left;\n margin-top: 1px;\n padding: 3px 25px 3px 10px;\n position: relative;\n }\n .lm_header .lm_tab i {\n width: 2px;\n height: 19px;\n position: absolute;\n }\n .lm_header .lm_tab i.lm_left {\n top: 0;\n left: -2px;\n }\n .lm_header .lm_tab i.lm_right {\n top: 0;\n right: -2px;\n }\n .lm_header .lm_tab .lm_title {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n }\n .lm_header .lm_tab .lm_title:only-child {\n padding-left: 10px;\n }\n .lm_header .lm_tab .lm_close_tab {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 11px;\n right: 0;\n text-align: center;\n }\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n height: 100%;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header,\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_left .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items,\n .lm_stack.lm_left .lm_items,\n .lm_stack.lm_right .lm_items {.lm_header .lm_tab.lm_active\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab,\n .lm_stack.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab,\n .lm_stack.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_drop_tab_placeholder {\n float: left;\n width: 100px;\n height: 10px;\n visibility: hidden;\n }\n .lm_header .lm_tabdropdown_list {\n position: absolute;\n top: 20px;\n right: 0;\n z-index: 5;\n overflow: hidden;\n }\n .lm_header .lm_tabdropdown_list .lm_tab {\n clear: both;\n padding-right: 10px;\n margin: 0;\n }\n .lm_header .lm_tabdropdown_list .lm_tab .lm_title {\n width: 100px;\n }\n .lm_header .lm_tabdropdown_list .lm_close_tab {\n display: none !important;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n box-shadow: none;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n .lm_popin {\n width: 20px;\n height: 20px;\n position: absolute;\n bottom: 0;\n right: 0;\n z-index: 9999;\n }\n .lm_popin > * {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n .lm_popin > .lm_bg {\n z-index: 10;\n }\n .lm_popin > .lm_icon {\n z-index: 20;\n } /*# sourceMappingURL=goldenlayout-base.css.map */\n`",
243
- "description": "`ElementStyles` which defines the css for FoundationLayout.",
244
- "privacy": "public"
245
- }
246
- ],
247
- "exports": [
248
- {
249
- "kind": "js",
250
- "name": "layoutStyles",
251
- "declaration": {
252
- "name": "layoutStyles",
253
- "module": "src/styles/layout.styles.ts"
166
+ "name": "unregisterFactory",
167
+ "module": "./utils/factory-registry"
254
168
  }
255
169
  }
256
170
  ]
@@ -868,11 +782,11 @@
868
782
  "description": "string of the registration ID"
869
783
  },
870
784
  {
871
- "name": "elements",
785
+ "name": "elementsOrFactory",
872
786
  "type": {
873
- "text": "Element[]"
787
+ "text": "Element[] | ComponentFactory"
874
788
  },
875
- "description": "Elements[] containing the reference to the elements to register for later usage"
789
+ "description": "Either Elements[] containing the reference to the elements to register, or a ComponentFactory function"
876
790
  }
877
791
  ],
878
792
  "privacy": "public"
@@ -1404,6 +1318,105 @@
1404
1318
  }
1405
1319
  ]
1406
1320
  },
1321
+ {
1322
+ "kind": "javascript-module",
1323
+ "path": "src/utils/factory-registry.ts",
1324
+ "declarations": [
1325
+ {
1326
+ "kind": "function",
1327
+ "name": "registerFactory",
1328
+ "return": {
1329
+ "type": {
1330
+ "text": "void"
1331
+ }
1332
+ },
1333
+ "parameters": [
1334
+ {
1335
+ "name": "key",
1336
+ "type": {
1337
+ "text": "string"
1338
+ },
1339
+ "description": "Unique identifier for the factory. Should be descriptive and unique across the application."
1340
+ },
1341
+ {
1342
+ "name": "factory",
1343
+ "type": {
1344
+ "text": "ComponentFactory"
1345
+ },
1346
+ "description": "The factory function that creates the component."
1347
+ }
1348
+ ],
1349
+ "description": "Registers a factory function with a unique key.\nThis allows framework components to be used in the declarative layout API\nwithout needing to pass function references through HTML attributes.",
1350
+ "privacy": "public"
1351
+ },
1352
+ {
1353
+ "kind": "function",
1354
+ "name": "getFactory",
1355
+ "return": {
1356
+ "type": {
1357
+ "text": ""
1358
+ }
1359
+ },
1360
+ "parameters": [
1361
+ {
1362
+ "name": "key",
1363
+ "type": {
1364
+ "text": "string"
1365
+ },
1366
+ "description": "The unique identifier for the factory."
1367
+ }
1368
+ ],
1369
+ "description": "Retrieves a factory function by its key.",
1370
+ "privacy": "public"
1371
+ },
1372
+ {
1373
+ "kind": "function",
1374
+ "name": "unregisterFactory",
1375
+ "return": {
1376
+ "type": {
1377
+ "text": ""
1378
+ }
1379
+ },
1380
+ "parameters": [
1381
+ {
1382
+ "name": "key",
1383
+ "type": {
1384
+ "text": "string"
1385
+ },
1386
+ "description": "The unique identifier for the factory to remove."
1387
+ }
1388
+ ],
1389
+ "description": "Removes a factory from the registry.\nThis is useful for cleanup when a component is unmounted or no longer needed.",
1390
+ "privacy": "public"
1391
+ }
1392
+ ],
1393
+ "exports": [
1394
+ {
1395
+ "kind": "js",
1396
+ "name": "registerFactory",
1397
+ "declaration": {
1398
+ "name": "registerFactory",
1399
+ "module": "src/utils/factory-registry.ts"
1400
+ }
1401
+ },
1402
+ {
1403
+ "kind": "js",
1404
+ "name": "getFactory",
1405
+ "declaration": {
1406
+ "name": "getFactory",
1407
+ "module": "src/utils/factory-registry.ts"
1408
+ }
1409
+ },
1410
+ {
1411
+ "kind": "js",
1412
+ "name": "unregisterFactory",
1413
+ "declaration": {
1414
+ "name": "unregisterFactory",
1415
+ "module": "src/utils/factory-registry.ts"
1416
+ }
1417
+ }
1418
+ ]
1419
+ },
1407
1420
  {
1408
1421
  "kind": "javascript-module",
1409
1422
  "path": "src/utils/index.ts",
@@ -1433,6 +1446,14 @@
1433
1446
  "package": "./events"
1434
1447
  }
1435
1448
  },
1449
+ {
1450
+ "kind": "js",
1451
+ "name": "*",
1452
+ "declaration": {
1453
+ "name": "*",
1454
+ "package": "./factory-registry"
1455
+ }
1456
+ },
1436
1457
  {
1437
1458
  "kind": "js",
1438
1459
  "name": "*",
@@ -1504,6 +1525,124 @@
1504
1525
  "path": "src/utils/types.ts",
1505
1526
  "declarations": [],
1506
1527
  "exports": []
1528
+ },
1529
+ {
1530
+ "kind": "javascript-module",
1531
+ "path": "src/styles/constants.ts",
1532
+ "declarations": [
1533
+ {
1534
+ "kind": "variable",
1535
+ "name": "glVisualConfig",
1536
+ "type": {
1537
+ "text": "Omit<LayoutConfig, 'root'>"
1538
+ },
1539
+ "default": "{\n dimensions: {\n headerHeight: 38,\n borderWidth: 12,\n },\n header: {\n maximise: 'maximise',\n minimise: 'minimise',\n popout: false,\n },\n}"
1540
+ },
1541
+ {
1542
+ "kind": "variable",
1543
+ "name": "LAYOUT_ICONS",
1544
+ "type": {
1545
+ "text": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n popoutSVG,\n}"
1546
+ },
1547
+ "default": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n popoutSVG,\n}",
1548
+ "description": "A collection of SVG icons in base64 format.",
1549
+ "privacy": "public"
1550
+ }
1551
+ ],
1552
+ "exports": [
1553
+ {
1554
+ "kind": "js",
1555
+ "name": "glVisualConfig",
1556
+ "declaration": {
1557
+ "name": "glVisualConfig",
1558
+ "module": "src/styles/constants.ts"
1559
+ }
1560
+ },
1561
+ {
1562
+ "kind": "js",
1563
+ "name": "LAYOUT_ICONS",
1564
+ "declaration": {
1565
+ "name": "LAYOUT_ICONS",
1566
+ "module": "src/styles/constants.ts"
1567
+ }
1568
+ }
1569
+ ]
1570
+ },
1571
+ {
1572
+ "kind": "javascript-module",
1573
+ "path": "src/styles/dragging.styles.ts",
1574
+ "declarations": [
1575
+ {
1576
+ "kind": "variable",
1577
+ "name": "globalDraggingStyles",
1578
+ "default": "`\n .lm_dragProxy .lm_content {\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);\n }\n .lm_dropTargetIndicator {\n outline: 1px dashed #cccccc;\n transition: all 200ms ease;\n }\n .lm_dropTargetIndicator .lm_inner {\n background: var(${neutralFillStealthRest.cssCustomProperty});\n opacity: 0.2;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_dragProxy {\n cursor: move;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_title {\n color: white;\n padding-left: 10px;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n`",
1579
+ "description": "This is defined as a string rather than a css template\nbecause it is applied to a CSSStyleSheet object rather than\nused as a FAST template"
1580
+ }
1581
+ ],
1582
+ "exports": [
1583
+ {
1584
+ "kind": "js",
1585
+ "name": "globalDraggingStyles",
1586
+ "declaration": {
1587
+ "name": "globalDraggingStyles",
1588
+ "module": "src/styles/dragging.styles.ts"
1589
+ }
1590
+ }
1591
+ ]
1592
+ },
1593
+ {
1594
+ "kind": "javascript-module",
1595
+ "path": "src/styles/index.ts",
1596
+ "declarations": [],
1597
+ "exports": [
1598
+ {
1599
+ "kind": "js",
1600
+ "name": "*",
1601
+ "declaration": {
1602
+ "name": "*",
1603
+ "package": "./constants"
1604
+ }
1605
+ },
1606
+ {
1607
+ "kind": "js",
1608
+ "name": "*",
1609
+ "declaration": {
1610
+ "name": "*",
1611
+ "package": "./dragging.styles"
1612
+ }
1613
+ },
1614
+ {
1615
+ "kind": "js",
1616
+ "name": "*",
1617
+ "declaration": {
1618
+ "name": "*",
1619
+ "package": "./layout.styles"
1620
+ }
1621
+ }
1622
+ ]
1623
+ },
1624
+ {
1625
+ "kind": "javascript-module",
1626
+ "path": "src/styles/layout.styles.ts",
1627
+ "declarations": [
1628
+ {
1629
+ "kind": "variable",
1630
+ "name": "layoutStyles",
1631
+ "default": "css`\n ${containerStyles}\n ${loadingSpinnerStyles}\n\n .lm_goldenlayout {\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n }\n\n .lm_stack.lm_item {\n background-color: var(--neutral-layer-3);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n }\n .lm_maximised .lm_header {\n background-color: var(--neutral-layer-3);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n position: unset;\n }\n\n .lm_maximised .lm_header .lm_tabs {\n z-index: 3;\n }\n\n .lm_content {\n background-color: var(--neutral-layer-card-container);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n box-sizing: border-box;\n color: var(--neutral-foreground-rest);\n }\n\n .lm_header .lm_tabs {\n padding: 0 16px;\n }\n\n .lm_stack > .lm_items {\n box-shadow: 0px -1px 15px rgba(0, 0, 0, 0.15);\n }\n\n .lm_header .lm_tab.lm_active.lm_focused {\n background-color: var(--neutral-layer-card-container);\n }\n .lm_header .lm_tab.lm_active {\n background-color: var(--neutral-layer-card-container);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n border-bottom: 0;\n color: var(--accent-foreground-rest);\n }\n\n .lm_header .lm_tab {\n align-items: center;\n background-color: var(--neutral-layer-4);\n border: 0;\n border-bottom-color: transparent;\n border-bottom: 0px solid;\n border-color: var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px) calc(var(--control-corner-radius) * 1.5px) 0 0;\n color: var(--accent-foreground-rest);\n display: flex;\n font-family: inherit;\n font-size: 13px;\n font-weight: 400;\n height: 30px;\n margin-right: 2px;\n margin-top: 3px;\n padding: 2px 16px;\n }\n\n .lm_header .lm_tab:not(.lm_active):hover {\n background-color: var(--neutral-layer-card-container);\n color: var(--accent-foreground-rest);\n }\n\n .lm_header .lm_controls {\n top: 4px;\n display: flex;\n }\n .lm_header .lm_controls > * {\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px;\n background-color: color-mix(in srgb, var(--neutral-fill-strong-rest), transparent 90%);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n margin-right: 4px;\n top: 3px;\n opacity: 1;\n }\n .lm_header .lm_controls > *:hover {\n background-color: color-mix(in srgb, var(--neutral-fill-strong-hover), transparent 75%);\n cursor: pointer;\n }\n\n .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.maximiseSVG}');\n }\n .lm_maximised .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.minimiseSVG}');\n }\n .lm_controls .lm_close {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n }\n .lm_header .lm_tab .lm_close_tab {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n background-size: 10px;\n background-repeat: no-repeat;\n margin-left: 12px;\n position: relative;\n top: 0;\n right: 0;\n }\n\n .lm_header .lm_tab.lm_active {\n padding: 4px 25px 3px 10px;\n }\n\n .lm_header .lm_tab:not(.lm_active) .lm_title {\n color: var(--neutral-foreground-hint);\n }\n\n .lm_header .lm_controls .lm_tabdropdown::before {\n content: none;\n }\n .lm_header .lm_controls .lm_tabdropdown {\n background-image: url('${LAYOUT_ICONS.tabDropdownSVG}');\n }\n .lm_header .lm_tabdropdown_list {\n top: 38px;\n right: 108px;\n background-color: var(--neutral-layer-3);\n border: 1px solid;\n border-color: var(--neutral-stroke-rest);\n border-radius: calc(var(--control-corner-radius) * 1.5px);\n box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.35);\n }\n .lm_header .lm_tabdropdown_list > .lm_tab {\n box-shadow: none;\n padding: 0 16px;\n white-space: nowrap;\n background-color: transparent;\n color: var(--neutral-foreground-rest);\n height: 36px;\n border-radius: 0;\n overflow: visible;\n text-overflow: normal;\n }\n .lm_header .lm_tabdropdown_list > .lm_tab:last-child {\n border-bottom: 0;\n }\n\n /* gl base styles start */\n .lm_root {\n position: relative;\n }\n .lm_row > .lm_item {\n float: left;\n }\n .lm_content {\n overflow: hidden;\n position: relative;\n }\n .lm_dragging,\n .lm_dragging * {\n cursor: move !important;\n user-select: none;\n }\n .lm_maximised {\n left: 0;\n padding: 1px;\n position: absolute;\n top: 0;\n z-index: 40;\n }\n .lm_maximise_placeholder {\n display: none;\n }\n .lm_splitter {\n position: relative;\n z-index: 20;\n }\n .lm_splitter:hover,\n .lm_splitter.lm_dragging {\n background: var(--accent-fill-rest);\n border-radius: calc(var(--control-corner-radius) * 4px);\n }\n .lm_splitter.lm_vertical .lm_drag_handle {\n width: 100%;\n height: 15px;\n position: absolute;\n top: -5px;\n cursor: ns-resize !important;\n }\n .lm_splitter.lm_horizontal {\n float: left;\n height: 100%;\n }\n .lm_splitter.lm_horizontal .lm_drag_handle {\n width: 15px;\n height: 100%;\n position: absolute;\n left: -5px;\n cursor: ew-resize !important;\n }\n .lm_header {\n overflow: visible;\n position: relative;\n }\n .lm_header [class^='lm_'] {\n box-sizing: content-box !important;\n }\n .lm_header .lm_controls {\n position: absolute;\n right: 3px;\n }\n .lm_header .lm_controls > li {\n cursor: pointer;\n float: left;\n width: 18px;\n height: 18px;\n text-align: center;\n }\n .lm_header ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n .lm_header .lm_tabs {\n position: absolute;\n }\n .lm_header .lm_tab {\n cursor: pointer;\n float: left;\n margin-top: 1px;\n padding: 3px 25px 3px 10px;\n position: relative;\n }\n .lm_header .lm_tab i {\n width: 2px;\n height: 19px;\n position: absolute;\n }\n .lm_header .lm_tab i.lm_left {\n top: 0;\n left: -2px;\n }\n .lm_header .lm_tab i.lm_right {\n top: 0;\n right: -2px;\n }\n .lm_header .lm_tab .lm_title {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n user-select: none;\n }\n .lm_header .lm_tab .lm_title:only-child {\n padding-left: 10px;\n }\n .lm_header .lm_tab .lm_close_tab {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 11px;\n right: 0;\n text-align: center;\n }\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n height: 100%;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header,\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_left .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items,\n .lm_stack.lm_left .lm_items,\n .lm_stack.lm_right .lm_items {.lm_header .lm_tab.lm_active\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab,\n .lm_stack.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab,\n .lm_stack.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_drop_tab_placeholder {\n float: left;\n width: 100px;\n height: 10px;\n visibility: hidden;\n }\n .lm_header .lm_tabdropdown_list {\n position: absolute;\n top: 20px;\n right: 0;\n z-index: 5;\n overflow: hidden;\n }\n .lm_header .lm_tabdropdown_list .lm_tab {\n clear: both;\n padding-right: 10px;\n margin: 0;\n }\n .lm_header .lm_tabdropdown_list .lm_tab .lm_title {\n width: 100px;\n }\n .lm_header .lm_tabdropdown_list .lm_close_tab {\n display: none !important;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n box-shadow: none;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n .lm_popin {\n width: 20px;\n height: 20px;\n position: absolute;\n bottom: 0;\n right: 0;\n z-index: 9999;\n }\n .lm_popin > * {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n .lm_popin > .lm_bg {\n z-index: 10;\n }\n .lm_popin > .lm_icon {\n z-index: 20;\n } /*# sourceMappingURL=goldenlayout-base.css.map */\n`",
1632
+ "description": "`ElementStyles` which defines the css for FoundationLayout.",
1633
+ "privacy": "public"
1634
+ }
1635
+ ],
1636
+ "exports": [
1637
+ {
1638
+ "kind": "js",
1639
+ "name": "layoutStyles",
1640
+ "declaration": {
1641
+ "name": "layoutStyles",
1642
+ "module": "src/styles/layout.styles.ts"
1643
+ }
1644
+ }
1645
+ ]
1507
1646
  }
1508
1647
  ]
1509
1648
  }
@@ -1,4 +1,5 @@
1
1
  export * from './main';
2
2
  export { LAYOUT_ICONS } from './styles';
3
- export { CustomButton, DEFAULT_RELOAD_BUFFER, LayoutComponentWithState, LayoutEmitEvents, LayoutReceiveEvents, LayoutReceiveEventsDetail, LayoutRegionType, LayoutRegistrationError, LayoutUsageError, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout, LAYOUT_POPOUT_CONTAINER_CLASS, } from './utils';
3
+ export { ComponentFactory, CustomButton, DEFAULT_RELOAD_BUFFER, LayoutComponentWithState, LayoutEmitEvents, LayoutReceiveEvents, LayoutReceiveEventsDetail, LayoutRegionType, LayoutRegistrationError, LayoutUsageError, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout, LAYOUT_POPOUT_CONTAINER_CLASS, } from './utils';
4
+ export { registerFactory, getFactory, unregisterFactory } from './utils/factory-registry';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,6BAA6B,GAC9B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -7,6 +7,9 @@ import { componentType, LayoutComponent, RegistrationConfig } from '../utils';
7
7
  * This element is used to wrap html elements and configure their layout settings as part of the layout system.
8
8
  *
9
9
  * This is a simple component which is only used to define the layout splits; any JavaScript API interactions or custom styling is used via {@link FoundationLayout}.
10
+ *
11
+ * The item can either use slotted content or a factory function registered via {@link registerFactory}.
12
+ * When a factory is registered with the same name as the registration attribute, it takes precedence over slotted content.
10
13
  * @tagname %%prefix%%-layout-item
11
14
  */
12
15
  export declare class FoundationLayoutItem extends FoundationElement implements LayoutComponent {
@@ -35,6 +38,23 @@ export declare class FoundationLayoutItem extends FoundationElement implements L
35
38
  * Using a duplicate registration name is a runtime error.
36
39
  * This registration name defaults to the number of the window it is.
37
40
  * It is highly recommended if you are using the JavaScript API that you set a registration name here manually.
41
+ *
42
+ * When using the declarative API with framework components, register a factory function via {@link registerFactory}
43
+ * using the same name as this registration attribute.
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * import { registerFactory } from '@genesislcap/foundation-layout';
48
+ * import { reactFactory } from './utils/react-layout-factory';
49
+ *
50
+ * // Register factory with the same name as the registration
51
+ * registerFactory('my-component', reactFactory(MyComponent));
52
+ * ```
53
+ *
54
+ * Then in JSX/HTML:
55
+ * ```tsx
56
+ * <rapid-layout-item registration="my-component" title="My Component" />
57
+ * ```
38
58
  * @public
39
59
  */
40
60
  registration: string;
@@ -1 +1 @@
1
- {"version":3,"file":"layout-item.d.ts","sourceRoot":"","sources":["../../../src/main/layout-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EACL,aAAa,EAEb,eAAe,EACf,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAIlB;;;;;;;;GAQG;AACH,qBAAa,oBAAqB,SAAQ,iBAAkB,YAAW,eAAe;IACpF;;;;;OAKG;IACG,KAAK,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACwB,QAAQ,EAAE,OAAO,CAAS;IAErD;;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,GAAG,MAAM;CAG7D;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;+BAG/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { LayoutConfig, RootItemConfig } from '@genesis-community/golden-layout';
2
2
  import { FoundationElement } from '@microsoft/fast-foundation';
3
- import { componentType, CustomButton, LayoutComponent, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout } from '../utils/';
3
+ import { ComponentFactory, componentType, CustomButton, LayoutComponent, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout } from '../utils/';
4
4
  export { layoutStyles } from '../styles';
5
5
  /**
6
6
  * @public
@@ -240,21 +240,48 @@ export declare class FoundationLayout extends FoundationElement implements Layou
240
240
  removeItems(registration: string, force?: boolean): number;
241
241
  /**
242
242
  * @public
243
- * Register a collection of `Element` and associate them with an `ID` with the layout system for later use.
243
+ * Register a collection of `Element` or a factory function and associate them with an `ID` with the layout system for later use.
244
244
  * @remarks
245
- * You would use this to register elements that you later want to load when using {@link FoundationLayout.loadLayout}.
245
+ * You can register either an array of elements or a factory function.
246
+ *
247
+ * **Element registration**: Use this to register elements that you later want to load when using {@link FoundationLayout.loadLayout}.
246
248
  * Use {@link FoundationLayout.layoutRequiredRegistrations} to see what components need to be registered for a certain config
247
249
  * and then register them using this function before calling {@link FoundationLayout.loadLayout}.
250
+ * When registering an element it is moved by reference into the internals of the layout, so if you pass elements already in the DOM then they will disappear.
251
+ * If you want to avoid this you can pass copies using `element.cloneNode(true)`.
248
252
  *
249
- * When registering an element it is moved by reference into the internals of the layout, so if you pass elements already in the DOM then they will disappear. If you want to avoid this you can pass copies using `element.cloneNode(true)`.
253
+ * **Factory registration**: This is the recommended approach for framework-rendered components (React, Angular, Vue, etc.)
254
+ * because it allows each layout instance to create a fresh component rather than cloning existing
255
+ * DOM elements (which loses event listeners and framework bindings).
256
+ * The factory function will be called each time a new instance of the component is needed. It receives
257
+ * a container element and should render the component into it. Optionally, it can return a cleanup
258
+ * function that will be called when the component is removed from the layout.
250
259
  *
251
260
  * @param registration - string of the registration ID
252
- * @param elements - Elements[] containing the reference to the elements to register for later usage
261
+ * @param elementsOrFactory - Either Elements[] containing the reference to the elements to register, or a ComponentFactory function
253
262
  * @throws {@link LayoutUsageError} if you attempt to add an item before the layout has been initialised.
254
263
  * @throws {@link LayoutRegistrationError} if you attempt to use a `registration` name which is already in use (declarative html API and JavaScript API registrations use the same "pool" of registration names).
255
264
  * @returns - string defining the name of the registered item with the layout system (config.id if set).
256
- */
257
- registerItem(registration: string, elements: Element[]): string;
265
+ *
266
+ * @example
267
+ * Element registration:
268
+ * ```typescript
269
+ * const div = document.createElement('div');
270
+ * div.innerHTML = '<h1>Hello</h1>';
271
+ * layout.registerItem('my-element', [div]);
272
+ * ```
273
+ *
274
+ * @example
275
+ * Factory registration (React):
276
+ * ```typescript
277
+ * layout.registerItem('text-field', (container) => {
278
+ * const root = createRoot(container);
279
+ * root.render(<TextFieldComponent />);
280
+ * return () => root.unmount();
281
+ * });
282
+ * ```
283
+ */
284
+ registerItem(registration: string, elementsOrFactory: Element[] | ComponentFactory): string;
258
285
  /**
259
286
  * Internal APIs
260
287
  */
@@ -283,12 +310,13 @@ export declare class FoundationLayout extends FoundationElement implements Layou
283
310
  /**
284
311
  * Registers a function with golden layout to create a pane
285
312
  * @param elements - Elements[] to add to new new pane
313
+ * @param factory - ComponentFactory function to create component instances
286
314
  * @param id - optional string which is used to register the new function with golden layout. Defaults to sequentially setting the IDs for default items
287
315
  * @returns - string which is the registered ID
288
316
  * @throws - {@link LayoutRegistrationError} if the id is already in use
289
317
  * @internal
290
318
  */
291
- cacheElementsAndRegister({ elements, id }: RegistrationConfig): string;
319
+ cacheElementsAndRegister(config: RegistrationConfig): string;
292
320
  /**
293
321
  * Sets up the event listeners for the layout receive events
294
322
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"layout-main.d.ts","sourceRoot":"","sources":["../../../src/main/layout-main.ts"],"names":[],"mappings":"AAAA,OAAO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