@openmrs/esm-extensions 6.3.1-pre.3250 → 7.0.1-pre.3256
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/.turbo/turbo-build.log +1 -1
- package/dist/modals.d.ts +2 -4
- package/dist/render.js +3 -3
- package/dist/store.d.ts +1 -3
- package/dist/workspaces.d.ts +3 -6
- package/dist/workspaces.js +1 -0
- package/package.json +8 -8
- package/src/modals.ts +2 -2
- package/src/render.ts +3 -3
- package/src/store.ts +1 -1
- package/src/workspaces.ts +4 -2
package/.turbo/turbo-build.log
CHANGED
package/dist/modals.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type LifeCycles } from 'single-spa';
|
|
2
2
|
/** @internal */
|
|
3
3
|
export interface ModalRegistration {
|
|
4
4
|
name: string;
|
|
5
|
-
load(): Promise<
|
|
6
|
-
default?: LifeCycles;
|
|
7
|
-
} & LifeCycles>;
|
|
5
|
+
load(): Promise<LifeCycles>;
|
|
8
6
|
moduleName: string;
|
|
9
7
|
}
|
|
10
8
|
/** @internal */
|
package/dist/render.js
CHANGED
|
@@ -15,7 +15,7 @@ let parcelCount = 0;
|
|
|
15
15
|
if (!extensionRegistration) {
|
|
16
16
|
throw Error(`Couldn't find extension '${extensionName}' to attach to '${extensionSlotName}'`);
|
|
17
17
|
}
|
|
18
|
-
const {
|
|
18
|
+
const { meta, moduleName, online, offline, load } = extensionRegistration;
|
|
19
19
|
if (checkStatus(online, offline)) {
|
|
20
20
|
updateInternalExtensionStore((state)=>{
|
|
21
21
|
const instance = {
|
|
@@ -38,10 +38,10 @@ let parcelCount = 0;
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
const
|
|
41
|
+
const lifecycle = await load();
|
|
42
42
|
const id = parcelCount++;
|
|
43
43
|
parcel = mountRootParcel(renderFunction({
|
|
44
|
-
...
|
|
44
|
+
...lifecycle,
|
|
45
45
|
name: `${extensionSlotName}/${extensionName}-${id}`
|
|
46
46
|
}), {
|
|
47
47
|
...additionalProps,
|
package/dist/store.d.ts
CHANGED
|
@@ -5,9 +5,7 @@ export interface ExtensionMeta {
|
|
|
5
5
|
}
|
|
6
6
|
export interface ExtensionRegistration {
|
|
7
7
|
readonly name: string;
|
|
8
|
-
load(): Promise<
|
|
9
|
-
default?: LifeCycles;
|
|
10
|
-
} & LifeCycles>;
|
|
8
|
+
load(): Promise<LifeCycles>;
|
|
11
9
|
readonly moduleName: string;
|
|
12
10
|
readonly meta: Readonly<ExtensionMeta>;
|
|
13
11
|
readonly order?: number;
|
package/dist/workspaces.d.ts
CHANGED
|
@@ -11,9 +11,7 @@ export interface WorkspaceRegistration {
|
|
|
11
11
|
canMaximize: boolean;
|
|
12
12
|
width: 'narrow' | 'wider' | 'extra-wide';
|
|
13
13
|
preferredWindowSize: WorkspaceWindowState;
|
|
14
|
-
load
|
|
15
|
-
default?: LifeCycles;
|
|
16
|
-
} & LifeCycles>;
|
|
14
|
+
load(): Promise<LifeCycles>;
|
|
17
15
|
moduleName: string;
|
|
18
16
|
groups: Array<string>;
|
|
19
17
|
}
|
|
@@ -29,11 +27,10 @@ export interface RegisterWorkspaceOptions {
|
|
|
29
27
|
canMaximize?: boolean;
|
|
30
28
|
width?: 'narrow' | 'wider' | 'extra-wide';
|
|
31
29
|
preferredWindowSize?: WorkspaceWindowState;
|
|
32
|
-
|
|
33
|
-
default?: LifeCycles;
|
|
34
|
-
} & LifeCycles>;
|
|
30
|
+
component: string;
|
|
35
31
|
moduleName: string;
|
|
36
32
|
groups?: Array<string>;
|
|
33
|
+
load(): Promise<LifeCycles>;
|
|
37
34
|
}
|
|
38
35
|
/**
|
|
39
36
|
* Tells the workspace system about a workspace. This is used by the app shell
|
package/dist/workspaces.js
CHANGED
|
@@ -17,6 +17,7 @@ const workspaceGroupStore = createGlobalStore('workspaceGroups', {
|
|
|
17
17
|
...state.workspaces,
|
|
18
18
|
[workspace.name]: {
|
|
19
19
|
...workspace,
|
|
20
|
+
load: workspace.load,
|
|
20
21
|
preferredWindowSize: workspace.preferredWindowSize ?? 'normal',
|
|
21
22
|
type: workspace.type ?? 'form',
|
|
22
23
|
canHide: workspace.canHide ?? false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-extensions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1-pre.3256",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Coordinates extensions and extension points in the OpenMRS Frontend",
|
|
6
6
|
"type": "module",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"single-spa": "6.x"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@openmrs/esm-api": "
|
|
68
|
-
"@openmrs/esm-config": "
|
|
69
|
-
"@openmrs/esm-expression-evaluator": "
|
|
70
|
-
"@openmrs/esm-feature-flags": "
|
|
71
|
-
"@openmrs/esm-state": "
|
|
72
|
-
"@openmrs/esm-utils": "
|
|
67
|
+
"@openmrs/esm-api": "7.0.1-pre.3256",
|
|
68
|
+
"@openmrs/esm-config": "7.0.1-pre.3256",
|
|
69
|
+
"@openmrs/esm-expression-evaluator": "7.0.1-pre.3256",
|
|
70
|
+
"@openmrs/esm-feature-flags": "7.0.1-pre.3256",
|
|
71
|
+
"@openmrs/esm-state": "7.0.1-pre.3256",
|
|
72
|
+
"@openmrs/esm-utils": "7.0.1-pre.3256",
|
|
73
73
|
"@swc/cli": "^0.7.7",
|
|
74
74
|
"@swc/core": "^1.11.29",
|
|
75
75
|
"concurrently": "^9.1.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"single-spa": "^6.0.3",
|
|
80
80
|
"vitest": "^3.1.4"
|
|
81
81
|
},
|
|
82
|
-
"stableVersion": "
|
|
82
|
+
"stableVersion": "7.0.0"
|
|
83
83
|
}
|
package/src/modals.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { type LifeCycles } from 'single-spa';
|
|
1
2
|
import { createGlobalStore } from '@openmrs/esm-state';
|
|
2
|
-
import type { LifeCycles } from 'single-spa';
|
|
3
3
|
import { getExtensionRegistration } from '.';
|
|
4
4
|
|
|
5
5
|
/** @internal */
|
|
6
6
|
export interface ModalRegistration {
|
|
7
7
|
name: string;
|
|
8
|
-
load(): Promise<
|
|
8
|
+
load(): Promise<LifeCycles>;
|
|
9
9
|
moduleName: string;
|
|
10
10
|
}
|
|
11
11
|
|
package/src/render.ts
CHANGED
|
@@ -32,7 +32,7 @@ export async function renderExtension(
|
|
|
32
32
|
throw Error(`Couldn't find extension '${extensionName}' to attach to '${extensionSlotName}'`);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const {
|
|
35
|
+
const { meta, moduleName, online, offline, load } = extensionRegistration;
|
|
36
36
|
|
|
37
37
|
if (checkStatus(online, offline)) {
|
|
38
38
|
updateInternalExtensionStore((state) => {
|
|
@@ -54,11 +54,11 @@ export async function renderExtension(
|
|
|
54
54
|
};
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
const
|
|
57
|
+
const lifecycle = await load();
|
|
58
58
|
const id = parcelCount++;
|
|
59
59
|
parcel = mountRootParcel(
|
|
60
60
|
renderFunction({
|
|
61
|
-
...
|
|
61
|
+
...lifecycle,
|
|
62
62
|
name: `${extensionSlotName}/${extensionName}-${id}`,
|
|
63
63
|
}),
|
|
64
64
|
{
|
package/src/store.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ExtensionMeta {
|
|
|
11
11
|
|
|
12
12
|
export interface ExtensionRegistration {
|
|
13
13
|
readonly name: string;
|
|
14
|
-
load(): Promise<
|
|
14
|
+
load(): Promise<LifeCycles>;
|
|
15
15
|
readonly moduleName: string;
|
|
16
16
|
readonly meta: Readonly<ExtensionMeta>;
|
|
17
17
|
readonly order?: number;
|
package/src/workspaces.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface WorkspaceRegistration {
|
|
|
15
15
|
canMaximize: boolean;
|
|
16
16
|
width: 'narrow' | 'wider' | 'extra-wide';
|
|
17
17
|
preferredWindowSize: WorkspaceWindowState;
|
|
18
|
-
load
|
|
18
|
+
load(): Promise<LifeCycles>;
|
|
19
19
|
moduleName: string;
|
|
20
20
|
groups: Array<string>;
|
|
21
21
|
}
|
|
@@ -49,9 +49,10 @@ export interface RegisterWorkspaceOptions {
|
|
|
49
49
|
canMaximize?: boolean;
|
|
50
50
|
width?: 'narrow' | 'wider' | 'extra-wide';
|
|
51
51
|
preferredWindowSize?: WorkspaceWindowState;
|
|
52
|
-
|
|
52
|
+
component: string;
|
|
53
53
|
moduleName: string;
|
|
54
54
|
groups?: Array<string>;
|
|
55
|
+
load(): Promise<LifeCycles>;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
/**
|
|
@@ -65,6 +66,7 @@ export function registerWorkspace(workspace: RegisterWorkspaceOptions) {
|
|
|
65
66
|
...state.workspaces,
|
|
66
67
|
[workspace.name]: {
|
|
67
68
|
...workspace,
|
|
69
|
+
load: workspace.load,
|
|
68
70
|
preferredWindowSize: workspace.preferredWindowSize ?? 'normal',
|
|
69
71
|
type: workspace.type ?? 'form',
|
|
70
72
|
canHide: workspace.canHide ?? false,
|