@orangelogic/design-system 2.188.0 → 3.0.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.
@@ -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";
@@ -143827,7 +143827,7 @@ var nUt = Object.defineProperty, iUt = Object.getOwnPropertyDescriptor, li = (n,
143827
143827
  };
143828
143828
  let Qn = class extends hn {
143829
143829
  constructor() {
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.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);
143831
143831
  }
143832
143832
  get teamSpaceRoles() {
143833
143833
  return this._teamSpaceRoles;
@@ -143838,6 +143838,11 @@ let Qn = class extends hn {
143838
143838
  get dsm() {
143839
143839
  return this._dsm ??= this.contentBuilder?.DataSources, this._dsm;
143840
143840
  }
143841
+ prefetchBlockTypes() {
143842
+ return this.blockTypesPromise = D3t({
143843
+ excludeBlocksWithNoTemplates: !this.isDesigner
143844
+ });
143845
+ }
143841
143846
  /**
143842
143847
  * Host callbacks handed to GrapesJS blocks and config UI, each timed via
143843
143848
  * `measurePromise` so the promise's own settling is the completion signal.
@@ -144441,7 +144446,7 @@ let Qn = class extends hn {
144441
144446
  }), this.contentBuilder?.onReady(async () => {
144442
144447
  if (!this.contentBuilder)
144443
144448
  return;
144444
- 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();
144445
144450
  }), this.contentBuilder?.on("load", async (i) => {
144446
144451
  this.contentBuilder?.getEl()?.addEventListener(
144447
144452
  "mousedown",
@@ -144546,9 +144551,9 @@ let Qn = class extends hn {
144546
144551
  this.hasBoundUpdate || (this.contentBuilder?.on("update", () => {
144547
144552
  this.emit("cx-change");
144548
144553
  }), this.hasBoundUpdate = !0);
144549
- const { component: o, index: a, parentComponent: s } = i ?? {}, l = await D3t({
144550
- excludeBlocksWithNoTemplates: !this.isDesigner
144551
- }), 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];
144552
144557
  if (!u) {
144553
144558
  this.blockPicker.limitedBlocks = vR(lt.Column), this.blockPicker.show(), r();
144554
144559
  return;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.188.0",
4
+ "version": "3.0.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "2.188.0",
4
+ "version": "3.0.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {