angular-three 1.9.12 → 1.9.13
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/esm2020/lib/canvas.mjs +9 -10
- package/esm2020/lib/di/before-render.mjs +2 -2
- package/esm2020/lib/di/ref.mjs +6 -10
- package/esm2020/lib/directives/args.mjs +5 -7
- package/esm2020/lib/directives/common.mjs +3 -3
- package/esm2020/lib/directives/parent.mjs +3 -3
- package/esm2020/lib/directives/repeat.mjs +3 -3
- package/esm2020/lib/pipes/push.mjs +3 -3
- package/esm2020/lib/portal.mjs +16 -17
- package/esm2020/lib/renderer/provider.mjs +3 -5
- package/esm2020/lib/renderer/renderer.mjs +6 -5
- package/esm2020/lib/renderer/store.mjs +376 -0
- package/esm2020/lib/renderer/utils.mjs +13 -24
- package/esm2020/lib/routed-scene.mjs +3 -3
- package/esm2020/lib/stores/rx-store.mjs +12 -20
- package/esm2020/lib/stores/store.mjs +8 -13
- package/fesm2015/angular-three.mjs +93 -129
- package/fesm2015/angular-three.mjs.map +1 -1
- package/fesm2020/angular-three.mjs +92 -130
- package/fesm2020/angular-three.mjs.map +1 -1
- package/lib/canvas.d.ts +2 -2
- package/lib/portal.d.ts +1 -1
- package/lib/renderer/renderer.d.ts +4 -4
- package/lib/renderer/{state.d.ts → store.d.ts} +2 -2
- package/package.json +3 -3
- package/plugin/package.json +1 -1
- package/esm2020/lib/renderer/state.mjs +0 -381
|
@@ -513,12 +513,9 @@ function tapEffect(effectFn) {
|
|
|
513
513
|
let cleanupFn = () => { };
|
|
514
514
|
let firstRun = false;
|
|
515
515
|
let prev = undefined;
|
|
516
|
-
const teardown = (error) => {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
cleanupFn({ prev, complete: true, error });
|
|
520
|
-
}
|
|
521
|
-
};
|
|
516
|
+
const teardown = (error) => () => {
|
|
517
|
+
if (cleanupFn)
|
|
518
|
+
cleanupFn({ prev, complete: true, error });
|
|
522
519
|
};
|
|
523
520
|
return tap({
|
|
524
521
|
next: (value) => {
|
|
@@ -561,13 +558,10 @@ class NgtRxStore extends RxState {
|
|
|
561
558
|
// override get to return {} if get() returns undefined
|
|
562
559
|
const originalGet = this.get.bind(this);
|
|
563
560
|
Object.defineProperty(this, 'get', {
|
|
564
|
-
get: () => {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
return originalGet(...args);
|
|
570
|
-
};
|
|
561
|
+
get: () => (...args) => {
|
|
562
|
+
if (args.length === 0)
|
|
563
|
+
return originalGet() ?? {};
|
|
564
|
+
return originalGet(...args);
|
|
571
565
|
},
|
|
572
566
|
});
|
|
573
567
|
// call initialize that might be setup by derived Stores
|
|
@@ -584,14 +578,12 @@ class NgtRxStore extends RxState {
|
|
|
584
578
|
if (keys.length) {
|
|
585
579
|
$ = combineLatest(keys.map((key) => this.select(key).pipe(startWith(this.get(key) ?? undefined))));
|
|
586
580
|
}
|
|
587
|
-
this.hold($, () =>
|
|
588
|
-
requestAnimationFrame(() => void safeDetectChanges(cdr));
|
|
589
|
-
});
|
|
581
|
+
this.hold($, () => void requestAnimationFrame(() => void safeDetectChanges(cdr)));
|
|
590
582
|
}
|
|
591
583
|
}
|
|
592
|
-
NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
593
|
-
NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
594
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
584
|
+
NgtRxStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRxStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
585
|
+
NgtRxStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRxStore });
|
|
586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRxStore, decorators: [{
|
|
595
587
|
type: Injectable
|
|
596
588
|
}], ctorParameters: function () { return []; } });
|
|
597
589
|
|
|
@@ -774,14 +766,12 @@ class NgtStore extends NgtRxStore {
|
|
|
774
766
|
const stateToUpdate = {};
|
|
775
767
|
// setup renderer
|
|
776
768
|
let gl = state.gl;
|
|
777
|
-
if (!state.gl)
|
|
769
|
+
if (!state.gl)
|
|
778
770
|
stateToUpdate.gl = gl = makeDefaultRenderer(glOptions, canvasElement);
|
|
779
|
-
}
|
|
780
771
|
// setup raycaster
|
|
781
772
|
let raycaster = state.raycaster;
|
|
782
|
-
if (!raycaster)
|
|
773
|
+
if (!raycaster)
|
|
783
774
|
stateToUpdate.raycaster = raycaster = new THREE.Raycaster();
|
|
784
|
-
}
|
|
785
775
|
// set raycaster options
|
|
786
776
|
const { params, ...options } = raycasterOptions || {};
|
|
787
777
|
if (!is.equ(options, raycaster, shallowLoose))
|
|
@@ -917,9 +907,7 @@ class NgtStore extends NgtRxStore {
|
|
|
917
907
|
this.invalidate();
|
|
918
908
|
}
|
|
919
909
|
destroy(canvas) {
|
|
920
|
-
this.set((state) => ({
|
|
921
|
-
internal: { ...state.internal, active: false },
|
|
922
|
-
}));
|
|
910
|
+
this.set((state) => ({ internal: { ...state.internal, active: false } }));
|
|
923
911
|
setTimeout(() => {
|
|
924
912
|
const { gl, xr, events } = this.get();
|
|
925
913
|
if (gl) {
|
|
@@ -966,15 +954,14 @@ class NgtStore extends NgtRxStore {
|
|
|
966
954
|
this.hold(this.select(), () => invalidate(this));
|
|
967
955
|
}
|
|
968
956
|
}
|
|
969
|
-
NgtStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
970
|
-
NgtStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
971
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
957
|
+
NgtStore.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtStore, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
958
|
+
NgtStore.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtStore });
|
|
959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtStore, decorators: [{
|
|
972
960
|
type: Injectable
|
|
973
961
|
}] });
|
|
974
962
|
function computeInitialSize(canvas, defaultSize) {
|
|
975
|
-
if (defaultSize)
|
|
963
|
+
if (defaultSize)
|
|
976
964
|
return defaultSize;
|
|
977
|
-
}
|
|
978
965
|
if (canvas instanceof HTMLCanvasElement && canvas.parentElement) {
|
|
979
966
|
return canvas.parentElement.getBoundingClientRect();
|
|
980
967
|
}
|
|
@@ -1020,9 +1007,9 @@ class NgtCommonDirective {
|
|
|
1020
1007
|
}
|
|
1021
1008
|
}
|
|
1022
1009
|
}
|
|
1023
|
-
NgtCommonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1024
|
-
NgtCommonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1010
|
+
NgtCommonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtCommonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1011
|
+
NgtCommonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtCommonDirective, ngImport: i0 });
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtCommonDirective, decorators: [{
|
|
1026
1013
|
type: Directive
|
|
1027
1014
|
}], ctorParameters: function () { return []; } });
|
|
1028
1015
|
|
|
@@ -1032,9 +1019,7 @@ class NgtArgs extends NgtCommonDirective {
|
|
|
1032
1019
|
this.injectedArgs = [];
|
|
1033
1020
|
}
|
|
1034
1021
|
set args(args) {
|
|
1035
|
-
if (args == null || !Array.isArray(args))
|
|
1036
|
-
return;
|
|
1037
|
-
if (args.length === 1 && args[0] === null)
|
|
1022
|
+
if (args == null || !Array.isArray(args) || (args.length === 1 && args[0] === null))
|
|
1038
1023
|
return;
|
|
1039
1024
|
this.injected = false;
|
|
1040
1025
|
this.injectedArgs = args;
|
|
@@ -1051,9 +1036,9 @@ class NgtArgs extends NgtCommonDirective {
|
|
|
1051
1036
|
return !this.injected && !!this.injectedArgs.length;
|
|
1052
1037
|
}
|
|
1053
1038
|
}
|
|
1054
|
-
NgtArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1055
|
-
NgtArgs.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1056
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1039
|
+
NgtArgs.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtArgs, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1040
|
+
NgtArgs.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtArgs, isStandalone: true, selector: "[args]", inputs: { args: "args" }, usesInheritance: true, ngImport: i0 });
|
|
1041
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtArgs, decorators: [{
|
|
1057
1042
|
type: Directive,
|
|
1058
1043
|
args: [{ selector: '[args]', standalone: true }]
|
|
1059
1044
|
}], propDecorators: { args: [{
|
|
@@ -1083,9 +1068,9 @@ class NgtParent extends NgtCommonDirective {
|
|
|
1083
1068
|
return !this.injected && !!this.injectedParent;
|
|
1084
1069
|
}
|
|
1085
1070
|
}
|
|
1086
|
-
NgtParent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
1087
|
-
NgtParent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
1088
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
1071
|
+
NgtParent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtParent, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
1072
|
+
NgtParent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtParent, isStandalone: true, selector: "[parent]", inputs: { parent: "parent" }, usesInheritance: true, ngImport: i0 });
|
|
1073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtParent, decorators: [{
|
|
1089
1074
|
type: Directive,
|
|
1090
1075
|
args: [{ selector: '[parent]', standalone: true }]
|
|
1091
1076
|
}], propDecorators: { parent: [{
|
|
@@ -1533,9 +1518,8 @@ function attachThreeChild(parent, child) {
|
|
|
1533
1518
|
}
|
|
1534
1519
|
pLS.add(child, added ? 'objects' : 'nonObjects');
|
|
1535
1520
|
cLS.parent = parent;
|
|
1536
|
-
if (cLS.afterAttach)
|
|
1521
|
+
if (cLS.afterAttach)
|
|
1537
1522
|
cLS.afterAttach.emit({ parent, node: child });
|
|
1538
|
-
}
|
|
1539
1523
|
invalidateInstance(child);
|
|
1540
1524
|
invalidateInstance(parent);
|
|
1541
1525
|
}
|
|
@@ -1545,12 +1529,10 @@ function removeThreeChild(parent, child, dispose) {
|
|
|
1545
1529
|
// clear parent ref
|
|
1546
1530
|
cLS.parent = null;
|
|
1547
1531
|
// remove child from parent
|
|
1548
|
-
if (pLS.objects)
|
|
1532
|
+
if (pLS.objects)
|
|
1549
1533
|
pLS.remove(child, 'objects');
|
|
1550
|
-
|
|
1551
|
-
if (pLS.nonObjects) {
|
|
1534
|
+
if (pLS.nonObjects)
|
|
1552
1535
|
pLS.remove(child, 'nonObjects');
|
|
1553
|
-
}
|
|
1554
1536
|
if (cLS.attach) {
|
|
1555
1537
|
detach(parent, child, cLS.attach);
|
|
1556
1538
|
}
|
|
@@ -1581,15 +1563,14 @@ function processThreeEvent(instance, priority, eventName, callback, cdr, targetC
|
|
|
1581
1563
|
.subscribe((state) => callback({ state, object: instance }), priority || lS.priority || 0);
|
|
1582
1564
|
}
|
|
1583
1565
|
if (eventName === SPECIAL_EVENTS.AFTER_UPDATE || eventName === SPECIAL_EVENTS.AFTER_ATTACH) {
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
const sub =
|
|
1566
|
+
let emitter = lS[eventName];
|
|
1567
|
+
if (!emitter)
|
|
1568
|
+
emitter = new EventEmitter();
|
|
1569
|
+
const sub = emitter.subscribe(callback);
|
|
1588
1570
|
return sub.unsubscribe.bind(sub);
|
|
1589
1571
|
}
|
|
1590
|
-
if (!lS.handlers)
|
|
1572
|
+
if (!lS.handlers)
|
|
1591
1573
|
lS.handlers = {};
|
|
1592
|
-
}
|
|
1593
1574
|
// try to get the previous handler. compound might have one, the THREE object might also have one with the same name
|
|
1594
1575
|
const previousHandler = lS.handlers[eventName];
|
|
1595
1576
|
// readjust the callback
|
|
@@ -1598,23 +1579,18 @@ function processThreeEvent(instance, priority, eventName, callback, cdr, targetC
|
|
|
1598
1579
|
previousHandler(event);
|
|
1599
1580
|
callback(event);
|
|
1600
1581
|
};
|
|
1601
|
-
lS.handlers
|
|
1602
|
-
...lS.handlers,
|
|
1603
|
-
[eventName]: eventToHandler(updatedCallback, cdr, targetCdr),
|
|
1604
|
-
};
|
|
1582
|
+
Object.assign(lS.handlers, { [eventName]: eventToHandler(updatedCallback, cdr, targetCdr) });
|
|
1605
1583
|
// increment the count everytime
|
|
1606
1584
|
lS.eventCount += 1;
|
|
1607
1585
|
// but only add the instance (target) to the interaction array (so that it is handled by the EventManager with Raycast)
|
|
1608
1586
|
// the first time eventCount is incremented
|
|
1609
|
-
if (lS.eventCount === 1 && instance['raycast'])
|
|
1587
|
+
if (lS.eventCount === 1 && instance['raycast'])
|
|
1610
1588
|
lS.store.get('addInteraction')(instance);
|
|
1611
|
-
}
|
|
1612
1589
|
// clean up the event listener by removing the target from the interaction array
|
|
1613
1590
|
return () => {
|
|
1614
1591
|
const localState = getLocalState(instance);
|
|
1615
|
-
if (localState && localState.eventCount)
|
|
1592
|
+
if (localState && localState.eventCount)
|
|
1616
1593
|
localState.store.get('removeInteraction')(instance['uuid']);
|
|
1617
|
-
}
|
|
1618
1594
|
};
|
|
1619
1595
|
}
|
|
1620
1596
|
function eventToHandler(callback, cdr, targetCdr) {
|
|
@@ -1628,9 +1604,7 @@ function kebabToPascal(str) {
|
|
|
1628
1604
|
// split the string at each hyphen
|
|
1629
1605
|
const parts = str.split('-');
|
|
1630
1606
|
// map over the parts, capitalizing the first letter of each part
|
|
1631
|
-
const pascalParts = parts.map((part) =>
|
|
1632
|
-
return part.charAt(0).toUpperCase() + part.slice(1);
|
|
1633
|
-
});
|
|
1607
|
+
const pascalParts = parts.map((part) => part.charAt(0).toUpperCase() + part.slice(1));
|
|
1634
1608
|
// join the parts together to create the final PascalCase string
|
|
1635
1609
|
return pascalParts.join('');
|
|
1636
1610
|
}
|
|
@@ -1660,9 +1634,8 @@ class NgtRendererStore {
|
|
|
1660
1634
|
];
|
|
1661
1635
|
const rendererNode = Object.assign(node, { __ngt_renderer__: state });
|
|
1662
1636
|
// assign ownerDocument to node so we can use HostListener in Component
|
|
1663
|
-
if (!rendererNode['ownerDocument'])
|
|
1637
|
+
if (!rendererNode['ownerDocument'])
|
|
1664
1638
|
rendererNode['ownerDocument'] = this.root.document;
|
|
1665
|
-
}
|
|
1666
1639
|
// assign injectorFactory on non-three type since
|
|
1667
1640
|
// rendererNode is an instance of DOM Node
|
|
1668
1641
|
if (state[0 /* NgtRendererClassId.type */] !== 'three') {
|
|
@@ -1672,9 +1645,9 @@ class NgtRendererStore {
|
|
|
1672
1645
|
// we attach an arrow function to the Comment node
|
|
1673
1646
|
// In our directives, we can call this function to then start tracking the RendererNode
|
|
1674
1647
|
// this is done to limit the amount of Nodes we need to process for getCreationState
|
|
1675
|
-
rendererNode['__ngt_renderer_add_comment__'] = (
|
|
1676
|
-
if (
|
|
1677
|
-
this.portals.push(
|
|
1648
|
+
rendererNode['__ngt_renderer_add_comment__'] = (node) => {
|
|
1649
|
+
if (node && node.__ngt_renderer__[0 /* NgtRendererClassId.type */] === 'portal') {
|
|
1650
|
+
this.portals.push(node);
|
|
1678
1651
|
}
|
|
1679
1652
|
else {
|
|
1680
1653
|
this.comments.push(rendererNode);
|
|
@@ -1711,15 +1684,11 @@ class NgtRendererStore {
|
|
|
1711
1684
|
rS[7 /* NgtRendererClassId.compounded */] = instance;
|
|
1712
1685
|
const attributes = Object.keys(rS[9 /* NgtRendererClassId.attributes */]);
|
|
1713
1686
|
const properties = Object.keys(rS[10 /* NgtRendererClassId.properties */]);
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
this.applyAttribute(instance, key, rS[9 /* NgtRendererClassId.attributes */][key]);
|
|
1717
|
-
}
|
|
1687
|
+
for (const key of attributes) {
|
|
1688
|
+
this.applyAttribute(instance, key, rS[9 /* NgtRendererClassId.attributes */][key]);
|
|
1718
1689
|
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
this.applyProperty(instance, key, rS[10 /* NgtRendererClassId.properties */][key]);
|
|
1722
|
-
}
|
|
1690
|
+
for (const key of properties) {
|
|
1691
|
+
this.applyProperty(instance, key, rS[10 /* NgtRendererClassId.properties */][key]);
|
|
1723
1692
|
}
|
|
1724
1693
|
this.executeOperation(compound);
|
|
1725
1694
|
}
|
|
@@ -2014,6 +1983,7 @@ class NgtRendererFactory {
|
|
|
2014
1983
|
this.catalogue = inject(NGT_CATALOGUE);
|
|
2015
1984
|
this.rendererMap = new Map();
|
|
2016
1985
|
this.routedSet = new Set();
|
|
1986
|
+
// all Renderer instances share the same Store
|
|
2017
1987
|
this.rendererStore = new NgtRendererStore({
|
|
2018
1988
|
store: inject(NgtStore),
|
|
2019
1989
|
cdr: inject(ChangeDetectorRef),
|
|
@@ -2039,9 +2009,9 @@ class NgtRendererFactory {
|
|
|
2039
2009
|
return renderer;
|
|
2040
2010
|
}
|
|
2041
2011
|
}
|
|
2042
|
-
NgtRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2043
|
-
NgtRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.
|
|
2044
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2012
|
+
NgtRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRendererFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2013
|
+
NgtRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRendererFactory });
|
|
2014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRendererFactory, decorators: [{
|
|
2045
2015
|
type: Injectable
|
|
2046
2016
|
}] });
|
|
2047
2017
|
/**
|
|
@@ -2352,12 +2322,10 @@ class NgtRenderer {
|
|
|
2352
2322
|
}
|
|
2353
2323
|
|
|
2354
2324
|
function provideNgtRenderer({ store, changeDetectorRef, compoundPrefixes = [] }) {
|
|
2355
|
-
if (!compoundPrefixes.includes('ngts'))
|
|
2325
|
+
if (!compoundPrefixes.includes('ngts'))
|
|
2356
2326
|
compoundPrefixes.push('ngts');
|
|
2357
|
-
|
|
2358
|
-
if (!compoundPrefixes.includes('ngtp')) {
|
|
2327
|
+
if (!compoundPrefixes.includes('ngtp'))
|
|
2359
2328
|
compoundPrefixes.push('ngtp');
|
|
2360
|
-
}
|
|
2361
2329
|
return makeEnvironmentProviders([
|
|
2362
2330
|
{ provide: RendererFactory2, useClass: NgtRendererFactory },
|
|
2363
2331
|
{ provide: NgtStore, useValue: store },
|
|
@@ -2440,7 +2408,7 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2440
2408
|
this.envInjector = inject(EnvironmentInjector);
|
|
2441
2409
|
this.host = inject(ElementRef);
|
|
2442
2410
|
this.store = inject(NgtStore);
|
|
2443
|
-
this.
|
|
2411
|
+
this.hbClass = true;
|
|
2444
2412
|
this.sceneGraphInputs = {};
|
|
2445
2413
|
this.compoundPrefixes = [];
|
|
2446
2414
|
this.created = new EventEmitter();
|
|
@@ -2459,7 +2427,7 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2459
2427
|
events: createPointerEvents,
|
|
2460
2428
|
});
|
|
2461
2429
|
}
|
|
2462
|
-
get
|
|
2430
|
+
get hbPointerEvents() {
|
|
2463
2431
|
return this.get('eventSource') !== this.host.nativeElement ? 'none' : 'auto';
|
|
2464
2432
|
}
|
|
2465
2433
|
set linear(linear) {
|
|
@@ -2558,9 +2526,8 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2558
2526
|
});
|
|
2559
2527
|
}
|
|
2560
2528
|
// emit created event if observed
|
|
2561
|
-
if (this.created.observed)
|
|
2529
|
+
if (this.created.observed)
|
|
2562
2530
|
this.created.emit(this.store.get());
|
|
2563
|
-
}
|
|
2564
2531
|
// render
|
|
2565
2532
|
if (this.glRef)
|
|
2566
2533
|
this.glRef.destroy();
|
|
@@ -2600,23 +2567,23 @@ class NgtCanvas extends NgtRxStore {
|
|
|
2600
2567
|
safeDetectChanges(this.cdr);
|
|
2601
2568
|
}
|
|
2602
2569
|
}
|
|
2603
|
-
NgtCanvas.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2604
|
-
NgtCanvas.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
2570
|
+
NgtCanvas.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtCanvas, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2571
|
+
NgtCanvas.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtCanvas, isStandalone: true, selector: "ngt-canvas", inputs: { sceneGraph: "sceneGraph", sceneGraphInputs: "sceneGraphInputs", compoundPrefixes: "compoundPrefixes", linear: "linear", legacy: "legacy", flat: "flat", orthographic: "orthographic", frameloop: "frameloop", dpr: "dpr", raycaster: "raycaster", shadows: "shadows", camera: "camera", gl: "gl", eventSource: "eventSource", eventPrefix: "eventPrefix", lookAt: "lookAt", performance: "performance" }, outputs: { created: "created", pointerMissed: "pointerMissed" }, host: { properties: { "class.ngt-canvas": "this.hbClass", "style.pointerEvents": "this.hbPointerEvents" } }, providers: [NgtStore, provideNgxResizeOptions({ emitInZone: false })], viewQueries: [{ propertyName: "glCanvas", first: true, predicate: ["glCanvas"], descendants: true, static: true }, { propertyName: "glAnchor", first: true, predicate: ["glCanvas"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
2605
2572
|
<div (ngxResize)="onResize($event)" style="height: 100%; width: 100%;">
|
|
2606
2573
|
<canvas #glCanvas style="display: block;"></canvas>
|
|
2607
2574
|
</div>
|
|
2608
2575
|
`, isInline: true, styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgxResize, selector: "[ngxResize]", inputs: ["ngxResizeOptions"], outputs: ["ngxResize"] }] });
|
|
2609
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtCanvas, decorators: [{
|
|
2610
2577
|
type: Component,
|
|
2611
2578
|
args: [{ selector: 'ngt-canvas', standalone: true, template: `
|
|
2612
2579
|
<div (ngxResize)="onResize($event)" style="height: 100%; width: 100%;">
|
|
2613
2580
|
<canvas #glCanvas style="display: block;"></canvas>
|
|
2614
2581
|
</div>
|
|
2615
2582
|
`, imports: [NgxResize], providers: [NgtStore, provideNgxResizeOptions({ emitInZone: false })], styles: [":host{display:block;position:relative;width:100%;height:100%;overflow:hidden}\n"] }]
|
|
2616
|
-
}], propDecorators: {
|
|
2583
|
+
}], propDecorators: { hbClass: [{
|
|
2617
2584
|
type: HostBinding,
|
|
2618
2585
|
args: ['class.ngt-canvas']
|
|
2619
|
-
}],
|
|
2586
|
+
}], hbPointerEvents: [{
|
|
2620
2587
|
type: HostBinding,
|
|
2621
2588
|
args: ['style.pointerEvents']
|
|
2622
2589
|
}], sceneGraph: [{
|
|
@@ -2689,7 +2656,7 @@ function injectNgtDestroy(cb) {
|
|
|
2689
2656
|
function injectBeforeRender(cb, priority = 0) {
|
|
2690
2657
|
try {
|
|
2691
2658
|
const store = inject(NgtStore);
|
|
2692
|
-
const sub = store.get('internal').subscribe(
|
|
2659
|
+
const sub = store.get('internal').subscribe(cb, priority, store);
|
|
2693
2660
|
injectNgtDestroy(() => void sub());
|
|
2694
2661
|
return sub;
|
|
2695
2662
|
}
|
|
@@ -2703,17 +2670,13 @@ function injectNgtRef(initialValue = null) {
|
|
|
2703
2670
|
let lastValue = ref.nativeElement;
|
|
2704
2671
|
const cdRefs = [];
|
|
2705
2672
|
const ref$ = new BehaviorSubject(lastValue);
|
|
2706
|
-
const { destroy$, cdr } = injectNgtDestroy(() =>
|
|
2707
|
-
ref$.complete();
|
|
2708
|
-
});
|
|
2673
|
+
const { destroy$, cdr } = injectNgtDestroy(() => void ref$.complete());
|
|
2709
2674
|
cdRefs.push(cdr);
|
|
2710
2675
|
const obs$ = ref$.asObservable().pipe(distinctUntilChanged(), takeUntil(destroy$));
|
|
2711
|
-
const subscribe = (callback) => {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
});
|
|
2716
|
-
};
|
|
2676
|
+
const subscribe = (callback) => obs$.subscribe((current) => {
|
|
2677
|
+
callback(current, lastValue);
|
|
2678
|
+
lastValue = current;
|
|
2679
|
+
});
|
|
2717
2680
|
const useCDR = (cdr) => void cdRefs.push(cdr);
|
|
2718
2681
|
const $ = obs$.pipe(filter((value, index) => index > 0 || value != null), takeUntil(destroy$));
|
|
2719
2682
|
const children$ = (type = 'objects') => $.pipe(switchMap((instance) => {
|
|
@@ -2805,9 +2768,9 @@ class NgtRepeat extends NgForOf {
|
|
|
2805
2768
|
this.ngForOf = Number.isInteger(count) ? Array.from({ length: count }, (_, i) => i) : [];
|
|
2806
2769
|
}
|
|
2807
2770
|
}
|
|
2808
|
-
NgtRepeat.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2809
|
-
NgtRepeat.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
2810
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2771
|
+
NgtRepeat.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRepeat, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
2772
|
+
NgtRepeat.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtRepeat, isStandalone: true, selector: "[ngFor][ngForRepeat]", inputs: { ngForRepeat: "ngForRepeat" }, usesInheritance: true, ngImport: i0 });
|
|
2773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRepeat, decorators: [{
|
|
2811
2774
|
type: Directive,
|
|
2812
2775
|
args: [{ selector: '[ngFor][ngForRepeat]', standalone: true }]
|
|
2813
2776
|
}], propDecorators: { ngForRepeat: [{
|
|
@@ -2852,9 +2815,9 @@ class NgtPush {
|
|
|
2852
2815
|
this.obj = undefined;
|
|
2853
2816
|
}
|
|
2854
2817
|
}
|
|
2855
|
-
NgtPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2856
|
-
NgtPush.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.
|
|
2857
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2818
|
+
NgtPush.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPush, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2819
|
+
NgtPush.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: NgtPush, isStandalone: true, name: "ngtPush", pure: false });
|
|
2820
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPush, decorators: [{
|
|
2858
2821
|
type: Pipe,
|
|
2859
2822
|
args: [{ name: 'ngtPush', pure: false, standalone: true }]
|
|
2860
2823
|
}] });
|
|
@@ -2903,14 +2866,11 @@ class NgtPortalBeforeRender {
|
|
|
2903
2866
|
this.subscription?.();
|
|
2904
2867
|
}
|
|
2905
2868
|
}
|
|
2906
|
-
NgtPortalBeforeRender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2907
|
-
NgtPortalBeforeRender.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
2908
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2869
|
+
NgtPortalBeforeRender.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortalBeforeRender, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2870
|
+
NgtPortalBeforeRender.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtPortalBeforeRender, isStandalone: true, selector: "[ngtPortalBeforeRender]", inputs: { renderPriority: "renderPriority", parentScene: "parentScene", parentCamera: "parentCamera" }, outputs: { beforeRender: "beforeRender" }, ngImport: i0 });
|
|
2871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortalBeforeRender, decorators: [{
|
|
2909
2872
|
type: Directive,
|
|
2910
|
-
args: [{
|
|
2911
|
-
selector: 'ngt-portal-before-render',
|
|
2912
|
-
standalone: true,
|
|
2913
|
-
}]
|
|
2873
|
+
args: [{ selector: '[ngtPortalBeforeRender]', standalone: true }]
|
|
2914
2874
|
}], propDecorators: { renderPriority: [{
|
|
2915
2875
|
type: Input
|
|
2916
2876
|
}], parentScene: [{
|
|
@@ -2929,9 +2889,9 @@ class NgtPortalContent {
|
|
|
2929
2889
|
}
|
|
2930
2890
|
}
|
|
2931
2891
|
}
|
|
2932
|
-
NgtPortalContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
2933
|
-
NgtPortalContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.
|
|
2934
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
2892
|
+
NgtPortalContent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortalContent, deps: [{ token: i0.ViewContainerRef }, { token: i0.ViewContainerRef, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2893
|
+
NgtPortalContent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: NgtPortalContent, isStandalone: true, selector: "ng-template[ngtPortalContent]", ngImport: i0 });
|
|
2894
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortalContent, decorators: [{
|
|
2935
2895
|
type: Directive,
|
|
2936
2896
|
args: [{ selector: 'ng-template[ngtPortalContent]', standalone: true }]
|
|
2937
2897
|
}], ctorParameters: function () { return [{ type: i0.ViewContainerRef }, { type: i0.ViewContainerRef, decorators: [{
|
|
@@ -3038,27 +2998,29 @@ class NgtPortal extends NgtRxStore {
|
|
|
3038
2998
|
};
|
|
3039
2999
|
}
|
|
3040
3000
|
}
|
|
3041
|
-
NgtPortal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
3042
|
-
NgtPortal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
3001
|
+
NgtPortal.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortal, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
3002
|
+
NgtPortal.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtPortal, isStandalone: true, selector: "ngt-portal", inputs: { container: "container", state: "state", autoRender: "autoRender", autoRenderPriority: "autoRenderPriority" }, outputs: { beforeRender: "beforeRender" }, providers: [NgtStore], queries: [{ propertyName: "portalContentTemplate", first: true, predicate: NgtPortalContent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "portalContentAnchor", first: true, predicate: ["portalContentAnchor"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
3043
3003
|
<ng-container #portalContentAnchor>
|
|
3044
|
-
<
|
|
3004
|
+
<ng-container
|
|
3045
3005
|
*ngIf="autoRender && portalContentRendered"
|
|
3006
|
+
ngtPortalBeforeRender
|
|
3046
3007
|
[renderPriority]="autoRenderPriority"
|
|
3047
3008
|
[parentScene]="parentScene"
|
|
3048
3009
|
[parentCamera]="parentCamera"
|
|
3049
3010
|
(beforeRender)="onBeforeRender($event)"
|
|
3050
3011
|
/>
|
|
3051
3012
|
</ng-container>
|
|
3052
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgtPortalBeforeRender, selector: "
|
|
3053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
3013
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgtPortalBeforeRender, selector: "[ngtPortalBeforeRender]", inputs: ["renderPriority", "parentScene", "parentCamera"], outputs: ["beforeRender"] }] });
|
|
3014
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtPortal, decorators: [{
|
|
3054
3015
|
type: Component,
|
|
3055
3016
|
args: [{
|
|
3056
3017
|
selector: 'ngt-portal',
|
|
3057
3018
|
standalone: true,
|
|
3058
3019
|
template: `
|
|
3059
3020
|
<ng-container #portalContentAnchor>
|
|
3060
|
-
<
|
|
3021
|
+
<ng-container
|
|
3061
3022
|
*ngIf="autoRender && portalContentRendered"
|
|
3023
|
+
ngtPortalBeforeRender
|
|
3062
3024
|
[renderPriority]="autoRenderPriority"
|
|
3063
3025
|
[parentScene]="parentScene"
|
|
3064
3026
|
[parentCamera]="parentCamera"
|
|
@@ -3096,9 +3058,9 @@ class NgtRoutedScene {
|
|
|
3096
3058
|
}
|
|
3097
3059
|
}
|
|
3098
3060
|
NgtRoutedScene.isRoutedScene = true;
|
|
3099
|
-
NgtRoutedScene.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.
|
|
3100
|
-
NgtRoutedScene.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.
|
|
3101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.
|
|
3061
|
+
NgtRoutedScene.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRoutedScene, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
3062
|
+
NgtRoutedScene.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: NgtRoutedScene, isStandalone: true, selector: "ngt-routed-scene", ngImport: i0, template: `<router-outlet />`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
|
|
3063
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: NgtRoutedScene, decorators: [{
|
|
3102
3064
|
type: Component,
|
|
3103
3065
|
args: [{
|
|
3104
3066
|
standalone: true,
|