angular-three 2.0.0-beta.4 → 2.0.0-beta.41

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.
Files changed (153) hide show
  1. package/README.md +4 -147
  2. package/esm2022/angular-three.mjs +1 -1
  3. package/esm2022/index.mjs +10 -11
  4. package/esm2022/lib/before-render.mjs +13 -0
  5. package/esm2022/lib/canvas.mjs +137 -161
  6. package/esm2022/lib/directives/args.mjs +13 -11
  7. package/esm2022/lib/directives/common.mjs +28 -27
  8. package/esm2022/lib/directives/key.mjs +29 -0
  9. package/esm2022/lib/directives/parent.mjs +13 -11
  10. package/esm2022/lib/dom/events.mjs +6 -1
  11. package/esm2022/lib/events.mjs +77 -60
  12. package/esm2022/lib/instance.mjs +65 -0
  13. package/esm2022/lib/loader.mjs +35 -41
  14. package/esm2022/lib/loop.mjs +6 -3
  15. package/esm2022/lib/portal.mjs +103 -112
  16. package/esm2022/lib/ref.mjs +48 -0
  17. package/esm2022/lib/renderer/catalogue.mjs +7 -0
  18. package/esm2022/lib/renderer/constants.mjs +21 -0
  19. package/esm2022/lib/renderer/index.mjs +419 -0
  20. package/esm2022/lib/renderer/store.mjs +148 -112
  21. package/esm2022/lib/renderer/utils.mjs +63 -48
  22. package/esm2022/lib/roots.mjs +249 -0
  23. package/esm2022/lib/routed-scene.mjs +11 -8
  24. package/esm2022/lib/store.mjs +207 -0
  25. package/esm2022/lib/three-types.mjs +2 -2
  26. package/esm2022/lib/types.mjs +1 -1
  27. package/esm2022/lib/utils/apply-props.mjs +23 -11
  28. package/esm2022/lib/utils/attach.mjs +2 -2
  29. package/esm2022/lib/utils/is.mjs +1 -1
  30. package/esm2022/lib/utils/make.mjs +1 -1
  31. package/esm2022/lib/utils/safe-detect-changes.mjs +15 -13
  32. package/esm2022/lib/utils/signal-store.mjs +99 -0
  33. package/esm2022/lib/utils/update.mjs +1 -1
  34. package/fesm2022/angular-three.mjs +2014 -1882
  35. package/fesm2022/angular-three.mjs.map +1 -1
  36. package/index.d.ts +9 -10
  37. package/lib/{di/before-render.d.ts → before-render.d.ts} +1 -1
  38. package/lib/canvas.d.ts +82 -12
  39. package/lib/directives/args.d.ts +2 -2
  40. package/lib/directives/common.d.ts +5 -1
  41. package/lib/directives/key.d.ts +10 -0
  42. package/lib/directives/parent.d.ts +5 -5
  43. package/lib/dom/events.d.ts +3 -2
  44. package/lib/events.d.ts +78 -2
  45. package/lib/instance.d.ts +36 -0
  46. package/lib/loader.d.ts +21 -3
  47. package/lib/loop.d.ts +68 -6
  48. package/lib/portal.d.ts +21 -12
  49. package/lib/{di/ref.d.ts → ref.d.ts} +3 -2
  50. package/lib/renderer/catalogue.d.ts +13 -0
  51. package/lib/renderer/constants.d.ts +20 -0
  52. package/lib/renderer/index.d.ts +5 -0
  53. package/lib/renderer/store.d.ts +21 -15
  54. package/lib/renderer/utils.d.ts +29 -19
  55. package/lib/roots.d.ts +11 -0
  56. package/lib/routed-scene.d.ts +1 -1
  57. package/lib/store.d.ts +147 -0
  58. package/lib/three-types.d.ts +5 -5
  59. package/lib/types.d.ts +1 -309
  60. package/lib/utils/apply-props.d.ts +4 -2
  61. package/lib/utils/attach.d.ts +5 -3
  62. package/lib/utils/is.d.ts +5 -4
  63. package/lib/utils/make.d.ts +12 -1
  64. package/lib/utils/safe-detect-changes.d.ts +2 -2
  65. package/lib/utils/signal-store.d.ts +17 -0
  66. package/lib/utils/update.d.ts +1 -1
  67. package/metadata.json +1 -1
  68. package/package.json +24 -5
  69. package/plugin/generators.json +57 -17
  70. package/plugin/migrations.json +27 -0
  71. package/plugin/package.json +22 -4
  72. package/plugin/src/generators/init/compat.d.ts +3 -1
  73. package/plugin/src/generators/init/compat.js +2 -2
  74. package/plugin/src/generators/init/compat.js.map +1 -1
  75. package/plugin/src/generators/init/files/experience/experience.component.html__tmpl__ +4 -0
  76. package/plugin/src/generators/init/files/experience/experience.component.ts__tmpl__ +18 -0
  77. package/plugin/src/generators/init/generator.d.ts +6 -0
  78. package/plugin/src/generators/init/generator.js +160 -0
  79. package/plugin/src/generators/init/generator.js.map +1 -0
  80. package/plugin/src/generators/init/schema.json +15 -4
  81. package/plugin/src/generators/init-cannon/compat.d.ts +2 -0
  82. package/plugin/src/generators/init-cannon/compat.js +6 -0
  83. package/plugin/src/generators/init-cannon/compat.js.map +1 -0
  84. package/plugin/src/generators/init-cannon/generator.d.ts +2 -0
  85. package/plugin/src/generators/init-cannon/generator.js +23 -0
  86. package/plugin/src/generators/init-cannon/generator.js.map +1 -0
  87. package/plugin/src/generators/init-cannon/schema.json +6 -0
  88. package/plugin/src/generators/init-postprocessing/compat.d.ts +2 -0
  89. package/plugin/src/generators/init-postprocessing/compat.js +6 -0
  90. package/plugin/src/generators/init-postprocessing/compat.js.map +1 -0
  91. package/plugin/src/generators/init-postprocessing/generator.d.ts +2 -0
  92. package/plugin/src/generators/init-postprocessing/generator.js +21 -0
  93. package/plugin/src/generators/init-postprocessing/generator.js.map +1 -0
  94. package/plugin/src/generators/init-postprocessing/schema.json +6 -0
  95. package/plugin/src/generators/init-rapier/compat.d.ts +2 -0
  96. package/plugin/src/generators/init-rapier/compat.js +6 -0
  97. package/plugin/src/generators/init-rapier/compat.js.map +1 -0
  98. package/plugin/src/generators/init-rapier/generator.d.ts +2 -0
  99. package/plugin/src/generators/init-rapier/generator.js +22 -0
  100. package/plugin/src/generators/init-rapier/generator.js.map +1 -0
  101. package/plugin/src/generators/init-rapier/schema.json +6 -0
  102. package/plugin/src/generators/init-soba/compat.d.ts +2 -0
  103. package/plugin/src/generators/init-soba/compat.js +6 -0
  104. package/plugin/src/generators/init-soba/compat.js.map +1 -0
  105. package/plugin/src/generators/init-soba/generator.d.ts +2 -0
  106. package/plugin/src/generators/init-soba/generator.js +27 -0
  107. package/plugin/src/generators/init-soba/generator.js.map +1 -0
  108. package/plugin/src/generators/init-soba/schema.json +6 -0
  109. package/plugin/src/generators/utils.d.ts +2 -0
  110. package/plugin/src/generators/utils.js +34 -0
  111. package/plugin/src/generators/utils.js.map +1 -0
  112. package/plugin/src/generators/versions.d.ts +14 -0
  113. package/plugin/src/generators/versions.js +18 -0
  114. package/plugin/src/generators/versions.js.map +1 -0
  115. package/plugin/src/index.d.ts +5 -1
  116. package/plugin/src/index.js +11 -3
  117. package/plugin/src/index.js.map +1 -1
  118. package/plugin/src/migrations/migrate-to-ngxtension/compat.d.ts +2 -0
  119. package/plugin/src/migrations/migrate-to-ngxtension/compat.js +6 -0
  120. package/plugin/src/migrations/migrate-to-ngxtension/compat.js.map +1 -0
  121. package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.d.ts +2 -0
  122. package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.js +55 -0
  123. package/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.js.map +1 -0
  124. package/web-types.json +1 -1
  125. package/esm2022/lib/di/before-render.mjs +0 -13
  126. package/esm2022/lib/di/catalogue.mjs +0 -7
  127. package/esm2022/lib/di/ref.mjs +0 -49
  128. package/esm2022/lib/directives/repeat.mjs +0 -18
  129. package/esm2022/lib/renderer/di.mjs +0 -3
  130. package/esm2022/lib/renderer/enums.mjs +0 -2
  131. package/esm2022/lib/renderer/provider.mjs +0 -18
  132. package/esm2022/lib/renderer/renderer.mjs +0 -368
  133. package/esm2022/lib/stores/signal.store.mjs +0 -79
  134. package/esm2022/lib/stores/store.mjs +0 -420
  135. package/esm2022/lib/utils/assert-in-injection-context.mjs +0 -14
  136. package/esm2022/lib/utils/instance.mjs +0 -63
  137. package/esm2022/lib/utils/signal.mjs +0 -24
  138. package/esm2022/lib/utils/timing.mjs +0 -21
  139. package/lib/di/catalogue.d.ts +0 -3
  140. package/lib/directives/repeat.d.ts +0 -7
  141. package/lib/renderer/di.d.ts +0 -2
  142. package/lib/renderer/enums.d.ts +0 -26
  143. package/lib/renderer/provider.d.ts +0 -8
  144. package/lib/renderer/renderer.d.ts +0 -49
  145. package/lib/stores/signal.store.d.ts +0 -21
  146. package/lib/stores/store.d.ts +0 -13
  147. package/lib/utils/assert-in-injection-context.d.ts +0 -2
  148. package/lib/utils/instance.d.ts +0 -4
  149. package/lib/utils/signal.d.ts +0 -2
  150. package/lib/utils/timing.d.ts +0 -4
  151. package/plugin/src/generators/init/init.d.ts +0 -5
  152. package/plugin/src/generators/init/init.js +0 -56
  153. package/plugin/src/generators/init/init.js.map +0 -1
package/README.md CHANGED
@@ -1,150 +1,7 @@
1
- # Angular Renderer for THREE.js
1
+ # core
2
2
 
3
- [![From Vietnam with <3](https://raw.githubusercontent.com/webuild-community/badge/master/svg/love.svg)](https://webuild.community)
3
+ This library was generated with [Nx](https://nx.dev).
4
4
 
5
- Leverage your [Angular](https://angular.io) to build 3D applications with [THREE.js](https://threejs.org)
5
+ ## Running unit tests
6
6
 
7
- ## Installation
8
-
9
- ### Angular CLI
10
-
11
- ```shell
12
- npx ng add angular-three
13
- ```
14
-
15
- ### Nx
16
-
17
- ```shell
18
- npm i angular-three
19
- npx nx g angular-three:init
20
- ```
21
-
22
- ### Manual
23
-
24
- ```shell
25
- npm i angular-three three
26
- ```
27
-
28
- ```shell
29
- npm i -D @types/three
30
- ```
31
-
32
- - Adjust `tsconfig.json` (or `tsconfig.base.json`) to include `skipTypeCheck: false`
33
-
34
- > Typically, we'd want to keep `three` and `@types/three` on the same minor version. Eg: `0.147`, `0.148` etc..
35
-
36
- ## Type
37
-
38
- ### VSCode
39
-
40
- - If you use `ng add` or `nx generate` command, this is setup for you.
41
- - If you install `angular-three` manually, you can do the following steps to enable typings
42
- - Open `.vscode/settings.json`, or create one if you do not have it
43
- - Add `html.customData` property with the value of `["./node_modules/angular-three/metadata.json"]`. If `html.customData` exists, simply add `"./node_modules/angular-three/metadata.json"` to the array
44
-
45
- ### WebStorm/IntelliJ
46
-
47
- - You **should not** need to do anything here but if things do not work, you can add `web-types` property to `package.json` with the value of `"./node_modules/angular-three/web-types.json"`
48
-
49
- ### NeoVim
50
-
51
- Setup will vary depending on your current NeoVim configuration. However, I'd expect the **required** steps to be the same
52
-
53
- - `neovim/nvim-lspconfig` needs to be configured for `html` LSP
54
- - `init_options.dataPaths` needs to include the path to `node_modules/angular-three/metadata.json`
55
- - Setup a `html/customDataContent` handler (`handlers = {["html/customDataContent"] = function() ... end}` for Lua syntax)
56
- and return the content of the `init_options.dataPaths`
57
-
58
- Here's an example setup for [LazyVim](https://www.lazyvim.org/)
59
-
60
- ```lua
61
- return {
62
- {
63
- "neovim/nvim-lspconfig",
64
- ---@class PluginLspOpts
65
- opts = {
66
- ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
67
- setup = {
68
- html = function(_, opts)
69
- opts.init_options = {
70
- dataPaths = {
71
- vim.fn.getcwd() .. "/node_modules/angular-three/metadata.json",
72
- },
73
- configurationSection = { "html", "css", "javascript" },
74
- embeddedLanguages = {
75
- css = true,
76
- javascript = true,
77
- },
78
- provideFormatter = true,
79
- }
80
-
81
- opts.handlers = {
82
- ["html/customDataContent"] = function(err, result, ctx, config)
83
- local function exists(name)
84
- if type(name) ~= "string" then
85
- return false
86
- end
87
- return os.execute("test -e " .. name)
88
- end
89
-
90
- if not vim.tbl_isempty(result) and #result == 1 then
91
- if not exists(result[1]) then
92
- return ""
93
- end
94
- local content = vim.fn.join(vim.fn.readfile(result[1]), "\n")
95
- return content
96
- end
97
- return ""
98
- end,
99
- }
100
-
101
- return false
102
- end,
103
- },
104
- },
105
- },
106
- }
107
- ```
108
-
109
- ## Documentations
110
-
111
- Read more about Angular Three usages in [Documentations](https://angular-three-backupjs.netlify.app)
112
-
113
- ## Simple usage
114
-
115
- 1. Create a `Scene` component as a Standalone Component
116
-
117
- ```ts
118
- import { extend } from 'angular-three';
119
- import { Mesh, BoxGeometry, MeshBasicMaterial } from 'three';
120
-
121
- extend({ Mesh, BoxGeometry, MeshBasicMaterial });
122
-
123
- @Component({
124
- standalone: true,
125
- template: `
126
- <ngt-mesh>
127
- <ngt-box-geometry />
128
- <ngt-mesh-basic-material color="darkred" />
129
- </ngt-mesh>
130
- `,
131
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
132
- })
133
- export class Scene {}
134
- ```
135
-
136
- - `extend` will add the THREE entities to `angular-three` catalogue which allows the renderer to recognize the custom tags: `ngt-mesh`, `ngt-box-geometry` etc..
137
- - Custom Element tags follow this rule: `ngt-` + THREE classes in **kebab-case**. `Mesh` -> `ngt-mesh`
138
- - `schemas: [CUSTOM_ELEMENTS_SCHEMA]` allows us to use custom tags on the template. This is Angular's limitation at the moment
139
-
140
- 2. Render `<ngt-canvas>` component, use `Scene` component above to pass into `[sceneGraph]` input on `<ngt-canvas>`
141
-
142
- ```html
143
- <ngt-canvas [sceneGraph]="Scene" />
144
- ```
145
-
146
- - `ngt-canvas` creates the basic building blocks of THREE.js: a default `WebGLRenderer`, a default `Scene`, and a default `PerspectiveCamera`
147
-
148
- ## Contributions
149
-
150
- Contributions are welcomed
7
+ Run `nx test core` to execute the unit tests.
@@ -2,4 +2,4 @@
2
2
  * Generated bundle index. Do not edit.
3
3
  */
4
4
  export * from './index';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci10aHJlZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvYW5ndWxhci10aHJlZS9zcmMvYW5ndWxhci10aHJlZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5ndWxhci10aHJlZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvYW5ndWxhci10aHJlZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsU0FBUyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL2luZGV4JztcbiJdfQ==
package/esm2022/index.mjs CHANGED
@@ -1,26 +1,25 @@
1
+ export * from './lib/before-render';
1
2
  export * from './lib/canvas';
2
- export * from './lib/di/before-render';
3
- export * from './lib/di/catalogue';
4
- export * from './lib/di/ref';
5
3
  export * from './lib/directives/args';
4
+ export * from './lib/directives/key';
6
5
  export * from './lib/directives/parent';
7
- export * from './lib/directives/repeat';
6
+ export {} from './lib/events';
7
+ export * from './lib/instance';
8
8
  export * from './lib/loader';
9
9
  export { addAfterEffect, addEffect, addTail } from './lib/loop';
10
10
  export { NgtPortal, NgtPortalContent } from './lib/portal';
11
+ export * from './lib/ref';
12
+ export * from './lib/renderer';
11
13
  export * from './lib/routed-scene';
12
- export * from './lib/stores/signal.store';
13
- export * from './lib/stores/store';
14
+ export * from './lib/store';
14
15
  export * from './lib/three-types';
15
16
  export * from './lib/types';
16
17
  export * from './lib/utils/apply-props';
17
- export * from './lib/utils/assert-in-injection-context';
18
18
  export { createAttachFunction } from './lib/utils/attach';
19
- export * from './lib/utils/instance';
20
19
  export * from './lib/utils/is';
21
20
  export * from './lib/utils/make';
22
21
  export * from './lib/utils/safe-detect-changes';
23
- export * from './lib/utils/signal';
24
- export * from './lib/utils/timing';
22
+ export * from './lib/utils/signal-store';
25
23
  export * from './lib/utils/update';
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uL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hyZWUtdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdHlwZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbHMvYXBwbHktcHJvcHMnO1xuZXhwb3J0IHsgY3JlYXRlQXR0YWNoRnVuY3Rpb24gfSBmcm9tICcuL2xpYi91dGlscy9hdHRhY2gnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbHMvaXMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvdXRpbHMvbWFrZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlscy9zYWZlLWRldGVjdC1jaGFuZ2VzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWxzL3NpZ25hbC1zdG9yZSc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi91dGlscy91cGRhdGUnO1xuaW1wb3J0ICcuL2xpYi90aHJlZS10eXBlcyc7XG4iXX0=
@@ -0,0 +1,13 @@
1
+ import { DestroyRef, Injector, inject, runInInjectionContext } from '@angular/core';
2
+ import { assertInjector } from 'ngxtension/assert-injector';
3
+ import { injectNgtStore } from './store';
4
+ export function injectBeforeRender(cb, { priority = 0, injector } = {}) {
5
+ injector = assertInjector(injectBeforeRender, injector);
6
+ return runInInjectionContext(injector, () => {
7
+ const store = injectNgtStore();
8
+ const sub = store.get('internal').subscribe(cb, priority, store);
9
+ inject(DestroyRef).onDestroy(() => void sub());
10
+ return sub;
11
+ });
12
+ }
13
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVmb3JlLXJlbmRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9zcmMvbGliL2JlZm9yZS1yZW5kZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLHFCQU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