@vectoriox/iox-builder 1.1.8 → 1.2.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.
|
@@ -422,6 +422,9 @@ class DragEngineService {
|
|
|
422
422
|
registerDraggable(el, getPayload) {
|
|
423
423
|
el.setAttribute('data-iox-draggable', '');
|
|
424
424
|
interact(el).draggable({
|
|
425
|
+
// Don't start a drag when the pointer goes down inside a contenteditable
|
|
426
|
+
// element (e.g. a text block in inline-edit mode).
|
|
427
|
+
ignoreFrom: '[contenteditable="true"]',
|
|
425
428
|
listeners: {
|
|
426
429
|
start: (event) => this._onDragStart(event, el, getPayload),
|
|
427
430
|
move: (event) => this._onDragMove(event),
|
|
@@ -449,6 +452,10 @@ class DragEngineService {
|
|
|
449
452
|
// Drag lifecycle
|
|
450
453
|
// ─────────────────────────────────────────────────────────
|
|
451
454
|
_onDragStart(event, el, getPayload) {
|
|
455
|
+
if (el.hasAttribute('data-editing')) {
|
|
456
|
+
event.interaction.stop();
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
452
459
|
this._payload = getPayload();
|
|
453
460
|
this._sourceEl = el;
|
|
454
461
|
this._isDragging = true;
|
|
@@ -3574,6 +3581,163 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
3574
3581
|
type: Input
|
|
3575
3582
|
}] } });
|
|
3576
3583
|
|
|
3584
|
+
class BuilderButtonBlockComponent {
|
|
3585
|
+
constructor(dragEngine, cdr) {
|
|
3586
|
+
this.dragEngine = dragEngine;
|
|
3587
|
+
this.cdr = cdr;
|
|
3588
|
+
this.children = [];
|
|
3589
|
+
this.style = {};
|
|
3590
|
+
this.tag = 'button';
|
|
3591
|
+
this.href = '';
|
|
3592
|
+
this.target = '_self';
|
|
3593
|
+
this.type = 'button';
|
|
3594
|
+
this.nodeId = '';
|
|
3595
|
+
this.dropListId = '';
|
|
3596
|
+
this.childClick = new EventEmitter();
|
|
3597
|
+
this.childMouseEnter = new EventEmitter();
|
|
3598
|
+
this.childMouseLeave = new EventEmitter();
|
|
3599
|
+
}
|
|
3600
|
+
ngOnInit() { }
|
|
3601
|
+
ngOnDestroy() { }
|
|
3602
|
+
onDrop(event) {
|
|
3603
|
+
this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
|
|
3604
|
+
}
|
|
3605
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, deps: [{ token: DragEngineService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3606
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: BuilderButtonBlockComponent, isStandalone: false, selector: "app-builder-button-block", inputs: { children: "children", style: "style", tag: "tag", href: "href", target: "target", type: "type", nodeId: "nodeId", dropListId: "dropListId" }, outputs: { childClick: "childClick", childMouseEnter: "childMouseEnter", childMouseLeave: "childMouseLeave" }, ngImport: i0, template: `
|
|
3607
|
+
<button *ngIf="tag !== 'a'"
|
|
3608
|
+
class="button-block-root"
|
|
3609
|
+
[ngClass]="'iox-node-' + nodeId"
|
|
3610
|
+
[attr.type]="type"
|
|
3611
|
+
ioxDropzone
|
|
3612
|
+
[ioxDropzoneId]="dropListId"
|
|
3613
|
+
[ioxDropzoneData]="children"
|
|
3614
|
+
(ioxDrop)="onDrop($event)">
|
|
3615
|
+
<ng-container *ngIf="!children.length">
|
|
3616
|
+
<span class="button-block-placeholder">Button</span>
|
|
3617
|
+
</ng-container>
|
|
3618
|
+
<div *ngFor="let child of children"
|
|
3619
|
+
class="button-block-child"
|
|
3620
|
+
[ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
|
|
3621
|
+
ioxDraggable
|
|
3622
|
+
[ioxDragData]="child"
|
|
3623
|
+
[ioxDragSourceId]="dropListId">
|
|
3624
|
+
<ng-container
|
|
3625
|
+
[ioxRender]="child"
|
|
3626
|
+
(onClick)="childClick.emit($event)"
|
|
3627
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
3628
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
3629
|
+
</ng-container>
|
|
3630
|
+
</div>
|
|
3631
|
+
</button>
|
|
3632
|
+
|
|
3633
|
+
<a *ngIf="tag === 'a'"
|
|
3634
|
+
class="button-block-root"
|
|
3635
|
+
[ngClass]="'iox-node-' + nodeId"
|
|
3636
|
+
[attr.href]="href || null"
|
|
3637
|
+
[attr.target]="target || null"
|
|
3638
|
+
ioxDropzone
|
|
3639
|
+
[ioxDropzoneId]="dropListId"
|
|
3640
|
+
[ioxDropzoneData]="children"
|
|
3641
|
+
(ioxDrop)="onDrop($event)">
|
|
3642
|
+
<ng-container *ngIf="!children.length">
|
|
3643
|
+
<span class="button-block-placeholder">Button</span>
|
|
3644
|
+
</ng-container>
|
|
3645
|
+
<div *ngFor="let child of children"
|
|
3646
|
+
class="button-block-child"
|
|
3647
|
+
[ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
|
|
3648
|
+
ioxDraggable
|
|
3649
|
+
[ioxDragData]="child"
|
|
3650
|
+
[ioxDragSourceId]="dropListId">
|
|
3651
|
+
<ng-container
|
|
3652
|
+
[ioxRender]="child"
|
|
3653
|
+
(onClick)="childClick.emit($event)"
|
|
3654
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
3655
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
3656
|
+
</ng-container>
|
|
3657
|
+
</div>
|
|
3658
|
+
</a>
|
|
3659
|
+
`, isInline: true, styles: [".button-block-root{display:inline-flex;align-items:center;gap:8px;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;font:inherit;color:inherit;box-sizing:border-box;width:100%;height:100%;position:relative}.button-block-placeholder{display:flex;align-items:center;justify-content:center;width:100%;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.button-block-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"] }] }); }
|
|
3660
|
+
}
|
|
3661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: BuilderButtonBlockComponent, decorators: [{
|
|
3662
|
+
type: Component,
|
|
3663
|
+
args: [{ selector: 'app-builder-button-block', template: `
|
|
3664
|
+
<button *ngIf="tag !== 'a'"
|
|
3665
|
+
class="button-block-root"
|
|
3666
|
+
[ngClass]="'iox-node-' + nodeId"
|
|
3667
|
+
[attr.type]="type"
|
|
3668
|
+
ioxDropzone
|
|
3669
|
+
[ioxDropzoneId]="dropListId"
|
|
3670
|
+
[ioxDropzoneData]="children"
|
|
3671
|
+
(ioxDrop)="onDrop($event)">
|
|
3672
|
+
<ng-container *ngIf="!children.length">
|
|
3673
|
+
<span class="button-block-placeholder">Button</span>
|
|
3674
|
+
</ng-container>
|
|
3675
|
+
<div *ngFor="let child of children"
|
|
3676
|
+
class="button-block-child"
|
|
3677
|
+
[ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
|
|
3678
|
+
ioxDraggable
|
|
3679
|
+
[ioxDragData]="child"
|
|
3680
|
+
[ioxDragSourceId]="dropListId">
|
|
3681
|
+
<ng-container
|
|
3682
|
+
[ioxRender]="child"
|
|
3683
|
+
(onClick)="childClick.emit($event)"
|
|
3684
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
3685
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
3686
|
+
</ng-container>
|
|
3687
|
+
</div>
|
|
3688
|
+
</button>
|
|
3689
|
+
|
|
3690
|
+
<a *ngIf="tag === 'a'"
|
|
3691
|
+
class="button-block-root"
|
|
3692
|
+
[ngClass]="'iox-node-' + nodeId"
|
|
3693
|
+
[attr.href]="href || null"
|
|
3694
|
+
[attr.target]="target || null"
|
|
3695
|
+
ioxDropzone
|
|
3696
|
+
[ioxDropzoneId]="dropListId"
|
|
3697
|
+
[ioxDropzoneData]="children"
|
|
3698
|
+
(ioxDrop)="onDrop($event)">
|
|
3699
|
+
<ng-container *ngIf="!children.length">
|
|
3700
|
+
<span class="button-block-placeholder">Button</span>
|
|
3701
|
+
</ng-container>
|
|
3702
|
+
<div *ngFor="let child of children"
|
|
3703
|
+
class="button-block-child"
|
|
3704
|
+
[ngClass]="'iox-outer-' + (child.styleId ?? child.id)"
|
|
3705
|
+
ioxDraggable
|
|
3706
|
+
[ioxDragData]="child"
|
|
3707
|
+
[ioxDragSourceId]="dropListId">
|
|
3708
|
+
<ng-container
|
|
3709
|
+
[ioxRender]="child"
|
|
3710
|
+
(onClick)="childClick.emit($event)"
|
|
3711
|
+
(onMouseEnter)="childMouseEnter.emit($event)"
|
|
3712
|
+
(onMouseLeave)="childMouseLeave.emit()">
|
|
3713
|
+
</ng-container>
|
|
3714
|
+
</div>
|
|
3715
|
+
</a>
|
|
3716
|
+
`, standalone: false, styles: [".button-block-root{display:inline-flex;align-items:center;gap:8px;cursor:pointer;text-decoration:none;border:none;background:none;padding:0;font:inherit;color:inherit;box-sizing:border-box;width:100%;height:100%;position:relative}.button-block-placeholder{display:flex;align-items:center;justify-content:center;width:100%;color:#64748b80;font-size:12px;pointer-events:none;-webkit-user-select:none;user-select:none}.button-block-child{min-width:0}\n"] }]
|
|
3717
|
+
}], ctorParameters: () => [{ type: DragEngineService }, { type: i0.ChangeDetectorRef }], propDecorators: { children: [{
|
|
3718
|
+
type: Input
|
|
3719
|
+
}], style: [{
|
|
3720
|
+
type: Input
|
|
3721
|
+
}], tag: [{
|
|
3722
|
+
type: Input
|
|
3723
|
+
}], href: [{
|
|
3724
|
+
type: Input
|
|
3725
|
+
}], target: [{
|
|
3726
|
+
type: Input
|
|
3727
|
+
}], type: [{
|
|
3728
|
+
type: Input
|
|
3729
|
+
}], nodeId: [{
|
|
3730
|
+
type: Input
|
|
3731
|
+
}], dropListId: [{
|
|
3732
|
+
type: Input
|
|
3733
|
+
}], childClick: [{
|
|
3734
|
+
type: Output
|
|
3735
|
+
}], childMouseEnter: [{
|
|
3736
|
+
type: Output
|
|
3737
|
+
}], childMouseLeave: [{
|
|
3738
|
+
type: Output
|
|
3739
|
+
}] } });
|
|
3740
|
+
|
|
3577
3741
|
class PanelChildComponent {
|
|
3578
3742
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: PanelChildComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3579
3743
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: PanelChildComponent, isStandalone: false, selector: "panel-child", inputs: { name: "name" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["tpl"], descendants: true, static: true }], ngImport: i0, template: '<ng-template #tpl><ng-content></ng-content></ng-template>', isInline: true }); }
|
|
@@ -4090,6 +4254,7 @@ const DECLARATIONS = [
|
|
|
4090
4254
|
BuilderContainerComponent,
|
|
4091
4255
|
BuilderLinkedContainerComponent,
|
|
4092
4256
|
BuilderRepeaterComponent,
|
|
4257
|
+
BuilderButtonBlockComponent,
|
|
4093
4258
|
PanelComponent,
|
|
4094
4259
|
PanelChildComponent,
|
|
4095
4260
|
LayerTreeComponent,
|
|
@@ -4107,6 +4272,7 @@ class IoxBuilderModule {
|
|
|
4107
4272
|
BuilderContainerComponent,
|
|
4108
4273
|
BuilderLinkedContainerComponent,
|
|
4109
4274
|
BuilderRepeaterComponent,
|
|
4275
|
+
BuilderButtonBlockComponent,
|
|
4110
4276
|
PanelComponent,
|
|
4111
4277
|
PanelChildComponent,
|
|
4112
4278
|
LayerTreeComponent,
|
|
@@ -4144,6 +4310,7 @@ class IoxBuilderModule {
|
|
|
4144
4310
|
BuilderContainerComponent,
|
|
4145
4311
|
BuilderLinkedContainerComponent,
|
|
4146
4312
|
BuilderRepeaterComponent,
|
|
4313
|
+
BuilderButtonBlockComponent,
|
|
4147
4314
|
PanelComponent,
|
|
4148
4315
|
PanelChildComponent,
|
|
4149
4316
|
LayerTreeComponent,
|
|
@@ -4234,6 +4401,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
|
|
|
4234
4401
|
BuilderContainerComponent,
|
|
4235
4402
|
BuilderLinkedContainerComponent,
|
|
4236
4403
|
BuilderRepeaterComponent,
|
|
4404
|
+
BuilderButtonBlockComponent,
|
|
4237
4405
|
PanelComponent,
|
|
4238
4406
|
PanelChildComponent,
|
|
4239
4407
|
LayerTreeComponent,
|
|
@@ -4269,6 +4437,45 @@ class BuilderButtonComponentConfig extends ComponentConfig {
|
|
|
4269
4437
|
}
|
|
4270
4438
|
}
|
|
4271
4439
|
|
|
4440
|
+
class ButtonBlockComponentConfig extends ComponentConfig {
|
|
4441
|
+
constructor() {
|
|
4442
|
+
super('Button', 'app-builder-button-block', 'ph-thin ph-cursor-click', 'Basic');
|
|
4443
|
+
this.children = [];
|
|
4444
|
+
this.inputs = {
|
|
4445
|
+
tag: 'select',
|
|
4446
|
+
href: 'text',
|
|
4447
|
+
target: 'select',
|
|
4448
|
+
type: 'select',
|
|
4449
|
+
};
|
|
4450
|
+
this.traits = [
|
|
4451
|
+
new TraitConfig('tag', 'Tag', TraitInputType.Select, ['button', 'a'], 'button'),
|
|
4452
|
+
new TraitConfig('href', 'URL', TraitInputType.Text, undefined, '', false, { trait: 'tag', values: 'a' }),
|
|
4453
|
+
new TraitConfig('target', 'Target', TraitInputType.Select, ['_self', '_blank'], '_self', false, { trait: 'tag', values: 'a' }),
|
|
4454
|
+
new TraitConfig('type', 'Type', TraitInputType.Select, ['button', 'submit', 'reset'], 'button', false, { trait: 'tag', values: 'button' }),
|
|
4455
|
+
];
|
|
4456
|
+
this.styleTraits = [
|
|
4457
|
+
new PositionGroupStyleConfig(),
|
|
4458
|
+
new LayoutGroupStyleConfig(),
|
|
4459
|
+
new SizeGroupStyleConfig(),
|
|
4460
|
+
new SpacingGroupStyleConfig(),
|
|
4461
|
+
new BorderGroupStyleConfig(),
|
|
4462
|
+
new BackgroundGroupStyleConfig(),
|
|
4463
|
+
new EffectsGroupStyleConfig(),
|
|
4464
|
+
];
|
|
4465
|
+
this.applyStyleDefaults({
|
|
4466
|
+
display: 'inline-flex',
|
|
4467
|
+
alignItems: 'center',
|
|
4468
|
+
justifyContent: 'center',
|
|
4469
|
+
gap: '8px',
|
|
4470
|
+
width: 'auto',
|
|
4471
|
+
height: 'auto',
|
|
4472
|
+
padding: '10px 20px',
|
|
4473
|
+
borderRadius: '6px',
|
|
4474
|
+
cursor: 'pointer',
|
|
4475
|
+
});
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
|
|
4272
4479
|
class CardComponentConfig extends ComponentConfig {
|
|
4273
4480
|
constructor() {
|
|
4274
4481
|
super('Card', 'app-card', 'ph-thin ph-cards', 'Content');
|
|
@@ -4588,8 +4795,11 @@ class TextBlockComponentConfig extends ComponentConfig {
|
|
|
4588
4795
|
new EffectsGroupStyleConfig(),
|
|
4589
4796
|
];
|
|
4590
4797
|
this.applyStyleDefaults({
|
|
4591
|
-
|
|
4798
|
+
display: 'block',
|
|
4799
|
+
width: '100%',
|
|
4592
4800
|
height: 'auto',
|
|
4801
|
+
minHeight: '20px',
|
|
4802
|
+
padding: '10px',
|
|
4593
4803
|
});
|
|
4594
4804
|
}
|
|
4595
4805
|
}
|
|
@@ -4602,5 +4812,5 @@ class TextBlockComponentConfig extends ComponentConfig {
|
|
|
4602
4812
|
* Generated bundle index. Do not edit.
|
|
4603
4813
|
*/
|
|
4604
4814
|
|
|
4605
|
-
export { ACTION_TYPE_OPTIONS, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
|
|
4815
|
+
export { ACTION_TYPE_OPTIONS, BuilderButtonBlockComponent, BuilderButtonComponentConfig, BuilderComponent, BuilderContainerComponent, BuilderContainerComponentConfig, BuilderDividerComponentConfig, BuilderHeadingComponentConfig, BuilderIconComponentConfig, BuilderImageComponentConfig, BuilderLinkComponentConfig, BuilderLinkedContainerComponent, BuilderLinkedContainerConfig, BuilderMode, BuilderRepeaterComponent, BuilderSpacerComponentConfig, ButtonBlockComponentConfig, CardComponentConfig, ComponentConfig, ComponentRegistryService, DEVICE_OPTIONS, DataSourceRegistryService, DeviceMode, DragEngineService, EASING_OPTIONS$1 as EASING_OPTIONS, GroupStyleConfig, IOX_CONTENT_SERVICE, IOX_FONT_MANAGER, InteractionEngineService, InteractionsPanelComponent, IoxBuilderModule, IoxDraggableDirective, IoxDropzoneDirective, LayerTreeComponent, NodeAction, OverlayComponent, OverlayService, PanelChildComponent, PanelComponent, PanelEventService, PanelEventTypes, PanelTypes, PresetRegistryService, ROUTE_ANIMATION_OPTIONS, RenderDirective, RepeaterComponentConfig, SCREEN_WIDTH_OPTIONS, SectionComponent, SectionComponentConfig, StyleCategory, StyleRegistryService, TraitConfig as StyleTraitConfig, TRIGGER_OPTIONS, TextBlockComponentConfig, ToolbarAction, ToolbarComponent, TraitConfig, TraitInputType, UNITS_ALL, UNITS_DEG, UNITS_FIXED, UNITS_NO_VW, ViewportService, ZOOM_OPTIONS, buildPresetStyleTraits, defaultPageSettings, generateNodeId, resolveTraitControllerType, resolveTraitOptions };
|
|
4606
4816
|
//# sourceMappingURL=vectoriox-iox-builder.mjs.map
|