@vectoriox/iox-builder 4.0.0 → 4.1.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.
package/index.d.ts CHANGED
@@ -585,7 +585,9 @@ declare enum ToolbarAction {
585
585
  Copy = "copy",
586
586
  Paste = "paste",
587
587
  AddSlide = "add-slide",
588
- Wrap = "wrap"
588
+ Wrap = "wrap",
589
+ /** Open the components panel to insert into / after the selection (B2 quick-add). */
590
+ AddElement = "add-element"
589
591
  }
590
592
  declare enum NodeAction {
591
593
  Delete = "delete",
@@ -739,7 +741,11 @@ declare enum PanelEventTypes {
739
741
  * Repeater/Slider listen so their PREVIEW CLONES are re-cloned with the new interactions —
740
742
  * clones are attached by ELEMENT at render time, so without this a new interaction only starts
741
743
  * working after a save + reload. */
742
- INTERACTION_CHANGED = "interactionchanged"
744
+ INTERACTION_CHANGED = "interactionchanged",
745
+ /** CLICK-TO-INSERT (B2): a components-panel entry was clicked. Carries the same payload a drag
746
+ * would (`string` component type, or a block / symbol object). The builder resolves WHERE from
747
+ * the current selection — see `resolveInsertTarget`. */
748
+ INSERT_COMPONENT = "insertcomponent"
743
749
  }
744
750
  interface PanelEvent {
745
751
  type: PanelEventTypes;
@@ -813,6 +819,27 @@ declare class DragEngineService {
813
819
  private overlayService;
814
820
  constructor(registry: ComponentRegistryService, symbolRegistry: SymbolRegistryService, overlayService: OverlayService);
815
821
  handleDrop(children: ComponentNode[], event: IoxDropEvent, dropListId: string, cdr: ChangeDetectorRef, afterDrop?: () => void): void;
822
+ /**
823
+ * Turn a components-panel payload into a fresh ComponentNode: a built-in type string via the
824
+ * registry, or a block / symbol / bare node deep-cloned with fresh ids (so each copy owns its
825
+ * CSS rules and its intra-subtree references stay self-consistent). Prefers `symbol.node`
826
+ * (always current) over a block's original snapshot.
827
+ *
828
+ * The ONE place a panel payload becomes a node — drag-drop and click-to-insert both use it, so
829
+ * a clicked element is identical to a dragged one.
830
+ */
831
+ materialize(data: unknown): ComponentNode | null;
832
+ /**
833
+ * CLICK-TO-INSERT (B2): place a panel payload at a resolved target without a drag. Emits
834
+ * `dropComplete$` exactly like a drop, so the builder selects the new node and records one undo
835
+ * step through the same path. Returns the inserted node, or null if the payload was unusable.
836
+ */
837
+ insertPayload(children: ComponentNode[], index: number, data: unknown): ComponentNode | null;
838
+ /** True when `children` is a registered drop zone's array — i.e. a real container that can hold
839
+ * children. Click-to-insert uses the same test a drag does, so it can't insert where a drop
840
+ * couldn't. */
841
+ isDropContainer(children: unknown): boolean;
842
+ private cdrForData;
816
843
  private ids;
817
844
  private elMap;
818
845
  private dataMap;
@@ -846,6 +873,7 @@ declare class DragEngineService {
846
873
  private _deepTargetId;
847
874
  /** Injected overlay div marking the active drop target. */
848
875
  private _targetOverlay;
876
+ private _targetChip;
849
877
  private _indicator;
850
878
  private _indicatorContainerId;
851
879
  private _indicatorIndex;
@@ -890,6 +918,8 @@ declare class DragEngineService {
890
918
  refreshDragOverlays(): void;
891
919
  private _moveTargetOverlay;
892
920
  private _removeTargetOverlay;
921
+ /** Name the drop target and the slot: "into Card grid · position 2 of 4". */
922
+ private _updateTargetChip;
893
923
  private _isRootContainer;
894
924
  /**
895
925
  * Returns true if the dropzone with `childId` is a DOM descendant of the
@@ -1592,6 +1622,12 @@ declare class BuilderComponent implements OnInit, AfterViewInit, OnChanges, OnDe
1592
1622
  private _refreshRepeaterFor;
1593
1623
  /** Emit ELEMENT_SELECT with the ancestors the panels need (symbol + repeater item scope). */
1594
1624
  private _emitElementSelect;
1625
+ /**
1626
+ * Insert a components-panel payload at the position the SELECTION implies (B2):
1627
+ * nothing selected → end of the page; a container → inside it; a leaf → right after it.
1628
+ * `dropComplete$` then selects the new node and records the undo step, exactly as a drop does.
1629
+ */
1630
+ insertFromPanel(data: unknown): void;
1595
1631
  private refreshBreakpointCounts;
1596
1632
  /** Read a node's current `display` value. The style panel mutates `styleTraits` in place at edit
1597
1633
  * time, so that is the live source of truth; fall back to a preset's `styleOverrides` map, then
@@ -1793,6 +1829,9 @@ declare class OverlayComponent implements OnInit, OnDestroy {
1793
1829
  ngOnInit(): void;
1794
1830
  ngOnDestroy(): void;
1795
1831
  onSelectParent(event: MouseEvent): void;
1832
+ /** Quick-add (B2): open the components panel. The new element lands inside this node when it is
1833
+ * a container, otherwise right after it. */
1834
+ onAddElement(event: MouseEvent): void;
1796
1835
  onDuplicate(event: MouseEvent): void;
1797
1836
  onDelete(event: MouseEvent): void;
1798
1837
  onWrap(event: MouseEvent, wrapType: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectoriox/iox-builder",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=20.0.0",
6
6
  "@angular/core": ">=20.0.0",