@vectoriox/iox-builder 11.6.0 → 11.7.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.
|
@@ -11431,13 +11431,14 @@ class BuilderDialogComponent {
|
|
|
11431
11431
|
const allowed = ['center', 'top', 'bottom', 'start', 'end'];
|
|
11432
11432
|
return allowed.indexOf(String(this.placement)) >= 0 ? String(this.placement) : 'center';
|
|
11433
11433
|
}
|
|
11434
|
-
constructor(dragEngine, instanceRegistry, overlayService, cdr, designState, panelEvents) {
|
|
11434
|
+
constructor(dragEngine, instanceRegistry, overlayService, cdr, designState, panelEvents, zone) {
|
|
11435
11435
|
this.dragEngine = dragEngine;
|
|
11436
11436
|
this.instanceRegistry = instanceRegistry;
|
|
11437
11437
|
this.overlayService = overlayService;
|
|
11438
11438
|
this.cdr = cdr;
|
|
11439
11439
|
this.designState = designState;
|
|
11440
11440
|
this.panelEvents = panelEvents;
|
|
11441
|
+
this.zone = zone;
|
|
11441
11442
|
this.children = [];
|
|
11442
11443
|
this.nodeId = '';
|
|
11443
11444
|
this.dropListId = '';
|
|
@@ -11456,6 +11457,14 @@ class BuilderDialogComponent {
|
|
|
11456
11457
|
/** Closed by its X / backdrop while the selection or the switcher still shows it: hidden until either changes. */
|
|
11457
11458
|
this.dismissed = false;
|
|
11458
11459
|
}
|
|
11460
|
+
/** The canvas runs interactions OUTSIDE Angular's zone; an open / close they cause still has to reach the panels
|
|
11461
|
+
* and the toolbar that read the design state (CC1.3: the Phone menu preview, the Menu chip). */
|
|
11462
|
+
inZone(fn) {
|
|
11463
|
+
if (this.zone)
|
|
11464
|
+
this.zone.run(fn);
|
|
11465
|
+
else
|
|
11466
|
+
fn();
|
|
11467
|
+
}
|
|
11459
11468
|
/** Open on the canvas right now (an exit that is playing counts as closed). */
|
|
11460
11469
|
get isOpen() {
|
|
11461
11470
|
return this.designOpen && !this.closing;
|
|
@@ -11559,9 +11568,9 @@ class BuilderDialogComponent {
|
|
|
11559
11568
|
}
|
|
11560
11569
|
// Open/close/toggle actions (and A1c's panel) reach the canvas twin through here.
|
|
11561
11570
|
this.instanceRegistry.register(this.nodeId, {
|
|
11562
|
-
open: () => this.openRuntime(),
|
|
11563
|
-
close: () => this.closeRuntime(),
|
|
11564
|
-
toggle: () => (this.isOpen ? this.closeRuntime() : this.openRuntime()),
|
|
11571
|
+
open: () => this.inZone(() => this.openRuntime()),
|
|
11572
|
+
close: () => this.inZone(() => this.closeRuntime()),
|
|
11573
|
+
toggle: () => this.inZone(() => (this.isOpen ? this.closeRuntime() : this.openRuntime())),
|
|
11565
11574
|
isOpen: () => this.isOpen,
|
|
11566
11575
|
});
|
|
11567
11576
|
}
|
|
@@ -11593,7 +11602,7 @@ class BuilderDialogComponent {
|
|
|
11593
11602
|
onDrop(event) {
|
|
11594
11603
|
this.dragEngine.handleDrop(this.children, event, this.dropListId, this.cdr);
|
|
11595
11604
|
}
|
|
11596
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderDialogComponent, deps: [{ token: DragEngineService }, { token: i1$1.ComponentInstanceRegistryService }, { token: OverlayService }, { token: i0.ChangeDetectorRef }, { token: CanvasDesignStateService, optional: true }, { token: PanelEventService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11605
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderDialogComponent, deps: [{ token: DragEngineService }, { token: i1$1.ComponentInstanceRegistryService }, { token: OverlayService }, { token: i0.ChangeDetectorRef }, { token: CanvasDesignStateService, optional: true }, { token: PanelEventService, optional: true }, { token: i0.NgZone, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11597
11606
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderDialogComponent, isStandalone: false, selector: "app-builder-dialog", inputs: { children: "children", nodeId: "nodeId", dropListId: "dropListId", closeOnBackdrop: "closeOnBackdrop", showCloseButton: "showCloseButton", placement: "placement" }, outputs: { childClick: "childClick", childMouseEnter: "childMouseEnter", childMouseLeave: "childMouseLeave" }, viewQueries: [{ propertyName: "stageRef", first: true, predicate: ["stage"], descendants: true }], ngImport: i0, template: `
|
|
11598
11607
|
<div *ngIf="designOpen" #stage class="dialog-stage" [attr.data-placement]="placementValue"
|
|
11599
11608
|
(click)="onStageClick($event)">
|
|
@@ -11667,6 +11676,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
|
|
|
11667
11676
|
type: Optional
|
|
11668
11677
|
}] }, { type: PanelEventService, decorators: [{
|
|
11669
11678
|
type: Optional
|
|
11679
|
+
}] }, { type: i0.NgZone, decorators: [{
|
|
11680
|
+
type: Optional
|
|
11670
11681
|
}] }], propDecorators: { children: [{
|
|
11671
11682
|
type: Input
|
|
11672
11683
|
}], nodeId: [{
|
|
@@ -13556,9 +13567,10 @@ function picture(createConfig, aspectRatio, src = '') {
|
|
|
13556
13567
|
setTrait(node, 'src', src);
|
|
13557
13568
|
return styled(node, { width: '100%', height: 'auto', aspectRatio });
|
|
13558
13569
|
}
|
|
13570
|
+
const photoAt = (copy, index) => (copy.photos?.length ? copy.photos[index % copy.photos.length] : '');
|
|
13559
13571
|
function card(copy, createConfig, index) {
|
|
13560
13572
|
return boxed('card', createConfig, [
|
|
13561
|
-
picture(createConfig, '4 / 3',
|
|
13573
|
+
picture(createConfig, '4 / 3', photoAt(copy, index)),
|
|
13562
13574
|
heading('h3', copy.cardTitle, 'h3', createConfig),
|
|
13563
13575
|
text(copy.cardText, createConfig, 'small'),
|
|
13564
13576
|
], { display: 'grid', gap: '8px', alignContent: 'start', minWidth: '0' });
|
|
@@ -13583,7 +13595,7 @@ function homeView(copy, createConfig, opts) {
|
|
|
13583
13595
|
const cards = Array.from({ length: CARD_COUNT }, (_, i) => card(copy, createConfig, i));
|
|
13584
13596
|
const cardRow = withChildren(styled(box(createConfig), { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: '14px' }), cards);
|
|
13585
13597
|
const collection = block(createConfig, SpecimenFamily.Collection, opts, [listHeading, cardRow], { [EntrancePart.Heading]: [listHeading], [EntrancePart.Items]: cards });
|
|
13586
|
-
const rowPicture = picture(createConfig, '16 / 10');
|
|
13598
|
+
const rowPicture = picture(createConfig, '16 / 10', photoAt(copy, 3));
|
|
13587
13599
|
const rowHeading = heading('h2', copy.rowHeading, 'h2', createConfig);
|
|
13588
13600
|
const rowWords = withChildren(styled(box(createConfig), { display: 'grid', gap: '10px', alignContent: 'center' }), [rowHeading, text(copy.rowText, createConfig, 'body')]);
|
|
13589
13601
|
const feature = block(createConfig, SpecimenFamily.Feature, opts, [rowPicture, rowWords], { [EntrancePart.Heading]: [rowHeading], [EntrancePart.RowMedia]: [rowPicture] }, { gridTemplateColumns: 'minmax(0, 1.1fr) minmax(0, 1fr)', gap: '18px', alignItems: 'start' });
|
|
@@ -13599,7 +13611,7 @@ function homeView(copy, createConfig, opts) {
|
|
|
13599
13611
|
}
|
|
13600
13612
|
function itemView(copy, createConfig, opts) {
|
|
13601
13613
|
const title = heading('display', copy.cardTitle, 'h1', createConfig);
|
|
13602
|
-
const media = picture(createConfig, '16 / 8', copy.
|
|
13614
|
+
const media = picture(createConfig, '16 / 8', copy.photos?.[0]);
|
|
13603
13615
|
return [block(createConfig, SpecimenFamily.Detail, opts, [text(copy.listHeading, createConfig, 'eyebrow'), title, media, text(copy.cardText, createConfig, 'lead')], { [EntrancePart.Heading]: [title], [EntrancePart.Media]: [media] })];
|
|
13604
13616
|
}
|
|
13605
13617
|
/**
|