@uxland/primary-shell 5.0.0 → 5.1.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.
Files changed (46) hide show
  1. package/dist/index.js +27285 -26453
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.umd.cjs +1799 -1494
  4. package/dist/index.umd.cjs.map +1 -1
  5. package/dist/primary/shell/src/UI/components/pdf-visor/pdf-selector/pdf-selector.d.ts +12 -0
  6. package/dist/primary/shell/src/UI/components/pdf-visor/pdf-selector/template.d.ts +3 -0
  7. package/dist/primary/shell/src/UI/components/pdf-visor/pdf-visor.d.ts +22 -0
  8. package/dist/primary/shell/src/UI/components/pdf-visor/utils.d.ts +1 -0
  9. package/dist/primary/shell/src/UI/components/poc-events-ecap/poc-events-ecap.d.ts +2 -0
  10. package/dist/primary/shell/src/UI/components/primaria-shell/primaria-shell.d.ts +1 -0
  11. package/dist/primary/shell/src/api/api.d.ts +2 -0
  12. package/dist/primary/shell/src/api/interaction-service/interaction-service.d.ts +1 -1
  13. package/dist/primary/shell/src/api/pdf-viewer-manager/events.d.ts +5 -0
  14. package/dist/primary/shell/src/api/pdf-viewer-manager/pdf-viewer-manager.d.ts +27 -0
  15. package/dist/primary/shell/src/api/plugin-busy-manager/plugin-busy-manager.d.ts +17 -1
  16. package/dist/primary/shell/src/constants.d.ts +1 -0
  17. package/dist/primary/shell/src/events.d.ts +1 -0
  18. package/dist/primary/shell/src/locales.d.ts +10 -0
  19. package/dist/style.css +1 -1
  20. package/package.json +2 -2
  21. package/src/UI/components/clinical-monitoring/styles.css +3 -2
  22. package/src/UI/components/index.ts +1 -0
  23. package/src/UI/components/pdf-visor/pdf-selector/pdf-selector.ts +40 -0
  24. package/src/UI/components/pdf-visor/pdf-selector/styles.css +24 -0
  25. package/src/UI/components/pdf-visor/pdf-selector/template.ts +37 -0
  26. package/src/UI/components/pdf-visor/pdf-visor.ts +124 -0
  27. package/src/UI/components/pdf-visor/styles.css +29 -0
  28. package/src/UI/components/pdf-visor/utils.ts +16 -0
  29. package/src/UI/components/poc-events-ecap/poc-events-ecap.ts +37 -7
  30. package/src/UI/components/primaria-shell/primaria-shell.ts +9 -0
  31. package/src/UI/components/primaria-shell/styles.css +15 -2
  32. package/src/UI/components/primaria-shell/template.ts +7 -3
  33. package/src/UI/components/shell-header/template.ts +1 -1
  34. package/src/api/api.ts +8 -2
  35. package/src/api/interaction-service/interaction-service-impl.tsx +68 -90
  36. package/src/api/interaction-service/interaction-service.ts +1 -1
  37. package/src/api/interaction-service/modal-styles.css +69 -0
  38. package/src/api/pdf-viewer-manager/events.ts +5 -0
  39. package/src/api/pdf-viewer-manager/pdf-viewer-manager.ts +97 -0
  40. package/src/api/plugin-busy-manager/plugin-busy-manager.test.ts +93 -31
  41. package/src/api/plugin-busy-manager/plugin-busy-manager.ts +44 -1
  42. package/src/constants.ts +1 -0
  43. package/src/events.ts +1 -0
  44. package/src/features/exit/handler.ts +2 -4
  45. package/src/handle-views.ts +12 -7
  46. package/src/locales.ts +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -44,7 +44,7 @@
44
44
  "react-dom": "^19.0.0",
45
45
  "@types/react": "^19.0.12",
46
46
  "inversify-inject-decorators": "^3.1.0",
47
- "@salut/design-system-salut": "../../design-system-salut-2.2.1.tgz",
47
+ "@salut/design-system-salut": "../../design-system-salut-2.3.0.tgz",
48
48
  "jwt-decode": "^4.0.0",
49
49
  "lit": "^3.1.0",
50
50
  "mediatr-ts": "^1.2.1",
@@ -9,7 +9,8 @@
9
9
  min-height: 1px;
10
10
  height: 100%;
11
11
  display: flex;
12
- flex-direction: row;
12
+ flex-direction: row;
13
+
13
14
  #widgets-sidebar-region {
14
15
  width: 25%;
15
16
  border-left: 1px solid rgb(189, 189, 189);
@@ -17,7 +18,7 @@ flex-direction: row;
17
18
  .content {
18
19
  flex: 1;
19
20
  display: flex;
20
- flex-direction: column;
21
+ flex-direction: column;
21
22
  #header-widgets-region {
22
23
  display: grid;
23
24
  grid-template-columns: repeat(3, 1fr);
@@ -4,3 +4,4 @@ import "../shared-components";
4
4
  import "./shell-header/shell-header";
5
5
  import "./quick-actions-menu/quick-actions-menu";
6
6
  import "../../api/plugin-busy-manager/plugin-busy-list/component";
7
+ import "./pdf-visor/pdf-selector/pdf-selector";
@@ -0,0 +1,40 @@
1
+ import { LitElement, css, unsafeCSS } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
+ import { IPdfDocument } from "../../../../../src/api/pdf-viewer-manager/pdf-viewer-manager";
4
+ import { template } from "./template";
5
+ import styles from "./styles.css?inline";
6
+ import { createUrlFromBase64 } from "../utils";
7
+
8
+ @customElement("pdf-selector")
9
+ export class PdfSelector extends LitElement {
10
+ render() {
11
+ return template(this);
12
+ }
13
+
14
+ static styles = css`
15
+ ${unsafeCSS(styles)}
16
+ `;
17
+
18
+ @property({ type: Array })
19
+ pdfList: IPdfDocument[];
20
+
21
+ @property({ type: Array })
22
+ activePdfs: IPdfDocument[] = [];
23
+
24
+ removePdf(id: string) {
25
+ this.dispatchEvent(
26
+ new CustomEvent("pdf-removed", { detail: id, bubbles: true, composed: true }),
27
+ );
28
+ }
29
+
30
+ setActivePdf(id: string) {
31
+ this.dispatchEvent(
32
+ new CustomEvent("active-pdf-changed", { detail: id, bubbles: true, composed: true }),
33
+ );
34
+ }
35
+
36
+ openInNewWindow(pdf: IPdfDocument) {
37
+ const url = pdf.data.url ? pdf.data.url : createUrlFromBase64(pdf.data.b64 as string);
38
+ url && window.open(url);
39
+ }
40
+ }
@@ -0,0 +1,24 @@
1
+ :host {
2
+ width: 250px;
3
+ gap: 8px
4
+ }
5
+
6
+ .pdf-item{
7
+ display: flex;
8
+ align-items: flex-start;
9
+ padding: 8px;
10
+ gap:8px;
11
+ color:black;
12
+ border-bottom: 1px solid var(--color-neutral-100);
13
+ }
14
+
15
+ .header-icons{
16
+ display: flex;
17
+ gap: 8px;
18
+ }
19
+
20
+ .container{
21
+ gap: 8px;
22
+ display: flex;
23
+ flex-direction: column;
24
+ }
@@ -0,0 +1,37 @@
1
+ import { html } from "lit";
2
+ import { PdfSelector } from "./pdf-selector";
3
+ import { IPdfDocument } from "primary/shell/src/api/pdf-viewer-manager/pdf-viewer-manager";
4
+ import { repeat } from "lit/directives/repeat.js";
5
+
6
+ export const template = (props: PdfSelector) => {
7
+ const pdfitem = (pdf: IPdfDocument) => {
8
+ return html`
9
+ <div class="pdf-item">
10
+ <dss-checkbox @onChange=${() => props.setActivePdf(pdf.id)}>
11
+ <input
12
+ slot="input"
13
+ type="checkbox"
14
+ aria-label="Label"
15
+ .checked=${props.activePdfs.some((p) => p.id === pdf.id)}
16
+ >
17
+ </dss-checkbox>
18
+ <div class="container">
19
+ <div class="header-icons">
20
+ <dss-icon-button size="md" variant="error" icon="picture_as_pdf"></dss-icon-button>
21
+ <dss-icon-button size="md" variant="error" icon="close" @click=${() => props.removePdf(pdf.id)}></dss-icon-button>
22
+ <dss-icon-button size="md" icon="open_in_new" @click=${() => props.openInNewWindow(pdf)}></dss-icon-button>
23
+ </div>
24
+ <div class="data">
25
+ ${pdf.pdfName}
26
+ </div>
27
+ </div>
28
+ </div>
29
+ `;
30
+ };
31
+
32
+ return html`
33
+ <div>
34
+ ${repeat(props.pdfList, (pdf: IPdfDocument) => pdfitem(pdf))}
35
+ </div>
36
+ `;
37
+ };
@@ -0,0 +1,124 @@
1
+ import styles from "./styles.css?inline";
2
+ import { html, LitElement, css, unsafeCSS } from "lit";
3
+ import { customElement, property } from "lit/decorators.js";
4
+ import { BrokerDisposableHandler } from "../../../api/broker/primaria-broker";
5
+ import { PrimariaApi } from "../../../api/api";
6
+ import { TYPES } from "../../../../src/infrastructure/ioc/types";
7
+ import { lazyInject } from "../../../../src/infrastructure/ioc/container";
8
+ import { pdfViwerEvents } from "../../../../src/api/pdf-viewer-manager/events";
9
+ import { IPdfDocument } from "../../../api/pdf-viewer-manager/pdf-viewer-manager";
10
+ import { translate } from "../../../../src/locales";
11
+ import { createUrlFromBase64 } from "./utils";
12
+
13
+ @customElement("pdf-visor")
14
+ export class PdfVisor extends LitElement {
15
+ static styles = css`${unsafeCSS(styles)}`;
16
+
17
+ @lazyInject(TYPES.primaryApi)
18
+ api: PrimariaApi;
19
+
20
+ @property({ type: Array })
21
+ pdfList: IPdfDocument[] = [];
22
+
23
+ @property({ type: Array })
24
+ activePdfs: IPdfDocument[] = [];
25
+
26
+ private subscriptions: BrokerDisposableHandler[] = [];
27
+
28
+ async connectedCallback() {
29
+ super.connectedCallback();
30
+ this._initializePdfState();
31
+ this._subscribeEvents();
32
+ }
33
+
34
+ disconnectedCallback(): void {
35
+ super.disconnectedCallback();
36
+ this._unsubscribeEvents();
37
+ }
38
+
39
+ private _initializePdfState() {
40
+ const initialPdfs = this.api.pdfViewerManager.getPdfs?.() || [];
41
+ this.pdfList = [...initialPdfs];
42
+
43
+ if (initialPdfs.length === 1) {
44
+ this.activePdfs = [initialPdfs[0] as IPdfDocument];
45
+ } else if (initialPdfs.length >= 2) {
46
+ this.activePdfs = initialPdfs.slice(-2);
47
+ }
48
+ }
49
+
50
+ private _getPdfSrc(pdf: IPdfDocument) {
51
+ if (pdf.data.url) return pdf.data.url;
52
+ if (pdf.data.b64) return createUrlFromBase64(pdf.data.b64);
53
+ return "";
54
+ }
55
+
56
+ private _subscribeEvents() {
57
+ const subscriptions = [
58
+ this.api.broker.subscribe(pdfViwerEvents.added, (pdf: IPdfDocument) => this._onPdfAdded(pdf)),
59
+ this.api.broker.subscribe(pdfViwerEvents.deleted, ({ id }) => this._onPdfDeleted({ id })),
60
+ ];
61
+ subscriptions.forEach((s) => this.subscriptions.push(s));
62
+ }
63
+
64
+ private _unsubscribeEvents() {
65
+ this.subscriptions.forEach((s) => s.dispose());
66
+ }
67
+
68
+ private _onPdfAdded(pdf: IPdfDocument) {
69
+ this.pdfList = [...this.pdfList, pdf];
70
+ this._updateActivePdfs(pdf.id);
71
+ }
72
+
73
+ private _onPdfDeleted({ id }) {
74
+ this.pdfList = this.pdfList.filter((pdf) => pdf.id !== id);
75
+ this.activePdfs = this.activePdfs.filter((pdf) => pdf.id !== id);
76
+ this.requestUpdate();
77
+ }
78
+
79
+ private _removePdf(id: string) {
80
+ this.api.pdfViewerManager.delete(id);
81
+ this.activePdfs = this.activePdfs.filter((pdf) => pdf.id !== id);
82
+ }
83
+
84
+ private _updateActivePdfs(id: string) {
85
+ const isAlreadyActive = this.activePdfs.some((pdf) => pdf.id === id);
86
+ if (isAlreadyActive) {
87
+ this.activePdfs = this.activePdfs.filter((pdf) => pdf.id !== id);
88
+ } else {
89
+ const newPdf = this.pdfList.find((pdf) => pdf.id === id);
90
+ if (!newPdf) return;
91
+ if (this.activePdfs.length === 2) {
92
+ this.activePdfs = [this.activePdfs[1] as IPdfDocument, newPdf];
93
+ } else {
94
+ this.activePdfs = [...this.activePdfs, newPdf];
95
+ }
96
+ }
97
+ this.requestUpdate();
98
+ }
99
+
100
+ render() {
101
+ return html`
102
+ <div class="pdf-container">
103
+ ${
104
+ this.activePdfs.length > 0
105
+ ? this.activePdfs.map(
106
+ (pdf) =>
107
+ html`<iframe height="100%" src=${this._getPdfSrc(pdf)} frameborder="0"></iframe>`,
108
+ )
109
+ : html`
110
+ <div class="no-pdf">
111
+ <p>${translate("pdfVisor.noPdfSelected")}</p>
112
+ </div>
113
+ `
114
+ }
115
+ </div>
116
+ <pdf-selector
117
+ .pdfList=${this.pdfList}
118
+ .activePdfs=${this.activePdfs}
119
+ @pdf-removed=${(e: CustomEvent) => this._removePdf(e.detail)}
120
+ @active-pdf-changed=${(e: CustomEvent) => this._updateActivePdfs(e.detail)}
121
+ ></pdf-selector>
122
+ `;
123
+ }
124
+ }
@@ -0,0 +1,29 @@
1
+ :host {
2
+ min-height: 1px;
3
+ height: 100%;
4
+ width: 100%;
5
+ display: flex;
6
+ }
7
+
8
+ iframe {
9
+ border: none;
10
+ flex:1;
11
+ height: 100%;
12
+
13
+ }
14
+
15
+ .pdf-container {
16
+ display: flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ height: 100%;
20
+ flex: 1;
21
+ border: 1px solid #ccc;
22
+ }
23
+
24
+ .no-pdf {
25
+ text-align: center;
26
+ color: #666;
27
+ font-size: 1.2rem;
28
+ font-weight: bold;
29
+ }
@@ -0,0 +1,16 @@
1
+ function base64ToBlob(base64, type = "application/octet-stream") {
2
+ const binStr = window.atob(base64);
3
+ const len = binStr.length;
4
+ const arr = new Uint8Array(len);
5
+ for (let i = 0; i < len; i++) {
6
+ arr[i] = binStr.charCodeAt(i);
7
+ }
8
+ return new Blob([arr], { type: type });
9
+ }
10
+
11
+ export const createUrlFromBase64 = (b64: string, type?: string) => {
12
+ if (b64) {
13
+ const blob = base64ToBlob(b64, type || "application/pdf");
14
+ return URL.createObjectURL(blob);
15
+ }
16
+ };
@@ -22,19 +22,49 @@ export class PocEventsEcap extends LitElement {
22
22
 
23
23
  </form>
24
24
  <button @click=${(e) => this.goToLinkOnEcap()}>LLennçar event ecap</button>
25
- </div>`;
25
+ </div>
26
+
27
+ <form>
28
+ <label for="pdfName">PDF Name</label>
29
+ <input type="text" id="pdfName" name="pdfName" placeholder="pdfName">
30
+ <label for="url">URL</label>
31
+ <input type="text" id="url" name="url" placeholder="url">
32
+
33
+
34
+ </form>
35
+ <button @click=${(e) => this.sendPdfToViewer()}>Add PDF</button>
36
+
37
+
38
+ <button @click=${(e) => this.getPDFS()}>GET PDFs</button>
39
+ `;
26
40
  }
27
41
 
28
- goToLinkOnEcap() {
42
+ sendPdfToViewer() {
43
+ const pdfName = (this as any).shadowRoot?.getElementById("pdfName")?.value as string;
44
+ const fileName = (this as any).shadowRoot?.getElementById("url")?.value as string;
29
45
 
30
- const eventType = (this as any).shadowRoot?.getElementById("eventType")?.value;
31
- const accio = (this as any).shadowRoot?.getElementById("accio")?.value;
32
- const parameterName = (this as any).shadowRoot?.getElementById("parameterName")?.value;
33
- const parameterValue = (this as any).shadowRoot?.getElementById("parameterValue")?.value;
46
+ const data = fileName;
47
+
48
+ const pdf = { pdfName, data };
49
+ console.log("Añadiendo PDF:", pdf);
50
+
51
+ shellApi.pdfViewerManager.add(pdf);
52
+ }
53
+
54
+ getPDFS() {
55
+ const pdfs = shellApi.pdfViewerManager.getPdfs();
56
+ console.log(pdfs);
57
+ }
58
+
59
+ goToLinkOnEcap() {
60
+ const eventType = (this as any).shadowRoot?.getElementById("eventType")?.value;
61
+ const accio = (this as any).shadowRoot?.getElementById("accio")?.value;
62
+ const parameterName = (this as any).shadowRoot?.getElementById("parameterName")?.value;
63
+ const parameterValue = (this as any).shadowRoot?.getElementById("parameterValue")?.value;
34
64
 
35
65
  //sending data to parent window if opened inside iframe
36
66
  shellApi.ecapEventManager.publish(eventType, accio, {
37
- [parameterName]: parameterValue
67
+ [parameterName]: parameterValue,
38
68
  });
39
69
  }
40
70
 
@@ -67,6 +67,9 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
67
67
  @state()
68
68
  error: { message: string };
69
69
 
70
+ @state()
71
+ quickActionBusy = false;
72
+
70
73
  _toggleSidebar() {
71
74
  this.sidebarExpanded = !this.sidebarExpanded;
72
75
  }
@@ -91,6 +94,12 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
91
94
  this._handleError({ message: translate("errors.invalidPatient") });
92
95
  }),
93
96
  );
97
+
98
+ this.subscriptions.push(
99
+ shellApi.broker.subscribe(shellEvents.quickActionBusyChanged, (detail: { busy: boolean }) => {
100
+ this.quickActionBusy = detail.busy;
101
+ }),
102
+ );
94
103
  }
95
104
 
96
105
  _handleError(error: { message: string }) {
@@ -29,15 +29,28 @@
29
29
  width: 40px;
30
30
  height: 100%;
31
31
  color: white;
32
- .top-content {
32
+ .quick-actions-content {
33
33
  padding-top: 24px;
34
- padding-bottom: 24px;
34
+ padding-bottom: 22px;
35
35
  border-radius: 8px;
36
+ .create-button-icon-badge{
37
+ position: relative;
38
+ dss-notification-badge {
39
+ position: absolute;
40
+ top: -7px;
41
+ right: -6px;
42
+ z-index: 1;
43
+ }
44
+ dss-icon {
45
+ position: relative;
46
+ }
47
+ }
36
48
  }
37
49
  .icon {
38
50
  margin-left: 8px;
39
51
  }
40
52
  #menu-region-container {
53
+ padding-top: 24px;
41
54
  min-height: 1px;
42
55
  height: 100%;
43
56
  width: 100%;
@@ -13,10 +13,15 @@ export const template = (props: PrimariaShell) => html`
13
13
  <shell-header></shell-header>
14
14
  <div class="main-container">
15
15
  <div class="sidebar" ?expanded=${props.sidebarExpanded}>
16
- <div class="top-content">
16
+ <div id="menu-region-container"></div>
17
+ <div class="quick-actions-content">
17
18
  <quick-actions-menu>
18
19
  <div class="${props.sidebarExpanded ? "create-button-opened" : "create-button-closed"} " slot="anchor" id="usage-anchor">
19
- <dss-icon class="${props.sidebarExpanded ? "icon" : ""}" icon="add_circle_outline" size="md"></dss-icon>${props.sidebarExpanded ? translate('actions.create') : nothing}
20
+ <div class="${props.quickActionBusy ? "create-button-icon-badge" : ""}">
21
+ ${props.quickActionBusy ? html`<dss-notification-badge value="" state="error" borderwhite="" type="default" dot=""></dss-notification-badge>`: nothing}
22
+ <dss-icon class="${props.sidebarExpanded ? "icon" : ""}" icon="add_circle_outline" size="md"></dss-icon>
23
+ </div>
24
+ ${props.sidebarExpanded ? translate('actions.create') : nothing}
20
25
  ${!props.sidebarExpanded ? html`<dss-tooltip position="right">
21
26
  ${translate('actions.create')}
22
27
  </dss-tooltip>` : nothing}
@@ -24,7 +29,6 @@ export const template = (props: PrimariaShell) => html`
24
29
  <dss-action-menu id="quick-actions-region-container" slot="content" id="content" anchor="usage-anchor"></dss-action-menu>
25
30
  </quick-actions-menu>
26
31
  </div>
27
- <div id="menu-region-container"></div>
28
32
  <div class="bottom-content">
29
33
  <div class="bottom-content-first">
30
34
  <hr class="dss-divider--bold ${props.sidebarExpanded ? "divider-opened" : "divider-closed"}" />
@@ -21,7 +21,7 @@ export const template = (props: ShellHeader) => {
21
21
  <div id="header-actions-region-container"></div>
22
22
  ${when(
23
23
  props.professional,
24
- () => html`<dss-header-menu-professional @onLogout=${props.logout} slot="professional-menu" name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
24
+ () => html`<dss-header-menu-professional @onExit=${props.logout} slot="professional-menu" name="${props.professional.firstName} ${props.professional?.familyName} ${props.professional?.lastName}" center="${props.professional.workCenter}" collegiate="${props.professional.registrationNumber}">
25
25
  <dss-avatar size="xl" name="${props.professional.firstName}" surname="${props.professional?.familyName}" slot="avatar"></dss-avatar>
26
26
  <dss-input-dropdown icon="maps_home_work" type="default" .elements=${workCenterElements} selectedvalue="[&quot;1&quot;]">
27
27
  <label slot="label" for="preferences1">${translate("header.workCenter")}</label>
package/src/api/api.ts CHANGED
@@ -22,8 +22,10 @@ import { PrimariaInteractionService } from "./interaction-service";
22
22
  import { ParimariaInteractionServiceImpl } from "./interaction-service/interaction-service-impl";
23
23
  import { PrimariaNotificationService } from "./notification-service/notification-service";
24
24
  import { PrimariaNotificationServiceImpl } from "./notification-service/notification.service-impl";
25
+ import { createPdfViewerManager, PdfViewerManager } from "./pdf-viewer-manager/pdf-viewer-manager";
25
26
 
26
27
  const broker = createBroker();
28
+
27
29
  export interface PrimariaApi extends HarmonixApi {
28
30
  httpClient: HttpClient;
29
31
  interactionService: PrimariaInteractionService;
@@ -34,13 +36,14 @@ export interface PrimariaApi extends HarmonixApi {
34
36
  tokenManager: TokenManager;
35
37
  ecapEventManager: EcapEventManager;
36
38
  pluginBusyManager: PluginBusyManager;
39
+ pdfViewerManager: PdfViewerManager;
37
40
  }
38
41
 
39
42
  const regionManager: IRegionManager = createRegionManager("primaria");
40
43
  export const PrimariaRegionHost: any = createRegionHost(regionManager as any);
41
44
  const tokenManager = createTokenManager();
42
45
  const globalStateManager: PrimariaGlobalStateManager = createGlobalStateManager(broker);
43
- const pluginBusyManager = new PluginBusyManagerImpl();
46
+ const pluginBusyManager = new PluginBusyManagerImpl(broker);
44
47
  const interactionService = new ParimariaInteractionServiceImpl();
45
48
  const notificationService = new PrimariaNotificationServiceImpl();
46
49
 
@@ -53,9 +56,11 @@ const notificationService = new PrimariaNotificationServiceImpl();
53
56
  export const primariaApiFactory: ApiFactory<PrimariaApi> = (
54
57
  pluginInfo: PluginInfo,
55
58
  ): PrimariaApi => {
59
+ const regionManagerProxy = createRegionManagerProxy(pluginInfo, regionManager, broker);
60
+
56
61
  return {
57
62
  pluginInfo: pluginInfo,
58
- regionManager: createRegionManagerProxy(pluginInfo, regionManager, broker),
63
+ regionManager: regionManagerProxy,
59
64
  httpClient: createHttpClient(tokenManager, broker),
60
65
  broker: broker,
61
66
  createLocaleManager: createLocaleManager(pluginInfo.pluginId) as any,
@@ -65,6 +70,7 @@ export const primariaApiFactory: ApiFactory<PrimariaApi> = (
65
70
  pluginBusyManager,
66
71
  interactionService,
67
72
  notificationService,
73
+ pdfViewerManager: createPdfViewerManager(broker, notificationService, regionManagerProxy),
68
74
  };
69
75
  };
70
76