@vectoriox/iox-builder 1.7.2 → 1.7.3

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.
@@ -2858,6 +2858,8 @@ let dropListCounter = 0;
2858
2858
  */
2859
2859
  const DIRECTIVE_HOST_TYPES = new Set([
2860
2860
  'Image', 'Icon', 'Divider', 'Spacer', 'Button', 'Link', 'Heading', 'Text', 'ButtonBlock',
2861
+ // Phase 2 (9c): layout components converted to directive-hosts (host IS the real tag).
2862
+ 'Section',
2861
2863
  ]);
2862
2864
  /**
2863
2865
  * RenderDirective — applied to <ng-container> to dynamically instantiate a
@@ -4897,42 +4899,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
4897
4899
  args: ['globalOverlay']
4898
4900
  }] } });
4899
4901
 
4900
- class IoxDropzoneDirective {
4901
- constructor(el, dragEngine, cdr) {
4902
- this.el = el;
4903
- this.dragEngine = dragEngine;
4904
- this.cdr = cdr;
4905
- this.ioxDropzoneId = '';
4906
- this.ioxDropzoneData = [];
4907
- this.ioxDrop = new EventEmitter();
4908
- }
4909
- ngOnInit() {
4910
- this.dragEngine.registerDropzone(this.ioxDropzoneId, this.el.nativeElement, this.ioxDropzoneData, this.cdr, (evt) => this.ioxDrop.emit(evt), this.ioxDropzonePostDrop);
4911
- }
4912
- ngOnDestroy() {
4913
- this.dragEngine.unregisterDropzone(this.ioxDropzoneId, this.el.nativeElement);
4914
- }
4915
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: IoxDropzoneDirective, deps: [{ token: i0.ElementRef }, { token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4916
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: IoxDropzoneDirective, isStandalone: false, selector: "[ioxDropzone]", inputs: { ioxDropzoneId: "ioxDropzoneId", ioxDropzoneData: "ioxDropzoneData", ioxDropzonePostDrop: "ioxDropzonePostDrop" }, outputs: { ioxDrop: "ioxDrop" }, ngImport: i0 }); }
4917
- }
4918
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: IoxDropzoneDirective, decorators: [{
4919
- type: Directive,
4920
- args: [{
4921
- selector: '[ioxDropzone]',
4922
- standalone: false,
4923
- }]
4924
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { ioxDropzoneId: [{
4925
- type: Input
4926
- }], ioxDropzoneData: [{
4927
- type: Input
4928
- }], ioxDropzonePostDrop: [{
4929
- type: Input
4930
- }], ioxDrop: [{
4931
- type: Output
4932
- }] } });
4933
-
4902
+ /**
4903
+ * Directive-host Section (Phase 2 of the Moveable migration = task 9c). The `<section>` IS the host
4904
+ * (no `<app-section>` wrapper, no separate `.section-root`) — matching the SSR engine's
4905
+ * `section[iox-section]`. The dropzone is registered on the host element itself (was the ioxDropzone
4906
+ * directive on `.section-root`); the `.section-child` draggable wrappers are UNCHANGED, so interact.js
4907
+ * (flag-off) keeps working exactly as before. See moveable-migration.md.
4908
+ */
4934
4909
  class SectionComponent {
4935
- constructor(dragEngine, cdr) {
4910
+ constructor(elRef, dragEngine, cdr) {
4911
+ this.elRef = elRef;
4936
4912
  this.dragEngine = dragEngine;
4937
4913
  this.cdr = cdr;
4938
4914
  this.children = [];
@@ -4943,7 +4919,13 @@ class SectionComponent {
4943
4919
  this.childMouseEnter = new EventEmitter();
4944
4920
  this.childMouseLeave = new EventEmitter();
4945
4921
  }
4946
- ngOnInit() { }
4922
+ ngOnInit() {
4923
+ // Register the HOST as the dropzone (was the ioxDropzone directive on `.section-root`).
4924
+ this.dragEngine.registerDropzone(this.dropListId, this.elRef.nativeElement, this.children, this.cdr, (evt) => this.onDrop(evt));
4925
+ }
4926
+ ngOnDestroy() {
4927
+ this.dragEngine.unregisterDropzone(this.dropListId, this.elRef.nativeElement);
4928
+ }
4947
4929
  get listOrientation() {
4948
4930
  const d = this.style?.['display'];
4949
4931
  if (d === 'flex' || d === 'inline-flex') {
@@ -4953,69 +4935,54 @@ class SectionComponent {
4953
4935
  }
4954
4936
  return 'vertical';
4955
4937
  }
4956
- ngOnDestroy() { }
4957
4938
  onDrop(event) {
4958
4939
  this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
4959
4940
  }
4960
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SectionComponent, deps: [{ token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4961
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: SectionComponent, isStandalone: false, selector: "app-section", inputs: { children: "children", style: "style", nodeId: "nodeId", dropListId: "dropListId" }, outputs: { childClick: "childClick", childMouseEnter: "childMouseEnter", childMouseLeave: "childMouseLeave" }, ngImport: i0, template: `
4962
- <section class="section-root"
4963
- [ngClass]="['iox-node-' + nodeId, listOrientation === 'horizontal' ? 'is-horizontal' : '']"
4964
- ioxDropzone
4965
- [ioxDropzoneId]="dropListId"
4966
- [ioxDropzoneData]="children"
4967
- (ioxDrop)="onDrop($event)">
4968
-
4969
- <div *ngIf="!children.length" class="section-placeholder">
4970
- <i class="ph-thin ph-rows"></i>
4971
- <span>Drop components here</span>
4972
- </div>
4941
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SectionComponent, deps: [{ token: i0.ElementRef }, { token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4942
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: SectionComponent, isStandalone: false, selector: "section[iox-section]", inputs: { children: "children", style: "style", nodeId: "nodeId", dropListId: "dropListId" }, outputs: { childClick: "childClick", childMouseEnter: "childMouseEnter", childMouseLeave: "childMouseLeave" }, host: { properties: { "class": "'section-root iox-node-' + nodeId + (listOrientation === 'horizontal' ? ' is-horizontal' : '')" } }, ngImport: i0, template: `
4943
+ <div *ngIf="!children.length" class="section-placeholder">
4944
+ <i class="ph-thin ph-rows"></i>
4945
+ <span>Drop components here</span>
4946
+ </div>
4973
4947
 
4974
- <div *ngFor="let child of children"
4975
- [ngClass]="['section-child', 'iox-outer-' + (child.styleId ?? child.id)]"
4976
- ioxDraggable
4977
- [ioxDragData]="child"
4978
- [ioxDragSourceId]="dropListId">
4979
- <ng-container
4980
- [ioxRender]="child"
4981
- (onClick)="childClick.emit($event)"
4982
- (onMouseEnter)="childMouseEnter.emit($event)"
4983
- (onMouseLeave)="childMouseLeave.emit()">
4984
- </ng-container>
4985
- </div>
4986
- </section>
4987
- `, isInline: true, styles: [".section-root{position:relative;box-sizing:border-box}.section-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;border:1.5px dashed rgba(100,116,139,.35);border-radius:4px;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;opacity:0;transition:opacity .15s}.section-root:hover .section-placeholder,.section-root.iox-drag-over .section-placeholder{opacity:1}.section-placeholder i{font-size:22px}.section-child{min-width:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RenderDirective, selector: "[ioxRender]", inputs: ["ioxRender"], outputs: ["onClick", "onMouseEnter", "onMouseLeave"] }, { kind: "directive", type: IoxDraggableDirective, selector: "[ioxDraggable]", inputs: ["ioxDragData", "ioxDragSourceId"] }, { kind: "directive", type: IoxDropzoneDirective, selector: "[ioxDropzone]", inputs: ["ioxDropzoneId", "ioxDropzoneData", "ioxDropzonePostDrop"], outputs: ["ioxDrop"] }] }); }
4948
+ <div *ngFor="let child of children"
4949
+ [ngClass]="['section-child', 'iox-outer-' + (child.styleId ?? child.id)]"
4950
+ ioxDraggable
4951
+ [ioxDragData]="child"
4952
+ [ioxDragSourceId]="dropListId">
4953
+ <ng-container
4954
+ [ioxRender]="child"
4955
+ (onClick)="childClick.emit($event)"
4956
+ (onMouseEnter)="childMouseEnter.emit($event)"
4957
+ (onMouseLeave)="childMouseLeave.emit()">
4958
+ </ng-container>
4959
+ </div>
4960
+ `, isInline: true, styles: [":host{position:relative;box-sizing:border-box}.section-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;border:1.5px dashed rgba(100,116,139,.35);border-radius:4px;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;opacity:0;transition:opacity .15s}:host(:hover) .section-placeholder,:host(.iox-drag-over) .section-placeholder{opacity:1}.section-placeholder i{font-size:22px}.section-child{min-width:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RenderDirective, selector: "[ioxRender]", inputs: ["ioxRender"], outputs: ["onClick", "onMouseEnter", "onMouseLeave"] }, { kind: "directive", type: IoxDraggableDirective, selector: "[ioxDraggable]", inputs: ["ioxDragData", "ioxDragSourceId"] }] }); }
4988
4961
  }
4989
4962
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SectionComponent, decorators: [{
4990
4963
  type: Component,
4991
- args: [{ selector: 'app-section', template: `
4992
- <section class="section-root"
4993
- [ngClass]="['iox-node-' + nodeId, listOrientation === 'horizontal' ? 'is-horizontal' : '']"
4994
- ioxDropzone
4995
- [ioxDropzoneId]="dropListId"
4996
- [ioxDropzoneData]="children"
4997
- (ioxDrop)="onDrop($event)">
4998
-
4999
- <div *ngIf="!children.length" class="section-placeholder">
5000
- <i class="ph-thin ph-rows"></i>
5001
- <span>Drop components here</span>
5002
- </div>
4964
+ args: [{ selector: 'section[iox-section]', template: `
4965
+ <div *ngIf="!children.length" class="section-placeholder">
4966
+ <i class="ph-thin ph-rows"></i>
4967
+ <span>Drop components here</span>
4968
+ </div>
5003
4969
 
5004
- <div *ngFor="let child of children"
5005
- [ngClass]="['section-child', 'iox-outer-' + (child.styleId ?? child.id)]"
5006
- ioxDraggable
5007
- [ioxDragData]="child"
5008
- [ioxDragSourceId]="dropListId">
5009
- <ng-container
5010
- [ioxRender]="child"
5011
- (onClick)="childClick.emit($event)"
5012
- (onMouseEnter)="childMouseEnter.emit($event)"
5013
- (onMouseLeave)="childMouseLeave.emit()">
5014
- </ng-container>
5015
- </div>
5016
- </section>
5017
- `, standalone: false, styles: [".section-root{position:relative;box-sizing:border-box}.section-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;border:1.5px dashed rgba(100,116,139,.35);border-radius:4px;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;opacity:0;transition:opacity .15s}.section-root:hover .section-placeholder,.section-root.iox-drag-over .section-placeholder{opacity:1}.section-placeholder i{font-size:22px}.section-child{min-width:0}\n"] }]
5018
- }], ctorParameters: () => [{ type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
4970
+ <div *ngFor="let child of children"
4971
+ [ngClass]="['section-child', 'iox-outer-' + (child.styleId ?? child.id)]"
4972
+ ioxDraggable
4973
+ [ioxDragData]="child"
4974
+ [ioxDragSourceId]="dropListId">
4975
+ <ng-container
4976
+ [ioxRender]="child"
4977
+ (onClick)="childClick.emit($event)"
4978
+ (onMouseEnter)="childMouseEnter.emit($event)"
4979
+ (onMouseLeave)="childMouseLeave.emit()">
4980
+ </ng-container>
4981
+ </div>
4982
+ `, host: {
4983
+ '[class]': "'section-root iox-node-' + nodeId + (listOrientation === 'horizontal' ? ' is-horizontal' : '')",
4984
+ }, standalone: false, styles: [":host{position:relative;box-sizing:border-box}.section-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;border:1.5px dashed rgba(100,116,139,.35);border-radius:4px;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:0;opacity:0;transition:opacity .15s}:host(:hover) .section-placeholder,:host(.iox-drag-over) .section-placeholder{opacity:1}.section-placeholder i{font-size:22px}.section-child{min-width:0}\n"] }]
4985
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
5019
4986
  type: Input
5020
4987
  }], style: [{
5021
4988
  type: Input
@@ -5031,6 +4998,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
5031
4998
  type: Output
5032
4999
  }] } });
5033
5000
 
5001
+ class IoxDropzoneDirective {
5002
+ constructor(el, dragEngine, cdr) {
5003
+ this.el = el;
5004
+ this.dragEngine = dragEngine;
5005
+ this.cdr = cdr;
5006
+ this.ioxDropzoneId = '';
5007
+ this.ioxDropzoneData = [];
5008
+ this.ioxDrop = new EventEmitter();
5009
+ }
5010
+ ngOnInit() {
5011
+ this.dragEngine.registerDropzone(this.ioxDropzoneId, this.el.nativeElement, this.ioxDropzoneData, this.cdr, (evt) => this.ioxDrop.emit(evt), this.ioxDropzonePostDrop);
5012
+ }
5013
+ ngOnDestroy() {
5014
+ this.dragEngine.unregisterDropzone(this.ioxDropzoneId, this.el.nativeElement);
5015
+ }
5016
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: IoxDropzoneDirective, deps: [{ token: i0.ElementRef }, { token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
5017
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: IoxDropzoneDirective, isStandalone: false, selector: "[ioxDropzone]", inputs: { ioxDropzoneId: "ioxDropzoneId", ioxDropzoneData: "ioxDropzoneData", ioxDropzonePostDrop: "ioxDropzonePostDrop" }, outputs: { ioxDrop: "ioxDrop" }, ngImport: i0 }); }
5018
+ }
5019
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: IoxDropzoneDirective, decorators: [{
5020
+ type: Directive,
5021
+ args: [{
5022
+ selector: '[ioxDropzone]',
5023
+ standalone: false,
5024
+ }]
5025
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { ioxDropzoneId: [{
5026
+ type: Input
5027
+ }], ioxDropzoneData: [{
5028
+ type: Input
5029
+ }], ioxDropzonePostDrop: [{
5030
+ type: Input
5031
+ }], ioxDrop: [{
5032
+ type: Output
5033
+ }] } });
5034
+
5034
5035
  class BuilderContainerComponent {
5035
5036
  constructor(dragEngine, cdr) {
5036
5037
  this.dragEngine = dragEngine;