@vectoriox/iox-builder 9.5.1 → 9.5.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.
@@ -984,6 +984,23 @@ const HIDDEN_AT_REST_TYPES = ['Dialog'];
984
984
  function isHiddenAtRest(node) {
985
985
  return !!node?.type && HIDDEN_AT_REST_TYPES.includes(node.type);
986
986
  }
987
+ /**
988
+ * How the selection shows a node hidden at rest — the two approved rules, by what the node IS:
989
+ * - a PART of a composite (it carries a `role`: the mobile menu's drawer) follows R2 (board 3): the
990
+ * selection is the reveal, and moving it out of the part hides it again;
991
+ * - a free-standing overlay (a plain Dialog) follows board A4: selecting it opens it, and it stays open
992
+ * while the author works elsewhere, until its X, its backdrop or the eye closes it.
993
+ */
994
+ var SelectionReveal;
995
+ (function (SelectionReveal) {
996
+ SelectionReveal["WhileSelected"] = "while-selected";
997
+ SelectionReveal["UntilClosed"] = "until-closed";
998
+ })(SelectionReveal || (SelectionReveal = {}));
999
+ function selectionRevealOf(node) {
1000
+ if (!isHiddenAtRest(node))
1001
+ return null;
1002
+ return node?.role ? SelectionReveal.WhileSelected : SelectionReveal.UntilClosed;
1003
+ }
987
1004
  /** Root → `target`, inclusive, across `roots` (page layout and globals), or [] when it is not there. */
988
1005
  function pathToNode(roots, target) {
989
1006
  for (const root of roots) {
@@ -4016,7 +4033,7 @@ var CanvasShowState;
4016
4033
  */
4017
4034
  class CanvasDesignStateService {
4018
4035
  constructor() {
4019
- this._state$ = new BehaviorSubject({ revealed: new Set(), shown: new Map() });
4036
+ this._state$ = new BehaviorSubject({ revealed: new Set(), pinned: new Set(), shown: new Map() });
4020
4037
  this.state$ = this._state$.asObservable();
4021
4038
  this._pagePath$ = new BehaviorSubject(null);
4022
4039
  /** The app path of the page on the canvas (`/work`), or null when unknown. */
@@ -4033,13 +4050,31 @@ class CanvasDesignStateService {
4033
4050
  if (next !== this._pagePath$.value)
4034
4051
  this._pagePath$.next(next);
4035
4052
  }
4036
- /** The selection moved: the hidden-at-rest parts on its path are revealed, every other one is not. */
4053
+ /**
4054
+ * The selection moved. The hidden-at-rest PARTS on its path are revealed and every other part is not
4055
+ * (R2); a free-standing overlay on the path is pinned open until it is closed (A4).
4056
+ */
4037
4057
  setSelectionPath(path) {
4038
- const revealed = new Set(path.filter(isHiddenAtRest).map(n => n.id).filter((id) => !!id));
4039
- const current = this._state$.value.revealed;
4040
- if (revealed.size === current.size && [...revealed].every(id => current.has(id)))
4058
+ const ids = (reveal) => path.filter(n => selectionRevealOf(n) === reveal).map(n => n.id).filter((id) => !!id);
4059
+ const revealed = new Set(ids(SelectionReveal.WhileSelected));
4060
+ const { revealed: was, pinned: held } = this._state$.value;
4061
+ const pinned = new Set([...held, ...ids(SelectionReveal.UntilClosed)]);
4062
+ if (sameSet(revealed, was) && sameSet(pinned, held))
4041
4063
  return;
4042
- this._state$.next({ ...this._state$.value, revealed });
4064
+ this._state$.next({ ...this._state$.value, revealed, pinned });
4065
+ }
4066
+ /** Closed on the canvas (its X, its backdrop, the eye): no longer pinned or switched open. */
4067
+ dismiss(nodeId) {
4068
+ if (!nodeId)
4069
+ return;
4070
+ const { pinned, shown } = this._state$.value;
4071
+ if (!pinned.has(nodeId) && !shown.has(nodeId))
4072
+ return;
4073
+ const nextPinned = new Set(pinned);
4074
+ nextPinned.delete(nodeId);
4075
+ const nextShown = new Map(shown);
4076
+ nextShown.delete(nodeId);
4077
+ this._state$.next({ ...this._state$.value, pinned: nextPinned, shown: nextShown });
4043
4078
  }
4044
4079
  /** The switcher's choice for one part (null = back to the saved default). */
4045
4080
  setShown(nodeId, state) {
@@ -4058,8 +4093,8 @@ class CanvasDesignStateService {
4058
4093
  isShown(nodeId) {
4059
4094
  if (!nodeId)
4060
4095
  return false;
4061
- const { revealed, shown } = this._state$.value;
4062
- return revealed.has(nodeId) || shown.get(nodeId) === CanvasShowState.Open;
4096
+ const { revealed, pinned, shown } = this._state$.value;
4097
+ return revealed.has(nodeId) || pinned.has(nodeId) || shown.get(nodeId) === CanvasShowState.Open;
4063
4098
  }
4064
4099
  /** True when the part is shown only because the selection is inside it (the switcher's hint line). */
4065
4100
  isRevealedBySelection(nodeId) {
@@ -4067,7 +4102,7 @@ class CanvasDesignStateService {
4067
4102
  }
4068
4103
  /** A new page on the canvas: nothing is revealed or switched open. */
4069
4104
  reset() {
4070
- this._state$.next({ revealed: new Set(), shown: new Map() });
4105
+ this._state$.next({ revealed: new Set(), pinned: new Set(), shown: new Map() });
4071
4106
  }
4072
4107
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: CanvasDesignStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4073
4108
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: CanvasDesignStateService }); }
@@ -4075,6 +4110,9 @@ class CanvasDesignStateService {
4075
4110
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: CanvasDesignStateService, decorators: [{
4076
4111
  type: Injectable
4077
4112
  }] });
4113
+ function sameSet(a, b) {
4114
+ return a.size === b.size && [...a].every(id => b.has(id));
4115
+ }
4078
4116
 
4079
4117
  // Re-exported from the shared iox-ui package so iox-builder consumers
4080
4118
  // don't need to import from two different packages.
@@ -9601,7 +9639,14 @@ class BuilderDialogComponent {
9601
9639
  this.cdr.markForCheck();
9602
9640
  }
9603
9641
  openRuntime() { this.runtimeOpen = true; this.dismissed = false; this.recompute(); }
9604
- closeRuntime() { this.runtimeOpen = false; this.dismissed = true; this.recompute(); }
9642
+ closeRuntime() {
9643
+ this.runtimeOpen = false;
9644
+ // Unpin it first (a free-standing dialog the selection opened, A4) — that emits and clears
9645
+ // `dismissed`; then hide it even while the selection still sits inside a revealed part (R2).
9646
+ this.designState?.dismiss(this.nodeId);
9647
+ this.dismissed = true;
9648
+ this.recompute();
9649
+ }
9605
9650
  ngOnInit() {
9606
9651
  // Board A4: "Closed later? Click it [in the tree] and it reopens." Selection IS the
9607
9652
  // reopen signal — tree row, breadcrumb crumb, target-picker jump all land here.
@@ -9620,8 +9665,10 @@ class BuilderDialogComponent {
9620
9665
  // stays shut because nothing is selected on load.
9621
9666
  //
9622
9667
  // CC1 (R2, board 3): with the canvas design state present, "selected" means the selection is the
9623
- // dialog OR ANY PART INSIDE IT (a drawer link picked from the tree), and DESELECTING closes it
9624
- // again — a closed overlay has no canvas presence. The "Showing on canvas" switcher holds it open.
9668
+ // dialog OR ANY PART INSIDE IT (a drawer link picked from the tree). A composite PART (the
9669
+ // drawer, it carries a role) closes again when the selection leaves it; a free-standing Dialog
9670
+ // stays open until its X / backdrop / the eye closes it, as A4 has it (selectionRevealOf).
9671
+ // The "Showing on canvas" switcher holds a part open.
9625
9672
  if (this.designState) {
9626
9673
  this.stateSub = this.designState.state$.subscribe(() => { this.dismissed = false; this.recompute(); });
9627
9674
  }
@@ -12480,5 +12527,5 @@ class BuilderSpacerComponentConfig extends ComponentConfig {
12480
12527
  * Generated bundle index. Do not edit.
12481
12528
  */
12482
12529
 
12483
- 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, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PALETTE_PRESET_DEFS, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, escapesRoot, essentialTraitsFor, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, generateNodeId, insertRefusal, insertRefusalLabel, isHiddenAt, isHiddenAtRest, isSpecimen, markSpecimen, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, nodeStyleMap, pathToNode, refreshSubtree, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, rootEscapeBand, rootZone, setStyleTrait, setTrait, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
12530
+ 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, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CANVAS_EMPTY_IMAGE_LABEL_EN, CANVAS_EMPTY_IMAGE_LABEL_KEY, CANVAS_ROOT_RESET_CSS, COMPOSITE_PRESETS, CanvasDesignStateService, CanvasShowState, CardComponentConfig, ChildLayoutGroupStyleConfig, ComponentConfig, ComponentRegistryService, CompositePresetId, DEFAULT_ESSENTIAL_TRAITS, DRAG_HANDLE_ATTR, DROP_REFUSED_CLASS, DataSourceRegistryService, DataSourceType, DialogComponentConfig, DimensionsGroupStyleConfig, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, EDITOR_CHROME_ATTRIBUTE, ESSENTIAL_TRAITS_BY_TYPE, EffectsGroupStyleConfig, FIELD_KIND_PRESETS, FIELD_PARTS, FORM_STATE_BLOCK_TYPES, FORM_TYPE, FieldComponentConfig, FieldGroupComponentConfig, FormComponentConfig, FormErrorComponentConfig, FormStateService, FormSuccessComponentConfig, GalleryConfig, GroupStyleConfig, HIDDEN_AT_REST_LABEL_KEY, HIDDEN_AT_REST_TYPES, INSERT_REFUSAL_LABEL_KEYS, INTERACTION_STATES, INVERSE_ACTION, IOX_BUILDER_CANVAS, IOX_BUILDER_LABELS, IOX_DATA_SOURCE_ENDPOINTS, InsertRefusal, InteractionEngineService, InteractionPresetRegistryService, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LAYOUT_PRESETS, LayerTreeComponent, LayoutGroupStyleConfig, ListGroupStyleConfig, NodeAction, OverlayComponent, OverlayService, PALETTE_PRESET_DEFS, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PositionGroupStyleConfig, PresetRegistryService, RELATIONAL_STATES, RELATIONAL_STATE_BASE, REPEATER_SOURCE_PROP, REPEATER_TYPE, ROOT_ESCAPE_PX, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, RootZone, SCREEN_WIDTH_OPTIONS, STRUCTURAL_STATES, SUPPORTED_STATES, SectionComponent, SectionComponentConfig, SelectionReveal, SizeGroupStyleConfig, SliderContainerComponent, SliderContainerConfig, SliderSlideComponent, SliderSlideConfig, SpacingGroupStyleConfig, StructureFix, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, SubmitButtonComponentConfig, SymbolRegistryService, TARGETED_STATES, TARGETED_STATE_BASE, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, TypographyGroupStyleConfig, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, VALIDATION_STATES, VALIDATION_STATE_CLASS, ViewportService, ZOOM_OPTIONS, arrayItemSchemaFields, arraySchemaFields, auditNodes, bindingLabel, bindingLabels, buildCompositePreset, buildConsentPreset, buildElementStyleSpecimen, buildFieldKindPreset, buildFlavorSpecimen, buildFormPreset, buildFullStyleTraits, buildLayoutPreset, buildPalettePreset, buildPresetStyleTraits, builderCompositeFactory, canFluidise, canvasEmptyImageLabel, collapseColumnsProps, columnCountOf, defaultBuilderLabels, defaultPageSettings, dropTargetLabel, escapesRoot, essentialTraitsFor, findNodeLocation, findParentOf, flattenLayerTree, flattenSchemaFields, fluidiseProps, generateNodeId, insertRefusal, insertRefusalLabel, isHiddenAt, isHiddenAtRest, isSpecimen, markSpecimen, matchesControlSearch, nearestFormNode, nodeAncestorPath, nodeAncestorPathInEither, nodeStyleMap, pathToNode, refreshSubtree, removalRefusal, reorderProps, repeaterSourceAlias, repeaterSubLabel, resolveInsertTarget, resolveTraitControllerType, resolveTraitOptions, rootEscapeBand, rootZone, selectionRevealOf, setStyleTrait, setTrait, stackChildrenProps, summarise, syncEmptyImagePlaceholder, syncNodeDesign, syncNodeInputs, textNode, upsertNodeStyles, visibilityProps, walkNodes, wrapNode };
12484
12531
  //# sourceMappingURL=vectoriox-iox-builder.mjs.map