@openmrs/esm-globals 7.0.1-pre.3258 → 7.0.1-pre.3273

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.
@@ -1,3 +1,3 @@
1
- [0] Successfully compiled: 4 files with swc (491.42ms)
1
+ [0] Successfully compiled: 4 files with swc (250.64ms)
2
2
  [0] swc --strip-leading-paths src -d dist exited with code 0
3
3
  [1] tsc --project tsconfig.build.json exited with code 0
package/dist/types.d.ts CHANGED
@@ -127,9 +127,9 @@ export type PageDefinition = {
127
127
  */
128
128
  offline?: boolean;
129
129
  /**
130
- * Determines the order in which this page is rendered in the app-shell, which is useful for situations where DOM ordering matters.
130
+ * If supplied, the page will be rendered within the DOM element with the specified ID. Defaults to "omrs-apps-container" if not supplied.
131
131
  */
132
- order?: number;
132
+ containerDomId?: string;
133
133
  } & ({
134
134
  /**
135
135
  * Either a string or a boolean.
@@ -161,9 +161,7 @@ export type PageDefinition = {
161
161
  * @internal
162
162
  * A definition of a page after the app has been registered.
163
163
  */
164
- export type RegisteredPageDefinition = Omit<PageDefinition, 'order'> & AppComponent & {
165
- order: number;
166
- };
164
+ export type RegisteredPageDefinition = PageDefinition & AppComponent;
167
165
  /**
168
166
  * A definition of an extension as extracted from an app's routes.json
169
167
  */
@@ -292,6 +290,26 @@ export interface WorkspaceGroupDefinition {
292
290
  */
293
291
  members?: Array<string>;
294
292
  }
293
+ export interface WorkspaceGroupDefinition2 {
294
+ name: string;
295
+ closeable?: boolean;
296
+ overlay?: boolean;
297
+ }
298
+ export interface WorkspaceWindowDefinition2 {
299
+ name: string;
300
+ icon?: string;
301
+ canHide: boolean;
302
+ canMaximize: boolean;
303
+ overlay: boolean;
304
+ group: string;
305
+ order?: number;
306
+ width?: 'narrow' | 'wider' | 'extra-wide';
307
+ }
308
+ export interface WorkspaceDefinition2 {
309
+ name: string;
310
+ component: string;
311
+ window: string;
312
+ }
295
313
  /**
296
314
  * A definition of a feature flag extracted from the routes.json
297
315
  */
@@ -331,6 +349,12 @@ export interface OpenmrsAppRoutes {
331
349
  workspaces?: Array<WorkspaceDefinition>;
332
350
  /** An array of all workspace groups supported by this frontend module. */
333
351
  workspaceGroups?: Array<WorkspaceGroupDefinition>;
352
+ /** An array of all workspace groups (v2) supported by this frontend module. */
353
+ workspaceGroups2?: Array<WorkspaceGroupDefinition2>;
354
+ /** An array of all workspace windows (v2) supported by this frontend module. */
355
+ workspaceWindows2?: Array<WorkspaceWindowDefinition2>;
356
+ /** An array of all workspaces (v2) supported by this frontend module. */
357
+ workspaces2?: Array<WorkspaceDefinition2>;
334
358
  }
335
359
  /**
336
360
  * This interfaces describes the format of the overall routes.json loaded by the app shell.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-globals",
3
- "version": "7.0.1-pre.3258",
3
+ "version": "7.0.1-pre.3273",
4
4
  "license": "MPL-2.0",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
package/src/types.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { LifeCycles } from 'single-spa';
2
1
  import type { i18n } from 'i18next';
3
2
 
4
3
  declare global {
@@ -136,9 +135,9 @@ export type PageDefinition = {
136
135
  */
137
136
  offline?: boolean;
138
137
  /**
139
- * Determines the order in which this page is rendered in the app-shell, which is useful for situations where DOM ordering matters.
138
+ * If supplied, the page will be rendered within the DOM element with the specified ID. Defaults to "omrs-apps-container" if not supplied.
140
139
  */
141
- order?: number;
140
+ containerDomId?: string;
142
141
  } & (
143
142
  | {
144
143
  /**
@@ -174,7 +173,7 @@ export type PageDefinition = {
174
173
  * @internal
175
174
  * A definition of a page after the app has been registered.
176
175
  */
177
- export type RegisteredPageDefinition = Omit<PageDefinition, 'order'> & AppComponent & { order: number };
176
+ export type RegisteredPageDefinition = PageDefinition & AppComponent;
178
177
 
179
178
  /**
180
179
  * A definition of an extension as extracted from an app's routes.json
@@ -311,6 +310,29 @@ export interface WorkspaceGroupDefinition {
311
310
  members?: Array<string>;
312
311
  }
313
312
 
313
+ export interface WorkspaceGroupDefinition2 {
314
+ name: string;
315
+ closeable?: boolean;
316
+ overlay?: boolean;
317
+ }
318
+
319
+ export interface WorkspaceWindowDefinition2 {
320
+ name: string;
321
+ icon?: string;
322
+ canHide: boolean;
323
+ canMaximize: boolean;
324
+ overlay: boolean;
325
+ group: string;
326
+ order?: number;
327
+ width?: 'narrow' | 'wider' | 'extra-wide';
328
+ }
329
+
330
+ export interface WorkspaceDefinition2 {
331
+ name: string;
332
+ component: string;
333
+ window: string;
334
+ }
335
+
314
336
  /**
315
337
  * A definition of a feature flag extracted from the routes.json
316
338
  */
@@ -353,6 +375,15 @@ export interface OpenmrsAppRoutes {
353
375
  workspaces?: Array<WorkspaceDefinition>;
354
376
  /** An array of all workspace groups supported by this frontend module. */
355
377
  workspaceGroups?: Array<WorkspaceGroupDefinition>;
378
+
379
+ /** An array of all workspace groups (v2) supported by this frontend module. */
380
+ workspaceGroups2?: Array<WorkspaceGroupDefinition2>;
381
+
382
+ /** An array of all workspace windows (v2) supported by this frontend module. */
383
+ workspaceWindows2?: Array<WorkspaceWindowDefinition2>;
384
+
385
+ /** An array of all workspaces (v2) supported by this frontend module. */
386
+ workspaces2?: Array<WorkspaceDefinition2>;
356
387
  }
357
388
 
358
389
  /**