@lluc_llull/ui-lib 0.16.2 → 0.17.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/directives/link-type.directive.d.ts +3 -3
- package/effects/dynamic-background/dynamic-background.component.d.ts +3 -2
- package/fesm2022/lluc_llull-ui-lib-directives.mjs +12 -6
- package/fesm2022/lluc_llull-ui-lib-directives.mjs.map +1 -1
- package/fesm2022/lluc_llull-ui-lib-effects.mjs +13 -5
- package/fesm2022/lluc_llull-ui-lib-effects.mjs.map +1 -1
- package/fesm2022/lluc_llull-ui-lib-mapper.mjs +15 -5
- package/fesm2022/lluc_llull-ui-lib-mapper.mjs.map +1 -1
- package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs +9 -5
- package/fesm2022/lluc_llull-ui-lib-screen-sizer.mjs.map +1 -1
- package/mapper/mapper.service.d.ts +3 -2
- package/package.json +5 -5
- package/screen-sizer/screen-sizer.service.d.ts +2 -2
|
@@ -5,12 +5,12 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
export declare class LinkTypeDirective implements OnInit {
|
|
6
6
|
private readonly router;
|
|
7
7
|
private readonly elRef;
|
|
8
|
+
private platformId;
|
|
8
9
|
linkType?: LinkType;
|
|
9
10
|
href?: string;
|
|
10
11
|
anchorClicked: EventEmitter<void>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
constructor(router: Router, elRef: ElementRef<HTMLAnchorElement>);
|
|
12
|
+
constructor(router: Router, elRef: ElementRef<HTMLAnchorElement>, platformId: Object);
|
|
13
|
+
get isBrowser(): boolean;
|
|
14
14
|
ngOnInit(): void;
|
|
15
15
|
onClick(event: Event): void;
|
|
16
16
|
private setupAttributes;
|
|
@@ -2,19 +2,20 @@ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
|
2
2
|
import { EffectKey } from './effects/effect-registry';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DynamicBackgroundComponent implements OnInit, OnDestroy {
|
|
5
|
+
private readonly platformId;
|
|
5
6
|
canvasRef: ElementRef<HTMLCanvasElement>;
|
|
6
7
|
effect: EffectKey;
|
|
7
8
|
rotationSpeed: number;
|
|
8
9
|
size: number;
|
|
9
10
|
backgroundColor: string;
|
|
10
11
|
elementColor?: string;
|
|
11
|
-
private readonly platformId;
|
|
12
|
-
private readonly isBrowser;
|
|
13
12
|
private scene;
|
|
14
13
|
private camera;
|
|
15
14
|
private renderer;
|
|
16
15
|
private animationId;
|
|
17
16
|
private currentEffect;
|
|
17
|
+
constructor(platformId: Object);
|
|
18
|
+
get isBrowser(): boolean;
|
|
18
19
|
ngOnInit(): void;
|
|
19
20
|
ngOnDestroy(): void;
|
|
20
21
|
private initScene;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter,
|
|
3
|
+
import { EventEmitter, PLATFORM_ID, HostListener, Output, Input, Inject, Directive } from '@angular/core';
|
|
4
4
|
export { LinkType } from '@lluc_llull/ui-lib/enums';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
6
6
|
|
|
7
7
|
class LinkTypeDirective {
|
|
8
8
|
router;
|
|
9
9
|
elRef;
|
|
10
|
+
platformId;
|
|
10
11
|
linkType;
|
|
11
12
|
href;
|
|
12
13
|
anchorClicked = new EventEmitter();
|
|
13
|
-
|
|
14
|
-
isBrowser = isPlatformBrowser(this.platformId);
|
|
15
|
-
constructor(router, elRef) {
|
|
14
|
+
constructor(router, elRef, platformId) {
|
|
16
15
|
this.router = router;
|
|
17
16
|
this.elRef = elRef;
|
|
17
|
+
this.platformId = platformId;
|
|
18
|
+
}
|
|
19
|
+
get isBrowser() {
|
|
20
|
+
return isPlatformBrowser(this.platformId);
|
|
18
21
|
}
|
|
19
22
|
ngOnInit() {
|
|
20
23
|
this.setupAttributes();
|
|
@@ -93,7 +96,7 @@ class LinkTypeDirective {
|
|
|
93
96
|
});
|
|
94
97
|
this.anchorClicked.emit();
|
|
95
98
|
}
|
|
96
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LinkTypeDirective, deps: [{ token: i1.Router }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LinkTypeDirective, deps: [{ token: i1.Router }, { token: i0.ElementRef }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Directive });
|
|
97
100
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.19", type: LinkTypeDirective, isStandalone: true, selector: "[linkType]", inputs: { linkType: "linkType", href: "href" }, outputs: { anchorClicked: "anchorClicked" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
98
101
|
}
|
|
99
102
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: LinkTypeDirective, decorators: [{
|
|
@@ -102,7 +105,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
102
105
|
selector: '[linkType]',
|
|
103
106
|
standalone: true,
|
|
104
107
|
}]
|
|
105
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: i0.ElementRef }
|
|
108
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i0.ElementRef }, { type: Object, decorators: [{
|
|
109
|
+
type: Inject,
|
|
110
|
+
args: [PLATFORM_ID]
|
|
111
|
+
}] }], propDecorators: { linkType: [{
|
|
106
112
|
type: Input
|
|
107
113
|
}], href: [{
|
|
108
114
|
type: Input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lluc_llull-ui-lib-directives.mjs","sources":["../../../projects/ui-lib/directives/link-type.directive.ts","../../../projects/ui-lib/directives/lluc_llull-ui-lib-directives.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnInit,\n Output,\n PLATFORM_ID,\n
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-directives.mjs","sources":["../../../projects/ui-lib/directives/link-type.directive.ts","../../../projects/ui-lib/directives/lluc_llull-ui-lib-directives.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n Inject,\n Input,\n OnInit,\n Output,\n PLATFORM_ID,\n} from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LinkType } from '@lluc_llull/ui-lib/enums';\n\n@Directive({\n selector: '[linkType]',\n standalone: true,\n})\nexport class LinkTypeDirective implements OnInit {\n @Input() linkType?: LinkType;\n @Input() href?: string;\n @Output() anchorClicked = new EventEmitter<void>();\n\n constructor(\n private readonly router: Router,\n private readonly elRef: ElementRef<HTMLAnchorElement>,\n @Inject(PLATFORM_ID) private platformId: Object,\n ) {}\n\n get isBrowser(): boolean {\n return isPlatformBrowser(this.platformId);\n }\n\n ngOnInit(): void {\n this.setupAttributes();\n }\n\n @HostListener('click', ['$event'])\n onClick(event: Event): void {\n if (!this.linkType || !this.href) return;\n\n switch (this.linkType) {\n case 'internal':\n event.preventDefault();\n this.navigateInternal(this.href);\n break;\n\n case 'anchor':\n event.preventDefault();\n this.scrollToAnchor(this.href);\n break;\n\n case 'nolink':\n event.preventDefault();\n break;\n\n case 'external':\n case 'pdf':\n default:\n break;\n }\n }\n\n private setupAttributes(): void {\n const element = this.elRef.nativeElement;\n const resolvedHref = this.resolveHref();\n\n if (!resolvedHref) return;\n\n element.setAttribute('href', resolvedHref);\n\n if (this.linkType === 'external' || this.linkType === 'pdf') {\n element.setAttribute('target', '_blank');\n element.setAttribute('rel', 'noopener noreferrer nofollow');\n }\n }\n\n private resolveHref(): string {\n if (!this.href) return '';\n\n // si ya es absoluta, no tocarla\n if (this.href.startsWith('/')) {\n return this.href;\n }\n\n if (this.linkType === 'internal') {\n const lang = this.getCurrentLang();\n return `/${lang}/${this.href}`;\n }\n\n return this.href;\n }\n\n private navigateInternal(url: string): void {\n // si ya es absoluta, navega directamente\n if (url.startsWith('/')) {\n this.router.navigateByUrl(url);\n return;\n }\n\n const lang = this.getCurrentLang();\n\n this.anchorClicked.emit();\n this.router.navigate(['/', lang, url]);\n }\n\n private getCurrentLang(): string {\n const firstSegment = this.router.url.split('?')[0].split('#')[0].split('/')[1];\n return firstSegment || 'es';\n }\n\n private scrollToAnchor(id: string): void {\n if (!this.isBrowser) return;\n\n const cleanId = id.replace(/^#/, '');\n const el = document.getElementById(cleanId);\n if (!el) return;\n\n const yOffset = -160;\n const y = el.getBoundingClientRect().top + window.scrollY + yOffset;\n\n window.scrollTo({\n top: y,\n behavior: 'smooth',\n });\n\n this.anchorClicked.emit();\n }\n}\n\nexport { LinkType };\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAmBa,iBAAiB,CAAA;AAML,IAAA,MAAA;AACA,IAAA,KAAA;AACY,IAAA,UAAA;AAPxB,IAAA,QAAQ;AACR,IAAA,IAAI;AACH,IAAA,aAAa,GAAG,IAAI,YAAY,EAAQ;AAElD,IAAA,WAAA,CACqB,MAAc,EACd,KAAoC,EACxB,UAAkB,EAAA;QAF9B,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,KAAK,GAAL,KAAK;QACO,IAAA,CAAA,UAAU,GAAV,UAAU;IACxC;AAEH,IAAA,IAAI,SAAS,GAAA;AACT,QAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;IAC7C;IAEA,QAAQ,GAAA;QACJ,IAAI,CAAC,eAAe,EAAE;IAC1B;AAGA,IAAA,OAAO,CAAC,KAAY,EAAA;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE;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A,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;IAC7B;AA7GS,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,kEAQd,WAAW,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;4FARd,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,aAAA,EAAA,eAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA;;0BASQ,MAAM;2BAAC,WAAW;yCAPd,QAAQ,EAAA,CAAA;sBAAhB;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACS,aAAa,EAAA,CAAA;sBAAtB;gBAiBD,OAAO,EAAA,CAAA;sBADN,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;ACtCrC;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { PLATFORM_ID, Input, ViewChild, Inject, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
|
|
6
6
|
class SphereDeformEffect {
|
|
@@ -50,19 +50,24 @@ const EFFECT_REGISTRY = {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
class DynamicBackgroundComponent {
|
|
53
|
+
platformId;
|
|
53
54
|
canvasRef;
|
|
54
55
|
effect = 'sphere-deform';
|
|
55
56
|
rotationSpeed = 0.01;
|
|
56
57
|
size = 2;
|
|
57
58
|
backgroundColor = '#000000';
|
|
58
59
|
elementColor;
|
|
59
|
-
platformId = inject(PLATFORM_ID);
|
|
60
|
-
isBrowser = isPlatformBrowser(this.platformId);
|
|
61
60
|
scene;
|
|
62
61
|
camera;
|
|
63
62
|
renderer;
|
|
64
63
|
animationId;
|
|
65
64
|
currentEffect;
|
|
65
|
+
constructor(platformId) {
|
|
66
|
+
this.platformId = platformId;
|
|
67
|
+
}
|
|
68
|
+
get isBrowser() {
|
|
69
|
+
return isPlatformBrowser(this.platformId);
|
|
70
|
+
}
|
|
66
71
|
ngOnInit() {
|
|
67
72
|
if (this.isBrowser) {
|
|
68
73
|
this.initScene();
|
|
@@ -115,13 +120,16 @@ class DynamicBackgroundComponent {
|
|
|
115
120
|
this.camera.updateProjectionMatrix();
|
|
116
121
|
this.renderer.setSize(width, height);
|
|
117
122
|
};
|
|
118
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DynamicBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DynamicBackgroundComponent, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
119
124
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.19", type: DynamicBackgroundComponent, isStandalone: true, selector: "lib-dynamic-background", inputs: { effect: "effect", rotationSpeed: "rotationSpeed", size: "size", backgroundColor: "backgroundColor", elementColor: "elementColor" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["bgCanvas"], descendants: true, static: true }], ngImport: i0, template: "<canvas #bgCanvas class=\"dynamic-bg-canvas\"></canvas>\n", styles: [".dynamic-bg-canvas{position:absolute;top:0;left:0;width:100%;height:100%;display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
120
125
|
}
|
|
121
126
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: DynamicBackgroundComponent, decorators: [{
|
|
122
127
|
type: Component,
|
|
123
128
|
args: [{ selector: 'lib-dynamic-background', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<canvas #bgCanvas class=\"dynamic-bg-canvas\"></canvas>\n", styles: [".dynamic-bg-canvas{position:absolute;top:0;left:0;width:100%;height:100%;display:block}\n"] }]
|
|
124
|
-
}],
|
|
129
|
+
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
130
|
+
type: Inject,
|
|
131
|
+
args: [PLATFORM_ID]
|
|
132
|
+
}] }], propDecorators: { canvasRef: [{
|
|
125
133
|
type: ViewChild,
|
|
126
134
|
args: ['bgCanvas', { static: true }]
|
|
127
135
|
}], effect: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lluc_llull-ui-lib-effects.mjs","sources":["../../../projects/ui-lib/effects/dynamic-background/effects/sphere-deform/sphere-deform.effect.ts","../../../projects/ui-lib/effects/dynamic-background/effects/effect-registry.ts","../../../projects/ui-lib/effects/dynamic-background/dynamic-background.component.ts","../../../projects/ui-lib/effects/dynamic-background/dynamic-background.component.html","../../../projects/ui-lib/effects/lluc_llull-ui-lib-effects.ts"],"sourcesContent":["import * as THREE from 'three';\nimport { DynamicEffect } from '../dynamic-effect.interface';\n\nexport class SphereDeformEffect implements DynamicEffect {\n private mesh!: THREE.Mesh;\n private time = 0;\n\n constructor(\n private size: number,\n private rotationSpeed: number,\n private color?: string,\n ) {}\n\n init(scene: THREE.Scene, _options: any): void {\n const geometry = new THREE.SphereGeometry(this.size, 128, 128);\n\n const material = this.color\n ? new THREE.MeshStandardMaterial({ color: this.color, flatShading: true })\n : new THREE.MeshNormalMaterial({ flatShading: true });\n\n this.mesh = new THREE.Mesh(geometry, material);\n scene.add(this.mesh);\n }\n\n animate(): void {\n this.time += 0.02;\n const positionAttr = this.mesh.geometry.attributes['position'] as THREE.BufferAttribute;\n const vertex = new THREE.Vector3();\n\n for (let i = 0; i < positionAttr.count; i++) {\n vertex.fromBufferAttribute(positionAttr, i);\n\n const offset =\n Math.sin(vertex.x * 3 + this.time) * 0.2 +\n Math.cos(vertex.y * 5 + this.time * 0.7) * 0.2;\n\n vertex.normalize().multiplyScalar(this.size + offset);\n\n positionAttr.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n\n positionAttr.needsUpdate = true;\n this.mesh.geometry.computeVertexNormals();\n\n this.mesh.rotation.y += this.rotationSpeed;\n }\n\n dispose(): void {\n this.mesh?.geometry.dispose();\n (this.mesh?.material as THREE.Material)?.dispose();\n }\n}\n","import { DynamicEffect } from './dynamic-effect.interface';\nimport { SphereDeformEffect } from './sphere-deform/sphere-deform.effect';\n// import { RingTransformEffect } from './ring-transform/ring-transform.effect';\n// import { ParticlesEffect } from './particles/particles.effect';\n\nexport type EffectKey = 'sphere-deform' | 'ring-transform' | 'particles';\n\nexport const EFFECT_REGISTRY: Partial<Record<EffectKey, new (...args: any[]) => DynamicEffect>> = {\n 'sphere-deform': SphereDeformEffect,\n // 'ring-transform': RingTransformEffect,\n // 'particles': ParticlesEffect,\n};\n","import { CommonModule, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n ViewChild,\n inject,\n} from '@angular/core';\nimport * as THREE from 'three';\nimport { DynamicEffect } from './effects/dynamic-effect.interface';\nimport { EFFECT_REGISTRY, EffectKey } from './effects/effect-registry';\n\n@Component({\n selector: 'lib-dynamic-background',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './dynamic-background.component.html',\n styleUrl: './dynamic-background.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicBackgroundComponent implements OnInit, OnDestroy {\n @ViewChild('bgCanvas', { static: true }) canvasRef!: ElementRef<HTMLCanvasElement>;\n\n @Input() effect: EffectKey = 'sphere-deform';\n @Input() rotationSpeed = 0.01;\n @Input() size = 2;\n @Input() backgroundColor = '#000000';\n @Input() elementColor?: string;\n\n private readonly platformId = inject(PLATFORM_ID);\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private scene!: THREE.Scene;\n private camera!: THREE.PerspectiveCamera;\n private renderer!: THREE.WebGLRenderer;\n private animationId!: number;\n\n private currentEffect!: DynamicEffect;\n\n ngOnInit(): void {\n if (this.isBrowser) {\n this.initScene();\n this.loadEffect();\n this.animate();\n window.addEventListener('resize', this.onResize);\n }\n }\n\n ngOnDestroy(): void {\n if (this.isBrowser) {\n cancelAnimationFrame(this.animationId);\n this.renderer?.dispose();\n this.currentEffect?.dispose();\n window.removeEventListener('resize', this.onResize);\n }\n }\n\n private initScene(): void {\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n this.scene = new THREE.Scene();\n this.scene.background = new THREE.Color(this.backgroundColor);\n\n this.camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);\n this.camera.position.z = 5;\n\n this.renderer = new THREE.WebGLRenderer({\n canvas: this.canvasRef.nativeElement,\n antialias: true,\n });\n this.renderer.setSize(width, height);\n\n const light = new THREE.DirectionalLight(0xffffff, 1);\n light.position.set(5, 5, 5).normalize();\n this.scene.add(light);\n }\n\n private loadEffect(): void {\n const EffectClass = EFFECT_REGISTRY[this.effect];\n if (!EffectClass) {\n throw new Error(`Efecto \"${this.effect}\" no está registrado en EFFECT_REGISTRY`);\n }\n this.currentEffect = new EffectClass(this.size, this.rotationSpeed, this.elementColor);\n this.currentEffect.init(this.scene, {});\n }\n\n private animate = (): void => {\n this.animationId = requestAnimationFrame(this.animate);\n this.currentEffect.animate();\n this.renderer.render(this.scene, this.camera);\n };\n\n private onResize = (): void => {\n const width = window.innerWidth;\n const height = window.innerHeight;\n this.camera.aspect = width / height;\n this.camera.updateProjectionMatrix();\n this.renderer.setSize(width, height);\n };\n}\n","<canvas #bgCanvas class=\"dynamic-bg-canvas\"></canvas>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAGa,kBAAkB,CAAA;AAKf,IAAA,IAAA;AACA,IAAA,aAAA;AACA,IAAA,KAAA;AANJ,IAAA,IAAI;IACJ,IAAI,GAAG,CAAC;AAEhB,IAAA,WAAA,CACY,IAAY,EACZ,aAAqB,EACrB,KAAc,EAAA;QAFd,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IAAA,CAAA,KAAK,GAAL,KAAK;IACd;IAEH,IAAI,CAAC,KAAkB,EAAE,QAAa,EAAA;AAClC,QAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC;AAE9D,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC;AAClB,cAAE,IAAI,KAAK,CAAC,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE;AACzE,cAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC9C,QAAA,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB;IAEA,OAAO,GAAA;AACH,QAAA,IAAI,CAAC,IAAI,IAAI,IAAI;AACjB,QAAA,MAAM,YAAY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AAA,CAAA,2FAAA,CAAA,EAAA;8BAGN,SAAS,EAAA,CAAA;sBAAjD,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;gBAE9B,MAAM,EAAA,CAAA;sBAAd;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,YAAY,EAAA,CAAA;sBAApB;;;AE/BL;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-effects.mjs","sources":["../../../projects/ui-lib/effects/dynamic-background/effects/sphere-deform/sphere-deform.effect.ts","../../../projects/ui-lib/effects/dynamic-background/effects/effect-registry.ts","../../../projects/ui-lib/effects/dynamic-background/dynamic-background.component.ts","../../../projects/ui-lib/effects/dynamic-background/dynamic-background.component.html","../../../projects/ui-lib/effects/lluc_llull-ui-lib-effects.ts"],"sourcesContent":["import * as THREE from 'three';\nimport { DynamicEffect } from '../dynamic-effect.interface';\n\nexport class SphereDeformEffect implements DynamicEffect {\n private mesh!: THREE.Mesh;\n private time = 0;\n\n constructor(\n private size: number,\n private rotationSpeed: number,\n private color?: string,\n ) {}\n\n init(scene: THREE.Scene, _options: any): void {\n const geometry = new THREE.SphereGeometry(this.size, 128, 128);\n\n const material = this.color\n ? new THREE.MeshStandardMaterial({ color: this.color, flatShading: true })\n : new THREE.MeshNormalMaterial({ flatShading: true });\n\n this.mesh = new THREE.Mesh(geometry, material);\n scene.add(this.mesh);\n }\n\n animate(): void {\n this.time += 0.02;\n const positionAttr = this.mesh.geometry.attributes['position'] as THREE.BufferAttribute;\n const vertex = new THREE.Vector3();\n\n for (let i = 0; i < positionAttr.count; i++) {\n vertex.fromBufferAttribute(positionAttr, i);\n\n const offset =\n Math.sin(vertex.x * 3 + this.time) * 0.2 +\n Math.cos(vertex.y * 5 + this.time * 0.7) * 0.2;\n\n vertex.normalize().multiplyScalar(this.size + offset);\n\n positionAttr.setXYZ(i, vertex.x, vertex.y, vertex.z);\n }\n\n positionAttr.needsUpdate = true;\n this.mesh.geometry.computeVertexNormals();\n\n this.mesh.rotation.y += this.rotationSpeed;\n }\n\n dispose(): void {\n this.mesh?.geometry.dispose();\n (this.mesh?.material as THREE.Material)?.dispose();\n }\n}\n","import { DynamicEffect } from './dynamic-effect.interface';\nimport { SphereDeformEffect } from './sphere-deform/sphere-deform.effect';\n// import { RingTransformEffect } from './ring-transform/ring-transform.effect';\n// import { ParticlesEffect } from './particles/particles.effect';\n\nexport type EffectKey = 'sphere-deform' | 'ring-transform' | 'particles';\n\nexport const EFFECT_REGISTRY: Partial<Record<EffectKey, new (...args: any[]) => DynamicEffect>> = {\n 'sphere-deform': SphereDeformEffect,\n // 'ring-transform': RingTransformEffect,\n // 'particles': ParticlesEffect,\n};\n","import { CommonModule, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n ViewChild,\n} from '@angular/core';\nimport * as THREE from 'three';\nimport { DynamicEffect } from './effects/dynamic-effect.interface';\nimport { EFFECT_REGISTRY, EffectKey } from './effects/effect-registry';\n\n@Component({\n selector: 'lib-dynamic-background',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './dynamic-background.component.html',\n styleUrl: './dynamic-background.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicBackgroundComponent implements OnInit, OnDestroy {\n @ViewChild('bgCanvas', { static: true }) canvasRef!: ElementRef<HTMLCanvasElement>;\n\n @Input() effect: EffectKey = 'sphere-deform';\n @Input() rotationSpeed = 0.01;\n @Input() size = 2;\n @Input() backgroundColor = '#000000';\n @Input() elementColor?: string;\n\n private scene!: THREE.Scene;\n private camera!: THREE.PerspectiveCamera;\n private renderer!: THREE.WebGLRenderer;\n private animationId!: number;\n\n private currentEffect!: DynamicEffect;\n\n constructor(@Inject(PLATFORM_ID) private readonly platformId: Object) {}\n\n get isBrowser(): boolean {\n return isPlatformBrowser(this.platformId);\n }\n\n ngOnInit(): void {\n if (this.isBrowser) {\n this.initScene();\n this.loadEffect();\n this.animate();\n window.addEventListener('resize', this.onResize);\n }\n }\n\n ngOnDestroy(): void {\n if (this.isBrowser) {\n cancelAnimationFrame(this.animationId);\n this.renderer?.dispose();\n this.currentEffect?.dispose();\n window.removeEventListener('resize', this.onResize);\n }\n }\n\n private initScene(): void {\n const width = window.innerWidth;\n const height = window.innerHeight;\n\n this.scene = new THREE.Scene();\n this.scene.background = new THREE.Color(this.backgroundColor);\n\n this.camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);\n this.camera.position.z = 5;\n\n this.renderer = new THREE.WebGLRenderer({\n canvas: this.canvasRef.nativeElement,\n antialias: true,\n });\n this.renderer.setSize(width, height);\n\n const light = new THREE.DirectionalLight(0xffffff, 1);\n light.position.set(5, 5, 5).normalize();\n this.scene.add(light);\n }\n\n private loadEffect(): void {\n const EffectClass = EFFECT_REGISTRY[this.effect];\n if (!EffectClass) {\n throw new Error(`Efecto \"${this.effect}\" no está registrado en EFFECT_REGISTRY`);\n }\n this.currentEffect = new EffectClass(this.size, this.rotationSpeed, this.elementColor);\n this.currentEffect.init(this.scene, {});\n }\n\n private animate = (): void => {\n this.animationId = requestAnimationFrame(this.animate);\n this.currentEffect.animate();\n this.renderer.render(this.scene, this.camera);\n };\n\n private onResize = (): void => {\n const width = window.innerWidth;\n const height = window.innerHeight;\n this.camera.aspect = width / height;\n this.camera.updateProjectionMatrix();\n this.renderer.setSize(width, height);\n };\n}\n","<canvas #bgCanvas class=\"dynamic-bg-canvas\"></canvas>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAGa,kBAAkB,CAAA;AAKf,IAAA,IAAA;AACA,IAAA,aAAA;AACA,IAAA,KAAA;AANJ,IAAA,IAAI;IACJ,IAAI,GAAG,CAAC;AA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Ad;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,IAAI,EAAA,CAAA;sBAAZ;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,YAAY,EAAA,CAAA;sBAApB;;;AE/BL;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapImage, mapButtons } from '@lluc_llull/ui-lib/utils';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken,
|
|
3
|
+
import { InjectionToken, PLATFORM_ID, Inject, Injectable } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
const mapCategoryProgress = (props) => ({
|
|
6
6
|
pretitle: props?.texts?.pretitle,
|
|
@@ -140,8 +140,12 @@ const componentMappers = {
|
|
|
140
140
|
const CDN_BASE_URL = new InjectionToken('CDN_BASE_URL');
|
|
141
141
|
|
|
142
142
|
class MapperService {
|
|
143
|
-
platformId
|
|
144
|
-
cdn
|
|
143
|
+
platformId;
|
|
144
|
+
cdn;
|
|
145
|
+
constructor(platformId, cdn) {
|
|
146
|
+
this.platformId = platformId;
|
|
147
|
+
this.cdn = cdn;
|
|
148
|
+
}
|
|
145
149
|
mapComponents(body) {
|
|
146
150
|
if (!body || body.length === 0) {
|
|
147
151
|
return [];
|
|
@@ -170,7 +174,7 @@ class MapperService {
|
|
|
170
174
|
return mapped;
|
|
171
175
|
});
|
|
172
176
|
}
|
|
173
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MapperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MapperService, deps: [{ token: PLATFORM_ID }, { token: CDN_BASE_URL }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
174
178
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MapperService, providedIn: 'root' });
|
|
175
179
|
}
|
|
176
180
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: MapperService, decorators: [{
|
|
@@ -178,7 +182,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
178
182
|
args: [{
|
|
179
183
|
providedIn: 'root',
|
|
180
184
|
}]
|
|
181
|
-
}]
|
|
185
|
+
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
186
|
+
type: Inject,
|
|
187
|
+
args: [PLATFORM_ID]
|
|
188
|
+
}] }, { type: undefined, decorators: [{
|
|
189
|
+
type: Inject,
|
|
190
|
+
args: [CDN_BASE_URL]
|
|
191
|
+
}] }] });
|
|
182
192
|
|
|
183
193
|
/**
|
|
184
194
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lluc_llull-ui-lib-mapper.mjs","sources":["../../../projects/ui-lib/mapper/component-mappers/category-progress.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/nav-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/header-clear.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/hero-section.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/lang-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/legal-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/links-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/404.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/section-intro.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/social-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/visual-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/index.ts","../../../projects/ui-lib/mapper/cdn.token.ts","../../../projects/ui-lib/mapper/mapper.service.ts","../../../projects/ui-lib/mapper/lluc_llull-ui-lib-mapper.ts"],"sourcesContent":["import { ComponentMapperFn } from './types';\n\nexport const mapCategoryProgress: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n categories: props?.items?.map((item: any) => ({\n title: item.title,\n items: item.items?.map((subItem: any) => ({\n label: subItem.name,\n value: subItem.progress,\n })),\n })),\n});\n","import { UiLibNavItemsI, UiLibSocialItemsI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapNavModal = (navigation: any, lang: string): UiLibNavItemsI[] => {\n if (!navigation?.items || !Array.isArray(navigation.items)) return [];\n\n return navigation.items.map((item: any) => {\n const slug = item.slug;\n\n const url = slug === 'home' || slug === '' ? `/${lang}` : `/${lang}/${slug}`;\n\n return {\n label: item.label?.[lang] ?? item.label?.['es'] ?? slug,\n url,\n linkType: 'internal',\n name: slug,\n active: true,\n children: [],\n };\n });\n};\n\nexport const mapSocialLinks = (navigation: any): UiLibSocialItemsI[] => {\n if (!navigation?.social || !Array.isArray(navigation.social)) return [];\n\n return navigation.social.map((item: any, index: number) => ({\n label: item.label ?? '',\n url: item.url ?? '',\n linkType: item.linkType ?? 'external',\n icon: item.icon ?? '',\n order: item.order ?? index,\n }));\n};\n","import { mapImage } from '@lluc_llull/ui-lib/utils';\nimport { mapSocialLinks } from './nav-modal.mapper';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeaderClear: ComponentMapperFn = (props, cdn) => {\n return {\n logo: mapImage(props?.logo, cdn),\n logoDark: mapImage(props?.logoDark, cdn),\n lang: props?.lang || 'es',\n navigation: props?.navigation,\n socialItems: mapSocialLinks(props?.navigation),\n };\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeroSection: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n buttons: mapButtons(props?.buttons),\n highlight: props?.texts?.highlight,\n});\n","import { UiLibLangItemI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapLangModal = (langs: any[], currentLang: string = 'es'): UiLibLangItemI[] => {\n if (!Array.isArray(langs)) return [];\n\n return langs.map((lang, index) => {\n const label = lang.labels?.[currentLang] || lang.labels?.[lang.code] || lang.code;\n\n return {\n id: lang.id ?? index,\n code: lang.code,\n label,\n };\n });\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLegalFooter: ComponentMapperFn = (props) => ({\n year: props?.texts?.year,\n brand: props?.texts?.brand,\n credits: props?.texts?.credits,\n links: mapButtons(props?.footer_links),\n //variant\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLinksFooter: ComponentMapperFn = (props) => ({\n links: mapButtons(props?.footer_links),\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const map404: ComponentMapperFn = (props) => ({\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n highlight: props?.texts?.highlight,\n button: mapButtons(props?.buttons)[0],\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSectionIntro: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n button: mapButtons(props?.button)[0],\n});\n","import { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSocialFooter: ComponentMapperFn = (props) => ({\n images: mapImage(props?.multimedia),\n socials: mapButtons(props?.social_links),\n hashtag: props?.texts?.hashtag,\n});\n","import { UiLibAddressI } from '@lluc_llull/ui-lib/interfaces';\nimport { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapVisualFooter: ComponentMapperFn = (props) => ({\n contactTitle: props?.texts?.contactTitle,\n contactPhone: mapButtons(props?.contactPhone),\n contactEmail: mapButtons(props?.contactEmail),\n addressTitle: props?.texts?.addressTitle,\n address: {\n address: props?.address?.address,\n city: props?.address?.city,\n country: props?.address?.country,\n cp: props?.address?.cp,\n province: props?.address?.province,\n } as UiLibAddressI,\n socialsTitle: props?.texts?.socialsTitle,\n socials: mapButtons(props?.social_links),\n image: mapImage(props?.multimedia),\n});\n","\nexport * from './category-progress.mapper';\nexport * from './header-clear.mapper';\nexport * from './hero-section.mapper';\nexport * from './lang-modal.mapper';\nexport * from './legal-footer.mapper';\nexport * from './links-footer.mapper';\nexport * from './404.mapper';\nexport * from './section-intro.mapper';\nexport * from './social-footer.mapper';\nexport * from './visual-footer.mapper';\nexport * from './nav-modal.mapper';\n\nimport { mapCategoryProgress } from './category-progress.mapper';\nimport { mapHeaderClear } from './header-clear.mapper';\nimport { mapHeroSection } from './hero-section.mapper';\nimport { mapLangModal } from './lang-modal.mapper';\nimport { mapLegalFooter } from './legal-footer.mapper';\nimport { mapLinksFooter } from './links-footer.mapper';\nimport { map404 } from './404.mapper';\nimport { mapSectionIntro } from './section-intro.mapper';\nimport { mapSocialFooter } from './social-footer.mapper';\nimport { mapVisualFooter } from './visual-footer.mapper';\n\nexport const componentMappers: Record<string, (props: any, cdn?: string) => any> = {\n 'hero-section': mapHeroSection,\n 'header-clear': mapHeaderClear,\n 'lang-modal': mapLangModal,\n 'section-intro': mapSectionIntro,\n 'category-progress': mapCategoryProgress,\n 'links-footer': mapLinksFooter,\n 'legal-footer': mapLegalFooter,\n 'social-footer': mapSocialFooter,\n 'visual-footer': mapVisualFooter,\n 'not-found': map404,\n};\n","import { InjectionToken } from '@angular/core';\n\nexport const CDN_BASE_URL = new InjectionToken<string>('CDN_BASE_URL');","import { inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { BodyComponent } from '@lluc_llull/ui-lib/interfaces';\nimport { CDN_BASE_URL } from './cdn.token';\nimport { componentMappers } from './component-mappers';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MapperService {\n private platformId = inject(PLATFORM_ID);\n private cdn = inject(CDN_BASE_URL);\n\n mapComponents<T>(body: any[]): BodyComponent<T>[] {\n if (!body || body.length === 0) {\n return [];\n }\n\n return body\n .filter((component) => component && component.name && component.props)\n .map((component) => {\n const name = component.name.toLowerCase();\n const mapper = componentMappers[name];\n\n const mapped: BodyComponent<T> = {\n name,\n order: component.order,\n props: {} as T,\n };\n\n if (mapper) {\n try {\n mapped.props = mapper(component.props, this.cdn) as T;\n } catch (e) {\n console.error(`Error mapping props for component \"${name}\"`, e);\n }\n } else {\n console.warn(`No mapper found for component \"${name}\"`);\n }\n\n return mapped;\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAEa,mBAAmB,GAAsB,CAAC,KAAK,MAAM;AAC9D,IAAA,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ;AAChC,IAAA,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;AAC1B,IAAA,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAS,MAAM;QAC1C,KAAK,EAAE,IAAI,CAAC,KAAK;AACjB,QAAA,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAY,MAAM;YACtC,KAAK,EAAE,OAAO,CAAC,IAAI;YACnB,KAAK,EAAE,OAAO,CAAC,QAAQ;AAC1B,SAAA,CAAC,CAAC;AACN,KAAA,CAAC,CAAC;AACN,CAAA;;MCVY,WAAW,GAAG,CAAC,UAAe,EAAE,IAAY,KAAsB;AAC3E,IAAA,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,EAAE;IAErE,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,KAAI;AACtC,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI;QAEtB,MA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version":3,"file":"lluc_llull-ui-lib-mapper.mjs","sources":["../../../projects/ui-lib/mapper/component-mappers/category-progress.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/nav-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/header-clear.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/hero-section.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/lang-modal.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/legal-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/links-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/404.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/section-intro.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/social-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/visual-footer.mapper.ts","../../../projects/ui-lib/mapper/component-mappers/index.ts","../../../projects/ui-lib/mapper/cdn.token.ts","../../../projects/ui-lib/mapper/mapper.service.ts","../../../projects/ui-lib/mapper/lluc_llull-ui-lib-mapper.ts"],"sourcesContent":["import { ComponentMapperFn } from './types';\n\nexport const mapCategoryProgress: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n categories: props?.items?.map((item: any) => ({\n title: item.title,\n items: item.items?.map((subItem: any) => ({\n label: subItem.name,\n value: subItem.progress,\n })),\n })),\n});\n","import { UiLibNavItemsI, UiLibSocialItemsI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapNavModal = (navigation: any, lang: string): UiLibNavItemsI[] => {\n if (!navigation?.items || !Array.isArray(navigation.items)) return [];\n\n return navigation.items.map((item: any) => {\n const slug = item.slug;\n\n const url = slug === 'home' || slug === '' ? `/${lang}` : `/${lang}/${slug}`;\n\n return {\n label: item.label?.[lang] ?? item.label?.['es'] ?? slug,\n url,\n linkType: 'internal',\n name: slug,\n active: true,\n children: [],\n };\n });\n};\n\nexport const mapSocialLinks = (navigation: any): UiLibSocialItemsI[] => {\n if (!navigation?.social || !Array.isArray(navigation.social)) return [];\n\n return navigation.social.map((item: any, index: number) => ({\n label: item.label ?? '',\n url: item.url ?? '',\n linkType: item.linkType ?? 'external',\n icon: item.icon ?? '',\n order: item.order ?? index,\n }));\n};\n","import { mapImage } from '@lluc_llull/ui-lib/utils';\nimport { mapSocialLinks } from './nav-modal.mapper';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeaderClear: ComponentMapperFn = (props, cdn) => {\n return {\n logo: mapImage(props?.logo, cdn),\n logoDark: mapImage(props?.logoDark, cdn),\n lang: props?.lang || 'es',\n navigation: props?.navigation,\n socialItems: mapSocialLinks(props?.navigation),\n };\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapHeroSection: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n buttons: mapButtons(props?.buttons),\n highlight: props?.texts?.highlight,\n});\n","import { UiLibLangItemI } from '@lluc_llull/ui-lib/interfaces';\n\nexport const mapLangModal = (langs: any[], currentLang: string = 'es'): UiLibLangItemI[] => {\n if (!Array.isArray(langs)) return [];\n\n return langs.map((lang, index) => {\n const label = lang.labels?.[currentLang] || lang.labels?.[lang.code] || lang.code;\n\n return {\n id: lang.id ?? index,\n code: lang.code,\n label,\n };\n });\n};\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLegalFooter: ComponentMapperFn = (props) => ({\n year: props?.texts?.year,\n brand: props?.texts?.brand,\n credits: props?.texts?.credits,\n links: mapButtons(props?.footer_links),\n //variant\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapLinksFooter: ComponentMapperFn = (props) => ({\n links: mapButtons(props?.footer_links),\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const map404: ComponentMapperFn = (props) => ({\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n highlight: props?.texts?.highlight,\n button: mapButtons(props?.buttons)[0],\n});\n","import { mapButtons } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSectionIntro: ComponentMapperFn = (props) => ({\n pretitle: props?.texts?.pretitle,\n title: props?.texts?.title,\n subtitle: props?.texts?.subtitle,\n text: props?.texts?.text,\n button: mapButtons(props?.button)[0],\n});\n","import { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapSocialFooter: ComponentMapperFn = (props) => ({\n images: mapImage(props?.multimedia),\n socials: mapButtons(props?.social_links),\n hashtag: props?.texts?.hashtag,\n});\n","import { UiLibAddressI } from '@lluc_llull/ui-lib/interfaces';\nimport { mapButtons, mapImage } from '@lluc_llull/ui-lib/utils';\nimport { ComponentMapperFn } from './types';\n\nexport const mapVisualFooter: ComponentMapperFn = (props) => ({\n contactTitle: props?.texts?.contactTitle,\n contactPhone: mapButtons(props?.contactPhone),\n contactEmail: mapButtons(props?.contactEmail),\n addressTitle: props?.texts?.addressTitle,\n address: {\n address: props?.address?.address,\n city: props?.address?.city,\n country: props?.address?.country,\n cp: props?.address?.cp,\n province: props?.address?.province,\n } as UiLibAddressI,\n socialsTitle: props?.texts?.socialsTitle,\n socials: mapButtons(props?.social_links),\n image: mapImage(props?.multimedia),\n});\n","\nexport * from './category-progress.mapper';\nexport * from './header-clear.mapper';\nexport * from './hero-section.mapper';\nexport * from './lang-modal.mapper';\nexport * from './legal-footer.mapper';\nexport * from './links-footer.mapper';\nexport * from './404.mapper';\nexport * from './section-intro.mapper';\nexport * from './social-footer.mapper';\nexport * from './visual-footer.mapper';\nexport * from './nav-modal.mapper';\n\nimport { mapCategoryProgress } from './category-progress.mapper';\nimport { mapHeaderClear } from './header-clear.mapper';\nimport { mapHeroSection } from './hero-section.mapper';\nimport { mapLangModal } from './lang-modal.mapper';\nimport { mapLegalFooter } from './legal-footer.mapper';\nimport { mapLinksFooter } from './links-footer.mapper';\nimport { map404 } from './404.mapper';\nimport { mapSectionIntro } from './section-intro.mapper';\nimport { mapSocialFooter } from './social-footer.mapper';\nimport { mapVisualFooter } from './visual-footer.mapper';\n\nexport const componentMappers: Record<string, (props: any, cdn?: string) => any> = {\n 'hero-section': mapHeroSection,\n 'header-clear': mapHeaderClear,\n 'lang-modal': mapLangModal,\n 'section-intro': mapSectionIntro,\n 'category-progress': mapCategoryProgress,\n 'links-footer': mapLinksFooter,\n 'legal-footer': mapLegalFooter,\n 'social-footer': mapSocialFooter,\n 'visual-footer': mapVisualFooter,\n 'not-found': map404,\n};\n","import { InjectionToken } from '@angular/core';\n\nexport const CDN_BASE_URL = new InjectionToken<string>('CDN_BASE_URL');","import { Inject, Injectable, PLATFORM_ID } from '@angular/core';\nimport { BodyComponent } from '@lluc_llull/ui-lib/interfaces';\nimport { CDN_BASE_URL } from './cdn.token';\nimport { componentMappers } from './component-mappers';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MapperService {\n\n constructor(@Inject(PLATFORM_ID) private readonly platformId: Object, @Inject(CDN_BASE_URL) private readonly cdn: string) {}\n\n mapComponents<T>(body: any[]): BodyComponent<T>[] {\n if (!body || body.length === 0) {\n return [];\n }\n\n return body\n .filter((component) => component && component.name && component.props)\n .map((component) => {\n const name = component.name.toLowerCase();\n const mapper = componentMappers[name];\n\n const mapped: BodyComponent<T> = {\n name,\n order: component.order,\n props: {} as T,\n };\n\n if (mapper) {\n try {\n mapped.props = mapper(component.props, this.cdn) as T;\n } catch (e) {\n console.error(`Error mapping props for component \"${name}\"`, e);\n }\n } else {\n console.warn(`No mapper found for component \"${name}\"`);\n }\n\n return mapped;\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAEa,mBAAmB,GAAsB,CAAC,KAAK,MAAM;AAC9D,IAAA,QAAQ,EAAE,KAAK,EAAE,KAAK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AAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAM;gBACzD;gBAAE,OAAO,CAAC,EAAE;oBACR,OAAO,CAAC,KAAK,CAAC,CAAA,mCAAA,EAAsC,IAAI,CAAA,CAAA,CAAG,EAAE,CAAC,CAAC;gBACnE;YACJ;iBAAO;AACH,gBAAA,OAAO,CAAC,IAAI,CAAC,kCAAkC,IAAI,CAAA,CAAA,CAAG,CAAC;YAC3D;AAEA,YAAA,OAAO,MAAM;AACjB,QAAA,CAAC,CAAC;IACV;wGAjCS,aAAa,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAEF,WAAW,EAAA,EAAA,EAAA,KAAA,EAA+C,YAAY,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAFjF,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFV,MAAM,EAAA,CAAA;;4FAET,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;0BAGgB,MAAM;2BAAC,WAAW;;0BAAwC,MAAM;2BAAC,YAAY;;;ACV9F;;AAEG;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { signal,
|
|
3
|
+
import { signal, PLATFORM_ID, Inject, Injectable } from '@angular/core';
|
|
4
4
|
import { fromEvent } from 'rxjs';
|
|
5
5
|
import { debounceTime, map, distinctUntilChanged, startWith } from 'rxjs/operators';
|
|
6
6
|
|
|
7
7
|
class ScreenSizerService {
|
|
8
|
+
platformId;
|
|
8
9
|
breakpoints = {
|
|
9
10
|
xs: 480,
|
|
10
11
|
sm: 768,
|
|
@@ -21,14 +22,14 @@ class ScreenSizerService {
|
|
|
21
22
|
minMd = signal(false);
|
|
22
23
|
minLg = signal(false);
|
|
23
24
|
minXl = signal(false);
|
|
24
|
-
platformId = inject(PLATFORM_ID);
|
|
25
25
|
get width() {
|
|
26
26
|
if (isPlatformBrowser(this.platformId)) {
|
|
27
27
|
return Math.min(window.innerWidth, window.outerWidth);
|
|
28
28
|
}
|
|
29
29
|
return 0;
|
|
30
30
|
}
|
|
31
|
-
constructor() {
|
|
31
|
+
constructor(platformId) {
|
|
32
|
+
this.platformId = platformId;
|
|
32
33
|
if (isPlatformBrowser(this.platformId)) {
|
|
33
34
|
fromEvent(window, 'resize')
|
|
34
35
|
.pipe(debounceTime(200), map(() => this.width), distinctUntilChanged(), startWith(this.width))
|
|
@@ -75,13 +76,16 @@ class ScreenSizerService {
|
|
|
75
76
|
minXlInstant() {
|
|
76
77
|
return this.minXl();
|
|
77
78
|
}
|
|
78
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
79
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
79
80
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, providedIn: 'root' });
|
|
80
81
|
}
|
|
81
82
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: ScreenSizerService, decorators: [{
|
|
82
83
|
type: Injectable,
|
|
83
84
|
args: [{ providedIn: 'root' }]
|
|
84
|
-
}], ctorParameters: () => [
|
|
85
|
+
}], ctorParameters: () => [{ type: Object, decorators: [{
|
|
86
|
+
type: Inject,
|
|
87
|
+
args: [PLATFORM_ID]
|
|
88
|
+
}] }] });
|
|
85
89
|
|
|
86
90
|
/**
|
|
87
91
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lluc_llull-ui-lib-screen-sizer.mjs","sources":["../../../projects/ui-lib/screen-sizer/screen-sizer.service.ts","../../../projects/ui-lib/screen-sizer/lluc_llull-ui-lib-screen-sizer.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Injectable, PLATFORM_ID, inject, signal } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map, startWith } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ScreenSizerService {\n readonly breakpoints = {\n xs: 480,\n sm: 768,\n md: 1024,\n lg: 1280,\n xl: 1536,\n };\n\n readonly isXs = signal(false);\n readonly isSm = signal(false);\n readonly isMd = signal(false);\n readonly isLg = signal(false);\n readonly isXl = signal(false);\n\n readonly minSm = signal(false);\n readonly minMd = signal(false);\n readonly minLg = signal(false);\n readonly minXl = signal(false);\n\n
|
|
1
|
+
{"version":3,"file":"lluc_llull-ui-lib-screen-sizer.mjs","sources":["../../../projects/ui-lib/screen-sizer/screen-sizer.service.ts","../../../projects/ui-lib/screen-sizer/lluc_llull-ui-lib-screen-sizer.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Inject, Injectable, PLATFORM_ID, inject, signal } from '@angular/core';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map, startWith } from 'rxjs/operators';\n\n@Injectable({ providedIn: 'root' })\nexport class ScreenSizerService {\n readonly breakpoints = {\n xs: 480,\n sm: 768,\n md: 1024,\n lg: 1280,\n xl: 1536,\n };\n\n readonly isXs = signal(false);\n readonly isSm = signal(false);\n readonly isMd = signal(false);\n readonly isLg = signal(false);\n readonly isXl = signal(false);\n\n readonly minSm = signal(false);\n readonly minMd = signal(false);\n readonly minLg = signal(false);\n readonly minXl = signal(false);\n\n get width(): number {\n if (isPlatformBrowser(this.platformId)) {\n return Math.min(window.innerWidth, window.outerWidth);\n }\n return 0;\n }\n\n constructor(@Inject(PLATFORM_ID) private readonly platformId: Object) {\n if (isPlatformBrowser(this.platformId)) {\n fromEvent(window, 'resize')\n .pipe(\n debounceTime(200),\n map(() => this.width),\n distinctUntilChanged(),\n startWith(this.width),\n )\n .subscribe((width) => this.updateFlags(width));\n }\n }\n\n private updateFlags(width: number) {\n const { xs, sm, md, lg, xl } = this.breakpoints;\n\n this.isXs.set(width < sm);\n this.isSm.set(width >= sm && width < md);\n this.isMd.set(width >= md && width < lg);\n this.isLg.set(width >= lg && width < xl);\n this.isXl.set(width >= xl);\n\n this.minSm.set(width >= sm);\n this.minMd.set(width >= md);\n this.minLg.set(width >= lg);\n this.minXl.set(width >= xl);\n }\n\n // Métodos rápidos si no usas signals directamente\n isXsInstant() {\n return this.isXs();\n }\n isSmInstant() {\n return this.isSm();\n }\n isMdInstant() {\n return this.isMd();\n }\n isLgInstant() {\n return this.isLg();\n }\n isXlInstant() {\n return this.isXl();\n }\n\n minSmInstant() {\n return this.minSm();\n }\n minMdInstant() {\n return this.minMd();\n }\n minLgInstant() {\n return this.minLg();\n }\n minXlInstant() {\n return this.minXl();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAMa,kBAAkB,CAAA;AA2BuB,IAAA,UAAA;AA1BzC,IAAA,WAAW,GAAG;AACnB,QAAA,EAAE,EAAE,GAAG;AACP,QAAA,EAAE,EAAE,GAAG;AACP,QAAA,EAAE,EAAE,IAAI;AACR,QAAA,EAAE,EAAE,IAAI;AACR,QAAA,EAAE,EAAE,IAAI;KACX;AAEQ,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;AACpB,IAAA,IAAI,GAAG,MAAM,CAAC,KAA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EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,kBA2BP,WAAW,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AA3BtB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA;;4FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BA4BjB,MAAM;2BAAC,WAAW;;;ACjCnC;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BodyComponent } from '@lluc_llull/ui-lib/interfaces';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class MapperService {
|
|
4
|
-
private platformId;
|
|
5
|
-
private cdn;
|
|
4
|
+
private readonly platformId;
|
|
5
|
+
private readonly cdn;
|
|
6
|
+
constructor(platformId: Object, cdn: string);
|
|
6
7
|
mapComponents<T>(body: any[]): BodyComponent<T>[];
|
|
7
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapperService, never>;
|
|
8
9
|
static ɵprov: i0.ɵɵInjectableDeclaration<MapperService>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lluc_llull/ui-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Angular UI component library",
|
|
5
5
|
"author": "lluc_llull",
|
|
6
6
|
"license": "MIT",
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
"types": "./feedback/index.d.ts",
|
|
62
62
|
"default": "./fesm2022/lluc_llull-ui-lib-feedback.mjs"
|
|
63
63
|
},
|
|
64
|
-
"./headers": {
|
|
65
|
-
"types": "./headers/index.d.ts",
|
|
66
|
-
"default": "./fesm2022/lluc_llull-ui-lib-headers.mjs"
|
|
67
|
-
},
|
|
68
64
|
"./footers": {
|
|
69
65
|
"types": "./footers/index.d.ts",
|
|
70
66
|
"default": "./fesm2022/lluc_llull-ui-lib-footers.mjs"
|
|
71
67
|
},
|
|
68
|
+
"./headers": {
|
|
69
|
+
"types": "./headers/index.d.ts",
|
|
70
|
+
"default": "./fesm2022/lluc_llull-ui-lib-headers.mjs"
|
|
71
|
+
},
|
|
72
72
|
"./interfaces": {
|
|
73
73
|
"types": "./interfaces/index.d.ts",
|
|
74
74
|
"default": "./fesm2022/lluc_llull-ui-lib-interfaces.mjs"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class ScreenSizerService {
|
|
3
|
+
private readonly platformId;
|
|
3
4
|
readonly breakpoints: {
|
|
4
5
|
xs: number;
|
|
5
6
|
sm: number;
|
|
@@ -16,9 +17,8 @@ export declare class ScreenSizerService {
|
|
|
16
17
|
readonly minMd: import("@angular/core").WritableSignal<boolean>;
|
|
17
18
|
readonly minLg: import("@angular/core").WritableSignal<boolean>;
|
|
18
19
|
readonly minXl: import("@angular/core").WritableSignal<boolean>;
|
|
19
|
-
private readonly platformId;
|
|
20
20
|
get width(): number;
|
|
21
|
-
constructor();
|
|
21
|
+
constructor(platformId: Object);
|
|
22
22
|
private updateFlags;
|
|
23
23
|
isXsInstant(): boolean;
|
|
24
24
|
isSmInstant(): boolean;
|