@uxland/primary-shell 7.45.10 → 7.45.11

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-CnsLn8vW.js";
1
+ import { s, t as d, k as l, h as p, r as m, i as g, a as h } from "./index-DeP4Bkz8.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-Bry79kcE.js.map
52
+ //# sourceMappingURL=component-DXEGE47c.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component-Bry79kcE.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-DXEGE47c.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;"}
@@ -9842,7 +9842,7 @@ class ImportDataManagerImpl {
9842
9842
  async import(W, X) {
9843
9843
  this.currentImporterId = W, this.currentImportParams = X, this.selectedItems = {}, this.pluginTexts = {};
9844
9844
  try {
9845
- const { ImportDataManagerModal: te } = await import("./component-Bry79kcE.js"), { confirmed: re } = await this.interactionService.confirm(
9845
+ const { ImportDataManagerModal: te } = await import("./component-DXEGE47c.js"), { confirmed: re } = await this.interactionService.confirm(
9846
9846
  void 0,
9847
9847
  { component: te },
9848
9848
  {
@@ -16319,7 +16319,7 @@ const measureElementWithMargins = (J) => {
16319
16319
  };
16320
16320
  class VirtualScroller {
16321
16321
  constructor(W) {
16322
- this._options = W;
16322
+ this._lastVisibleState = { virtualItems: [], totalHeight: 0 }, this._savedScrollTop = 0, this._viewportWasHidden = !1, this._options = W;
16323
16323
  }
16324
16324
  setup(W, X) {
16325
16325
  return this._viewport = W, this._virtualizer = new Virtualizer({
@@ -16327,12 +16327,12 @@ class VirtualScroller {
16327
16327
  getScrollElement: () => this._viewport ?? null,
16328
16328
  estimateSize: (te) => this._options.estimateItemHeight(te),
16329
16329
  overscan: this._options.overscan ?? 5,
16330
- measureElement: (te) => (this._options.measureElement ?? measureElementWithMargins)(te),
16330
+ measureElement: (te) => this._measureItem(te),
16331
16331
  observeElementRect,
16332
16332
  observeElementOffset,
16333
16333
  scrollToFn: elementScroll,
16334
16334
  onChange: () => {
16335
- X(this.getState());
16335
+ this._trackViewportVisibility(), X(this.getState());
16336
16336
  }
16337
16337
  }), this._cleanup = this._virtualizer._didMount(), this._virtualizer._willUpdate(), X(this.getState()), () => {
16338
16338
  this._cleanup?.();
@@ -16362,11 +16362,38 @@ class VirtualScroller {
16362
16362
  getOffsetForIndex(W) {
16363
16363
  return this._virtualizer?.getOffsetForIndex(W, "start")?.[0] ?? 0;
16364
16364
  }
16365
+ // While the view is hidden every rendered item's rect measures 0px (though
16366
+ // its computed margins do not); the virtualizer's per-item ResizeObserver
16367
+ // would push those collapsed sizes into its size cache and apply scroll
16368
+ // "corrections", shifting every offset. Reuse the cached measurement (or the
16369
+ // estimate) so sizes survive the hide/show cycle.
16370
+ _measureItem(W) {
16371
+ if (W.getBoundingClientRect().height === 0) {
16372
+ const X = Number(W.getAttribute("data-index"));
16373
+ return this._virtualizer?.measurementsCache[X]?.size ?? this._options.estimateItemHeight(X);
16374
+ }
16375
+ return (this._options.measureElement ?? measureElementWithMargins)(W);
16376
+ }
16377
+ // Deactivated region views are hidden with display:none: the viewport
16378
+ // measures 0px, the virtualizer nulls its range (empty virtualItems) and the
16379
+ // browser may drop the scroll position. Track the hidden viewport so
16380
+ // `getState` keeps returning the last visible state, and restore the scroll
16381
+ // offset on the first change after the viewport shows again.
16382
+ _trackViewportVisibility() {
16383
+ if (this._viewport) {
16384
+ if (this._viewport.clientHeight === 0) {
16385
+ this._viewportWasHidden = !0;
16386
+ return;
16387
+ }
16388
+ this._viewportWasHidden && (this._viewportWasHidden = !1, this._viewport.scrollTop = this._savedScrollTop), this._savedScrollTop = this._viewport.scrollTop;
16389
+ }
16390
+ }
16365
16391
  getState() {
16366
- return {
16367
- virtualItems: this._virtualizer?.getVirtualItems() ?? [],
16368
- totalHeight: this._virtualizer?.getTotalSize() ?? 0
16369
- };
16392
+ const W = !!(this._viewport && this._viewport.clientHeight > 0);
16393
+ return this._virtualizer && W && (this._lastVisibleState = {
16394
+ virtualItems: this._virtualizer.getVirtualItems(),
16395
+ totalHeight: this._virtualizer.getTotalSize()
16396
+ }), this._lastVisibleState;
16370
16397
  }
16371
16398
  }
16372
16399
  var __defProp$o = Object.defineProperty, __getOwnPropDesc$d = Object.getOwnPropertyDescriptor, __decorateClass$r = (J, W, X, te) => {
@@ -53717,4 +53744,4 @@ export {
53717
53744
  primariaApiFactory as y,
53718
53745
  PrimariaContentSwitcher as z
53719
53746
  };
53720
- //# sourceMappingURL=index-CnsLn8vW.js.map
53747
+ //# sourceMappingURL=index-DeP4Bkz8.js.map