@orangelogic/design-system 2.187.0 → 2.189.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.
@@ -1,7 +1,7 @@
1
1
  import "./resize-observer.js";
2
2
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
3
3
  import "../chunks/component.styles.CRO4Odto.js";
4
- import { C as A } from "../chunks/tab-group.CjISeeMB.js";
4
+ import { C as A } from "../chunks/tab-group.uSHlsFu8.js";
5
5
  import "../chunks/custom-element.L4WJXn1j.js";
6
6
  import "../chunks/i18n.DbXTTLXx.js";
7
7
  import "../chunks/scroll.xtO5yojm.js";
@@ -1,6 +1,6 @@
1
1
  import { n as a, C as v } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
- import { c as u } from "../chunks/component.styles.CRO4Odto.js";
3
- import { c as h } from "../chunks/custom-element.L4WJXn1j.js";
2
+ import { c as h } from "../chunks/component.styles.CRO4Odto.js";
3
+ import { c as u } from "../chunks/custom-element.L4WJXn1j.js";
4
4
  import { L as f } from "../chunks/i18n.DbXTTLXx.js";
5
5
  import { H as x } from "../chunks/slot.j5oheLJC.js";
6
6
  import { w as p } from "../chunks/watch.DJF5K-8U.js";
@@ -30,6 +30,12 @@ const w = b`.tab{border-radius:var(--cx-border-radius-small);padding:var(--tab-p
30
30
  );
31
31
  }
32
32
 
33
+
34
+ :host([data-cx-tab-group__tab--hidden]) {
35
+ visibility: hidden;
36
+ pointer-events: none;
37
+ }
38
+
33
39
  ${w}
34
40
 
35
41
  ${k}
@@ -90,7 +96,7 @@ let I = 0, t = class extends v {
90
96
  }
91
97
  }
92
98
  };
93
- t.styles = [u, C];
99
+ t.styles = [h, C];
94
100
  t.dependencies = {
95
101
  "cx-icon-button": g,
96
102
  "cx-line-clamp": y
@@ -129,7 +135,7 @@ e([
129
135
  p("disabled")
130
136
  ], t.prototype, "handleDisabledChange", 1);
131
137
  t = e([
132
- h("cx-tab")
138
+ u("cx-tab")
133
139
  ], t);
134
140
  export {
135
141
  t as default
@@ -75,7 +75,7 @@ import { default as FJt } from "./step.js";
75
75
  import { default as jJt } from "./stepper.js";
76
76
  import db from "./switch.js";
77
77
  import a3 from "./tab.js";
78
- import { C as s3, T as MF, a as PF, b as NF, g as r8 } from "../chunks/tab-group.CjISeeMB.js";
78
+ import { C as s3, T as MF, a as PF, b as NF, g as r8 } from "../chunks/tab-group.uSHlsFu8.js";
79
79
  import s6 from "./tab-panel.js";
80
80
  import { default as VJt } from "./tag.js";
81
81
  import l6 from "./textarea.js";
@@ -121,7 +121,7 @@ import { a as JZt, g as ZZt } from "../chunks/slot.j5oheLJC.js";
121
121
  import { c as Or, d as Oee, H as An, e as Ta, f as gs, a as Dee, b as rr } from "../chunks/resizable-component.styles.CAfXABBc.js";
122
122
  import { a as Fo, E as Kn, b as Yv, O as rp, T as vp, G as k8 } from "../chunks/index.Cpamj0jB.js";
123
123
  import { C as eQt } from "../chunks/index.Cpamj0jB.js";
124
- import { A as Bl, D as Ck, P as ZS, E as Mu, B as lt, c as yp, S as If, d as Bo, e as JF, g as Iee, T as _8, a as ZF, f as c3 } from "../chunks/transformation.8uLv6uwG.js";
124
+ import { A as Bl, D as Ck, P as ZS, B as lt, E as Mu, c as yp, S as If, d as Bo, e as JF, g as Iee, T as _8, a as ZF, f as c3 } from "../chunks/transformation.8uLv6uwG.js";
125
125
  import { b as nQt } from "../chunks/transformation.8uLv6uwG.js";
126
126
  import { t as Tu, b as Mee, c as C8, g as S8 } from "../chunks/toast.CXEAfCvN.js";
127
127
  import { j as rQt, f as oQt, e as aQt, i as sQt, a as lQt, h as cQt, m as dQt, d as uQt, r as pQt } from "../chunks/toast.CXEAfCvN.js";
@@ -138326,6 +138326,9 @@ const xzt = IFt.extend({
138326
138326
  },
138327
138327
  onUpdate() {
138328
138328
  u && u.requestUpdate();
138329
+ },
138330
+ parseOptions: {
138331
+ preserveWhitespace: !0
138329
138332
  }
138330
138333
  }), c = k, k;
138331
138334
  },
@@ -143824,7 +143827,7 @@ var nUt = Object.defineProperty, iUt = Object.getOwnPropertyDescriptor, li = (n,
143824
143827
  };
143825
143828
  let Qn = class extends hn {
143826
143829
  constructor() {
143827
- super(), this.localize = new En(this), this.configsController = new Yx(this.localize), this.initialData = "", this.device = "desktop", this.devices = Iee, this.autoInit = !1, this.pageId = "", this.allowDuplicateBlocks = !1, this.enableAssetFormatControls = !1, this.enableMetrics = !1, this.defaultImageFormat = Pu, this.defaultVideoPosterFormat = Pu, this.defaultGalleryFormat = Pu, this.defaultCarouselFormat = Pu, this.defaultTimelineFormat = Pu, this.enableFontFamilyControls = !1, this.allowedFolders = [], this.defaultLanguage = "en-us", this.supportedLanguages = ["en"], this.mode = Mu.Template, this.contentBuilder = null, this.ready = !1, this.editingComponent = null, this.isGalleryConfigOpen = !1, this.hoveredComponent = void 0, this.hoveredComponentPlacement = "top", this.defaultRowGap = 0, this.containerDropdowns = [], this.containerDropdownStateMap = {}, this.distance = void 0, this.toolbar = [], this.toolbarActive = !1, this.childSelected = void 0, this.mappedSupportedLanguages = [], this.mousePosition = { x: 0, y: 0 }, this._teamSpaceRoles = [], this.canvasDocument = null, this._dsm = null, this.hasBoundUpdate = !1, this.newlyAddedComponentTimeout = null, this.initializeCustomFrame = _Nt(), this.containerDropdownObservers = [], this.nextMapHoveredBadgeState = null, this.deselectAll = this.deselectAll.bind(this), this.handleCanvasClick = this.handleCanvasClick.bind(this), this.handleRootToolbarRightClick = this.handleRootToolbarRightClick.bind(this), this.handleCanvasKeydown = this.handleCanvasKeydown.bind(this), this.handleTemplatesDataSourceChange = this.handleTemplatesDataSourceChange.bind(this), this.handleCanvasMouseMove = this.handleCanvasMouseMove.bind(this), this.handleTemplateManagerUpdated = this.handleTemplateManagerUpdated.bind(this), this.handleCanvasScroll = this.handleCanvasScroll.bind(this);
143830
+ super(), this.localize = new En(this), this.configsController = new Yx(this.localize), this.initialData = "", this.device = "desktop", this.devices = Iee, this.autoInit = !1, this.pageId = "", this.allowDuplicateBlocks = !1, this.enableAssetFormatControls = !1, this.enableMetrics = !1, this.defaultImageFormat = Pu, this.defaultVideoPosterFormat = Pu, this.defaultGalleryFormat = Pu, this.defaultCarouselFormat = Pu, this.defaultTimelineFormat = Pu, this.enableFontFamilyControls = !1, this.allowedFolders = [], this.defaultLanguage = "en-us", this.supportedLanguages = ["en"], this.mode = Mu.Template, this.contentBuilder = null, this.ready = !1, this.editingComponent = null, this.isGalleryConfigOpen = !1, this.hoveredComponent = void 0, this.hoveredComponentPlacement = "top", this.defaultRowGap = 0, this.containerDropdowns = [], this.containerDropdownStateMap = {}, this.distance = void 0, this.toolbar = [], this.toolbarActive = !1, this.childSelected = void 0, this.mappedSupportedLanguages = [], this.mousePosition = { x: 0, y: 0 }, this._teamSpaceRoles = [], this.canvasDocument = null, this._dsm = null, this.hasBoundUpdate = !1, this.blockTypesPromise = null, this.newlyAddedComponentTimeout = null, this.initializeCustomFrame = _Nt(), this.containerDropdownObservers = [], this.nextMapHoveredBadgeState = null, this.deselectAll = this.deselectAll.bind(this), this.handleCanvasClick = this.handleCanvasClick.bind(this), this.handleRootToolbarRightClick = this.handleRootToolbarRightClick.bind(this), this.handleCanvasKeydown = this.handleCanvasKeydown.bind(this), this.handleTemplatesDataSourceChange = this.handleTemplatesDataSourceChange.bind(this), this.handleCanvasMouseMove = this.handleCanvasMouseMove.bind(this), this.handleTemplateManagerUpdated = this.handleTemplateManagerUpdated.bind(this), this.handleCanvasScroll = this.handleCanvasScroll.bind(this);
143828
143831
  }
143829
143832
  get teamSpaceRoles() {
143830
143833
  return this._teamSpaceRoles;
@@ -143835,6 +143838,11 @@ let Qn = class extends hn {
143835
143838
  get dsm() {
143836
143839
  return this._dsm ??= this.contentBuilder?.DataSources, this._dsm;
143837
143840
  }
143841
+ prefetchBlockTypes() {
143842
+ return this.blockTypesPromise = D3t({
143843
+ excludeBlocksWithNoTemplates: !this.isDesigner
143844
+ });
143845
+ }
143838
143846
  /**
143839
143847
  * Host callbacks handed to GrapesJS blocks and config UI, each timed via
143840
143848
  * `measurePromise` so the promise's own settling is the completion signal.
@@ -144438,7 +144446,7 @@ let Qn = class extends hn {
144438
144446
  }), this.contentBuilder?.onReady(async () => {
144439
144447
  if (!this.contentBuilder)
144440
144448
  return;
144441
- this.contentBuilder.Canvas.getFrameEl().setAttribute("aria-label", "content-builder-frame"), this.updateFrameSize(), this._teamSpaceRoles = await this.fetchTeamSpaceRoles();
144449
+ this.contentBuilder.Canvas.getFrameEl().setAttribute("aria-label", "content-builder-frame"), this.updateFrameSize(), this._teamSpaceRoles = await this.fetchTeamSpaceRoles(), this.prefetchBlockTypes();
144442
144450
  }), this.contentBuilder?.on("load", async (i) => {
144443
144451
  this.contentBuilder?.getEl()?.addEventListener(
144444
144452
  "mousedown",
@@ -144543,9 +144551,9 @@ let Qn = class extends hn {
144543
144551
  this.hasBoundUpdate || (this.contentBuilder?.on("update", () => {
144544
144552
  this.emit("cx-change");
144545
144553
  }), this.hasBoundUpdate = !0);
144546
- const { component: o, index: a, parentComponent: s } = i ?? {}, l = await D3t({
144547
- excludeBlocksWithNoTemplates: !this.isDesigner
144548
- }), c = this.contentBuilder?.getWrapper(), d = c?.findType(lt.Column) ?? [], u = d.find((k) => k.parent() === c) ?? d[0];
144554
+ const { component: o, index: a, parentComponent: s } = i ?? {};
144555
+ this.blockTypesPromise ??= this.prefetchBlockTypes();
144556
+ const l = await this.blockTypesPromise, c = this.contentBuilder?.getWrapper(), d = c?.findType(lt.Column) ?? [], u = d.find((k) => k.parent() === c) ?? d[0];
144549
144557
  if (!u) {
144550
144558
  this.blockPicker.limitedBlocks = vR(lt.Column), this.blockPicker.show(), r();
144551
144559
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.187.0",
4
+ "version": "2.189.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -1,5 +1,6 @@
1
1
  import { HideOptions, Rect } from '@floating-ui/dom';
2
2
  import { default as CortexElement } from '../../../../base/src/cortex-element.ts';
3
+ import { PopupToggle } from '../../../../types/src/popup';
3
4
  import { CSSResultGroup } from 'lit';
4
5
 
5
6
  export interface VirtualElement {
@@ -66,6 +67,13 @@ export default class CxPopup extends CortexElement {
66
67
  * clipped, using a `fixed` position strategy can often workaround it.
67
68
  */
68
69
  strategy: 'absolute' | 'fixed' | 'overlay';
70
+ /**
71
+ * Determines how the popup hides its panel while closed. `display` takes the panel out of layout,
72
+ * so nothing inside a closed popup is measured or can grow its surroundings. `visibility` keeps
73
+ * the panel laid out and only hides it visually, which lets it be measured before opening and
74
+ * avoids a flash on first open, at the cost of a closed panel that still occupies layout.
75
+ */
76
+ toggle: PopupToggle;
69
77
  /** The distance in pixels from which to offset the panel away from its anchor. */
70
78
  distance: number;
71
79
  /** The distance in pixels from which to offset the panel along its anchor. */
@@ -57,7 +57,7 @@ export default class CxTabGroup extends CortexElement {
57
57
  * repeatedly in quick succession (resize, slotchange, alignment/label changes), and each call creates its own
58
58
  * observer that only disconnects itself once its callback fires. Without tracking and disconnecting the previous
59
59
  * instance up front, a stale observer can fire after a newer one already recomputed tab visibility, overwriting
60
- * dropdownOffset/data-hidden with outdated results.
60
+ * dropdownOffset and the tabs' hidden marker with outdated results.
61
61
  */
62
62
  private overflowObserver?;
63
63
  private tabs;
@@ -118,6 +118,7 @@ export default class CxTabGroup extends CortexElement {
118
118
  minTabWidth: number;
119
119
  /** Minimum clamp width - The minimum width of the tab not to be clamped */
120
120
  private static readonly MIN_CLAMP_WIDTH;
121
+ private static readonly HIDDEN_TAB_ATTRIBUTE;
121
122
  connectedCallback(): void;
122
123
  disconnectedCallback(): void;
123
124
  /**
@@ -226,6 +226,14 @@ export default class CxContentBuilder extends CortexElement {
226
226
  private _dsm;
227
227
  private get dsm();
228
228
  private hasBoundUpdate;
229
+ /**
230
+ * In-flight/resolved block-types fetch, kept as a promise (not the awaited value) so the
231
+ * `component:open-picker` handler can share it even if it fires before the prefetch below
232
+ * settles. Prefetched once `isDesigner` is known (right after team-space roles resolve) so
233
+ * the block picker dialog shows immediately instead of waiting on the API on first open.
234
+ */
235
+ private blockTypesPromise;
236
+ private prefetchBlockTypes;
229
237
  private newlyAddedComponentTimeout;
230
238
  private readonly initializeCustomFrame;
231
239
  private containerDropdownObservers;
@@ -0,0 +1,4 @@
1
+ export declare enum PopupToggle {
2
+ Display = "display",
3
+ Visibility = "visibility"
4
+ }
@@ -431,6 +431,10 @@
431
431
  * Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is clipped, using a `fixed` position strategy can often workaround it.
432
432
  */
433
433
  strategy?: 'absolute' | 'fixed' | 'overlay';
434
+ /**
435
+ * Determines how the popup hides its panel while closed. `display` takes the panel out of layout, so nothing inside a closed popup is measured or can grow its surroundings. `visibility` keeps the panel laid out and only hides it visually, which lets it be measured before opening and avoids a flash on first open, at the cost of a closed panel that still occupies layout.
436
+ */
437
+ toggle?: 'display' | 'visibility';
434
438
  /**
435
439
  * The distance in pixels from which to offset the panel away from its anchor.
436
440
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.187.0",
4
+ "version": "2.189.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {