@vectoriox/iox-ui 5.14.0 → 5.16.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/design-core/index.d.ts +190 -25
- package/fesm2022/vectoriox-iox-ui-design-core.mjs +393 -62
- package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
- package/fesm2022/vectoriox-iox-ui.mjs +38 -12
- package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
- package/index.d.ts +18 -3
- package/package.json +1 -1
- package/src/design-core/design-apply.ts +116 -0
- package/src/design-core/design-settings.ts +194 -0
- package/src/design-core/empty-image.ts +14 -5
- package/src/design-core/flavor-seed.ts +39 -13
- package/src/design-core/flavor-spec.generated.ts +14 -6
- package/src/design-core/flavor.ts +6 -5
- package/src/design-core/fonts.ts +45 -8
- package/src/design-core/public-api.ts +2 -0
- package/src/design-core/token-css.ts +32 -2
- package/src/design-core/token-names.ts +21 -0
|
@@ -559,9 +559,11 @@ class BuilderImageComponent {
|
|
|
559
559
|
this.alt = 'Image';
|
|
560
560
|
this.nodeId = '';
|
|
561
561
|
/**
|
|
562
|
-
* What a MARKED image shows
|
|
563
|
-
* the shared `
|
|
564
|
-
* the blank on the live site, `null` for an unmarked image, which therefore renders
|
|
562
|
+
* What a MARKED image shows WHENEVER it has no source (design-system DS3) — set by each renderer
|
|
563
|
+
* from the shared `emptyImagePlaceholder` (`@vectoriox/iox-ui/design-core`): the "Add image" label
|
|
564
|
+
* on the canvas, the blank on the live site, `null` for an unmarked image, which therefore renders
|
|
565
|
+
* as before. It does not depend on `src`, so clearing the source (a binding emptied, a context slot
|
|
566
|
+
* not yet filled) shows it with no re-render; a renderer re-sets it only when the MARKER changes.
|
|
565
567
|
*/
|
|
566
568
|
this.emptySrc = null;
|
|
567
569
|
}
|
|
@@ -578,18 +580,33 @@ class BuilderImageComponent {
|
|
|
578
580
|
get srcAttr() {
|
|
579
581
|
return this.src || this.emptySrc || null;
|
|
580
582
|
}
|
|
583
|
+
get showsPlaceholder() {
|
|
584
|
+
return !this.src && !!this.emptySrc;
|
|
585
|
+
}
|
|
581
586
|
/** `data-iox-empty` while the placeholder stands in — the hook the shared fill rule keys on. */
|
|
582
587
|
get emptyAttr() {
|
|
583
|
-
return
|
|
588
|
+
return this.showsPlaceholder ? '' : null;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* The placeholder is not the author's picture, so it never carries the author's alt: it is
|
|
592
|
+
* decorative (`alt=""`) and hidden from assistive technology — on the live site, in Preview and on
|
|
593
|
+
* the canvas alike (the canvas label is painted inside the placeholder, not announced as content).
|
|
594
|
+
*/
|
|
595
|
+
get altAttr() {
|
|
596
|
+
return this.showsPlaceholder ? '' : this.alt;
|
|
597
|
+
}
|
|
598
|
+
get ariaHiddenAttr() {
|
|
599
|
+
return this.showsPlaceholder ? 'true' : null;
|
|
584
600
|
}
|
|
585
601
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
586
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderImageComponent, isStandalone: false, selector: "img[iox-img]", inputs: { src: "src", alt: "alt", nodeId: "nodeId", emptySrc: "emptySrc" }, host: { properties: { "attr.src": "srcAttr", "attr.alt": "
|
|
602
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderImageComponent, isStandalone: false, selector: "img[iox-img]", inputs: { src: "src", alt: "alt", nodeId: "nodeId", emptySrc: "emptySrc" }, host: { properties: { "attr.src": "srcAttr", "attr.alt": "altAttr", "attr.aria-hidden": "ariaHiddenAttr", "attr.data-iox-empty": "emptyAttr", "class": "'iox-node-' + nodeId" } }, ngImport: i0, template: '', isInline: true, styles: [":host{display:block;max-width:100%}\n"] }); }
|
|
587
603
|
}
|
|
588
604
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderImageComponent, decorators: [{
|
|
589
605
|
type: Component,
|
|
590
606
|
args: [{ selector: 'img[iox-img]', template: '', host: {
|
|
591
607
|
'[attr.src]': 'srcAttr',
|
|
592
|
-
'[attr.alt]': '
|
|
608
|
+
'[attr.alt]': 'altAttr',
|
|
609
|
+
'[attr.aria-hidden]': 'ariaHiddenAttr',
|
|
593
610
|
'[attr.data-iox-empty]': 'emptyAttr',
|
|
594
611
|
'[class]': "'iox-node-' + nodeId",
|
|
595
612
|
}, standalone: false, styles: [":host{display:block;max-width:100%}\n"] }]
|
|
@@ -737,6 +754,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
|
|
|
737
754
|
/**
|
|
738
755
|
* Directive-host link: the `<a>` IS the host — no wrapper. Content is the label; styles come from
|
|
739
756
|
* `.iox-node` (the legacy `style` input is kept for builder compat but no longer inline-applied).
|
|
757
|
+
*
|
|
758
|
+
* Outside a preview (`IS_PREVIEW` unprovided — the editing canvas, the design sampler) the link keeps
|
|
759
|
+
* its real `href` so it LOOKS like the live site's (the UA link styles key on it) and stays clickable
|
|
760
|
+
* so the canvas can select it, but no click navigates: plain, modified (cmd/ctrl/shift) and middle
|
|
761
|
+
* clicks all have their default cancelled here.
|
|
740
762
|
*/
|
|
741
763
|
class BuilderLinkComponent {
|
|
742
764
|
constructor(isPreview) {
|
|
@@ -761,16 +783,16 @@ class BuilderLinkComponent {
|
|
|
761
783
|
}
|
|
762
784
|
}
|
|
763
785
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderLinkComponent, deps: [{ token: IS_PREVIEW, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
764
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderLinkComponent, isStandalone: false, selector: "a[iox-link]", inputs: { nodeId: "nodeId", label: "label", linkType: "linkType", url: "url", pageRoute: "pageRoute", target: "target", style: "style" }, host: { listeners: { "click": "onLinkClick($event)" }, properties: { "attr.href": "
|
|
786
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: BuilderLinkComponent, isStandalone: false, selector: "a[iox-link]", inputs: { nodeId: "nodeId", label: "label", linkType: "linkType", url: "url", pageRoute: "pageRoute", target: "target", style: "style" }, host: { listeners: { "click": "onLinkClick($event)", "auxclick": "onLinkClick($event)" }, properties: { "attr.href": "resolvedHref", "attr.target": "target", "class": "'builder-link iox-node-' + nodeId" } }, ngImport: i0, template: `{{ label }}`, isInline: true, styles: [":host{display:inline;cursor:pointer}:host:where(:not(.iox-es)){color:inherit}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
765
787
|
}
|
|
766
788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: BuilderLinkComponent, decorators: [{
|
|
767
789
|
type: Component,
|
|
768
790
|
args: [{ selector: 'a[iox-link]', template: `{{ label }}`, host: {
|
|
769
|
-
'[attr.href]':
|
|
770
|
-
'[attr.target]':
|
|
771
|
-
'[style.pointer-events]': "isPreview ? null : 'none'",
|
|
791
|
+
'[attr.href]': 'resolvedHref',
|
|
792
|
+
'[attr.target]': 'target',
|
|
772
793
|
'[class]': "'builder-link iox-node-' + nodeId",
|
|
773
794
|
'(click)': 'onLinkClick($event)',
|
|
795
|
+
'(auxclick)': 'onLinkClick($event)',
|
|
774
796
|
}, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:inline;cursor:pointer}:host:where(:not(.iox-es)){color:inherit}\n"] }]
|
|
775
797
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
776
798
|
type: Optional
|
|
@@ -1131,6 +1153,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImpo
|
|
|
1131
1153
|
args: ['childrenHost', { read: ViewContainerRef, static: true }]
|
|
1132
1154
|
}] } });
|
|
1133
1155
|
|
|
1156
|
+
/** `click` covers plain and modified clicks; a middle click opens a tab through `auxclick` alone. */
|
|
1157
|
+
const NAVIGATING_CLICKS = ['click', 'auxclick'];
|
|
1134
1158
|
/** Directive-host linked container: the `<a>` IS the host — no wrapper, no inner/outer split. */
|
|
1135
1159
|
class LinkedContainerComponent {
|
|
1136
1160
|
constructor(elRef, isPreview) {
|
|
@@ -1145,12 +1169,14 @@ class LinkedContainerComponent {
|
|
|
1145
1169
|
}
|
|
1146
1170
|
ngOnInit() {
|
|
1147
1171
|
if (!this.isPreview) {
|
|
1148
|
-
|
|
1172
|
+
for (const type of NAVIGATING_CLICKS)
|
|
1173
|
+
this.elRef.nativeElement.addEventListener(type, this.capturePreventDefault, true);
|
|
1149
1174
|
}
|
|
1150
1175
|
}
|
|
1151
1176
|
ngOnDestroy() {
|
|
1152
1177
|
if (!this.isPreview) {
|
|
1153
|
-
|
|
1178
|
+
for (const type of NAVIGATING_CLICKS)
|
|
1179
|
+
this.elRef.nativeElement.removeEventListener(type, this.capturePreventDefault, true);
|
|
1154
1180
|
}
|
|
1155
1181
|
}
|
|
1156
1182
|
get resolvedHref() {
|