@vectoriox/iox-builder 11.34.0 → 11.35.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.
@@ -4392,6 +4392,12 @@ var CanvasShowState;
4392
4392
  CanvasShowState["Closed"] = "closed";
4393
4393
  CanvasShowState["Open"] = "open";
4394
4394
  })(CanvasShowState || (CanvasShowState = {}));
4395
+ /** Parts of which the canvas shows ONE at a time (popup-presets board PP-D7: two popups are never open together on the
4396
+ * canvas, as on the live page — one popup per page view). A part joins its group by itself (the Dialog twin of a popup). */
4397
+ var CanvasShowGroup;
4398
+ (function (CanvasShowGroup) {
4399
+ CanvasShowGroup["Popup"] = "popup";
4400
+ })(CanvasShowGroup || (CanvasShowGroup = {}));
4395
4401
  const EMPTY_SNAPSHOT = () => ({
4396
4402
  revealed: new Set(), selectedTriggers: new Set(), pinned: new Set(), triggeredBySelection: new Set(), shown: new Map(), items: new Map(),
4397
4403
  runtime: new Set(), menu: null, tooltips: new Set(), toast: null,
@@ -4417,6 +4423,37 @@ class CanvasDesignStateService {
4417
4423
  this._pagePath$ = new BehaviorSubject(null);
4418
4424
  /** The app path of the page on the canvas (`/work`), or null when unknown. */
4419
4425
  this.pagePath$ = this._pagePath$.asObservable();
4426
+ /** The parts that belong to a show-one-at-a-time group, by node id. Not a snapshot field: membership never changes
4427
+ * what is shown by itself — only an opening does. */
4428
+ this.groups = new Map();
4429
+ }
4430
+ /** A part joins (or, with null, leaves) a show-one-at-a-time group (PP-D7). */
4431
+ joinGroup(nodeId, group) {
4432
+ if (!nodeId)
4433
+ return;
4434
+ if (group)
4435
+ this.groups.set(nodeId, group);
4436
+ else
4437
+ this.groups.delete(nodeId);
4438
+ }
4439
+ /** `id` opened: every OTHER member of its group stops being shown by the switcher, an action or a pin (the selection
4440
+ * shows one part only, so its reveal needs no closing). */
4441
+ onlyThis(state, id) {
4442
+ const group = this.groups.get(id);
4443
+ if (!group)
4444
+ return state;
4445
+ const others = [...this.groups].filter(([other, g]) => g === group && other !== id).map(([other]) => other);
4446
+ if (!others.some(o => state.shown.has(o) || state.runtime.has(o) || state.pinned.has(o)))
4447
+ return state;
4448
+ const shown = new Map(state.shown);
4449
+ const runtime = new Set(state.runtime);
4450
+ const pinned = new Set(state.pinned);
4451
+ for (const o of others) {
4452
+ shown.delete(o);
4453
+ runtime.delete(o);
4454
+ pinned.delete(o);
4455
+ }
4456
+ return { ...state, shown, runtime, pinned };
4420
4457
  }
4421
4458
  get snapshot() {
4422
4459
  return this._state$.value;
@@ -4445,7 +4482,11 @@ class CanvasDesignStateService {
4445
4482
  if (sameSet(revealed, was) && sameSet(pinned, held) && sameSet(selectedTriggers, wasTriggers) && sameSet(triggeredBySelection, wasTriggered)
4446
4483
  && sameMenu(menu, this._state$.value.menu))
4447
4484
  return;
4448
- this._state$.next({ ...this._state$.value, revealed, pinned, selectedTriggers, triggeredBySelection, menu });
4485
+ let next = { ...this._state$.value, revealed, pinned, selectedTriggers, triggeredBySelection, menu };
4486
+ // PP-D7: selecting into a popup puts away any other popup the switcher or an action holds open.
4487
+ for (const id of [...revealed, ...pinned].filter(id => !was.has(id) && !held.has(id)))
4488
+ next = this.onlyThis(next, id);
4489
+ this._state$.next(next);
4449
4490
  }
4450
4491
  /** Closed on the canvas (its X, its backdrop, the eye): no longer pinned, switched open or revealed by the
4451
4492
  * selection — selecting into it again reveals it again. */
@@ -4469,16 +4510,18 @@ class CanvasDesignStateService {
4469
4510
  markOpened(nodeId) {
4470
4511
  if (!nodeId || this._state$.value.runtime.has(nodeId))
4471
4512
  return;
4472
- this._state$.next({ ...this._state$.value, runtime: new Set([...this._state$.value.runtime, nodeId]) });
4513
+ this._state$.next(this.onlyThis({ ...this._state$.value, runtime: new Set([...this._state$.value.runtime, nodeId]) }, nodeId));
4473
4514
  }
4474
4515
  /** The switcher's choice for one part (null = back to the saved default). */
4475
4516
  setShown(nodeId, state) {
4476
4517
  const shown = new Map(this._state$.value.shown);
4477
- if (state && state !== CanvasShowState.Closed)
4518
+ const open = !!state && state !== CanvasShowState.Closed;
4519
+ if (open)
4478
4520
  shown.set(nodeId, state);
4479
4521
  else
4480
4522
  shown.delete(nodeId);
4481
- this._state$.next({ ...this._state$.value, shown });
4523
+ const next = { ...this._state$.value, shown };
4524
+ this._state$.next(open ? this.onlyThis(next, nodeId) : next);
4482
4525
  }
4483
4526
  /** Tabs' "Showing on canvas": the item a root shows (null = whatever the canvas shows live). */
4484
4527
  setShownItem(rootId, key) {
@@ -12766,10 +12809,14 @@ class BuilderDialogComponent {
12766
12809
  set menuHover(v) { this.setMenu(MenuTrait.Hover, v); }
12767
12810
  set menuPhone(v) { this.setMenu(MenuTrait.Phone, v); }
12768
12811
  /** PU2: the popup's kind and form (composite-core PopupTrait) — a Dialog with no kind is not a popup and draws as before. */
12769
- set popupKind(v) { this.popupLook = { ...this.popupLook, kind: v }; this.cdr?.markForCheck(); }
12812
+ set popupKind(v) { this.popupLook = { ...this.popupLook, kind: v }; this.joinPopups(); this.cdr?.markForCheck(); }
12770
12813
  set popupForm(v) { this.popupLook = { ...this.popupLook, form: v }; this.cdr?.markForCheck(); }
12771
12814
  /** The form the stage is drawn in (PP-D4) — composite-core `popupFormOf`, the live page's reader: `centred` only for a
12772
12815
  * newsletter; null when the Dialog is not a popup. */
12816
+ /** PP-D7: a popup is one of the canvas's popups — opening it puts the others away (the design state's group). */
12817
+ joinPopups() {
12818
+ this.designState?.joinGroup(this.nodeId, this.popupFormValue ? CanvasShowGroup.Popup : null);
12819
+ }
12773
12820
  get popupFormValue() {
12774
12821
  const kind = this.popupLook.kind;
12775
12822
  return Object.values(PopupKind).includes(kind) ? popupFormOf(kind, this.popupLook.form) : null;
@@ -12951,8 +12998,16 @@ class BuilderDialogComponent {
12951
12998
  // drawer, it carries a role) closes again when the selection leaves it; a free-standing Dialog
12952
12999
  // stays open until its X / backdrop / the eye closes it, as A4 has it (selectionRevealOf).
12953
13000
  // The "Showing on canvas" switcher holds a part open.
13001
+ this.joinPopups();
12954
13002
  if (this.designState) {
12955
- this.stateSub = this.designState.state$.subscribe(() => { this.dismissed = false; this.recompute(); });
13003
+ this.stateSub = this.designState.state$.subscribe(() => {
13004
+ this.dismissed = false;
13005
+ // An action's open lives in the design state too (markOpened): when the state put it away — another popup
13006
+ // opened (PP-D7) — the twin's own flag lets go with it.
13007
+ if (this.runtimeOpen && !this.designState.isShown(this.nodeId))
13008
+ this.runtimeOpen = false;
13009
+ this.recompute();
13010
+ });
12956
13011
  }
12957
13012
  else {
12958
13013
  this.selectSub = this.overlayService.select$?.subscribe?.((sel) => {
@@ -12973,6 +13028,7 @@ class BuilderDialogComponent {
12973
13028
  this.selectSub?.unsubscribe();
12974
13029
  this.stateSub?.unsubscribe();
12975
13030
  this.instanceRegistry.unregister(this.nodeId);
13031
+ this.designState?.joinGroup(this.nodeId, null);
12976
13032
  }
12977
13033
  /** A click on the stage ITSELF is the backdrop click — children swallow everything else.
12978
13034
  * Closing clicks STOP here: the same click would bubble into canvas selection, and
@@ -16442,5 +16498,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
16442
16498
  * Generated bundle index. Do not edit.
16443
16499
  */
16444
16500
 
16445
- export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FOOTER_MIX_TRAIT, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_RENDER_DISPLAY_ONLY, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LIST_MIX_TRAIT, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OPENING_MIX_TRAIT, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, SLIDER_CREATIVE_PRESET_TRAIT, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTrigger, displayTriggerOf, dropChildren, dropSectionStamps, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, followsScroll, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isDisplayOnlyNode, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
16501
+ export { ACTION_TYPE_OPTIONS, AuditCode, AuditPanelComponent, AuditSeverity, BODY_CRUMB_LABEL, BOUND_ICON, BREAKPOINT_PRESENTATION, BUILDER_CANVAS_CONTAINER, BUILDER_CHROME_EN, BUILDER_FONT_LINK_ATTR, BUILDER_TOKEN_SCOPE_CLASS, BackgroundGroupStyleConfig, BorderGroupStyleConfig, BreadcrumbBarComponent, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderClipboardService, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDataSourceService, BuilderDialogComponent, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderHistoryService, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderListComponentConfig, BuilderListItemComponentConfig, BuilderMode, BuilderPopoverComponent, BuilderRepeaterComponent, BuilderSpacerComponentConfig, BusinessSpecimenView, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, CANVAS_TOKEN_SCOPE, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowGroup, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositeCanvasService, CompositePaletteGroup, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DESCRIPTOR_MAX_LENGTH, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FOOTER_MIX_TRAIT, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FieldTrait, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GLOBALS_AFTER_CLASS, GalleryConfig, GlobalCanvasLayer, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_ROLES, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_CONTENT_TYPE_LABELS, IOX_DATA_SOURCE_ENDPOINTS, IOX_RENDER_DISPLAY_ONLY, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LIST_MIX_TRAIT, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OPENING_MIX_TRAIT, OverlayComponent, OverlayService, PAGE_TRANSITION_EASING_OPTIONS, PALETTE_PRESET_DEFS, POPOVER_PLACEMENT_OPTIONS, POPOVER_SHEET_MAX_WIDTH, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PhoneMenuOpenerAction, PopoverComponentConfig, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, REVEALED_WHILE_SELECTED_ROLES, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, SENT_LABEL_TRAIT, SILENT_REFUSALS, SLIDER_CREATIVE_PRESET_TRAIT, STRUCTURAL_STATES, SUPPORTED_STATES, SceneCanvasService, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TOGGLE_PART_ROLES, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, VideoConfig, ViewportService, ZOOM_OPTIONS, addFormChannel, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildBusinessSpecimen, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormActionsRow, buildFormChannel, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, canvasFloatingContainer, canvasHostDisplay, collapseColumnsProps, columnCountOf, compositeStructureFindings, defaultBuilderLabels, defaultPageSettings, deleteTabPair, displayTrigger, displayTriggerOf, dropChildren, dropSectionStamps, dropTargetLabel, duplicateTabPair, escapesRoot, essentialTraitsFor, findNodeByIdInEither, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, followsScroll, formChannelOf, generateNodeId, globalCanvasLayer, hiddenAtBase, hiddenUntilItemOn, inPhoneMenuContext, insertRefusal, insertRefusalLabel, interactionTargets, isDisplayOnlyNode, isHiddenAt, isHiddenAtRest, isPhoneMenuOpener, isPinnedGlobal, isReadingBar, isSpecimen, itemsOnAtRest, markSpecimen, matchesControlSearch, nearestFormNode, neverShown, nodeAncestorPath, nodeAncestorPathInEither, nodeDescriptor, nodeStyleMap, overlayGlobals, pathToNode, phoneMenuOf, phoneMenuShowsAt, refreshSubtree, regenerateNodeIds, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, retypeNode, rootEscapeBand, rootZone, selectionRevealOf, setChannelAddress, setOverlayPreview, setStyleTrait, setTrait, shortDescriptor, showCanvasToast, shownBeforeControl, sourceContentType, sourceTypeLabel, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, tabPairLabel, tabsRootForPart, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
16446
16502
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map