@imagineio/configurator-sdk 0.1.0-beta.1 → 0.1.0-beta.3
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/LICENSE.md +294 -294
- package/README.md +7 -39
- package/dist/371ed78aa2.js +1 -1
- package/dist/4910c07ca8.css +21 -1
- package/dist/5c9fd9201c.js +1 -1
- package/dist/87bb469216.js +1 -1
- package/dist/8a22e8944f.css +11 -0
- package/dist/98f3644031.js +1 -1
- package/dist/ab6c80484f.js +1 -1
- package/dist/baeaed46c9.js +1 -1
- package/package.json +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,294 +1,294 @@
|
|
|
1
|
-
PROPRIETARY SOFTWARE LICENCE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 imagine.io. All rights reserved.
|
|
4
|
-
|
|
5
|
-
This software and its accompanying files (the "Software") are the confidential
|
|
6
|
-
and proprietary property of imagine.io. The Software is licensed, not sold.
|
|
7
|
-
|
|
8
|
-
1. GRANT. Subject to a separate written agreement with imagine.io ("Agreement"),
|
|
9
|
-
and only for the term and scope that Agreement states, you are granted a
|
|
10
|
-
non-exclusive, non-transferable, revocable right to install and use the
|
|
11
|
-
Software solely to build and operate your own application. Absent such an
|
|
12
|
-
Agreement, no rights are granted and any use is unauthorised.
|
|
13
|
-
|
|
14
|
-
2. RESTRICTIONS. You may not, in whole or in part: (a) copy, publish,
|
|
15
|
-
redistribute, sublicense, sell, rent, or lease the Software; (b) reverse
|
|
16
|
-
engineer, decompile, deobfuscate, or otherwise attempt to derive source code,
|
|
17
|
-
except to the extent this restriction is unenforceable under applicable law;
|
|
18
|
-
(c) modify, adapt, or create derivative works, including patching, hot-
|
|
19
|
-
patching, or runtime monkey-patching of the distributed files; (d) remove,
|
|
20
|
-
obscure, or alter any proprietary notice, attribution, watermark, licence
|
|
21
|
-
check, or integrity mechanism; (e) use the Software to build a product that
|
|
22
|
-
competes with imagine.io; or (f) permit any third party to do the foregoing.
|
|
23
|
-
|
|
24
|
-
3. NO OPEN SOURCE. Minification, bundling, or obfuscation of the distributed
|
|
25
|
-
files is a technical measure, not a grant. The absence of readable source
|
|
26
|
-
does not imply permission, and the presence of readable source does not
|
|
27
|
-
waive any restriction in Section 2.
|
|
28
|
-
|
|
29
|
-
4. OWNERSHIP. imagine.io retains all right, title, and interest in the Software,
|
|
30
|
-
including all intellectual property rights. No rights are granted by
|
|
31
|
-
implication, estoppel, or otherwise.
|
|
32
|
-
|
|
33
|
-
5. TERMINATION. This licence terminates automatically and immediately upon any
|
|
34
|
-
breach of Section 2, or upon termination of the Agreement. On termination you
|
|
35
|
-
must cease all use and destroy all copies.
|
|
36
|
-
|
|
37
|
-
6. NO WARRANTY. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
38
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
39
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
40
|
-
|
|
41
|
-
7. LIMITATION OF LIABILITY. IN NO EVENT SHALL IMAGINE.IO BE LIABLE FOR ANY
|
|
42
|
-
CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT,
|
|
43
|
-
OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
44
|
-
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
45
|
-
|
|
46
|
-
8. THIRD-PARTY SOFTWARE. This package contains and depends on third-party
|
|
47
|
-
software licensed separately from this licence. That software remains subject
|
|
48
|
-
to its own terms, which this licence does not modify or override. Appendix A
|
|
49
|
-
gives the notice required by the one component redistributed inside this
|
|
50
|
-
package; Appendix B is the full text of the licence that component carries.
|
|
51
|
-
|
|
52
|
-
================================================================================
|
|
53
|
-
APPENDIX A — THIRD-PARTY NOTICE
|
|
54
|
-
================================================================================
|
|
55
|
-
|
|
56
|
-
One component requires attribution: it is the only third-party code shipped
|
|
57
|
-
INSIDE this package, so its licence terms bind us directly and the notice has to
|
|
58
|
-
travel with the package.
|
|
59
|
-
|
|
60
|
-
Nothing else is listed because nothing else is redistributed. The build compiles
|
|
61
|
-
each of our own files in place (bundle: false) and follows nothing, so no
|
|
62
|
-
dependency code is copied into dist/. Every dependency arrives in the consumer's
|
|
63
|
-
own node_modules carrying its own licence file, which is what satisfies its
|
|
64
|
-
terms — there is no obligation here for this file to discharge.
|
|
65
|
-
|
|
66
|
-
--------------------------------------------------------------------------------
|
|
67
|
-
GOOGLE DRACO
|
|
68
|
-
--------------------------------------------------------------------------------
|
|
69
|
-
|
|
70
|
-
static/assets/draco/ — the Draco decoder and encoder builds
|
|
71
|
-
(draco_decoder.js, draco_decoder.wasm, draco_encoder.js,
|
|
72
|
-
draco_encoder_wrapper.js, draco_wasm_wrapper.js), used to decompress
|
|
73
|
-
KHR_draco_mesh_compression geometry and to compress the AR export.
|
|
74
|
-
|
|
75
|
-
Project: https://github.com/google/draco
|
|
76
|
-
Copyright: The Draco Authors
|
|
77
|
-
Licence: Apache License, Version 2.0
|
|
78
|
-
|
|
79
|
-
A copy of the Apache License 2.0 is reproduced in Appendix B of this file, as
|
|
80
|
-
required by section 4(a) of that licence. You may not use these files except
|
|
81
|
-
in compliance with the License. Unless required by applicable law or agreed to
|
|
82
|
-
in writing, software distributed under the License is distributed on an
|
|
83
|
-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
84
|
-
implied.
|
|
85
|
-
|
|
86
|
-
UNMODIFIED. These are prebuilt binaries vendored from a three.js distribution
|
|
87
|
-
(three/examples/jsm/libs/draco/); the accompanying README.md is Google's, word
|
|
88
|
-
for word, differing only where a repo-wide Markdown formatter changed bullet
|
|
89
|
-
characters and quote style. Every binary is byte-identical to the day it
|
|
90
|
-
entered version control — nothing here is a modified build, so the
|
|
91
|
-
statement-of-changes requirement in section 4(b) of the Apache License does
|
|
92
|
-
not arise. If a Draco build is ever rebuilt or patched, that changes and this
|
|
93
|
-
paragraph must be replaced with a description of the changes.
|
|
94
|
-
|
|
95
|
-
--------------------------------------------------------------------------------
|
|
96
|
-
MAINTAINING THIS APPENDIX
|
|
97
|
-
--------------------------------------------------------------------------------
|
|
98
|
-
|
|
99
|
-
What triggers an entry is a file being COPIED INTO this package from a
|
|
100
|
-
third-party project — not a dependency being added, which changes nothing here.
|
|
101
|
-
If a newly vendored component's licence requires its full text to be
|
|
102
|
-
distributed, that text goes into a further appendix of this file, as Apache-2.0
|
|
103
|
-
does in Appendix B.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
================================================================================
|
|
107
|
-
APPENDIX B — APACHE LICENSE, VERSION 2.0
|
|
108
|
-
================================================================================
|
|
109
|
-
|
|
110
|
-
Reproduced in full for the component named in Appendix A. This licence applies
|
|
111
|
-
to that component ONLY, and grants no rights in the rest of the Software.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Apache License
|
|
115
|
-
Version 2.0, January 2004
|
|
116
|
-
http://www.apache.org/licenses/
|
|
117
|
-
|
|
118
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
119
|
-
|
|
120
|
-
1. Definitions.
|
|
121
|
-
|
|
122
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
123
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
124
|
-
|
|
125
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
126
|
-
the copyright owner that is granting the License.
|
|
127
|
-
|
|
128
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
129
|
-
other entities that control, are controlled by, or are under common
|
|
130
|
-
control with that entity. For the purposes of this definition,
|
|
131
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
132
|
-
direction or management of such entity, whether by contract or
|
|
133
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
134
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
135
|
-
|
|
136
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
137
|
-
exercising permissions granted by this License.
|
|
138
|
-
|
|
139
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
140
|
-
including but not limited to software source code, documentation
|
|
141
|
-
source, and configuration files.
|
|
142
|
-
|
|
143
|
-
"Object" form shall mean any form resulting from mechanical
|
|
144
|
-
transformation or translation of a Source form, including but
|
|
145
|
-
not limited to compiled object code, generated documentation,
|
|
146
|
-
and conversions to other media types.
|
|
147
|
-
|
|
148
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
149
|
-
Object form, made available under the License, as indicated by a
|
|
150
|
-
copyright notice that is included in or attached to the work
|
|
151
|
-
(an example is provided in the Appendix below).
|
|
152
|
-
|
|
153
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
154
|
-
form, that is based on (or derived from) the Work and for which the
|
|
155
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
156
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
157
|
-
of this License, Derivative Works shall not include works that remain
|
|
158
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
159
|
-
the Work and Derivative Works thereof.
|
|
160
|
-
|
|
161
|
-
"Contribution" shall mean any work of authorship, including
|
|
162
|
-
the original version of the Work and any modifications or additions
|
|
163
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
164
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
165
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
166
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
167
|
-
means any form of electronic, verbal, or written communication sent
|
|
168
|
-
to the Licensor or its representatives, including but not limited to
|
|
169
|
-
communication on electronic mailing lists, source code control systems,
|
|
170
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
171
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
172
|
-
excluding communication that is conspicuously marked or otherwise
|
|
173
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
174
|
-
|
|
175
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
176
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
177
|
-
subsequently incorporated within the Work.
|
|
178
|
-
|
|
179
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
180
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
181
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
182
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
183
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
184
|
-
Work and such Derivative Works in Source or Object form.
|
|
185
|
-
|
|
186
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
187
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
188
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
189
|
-
(except as stated in this section) patent license to make, have made,
|
|
190
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
191
|
-
where such license applies only to those patent claims licensable
|
|
192
|
-
by such Contributor that are necessarily infringed by their
|
|
193
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
194
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
195
|
-
institute patent litigation against any entity (including a
|
|
196
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
197
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
198
|
-
or contributory patent infringement, then any patent licenses
|
|
199
|
-
granted to You under this License for that Work shall terminate
|
|
200
|
-
as of the date such litigation is filed.
|
|
201
|
-
|
|
202
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
203
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
204
|
-
modifications, and in Source or Object form, provided that You
|
|
205
|
-
meet the following conditions:
|
|
206
|
-
|
|
207
|
-
(a) You must give any other recipients of the Work or
|
|
208
|
-
Derivative Works a copy of this License; and
|
|
209
|
-
|
|
210
|
-
(b) You must cause any modified files to carry prominent notices
|
|
211
|
-
stating that You changed the files; and
|
|
212
|
-
|
|
213
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
214
|
-
that You distribute, all copyright, patent, trademark, and
|
|
215
|
-
attribution notices from the Source form of the Work,
|
|
216
|
-
excluding those notices that do not pertain to any part of
|
|
217
|
-
the Derivative Works; and
|
|
218
|
-
|
|
219
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
220
|
-
distribution, then any Derivative Works that You distribute must
|
|
221
|
-
include a readable copy of the attribution notices contained
|
|
222
|
-
within such NOTICE file, excluding those notices that do not
|
|
223
|
-
pertain to any part of the Derivative Works, in at least one
|
|
224
|
-
of the following places: within a NOTICE text file distributed
|
|
225
|
-
as part of the Derivative Works; within the Source form or
|
|
226
|
-
documentation, if provided along with the Derivative Works; or,
|
|
227
|
-
within a display generated by the Derivative Works, if and
|
|
228
|
-
wherever such third-party notices normally appear. The contents
|
|
229
|
-
of the NOTICE file are for informational purposes only and
|
|
230
|
-
do not modify the License. You may add Your own attribution
|
|
231
|
-
notices within Derivative Works that You distribute, alongside
|
|
232
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
233
|
-
that such additional attribution notices cannot be construed
|
|
234
|
-
as modifying the License.
|
|
235
|
-
|
|
236
|
-
You may add Your own copyright statement to Your modifications and
|
|
237
|
-
may provide additional or different license terms and conditions
|
|
238
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
239
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
240
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
241
|
-
the conditions stated in this License.
|
|
242
|
-
|
|
243
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
244
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
245
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
246
|
-
this License, without any additional terms or conditions.
|
|
247
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
248
|
-
the terms of any separate license agreement you may have executed
|
|
249
|
-
with Licensor regarding such Contributions.
|
|
250
|
-
|
|
251
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
252
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
253
|
-
except as required for reasonable and customary use in describing the
|
|
254
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
255
|
-
|
|
256
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
257
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
258
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
259
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
260
|
-
implied, including, without limitation, any warranties or conditions
|
|
261
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
262
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
263
|
-
appropriateness of using or redistributing the Work and assume any
|
|
264
|
-
risks associated with Your exercise of permissions under this License.
|
|
265
|
-
|
|
266
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
267
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
268
|
-
unless required by applicable law (such as deliberate and grossly
|
|
269
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
270
|
-
liable to You for damages, including any direct, indirect, special,
|
|
271
|
-
incidental, or consequential damages of any character arising as a
|
|
272
|
-
result of this License or out of the use or inability to use the
|
|
273
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
274
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
275
|
-
other commercial damages or losses), even if such Contributor
|
|
276
|
-
has been advised of the possibility of such damages.
|
|
277
|
-
|
|
278
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
279
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
280
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
281
|
-
or other liability obligations and/or rights consistent with this
|
|
282
|
-
License. However, in accepting such obligations, You may act only
|
|
283
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
284
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
285
|
-
defend, and hold each Contributor harmless for any liability
|
|
286
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
287
|
-
of your accepting any such warranty or additional liability.
|
|
288
|
-
|
|
289
|
-
END OF TERMS AND CONDITIONS
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
================================================================================
|
|
293
|
-
|
|
294
|
-
For licensing enquiries: legal@imagine.io
|
|
1
|
+
PROPRIETARY SOFTWARE LICENCE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 imagine.io. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and its accompanying files (the "Software") are the confidential
|
|
6
|
+
and proprietary property of imagine.io. The Software is licensed, not sold.
|
|
7
|
+
|
|
8
|
+
1. GRANT. Subject to a separate written agreement with imagine.io ("Agreement"),
|
|
9
|
+
and only for the term and scope that Agreement states, you are granted a
|
|
10
|
+
non-exclusive, non-transferable, revocable right to install and use the
|
|
11
|
+
Software solely to build and operate your own application. Absent such an
|
|
12
|
+
Agreement, no rights are granted and any use is unauthorised.
|
|
13
|
+
|
|
14
|
+
2. RESTRICTIONS. You may not, in whole or in part: (a) copy, publish,
|
|
15
|
+
redistribute, sublicense, sell, rent, or lease the Software; (b) reverse
|
|
16
|
+
engineer, decompile, deobfuscate, or otherwise attempt to derive source code,
|
|
17
|
+
except to the extent this restriction is unenforceable under applicable law;
|
|
18
|
+
(c) modify, adapt, or create derivative works, including patching, hot-
|
|
19
|
+
patching, or runtime monkey-patching of the distributed files; (d) remove,
|
|
20
|
+
obscure, or alter any proprietary notice, attribution, watermark, licence
|
|
21
|
+
check, or integrity mechanism; (e) use the Software to build a product that
|
|
22
|
+
competes with imagine.io; or (f) permit any third party to do the foregoing.
|
|
23
|
+
|
|
24
|
+
3. NO OPEN SOURCE. Minification, bundling, or obfuscation of the distributed
|
|
25
|
+
files is a technical measure, not a grant. The absence of readable source
|
|
26
|
+
does not imply permission, and the presence of readable source does not
|
|
27
|
+
waive any restriction in Section 2.
|
|
28
|
+
|
|
29
|
+
4. OWNERSHIP. imagine.io retains all right, title, and interest in the Software,
|
|
30
|
+
including all intellectual property rights. No rights are granted by
|
|
31
|
+
implication, estoppel, or otherwise.
|
|
32
|
+
|
|
33
|
+
5. TERMINATION. This licence terminates automatically and immediately upon any
|
|
34
|
+
breach of Section 2, or upon termination of the Agreement. On termination you
|
|
35
|
+
must cease all use and destroy all copies.
|
|
36
|
+
|
|
37
|
+
6. NO WARRANTY. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
38
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
39
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
40
|
+
|
|
41
|
+
7. LIMITATION OF LIABILITY. IN NO EVENT SHALL IMAGINE.IO BE LIABLE FOR ANY
|
|
42
|
+
CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT,
|
|
43
|
+
OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
44
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
45
|
+
|
|
46
|
+
8. THIRD-PARTY SOFTWARE. This package contains and depends on third-party
|
|
47
|
+
software licensed separately from this licence. That software remains subject
|
|
48
|
+
to its own terms, which this licence does not modify or override. Appendix A
|
|
49
|
+
gives the notice required by the one component redistributed inside this
|
|
50
|
+
package; Appendix B is the full text of the licence that component carries.
|
|
51
|
+
|
|
52
|
+
================================================================================
|
|
53
|
+
APPENDIX A — THIRD-PARTY NOTICE
|
|
54
|
+
================================================================================
|
|
55
|
+
|
|
56
|
+
One component requires attribution: it is the only third-party code shipped
|
|
57
|
+
INSIDE this package, so its licence terms bind us directly and the notice has to
|
|
58
|
+
travel with the package.
|
|
59
|
+
|
|
60
|
+
Nothing else is listed because nothing else is redistributed. The build compiles
|
|
61
|
+
each of our own files in place (bundle: false) and follows nothing, so no
|
|
62
|
+
dependency code is copied into dist/. Every dependency arrives in the consumer's
|
|
63
|
+
own node_modules carrying its own licence file, which is what satisfies its
|
|
64
|
+
terms — there is no obligation here for this file to discharge.
|
|
65
|
+
|
|
66
|
+
--------------------------------------------------------------------------------
|
|
67
|
+
GOOGLE DRACO
|
|
68
|
+
--------------------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
static/assets/draco/ — the Draco decoder and encoder builds
|
|
71
|
+
(draco_decoder.js, draco_decoder.wasm, draco_encoder.js,
|
|
72
|
+
draco_encoder_wrapper.js, draco_wasm_wrapper.js), used to decompress
|
|
73
|
+
KHR_draco_mesh_compression geometry and to compress the AR export.
|
|
74
|
+
|
|
75
|
+
Project: https://github.com/google/draco
|
|
76
|
+
Copyright: The Draco Authors
|
|
77
|
+
Licence: Apache License, Version 2.0
|
|
78
|
+
|
|
79
|
+
A copy of the Apache License 2.0 is reproduced in Appendix B of this file, as
|
|
80
|
+
required by section 4(a) of that licence. You may not use these files except
|
|
81
|
+
in compliance with the License. Unless required by applicable law or agreed to
|
|
82
|
+
in writing, software distributed under the License is distributed on an
|
|
83
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
84
|
+
implied.
|
|
85
|
+
|
|
86
|
+
UNMODIFIED. These are prebuilt binaries vendored from a three.js distribution
|
|
87
|
+
(three/examples/jsm/libs/draco/); the accompanying README.md is Google's, word
|
|
88
|
+
for word, differing only where a repo-wide Markdown formatter changed bullet
|
|
89
|
+
characters and quote style. Every binary is byte-identical to the day it
|
|
90
|
+
entered version control — nothing here is a modified build, so the
|
|
91
|
+
statement-of-changes requirement in section 4(b) of the Apache License does
|
|
92
|
+
not arise. If a Draco build is ever rebuilt or patched, that changes and this
|
|
93
|
+
paragraph must be replaced with a description of the changes.
|
|
94
|
+
|
|
95
|
+
--------------------------------------------------------------------------------
|
|
96
|
+
MAINTAINING THIS APPENDIX
|
|
97
|
+
--------------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
What triggers an entry is a file being COPIED INTO this package from a
|
|
100
|
+
third-party project — not a dependency being added, which changes nothing here.
|
|
101
|
+
If a newly vendored component's licence requires its full text to be
|
|
102
|
+
distributed, that text goes into a further appendix of this file, as Apache-2.0
|
|
103
|
+
does in Appendix B.
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
================================================================================
|
|
107
|
+
APPENDIX B — APACHE LICENSE, VERSION 2.0
|
|
108
|
+
================================================================================
|
|
109
|
+
|
|
110
|
+
Reproduced in full for the component named in Appendix A. This licence applies
|
|
111
|
+
to that component ONLY, and grants no rights in the rest of the Software.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
Apache License
|
|
115
|
+
Version 2.0, January 2004
|
|
116
|
+
http://www.apache.org/licenses/
|
|
117
|
+
|
|
118
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
119
|
+
|
|
120
|
+
1. Definitions.
|
|
121
|
+
|
|
122
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
123
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
124
|
+
|
|
125
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
126
|
+
the copyright owner that is granting the License.
|
|
127
|
+
|
|
128
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
129
|
+
other entities that control, are controlled by, or are under common
|
|
130
|
+
control with that entity. For the purposes of this definition,
|
|
131
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
132
|
+
direction or management of such entity, whether by contract or
|
|
133
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
134
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
135
|
+
|
|
136
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
137
|
+
exercising permissions granted by this License.
|
|
138
|
+
|
|
139
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
140
|
+
including but not limited to software source code, documentation
|
|
141
|
+
source, and configuration files.
|
|
142
|
+
|
|
143
|
+
"Object" form shall mean any form resulting from mechanical
|
|
144
|
+
transformation or translation of a Source form, including but
|
|
145
|
+
not limited to compiled object code, generated documentation,
|
|
146
|
+
and conversions to other media types.
|
|
147
|
+
|
|
148
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
149
|
+
Object form, made available under the License, as indicated by a
|
|
150
|
+
copyright notice that is included in or attached to the work
|
|
151
|
+
(an example is provided in the Appendix below).
|
|
152
|
+
|
|
153
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
154
|
+
form, that is based on (or derived from) the Work and for which the
|
|
155
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
156
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
157
|
+
of this License, Derivative Works shall not include works that remain
|
|
158
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
159
|
+
the Work and Derivative Works thereof.
|
|
160
|
+
|
|
161
|
+
"Contribution" shall mean any work of authorship, including
|
|
162
|
+
the original version of the Work and any modifications or additions
|
|
163
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
164
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
165
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
166
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
167
|
+
means any form of electronic, verbal, or written communication sent
|
|
168
|
+
to the Licensor or its representatives, including but not limited to
|
|
169
|
+
communication on electronic mailing lists, source code control systems,
|
|
170
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
171
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
172
|
+
excluding communication that is conspicuously marked or otherwise
|
|
173
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
174
|
+
|
|
175
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
176
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
177
|
+
subsequently incorporated within the Work.
|
|
178
|
+
|
|
179
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
180
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
181
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
182
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
183
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
184
|
+
Work and such Derivative Works in Source or Object form.
|
|
185
|
+
|
|
186
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
187
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
188
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
189
|
+
(except as stated in this section) patent license to make, have made,
|
|
190
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
191
|
+
where such license applies only to those patent claims licensable
|
|
192
|
+
by such Contributor that are necessarily infringed by their
|
|
193
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
194
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
195
|
+
institute patent litigation against any entity (including a
|
|
196
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
197
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
198
|
+
or contributory patent infringement, then any patent licenses
|
|
199
|
+
granted to You under this License for that Work shall terminate
|
|
200
|
+
as of the date such litigation is filed.
|
|
201
|
+
|
|
202
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
203
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
204
|
+
modifications, and in Source or Object form, provided that You
|
|
205
|
+
meet the following conditions:
|
|
206
|
+
|
|
207
|
+
(a) You must give any other recipients of the Work or
|
|
208
|
+
Derivative Works a copy of this License; and
|
|
209
|
+
|
|
210
|
+
(b) You must cause any modified files to carry prominent notices
|
|
211
|
+
stating that You changed the files; and
|
|
212
|
+
|
|
213
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
214
|
+
that You distribute, all copyright, patent, trademark, and
|
|
215
|
+
attribution notices from the Source form of the Work,
|
|
216
|
+
excluding those notices that do not pertain to any part of
|
|
217
|
+
the Derivative Works; and
|
|
218
|
+
|
|
219
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
220
|
+
distribution, then any Derivative Works that You distribute must
|
|
221
|
+
include a readable copy of the attribution notices contained
|
|
222
|
+
within such NOTICE file, excluding those notices that do not
|
|
223
|
+
pertain to any part of the Derivative Works, in at least one
|
|
224
|
+
of the following places: within a NOTICE text file distributed
|
|
225
|
+
as part of the Derivative Works; within the Source form or
|
|
226
|
+
documentation, if provided along with the Derivative Works; or,
|
|
227
|
+
within a display generated by the Derivative Works, if and
|
|
228
|
+
wherever such third-party notices normally appear. The contents
|
|
229
|
+
of the NOTICE file are for informational purposes only and
|
|
230
|
+
do not modify the License. You may add Your own attribution
|
|
231
|
+
notices within Derivative Works that You distribute, alongside
|
|
232
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
233
|
+
that such additional attribution notices cannot be construed
|
|
234
|
+
as modifying the License.
|
|
235
|
+
|
|
236
|
+
You may add Your own copyright statement to Your modifications and
|
|
237
|
+
may provide additional or different license terms and conditions
|
|
238
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
239
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
240
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
241
|
+
the conditions stated in this License.
|
|
242
|
+
|
|
243
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
244
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
245
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
246
|
+
this License, without any additional terms or conditions.
|
|
247
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
248
|
+
the terms of any separate license agreement you may have executed
|
|
249
|
+
with Licensor regarding such Contributions.
|
|
250
|
+
|
|
251
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
252
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
253
|
+
except as required for reasonable and customary use in describing the
|
|
254
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
255
|
+
|
|
256
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
257
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
258
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
259
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
260
|
+
implied, including, without limitation, any warranties or conditions
|
|
261
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
262
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
263
|
+
appropriateness of using or redistributing the Work and assume any
|
|
264
|
+
risks associated with Your exercise of permissions under this License.
|
|
265
|
+
|
|
266
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
267
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
268
|
+
unless required by applicable law (such as deliberate and grossly
|
|
269
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
270
|
+
liable to You for damages, including any direct, indirect, special,
|
|
271
|
+
incidental, or consequential damages of any character arising as a
|
|
272
|
+
result of this License or out of the use or inability to use the
|
|
273
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
274
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
275
|
+
other commercial damages or losses), even if such Contributor
|
|
276
|
+
has been advised of the possibility of such damages.
|
|
277
|
+
|
|
278
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
279
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
280
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
281
|
+
or other liability obligations and/or rights consistent with this
|
|
282
|
+
License. However, in accepting such obligations, You may act only
|
|
283
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
284
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
285
|
+
defend, and hold each Contributor harmless for any liability
|
|
286
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
287
|
+
of your accepting any such warranty or additional liability.
|
|
288
|
+
|
|
289
|
+
END OF TERMS AND CONDITIONS
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
================================================================================
|
|
293
|
+
|
|
294
|
+
For licensing enquiries: legal@imagine.io
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @imagine/configurator-sdk
|
|
2
2
|
|
|
3
3
|
Build a 3D product configurator and make it yours. One publishable engine — scene,
|
|
4
4
|
options, pricing, save/share, AR, AI chat — driven entirely by your backend: data
|
|
@@ -15,7 +15,7 @@ Vite template scaffolds React 19, which the SDK's 3D stack doesn't support yet
|
|
|
15
15
|
fails with `ERESOLVE`:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install @
|
|
18
|
+
npm install @imagine/configurator-sdk react@^18.2 react-dom@^18.2
|
|
19
19
|
npm install -D @types/react@^18.3 @types/react-dom@^18.3 # the scaffold's are React 19's
|
|
20
20
|
```
|
|
21
21
|
|
|
@@ -28,14 +28,14 @@ dedupes three/react for you):
|
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
30
|
// vite.config.js
|
|
31
|
-
import imagineConfigurator from '@
|
|
31
|
+
import imagineConfigurator from '@imagine/configurator-sdk/vite';
|
|
32
32
|
export default defineConfig({ plugins: [react(), imagineConfigurator()] });
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
…or follow the manual steps in the Getting Started guide.
|
|
36
36
|
|
|
37
37
|
```jsx
|
|
38
|
-
import { mount, config } from '@
|
|
38
|
+
import { mount, config } from '@imagine/configurator-sdk';
|
|
39
39
|
|
|
40
40
|
// The backend endpoint is built into the SDK — only the key is yours to set.
|
|
41
41
|
config.setApiKey('YOUR_ORG_API_KEY');
|
|
@@ -66,38 +66,6 @@ in `script-src` / `style-src` / `font-src`, or point the override at your own or
|
|
|
66
66
|
|
|
67
67
|
## License
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Summary, so you can see the terms before installing. This is a plain-English summary and
|
|
74
|
-
is not the licence; the full text in `LICENSE.md` governs.
|
|
75
|
-
|
|
76
|
-
**You need an agreement.** Rights are granted only under a separate written agreement
|
|
77
|
-
with imagine.io, for that agreement's term and scope. Without one, no rights are granted
|
|
78
|
-
and use is unauthorised.
|
|
79
|
-
|
|
80
|
-
**You may not:**
|
|
81
|
-
|
|
82
|
-
- copy, publish, redistribute, sublicense, sell, rent, or lease the package;
|
|
83
|
-
- reverse engineer, decompile, or deobfuscate it, or otherwise try to derive source
|
|
84
|
-
(except where that restriction is unenforceable by law);
|
|
85
|
-
- modify or create derivative works, including patching or runtime monkey-patching of
|
|
86
|
-
the distributed files;
|
|
87
|
-
- remove, obscure, or alter any proprietary notice, attribution, watermark, licence
|
|
88
|
-
check, or integrity mechanism;
|
|
89
|
-
- use it to build a product that competes with imagine.io;
|
|
90
|
-
- permit anyone else to do the above.
|
|
91
|
-
|
|
92
|
-
**Minification is not a grant.** The code ships minified as a technical measure. Unreadable
|
|
93
|
-
source does not imply permission, and readable source does not waive any restriction.
|
|
94
|
-
|
|
95
|
-
The licence terminates automatically on breach. The Software is provided "as is", without
|
|
96
|
-
warranty, and liability is limited — see `LICENSE.md` for those clauses in full.
|
|
97
|
-
|
|
98
|
-
Full text: `LICENSE.md`, shipped inside the package — readable at
|
|
99
|
-
`node_modules/@imagineio/configurator-sdk/LICENSE.md` after install. It also carries the
|
|
100
|
-
notice and Apache-2.0 text for the one third-party component redistributed here (Google
|
|
101
|
-
Draco).
|
|
102
|
-
|
|
103
|
-
**Want to use this?** Licensing enquiries: legal@imagine.io
|
|
69
|
+
Proprietary — see [`LICENSE.md`](LICENSE.md), which also carries the notice and full
|
|
70
|
+
licence text for the one third-party component redistributed inside the package
|
|
71
|
+
(Google Draco, Apache-2.0).
|
package/dist/371ed78aa2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getApiBaseUrl as F}from"./8ade32d067.js";import{describeBootFailure as K,probeBackendReachable as N,warnIntegrator as q}from"./05973a4da2.js";import{adoptUrlCredentials as J}from"./1fff100656.js";import Q from"./872c4302e0.js";import
|
|
1
|
+
import{getApiBaseUrl as F}from"./8ade32d067.js";import{describeBootFailure as K,probeBackendReachable as N,warnIntegrator as q}from"./05973a4da2.js";import{adoptUrlCredentials as J}from"./1fff100656.js";import Q from"./872c4302e0.js";import f from"./be337ddda5.js";import X from"./9c6c598569.js";import i from"./8f60e5059a.js";import I from"./1fac915f8b.js";import{recomputePrice as A}from"./67f6338a4a.js";import{setUseMobileTextures as Y}from"./c44d37da7a.js";import{initIframeMessageService as Z}from"./1e243363f6.js";import{whenPiecePositionsReady as ee,waitForAssetsIdle as D}from"./2774152dd2.js";import{applyLayoutSceneSelections as te,applyLayoutStyling as ae}from"./37addc7fb3.js";import{setTokenProvider as ne}from"./33fa2c8ca2.js";import{hideUI as G}from"./2cafe3274b.js";import{UI_REGIONS as k}from"./9840b9ce12.js";const Ie="This configurator is unavailable.";function ke({resolveInitialSystemId:B,resolveConfigurator:v,resolveConfiguratorKey:P,resolveInitialChannelId:W,getToken:T,onReady:x,onError:C}={}){typeof T=="function"&&ne(T);let l=!1,w=null;return(async()=>{const d=await import("./a77b15c0d6.js"),L=W?.();L!=null&&d.setChannelId?.(L),import.meta.env?.DEV&&!window.__sdkEventLoggerRegistered&&(window.__sdkEventLoggerRegistered=!0,d.on?.("*",n=>{}));let m=B?.();const y=J().shareToken;y&&d.setShareToken?.(y);let s=null;if(y)try{s=await d.loadProject(y);const n=s?.system?.id??s?.system??s?.scene_snapshot?.canonical?.systemId??null;n!=null&&(m=n);try{const u=(s?.scene_snapshot??s?.sceneSnapshot??null)?.theme??null,o=u?.systemThemeRecord??u?.systemTheme??null;if(o!=null){const{applySystemTheme:h}=await import("./5c9fd9201c.js");h(o),i.setState({themeReady:!0})}}catch{}}catch{}const{checkConfiguratorLicence:M,getConfiguratorBlockedMessage:$}=await import("./3bbcee0334.js"),H=await M({systemId:m});if(l)return;if(!H){C?.($(),{code:"unlicensed"});return}try{const{refreshEntitlements:n}=await import("./32861ea2b0.js");n().catch(()=>{})}catch{}try{const{ui:n,sceneCapabilities:r}=v?.(m)||{};n&&Object.keys(n).length&&i.setState(n),r&&i.setState({sceneCapabilities:r});const u=P?.(m);u!=null&&f.setState({configuratorKey:u}),i.setState({showWalls:!!r?.walls})}catch{}let R=!1;try{const{prepareTheme:n}=await import("./be0cfe2236.js");R=await n(m)}catch{}if(!l)try{try{await d.loadConfigurator(m)}catch(e){if(e?.status===401||e?.status===403||e?.status===404)throw e;await Q.getState().loadCatalog({systemId:m}),await f.getState().loadConfigurations(m);const t=f.getState(),a=t.systemDomainDefaults??t.systemRoom?.domain_defaults??null;a&&await d.loadDomainDefaults(a)}try{const e=f.getState(),t=e.systemId??m,a=v?.(t)||{};a.ui&&Object.keys(a.ui).length&&i.setState(a.ui);const c=!!e.systemRoom;i.setState({sceneCapabilities:{dimensions:c,walls:c},showWalls:c});const p=P?.(t);p!=null&&f.setState({configuratorKey:p})}catch{}if(!R)try{const{applySystemTheme:e}=await import("./5c9fd9201c.js");let t=null,a=!1;try{const S=new URLSearchParams(window.location.search);S.has("theme")&&(t=S.get("theme"),a=!0)}catch{}if(!a)for(let S=0;S<20;S+=1){const O=f.getState();if(t=O.systemThemeRecord??O.systemTheme,t!=null||l)break;await new Promise(z=>setTimeout(z,100))}if(l)return;const c=typeof document<"u"&&!!document.documentElement.getAttribute("data-theme-id"),p=typeof t=="string"&&/^\d+$/.test(t.trim()),V=c&&p&&!a;(t!=null||a)&&!V&&e(t)}catch{}if(l)return;i.setState({themeReady:!0});const n="ontouchstart"in window||navigator.maxTouchPoints>0,r=Math.min(window.innerWidth,window.innerHeight)<768;Y(n&&r);const u=s?null:await d.parseShareLink(),o=f.getState().sceneConfigurations,h=f.getState().defaultPresetId;let _=h!=null&&o[h]?h:null;_||(_=Object.values(o||{})[0]?.id);const b=s?.scene_snapshot?._state?.sceneGraph?.activeSceneConfigId,g=b!=null&&o[b]?b:u?.sc||_;d.preloadMaterials(o[g]),X.getState().initializeScene(g);try{const{applySceneConfigDefaults:e}=await import("./a77b15c0d6.js");e(g)}catch{}te(o[g]),ae(o[g]),!s&&u&&await d.restoreShareLink(u);const E=new URLSearchParams(window.location.search),j=E.get("gui");(j==="false"||j==="0")&&i.getState().setGuiVisible(!1);const U=E.get("hide");if(U){const e=U.split(",").map(t=>t.trim()).filter(Boolean);if(e.includes("all"))G();else{const t=e.filter(c=>k.includes(c)),a=e.filter(c=>!k.includes(c)&&c!=="all");a.length&&console.warn(`[sdk] ?hide= ignored unknown region(s): ${a.join(", ")}. Known regions: ${k.join(", ")}, or "all".`),t.length&&G(t)}}A(),I.getState().clearHistory(),Z(),import("./a77b15c0d6.js").then(({initConfigEngine:e})=>e()).catch(()=>{}),(()=>{if(l)return;i.setState({bootEvaluating:!0});const e=I.getState();e.pauseTracking();let t=!1;const a=()=>{t||(t=!0,i.setState({bootEvaluating:!1}),e.resumeTracking())};D().then(()=>{if(l){a();return}import("./a77b15c0d6.js").then(async({seedInitialState:c,reevaluateForFocus:p})=>{await c(),!l&&await p()}).catch(()=>{}).finally(a)}).catch(a)})(),x?.(),s?(i.setState({isLayoutLoading:!0}),i.getState().setSceneLoading(!0,"Loading your saved design..."),w=ee(async()=>{l||(await d.restoreProject(s),A(),D().then(()=>{if(l)return;i.getState().setInitialPerPieceOverrides(),i.setState({isLayoutLoading:!1}),i.getState().clearSceneLoading(),I.getState().clearHistory();const e=s?.scene_snapshot?.canonical||null;import("./a77b15c0d6.js").then(({restoreConfiguration:t,refreshCanonicalState:a})=>e?t(e):a()).catch(()=>{})}))})):i.getState().setInitialPerPieceOverrides()}catch(n){const r=n?.status,u=r==null?await N(F()):null,o=K(n,{reachable:u});q(o,n);const h=o.code==="unavailable"?"unavailable":r===401||r===403?"unauthorized":r===404?"unavailable":"network";C?.(`${o.title} ${o.body}`,{code:h,reason:o.code,title:o.title,body:o.body,fix:o.fix,status:r,cause:n})}})(),{cancel(){l=!0,w&&w()}}}export{Ie as ORG_UNAVAILABLE_MESSAGE,ke as bootConfigurator};
|
package/dist/4910c07ca8.css
CHANGED
|
@@ -153,7 +153,27 @@
|
|
|
153
153
|
flex: 1 1 auto;
|
|
154
154
|
min-height: 0;
|
|
155
155
|
overflow-y: auto;
|
|
156
|
-
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* NO SCROLLBAR IN THE PANEL.
|
|
159
|
+
styles/globals.css gives every scroller an 8px bar with a SOLID track
|
|
160
|
+
(`background: var(--bg-secondary)`), which against this shell's warm cream panel read as a
|
|
161
|
+
grey stripe down its edge. Styling it slim and transparent helped, but the bar still sat
|
|
162
|
+
INSIDE the panel between the rows and its edge, which is worse than nothing on a list this
|
|
163
|
+
short.
|
|
164
|
+
Hidden, which is also what every other shell does — .sidebar__content has hidden its
|
|
165
|
+
scrollbar since the beginning, so this panel was the one place the global default ever
|
|
166
|
+
showed. Scrolling still works by wheel, trackpad, touch and keyboard; only the painted bar
|
|
167
|
+
goes. `scrollbar-gutter: stable` went with it: it reserved room so rows would not shift when
|
|
168
|
+
a visible bar appeared, and nothing appears now. */
|
|
169
|
+
.showcase-layout .showcase-rows,
|
|
170
|
+
.showcase-layout .showcase-panel {
|
|
171
|
+
scrollbar-width: none; /* Firefox */
|
|
172
|
+
-ms-overflow-style: none; /* legacy Edge */
|
|
173
|
+
}
|
|
174
|
+
.showcase-layout .showcase-rows::-webkit-scrollbar,
|
|
175
|
+
.showcase-layout .showcase-panel::-webkit-scrollbar {
|
|
176
|
+
display: none;
|
|
157
177
|
}
|
|
158
178
|
.showcase-row {
|
|
159
179
|
display: flex;
|
package/dist/5c9fd9201c.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const I=new Set(["theme2","theme3"]),C=new Set(["default","theme1"]),V=new Set(["theme2","theme3","theme4","theme5"]);import{markHostTheme as
|
|
1
|
+
const I=new Set(["theme2","theme3"]),C=new Set(["default","theme1"]),V=new Set(["theme2","theme3","theme4","theme5"]);import{useEffect as J}from"react";import{markHostTheme as Q,isHostThemeApplied as X,_resetHostTheme as Y}from"./40d6aeb28c.js";import{validateTheme as Z,checkThemeContrast as tt,applyCustomCss as P,applyFontUrl as U}from"./b1349d5a21.js";import{setThemeLabels as et,setLocale as rt}from"./28d887bf8a.js";import ot from"./79a397bb92.js";import W from"./be337ddda5.js";const j={none:"none",sm:"0 1px 2px rgba(0,0,0,0.08)",md:"0 4px 12px rgba(0,0,0,0.12)"},nt=new Set(["Inter","Playfair Display","Nunito","Poppins","Roboto","Lato","Montserrat","Merriweather","Open Sans","Raleway","Work Sans"]),it=["--color-primary","--color-primary-dark","--color-secondary","--color-accent","--color-brand-primary","--color-brand-primary-dark","--color-brand-primary-light","--color-brand-primary-rgb","--color-brand-accent","--color-background","--color-foreground","--color-surface","--color-border","--sidebar-width","--sidebar-content-padding","--radius-xl","--thumbnail-border-radius","--btn-height-md","--thumbnail-gap","--font-size-md","--sidebar-section-title-size","--font-size-2xl","--sidebar-section-title-weight","--font-family-base","--font-family-heading","--btn-border-radius","--btn-shadow","--layout-density","--brand-logo-url","--bg-primary","--bg-secondary","--bg-tertiary","--bg-muted","--text-primary","--text-primary-rgb","--text-secondary","--text-tertiary","--border-default","--border-light","--border-dark"];function xt(t,e){J(()=>{let r=e??t,o=!1;try{const i=new URLSearchParams(window.location.search);i.has("theme")&&(r=i.get("theme"),o=!0)}catch{}r==null&&!o||ct(r,{force:o})},[t,e])}function k(t){return t?String(t).trim().toLowerCase():""}function at(t){return I.has(k(t))?"dark":"light"}function N(t){if(t==null)return null;if(typeof t=="string")return t.trim().toLowerCase()||null;if(typeof t=="object"){const e=t.layout??t.layoutKey??t.uiTemplate??t.ui_template??null;if(e){const o=String(e).trim().toLowerCase().replace(/[\s_-]+/g,"");if(o)return o}const r=t.name??t.themeName??t.key??null;if(r){const o=String(r).trim().toLowerCase().replace(/[\s_-]+/g,"");if(o)return o}if(t.id!=null)return`theme${t.id}`}return null}function st(t){Q(),v(t),lt(t)}function lt(t){let e;if(t==null||t===""||typeof t=="string"&&C.has(k(t)))e={systemTheme:null,systemThemeRecord:null};else if(typeof t=="string")e={systemTheme:k(t).replace(/[\s_-]+/g,""),systemThemeRecord:null};else if(typeof t=="object")e={systemTheme:N(t),systemThemeRecord:t};else return;try{const r=W.getState();if(r.systemTheme===e.systemTheme&&r.systemThemeRecord===e.systemThemeRecord)return;W.setState(e)}catch{}}async function St(t){if(t==null||t==="")return null;let e=null;try{e=await ot.fetchTheme(t)}catch{return null}return!e||typeof e!="object"?null:(st(e),e)}function ct(t,{force:e=!1}={}){X()&&!e||v(t)}function kt(){Y()}function v(t){const e=typeof document<"u"?document.documentElement:null;if(e){if(t&&typeof t=="object"){const{errors:r,warnings:o}=Z(t),i=tt(t);if(!i.pass){const y=i.results.filter(u=>!u.pass).map(u=>`${u.pair} = ${u.ratio??"?"}:1 (needs ${u.min}:1)`).join(", ")}et(t.labels),t.locale&&rt(t.locale)}if(t==null||t===""||typeof t=="string"&&C.has(k(t))){z(e);return}if(typeof t=="string"){z(e);const r=k(t).replace(/[\s_-]+/g,"");r&&!C.has(r)&&(e.setAttribute("data-theme",r),e.setAttribute("data-theme-preset",r),e.setAttribute("data-theme-mode",at(r)));return}if(typeof t=="object"){z(e);const r=t.colorTokens??t.color_tokens??{},o=t.typographyTokens??t.typography_tokens??{},i=t.layoutDensity??t.layout_density,y=t.logoUrl??t.logo_url,u=t.faviconUrl??t.favicon_url,b=t.config||{},a=b.colors||{},T=N(t);T&&e.setAttribute("data-theme",T),t.id!=null&&e.setAttribute("data-theme-id",String(t.id));const $=String(t.name??t.themeName??t.key??"").trim().toLowerCase().replace(/[\s_-]+/g,"");V.has($)&&(e.setAttribute("data-theme-preset",$),I.has($)&&e.setAttribute("data-theme-mode","dark"));const l=(S,D)=>h(S)?S.trim():h(D)?D.trim():null,f=l(a.primary,r.primary);s(e,"--color-primary",f),h(f)&&n(e,"--color-primary-dark",c(f,-.15));const F=l(a.accent,r.accent);if(s(e,"--color-accent",F),h(f)){n(e,"--color-brand-primary",f),n(e,"--color-brand-primary-dark",c(f,-.15)),n(e,"--color-brand-primary-light",c(f,.3));const S=O(f);S&&n(e,"--color-brand-primary-rgb",S),n(e,"--color-brand-accent",h(F)?F.trim():f)}s(e,"--color-background",l(a.background,r.background)),s(e,"--color-surface",l(a.surface,r.surface)),s(e,"--color-foreground",l(a.text,r.foreground)),s(e,"--color-secondary",l(a.textMuted,r.secondary)),s(e,"--color-border",l(a.border,r.border));const _=l(a.surface,r.surface),w=l(a.background,r.background),x=l(a.text,r.foreground),L=l(a.textMuted,r.secondary),B=l(a.border,r.border);s(e,"--bg-primary",_??w),s(e,"--bg-secondary",w??c(_,-.04)),s(e,"--bg-tertiary",c(w??_,-.08)),s(e,"--bg-muted",c(w??_,-.02)),s(e,"--text-primary",x);const H=O(x);H&&n(e,"--text-primary-rgb",H),s(e,"--text-secondary",L??c(x,.45)),s(e,"--text-tertiary",L??c(x,.6));const A=B??c(x,.86);s(e,"--border-default",A),s(e,"--border-light",c(A,.35)),s(e,"--border-dark",c(A,-.2));const M=l(a.background,r.background),K=t.mode??r.mode??(M&&ft(M)?"dark":"light");e.setAttribute("data-theme-mode",K);const g=b.sizing||{};n(e,"--sidebar-width",d(g.cardWidth)),n(e,"--sidebar-content-padding",d(g.cardPadding)),n(e,"--radius-xl",d(g.radius)),n(e,"--thumbnail-border-radius",d(g.radius)),n(e,"--btn-height-md",d(g.controlHeight)),n(e,"--thumbnail-gap",d(g.gap));const p=b.typography||{};n(e,"--font-size-md",d(p.baseSize)),n(e,"--sidebar-section-title-size",d(p.labelSize)),n(e,"--font-size-2xl",d(p.headingSize)),n(e,"--sidebar-section-title-weight",ut(p.fontWeight));const q=E(p.fontFamily)??E(o.bodyFont),G=E(o.headingFont)??E(p.fontFamily);n(e,"--font-family-base",q),n(e,"--font-family-heading",G),R(p.fontFamily),R(o.headingFont),R(o.bodyFont);const m=b.buttons||{};n(e,"--btn-border-radius",d(m.buttonRadius)),m.shadow!=null&&j[m.shadow]!=null&&n(e,"--btn-shadow",j[m.shadow]),(m.buttonStyle==="filled"||m.buttonStyle==="outline")&&e.setAttribute("data-button-style",m.buttonStyle),i&&n(e,"--layout-density",String(i)),y&&n(e,"--brand-logo-url",`url("${y}")`),u&&dt(u),U(t.fontUrl),P(t.customCss,{nonce:t.cspNonce})}}}const d=t=>typeof t=="number"&&Number.isFinite(t)?`${t}px`:null,ut=t=>typeof t=="number"&&Number.isFinite(t)?String(t):null,h=t=>typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t.trim());function n(t,e,r){r!=null&&r!==""&&t.style.setProperty(e,r)}function s(t,e,r){h(r)&&t.style.setProperty(e,r.trim())}function E(t){if(!t||typeof t!="string")return null;const e=t.trim();return e?e.includes(",")?e:`'${e}', system-ui, sans-serif`:null}function R(t){if(typeof document>"u"||!t||typeof t!="string")return;const e=t.replace(/['"]/g,"").split(",")[0].trim();if(!nt.has(e))return;const r=`gf-${e.replace(/\s+/g,"-").toLowerCase()}`;if(document.getElementById(r))return;const o=document.createElement("link");o.id=r,o.rel="stylesheet",o.href=`https://fonts.googleapis.com/css2?family=${e.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`,document.head.appendChild(o)}function z(t){P(null),U(null),["data-theme","data-theme-mode","data-theme-preset","data-theme-id","data-button-style"].forEach(o=>t.removeAttribute(o)),it.forEach(o=>t.style.removeProperty(o));const e=t.style,r=[];for(let o=0;o<e.length;o++){const i=e[o];(i.startsWith("--color-")||i.startsWith("--font-"))&&r.push(i)}r.forEach(o=>e.removeProperty(o))}function dt(t){if(typeof document>"u")return;let e=document.querySelector('link[rel="icon"]');e||(e=document.createElement("link"),e.rel="icon",document.head.appendChild(e)),e.href=t}function c(t,e){const r=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!r)return null;const o=parseInt(r[1],16),i=a=>{const T=Math.round(a+(e<0?a*e:(255-a)*e));return Math.max(0,Math.min(255,T))},y=i(o>>16&255),u=i(o>>8&255),b=i(o&255);return`#${((1<<24)+(y<<16)+(u<<8)+b).toString(16).slice(1)}`}function O(t){const e=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!e)return null;const r=parseInt(e[1],16);return`${r>>16&255}, ${r>>8&255}, ${r&255}`}function ft(t){const e=/^#?([0-9a-f]{6})$/i.exec(String(t||"").trim());if(!e)return!1;const r=parseInt(e[1],16),o=r>>16&255,i=r>>8&255,y=r&255;return .299*o+.587*i+.114*y<128}export{kt as _resetThemeOwnership,ct as applySystemTheme,st as applyTheme,St as applyThemeById,k as normalizeThemeId,N as themeLayoutKey,at as themeMode,xt as useSystemTheme};
|
package/dist/87bb469216.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as Jt,jsx as I,jsxs as ct}from"react/jsx-runtime";import{useCallback as tt,useEffect as Y,useMemo as X,useRef as Ee,useState as Pt,useSyncExternalStore as Ne}from"react";import{Html as un,useProgress as pn}from"@react-three/drei";import T from"./9c6c598569.js";import B from"./872c4302e0.js";import D from"./be337ddda5.js";import ft from"./d94df858ea.js";import{normalizeMaterialTargets as hn}from"./dc2a1a0e13.js";import O from"./8f60e5059a.js";import mn from"./60d697292c.js";import fn from"./811b403d43.js";import{useUiToggles as gn}from"./d0f9681634.js";import{ProductInstance as Qt,SelectionActionPanel as In,FreeMovable as Sn,PlacementGaps as yn,SceneStage as bn,SceneRoom as vn,SceneProductsSource as Pn}from"./8a3a57c008.js";import Mn from"./205827c5c8.js";import{computeTargets as xn,resolveTarget as wn,resolveTargetRenderer as Cn,resolveInsertSequence as _n}from"./58e6419ba8.js";import{disarmPlacement as Xe}from"./ab6c80484f.js";import{resolveComponent as Ze,useComponentRegistry as Tn}from"./882bc739c8.js";import{SlotHost as Fn}from"./73f7d65985.js";import{ModalHost as Gn}from"./09c4973968.js";import On from"./6c0a2572dd.js";import An from"./20b0104576.js";import{getConfigState as kn,subscribe as He,getVersion as At}from"./817d930a49.js";import{getPlacementStrategy as je}from"./281cf952fa.js";import{resolveAddMode as Dn,armPlacement as Ln}from"./ab6c80484f.js";import{resolveReplaceTarget as Rn}from"./4d7a0d1897.js";import{enforceCorners as qn}from"./388cadacbd.js";import{resolvePlacementStrategyConfig as Ve}from"./281cf952fa.js";import{getLabel as zn}from"./28d887bf8a.js";import{isAddFeature as En}from"./8c27edda0f.js";import{usePlacementInteraction as Nn}from"./4b8958aa4c.js";import{refreshCanonicalState as Xn,seedInitialState as Zn,addProduct as kt}from"./a77b15c0d6.js";import{resolveLayout as Hn,hasLayout as jn,useLayoutRegistry as Vn,layoutOverride as Un,_publishResolvedLayoutKey as Wn}from"./31ea036f5c.js";import{themeLayoutKey as Yn}from"./5c9fd9201c.js";import"./1a2629800a.css";import{runIntent as Dt,INTENTS as Lt}from"./6d238282c1.js";function Bn(){const v=ft(a=>a.sceneSelections),P=ft(a=>a.selectionOrder),S=T(a=>a.activeSceneConfigId),p=D(a=>a.defaultPresetId),c=D(a=>a.sceneConfigurations),F=D(a=>a.getSceneFeatures),y=Ne(He,At,At);return X(()=>{const a=S||p||Object.keys(c||{})[0],Mt=a?F(a):[],h=B.getState(),K=[],it=new Set,et=(l,R)=>{if(!l||l.id==null||it.has(String(l.id))||R>4)return;it.add(String(l.id)),K.push(l);const f=(h.features?.[l.id]||h.features?.[String(l.id)])?.childOptionSetIds||[];for(const d of f){const Z=h.features?.[d]||h.features?.[String(d)];Z&&et({id:d,type:Z.type,sequence:Z.sequence},R+1)}};for(const l of Mt)et(l,0);const G=K.filter(l=>/finish/i.test(l.type||"")&&v[l.id]!=null).sort((l,R)=>{const _=P?.[String(l.id)]??-1,f=P?.[String(R.id)]??-1;return _!==f?_-f:(l.sequence??0)-(R.sequence??0)}),z={};for(const l of G){const R=v[l.id],_=h.options?.[R]?.value;if(_==null)continue;const f=h.features?.[l.id]||{},d=hn(f.materialTargets??f.material_targets??f.materials);for(const Z of d)z[String(Z).toLowerCase()]=_}return z},[v,P,S,p,c,F,y])}function Kn(v,P){if(P==null)return null;const S=String(P);for(const p of Object.values(v.products||{})){const c=p?.components_configuration||p?.componentsConfiguration;if(!(!c||typeof c!="object"))for(const F of Object.values(c))for(const y of Array.isArray(F)?F:[F]){const a=y&&typeof y=="object"?y.componentId??y.component_id:y;if(a!=null&&String(a)===S)return p}}return null}function $n(v){const P=ft(h=>h.sceneSelections),S=ft(h=>h.setSceneSelection),p=D(h=>h.getSceneFeatures),c=D(h=>h.sceneConfigurations),F=Ne(He,At,At),y=X(()=>new Set((v?p(v)||[]:[]).filter(h=>En(h)).map(h=>String(h.id))),[v,p,c,F]),a=Ee({}),Mt=ft(h=>h.sceneSelectionsSettled);Y(()=>{if(!Mt){a.current={...P};return}const h=a.current,K=[];for(const[G,z]of Object.entries(P||{}))h[G]===z||z==null||y.has(String(G))&&K.push([G,z]);if(a.current={...P},!K.length)return;const it=D.getState().systemId;let et=!1;return(async()=>{const G=B.getState(),z=T.getState();for(const[l,R]of K){const _=G.options?.[R];let f=_?.valueProductVariantId??_?.value_product_variant_id??_?.value_product_variant??_?.variantId??_?.variant_id??null,d=f!=null?G.getProduct?.(f):null;if(d==null){const u=_?.value??(G.optionToProducts?.[String(R)]||[])[0]??_?.product_id??_?.productId??null;d=u!=null?G.getProduct?.(u):null,d==null&&u!=null&&G.getComponent?.(u)&&(d=Kn(G,u)),f=d?.id??f??u}else f=d?.id??f;if(f==null){S(l,null);continue}const Z=d?.id??f,lt=d?.placementGroup??d?.placement_group??null,$=d?.productGraph??d?.product_graph??null,H=d?.compatibleSlots??d?.compatible_slots??null;if(Array.isArray(H)&&H.length){const u=new Set(H.map(String));if(Object.values(z.productInstances||{}).some(ut=>{const st=G.getProduct?.(ut.variantId)||G.getProduct?.(ut.productId),g=st?.product_graph??st?.productGraph;return g!=null&&u.has(String(g))})){O.getState().setPendingSlotPlacement?.({productId:Z,variantId:f,name:d?.name??d?.displayName??d?.variantName??"product",compatibleGraphIds:Array.from(u)}),S(l,null);continue}}if(Dn(it,d)==="arm"){Ln({productId:Z,variantId:f});const u=je(),xt=typeof u?.computeTargets=="function",ut=Object.prototype.hasOwnProperty.call(u??{},"armHint")?u.armHint:zn(xt?"placement.armedPickTarget":"placement.armedPickGap",xt?"":"Click a + between pieces to insert it.");ut&&O.getState().showInfo?.(ut),S(l,null);continue}const dt=T.getState(),E=dt.selectedInstanceId,gt=E!=null?(dt.productInstances||{})[E]:null,nt=gt&&Number.isFinite(Number(gt.sequence))?Number(gt.sequence):void 0,It=Rn({placementGroup:lt}),ot=It!=null?(dt.productInstances||{})[It]:null,te=ot&&Number.isFinite(Number(ot.sequence))?Number(ot.sequence):nt,ee=Array.isArray(ot?.position)?ot.position:[0,0,0];let ne=null;try{ne=await Dt({type:Lt.PRODUCT_ADD,productGraphId:$,variantId:f,placementGroup:lt,sequence:te,replacePlacementId:It??void 0},u=>kt({productGraphId:u.productGraphId,variantId:u.variantId,placementGroup:u.placementGroup,position:ee,sequence:u.sequence,replace:u.replacePlacementId!=null,replacePlacementId:u.replacePlacementId}))}catch{}if(et)return;S(l,null)}})(),()=>{et=!0}},[P,y,v,S])}function Qn({position:v,onClick:P}){const[S,p]=Pt(!1);return I(un,{position:v,center:!0,style:{pointerEvents:"auto"},zIndexRange:[100,0],children:I("div",{onClick:P,onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),style:{width:22,height:22,borderRadius:"50%",background:S?"#ff8a65":"rgba(255, 87, 34, 0.85)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bg-primary, #fff)",fontSize:13,fontWeight:"bold",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",cursor:"pointer",transition:"transform 0.2s",transform:S?"scale(1.15)":"scale(1)"},children:"+"})})}function Jn({isMobile:v}={}){Tn();const P=Ze("SelectionActionPanel",In),S=T(t=>t.productInstances),p=B(t=>t.getProduct),c=B(t=>t.componentGroups),F=T(t=>t.clearSelection),y=T(t=>t.selectedInstanceId),a=T(t=>t.isFocusing),Mt=T(t=>t.removeProductInstance),h=T(t=>t.addProductInstance),K=T(t=>t.updateInstancePosition),it=T(t=>t.updateInstanceRotation),et=T(t=>t.activeSceneConfigId),G=D(t=>t.defaultPresetId),z=D(t=>t.sceneConfigurations),l=D(t=>t.systemId),R=D(t=>t.useTransform),_=O(t=>t.sceneCapabilities),f=O(t=>t.showWalls),d=O(t=>t.showDimensions),Z=O(t=>t.pendingSlotPlacement),lt=Bn(),$=O(t=>t.hostMaterialOverrides),H=(kn()||{}).room||null,dt=et||G||Object.keys(z||{})[0]||null;$n(dt);const[E,gt]=Pt(!0),[nt,It]=Pt(!1),ot=tt(async()=>{try{await Zn()}catch{}It(!0)},[]),{edgeOf:te,cornerOf:ee,isHostAnchored:ne,isMovable:u,rawFree:xt,splitReliable:ut,freeInstances:st,ordered:g,syntheticHosts:oe,moveInFlightRef:eo}=mn(),wt=X(()=>new Map(oe.map(t=>[t.hostedProductId,t])),[oe]),[St,We]=Pt({}),Rt=tt((t,e)=>{We(n=>{const o=n[t],r=e.full||null;return o&&o.width===e.width&&o.depth===e.depth&&o.height===e.height&&o.cx===e.cx&&o.cz===e.cz&&(o.full?.width??null)===(r?.width??null)&&(o.full?.height??null)===(r?.height??null)&&(o.full?.depth??null)===(r?.depth??null)?n:{...n,[t]:{width:e.width,depth:e.depth,height:e.height,cx:e.cx,cz:e.cz,full:r}}})},[]),pt=tt(t=>St[t]||null,[St]),se=B(t=>t.placementBoundsExcludeIds),re=X(()=>new Set((se||[]).map(t=>String(t))),[se]),qt=tt((t,e)=>{const n=t?.componentId??e?.id??e?.componentId??null;return n!=null&&re.has(String(n))||/leg|arm/i.test(String(t?.slotKey||""))?!0:(e?.groups||e?.group_ids||[]).some(r=>{const i=c?.[r]||c?.[String(r)];return/leg|arm/i.test(String(i?.name??i?.slotKey??i?.slot_key??""))})},[c,re]),yt=Ee(!1),L=g.length+st.length,zt=X(()=>[...g,...st],[g,st]),ht=L>0&&zt.every(t=>St[t.productId]),Et=X(()=>zt.filter(t=>St[t.productId]).length,[zt,St]),{active:ae,loaded:ce,total:Nt}=pn(),ie=O(t=>t.isEvaluating),Ct=O(t=>t.isLayoutLoading),le=O(t=>t.bootEvaluating);Y(()=>{if(!nt)return;const t=!ae&&(Nt===0||ce>=Nt),e=(ht||L===0)&&t&&!ie&&!le,n=()=>{gt(!1),O.getState().endBootLoading()};if(e){const r=setTimeout(n,900);return()=>clearTimeout(r)}const o=setTimeout(n,15e3);return()=>clearTimeout(o)},[nt,ht,L,Et,ae,ce,Nt,ie,le]);const[de,ue]=Pt(!1);Y(()=>{if(!E){ue(!1);return}(ht&&L>0||nt&&L===0)&&ue(!0)},[ht,L,nt,E]);const pe=nt?de||L===0?"Finishing up\u2026":`Loading products\u2026 ${Math.min(Et,L)}/${L}`:"Preparing your configurator\u2026",he=de?100:L>0?Math.min(Math.round(Et/L*100),92):0;Y(()=>{E&&O.getState().setBootPhase(pe,he)},[E,pe,he]),Y(()=>(O.setState({initialSceneLoading:E}),()=>O.setState({initialSceneLoading:!1})),[E]),Y(()=>{Ct&&(yt.current=!1)},[Ct]),Y(()=>{if(L===0){yt.current=!1;return}if(yt.current||E||Ct||!ht)return;const t=requestAnimationFrame(()=>{yt.current||(T.getState().resetCameraToDefault?.({instant:!0}),yt.current=!0)});return()=>cancelAnimationFrame(t)},[L,E,Ct,ht]);const bt=je(),_t=X(()=>g.map(t=>{const e=wt.get(t.id);return e?{...t,productId:e.hostVariantId}:t}),[g,wt]),me=R||!!z?.[dt]?.useTransform,N=T(t=>t.pendingPlacementPiece),fe=!!N&&typeof bt?.computeTargets=="function"&&!!Cn(),rt=X(()=>{const t={getProduct:p,getDims:pt,useTransform:me,candidate:N,openSlots:fe,config:Ve()},e=bt.computeLayout?bt.computeLayout(_t,t):_t.map(()=>({position:[0,0,0],rotation:[0,0,0]}));return qn(e,_t,t,bt)},[bt,_t,p,pt,me,N,fe]),j=X(()=>{const e=H?.height>0?H.height:2.7,n=.1,o=.05,r=new Map;let i=1/0,M=-1/0,A=1/0,m=-1/0,V=0,k=!1;if(g.forEach((s,U)=>{const x=rt[U];if(!x||u(s))return;const b=x.position||[0,0,0],w=pt(s.productId),W=p(s.productId),q=w?.full||w,Yt=q?.height>0?q.height:W?.height>0?W.height*.0254:0,Gt=(b[1]||0)+Yt;if(Gt>V&&(V=Gt),(s.positionedAbove??s.positioned_above)!=null)return;const Bt=(b[1]||0)<=.01,Ot=-((Array.isArray(x.rotation)?x.rotation[1]:0)||0),Kt=w?.depth>0?w.depth:W?.depth>0?W.depth*.0254:.6,$t=w?.width>0?w.width:W?.width>0?W.width*.0254:.9,Q=Math.cos(Ot),J=Math.sin(Ot),Pe=w?.cx||0,Me=w?.cz||0,xe=b[0]+Q*Pe-J*Me,we=b[2]+J*Pe+Q*Me,Ce=($t*Math.abs(Q)+Kt*Math.abs(J))/2,_e=($t*Math.abs(J)+Kt*Math.abs(Q))/2,Te=xe-Ce,Fe=xe+Ce,Ge=we-_e,Oe=we+_e,Ae=q?.width>0?q.width:$t,ke=q?.depth>0?q.depth:Kt,De=b[0]+Q*(q?.cx||0)-J*(q?.cz||0),Le=b[2]+J*(q?.cx||0)+Q*(q?.cz||0),Re=(Ae*Math.abs(Q)+ke*Math.abs(J))/2,qe=(Ae*Math.abs(J)+ke*Math.abs(Q))/2,an=De-Re,cn=De+Re,ln=Le-qe,dn=Le+qe,ze=String((Math.round(Ot/(Math.PI/2))%4+4)%4),C=r.get(ze)||{heading:Ot,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,fMinX:1/0,fMaxX:-1/0,fMinZ:1/0,fMaxZ:-1/0,hasFloor:!1};C.minX=Math.min(C.minX,Te),C.maxX=Math.max(C.maxX,Fe),C.minZ=Math.min(C.minZ,Ge),C.maxZ=Math.max(C.maxZ,Oe),Bt&&(C.fMinX=Math.min(C.fMinX,Te),C.fMaxX=Math.max(C.fMaxX,Fe),C.fMinZ=Math.min(C.fMinZ,Ge),C.fMaxZ=Math.max(C.fMaxZ,Oe),C.hasFloor=!0),r.set(ze,C),i=Math.min(i,an),M=Math.max(M,cn),A=Math.min(A,ln),m=Math.max(m,dn),k=!0}),!k)return null;const mt=Math.max(e,V>0?V+.02:e),Tt=[...r.values()].map(s=>{const U=Math.sin(s.heading),x=Math.cos(s.heading),b=U,w=-x,W=Math.abs(b)>Math.abs(w),q=s.hasFloor?s.fMinX:s.minX,Yt=s.hasFloor?s.fMaxX:s.maxX,Gt=s.hasFloor?s.fMinZ:s.minZ,Bt=s.hasFloor?s.fMaxZ:s.maxZ,ve=W?(b>0?Yt:q)+(b>0?n/2:-n/2):(w>0?Bt:Gt)+(w>0?n/2:-n/2);return{g:s,isSide:W,plane:ve}}),nn=Tt.filter(s=>s.isSide).map(s=>s.plane),on=Tt.filter(s=>!s.isSide).map(s=>s.plane),Ht=[];for(const s of Tt){const{g:U}=s;if(s.isSide){let x=U.minZ,b=U.maxZ;for(const w of on)x=Math.min(x,w),b=Math.max(b,w);Ht.push({cx:s.plane,cz:(x+b)/2,cy:mt/2,length:b-x+o*2,thickness:n,height:mt,rotY:Math.PI/2})}else{let x=U.minX,b=U.maxX;for(const w of nn)x=Math.min(x,w),b=Math.max(b,w);Ht.push({cx:(x+b)/2,cz:s.plane,cy:mt/2,length:b-x+o*2,thickness:n,height:mt,rotY:0})}}const Ft=.4,be=M>i&&m>A;let jt=i-Ft,Vt=M+Ft,Ut=A-Ft,Wt=m+Ft;for(const s of Tt){const U=Math.sin(s.g.heading),x=-Math.cos(s.g.heading);s.isSide?U<0?jt=s.plane-n/2:Vt=s.plane+n/2:x<0?Ut=s.plane-n/2:Wt=s.plane+n/2}const sn=be?{cx:(jt+Vt)/2,cz:(Ut+Wt)/2,w:Vt-jt,d:Wt-Ut}:null,rn=be?{minX:i,maxX:M,minZ:A,maxZ:m,w:M-i,d:m-A,h:mt,height:V>0?V:mt}:null;return{segments:Ht,floor:sn,bbox:rn}},[g,rt,H,pt,p,u]),Ye=f&&!!(j&&j.segments&&j.segments.length),Be=d&&!!(j&&j.bbox&&j.bbox.w>0),Ke=(t,e)=>{const n=rt[e]||{position:[0,0,0],rotation:[0,0,0]},o=wt.get(t.id);if(!o)return n;const r=n.position||[0,0,0],i=(Array.isArray(n.rotation)?n.rotation[1]:0)||0,M=Math.cos(i),A=Math.sin(i),m=o.offset||[0,0,0];return{position:[r[0]+(m[0]||0)*M+(m[2]||0)*A,r[1]+(m[1]||0),r[2]-(m[0]||0)*A+(m[2]||0)*M],rotation:[0,i+(o.rotDegY||0)*Math.PI/180,0]}},at=Z,vt=!!at,ge=X(()=>{if(!at)return new Set;const t=new Set((at.compatibleGraphIds||[]).map(String)),e=new Set;for(const n of Object.values(S||{})){const o=p(n.variantId)||p(n.productId),r=o?.product_graph??o?.productGraph;r!=null&&t.has(String(r))&&e.add(String(n.id))}return e},[at,S,p]),Xt=tt(()=>{O.getState().clearPendingSlotPlacement?.(),O.getState().clearPendingHostedProduct?.()},[]),Ie=tt((t,e)=>{if(!e)return;const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=T.getState().productInstances?.[String(t)],M=o?.placementGroup??o?.placement_group??i?.placementGroup??null,A=Array.isArray(i?.position)?i.position:[0,0,0],m=i?.variantId??i?.productId??null,V=Number.isFinite(Number(i?.sequence))?Number(i.sequence):void 0;Xt(),Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:M,sequence:V,hostPlacementId:String(t),hostVariantId:m},k=>kt({productGraphId:k.productGraphId,variantId:k.variantId,placementGroup:k.placementGroup,position:A,sequence:k.sequence,hostPlacementId:k.hostPlacementId,hostVariantId:k.hostVariantId}).catch(()=>{}))},[Xt]),Zt=tt((t,e)=>{const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=o?.placementGroup??o?.placement_group??null,M=g[t-1]||g[t],A=Array.isArray(M?.position)?M.position:[0,0,0],m=g[t],V=m&&Number.isFinite(Number(m.sequence))?Number(m.sequence):void 0;Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:i,sequence:V},k=>kt({productGraphId:k.productGraphId,variantId:k.variantId,placementGroup:k.placementGroup,position:A,sequence:k.sequence}).catch(()=>{}))},[g]);Y(()=>{if(!N||g.length>0)return;const t=N;Xe(),Zt(0,t)},[N,g.length,Zt]);const{gaps:$e,onInsert:Qe}=Nn({systemId:l,count:g.length,positionOf:t=>rt[t]?.position||[0,0,0],insertAt:Zt}),Se=X(()=>{if(!N)return[];const t=B.getState();return xn(g,{candidate:N,getProduct:e=>t.getProduct?.(e),getDims:pt,config:Ve(),layout:rt})},[N,g,rt,pt]),Je=tt(t=>{const e=wn(t,{candidate:N});if(!e)return;const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=o?.placementGroup??o?.placement_group??null,M=e.transform?.position??t.position??[0,0,0],A=_n(e,t,g);Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:i,anchor:e.anchor??null,sequence:A},m=>kt({productGraphId:m.productGraphId,variantId:m.variantId,placementGroup:m.placementGroup,position:M,sequence:m.sequence}).catch(()=>{})),Xe()},[N,g]),{selectedInst:no,swapOrder:oo,panelActions:ye,priceInfo:tn}=fn(),en=gn()("selectionPanel");Y(()=>{if(y==null)return;const t=S||{},e=String(y),n="__host";if(e.endsWith(n)){const o=e.slice(0,-n.length);if(t[o]||Object.values(t).some(r=>String(r?.id??r?.instanceId)===o))return}else if(t[y]||Object.values(t).some(o=>String(o?.instanceId??o?.id)===e))return;F?.()},[y,S,F]);const ro=ft(t=>t.placementPricing),ao=D(t=>t.getChannelPriceConfig);return ct(Jt,{children:[I(Pn,{onSeeded:ot}),ct(bn,{isMobile:v,camera:{position:[2.6,2.2,4],fov:45},controlsTarget:[0,.5,0],onPointerMissed:()=>F?.(),groundShadowCatcher:!0,overlay:ct(Jt,{children:[!vt&&ye&&en?I(P,{actions:ye,priceInfo:tn}):null,vt&&I("div",{className:"placement-mode-overlay",children:ct("div",{className:"placement-mode-overlay__content",children:[ct("span",{className:"placement-mode-overlay__text",children:["Click on a highlighted slot to place ",I("strong",{children:at?.name})]}),I("button",{type:"button",className:"placement-mode-overlay__cancel",onClick:Xt,children:I("span",{className:"placement-mode-overlay__cancel-text",children:"Cancel"})})]})}),I(Fn,{name:"overlay"}),a&&I("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,zIndex:30,cursor:"default"}})]}),children:[Ye&&I(vn,{width:H?.width,depth:H?.depth,height:H?.height??j?.bbox?.h??2.7,showCeiling:_?.ceiling===!0,segments:j?.segments||null,floor:j?.floor||null}),Be&&(()=>{const t=Ze("SceneDimensions",An);return I(t,{bbox:j.bbox})})(),g.map((t,e)=>{const n=wt.get(t.id),o=rt[e]||{position:[0,0,0],rotation:[0,0,0]};return o.hidden?null:ct("group",{children:[n&&I(Qt,{instance:{id:n.id,instanceId:n.id,productId:n.hostVariantId,variantId:n.hostVariantId,position:o.position||[0,0,0],rotation:o.rotation||[0,0,0]},slotMaterials:{...lt,...$?.[n.hostedProductId]||{},...$?.[n.id]||{}},stateInstanceId:n.hostedProductId,onSelect:()=>T.getState().selectInstance(n.id),isSelected:String(y)===String(n.id),onMeasure:r=>Rt(n.hostVariantId,r),footprintExcludeItem:qt,hoverable:!0,focusable:!0},n.id),I(Qt,{instance:{...t,...Ke(t,e)},slotMaterials:{...lt,...$?.[t.id]||$?.[t.instanceId]||{}},onSelect:(r,i,M)=>{if(vt){ge.has(String(t.id))&&Ie(t.id,at);return}T.getState().selectInstance(r,M??null)},isSelected:!vt&&String(y)===String(t.instanceId??t.id),onMeasure:r=>Rt(t.productId,r),footprintExcludeItem:qt,hoverable:!0,focusable:!0}),vt&&ge.has(String(t.id))&&I(Qn,{position:[o.position?.[0]||0,(o.position?.[1]||0)+.45,o.position?.[2]||0],onClick:()=>Ie(t.id,at)})]},t.id??t.instanceId??e)}),st.map((t,e)=>I(Sn,{selected:y===t.id,disabled:!!t.locked,position:t.position||[0,0,0],rotationY:(Array.isArray(t.rotation)&&t.rotation[1]||0)*Math.PI/180,onCommit:({position:n,rotationY:o})=>{K(t.id,n),it(t.id,[0,o*180/Math.PI,0]),Xn({allowRevert:!0}).catch(()=>{})},children:I(Qt,{instance:{...t,position:[0,0,0],rotation:[0,0,0]},slotMaterials:{...lt,...$?.[t.id]||$?.[t.instanceId]||{}},onMeasure:n=>Rt(t.productId,n),footprintExcludeItem:qt})},t.id??t.instanceId??`free-${e}`)),Se.length>0?I(Mn,{targets:Se,onPick:Je}):I(yn,{gaps:$e,onInsert:Qe})]})]})}const Ue=new Set;function to(){Vn();const v=D(a=>a.systemLayoutTemplate),P=D(a=>a.systemTheme),S=D(a=>a.systemThemeRecord),p=Yn(S)||(P?String(P).trim().toLowerCase():null);let c=v;try{const a=new URLSearchParams(window.location.search);a.has("template")?c=a.get("template"):a.has("theme")&&(c=a.get("theme"))}catch{}c=c||v||p||null;const F=Un();F&&(c=F),!F&&!v&&c&&c===p&&!jn(c)&&!/^theme\d+$/.test(c)&&!Ue.has(c)&&Ue.add(c),Wn(c);const y=Hn(c);return ct(Jt,{children:[I(y,{Scene:Jn,template:c}),I(Gn,{}),I(On,{})]})}export{Jn as SharedConfiguratorScene,to as default};
|
|
1
|
+
import{Fragment as Jt,jsx as I,jsxs as ct}from"react/jsx-runtime";import{useCallback as tt,useEffect as Y,useMemo as X,useRef as Ee,useState as Pt,useSyncExternalStore as Ne}from"react";import{Html as un,useProgress as pn}from"@react-three/drei";import T from"./9c6c598569.js";import B from"./872c4302e0.js";import D from"./be337ddda5.js";import ft from"./d94df858ea.js";import{normalizeMaterialTargets as hn}from"./dc2a1a0e13.js";import O from"./8f60e5059a.js";import mn from"./60d697292c.js";import fn from"./811b403d43.js";import{useUiToggles as gn}from"./d0f9681634.js";import{ProductInstance as Qt,SelectionActionPanel as In,FreeMovable as Sn,PlacementGaps as yn,SceneStage as bn,SceneRoom as vn,SceneProductsSource as Pn}from"./8a3a57c008.js";import Mn from"./205827c5c8.js";import{computeTargets as xn,resolveTarget as wn,resolveTargetRenderer as Cn,resolveInsertSequence as _n}from"./58e6419ba8.js";import{disarmPlacement as Xe}from"./ab6c80484f.js";import{resolveComponent as Ze,useComponentRegistry as Tn}from"./882bc739c8.js";import{SlotHost as Fn}from"./73f7d65985.js";import{ModalHost as Gn}from"./09c4973968.js";import On from"./6c0a2572dd.js";import An from"./20b0104576.js";import{getConfigState as kn,subscribe as He,getVersion as At}from"./817d930a49.js";import{getPlacementStrategy as je}from"./281cf952fa.js";import{resolveAddMode as Dn,armPlacement as Ln}from"./ab6c80484f.js";import{resolveReplaceTarget as Rn}from"./4d7a0d1897.js";import{enforceCorners as qn}from"./388cadacbd.js";import{resolvePlacementStrategyConfig as Ve}from"./281cf952fa.js";import{getLabel as zn}from"./28d887bf8a.js";import{isAddFeature as En}from"./8c27edda0f.js";import{usePlacementInteraction as Nn}from"./4b8958aa4c.js";import{refreshCanonicalState as Xn,seedInitialState as Zn,addProduct as kt}from"./a77b15c0d6.js";import{resolveLayout as Hn,hasLayout as jn,useLayoutRegistry as Vn,layoutOverride as Un,_publishResolvedLayoutKey as Wn}from"./31ea036f5c.js";import{themeLayoutKey as Yn,useSystemTheme as Bn}from"./5c9fd9201c.js";import"./1a2629800a.css";import{runIntent as Dt,INTENTS as Lt}from"./6d238282c1.js";function Kn(){const P=ft(a=>a.sceneSelections),v=ft(a=>a.selectionOrder),S=T(a=>a.activeSceneConfigId),p=D(a=>a.defaultPresetId),c=D(a=>a.sceneConfigurations),F=D(a=>a.getSceneFeatures),y=Ne(He,At,At);return X(()=>{const a=S||p||Object.keys(c||{})[0],Mt=a?F(a):[],h=B.getState(),K=[],it=new Set,et=(l,R)=>{if(!l||l.id==null||it.has(String(l.id))||R>4)return;it.add(String(l.id)),K.push(l);const f=(h.features?.[l.id]||h.features?.[String(l.id)])?.childOptionSetIds||[];for(const d of f){const Z=h.features?.[d]||h.features?.[String(d)];Z&&et({id:d,type:Z.type,sequence:Z.sequence},R+1)}};for(const l of Mt)et(l,0);const G=K.filter(l=>/finish/i.test(l.type||"")&&P[l.id]!=null).sort((l,R)=>{const _=v?.[String(l.id)]??-1,f=v?.[String(R.id)]??-1;return _!==f?_-f:(l.sequence??0)-(R.sequence??0)}),z={};for(const l of G){const R=P[l.id],_=h.options?.[R]?.value;if(_==null)continue;const f=h.features?.[l.id]||{},d=hn(f.materialTargets??f.material_targets??f.materials);for(const Z of d)z[String(Z).toLowerCase()]=_}return z},[P,v,S,p,c,F,y])}function $n(P,v){if(v==null)return null;const S=String(v);for(const p of Object.values(P.products||{})){const c=p?.components_configuration||p?.componentsConfiguration;if(!(!c||typeof c!="object"))for(const F of Object.values(c))for(const y of Array.isArray(F)?F:[F]){const a=y&&typeof y=="object"?y.componentId??y.component_id:y;if(a!=null&&String(a)===S)return p}}return null}function Qn(P){const v=ft(h=>h.sceneSelections),S=ft(h=>h.setSceneSelection),p=D(h=>h.getSceneFeatures),c=D(h=>h.sceneConfigurations),F=Ne(He,At,At),y=X(()=>new Set((P?p(P)||[]:[]).filter(h=>En(h)).map(h=>String(h.id))),[P,p,c,F]),a=Ee({}),Mt=ft(h=>h.sceneSelectionsSettled);Y(()=>{if(!Mt){a.current={...v};return}const h=a.current,K=[];for(const[G,z]of Object.entries(v||{}))h[G]===z||z==null||y.has(String(G))&&K.push([G,z]);if(a.current={...v},!K.length)return;const it=D.getState().systemId;let et=!1;return(async()=>{const G=B.getState(),z=T.getState();for(const[l,R]of K){const _=G.options?.[R];let f=_?.valueProductVariantId??_?.value_product_variant_id??_?.value_product_variant??_?.variantId??_?.variant_id??null,d=f!=null?G.getProduct?.(f):null;if(d==null){const u=_?.value??(G.optionToProducts?.[String(R)]||[])[0]??_?.product_id??_?.productId??null;d=u!=null?G.getProduct?.(u):null,d==null&&u!=null&&G.getComponent?.(u)&&(d=$n(G,u)),f=d?.id??f??u}else f=d?.id??f;if(f==null){S(l,null);continue}const Z=d?.id??f,lt=d?.placementGroup??d?.placement_group??null,$=d?.productGraph??d?.product_graph??null,H=d?.compatibleSlots??d?.compatible_slots??null;if(Array.isArray(H)&&H.length){const u=new Set(H.map(String));if(Object.values(z.productInstances||{}).some(ut=>{const st=G.getProduct?.(ut.variantId)||G.getProduct?.(ut.productId),g=st?.product_graph??st?.productGraph;return g!=null&&u.has(String(g))})){O.getState().setPendingSlotPlacement?.({productId:Z,variantId:f,name:d?.name??d?.displayName??d?.variantName??"product",compatibleGraphIds:Array.from(u)}),S(l,null);continue}}if(Dn(it,d)==="arm"){Ln({productId:Z,variantId:f});const u=je(),xt=typeof u?.computeTargets=="function",ut=Object.prototype.hasOwnProperty.call(u??{},"armHint")?u.armHint:zn(xt?"placement.armedPickTarget":"placement.armedPickGap",xt?"":"Click a + between pieces to insert it.");ut&&O.getState().showInfo?.(ut),S(l,null);continue}const dt=T.getState(),E=dt.selectedInstanceId,gt=E!=null?(dt.productInstances||{})[E]:null,nt=gt&&Number.isFinite(Number(gt.sequence))?Number(gt.sequence):void 0,It=Rn({placementGroup:lt}),ot=It!=null?(dt.productInstances||{})[It]:null,te=ot&&Number.isFinite(Number(ot.sequence))?Number(ot.sequence):nt,ee=Array.isArray(ot?.position)?ot.position:[0,0,0];let ne=null;try{ne=await Dt({type:Lt.PRODUCT_ADD,productGraphId:$,variantId:f,placementGroup:lt,sequence:te,replacePlacementId:It??void 0},u=>kt({productGraphId:u.productGraphId,variantId:u.variantId,placementGroup:u.placementGroup,position:ee,sequence:u.sequence,replace:u.replacePlacementId!=null,replacePlacementId:u.replacePlacementId}))}catch{}if(et)return;S(l,null)}})(),()=>{et=!0}},[v,y,P,S])}function Jn({position:P,onClick:v}){const[S,p]=Pt(!1);return I(un,{position:P,center:!0,style:{pointerEvents:"auto"},zIndexRange:[100,0],children:I("div",{onClick:v,onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),style:{width:22,height:22,borderRadius:"50%",background:S?"#ff8a65":"rgba(255, 87, 34, 0.85)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bg-primary, #fff)",fontSize:13,fontWeight:"bold",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",cursor:"pointer",transition:"transform 0.2s",transform:S?"scale(1.15)":"scale(1)"},children:"+"})})}function to({isMobile:P}={}){Tn();const v=Ze("SelectionActionPanel",In),S=T(t=>t.productInstances),p=B(t=>t.getProduct),c=B(t=>t.componentGroups),F=T(t=>t.clearSelection),y=T(t=>t.selectedInstanceId),a=T(t=>t.isFocusing),Mt=T(t=>t.removeProductInstance),h=T(t=>t.addProductInstance),K=T(t=>t.updateInstancePosition),it=T(t=>t.updateInstanceRotation),et=T(t=>t.activeSceneConfigId),G=D(t=>t.defaultPresetId),z=D(t=>t.sceneConfigurations),l=D(t=>t.systemId),R=D(t=>t.useTransform),_=O(t=>t.sceneCapabilities),f=O(t=>t.showWalls),d=O(t=>t.showDimensions),Z=O(t=>t.pendingSlotPlacement),lt=Kn(),$=O(t=>t.hostMaterialOverrides),H=(kn()||{}).room||null,dt=et||G||Object.keys(z||{})[0]||null;Qn(dt);const[E,gt]=Pt(!0),[nt,It]=Pt(!1),ot=tt(async()=>{try{await Zn()}catch{}It(!0)},[]),{edgeOf:te,cornerOf:ee,isHostAnchored:ne,isMovable:u,rawFree:xt,splitReliable:ut,freeInstances:st,ordered:g,syntheticHosts:oe,moveInFlightRef:no}=mn(),wt=X(()=>new Map(oe.map(t=>[t.hostedProductId,t])),[oe]),[St,We]=Pt({}),Rt=tt((t,e)=>{We(n=>{const o=n[t],r=e.full||null;return o&&o.width===e.width&&o.depth===e.depth&&o.height===e.height&&o.cx===e.cx&&o.cz===e.cz&&(o.full?.width??null)===(r?.width??null)&&(o.full?.height??null)===(r?.height??null)&&(o.full?.depth??null)===(r?.depth??null)?n:{...n,[t]:{width:e.width,depth:e.depth,height:e.height,cx:e.cx,cz:e.cz,full:r}}})},[]),pt=tt(t=>St[t]||null,[St]),se=B(t=>t.placementBoundsExcludeIds),re=X(()=>new Set((se||[]).map(t=>String(t))),[se]),qt=tt((t,e)=>{const n=t?.componentId??e?.id??e?.componentId??null;return n!=null&&re.has(String(n))||/leg|arm/i.test(String(t?.slotKey||""))?!0:(e?.groups||e?.group_ids||[]).some(r=>{const i=c?.[r]||c?.[String(r)];return/leg|arm/i.test(String(i?.name??i?.slotKey??i?.slot_key??""))})},[c,re]),yt=Ee(!1),L=g.length+st.length,zt=X(()=>[...g,...st],[g,st]),ht=L>0&&zt.every(t=>St[t.productId]),Et=X(()=>zt.filter(t=>St[t.productId]).length,[zt,St]),{active:ae,loaded:ce,total:Nt}=pn(),ie=O(t=>t.isEvaluating),Ct=O(t=>t.isLayoutLoading),le=O(t=>t.bootEvaluating);Y(()=>{if(!nt)return;const t=!ae&&(Nt===0||ce>=Nt),e=(ht||L===0)&&t&&!ie&&!le,n=()=>{gt(!1),O.getState().endBootLoading()};if(e){const r=setTimeout(n,900);return()=>clearTimeout(r)}const o=setTimeout(n,15e3);return()=>clearTimeout(o)},[nt,ht,L,Et,ae,ce,Nt,ie,le]);const[de,ue]=Pt(!1);Y(()=>{if(!E){ue(!1);return}(ht&&L>0||nt&&L===0)&&ue(!0)},[ht,L,nt,E]);const pe=nt?de||L===0?"Finishing up\u2026":`Loading products\u2026 ${Math.min(Et,L)}/${L}`:"Preparing your configurator\u2026",he=de?100:L>0?Math.min(Math.round(Et/L*100),92):0;Y(()=>{E&&O.getState().setBootPhase(pe,he)},[E,pe,he]),Y(()=>(O.setState({initialSceneLoading:E}),()=>O.setState({initialSceneLoading:!1})),[E]),Y(()=>{Ct&&(yt.current=!1)},[Ct]),Y(()=>{if(L===0){yt.current=!1;return}if(yt.current||E||Ct||!ht)return;const t=requestAnimationFrame(()=>{yt.current||(T.getState().resetCameraToDefault?.({instant:!0}),yt.current=!0)});return()=>cancelAnimationFrame(t)},[L,E,Ct,ht]);const bt=je(),_t=X(()=>g.map(t=>{const e=wt.get(t.id);return e?{...t,productId:e.hostVariantId}:t}),[g,wt]),me=R||!!z?.[dt]?.useTransform,N=T(t=>t.pendingPlacementPiece),fe=!!N&&typeof bt?.computeTargets=="function"&&!!Cn(),rt=X(()=>{const t={getProduct:p,getDims:pt,useTransform:me,candidate:N,openSlots:fe,config:Ve()},e=bt.computeLayout?bt.computeLayout(_t,t):_t.map(()=>({position:[0,0,0],rotation:[0,0,0]}));return qn(e,_t,t,bt)},[bt,_t,p,pt,me,N,fe]),j=X(()=>{const e=H?.height>0?H.height:2.7,n=.1,o=.05,r=new Map;let i=1/0,M=-1/0,A=1/0,m=-1/0,V=0,k=!1;if(g.forEach((s,U)=>{const x=rt[U];if(!x||u(s))return;const b=x.position||[0,0,0],w=pt(s.productId),W=p(s.productId),q=w?.full||w,Yt=q?.height>0?q.height:W?.height>0?W.height*.0254:0,Gt=(b[1]||0)+Yt;if(Gt>V&&(V=Gt),(s.positionedAbove??s.positioned_above)!=null)return;const Bt=(b[1]||0)<=.01,Ot=-((Array.isArray(x.rotation)?x.rotation[1]:0)||0),Kt=w?.depth>0?w.depth:W?.depth>0?W.depth*.0254:.6,$t=w?.width>0?w.width:W?.width>0?W.width*.0254:.9,Q=Math.cos(Ot),J=Math.sin(Ot),Pe=w?.cx||0,Me=w?.cz||0,xe=b[0]+Q*Pe-J*Me,we=b[2]+J*Pe+Q*Me,Ce=($t*Math.abs(Q)+Kt*Math.abs(J))/2,_e=($t*Math.abs(J)+Kt*Math.abs(Q))/2,Te=xe-Ce,Fe=xe+Ce,Ge=we-_e,Oe=we+_e,Ae=q?.width>0?q.width:$t,ke=q?.depth>0?q.depth:Kt,De=b[0]+Q*(q?.cx||0)-J*(q?.cz||0),Le=b[2]+J*(q?.cx||0)+Q*(q?.cz||0),Re=(Ae*Math.abs(Q)+ke*Math.abs(J))/2,qe=(Ae*Math.abs(J)+ke*Math.abs(Q))/2,an=De-Re,cn=De+Re,ln=Le-qe,dn=Le+qe,ze=String((Math.round(Ot/(Math.PI/2))%4+4)%4),C=r.get(ze)||{heading:Ot,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,fMinX:1/0,fMaxX:-1/0,fMinZ:1/0,fMaxZ:-1/0,hasFloor:!1};C.minX=Math.min(C.minX,Te),C.maxX=Math.max(C.maxX,Fe),C.minZ=Math.min(C.minZ,Ge),C.maxZ=Math.max(C.maxZ,Oe),Bt&&(C.fMinX=Math.min(C.fMinX,Te),C.fMaxX=Math.max(C.fMaxX,Fe),C.fMinZ=Math.min(C.fMinZ,Ge),C.fMaxZ=Math.max(C.fMaxZ,Oe),C.hasFloor=!0),r.set(ze,C),i=Math.min(i,an),M=Math.max(M,cn),A=Math.min(A,ln),m=Math.max(m,dn),k=!0}),!k)return null;const mt=Math.max(e,V>0?V+.02:e),Tt=[...r.values()].map(s=>{const U=Math.sin(s.heading),x=Math.cos(s.heading),b=U,w=-x,W=Math.abs(b)>Math.abs(w),q=s.hasFloor?s.fMinX:s.minX,Yt=s.hasFloor?s.fMaxX:s.maxX,Gt=s.hasFloor?s.fMinZ:s.minZ,Bt=s.hasFloor?s.fMaxZ:s.maxZ,ve=W?(b>0?Yt:q)+(b>0?n/2:-n/2):(w>0?Bt:Gt)+(w>0?n/2:-n/2);return{g:s,isSide:W,plane:ve}}),nn=Tt.filter(s=>s.isSide).map(s=>s.plane),on=Tt.filter(s=>!s.isSide).map(s=>s.plane),Ht=[];for(const s of Tt){const{g:U}=s;if(s.isSide){let x=U.minZ,b=U.maxZ;for(const w of on)x=Math.min(x,w),b=Math.max(b,w);Ht.push({cx:s.plane,cz:(x+b)/2,cy:mt/2,length:b-x+o*2,thickness:n,height:mt,rotY:Math.PI/2})}else{let x=U.minX,b=U.maxX;for(const w of nn)x=Math.min(x,w),b=Math.max(b,w);Ht.push({cx:(x+b)/2,cz:s.plane,cy:mt/2,length:b-x+o*2,thickness:n,height:mt,rotY:0})}}const Ft=.4,be=M>i&&m>A;let jt=i-Ft,Vt=M+Ft,Ut=A-Ft,Wt=m+Ft;for(const s of Tt){const U=Math.sin(s.g.heading),x=-Math.cos(s.g.heading);s.isSide?U<0?jt=s.plane-n/2:Vt=s.plane+n/2:x<0?Ut=s.plane-n/2:Wt=s.plane+n/2}const sn=be?{cx:(jt+Vt)/2,cz:(Ut+Wt)/2,w:Vt-jt,d:Wt-Ut}:null,rn=be?{minX:i,maxX:M,minZ:A,maxZ:m,w:M-i,d:m-A,h:mt,height:V>0?V:mt}:null;return{segments:Ht,floor:sn,bbox:rn}},[g,rt,H,pt,p,u]),Ye=f&&!!(j&&j.segments&&j.segments.length),Be=d&&!!(j&&j.bbox&&j.bbox.w>0),Ke=(t,e)=>{const n=rt[e]||{position:[0,0,0],rotation:[0,0,0]},o=wt.get(t.id);if(!o)return n;const r=n.position||[0,0,0],i=(Array.isArray(n.rotation)?n.rotation[1]:0)||0,M=Math.cos(i),A=Math.sin(i),m=o.offset||[0,0,0];return{position:[r[0]+(m[0]||0)*M+(m[2]||0)*A,r[1]+(m[1]||0),r[2]-(m[0]||0)*A+(m[2]||0)*M],rotation:[0,i+(o.rotDegY||0)*Math.PI/180,0]}},at=Z,vt=!!at,ge=X(()=>{if(!at)return new Set;const t=new Set((at.compatibleGraphIds||[]).map(String)),e=new Set;for(const n of Object.values(S||{})){const o=p(n.variantId)||p(n.productId),r=o?.product_graph??o?.productGraph;r!=null&&t.has(String(r))&&e.add(String(n.id))}return e},[at,S,p]),Xt=tt(()=>{O.getState().clearPendingSlotPlacement?.(),O.getState().clearPendingHostedProduct?.()},[]),Ie=tt((t,e)=>{if(!e)return;const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=T.getState().productInstances?.[String(t)],M=o?.placementGroup??o?.placement_group??i?.placementGroup??null,A=Array.isArray(i?.position)?i.position:[0,0,0],m=i?.variantId??i?.productId??null,V=Number.isFinite(Number(i?.sequence))?Number(i.sequence):void 0;Xt(),Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:M,sequence:V,hostPlacementId:String(t),hostVariantId:m},k=>kt({productGraphId:k.productGraphId,variantId:k.variantId,placementGroup:k.placementGroup,position:A,sequence:k.sequence,hostPlacementId:k.hostPlacementId,hostVariantId:k.hostVariantId}).catch(()=>{}))},[Xt]),Zt=tt((t,e)=>{const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=o?.placementGroup??o?.placement_group??null,M=g[t-1]||g[t],A=Array.isArray(M?.position)?M.position:[0,0,0],m=g[t],V=m&&Number.isFinite(Number(m.sequence))?Number(m.sequence):void 0;Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:i,sequence:V},k=>kt({productGraphId:k.productGraphId,variantId:k.variantId,placementGroup:k.placementGroup,position:A,sequence:k.sequence}).catch(()=>{}))},[g]);Y(()=>{if(!N||g.length>0)return;const t=N;Xe(),Zt(0,t)},[N,g.length,Zt]);const{gaps:$e,onInsert:Qe}=Nn({systemId:l,count:g.length,positionOf:t=>rt[t]?.position||[0,0,0],insertAt:Zt}),Se=X(()=>{if(!N)return[];const t=B.getState();return xn(g,{candidate:N,getProduct:e=>t.getProduct?.(e),getDims:pt,config:Ve(),layout:rt})},[N,g,rt,pt]),Je=tt(t=>{const e=wn(t,{candidate:N});if(!e)return;const n=B.getState(),o=n.getProduct?.(e.variantId)||n.getProduct?.(e.productId),r=o?.productGraph??o?.product_graph??null,i=o?.placementGroup??o?.placement_group??null,M=e.transform?.position??t.position??[0,0,0],A=_n(e,t,g);Dt({type:Lt.PRODUCT_ADD,productGraphId:r,variantId:e.variantId??e.productId,placementGroup:i,anchor:e.anchor??null,sequence:A},m=>kt({productGraphId:m.productGraphId,variantId:m.variantId,placementGroup:m.placementGroup,position:M,sequence:m.sequence}).catch(()=>{})),Xe()},[N,g]),{selectedInst:oo,swapOrder:so,panelActions:ye,priceInfo:tn}=fn(),en=gn()("selectionPanel");Y(()=>{if(y==null)return;const t=S||{},e=String(y),n="__host";if(e.endsWith(n)){const o=e.slice(0,-n.length);if(t[o]||Object.values(t).some(r=>String(r?.id??r?.instanceId)===o))return}else if(t[y]||Object.values(t).some(o=>String(o?.instanceId??o?.id)===e))return;F?.()},[y,S,F]);const ao=ft(t=>t.placementPricing),co=D(t=>t.getChannelPriceConfig);return ct(Jt,{children:[I(Pn,{onSeeded:ot}),ct(bn,{isMobile:P,camera:{position:[2.6,2.2,4],fov:45},controlsTarget:[0,.5,0],onPointerMissed:()=>F?.(),groundShadowCatcher:!0,overlay:ct(Jt,{children:[!vt&&ye&&en?I(v,{actions:ye,priceInfo:tn}):null,vt&&I("div",{className:"placement-mode-overlay",children:ct("div",{className:"placement-mode-overlay__content",children:[ct("span",{className:"placement-mode-overlay__text",children:["Click on a highlighted slot to place ",I("strong",{children:at?.name})]}),I("button",{type:"button",className:"placement-mode-overlay__cancel",onClick:Xt,children:I("span",{className:"placement-mode-overlay__cancel-text",children:"Cancel"})})]})}),I(Fn,{name:"overlay"}),a&&I("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,zIndex:30,cursor:"default"}})]}),children:[Ye&&I(vn,{width:H?.width,depth:H?.depth,height:H?.height??j?.bbox?.h??2.7,showCeiling:_?.ceiling===!0,segments:j?.segments||null,floor:j?.floor||null}),Be&&(()=>{const t=Ze("SceneDimensions",An);return I(t,{bbox:j.bbox})})(),g.map((t,e)=>{const n=wt.get(t.id),o=rt[e]||{position:[0,0,0],rotation:[0,0,0]};return o.hidden?null:ct("group",{children:[n&&I(Qt,{instance:{id:n.id,instanceId:n.id,productId:n.hostVariantId,variantId:n.hostVariantId,position:o.position||[0,0,0],rotation:o.rotation||[0,0,0]},slotMaterials:{...lt,...$?.[n.hostedProductId]||{},...$?.[n.id]||{}},stateInstanceId:n.hostedProductId,onSelect:()=>T.getState().selectInstance(n.id),isSelected:String(y)===String(n.id),onMeasure:r=>Rt(n.hostVariantId,r),footprintExcludeItem:qt,hoverable:!0,focusable:!0},n.id),I(Qt,{instance:{...t,...Ke(t,e)},slotMaterials:{...lt,...$?.[t.id]||$?.[t.instanceId]||{}},onSelect:(r,i,M)=>{if(vt){ge.has(String(t.id))&&Ie(t.id,at);return}T.getState().selectInstance(r,M??null)},isSelected:!vt&&String(y)===String(t.instanceId??t.id),onMeasure:r=>Rt(t.productId,r),footprintExcludeItem:qt,hoverable:!0,focusable:!0}),vt&&ge.has(String(t.id))&&I(Jn,{position:[o.position?.[0]||0,(o.position?.[1]||0)+.45,o.position?.[2]||0],onClick:()=>Ie(t.id,at)})]},t.id??t.instanceId??e)}),st.map((t,e)=>I(Sn,{selected:y===t.id,disabled:!!t.locked,position:t.position||[0,0,0],rotationY:(Array.isArray(t.rotation)&&t.rotation[1]||0)*Math.PI/180,onCommit:({position:n,rotationY:o})=>{K(t.id,n),it(t.id,[0,o*180/Math.PI,0]),Xn({allowRevert:!0}).catch(()=>{})},children:I(Qt,{instance:{...t,position:[0,0,0],rotation:[0,0,0]},slotMaterials:{...lt,...$?.[t.id]||$?.[t.instanceId]||{}},onMeasure:n=>Rt(t.productId,n),footprintExcludeItem:qt})},t.id??t.instanceId??`free-${e}`)),Se.length>0?I(Mn,{targets:Se,onPick:Je}):I(yn,{gaps:$e,onInsert:Qe})]})]})}const Ue=new Set;function eo(){Vn();const P=D(a=>a.systemLayoutTemplate),v=D(a=>a.systemTheme),S=D(a=>a.systemThemeRecord);Bn(v,S);const p=Yn(S)||(v?String(v).trim().toLowerCase():null);let c=P;try{const a=new URLSearchParams(window.location.search);a.has("template")?c=a.get("template"):a.has("theme")&&(c=a.get("theme"))}catch{}c=c||P||p||null;const F=Un();F&&(c=F),!F&&!P&&c&&c===p&&!jn(c)&&!/^theme\d+$/.test(c)&&!Ue.has(c)&&Ue.add(c),Wn(c);const y=Hn(c);return ct(Jt,{children:[I(y,{Scene:to,template:c}),I(Gn,{}),I(On,{})]})}export{to as SharedConfiguratorScene,eo as default};
|
package/dist/8a22e8944f.css
CHANGED
|
@@ -322,6 +322,17 @@ html[data-watermark="off"] .wizard-price { bottom: 22px; }
|
|
|
322
322
|
letter-spacing: 1.4px;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
+
/* THE STEP ALREADY SAID IT.
|
|
326
|
+
This shell's steps are one option set each — `push(id, f?.name)` in ui/layouts/shellShared
|
|
327
|
+
builds `{ label: <the set's name>, featureIds: [id] }` — so the tab above the panel and the
|
|
328
|
+
set's own heading are always the same words, one under the other ("Sofa Pieces" / "SOFA
|
|
329
|
+
PIECES"). Only the TOP-LEVEL heading goes: `data-part="option-set/title"` is what
|
|
330
|
+
ui/OptionSetSection emits, while a nested child set is a plain `.sidebar__section-title`
|
|
331
|
+
with no data-part (ui/SidebarComponents) — those name something the tab does not, and stay. */
|
|
332
|
+
.wizard-panel__body [data-part="option-set/title"] {
|
|
333
|
+
display: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
325
336
|
/* A few card styles hardcode var(--text-primary, #363636) (text + the option-card selected border)
|
|
326
337
|
instead of tokens — retint the label text to the warm accent (matches the
|
|
327
338
|
toolbar / active-step colour) and the selected border to the accent. */
|
package/dist/98f3644031.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fragment as fe,jsx as e,jsxs as E}from"react/jsx-runtime";import{Suspense as W,useEffect as I,useRef as x,useSyncExternalStore as N}from"react";import{getSceneAccessGranted as j,subscribeSceneAccess as Q}from"./87f511c4a8.js";import*as
|
|
1
|
+
import{Fragment as fe,jsx as e,jsxs as E}from"react/jsx-runtime";import{Suspense as W,useEffect as I,useRef as x,useSyncExternalStore as N}from"react";import{getSceneAccessGranted as j,subscribeSceneAccess as Q}from"./87f511c4a8.js";import*as b from"three";import{Canvas as U,useThree as A}from"@react-three/fiber";import{setSceneContext as T,disposeSceneExtras as _}from"./95a44ebec2.js";import{PerspectiveCamera as q,OrbitControls as J}from"@react-three/drei";import K from"./be337ddda5.js";import F from"./8f60e5059a.js";import"./9c6c598569.js";import X from"./d4378d9afa.js";import Y from"./00a41227ff.js";import Z from"./28a9d58274.js";import $ from"./8db8655f21.js";import{rememberRenderer as ee}from"./b59b0dde17.js";import te from"./14c83bc57a.js";import{applyEnvironmentToRenderer as oe}from"./4e7d0a0d4a.js";import{setR3FState as L}from"./e1cd279733.js";import{computeTopDownView as re,computeFitView as ne,ORTHO_FOV as z}from"./85af90fade.js";const B=(t,o)=>t?o:Math.max(o,1e5);function ie({defaultPosition:t,fov:o,controlsRef:a,controlsTarget:f,maxDistance:c}){const{scene:p,size:m,invalidate:h}=A(),u=F(r=>r.is3D)!==!1,g=x(),w=x(u),D=x(!1);return I(()=>{const r=g.current,n=a?.current;if(!r)return;const y=w.current;w.current=u;const k=!D.current;D.current=!0;const C=m.width/Math.max(m.height,1);if(n&&(n.maxDistance=B(u,c)),!u){const i=re({scene:p,aspect:C,fov:z});if(!i)return;r.fov=z,r.position.set(i.position[0],i.position[1],i.position[2]),r.updateProjectionMatrix(),n&&(n.target.set(i.target[0],i.target[1],i.target[2]),n.update()),h?.();return}if(y&&!k){r.updateProjectionMatrix(),h?.();return}r.fov=o;const S=y?null:ne({scene:p,aspect:C,fov:o}),v=S?.position||t,M=S?.target||f;r.position.set(v[0],v[1],v[2]),r.updateProjectionMatrix(),n&&(n.target.set(M[0],M[1],M[2]),n.update()),h?.()},[u,p,m.width,m.height]),e(q,{ref:g,makeDefault:!0,position:t,fov:o})}function ae(){const{gl:t,scene:o,camera:a,invalidate:f}=A(),c=N(Q,j,()=>!1);return I(()=>(L({gl:t,scene:o,camera:a}),c?T({THREE:b,scene:o,camera:a,renderer:t,invalidate:f}):T(null),()=>{_(),T(null),L(null)}),[t,o,a,c]),null}function se({background:t="#f4f4f5"}){return E(fe,{children:[e("color",{attach:"background",args:[t]}),e("ambientLight",{intensity:.7}),e("directionalLight",{position:[4,6,4],intensity:1.1,castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024})]})}function ce({env:t}){return!!t&&Object.keys(t).length>0?null:E("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.001,0],receiveShadow:!0,children:[e("circleGeometry",{args:[21,64]}),e("shadowMaterial",{transparent:!0,opacity:.28,color:"#000000"})]})}function ue({children:t,overlay:o,isMobile:a=!1,is3D:f,camera:c={position:[2.6,2.2,4],fov:45},controlsTarget:p=[0,.5,0],renderCamera:m=!0,renderControls:h=!0,minDistance:u=1.2,maxDistance:g=14,orbitProps:w,renderFallbackLighting:D=!0,fallbackBackground:r="#f4f4f5",groundShadowCatcher:n=!1,fallback:y=null,dpr:k=[1,2],shadows:C=!0,frameloop:S,canvasStyle:v,onPointerMissed:M,onCreated:i}){const P=x(),O=K(s=>s.systemEnvironment),V=F(s=>s.is3D),G=F(s=>s.captureMode)===!0,R=f??V!==!1,l=O&&Object.keys(O).length>0?O:null,H=B(R,g);return E("div",{className:"scene-canvas",style:{position:"relative",width:"100%",height:"100%"},children:[E(U,{shadows:C,dpr:k,...S?{frameloop:S}:{},style:{width:"100%",height:"100%",...v||{}},onPointerMissed:M,onCreated:s=>{const{gl:d}=s;ee(d),d.outputColorSpace=b.SRGBColorSpace,d.toneMapping=b.ACESFilmicToneMapping,d.toneMappingExposure=.9,d.shadowMap.type=b.PCFSoftShadowMap,l&&oe(l,d),j()&&i?.(s)},children:[l&&e(X,{env:l,isMobile:a,is3D:R,reducedQuality:!!a,captureMode:G}),!l&&D&&e(se,{background:r}),n&&R&&!G&&e(ce,{env:l}),m&&e(ie,{defaultPosition:c.position,fov:c.fov,controlsRef:P,controlsTarget:p,maxDistance:g}),e(W,{fallback:y,children:t}),h&&e(J,{ref:P,makeDefault:!0,target:p,enablePan:!0,minDistance:u,maxDistance:H,maxPolarAngle:Math.PI/2.05,enableRotate:R,...w||{}}),e(ae,{}),e(te,{controlsRef:P}),e(Y,{})]}),o,e(Z,{}),e($,{})]})}export{ue as default};
|
package/dist/ab6c80484f.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import P from"./8f60e5059a.js";import f from"./9c6c598569.js";import{getPlacementType as p,PLACEMENT_TYPES as S}from"./4d7a0d1897.js";import{getPlacementStrategy as x}from"./281cf952fa.js";import{resolveTargetRenderer as T}from"./58e6419ba8.js";function v(e){f.getState().setPendingPlacementPiece?.(e)}function I(){f.getState().clearPendingPlacementPiece?.()}function z(){return f.getState().pendingPlacementPiece||null}function A(e,i={}){try{const o=f.getState().productInstances||{};if(Object.keys(o).length===0)return"append"}catch{}if(!i?.movable)try{if(typeof x()?.computeTargets=="function"&&T())return"arm"}catch{}return p()===S.INSERT_BETWEEN&&!i?.movable?"arm":"append"}function M(e,i,{y:o=.6,spread:r=.45}={}){const s=t=>i(t)||[0,0,0],d=(t,a)=>{const n=s(t),c=s(a),l=n[0]-c[0],g=n[2]-c[2],m=Math.hypot(l,g);return m>1e-6?[l/m*r,g/m*r]:[r,0]},u=[];for(let t=0;t<=e;t++){let a;if(e===0)a=[0,o,0];else if(t===0){const n=s(0),[c,l]=e>1?d(0,1):[-r,0];a=[n[0]+c,o,n[2]+l]}else if(t===e){const n=s(e-1),[c,l]=e>1?d(e-1,e-2):[r,0];a=[n[0]+c,o,n[2]+l]}else{const n=s(t-1),c=s(t);a=[(n[0]+c[0])/2,o,(n[2]+c[2])/2]}u.push({index:t,position:a})}return u}function N(e,{modelUrl:i,name:o}={}){const r=e?.id??e;if(r==null)return!1;const s=P.getState();return typeof s.setPendingHostedProduct!="function"?!1:(s.setPendingHostedProduct({id:r,hostedProductId:r,name:o??e?.name??null,modelUrl:i??e?.modelUrl??null,scale:e?.scale??[1,1,1]}),!0)}function U(){P.getState().clearPendingHostedProduct?.()}export{N as armHostedProduct,v as armPlacement,M as computeGaps,U as disarmHostedProduct,I as disarmPlacement,z as getPendingPlacement,A as resolveAddMode};
|
package/dist/baeaed46c9.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import i,{useEffect as h,useState as V,Suspense as c}from"react";import s from"./8f60e5059a.js";import{useUIRegions as X}from"./9840b9ce12.js";import{useLabels as Y}from"./28d887bf8a.js";import Z from"./9c6c598569.js";import ee from"./be337ddda5.js";import{useCopilotAvailable as te}from"./672404d987.js";import ae from"./ce663020e4.js";import oe from"./921bf270dd.js";import se from"./35d8449ed8.js";import ie from"./d0f9681634.js";import ne from"./a822c5e4f2.js";import le from"./bdec200d00.js";import w from"./9794652102.js";import re from"./54413c1eae.js";import{resolveComponent as n,useComponentRegistry as A}from"./882bc739c8.js";import k from"./37596ace72.js";import ce from"./26155bf68c.js";import me from"./2cab5c5c23.js";import{useHasIcon as be}from"./09c4973968.js";import{ChevronRight as de,LogoIcon as ue,MobileConfiguratorIcon as pe,MobileChatIcon as ve,MobileLiveStatusIcon as fe}from"./c5e990946e.js";import"./7bfb0ecfbb.css";import"@copilotkit/react-ui/styles.css";const z=i.lazy(()=>import("./7a748aae59.js")),_e=i.lazy(()=>import("./54f0fcf38b.js")),B=i.lazy(()=>import("./5d5e8a9c58.js")),E=i.lazy(()=>import("./28df2aa12f.js")),P=i.lazy(()=>import("./4c24338793.js")),I=i.lazy(()=>import("./f89d7cd931.js"));function $(){return ae(),null}function ge(l){if(!l||l==="default")return"";const m=String(l).replace(/[^a-z0-9-]/g,"");return m?` main-layout--tpl-${m}`:""}function ye({Scene:l,template:m}){A();const d=n("Sidebar",le);A();const G=n("SceneToolbar",re),x=n("SaveProjectButton",me),O=n("GenerateAssetsButton",ce),R=n("ChatBar",_e),N=ge(m),M=ee(t=>t.systemName)||"Configurator",a=X(),b=Y(),C=s(t=>t.sidebarOpen),T=s(t=>t.jsonPanelOpen),j=be("logo"),u=s(t=>t.isMobile),p=s(t=>t.setIsMobile),{isOn:v}=ie({isMobile:u}),he=s(t=>t.addNotification),D=s(t=>t.openModal),H=Z(t=>t.setCameraPosition),r=s(t=>t.mobileActiveAccordion),f=s(t=>t.setMobileActiveAccordion),U=s(t=>t.isSceneLoading),_=s(t=>t.isLayoutLoading),Ne=s(t=>t.liveStatusSummary),g=s(t=>t.isLandscapeMode),W=s(t=>t.landscapeMethod),y=te();se({disabled:u}),h(()=>{const t=()=>{if(s.getState().isLandscapeMode){p(!0);return}p(window.innerWidth<768)};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[p]);const[L,q]=V(!1);h(()=>{const t="ontouchstart"in window||navigator.maxTouchPoints>0,S=()=>{const Q=Math.min(window.innerWidth,window.innerHeight)<768;q(t&&Q)};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]),h(()=>{window.dispatchEvent(new Event("resize"))},[g]);const{handleGenerateAssets:F,isGenerating:J}=oe({openModal:D,setCameraPosition:H}),K=U?"processing":"stable";return u?o("div",{className:`main-layout main-layout--mobile${g?" main-layout--landscape":""}${W==="css-rotation"?" main-layout--css-rotated":""}${N}`,children:[e(w,{}),y&&e($,{}),a.header&&o("div",{className:"mobile-top-bar",children:[o("div",{className:"mobile-top-bar__logo",children:[j?e(ue,{className:"mobile-top-bar__logo-icon"}):null,e("span",{className:"mobile-top-bar__title",children:M})]}),o("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[e(x,{disabled:_}),e(O,{onClick:F,isGenerating:J,disabled:_,className:"header__generate-btn"})]})]}),o("div",{className:`mobile-main${g?" mobile-main--landscape":""}`,children:[o("main",{className:"main-layout__scene",children:[e(l,{isMobile:L}),a.notifications&&e(k,{maxCount:1}),a.toolbar&&e(G,{variant:"mobile"})]}),(a.sidebar||a.chat||a.panels)&&o("div",{"data-sdk-overlay":!0,className:"mobile-tabs",style:_?{opacity:.5,pointerEvents:"none"}:void 0,children:[o("div",{className:"mobile-tabs__bar",children:[a.sidebar&&o("button",{className:`mobile-tabs__tab ${r==="configurator"?"mobile-tabs__tab--active":""}`,onClick:()=>f("configurator"),children:[e(pe,{}),e("span",{className:"mobile-tabs__tab-label",children:M})]}),a.chat&&o("button",{className:`mobile-tabs__tab ${r==="chat"?"mobile-tabs__tab--active":""}`,onClick:()=>f("chat"),children:[e(ve,{}),o("span",{className:"mobile-tabs__tab-label",children:[b("tabs.chat","Chat"),!y&&o("span",{style:{marginLeft:"4px",fontSize:"12px",color:"#ff6b6b"},children:["(",e("span",{style:{color:"#ff9800"},children:"\u26A0"}),")"]})]})]}),a.panels&&v("liveStatus")&&o("button",{className:`mobile-tabs__tab ${r==="livestatus"?"mobile-tabs__tab--active":""}`,onClick:()=>f("livestatus"),children:[e(fe,{}),b("tabs.status","Status")?e("span",{className:"mobile-tabs__tab-label",children:b("tabs.status","Status")}):null,e("span",{className:`mobile-tabs__badge-dot mobile-tabs__badge-dot--${K}`})]})]}),o("div",{className:"mobile-tabs__content",children:[a.sidebar&&e("div",{className:"mobile-tabs__panel mobile-tabs__panel--configurator",style:{display:r==="configurator"?void 0:"none"},children:e(d,{})}),a.chat&&e("div",{className:"mobile-tabs__panel mobile-tabs__panel--chat",style:{display:r==="chat"?void 0:"none"},children:e(c,{fallback:null,children:e(R,{alwaysExpanded:!0})})}),a.panels&&v("liveStatus")&&e("div",{className:"mobile-tabs__panel mobile-tabs__panel--livestatus",style:{display:r==="livestatus"?void 0:"none"},children:e(c,{fallback:null,children:i.createElement(n("LiveStatusPanel",z),{embedded:!0})})})]})]})]}),o(c,{fallback:null,children:[e(B,{}),e(E,{}),e(P,{}),e(I,{})]})]}):o("div",{className:`main-layout${N}`,children:[e(w,{}),y&&e($,{}),e("div",{className:"main-layout__content",children:o("main",{className:`main-layout__scene${C&&a.sidebar?" main-layout__scene--sidebar-open":""}`,children:[e(l,{isMobile:L}),a.header&&e(ne,{}),a.sidebar?C?e(d,{}):e("button",{className:"sidebar-toggle-btn",onClick:()=>s.getState().openSidebar(),title:b("sidebar.open","Open sidebar"),children:e(de,{})}):a.chat&&e(d,{}),a.panels&&T&&v("liveStatus")&&e(c,{fallback:null,children:i.createElement(n("LiveStatusPanel",z))})]})}),a.notifications&&e(k,{}),o(c,{fallback:null,children:[e(B,{}),e(E,{}),e(P,{}),e(I,{})]})]})}var Fe=ye;export{Fe as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imagineio/configurator-sdk",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.3",
|
|
4
4
|
"description": "Configurator SDK — backend Configuration Engine client, state stores, shared 3D scene primitives, and pluggable placement (strategy + type). Drives every configurator (kitchen, sectional, …) from one self-contained surface.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|