@vectoriox/iox-builder 1.7.1 → 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.
|
@@ -1889,6 +1889,10 @@ class MoveableCanvasService {
|
|
|
1889
1889
|
this.sourceId = this.resolveDropzoneId(element);
|
|
1890
1890
|
this.ensureMoveable();
|
|
1891
1891
|
this.moveable.target = element;
|
|
1892
|
+
// Drag is initiated by grabbing the ELEMENT itself (like interact.js) — not a Moveable
|
|
1893
|
+
// overlay area — so a plain click still passes through to selection/child-selection and only
|
|
1894
|
+
// a movement past the threshold starts a drag. Keeps Moveable visually silent (no hit-area box).
|
|
1895
|
+
this.moveable.dragTarget = element;
|
|
1892
1896
|
this.moveable.updateRect();
|
|
1893
1897
|
}
|
|
1894
1898
|
/** Recompute the control-box position (call on scroll/zoom/layout changes). */
|
|
@@ -2854,6 +2858,8 @@ let dropListCounter = 0;
|
|
|
2854
2858
|
*/
|
|
2855
2859
|
const DIRECTIVE_HOST_TYPES = new Set([
|
|
2856
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',
|
|
2857
2863
|
]);
|
|
2858
2864
|
/**
|
|
2859
2865
|
* RenderDirective — applied to <ng-container> to dynamically instantiate a
|
|
@@ -4893,42 +4899,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4893
4899
|
args: ['globalOverlay']
|
|
4894
4900
|
}] } });
|
|
4895
4901
|
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
this.ioxDrop = new EventEmitter();
|
|
4904
|
-
}
|
|
4905
|
-
ngOnInit() {
|
|
4906
|
-
this.dragEngine.registerDropzone(this.ioxDropzoneId, this.el.nativeElement, this.ioxDropzoneData, this.cdr, (evt) => this.ioxDrop.emit(evt), this.ioxDropzonePostDrop);
|
|
4907
|
-
}
|
|
4908
|
-
ngOnDestroy() {
|
|
4909
|
-
this.dragEngine.unregisterDropzone(this.ioxDropzoneId, this.el.nativeElement);
|
|
4910
|
-
}
|
|
4911
|
-
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 }); }
|
|
4912
|
-
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 }); }
|
|
4913
|
-
}
|
|
4914
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: IoxDropzoneDirective, decorators: [{
|
|
4915
|
-
type: Directive,
|
|
4916
|
-
args: [{
|
|
4917
|
-
selector: '[ioxDropzone]',
|
|
4918
|
-
standalone: false,
|
|
4919
|
-
}]
|
|
4920
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { ioxDropzoneId: [{
|
|
4921
|
-
type: Input
|
|
4922
|
-
}], ioxDropzoneData: [{
|
|
4923
|
-
type: Input
|
|
4924
|
-
}], ioxDropzonePostDrop: [{
|
|
4925
|
-
type: Input
|
|
4926
|
-
}], ioxDrop: [{
|
|
4927
|
-
type: Output
|
|
4928
|
-
}] } });
|
|
4929
|
-
|
|
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
|
+
*/
|
|
4930
4909
|
class SectionComponent {
|
|
4931
|
-
constructor(dragEngine, cdr) {
|
|
4910
|
+
constructor(elRef, dragEngine, cdr) {
|
|
4911
|
+
this.elRef = elRef;
|
|
4932
4912
|
this.dragEngine = dragEngine;
|
|
4933
4913
|
this.cdr = cdr;
|
|
4934
4914
|
this.children = [];
|
|
@@ -4939,7 +4919,13 @@ class SectionComponent {
|
|
|
4939
4919
|
this.childMouseEnter = new EventEmitter();
|
|
4940
4920
|
this.childMouseLeave = new EventEmitter();
|
|
4941
4921
|
}
|
|
4942
|
-
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
|
+
}
|
|
4943
4929
|
get listOrientation() {
|
|
4944
4930
|
const d = this.style?.['display'];
|
|
4945
4931
|
if (d === 'flex' || d === 'inline-flex') {
|
|
@@ -4949,69 +4935,54 @@ class SectionComponent {
|
|
|
4949
4935
|
}
|
|
4950
4936
|
return 'vertical';
|
|
4951
4937
|
}
|
|
4952
|
-
ngOnDestroy() { }
|
|
4953
4938
|
onDrop(event) {
|
|
4954
4939
|
this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
|
|
4955
4940
|
}
|
|
4956
|
-
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 }); }
|
|
4957
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: SectionComponent, isStandalone: false, selector: "
|
|
4958
|
-
<
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
[ioxDropzoneData]="children"
|
|
4963
|
-
(ioxDrop)="onDrop($event)">
|
|
4964
|
-
|
|
4965
|
-
<div *ngIf="!children.length" class="section-placeholder">
|
|
4966
|
-
<i class="ph-thin ph-rows"></i>
|
|
4967
|
-
<span>Drop components here</span>
|
|
4968
|
-
</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>
|
|
4969
4947
|
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
`, 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"] }] }); }
|
|
4984
4961
|
}
|
|
4985
4962
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SectionComponent, decorators: [{
|
|
4986
4963
|
type: Component,
|
|
4987
|
-
args: [{ selector: '
|
|
4988
|
-
<
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
[ioxDropzoneData]="children"
|
|
4993
|
-
(ioxDrop)="onDrop($event)">
|
|
4994
|
-
|
|
4995
|
-
<div *ngIf="!children.length" class="section-placeholder">
|
|
4996
|
-
<i class="ph-thin ph-rows"></i>
|
|
4997
|
-
<span>Drop components here</span>
|
|
4998
|
-
</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>
|
|
4999
4969
|
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
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: [{
|
|
5015
4986
|
type: Input
|
|
5016
4987
|
}], style: [{
|
|
5017
4988
|
type: Input
|
|
@@ -5027,6 +4998,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
5027
4998
|
type: Output
|
|
5028
4999
|
}] } });
|
|
5029
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
|
+
|
|
5030
5035
|
class BuilderContainerComponent {
|
|
5031
5036
|
constructor(dragEngine, cdr) {
|
|
5032
5037
|
this.dragEngine = dragEngine;
|