@uxland/primary-shell 7.47.5 → 7.48.0

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.
@@ -16,7 +16,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
16
16
  activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
17
17
  getCurrentMainViewActive(): string | undefined;
18
18
  _removeAllViews(): Promise<void>;
19
- _destroy(): void;
19
+ _destroy(): Promise<void>;
20
20
  }
21
21
  /**
22
22
  * Creates a proxy for the region manager with the given plugin info and region manager instance.
@@ -1,4 +1,4 @@
1
1
  import { ExitShellPayload } from './features/exit/request';
2
- export declare const disposeShell: () => void;
2
+ export declare const disposeShell: () => Promise<void>;
3
3
  export declare const raiseCloseEvent: () => void;
4
4
  export declare const raiseCustomCloseEvent: (event: ExitShellPayload) => void;
@@ -1,3 +1,3 @@
1
1
  import { PrimariaApi } from '../api/api';
2
2
  export declare const useFeatures: (api: PrimariaApi) => void;
3
- export declare const disposeFeatures: (api: PrimariaApi) => void;
3
+ export declare const disposeFeatures: (api: PrimariaApi) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.47.5",
3
+ "version": "7.48.0",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -94,7 +94,9 @@ export class PrimariaShell extends PrimariaRegionHost(LitElement) {
94
94
  _handleError(error: { message: string }) {
95
95
  this.viewSelected = shellViews.error;
96
96
  this.error = error;
97
- disposeShell();
97
+ // Sense esperar a proposit: aixo es un callback sincron de Lit i aqui ja pintem la vista
98
+ // d'error, que no depen que el teardown hagi acabat. El `void` ho marca com a deliberat.
99
+ void disposeShell();
98
100
  }
99
101
 
100
102
  _unsubscribeEvents() {
@@ -29,7 +29,7 @@
29
29
  display: grid;
30
30
  flex: 1;
31
31
  min-height: 0;
32
- grid-template-columns: 1fr 1fr;
32
+ grid-template-columns: 50% 50%;
33
33
  gap: 16px;
34
34
  padding: 16px;
35
35
  }
@@ -54,31 +54,26 @@
54
54
  overflow-y: auto;
55
55
  }
56
56
 
57
- /* Left column: vertical stack of multiple views with a gap. The last view
58
- takes the remaining space and handles its own scroll; preceding views
59
- keep their natural height. */
57
+ /* Left column: vertical stack of accordion widgets. Each one keeps its natural
58
+ height and bounds its own inner scroll, so the column scrolls as a whole —
59
+ same as the right column. */
60
60
  .content > primaria-region[name="import-data-activity-history-region"] > div {
61
61
  display: flex;
62
62
  flex-direction: column;
63
63
  gap: 16px;
64
- overflow: hidden;
64
+ overflow-y: auto;
65
65
  }
66
66
 
67
67
  .content > primaria-region[name="import-data-activity-history-region"] > div > * {
68
68
  flex-shrink: 0;
69
69
  }
70
70
 
71
- .content > primaria-region[name="import-data-activity-history-region"] > div > *:last-child {
72
- flex: 1;
73
- min-height: 0;
74
- }
75
-
76
71
  .footer {
77
72
  display: flex;
78
73
  flex-direction: row;
79
74
  align-items: center;
80
75
  background: white;
81
- justify-content: end;
76
+ justify-content: center;
82
77
  gap: 12px;
83
78
  height: 56px;
84
79
  border-top: 1px solid var(--color-neutral-100);
@@ -20,6 +20,7 @@ export const template = (props: ImportDataManagerModal) => {
20
20
  variant="secondary"
21
21
  ></dss-button>
22
22
  <dss-button
23
+ icon="add_circle"
23
24
  label="${translate("importDataManager.actions.import")}"
24
25
  @click="${() => {
25
26
  props._accept();
@@ -19,7 +19,7 @@ export interface PrimariaRegionManager extends HarmonixRegionManager {
19
19
  activatePluginView(regionName: string, pluginId: string, viewId: string): Promise<void>;
20
20
  getCurrentMainViewActive(): string | undefined;
21
21
  _removeAllViews(): Promise<void>;
22
- _destroy(): void;
22
+ _destroy(): Promise<void>;
23
23
  }
24
24
 
25
25
  /** Totes les regions que coneix el shell, per poder-les recórrer al tancar. */
@@ -215,8 +215,8 @@ class RegionManagerProxy implements PrimariaRegionManager {
215
215
  }
216
216
  }
217
217
 
218
- _destroy() {
219
- this.regionManager.destroy();
218
+ async _destroy() {
219
+ await this.regionManager.destroy();
220
220
  }
221
221
  }
222
222
 
package/src/disposer.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { activityMonitor, sessionRefreshTimer, shellApi } from "./api/api";
2
2
  import { disposeFeatures } from "./features/bootstrapper";
3
3
  import { ExitShellPayload } from "./features/exit/request";
4
- export const disposeShell = () => {
5
- disposeFeatures(shellApi);
4
+ export const disposeShell = async () => {
5
+ await disposeFeatures(shellApi);
6
6
  shellApi.interactionService.dispose();
7
7
  sessionRefreshTimer.stop();
8
8
  activityMonitor.stop();
@@ -12,10 +12,10 @@ export const useFeatures = (api: PrimariaApi) => {
12
12
  api.broker.send(new GetUserInfo());
13
13
  };
14
14
 
15
- export const disposeFeatures = (api: PrimariaApi) => {
15
+ export const disposeFeatures = async (api: PrimariaApi) => {
16
16
  disposeGetUserInfo();
17
17
  disposeExitShell();
18
18
  container.unbindAll();
19
- api.regionManager._destroy();
19
+ await api.regionManager._destroy();
20
20
  api.broker._clear();
21
21
  };
@@ -30,7 +30,7 @@ export class ExitShellHandler {
30
30
  this.unmountViewsAndDisposePlugins(), // S'intenta executar un dispose normal
31
31
  this.timeout(10000), // Si passen 5s, es segueix amb l'execució
32
32
  ]);
33
- disposeShell();
33
+ await disposeShell();
34
34
  this.emitClose(evt);
35
35
  } catch (error) {
36
36
  this.api.notificationService.error(translate("errors.exit"));
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-C6IdTseU.js","sources":["../src/api/import-data-manager/component/template.ts","../src/api/import-data-manager/component/component.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { translate } from \"../../../locales\";\nimport { shellApi } from \"../../api\";\nimport { ImportDataManagerModal } from \"./component\";\n\nexport const template = (props: ImportDataManagerModal) => {\n return html`\n <div class=\"container\">\n <div class=\"content\">\n <primaria-region name=\"${shellApi.regionManager.regions.shell.importDataActivityHistory}\"></primaria-region>\n <primaria-region name=\"${shellApi.regionManager.regions.shell.importData}\"></primaria-region>\n </div>\n <div class=\"footer\">\n <dss-button\n label=\"${translate(\"importDataManager.actions.cancel\")}\"\n @click=\"${() => {\n props.cancel();\n }}\"\n size=\"md\"\n variant=\"secondary\"\n ></dss-button>\n <dss-button\n label=\"${translate(\"importDataManager.actions.import\")}\"\n @click=\"${() => {\n props._accept();\n }}\"\n size=\"md\"\n variant=\"primary\"\n ></dss-button>\n </div>\n </div>\n `;\n};\n","import { LitElement, css, html, unsafeCSS } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { ConfirmationContentProps } from \"../../interaction-service\";\nimport styles from \"./styles.css?inline\";\nimport { template } from \"./template\";\n\n@customElement(\"import-data-manager-modal\")\nexport class ImportDataManagerModal extends LitElement implements ConfirmationContentProps<undefined, undefined> {\n data: undefined;\n setResult: (result: undefined) => void;\n setIsValid: (isValid: boolean) => void;\n confirm: () => void;\n // Injectat pel servei d'interacció igual que la resta; faltava des que es va afegir a la\n // interfície.\n confirmResult: (result: undefined) => void;\n cancel: () => void;\n\n render() {\n return html`${template(this)}`;\n }\n\n static styles = css`\n ${unsafeCSS(styles)}\n `;\n\n _accept = () => {\n this.confirm();\n };\n}\n"],"names":["template","props","html","shellApi","translate","ImportDataManagerModal","LitElement","css","unsafeCSS","styles","__decorateClass","customElement"],"mappings":";kiCAKaA,IAAW,CAACC,MAChBC;AAAAA;AAAAA;AAAAA,iCAGwBC,EAAS,cAAc,QAAQ,MAAM,yBAAyB;AAAA,iCAC9DA,EAAS,cAAc,QAAQ,MAAM,UAAU;AAAA;AAAA;AAAA;AAAA,mBAI7DC,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAH,EAAM,OAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,mBAKQG,EAAU,kCAAkC,CAAC;AAAA,oBAC5C,MAAM;AACd,EAAAH,EAAM,QAAA;AACR,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;AClBJ,IAAMI,IAAN,cAAqCC,EAAqE;AAAA,EAA1G,cAAA;AAAA,UAAA,GAAA,SAAA,GAkBL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AArBaK,EAcJ,SAASE;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAfVJ,IAANK,EAAA;AAAA,EADNC,EAAc,2BAA2B;AAAA,GAC7BN,CAAA;"}