angular-three 2.0.0-beta.3 → 2.0.0-beta.31
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/README.md +4 -147
- package/esm2022/angular-three.mjs +1 -1
- package/esm2022/index.mjs +10 -11
- package/esm2022/lib/before-render.mjs +13 -0
- package/esm2022/lib/canvas.mjs +137 -162
- package/esm2022/lib/directives/args.mjs +13 -11
- package/esm2022/lib/directives/common.mjs +29 -27
- package/esm2022/lib/directives/key.mjs +29 -0
- package/esm2022/lib/directives/parent.mjs +13 -11
- package/esm2022/lib/dom/events.mjs +6 -1
- package/esm2022/lib/events.mjs +75 -58
- package/esm2022/lib/instance.mjs +65 -0
- package/esm2022/lib/loader.mjs +31 -38
- package/esm2022/lib/loop.mjs +6 -3
- package/esm2022/lib/portal.mjs +91 -102
- package/esm2022/lib/ref.mjs +48 -0
- package/esm2022/lib/renderer/catalogue.mjs +7 -0
- package/esm2022/lib/renderer/constants.mjs +21 -0
- package/esm2022/lib/renderer/index.mjs +419 -0
- package/esm2022/lib/renderer/store.mjs +144 -108
- package/esm2022/lib/renderer/utils.mjs +63 -48
- package/esm2022/lib/roots.mjs +249 -0
- package/esm2022/lib/routed-scene.mjs +11 -8
- package/esm2022/lib/store.mjs +207 -0
- package/esm2022/lib/three-types.mjs +2 -2
- package/esm2022/lib/types.mjs +1 -1
- package/esm2022/lib/utils/apply-props.mjs +23 -11
- package/esm2022/lib/utils/attach.mjs +2 -2
- package/esm2022/lib/utils/is.mjs +1 -1
- package/esm2022/lib/utils/make.mjs +1 -1
- package/esm2022/lib/utils/safe-detect-changes.mjs +15 -13
- package/esm2022/lib/utils/signal-store.mjs +96 -0
- package/esm2022/lib/utils/update.mjs +1 -1
- package/fesm2022/angular-three.mjs +1991 -1870
- package/fesm2022/angular-three.mjs.map +1 -1
- package/index.d.ts +9 -10
- package/lib/{di/before-render.d.ts → before-render.d.ts} +1 -1
- package/lib/canvas.d.ts +82 -12
- package/lib/directives/args.d.ts +2 -2
- package/lib/directives/common.d.ts +5 -1
- package/lib/directives/key.d.ts +10 -0
- package/lib/directives/parent.d.ts +5 -5
- package/lib/dom/events.d.ts +3 -2
- package/lib/events.d.ts +78 -2
- package/lib/instance.d.ts +36 -0
- package/lib/loader.d.ts +13 -2
- package/lib/loop.d.ts +64 -6
- package/lib/portal.d.ts +20 -12
- package/lib/{di/ref.d.ts → ref.d.ts} +3 -2
- package/lib/renderer/catalogue.d.ts +9 -0
- package/lib/renderer/constants.d.ts +20 -0
- package/lib/renderer/index.d.ts +5 -0
- package/lib/renderer/store.d.ts +19 -15
- package/lib/renderer/utils.d.ts +28 -18
- package/lib/roots.d.ts +11 -0
- package/lib/routed-scene.d.ts +1 -1
- package/lib/store.d.ts +143 -0
- package/lib/three-types.d.ts +5 -5
- package/lib/types.d.ts +1 -309
- package/lib/utils/apply-props.d.ts +4 -2
- package/lib/utils/attach.d.ts +5 -3
- package/lib/utils/is.d.ts +5 -4
- package/lib/utils/make.d.ts +12 -1
- package/lib/utils/safe-detect-changes.d.ts +2 -2
- package/lib/utils/signal-store.d.ts +17 -0
- package/lib/utils/update.d.ts +1 -1
- package/metadata.json +1 -1
- package/package.json +22 -5
- package/plugin/generators.json +47 -17
- package/plugin/migrations.json +16 -0
- package/plugin/package.json +20 -4
- package/plugin/src/generators/init/compat.d.ts +3 -1
- package/plugin/src/generators/init/compat.js +2 -2
- package/plugin/src/generators/init/compat.js.map +1 -1
- package/plugin/src/generators/init/files/experience/experience.component.html__tmpl__ +4 -0
- package/plugin/src/generators/init/files/experience/experience.component.ts__tmpl__ +18 -0
- package/plugin/src/generators/init/generator.d.ts +6 -0
- package/plugin/src/generators/init/generator.js +160 -0
- package/plugin/src/generators/init/generator.js.map +1 -0
- package/plugin/src/generators/init/schema.json +15 -4
- package/plugin/src/generators/init-cannon/compat.d.ts +2 -0
- package/plugin/src/generators/init-cannon/compat.js +6 -0
- package/plugin/src/generators/init-cannon/compat.js.map +1 -0
- package/plugin/src/generators/init-cannon/generator.d.ts +2 -0
- package/plugin/src/generators/init-cannon/generator.js +23 -0
- package/plugin/src/generators/init-cannon/generator.js.map +1 -0
- package/plugin/src/generators/init-cannon/schema.json +6 -0
- package/plugin/src/generators/init-postprocessing/compat.d.ts +2 -0
- package/plugin/src/generators/init-postprocessing/compat.js +6 -0
- package/plugin/src/generators/init-postprocessing/compat.js.map +1 -0
- package/plugin/src/generators/init-postprocessing/generator.d.ts +2 -0
- package/plugin/src/generators/init-postprocessing/generator.js +21 -0
- package/plugin/src/generators/init-postprocessing/generator.js.map +1 -0
- package/plugin/src/generators/init-postprocessing/schema.json +6 -0
- package/plugin/src/generators/init-soba/compat.d.ts +2 -0
- package/plugin/src/generators/init-soba/compat.js +6 -0
- package/plugin/src/generators/init-soba/compat.js.map +1 -0
- package/plugin/src/generators/init-soba/generator.d.ts +2 -0
- package/plugin/src/generators/init-soba/generator.js +27 -0
- package/plugin/src/generators/init-soba/generator.js.map +1 -0
- package/plugin/src/generators/init-soba/schema.json +6 -0
- package/plugin/src/generators/utils.d.ts +2 -0
- package/plugin/src/generators/utils.js +34 -0
- package/plugin/src/generators/utils.js.map +1 -0
- package/plugin/src/generators/versions.d.ts +13 -0
- package/plugin/src/generators/versions.js +17 -0
- package/plugin/src/generators/versions.js.map +1 -0
- package/plugin/src/index.d.ts +3 -1
- package/plugin/src/index.js +7 -3
- package/plugin/src/index.js.map +1 -1
- package/plugin/src/migrations/migrate-to-ngxtension/compat.d.ts +2 -0
- package/plugin/src/migrations/migrate-to-ngxtension/compat.js +6 -0
- package/plugin/src/migrations/migrate-to-ngxtension/compat.js.map +1 -0
- package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.d.ts +2 -0
- package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.js +41 -0
- package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.js.map +1 -0
- package/web-types.json +1 -1
- package/esm2022/lib/di/before-render.mjs +0 -13
- package/esm2022/lib/di/catalogue.mjs +0 -7
- package/esm2022/lib/di/ref.mjs +0 -49
- package/esm2022/lib/directives/repeat.mjs +0 -18
- package/esm2022/lib/renderer/di.mjs +0 -3
- package/esm2022/lib/renderer/enums.mjs +0 -2
- package/esm2022/lib/renderer/provider.mjs +0 -18
- package/esm2022/lib/renderer/renderer.mjs +0 -365
- package/esm2022/lib/stores/signal.store.mjs +0 -81
- package/esm2022/lib/stores/store.mjs +0 -423
- package/esm2022/lib/utils/assert-in-injection-context.mjs +0 -14
- package/esm2022/lib/utils/instance.mjs +0 -63
- package/esm2022/lib/utils/signal.mjs +0 -24
- package/esm2022/lib/utils/timing.mjs +0 -21
- package/lib/di/catalogue.d.ts +0 -3
- package/lib/directives/repeat.d.ts +0 -7
- package/lib/renderer/di.d.ts +0 -2
- package/lib/renderer/enums.d.ts +0 -26
- package/lib/renderer/provider.d.ts +0 -8
- package/lib/renderer/renderer.d.ts +0 -49
- package/lib/stores/signal.store.d.ts +0 -20
- package/lib/stores/store.d.ts +0 -13
- package/lib/utils/assert-in-injection-context.d.ts +0 -2
- package/lib/utils/instance.d.ts +0 -4
- package/lib/utils/signal.d.ts +0 -2
- package/lib/utils/timing.d.ts +0 -4
- package/plugin/src/generators/init/init.d.ts +0 -5
- package/plugin/src/generators/init/init.js +0 -56
- package/plugin/src/generators/init/init.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "angular-three",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.31",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -23,19 +23,36 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@angular/common": "^16.0.0",
|
|
25
25
|
"@angular/core": "^16.0.0",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
26
|
+
"ngxtension": "^0.1.0",
|
|
27
|
+
"three": ">=0.148.0",
|
|
28
|
+
"@angular/router": "16.2.3",
|
|
29
|
+
"rxjs": "7.8.1"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"ngx-resize": "^2.0.0",
|
|
32
32
|
"tslib": "^2.3.0",
|
|
33
33
|
"@nx/devkit": "^16.0.0",
|
|
34
|
+
"@phenomnomnominal/tsquery": "^6.0.0",
|
|
34
35
|
"nx": "^16.0.0"
|
|
35
36
|
},
|
|
36
37
|
"sideEffects": false,
|
|
37
38
|
"generators": "./plugin/generators.json",
|
|
38
39
|
"schematics": "./plugin/generators.json",
|
|
40
|
+
"nx-migrations": {
|
|
41
|
+
"migrations": "./plugin/migrations.json",
|
|
42
|
+
"packageGroup": {
|
|
43
|
+
"angular-three-soba": "*",
|
|
44
|
+
"angular-three-postprocessing": "*",
|
|
45
|
+
"angular-three-cannon": "*"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"ng-update": {
|
|
49
|
+
"migrations": "./plugin/migrations.json",
|
|
50
|
+
"packageGroup": {
|
|
51
|
+
"angular-three-soba": "*",
|
|
52
|
+
"angular-three-postprocessing": "*",
|
|
53
|
+
"angular-three-cannon": "*"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
39
56
|
"web-types": "./web-types.json",
|
|
40
57
|
"module": "fesm2022/angular-three.mjs",
|
|
41
58
|
"typings": "index.d.ts",
|
package/plugin/generators.json
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"name": "angular-three-plugin",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"generators": {
|
|
6
|
+
"init": {
|
|
7
|
+
"factory": "./src/generators/init/generator",
|
|
8
|
+
"schema": "./src/generators/init/schema.json",
|
|
9
|
+
"description": "Init Angular Three with proper packages and config"
|
|
10
|
+
},
|
|
11
|
+
"soba": {
|
|
12
|
+
"factory": "./src/generators/init-soba/generator",
|
|
13
|
+
"schema": "./src/generators/init-soba/schema.json",
|
|
14
|
+
"description": "Init Angular Three Soba with proper packages "
|
|
15
|
+
},
|
|
16
|
+
"postprocessing": {
|
|
17
|
+
"factory": "./src/generators/init-postprocessing/generator",
|
|
18
|
+
"schema": "./src/generators/init-postprocessing/schema.json",
|
|
19
|
+
"description": "Init Angular Three Postprocessing with proper packages "
|
|
20
|
+
},
|
|
21
|
+
"cannon": {
|
|
22
|
+
"factory": "./src/generators/init-cannon/generator",
|
|
23
|
+
"schema": "./src/generators/init-cannon/schema.json",
|
|
24
|
+
"description": "Init Angular Three cannon with proper packages "
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"schematics": {
|
|
28
|
+
"ng-add": {
|
|
29
|
+
"factory": "./src/generators/init/compat",
|
|
30
|
+
"schema": "./src/generators/init/schema.json",
|
|
31
|
+
"description": "Add Angular Three with proper packages and config"
|
|
32
|
+
},
|
|
33
|
+
"soba": {
|
|
34
|
+
"factory": "./src/generators/init-soba/compat",
|
|
35
|
+
"schema": "./src/generators/init-soba/schema.json",
|
|
36
|
+
"description": "Init Angular Three Soba with proper packages "
|
|
37
|
+
},
|
|
38
|
+
"postprocessing": {
|
|
39
|
+
"factory": "./src/generators/init-postprocessing/compat",
|
|
40
|
+
"schema": "./src/generators/init-postprocessing/schema.json",
|
|
41
|
+
"description": "Init Angular Three Postprocessing with proper packages "
|
|
42
|
+
},
|
|
43
|
+
"cannon": {
|
|
44
|
+
"factory": "./src/generators/init-cannon/compat",
|
|
45
|
+
"schema": "./src/generators/init-cannon/schema.json",
|
|
46
|
+
"description": "Init Angular Three cannon with proper packages "
|
|
47
|
+
}
|
|
48
|
+
}
|
|
19
49
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"migrate-to-ngxtension": {
|
|
4
|
+
"version": "2.0.0-beta.30",
|
|
5
|
+
"description": "Migrate some APIs to ngxtension",
|
|
6
|
+
"implementation": "./src/migrations/migrate-to-ngxtension/migrate-to-ngxtension"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"schematics": {
|
|
10
|
+
"migrate-to-ngxtension": {
|
|
11
|
+
"version": "2.0.0-beta.30",
|
|
12
|
+
"description": "Migrate some APIs to ngxtension",
|
|
13
|
+
"implementation": "./src/migrations/migrate-to-ngxtension/compat"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/plugin/package.json
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "commonjs",
|
|
3
|
-
"
|
|
4
|
-
|
|
3
|
+
"generators": "./generators.json",
|
|
4
|
+
"nx-migrations": {
|
|
5
|
+
"migrations": "./migrations.json",
|
|
6
|
+
"packageGroup": {
|
|
7
|
+
"angular-three-soba": "*",
|
|
8
|
+
"angular-three-postprocessing": "*",
|
|
9
|
+
"angular-three-cannon": "*"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"ng-update": {
|
|
13
|
+
"migrations": "./migrations.json",
|
|
14
|
+
"packageGroup": {
|
|
15
|
+
"angular-three-soba": "*",
|
|
16
|
+
"angular-three-postprocessing": "*",
|
|
17
|
+
"angular-three-cannon": "*"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@nx/devkit": "16.8.1"
|
|
5
22
|
},
|
|
6
23
|
"main": "./src/index.js",
|
|
7
|
-
"
|
|
8
|
-
"version": "2.0.0-beta.3"
|
|
24
|
+
"version": "2.0.0-beta.31"
|
|
9
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const devkit_1 = require("@nx/devkit");
|
|
4
|
-
const
|
|
5
|
-
exports.default = (0, devkit_1.convertNxGenerator)(
|
|
4
|
+
const generator_1 = require("./generator");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
6
|
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,2CAA+B;AAE/B,kBAAe,IAAA,2BAAkB,EAAC,mBAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';
|
|
2
|
+
import { extend, type NgtBeforeRenderEvent } from 'angular-three';
|
|
3
|
+
import { Mesh, BoxGeometry, MeshBasicMaterial } from 'three';
|
|
4
|
+
|
|
5
|
+
extend({ Mesh, BoxGeometry, MeshBasicMaterial });
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
standalone: true,
|
|
9
|
+
templateUrl: './experience.component.html',
|
|
10
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
|
11
|
+
})
|
|
12
|
+
export class Experience {
|
|
13
|
+
onBeforeRender({ object, state: { delta }}: NgtBeforeRenderEvent<Mesh>) {
|
|
14
|
+
object.rotation.x += delta;
|
|
15
|
+
object.rotation.y += delta;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
5
|
+
const enquirer_1 = require("enquirer");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const versions_1 = require("../versions");
|
|
9
|
+
async function default_1(tree, { project }) {
|
|
10
|
+
devkit_1.logger.log('Initializing Angular Three...');
|
|
11
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
12
|
+
const version = packageJson['dependencies']?.['angular-three'] ||
|
|
13
|
+
packageJson['devDependencies']?.['angular-three'] ||
|
|
14
|
+
versions_1.ANGULAR_THREE_VERSION;
|
|
15
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, { 'angular-three': version, three: versions_1.THREE_VERSION, ngxtension: versions_1.NGXTENSION_VERSION }, { '@types/three': versions_1.THREE_TYPE_VERSION });
|
|
16
|
+
devkit_1.logger.info('Turning on skipLibCheck...');
|
|
17
|
+
const tsConfigPath = tree.exists('tsconfig.base.json') ? 'tsconfig.base.json' : 'tsconfig.json';
|
|
18
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
19
|
+
if (!('skipLibCheck' in json.compilerOptions) || json.compilerOptions?.skipLibCheck === false) {
|
|
20
|
+
json.compilerOptions.skipLibCheck = true;
|
|
21
|
+
}
|
|
22
|
+
return json;
|
|
23
|
+
});
|
|
24
|
+
(0, utils_1.addMetadataJson)(tree, 'angular-three/metadata.json');
|
|
25
|
+
const { generateExperience } = await (0, enquirer_1.prompt)({
|
|
26
|
+
type: 'select',
|
|
27
|
+
name: 'generateExperience',
|
|
28
|
+
message: 'Generate an Experience component?',
|
|
29
|
+
choices: [
|
|
30
|
+
{ value: 'append', name: 'append', message: 'Append <ngt-canvas /> to AppComponent template' },
|
|
31
|
+
{ value: 'replace', name: 'replace', message: 'Replace AppComponent template with <ngt-canvas />' },
|
|
32
|
+
{ value: 'none', name: 'none', message: 'Do not generate an Experience component' },
|
|
33
|
+
],
|
|
34
|
+
initial: 2,
|
|
35
|
+
});
|
|
36
|
+
if (generateExperience !== 'none') {
|
|
37
|
+
const isNx = tree.exists('nx.json');
|
|
38
|
+
if (!project) {
|
|
39
|
+
if (isNx) {
|
|
40
|
+
const rootProjectJson = (0, devkit_1.readJson)(tree, 'project.json');
|
|
41
|
+
if (!rootProjectJson) {
|
|
42
|
+
throw new Error(`
|
|
43
|
+
It seems like your workspace is an Integrated workspace but you did not provide a "project" name.
|
|
44
|
+
Please retry the generator with a "--project" specified.`);
|
|
45
|
+
}
|
|
46
|
+
const rootName = rootProjectJson['name'];
|
|
47
|
+
if (rootName === packageJson['name']) {
|
|
48
|
+
project = rootName;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
|
|
53
|
+
if (!angularJson) {
|
|
54
|
+
throw new Error(`
|
|
55
|
+
Cannot find "angular.json" file.
|
|
56
|
+
Please retry the generator with a "--project" specified in an Angular workspace.`);
|
|
57
|
+
}
|
|
58
|
+
project = packageJson['name'];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!project) {
|
|
62
|
+
throw new Error(`
|
|
63
|
+
Angular Three generator could not find a default "project".
|
|
64
|
+
Please retry the generator with a "--project" specified.`);
|
|
65
|
+
}
|
|
66
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
67
|
+
let sourceRoot = projectConfig.sourceRoot;
|
|
68
|
+
if (projectConfig['prefix']) {
|
|
69
|
+
sourceRoot += '/' + projectConfig['prefix'];
|
|
70
|
+
}
|
|
71
|
+
if (sourceRoot) {
|
|
72
|
+
// generate Experience component
|
|
73
|
+
(0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, 'files'), sourceRoot, { tmpl: '' });
|
|
74
|
+
let isStandalone = false;
|
|
75
|
+
while (!isStandalone) {
|
|
76
|
+
const answer = await (0, enquirer_1.prompt)({
|
|
77
|
+
type: 'confirm',
|
|
78
|
+
initial: true,
|
|
79
|
+
name: 'isStandalone',
|
|
80
|
+
message: 'Is your project standalone?',
|
|
81
|
+
});
|
|
82
|
+
isStandalone = answer.isStandalone;
|
|
83
|
+
if (!isStandalone) {
|
|
84
|
+
devkit_1.logger.info(`Wrong answer. You should be using Standalone.`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const appComponentPath = `${sourceRoot}/app.component.ts`;
|
|
88
|
+
const exist = tree.exists(appComponentPath);
|
|
89
|
+
const appComponentTemplatePath = `${sourceRoot}/app.component.html`;
|
|
90
|
+
const templateExist = tree.exists(appComponentTemplatePath);
|
|
91
|
+
const appComponentContent = exist ? tree.read(appComponentPath, 'utf8') : null;
|
|
92
|
+
const appComponentTemplateContent = templateExist ? tree.read(appComponentTemplatePath, 'utf8') : null;
|
|
93
|
+
if (isStandalone) {
|
|
94
|
+
if (!appComponentContent) {
|
|
95
|
+
devkit_1.logger.warn(`
|
|
96
|
+
AppComponent not found at ${appComponentPath}. Angular Three was initialized successfully but an Experience component was not generated.`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
let updatedContent = tsquery_1.tsquery.replace(appComponentContent, 'Identifier[name="imports"] ~ ArrayLiteralExpression', (node) => {
|
|
100
|
+
return `[${node.elements.map((element) => element['escapedText']).join(', ')}, NgtCanvas]`;
|
|
101
|
+
});
|
|
102
|
+
updatedContent = tsquery_1.tsquery.replace(updatedContent, 'SourceFile', (node) => {
|
|
103
|
+
return `
|
|
104
|
+
import { NgtCanvas } from 'angular-three';
|
|
105
|
+
import { Experience } from './experience/experience.component';
|
|
106
|
+
|
|
107
|
+
${node.getFullText()}
|
|
108
|
+
`;
|
|
109
|
+
});
|
|
110
|
+
const contentNode = tsquery_1.tsquery.ast(appComponentContent);
|
|
111
|
+
const classMembersQuery = 'ClassDeclaration > :matches(PropertyDeclaration,MethodDeclaration)';
|
|
112
|
+
const members = tsquery_1.tsquery.match(contentNode, classMembersQuery);
|
|
113
|
+
if (members.length === 0) {
|
|
114
|
+
updatedContent = tsquery_1.tsquery.replace(updatedContent, 'ClassDeclaration', (node) => {
|
|
115
|
+
const withoutBraces = node.getFullText().slice(0, -1);
|
|
116
|
+
return `
|
|
117
|
+
${withoutBraces}
|
|
118
|
+
scene = Experience;
|
|
119
|
+
}`;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
updatedContent = tsquery_1.tsquery.replace(updatedContent, classMembersQuery, (node) => {
|
|
124
|
+
return `
|
|
125
|
+
scene = Experience;
|
|
126
|
+
${node.getFullText()}`;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
if (appComponentTemplateContent) {
|
|
130
|
+
const updatedTemplateContent = generateExperience === 'append'
|
|
131
|
+
? `
|
|
132
|
+
${appComponentTemplateContent}
|
|
133
|
+
<ngt-canvas [sceneGraph]="scene" />`
|
|
134
|
+
: `<ngt-canvas [sceneGraph]="scene" />`;
|
|
135
|
+
tree.write(appComponentTemplatePath, updatedTemplateContent);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
updatedContent = tsquery_1.tsquery.replace(updatedContent, 'Identifier[name="template"] ~ NoSubstitutionTemplateLiteral', (node) => {
|
|
139
|
+
return generateExperience === 'append'
|
|
140
|
+
? `\`
|
|
141
|
+
${node.getFullText()}
|
|
142
|
+
<ngt-canvas [sceneGraph]="scene" />\``
|
|
143
|
+
: `\`<ngt-canvas [sceneGraph]="scene" />\``;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
tree.write(appComponentPath, updatedContent);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
devkit_1.logger.warn(`
|
|
152
|
+
"sourceRoot" not found. Angular Three was initialized successfully but an Experience component was not generated.`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return () => {
|
|
156
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
exports.default = default_1;
|
|
160
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init/generator.ts"],"names":[],"mappings":";;AAAA,uCASoB;AACpB,uDAAoD;AACpD,uCAAkC;AAClC,yCAAiC;AAEjC,oCAA2C;AAC3C,0CAA2G;AAM5F,KAAK,oBAAW,IAAU,EAAE,EAAE,OAAO,EAAU;IAC7D,eAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,MAAM,OAAO,GACZ,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC;QAC9C,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,eAAe,CAAC;QACjD,gCAAqB,CAAC;IAEvB,IAAA,qCAA4B,EAC3B,IAAI,EACJ,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,wBAAa,EAAE,UAAU,EAAE,6BAAkB,EAAE,EAClF,EAAE,cAAc,EAAE,6BAAkB,EAAE,CACtC,CAAC;IAEF,eAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe,CAAC;IAEhG,IAAA,mBAAU,EAAC,IAAI,EAAE,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;QACvC,IAAI,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,YAAY,KAAK,KAAK,EAAE;YAC9F,IAAI,CAAC,eAAe,CAAC,YAAY,GAAG,IAAI,CAAC;SACzC;QACD,OAAO,IAAI,CAAC;IACb,CAAC,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"project": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the project to add the Tailwind CSS setup for.",
|
|
10
|
+
"$default": {
|
|
11
|
+
"$source": "argv",
|
|
12
|
+
"index": 0
|
|
13
|
+
},
|
|
14
|
+
"x-prompt": "What project would you like to add the Angular Three setup?"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
6
17
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const generator_1 = require("./generator");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-cannon/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,2CAA+B;AAE/B,kBAAe,IAAA,2BAAkB,EAAC,mBAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const versions_1 = require("../versions");
|
|
5
|
+
async function default_1(tree) {
|
|
6
|
+
devkit_1.logger.log('Initializing Angular Three Cannon...');
|
|
7
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
8
|
+
const version = packageJson['dependencies']?.['angular-three'] ||
|
|
9
|
+
packageJson['devDependencies']?.['angular-three'] ||
|
|
10
|
+
versions_1.ANGULAR_THREE_VERSION;
|
|
11
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
12
|
+
'angular-three-cannon': version,
|
|
13
|
+
'@pmndrs/cannon-worker-api': versions_1.CANNON_WORKER_API_VERSION,
|
|
14
|
+
'cannon-es': versions_1.CANNON_ES_VERSION,
|
|
15
|
+
'cannon-es-debugger': versions_1.CANNON_ES_DEBUGGER_VERSION,
|
|
16
|
+
ngxtension: versions_1.NGXTENSION_VERSION,
|
|
17
|
+
}, {});
|
|
18
|
+
return () => {
|
|
19
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.default = default_1;
|
|
23
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-cannon/generator.ts"],"names":[],"mappings":";;AAAA,uCAA4G;AAC5G,0CAMqB;AAEN,KAAK,oBAAW,IAAU;IACxC,eAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IAEnD,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,MAAM,OAAO,GACZ,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC;QAC9C,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,eAAe,CAAC;QACjD,gCAAqB,CAAC;IAEvB,IAAA,qCAA4B,EAC3B,IAAI,EACJ;QACC,sBAAsB,EAAE,OAAO;QAC/B,2BAA2B,EAAE,oCAAyB;QACtD,WAAW,EAAE,4BAAiB;QAC9B,oBAAoB,EAAE,qCAA0B;QAChD,UAAU,EAAE,6BAAkB;KAC9B,EACD,EAAE,CACF,CAAC;IAEF,OAAO,GAAG,EAAE;QACX,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;AACH,CAAC;AAzBD,4BAyBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const generator_1 = require("./generator");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-postprocessing/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,2CAA+B;AAE/B,kBAAe,IAAA,2BAAkB,EAAC,mBAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const versions_1 = require("../versions");
|
|
5
|
+
async function default_1(tree) {
|
|
6
|
+
devkit_1.logger.log('Initializing Angular Three Postprocessing...');
|
|
7
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
8
|
+
const version = packageJson['dependencies']?.['angular-three'] ||
|
|
9
|
+
packageJson['devDependencies']?.['angular-three'] ||
|
|
10
|
+
versions_1.ANGULAR_THREE_VERSION;
|
|
11
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
12
|
+
'angular-three-postprocessing': version,
|
|
13
|
+
postprocessing: versions_1.POSTPROCESSING_VERSION,
|
|
14
|
+
ngxtension: versions_1.NGXTENSION_VERSION,
|
|
15
|
+
}, {});
|
|
16
|
+
return () => {
|
|
17
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.default = default_1;
|
|
21
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-postprocessing/generator.ts"],"names":[],"mappings":";;AAAA,uCAA4G;AAC5G,0CAAgG;AAEjF,KAAK,oBAAW,IAAU;IACxC,eAAM,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAE3D,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,MAAM,OAAO,GACZ,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC;QAC9C,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,eAAe,CAAC;QACjD,gCAAqB,CAAC;IAEvB,IAAA,qCAA4B,EAC3B,IAAI,EACJ;QACC,8BAA8B,EAAE,OAAO;QACvC,cAAc,EAAE,iCAAsB;QACtC,UAAU,EAAE,6BAAkB;KAC9B,EACD,EAAE,CACF,CAAC;IAEF,OAAO,GAAG,EAAE;QACX,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;AACH,CAAC;AAvBD,4BAuBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const generator_1 = require("./generator");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxGenerator)(generator_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-soba/compat.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,2CAA+B;AAE/B,kBAAe,IAAA,2BAAkB,EAAC,mBAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const versions_1 = require("../versions");
|
|
6
|
+
async function default_1(tree) {
|
|
7
|
+
devkit_1.logger.log('Initializing Angular Three Soba...');
|
|
8
|
+
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
+
const version = packageJson['dependencies']?.['angular-three'] ||
|
|
10
|
+
packageJson['devDependencies']?.['angular-three'] ||
|
|
11
|
+
versions_1.ANGULAR_THREE_VERSION;
|
|
12
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
13
|
+
'angular-three-soba': version,
|
|
14
|
+
meshline: versions_1.MESH_LINE_VERSION,
|
|
15
|
+
'three-stdlib': versions_1.THREE_STDLIB_VERSION,
|
|
16
|
+
'stats-gl': versions_1.STATS_GL_VERSION,
|
|
17
|
+
'three-mesh-bvh': versions_1.THREE_MESH_BVH_VERSION,
|
|
18
|
+
'troika-three-text': versions_1.TROIKA_THREE_TEXT_VERSION,
|
|
19
|
+
ngxtension: versions_1.NGXTENSION_VERSION,
|
|
20
|
+
}, {});
|
|
21
|
+
(0, utils_1.addMetadataJson)(tree, 'angular-three-soba/metadata.json');
|
|
22
|
+
return () => {
|
|
23
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.default = default_1;
|
|
27
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../libs/plugin/src/generators/init-soba/generator.ts"],"names":[],"mappings":";;AAAA,uCAA4G;AAC5G,oCAA2C;AAC3C,0CAQqB;AAEN,KAAK,oBAAW,IAAU;IACxC,eAAM,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAEjD,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAEnD,MAAM,OAAO,GACZ,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC,eAAe,CAAC;QAC9C,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC,eAAe,CAAC;QACjD,gCAAqB,CAAC;IAEvB,IAAA,qCAA4B,EAC3B,IAAI,EACJ;QACC,oBAAoB,EAAE,OAAO;QAC7B,QAAQ,EAAE,4BAAiB;QAC3B,cAAc,EAAE,+BAAoB;QACpC,UAAU,EAAE,2BAAgB;QAC5B,gBAAgB,EAAE,iCAAsB;QACxC,mBAAmB,EAAE,oCAAyB;QAC9C,UAAU,EAAE,6BAAkB;KAC9B,EACD,EAAE,CACF,CAAC;IAEF,IAAA,uBAAe,EAAC,IAAI,EAAE,kCAAkC,CAAC,CAAC;IAE1D,OAAO,GAAG,EAAE;QACX,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC;AACH,CAAC;AA7BD,4BA6BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addMetadataJson = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function addMetadataJson(tree, metadataJsonPath) {
|
|
6
|
+
if (!metadataJsonPath.includes('node_modules')) {
|
|
7
|
+
metadataJsonPath = `./node_modules/${metadataJsonPath}`;
|
|
8
|
+
}
|
|
9
|
+
// add metadata.json to vscode settings if exists
|
|
10
|
+
const vscodeSettingsPath = '.vscode/settings.json';
|
|
11
|
+
if (tree.exists('.vscode')) {
|
|
12
|
+
devkit_1.logger.info('Enabling typings support for VSCode...');
|
|
13
|
+
if (!tree.exists(vscodeSettingsPath)) {
|
|
14
|
+
(0, devkit_1.writeJson)(tree, vscodeSettingsPath, {});
|
|
15
|
+
}
|
|
16
|
+
(0, devkit_1.updateJson)(tree, vscodeSettingsPath, (json) => {
|
|
17
|
+
if (json['html.customData'] && Array.isArray(json['html.customData'])) {
|
|
18
|
+
json['html.customData'].push(metadataJsonPath);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
json['html.customData'] = [metadataJsonPath];
|
|
22
|
+
}
|
|
23
|
+
return json;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
devkit_1.logger.info(`.vscode/settings.json not found.
|
|
28
|
+
If you are using VSCode, add "${metadataJsonPath}" to "html.customData" in ".vscode/settings.json"
|
|
29
|
+
to enable TypeScript type definitions for Angular Three elements.
|
|
30
|
+
`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.addMetadataJson = addMetadataJson;
|
|
34
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../libs/plugin/src/generators/utils.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;AAEtE,SAAgB,eAAe,CAAC,IAAU,EAAE,gBAAwB;IACnE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;QAC/C,gBAAgB,GAAG,kBAAkB,gBAAgB,EAAE,CAAC;KACxD;IAED,iDAAiD;IACjD,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;IACnD,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;QAC3B,eAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE;YACrC,IAAA,kBAAS,EAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;SACxC;QACD,IAAA,mBAAU,EAAC,IAAI,EAAE,kBAAkB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC7C,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE;gBACtE,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAC/C;iBAAM;gBACN,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;aAC7C;YAED,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;KACH;SAAM;QACN,eAAM,CAAC,IAAI,CACV;gCAC6B,gBAAgB;;CAE/C,CACE,CAAC;KACF;AACF,CAAC;AA7BD,0CA6BC"}
|