angular-three 2.0.0-beta.3 → 2.0.0-beta.300

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 (159) hide show
  1. package/README.md +186 -112
  2. package/esm2022/angular-three.mjs +1 -1
  3. package/esm2022/index.mjs +17 -18
  4. package/esm2022/lib/canvas.mjs +155 -252
  5. package/esm2022/lib/directives/args.mjs +49 -21
  6. package/esm2022/lib/directives/selection.mjs +65 -0
  7. package/esm2022/lib/dom/events.mjs +7 -2
  8. package/esm2022/lib/events.mjs +98 -79
  9. package/esm2022/lib/html.mjs +40 -0
  10. package/esm2022/lib/instance.mjs +72 -0
  11. package/esm2022/lib/loader.mjs +77 -57
  12. package/esm2022/lib/loop.mjs +30 -24
  13. package/esm2022/lib/pipes/hexify.mjs +67 -0
  14. package/esm2022/lib/portal.mjs +184 -215
  15. package/esm2022/lib/renderer/catalogue.mjs +7 -0
  16. package/esm2022/lib/renderer/constants.mjs +20 -0
  17. package/esm2022/lib/renderer/index.mjs +557 -0
  18. package/esm2022/lib/renderer/state.mjs +49 -0
  19. package/esm2022/lib/renderer/utils.mjs +85 -74
  20. package/esm2022/lib/roots.mjs +273 -0
  21. package/esm2022/lib/routed-scene.mjs +13 -11
  22. package/esm2022/lib/store.mjs +183 -0
  23. package/esm2022/lib/three-types.mjs +1 -1
  24. package/esm2022/lib/types.mjs +1 -1
  25. package/esm2022/lib/utils/apply-props.mjs +43 -35
  26. package/esm2022/lib/utils/attach.mjs +13 -10
  27. package/esm2022/lib/utils/before-render.mjs +12 -0
  28. package/esm2022/lib/utils/is.mjs +6 -5
  29. package/esm2022/lib/utils/make.mjs +19 -17
  30. package/esm2022/lib/utils/non-nullish.mjs +7 -0
  31. package/esm2022/lib/utils/object-events.mjs +92 -0
  32. package/esm2022/lib/utils/parameters.mjs +70 -0
  33. package/esm2022/lib/utils/resolve-ref.mjs +8 -0
  34. package/esm2022/lib/utils/signal-store.mjs +90 -0
  35. package/esm2022/lib/utils/update.mjs +8 -4
  36. package/esm2022/testing/angular-three-testing.mjs +5 -0
  37. package/esm2022/testing/index.mjs +3 -0
  38. package/esm2022/testing/lib/test-bed.mjs +130 -0
  39. package/esm2022/testing/lib/test-canvas.mjs +45 -0
  40. package/esm2022/testing/lib/utils/mock-canvas.mjs +37 -0
  41. package/esm2022/testing/lib/utils/web-gl-rendering-context.mjs +752 -0
  42. package/fesm2022/angular-three-testing.mjs +966 -0
  43. package/fesm2022/angular-three-testing.mjs.map +1 -0
  44. package/fesm2022/angular-three.mjs +2110 -2057
  45. package/fesm2022/angular-three.mjs.map +1 -1
  46. package/index.d.ts +18 -17
  47. package/lib/canvas.d.ts +373 -33
  48. package/lib/directives/args.d.ts +14 -7
  49. package/lib/directives/selection.d.ts +17 -0
  50. package/lib/dom/events.d.ts +2 -2
  51. package/lib/events.d.ts +4 -4
  52. package/lib/html.d.ts +17 -0
  53. package/lib/instance.d.ts +4 -0
  54. package/lib/loader.d.ts +28 -5
  55. package/lib/loop.d.ts +27 -17
  56. package/lib/pipes/hexify.d.ts +20 -0
  57. package/lib/portal.d.ts +58 -44
  58. package/lib/renderer/catalogue.d.ts +13 -0
  59. package/lib/renderer/constants.d.ts +19 -0
  60. package/lib/renderer/{renderer.d.ts → index.d.ts} +34 -18
  61. package/lib/renderer/state.d.ts +24 -0
  62. package/lib/renderer/utils.d.ts +12 -20
  63. package/lib/roots.d.ts +13 -0
  64. package/lib/routed-scene.d.ts +1 -1
  65. package/lib/store.d.ts +15 -0
  66. package/lib/three-types.d.ts +502 -149
  67. package/lib/types.d.ts +161 -178
  68. package/lib/utils/apply-props.d.ts +2 -2
  69. package/lib/utils/attach.d.ts +4 -4
  70. package/lib/utils/is.d.ts +13 -13
  71. package/lib/utils/make.d.ts +10 -5
  72. package/lib/utils/non-nullish.d.ts +4 -0
  73. package/lib/utils/object-events.d.ts +34 -0
  74. package/lib/utils/parameters.d.ts +20 -0
  75. package/lib/utils/resolve-ref.d.ts +2 -0
  76. package/lib/utils/signal-store.d.ts +26 -0
  77. package/lib/utils/update.d.ts +1 -1
  78. package/metadata.json +1 -1
  79. package/package.json +41 -14
  80. package/plugin/generators.json +34 -16
  81. package/plugin/package.json +3 -6
  82. package/plugin/src/generators/add-soba/compat.d.ts +2 -0
  83. package/plugin/src/generators/add-soba/compat.js +6 -0
  84. package/plugin/src/generators/add-soba/compat.js.map +1 -0
  85. package/plugin/src/generators/add-soba/generator.d.ts +3 -0
  86. package/plugin/src/generators/add-soba/generator.js +78 -0
  87. package/plugin/src/generators/add-soba/generator.js.map +1 -0
  88. package/plugin/src/generators/add-soba/schema.json +4 -0
  89. package/plugin/src/generators/gltf/compat.d.ts +2 -0
  90. package/plugin/src/generators/gltf/compat.js +6 -0
  91. package/plugin/src/generators/gltf/compat.js.map +1 -0
  92. package/plugin/src/generators/gltf/files/__fileName__.ts__tmpl__ +36 -0
  93. package/plugin/src/generators/gltf/generator.d.ts +12 -0
  94. package/plugin/src/generators/gltf/generator.js +125 -0
  95. package/plugin/src/generators/gltf/generator.js.map +1 -0
  96. package/plugin/src/generators/gltf/schema.json +58 -0
  97. package/plugin/src/generators/init/compat.d.ts +1 -1
  98. package/plugin/src/generators/init/compat.js +2 -2
  99. package/plugin/src/generators/init/compat.js.map +1 -1
  100. package/plugin/src/generators/init/files/experience/experience.component.ts__tmpl__ +29 -0
  101. package/plugin/src/generators/init/generator.d.ts +6 -0
  102. package/plugin/src/generators/init/generator.js +154 -0
  103. package/plugin/src/generators/init/generator.js.map +1 -0
  104. package/plugin/src/generators/init/schema.json +11 -4
  105. package/plugin/src/generators/utils.d.ts +2 -0
  106. package/plugin/src/generators/utils.js +35 -0
  107. package/plugin/src/generators/utils.js.map +1 -0
  108. package/plugin/src/generators/version.d.ts +16 -0
  109. package/plugin/src/generators/version.js +20 -0
  110. package/plugin/src/generators/version.js.map +1 -0
  111. package/plugin/src/index.d.ts +0 -1
  112. package/plugin/src/index.js +0 -5
  113. package/plugin/src/index.js.map +1 -1
  114. package/testing/README.md +3 -0
  115. package/testing/index.d.ts +2 -0
  116. package/testing/lib/test-bed.d.ts +38 -0
  117. package/testing/lib/test-canvas.d.ts +11 -0
  118. package/testing/lib/utils/mock-canvas.d.ts +5 -0
  119. package/testing/lib/utils/web-gl-rendering-context.d.ts +16 -0
  120. package/testing/package.json +3 -0
  121. package/web-types.json +1 -1
  122. package/esm2022/lib/di/before-render.mjs +0 -13
  123. package/esm2022/lib/di/catalogue.mjs +0 -7
  124. package/esm2022/lib/di/ref.mjs +0 -49
  125. package/esm2022/lib/directives/common.mjs +0 -39
  126. package/esm2022/lib/directives/parent.mjs +0 -33
  127. package/esm2022/lib/directives/repeat.mjs +0 -18
  128. package/esm2022/lib/renderer/di.mjs +0 -3
  129. package/esm2022/lib/renderer/enums.mjs +0 -2
  130. package/esm2022/lib/renderer/provider.mjs +0 -18
  131. package/esm2022/lib/renderer/renderer.mjs +0 -365
  132. package/esm2022/lib/renderer/store.mjs +0 -372
  133. package/esm2022/lib/stores/signal.store.mjs +0 -81
  134. package/esm2022/lib/stores/store.mjs +0 -423
  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/safe-detect-changes.mjs +0 -15
  138. package/esm2022/lib/utils/signal.mjs +0 -24
  139. package/esm2022/lib/utils/timing.mjs +0 -21
  140. package/lib/di/catalogue.d.ts +0 -3
  141. package/lib/di/ref.d.ts +0 -7
  142. package/lib/directives/common.d.ts +0 -11
  143. package/lib/directives/parent.d.ts +0 -11
  144. package/lib/directives/repeat.d.ts +0 -7
  145. package/lib/renderer/di.d.ts +0 -2
  146. package/lib/renderer/enums.d.ts +0 -26
  147. package/lib/renderer/provider.d.ts +0 -8
  148. package/lib/renderer/store.d.ts +0 -63
  149. package/lib/stores/signal.store.d.ts +0 -20
  150. package/lib/stores/store.d.ts +0 -13
  151. package/lib/utils/assert-in-injection-context.d.ts +0 -2
  152. package/lib/utils/instance.d.ts +0 -4
  153. package/lib/utils/safe-detect-changes.d.ts +0 -2
  154. package/lib/utils/signal.d.ts +0 -2
  155. package/lib/utils/timing.d.ts +0 -4
  156. package/plugin/src/generators/init/init.d.ts +0 -5
  157. package/plugin/src/generators/init/init.js +0 -56
  158. package/plugin/src/generators/init/init.js.map +0 -1
  159. /package/lib/{di → utils}/before-render.d.ts +0 -0
package/README.md CHANGED
@@ -1,150 +1,224 @@
1
- # Angular Renderer for THREE.js
1
+ # `angular-three`
2
2
 
3
- [![From Vietnam with <3](https://raw.githubusercontent.com/webuild-community/badge/master/svg/love.svg)](https://webuild.community)
3
+ A custom Renderer for Angular 18+ that uses Three.js to render 3D scenes.
4
4
 
5
- Leverage your [Angular](https://angular.io) to build 3D applications with [THREE.js](https://threejs.org)
5
+ ## Compatibility
6
+
7
+ Angular Three v2 is still in beta and aims to be compatible with Angular 17+.
6
8
 
7
9
  ## Installation
8
10
 
9
- ### Angular CLI
11
+ ```bash
12
+ npm install angular-three@beta ngxtension three
13
+ # yarn add angular-three@beta ngxtension three
14
+ # pnpm add angular-three@beta ngxtension three
15
+ ```
16
+
17
+ > Make sure to install `@types/three` as well
18
+
19
+ ## Usage
20
+
21
+ ```typescript
22
+ import { extend } from 'angular-three';
23
+ import { Mesh, BoxGeometry } from 'three';
24
+
25
+ extend({
26
+ Mesh, // makes ngt-mesh available
27
+ BoxGeometry, // makes ngt-box-geometry available
28
+ /* ... */
29
+ MyMesh: Mesh, // makes ngt-my-mesh available
30
+ });
10
31
 
11
- ```shell
12
- npx ng add angular-three
32
+ // alternatively for demo purposes, you can use the following
33
+ // extend(THREE);
34
+ // This includes the entire THREE.js namespace
35
+
36
+ @Component({
37
+ // This Component is rendered in the Custom Renderer
38
+ standalone: true,
39
+ template: `
40
+ <ngt-mesh>
41
+ <ngt-box-geometry />
42
+ </ngt-mesh>
43
+ `,
44
+ schemas: [CUSTOM_ELEMENTS_SCHEMA], // required
45
+ changeDetection: ChangeDetectionStrategy.OnPush,
46
+ })
47
+ export class SceneGraph {}
48
+
49
+ @Component({
50
+ // This Component is rendered normally in Angular.
51
+ selector: 'app-my-experience',
52
+ standalone: true,
53
+ template: `
54
+ <ngt-canvas [sceneGraph]="SceneGraph" />
55
+ `,
56
+ imports: [NgtCanvas],
57
+ })
58
+ export class MyExperience {
59
+ SceneGraph = SceneGraph;
60
+ }
13
61
  ```
14
62
 
15
- ### Nx
63
+ > The Component that renders `NgtCanvas` (`MyExperience` in this case) controls the dimensions of the canvas so make sure to style it accordingly.
64
+
65
+ ### Inputs
66
+
67
+ - `sceneGraph: Type<any>`: **required**. This is the Component that renders your 3D Scene graph. It must be a standalone Component.
68
+ - `gl?: NgtGLOptions`: This input allows you to configure the WebGL renderer used by Angular Three. You can provide a THREE.js renderer instance, properties for the default renderer, or a function that returns a renderer based on the canvas element.
69
+ - `size?: NgtSize`: Specifies the dimensions of the renderer. If omitted, the component will automatically measure the canvas dimensions.
70
+ - `shadows?: boolean | 'basic' | 'percentage' | 'soft' | 'variance' | Partial<WebGLShadowMap>`: Enables or disables shadows in the scene. You can provide a boolean value to toggle shadows on or off, or use specific strings to control the shadow type. Additionally, you can pass partial WebGLShadowMap options for fine-tuning.
71
+ - `legacy?: boolean`: Disables three r139 color management when set to true.
72
+ - `linear?: boolean`: Switches off automatic sRGB color space and gamma correction when set to true.
73
+ - `flat?: boolean`: Uses THREE.NoToneMapping instead of THREE.ACESFilmicToneMapping when set to true.
74
+ - `orthographic?: boolean`: Creates an orthographic camera instead of a perspective camera when set to true.
75
+ - `frameloop?: 'always' | 'demand' | 'never'`: Controls the rendering mode. 'always' renders continuously, 'demand' renders only on state changes, and 'never' gives you manual control over rendering.
76
+ - `performance?: Partial<Omit<NgtPerformance, 'regress'>>`: Allows you to configure performance options for adaptive performance.
77
+ - `dpr?: NgtDpr`: Sets the target pixel ratio. You can provide a single number or a range [min, max].
78
+ - `raycaster?: Partial<Raycaster>`: Configures the default raycaster used for interaction.
79
+ - `scene?: Scene | Partial<Scene>`: Provides a THREE.js scene instance or properties to create a default scene.
80
+ - `camera?: NgtCamera | Partial<NgtObject3DNode<Camera>>`: Provides a THREE.js camera instance or properties to create a default camera. You can also set the manual property to true to take control of the camera projection.
81
+ - `events?: (store: NgtSignalStore<NgtState>) => NgtEventManager<HTMLElement>`: Allows you to customize the event manager for handling pointer events.
82
+ - `eventSource?: HTMLElement | ElementRef<HTMLElement>`: Specifies the target element where events are subscribed. By default, it's the div wrapping the canvas.
83
+ - `eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen'`: Sets the event prefix used for canvas pointer events.
84
+ - `lookAt?: Vector3 | Parameters<Vector3['set']>`: Defines the default coordinate for the camera to look at.
85
+
86
+ ### Outputs
87
+
88
+ - `created`: Emitted when the canvas is created.
89
+ - `pointerMissed`: Emitted when a pointer event is not captured by any element (aka clicking on the canvas)
90
+
91
+ ## Intellisense support
92
+
93
+ Since Angular Three is a custom Renderer, the elements are not recognized by the Angular Language Service.
94
+
95
+ ### Jetbrains IDE
96
+
97
+ The consumers can add `web-types` property to the workspace's `package.json` and set the value to `node_modules/angular-three/web-types.json`.
98
+
99
+ ```json
100
+ {
101
+ "web-types": "node_modules/angular-three/web-types.json"
102
+ }
103
+ ```
104
+
105
+ ### VSCode
106
+
107
+ Similarly, there's `node_modules/angular-three/metadata.json` file that can be used to provide intellisense support for VSCode users.
108
+
109
+ The consumers can enable it via `html.customData` in their `settings.json` file.
16
110
 
17
- ```shell
18
- npm i angular-three
19
- npx nx g angular-three:init
111
+ ```json
112
+ {
113
+ "html.customData": ["node_modules/angular-three/metadata.json"]
114
+ }
20
115
  ```
21
116
 
22
- ### Manual
117
+ ## Input Bindings
118
+
119
+ Input bindings for `ngt-*` elements work the same way as they do in Angular.
23
120
 
24
- ```shell
25
- npm i angular-three three
121
+ > You can consult THREE.js documentation on what is available on the entities
122
+
123
+ ```html
124
+ <ngt-mesh [position]="[x, y, z]" [rotation]="[x, y, z]">
125
+ <ngt-mesh-basic-material color="hotpink" />
126
+ </ngt-mesh>
26
127
  ```
27
128
 
28
- ```shell
29
- npm i -D @types/three
129
+ ## Events
130
+
131
+ Angular Three Custom Renderer supports the following events on applicable objects (`ngt-mesh`, `ngt-group` etc...)
132
+
133
+ ```
134
+ 'click',
135
+ 'contextmenu',
136
+ 'dblclick',
137
+ 'pointerup',
138
+ 'pointerdown',
139
+ 'pointerover',
140
+ 'pointerout',
141
+ 'pointerenter',
142
+ 'pointerleave',
143
+ 'pointermove',
144
+ 'pointermissed',
145
+ 'pointercancel',
146
+ 'wheel',
30
147
  ```
31
148
 
32
- - Adjust `tsconfig.json` (or `tsconfig.base.json`) to include `skipTypeCheck: false`
149
+ In addition, there are 2 special events that the consumers can listen to;
33
150
 
34
- > Typically, we'd want to keep `three` and `@types/three` on the same minor version. Eg: `0.147`, `0.148` etc..
151
+ - `attached`: when the element is attached to its parent
152
+ - `updated`: when the element properties are updated
35
153
 
36
- ## Type
154
+ ## Constructor Arguments
37
155
 
38
- ### VSCode
156
+ In THREE.js, there are some entities that require the consumers to dispose and recreate them if their parameters change; like the Geometries.
39
157
 
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
- }
158
+ To handle this, Angular Three exports a `NgtArgs` structural directive that always accepts an Array of values. The consumers can consult THREE.js documentations to know what values are applicable for what entities and their order.
159
+
160
+ ```html
161
+ <!-- for example, new BoxGeometry(width, height, depth) -->
162
+ <ngt-box-geometry *args="[width, height, depth]" />
107
163
  ```
108
164
 
109
- ## Documentations
165
+ `NgtArgs`, as a structural directive, ensures to create a new instance of the entity when the value changes
110
166
 
111
- Read more about Angular Three usages in [Documentations](https://angular-three-backupjs.netlify.app)
167
+ ## Parameters
112
168
 
113
- ## Simple usage
169
+ Beside the normal properties that `ngt-*` elements can accept for Input bindings, the consumers can also pass a `parameters` object to a special property `[parameters]` on the elements. This parameters object will be used to apply the properties on the entity.
114
170
 
115
- 1. Create a `Scene` component as a Standalone Component
171
+ ```html
172
+ <!-- instead of <ngt-mesh [position]="[x, y, z]" [scale]="scale" /> -->
173
+ <ngt-mesh [parameters]="{ position: [x, y, z], scale }" />
174
+ ```
116
175
 
117
- ```ts
118
- import { extend } from 'angular-three';
119
- import { Mesh, BoxGeometry, MeshBasicMaterial } from 'three';
176
+ ## Element Queries
120
177
 
121
- extend({ Mesh, BoxGeometry, MeshBasicMaterial });
178
+ The consumers can query for the THREE.js entities like they would do in normal HTML Angular Template.
122
179
 
180
+ ```ts
123
181
  @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],
182
+ template: `
183
+ <ngt-mesh #mesh></ngt-mesh>
184
+ `,
132
185
  })
133
- export class Scene {}
186
+ export class Box {
187
+ mesh = viewChild.required<ElementRef<Mesh>>('mesh');
188
+ // notice that it is an ElementRef of THREE.Mesh instead of an HTMLElement
189
+ }
134
190
  ```
135
191
 
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
192
+ ## Animation Loop
139
193
 
140
- 2. Render `<ngt-canvas>` component, use `Scene` component above to pass into `[sceneGraph]` input on `<ngt-canvas>`
194
+ In order to participate in the animation loop, use `injectBeforeRender` inject function
141
195
 
142
- ```html
143
- <ngt-canvas [sceneGraph]="Scene" />
196
+ ```ts
197
+ @Component({
198
+ /*...*/
199
+ })
200
+ export class Box {
201
+ mesh = viewChild.required<ElementRef<Mesh>>('mesh');
202
+
203
+ constructor() {
204
+ injectBeforeRender(() => {
205
+ // runs every frame
206
+ const mesh = this.mesh().nativeElement;
207
+ mesh.rotation.x += 0.01;
208
+ });
209
+ }
210
+ }
144
211
  ```
145
212
 
146
- - `ngt-canvas` creates the basic building blocks of THREE.js: a default `WebGLRenderer`, a default `Scene`, and a default `PerspectiveCamera`
213
+ ## Store
147
214
 
148
- ## Contributions
215
+ Angular Three keeps track of its state via an internal store. The consumers can access this store via the `injectStore` inject function
149
216
 
150
- Contributions are welcomed
217
+ ```ts
218
+ export class Box {
219
+ store = injectStore();
220
+ viewport = this.store.select('viewport'); // Signal<NgtViewport>
221
+ camera = this.store.select('camera'); // Signal<NgtCamera> - the default camera
222
+ /* many more properties */
223
+ }
224
+ ```
@@ -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
1
  export * from './lib/canvas';
2
- export * from './lib/di/before-render';
3
- export * from './lib/di/catalogue';
4
- export * from './lib/di/ref';
5
2
  export * from './lib/directives/args';
6
- export * from './lib/directives/parent';
7
- export * from './lib/directives/repeat';
3
+ export * from './lib/directives/selection';
4
+ export * from './lib/html';
5
+ export * from './lib/instance';
8
6
  export * from './lib/loader';
9
- export { addAfterEffect, addEffect, addTail } from './lib/loop';
10
- export { NgtPortal, NgtPortalContent } from './lib/portal';
7
+ export * from './lib/loop';
8
+ export * from './lib/pipes/hexify';
9
+ export * from './lib/portal';
10
+ export * from './lib/renderer';
11
+ export * from './lib/roots';
11
12
  export * from './lib/routed-scene';
12
- export * from './lib/stores/signal.store';
13
- export * from './lib/stores/store';
14
- export * from './lib/three-types';
15
- export * from './lib/types';
13
+ export * from './lib/store';
16
14
  export * from './lib/utils/apply-props';
17
- export * from './lib/utils/assert-in-injection-context';
18
- export { createAttachFunction } from './lib/utils/attach';
19
- export * from './lib/utils/instance';
15
+ export * from './lib/utils/attach';
16
+ export * from './lib/utils/before-render';
20
17
  export * from './lib/utils/is';
21
18
  export * from './lib/utils/make';
22
- export * from './lib/utils/safe-detect-changes';
23
- export * from './lib/utils/signal';
24
- export * from './lib/utils/timing';
19
+ export * from './lib/utils/non-nullish';
20
+ export * from './lib/utils/object-events';
21
+ export * from './lib/utils/parameters';
22
+ export * from './lib/utils/resolve-ref';
23
+ export * from './lib/utils/signal-store';
25
24
  export * from './lib/utils/update';
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXItdGhyZWUvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsY0FBY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