@uxland/primary-shell 7.43.1 → 7.43.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.
@@ -1,4 +1,4 @@
1
- import { s, t as d, k as l, h as p, r as m, i as g, a as h } from "./index-B0BnyHR2.js";
1
+ import { s, t as d, k as l, h as p, r as m, i as g, a as h } from "./index-B9gGnkza.js";
2
2
  const v = ".container{background-color:#fff;display:flex;flex-direction:column;min-width:500px;width:95vw;height:95vh;border-radius:var(--dss-radius-sm);overflow:hidden}.content{display:grid;flex:1;min-height:0;grid-template-columns:1fr 1fr;gap:16px;padding:16px}.content>primaria-region{width:100%;height:100%;min-height:0}.content primaria-region>div{width:100%;height:100%;border:1px solid var(--color-neutral-200);border-radius:8px;padding:16px;box-sizing:border-box}.content>primaria-region[name=import-data-region]>div{overflow-y:auto}.content>primaria-region[name=import-data-activity-history-region]>div{display:flex;flex-direction:column;gap:16px;overflow:hidden}.content>primaria-region[name=import-data-activity-history-region]>div>*{flex-shrink:0}.content>primaria-region[name=import-data-activity-history-region]>div>*:last-child{flex:1;min-height:0}.footer{display:flex;flex-direction:row;align-items:center;background:#fff;justify-content:end;gap:12px;height:56px;border-top:1px solid var(--color-neutral-100);padding:var(--dss-spacing-sm)}", f = (i) => l`
3
3
  <div class="container">
4
4
  <div class="content">
@@ -49,4 +49,4 @@ t = x([
49
49
  export {
50
50
  t as ImportDataManagerModal
51
51
  };
52
- //# sourceMappingURL=component-CZHFJbG2.js.map
52
+ //# sourceMappingURL=component-CU8m_HuW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-CZHFJbG2.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 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,GAeL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAlBaK,EAWJ,SAASE;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAZVJ,IAANK,EAAA;AAAA,EADNC,EAAc,2BAA2B;AAAA,GAC7BN,CAAA;"}
1
+ {"version":3,"file":"component-CU8m_HuW.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 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,GAeL,KAAA,UAAU,MAAM;AACd,WAAK,QAAA;AAAA,IACP;AAAA,EAAA;AAAA,EAVA,SAAS;AACP,WAAOJ,IAAOF,EAAS,IAAI,CAAC;AAAA,EAC9B;AASF;AAlBaK,EAWJ,SAASE;AAAAA,MACZC,EAAUC,CAAM,CAAC;AAAA;AAZVJ,IAANK,EAAA;AAAA,EADNC,EAAc,2BAA2B;AAAA,GAC7BN,CAAA;"}
@@ -5482,9 +5482,7 @@ const validateMpidHeader = (J, W) => {
5482
5482
  const ne = await J.refreshToken();
5483
5483
  return oe.headers.Authorization = `Bearer ${ne}`, te(oe);
5484
5484
  } catch (ne) {
5485
- return console.error("Error refreshing token:", ne), W.publish(BROKER_EVENTS.shell.refreshTokenFailed, {
5486
- request: oe
5487
- }), Promise.reject(re);
5485
+ return console.error("Error refreshing token:", ne), Promise.reject(re);
5488
5486
  }
5489
5487
  }
5490
5488
  return Promise.reject(re);
@@ -5494,28 +5492,27 @@ const validateMpidHeader = (J, W) => {
5494
5492
  let instance;
5495
5493
  const createHttpClient = (J, W) => (instance || (instance = createAxiosInstance(J, W)), { request: instance.request }), CHECK_INTERVAL_MS = 3e4, REFRESH_THRESHOLD_S = 120, ACTIVITY_WINDOW_MS = 900 * 1e3;
5496
5494
  class SessionRefreshTimerImpl {
5497
- constructor(W, X, te) {
5498
- this.tokenManager = W, this.activityMonitor = X, this.broker = te, this.intervalId = null, this.isRefreshing = !1, this.start = () => {
5495
+ constructor(W, X) {
5496
+ this.tokenManager = W, this.activityMonitor = X, this.intervalId = null, this.isRefreshing = !1, this.start = () => {
5499
5497
  this.intervalId = setInterval(this.checkAndRefresh, CHECK_INTERVAL_MS);
5500
5498
  }, this.stop = () => {
5501
5499
  this.intervalId !== null && (clearInterval(this.intervalId), this.intervalId = null);
5502
5500
  }, this.getTokenExpiry = () => {
5503
5501
  try {
5504
- const { exp: re } = jwtDecode(this.tokenManager.getToken());
5505
- return re ?? 0;
5502
+ const { exp: te } = jwtDecode(this.tokenManager.getToken());
5503
+ return te ?? 0;
5506
5504
  } catch {
5507
5505
  return 0;
5508
5506
  }
5509
5507
  }, this.checkAndRefresh = async () => {
5510
- const re = Date.now();
5511
- if (re - this.activityMonitor.getLastActivityTimestamp() > ACTIVITY_WINDOW_MS || this.isRefreshing) return;
5512
- const oe = this.getTokenExpiry();
5513
- if (oe !== 0 && oe - re / 1e3 <= REFRESH_THRESHOLD_S) {
5508
+ const te = Date.now();
5509
+ if (te - this.activityMonitor.getLastActivityTimestamp() > ACTIVITY_WINDOW_MS || this.isRefreshing) return;
5510
+ const re = this.getTokenExpiry();
5511
+ if (re !== 0 && re - te / 1e3 <= REFRESH_THRESHOLD_S) {
5514
5512
  this.isRefreshing = !0;
5515
5513
  try {
5516
5514
  await this.tokenManager.refreshToken();
5517
5515
  } catch {
5518
- this.broker.publish(BROKER_EVENTS.shell.refreshTokenFailed, {});
5519
5516
  } finally {
5520
5517
  this.isRefreshing = !1;
5521
5518
  }
@@ -5523,7 +5520,7 @@ class SessionRefreshTimerImpl {
5523
5520
  };
5524
5521
  }
5525
5522
  }
5526
- const createSessionRefreshTimer = (J, W, X) => new SessionRefreshTimerImpl(J, W, X);
5523
+ const createSessionRefreshTimer = (J, W) => new SessionRefreshTimerImpl(J, W);
5527
5524
  var jsxRuntime = { exports: {} }, reactJsxRuntime_production = {};
5528
5525
  /**
5529
5526
  * @license React
@@ -9778,25 +9775,29 @@ class RegionManagerProxy {
9778
9775
  const createRegionManagerProxy = (J, W, X) => new RegionManagerProxy(J, W, X);
9779
9776
  let token, refreshToken, tokenInitialized = !1;
9780
9777
  class TokenManagerImpl {
9781
- constructor() {
9782
- this.getUrlParams = () => new URLSearchParams(window.location.search), this.initToken = () => {
9778
+ constructor(W) {
9779
+ this.broker = W, this.getUrlParams = () => new URLSearchParams(window.location.search), this.initToken = () => {
9783
9780
  if (tokenInitialized) throw new Error("Token already initialized");
9784
9781
  tokenInitialized = !0;
9785
- const W = this.getUrlParams();
9786
- return token = W.get("access_token") || "", refreshToken = W.get("refresh_token") || "", token;
9787
- }, this.setInitialTokens = (W, X) => {
9782
+ const X = this.getUrlParams();
9783
+ return token = X.get("access_token") || "", refreshToken = X.get("refresh_token") || "", token;
9784
+ }, this.setInitialTokens = (X, te) => {
9788
9785
  if (tokenInitialized) throw new Error("Token already initialized");
9789
- token = W, refreshToken = X, tokenInitialized = !0;
9786
+ token = X, refreshToken = te, tokenInitialized = !0;
9790
9787
  }, this.getToken = () => (tokenInitialized || this.initToken(), token), this.refreshToken = async () => {
9791
9788
  tokenInitialized || this.initToken();
9792
- const W = await axios.post("/api/token/refresh", { token: refreshToken }), { access_token: X, refresh_token: te } = W.data;
9793
- if (!X) throw new Error("Invalid refresh token response");
9794
- return token = X, refreshToken = te, token;
9789
+ try {
9790
+ const X = await axios.post("/api/token/refresh", { token: refreshToken }), { access_token: te, refresh_token: re } = X.data;
9791
+ if (!te) throw new Error("Invalid refresh token response");
9792
+ return token = te, refreshToken = re, token;
9793
+ } catch (X) {
9794
+ throw this.broker.publish(BROKER_EVENTS.shell.refreshTokenFailed, {}), X;
9795
+ }
9795
9796
  };
9796
9797
  }
9797
9798
  }
9798
9799
  let tokenManager$1;
9799
- const createTokenManager = () => tokenManager$1 || (tokenManager$1 = new TokenManagerImpl(), tokenManager$1);
9800
+ const createTokenManager = (J) => tokenManager$1 || (tokenManager$1 = new TokenManagerImpl(J), tokenManager$1);
9800
9801
  class UserManagerImpl {
9801
9802
  constructor(W) {
9802
9803
  this.tokenManager = W, this.getRole = () => this.getAccessInfo()?.role_type, this.isUserRoleAdministrative = () => this.getRole() === "ADM", this.getFullName = () => {
@@ -9830,7 +9831,7 @@ class ImportDataManagerImpl {
9830
9831
  async import(W, X) {
9831
9832
  this.currentImporterId = W, this.currentImportParams = X, this.selectedItems = {}, this.pluginTexts = {};
9832
9833
  try {
9833
- const { ImportDataManagerModal: te } = await import("./component-CZHFJbG2.js"), { confirmed: re } = await this.interactionService.confirm(
9834
+ const { ImportDataManagerModal: te } = await import("./component-CU8m_HuW.js"), { confirmed: re } = await this.interactionService.confirm(
9834
9835
  void 0,
9835
9836
  { component: te },
9836
9837
  {
@@ -9891,7 +9892,7 @@ class PrimariaContextManagerImpl {
9891
9892
  }
9892
9893
  }
9893
9894
  let contextManager$1;
9894
- const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), broker$1 = createBroker(), regionManager = f$p("primaria"), PrimariaRegionHost = v$k(regionManager), tokenManager = createTokenManager(), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor, broker$1), globalStateManager = createGlobalStateManager(broker$1), contextManager = createContextManager(), pluginBusyManager = new PluginBusyManagerImpl(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker$1), interactionService = new ParimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker$1, notificationService), importDataManager = new ImportDataManagerImpl(interactionService), primariaApiFactory = (J) => {
9895
+ const createContextManager = () => contextManager$1 || (contextManager$1 = new PrimariaContextManagerImpl(), contextManager$1), broker$1 = createBroker(), regionManager = f$p("primaria"), PrimariaRegionHost = v$k(regionManager), tokenManager = createTokenManager(broker$1), userManager = createUserManager(tokenManager), activityMonitor = createActivityMonitor(), sessionRefreshTimer = createSessionRefreshTimer(tokenManager, activityMonitor), globalStateManager = createGlobalStateManager(broker$1), contextManager = createContextManager(), pluginBusyManager = new PluginBusyManagerImpl(), exitGuardManager = new ExitGuardManagerImpl(), quickActionBusyManager = new QuickActionBusyManagerImpl(broker$1), interactionService = new ParimariaInteractionServiceImpl(), notificationService = new PrimariaNotificationServiceImpl(), ecapEventManager = createEcapEventManager(globalStateManager), pdfViewerManager = createPdfViewerManager(broker$1, notificationService), importDataManager = new ImportDataManagerImpl(interactionService), primariaApiFactory = (J) => {
9895
9896
  const W = createRegionManagerProxy(J, regionManager, broker$1);
9896
9897
  return {
9897
9898
  pluginInfo: J,
@@ -53420,4 +53421,4 @@ export {
53420
53421
  primariaApiFactory as y,
53421
53422
  PrimariaContentSwitcher as z
53422
53423
  };
53423
- //# sourceMappingURL=index-B0BnyHR2.js.map
53424
+ //# sourceMappingURL=index-B9gGnkza.js.map