@roomle/web-sdk 4.1.0-alpha.8 → 4.1.0
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/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{api-CsEsgakO.mjs → api-COog8C3X.mjs} +2 -2
- package/lib/{api-CsEsgakO.mjs.map → api-COog8C3X.mjs.map} +1 -1
- package/lib/asset-loader.worker-eqHzNAwa.mjs.map +1 -1
- package/lib/budgeteer.sw-BUMElkO1.mjs.map +1 -1
- package/lib/configurator-9q_a9B9k.mjs +2 -0
- package/lib/configurator-Ducp-Nxf.mjs +45 -0
- package/lib/{configurator-D6omMUll.mjs.map → configurator-Ducp-Nxf.mjs.map} +1 -1
- package/lib/glb-viewer-BiRBZWfu.mjs +2 -0
- package/lib/{glb-viewer-Dc3-bICf.mjs → glb-viewer-BvnOSeLd.mjs} +23 -23
- package/lib/{glb-viewer-Dc3-bICf.mjs.map → glb-viewer-BvnOSeLd.mjs.map} +1 -1
- package/lib/{homag-intelligence-w4uDp7Rq.mjs → homag-intelligence-DWfY5Rhy.mjs} +3 -3
- package/lib/{homag-intelligence-w4uDp7Rq.mjs.map → homag-intelligence-DWfY5Rhy.mjs.map} +1 -1
- package/lib/{material-viewer-BGCm6x76.mjs → material-viewer-DShIT0xY.mjs} +20 -20
- package/lib/{material-viewer-BGCm6x76.mjs.map → material-viewer-DShIT0xY.mjs.map} +1 -1
- package/lib/{packages-BiP7luUF.mjs → packages-6njsPLBJ.mjs} +5 -5
- package/lib/{packages-BiP7luUF.mjs.map → packages-6njsPLBJ.mjs.map} +1 -1
- package/lib/planner-ABiXTXmc.mjs +44 -0
- package/lib/{planner-Cy70IyzR.mjs.map → planner-ABiXTXmc.mjs.map} +1 -1
- package/lib/planner-v3xjVi85.mjs +2 -0
- package/lib/roomle-headless.d.ts +6 -3
- package/lib/roomle-headless.js +61 -61
- package/lib/roomle-headless.js.map +1 -1
- package/lib/{main-B9d421La.mjs → roomle-sdk-BdEmEYZg.mjs} +2554 -2529
- package/lib/roomle-sdk-BdEmEYZg.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +6 -3
- package/lib/roomle-sdk.js +7 -7
- package/lib/{script-loader-PTykLIvS.mjs → script-loader-BTy3OZVv.mjs} +2 -2
- package/lib/{script-loader-PTykLIvS.mjs.map → script-loader-BTy3OZVv.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{tools-core-BI0CslNo.mjs → tools-core-T65Q1eht.mjs} +5 -5
- package/lib/{tools-core-BI0CslNo.mjs.map → tools-core-T65Q1eht.mjs.map} +1 -1
- package/package.json +2 -2
- package/lib/configurator-D6omMUll.mjs +0 -45
- package/lib/configurator-DrGKSUYg.mjs +0 -2
- package/lib/glb-viewer-DPhBJxzx.mjs +0 -2
- package/lib/main-B9d421La.mjs.map +0 -1
- package/lib/planner-Cy70IyzR.mjs +0 -44
- package/lib/planner-K2Y2fdcw.mjs +0 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { A as e, C as t, H as n, I as r, V as i, Z as a, c as o, ct as s, ft as c, n as l, ot as u, st as d, tt as f, u as p, w as m } from "./roomle-sdk-BdEmEYZg.mjs";
|
|
2
|
+
import { t as h } from "./script-loader-BTy3OZVv.mjs";
|
|
3
|
+
//#region packages/planner-core/src/input/planner-input-manager.ts
|
|
4
|
+
var g = class extends r {
|
|
5
|
+
_canDrag(e) {
|
|
6
|
+
return !0;
|
|
7
|
+
}
|
|
8
|
+
}, _ = [
|
|
9
|
+
new d("script-loader", h),
|
|
10
|
+
new d("planner-input-manager", g, u.CONTEXT),
|
|
11
|
+
new d("logger", f),
|
|
12
|
+
new d("planner-mesh-generator", o),
|
|
13
|
+
new d("configurator-view-model", t, u.CONTEXT),
|
|
14
|
+
new d("rapi-access", s),
|
|
15
|
+
new d("global-init-data", a),
|
|
16
|
+
new d("planner-selection-handler", m)
|
|
17
|
+
], v = class extends n {
|
|
18
|
+
constructor(e, t) {
|
|
19
|
+
super(e), this._activePlugins = t || [];
|
|
20
|
+
}
|
|
21
|
+
setupGlobals() {}
|
|
22
|
+
setupDependencies() {
|
|
23
|
+
l.setup(_), this.lookup("logger", this._context), this.lookup("planner-kernel-access", this._context).init(e.PLANNER);
|
|
24
|
+
}
|
|
25
|
+
cleanUpGlobals() {
|
|
26
|
+
throw Error("Method not implemented.");
|
|
27
|
+
}
|
|
28
|
+
cleanUpDependencies() {
|
|
29
|
+
throw Error("Method not implemented.");
|
|
30
|
+
}
|
|
31
|
+
async bootFinished() {
|
|
32
|
+
this._planner = new p(this._context, this._activePlugins), this._planner.getMain = () => this, window.RoomlePlanner || (this._activePlugins.length, window.RoomlePlanner = this._planner), this.lookup("init-data", this._context)?.hi && c() && await this._planner.setupHomagIntelligence();
|
|
33
|
+
}
|
|
34
|
+
getApi() {
|
|
35
|
+
return this._planner;
|
|
36
|
+
}
|
|
37
|
+
getContextName() {
|
|
38
|
+
return i.PLANNER;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { v as t };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=planner-ABiXTXmc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-
|
|
1
|
+
{"version":3,"file":"planner-ABiXTXmc.mjs","names":[],"sources":["../../packages/planner-core/src/input/planner-input-manager.ts","../../packages/planner-core/src/utils/injectables.ts","../../packages/planner-core/src/planner.ts"],"sourcesContent":["import type { INPUT_EVENT_TYPE } from '../../../common-core/src/input/input-manager';\nimport InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class PlannerInputManager extends InputManager {\n protected _canDrag(_type: INPUT_EVENT_TYPE): boolean {\n return true;\n }\n}\n","import ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport Logger from '../../../common-core/src/logger';\nimport { default as PlannerMeshGenerator } from '../webgl/planner-mesh-generator';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport PlannerInputManager from '../input/planner-input-manager';\nimport PlannerSelectionHandler from './planner-selection-handler';\nimport GlobalInitData from '../../../common-core/src/utils/global-init-data';\nimport ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'planner-input-manager',\n PlannerInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment(\n 'planner-mesh-generator',\n PlannerMeshGenerator,\n ),\n new DependencyInjectionAssignment(\n 'configurator-view-model',\n ConfiguratorViewModel,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment('global-init-data', GlobalInitData),\n new DependencyInjectionAssignment(\n 'planner-selection-handler',\n PlannerSelectionHandler,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport { RoomlePlanner } from './roomle-planner';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { INJECTABLES } from './utils/injectables';\nimport type PlannerKernelAccess from './services/planner-kernel-access';\nimport type Logger from '../../common-core/src/logger';\nimport { KERNEL_TYPE } from '../../common-core/src/services/common-kernel-access';\nimport type { PluginName } from '../../configurator-core/src/utils/plugin-types';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport { isInIframe } from '../../common-core/src/utils/rapi-utils';\n\nexport class Planner<\n P extends readonly PluginName[] = readonly [],\n> extends Main {\n private _planner: RoomlePlanner<P>;\n private _activePlugins: P;\n\n constructor(creator?: string, activePlugins?: P) {\n super(creator);\n this._activePlugins = (activePlugins || []) as P;\n }\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n // instantiate kernel acccess\n // instantiate pka\n // set pka on kernel access\n const plannerKernelAccess = this.lookup<PlannerKernelAccess>(\n 'planner-kernel-access',\n this._context,\n );\n plannerKernelAccess.init(KERNEL_TYPE.PLANNER);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._planner = new RoomlePlanner<P>(this._context, this._activePlugins);\n\n this._planner.getMain = () => {\n return this;\n };\n\n if (!window.RoomlePlanner) {\n if (this._activePlugins.length === 0) {\n // cast to unknown because we know that the planner is a RoomlePlanner\n window.RoomlePlanner = this._planner as unknown as RoomlePlanner;\n } else {\n window.RoomlePlanner = this._planner as RoomlePlanner<\n readonly PluginName[]\n >;\n }\n }\n\n const initData = this.lookup<InitData>('init-data', this._context);\n\n if (initData?.hi && isInIframe()) {\n await this._planner.setupHomagIntelligence();\n }\n }\n\n public getApi(): RoomlePlanner<P> {\n return this._planner;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.PLANNER;\n }\n}\n"],"mappings":";;;AAGA,IAAqB,IAArB,cAAiD,EAAa;CAC5D,SAAmB,GAAkC;AACnD,SAAO;;GCQE,IAA+C;CAC1D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EACF,yBACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EACF,0BACA,EACD;CACD,IAAI,EACF,2BACA,GACA,EAAQ,QACT;CACD,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EAA8B,oBAAoB,EAAe;CACrE,IAAI,EACF,6BACA,EACD;CACF,ECxBY,IAAb,cAEU,EAAK;CAIb,YAAY,GAAkB,GAAmB;AAE/C,EADA,MAAM,EAAQ,EACd,KAAK,iBAAkB,KAAiB,EAAE;;CAE5C,eAA+B;CAI/B,oBAAoC;AAMN,EAL5B,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS,EAIhB,KAAK,OAC/B,yBACA,KAAK,SACN,CACmB,KAAK,EAAY,QAAQ;;CAG/C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAoB5C,EAnBA,KAAK,WAAW,IAAI,EAAiB,KAAK,UAAU,KAAK,eAAe,EAExE,KAAK,SAAS,gBACL,MAGJ,OAAO,kBACN,KAAK,eAAe,QAEtB,OAAO,gBAAgB,KAAK,WAQf,KAAK,OAAiB,aAAa,KAAK,SAAS,EAEpD,MAAM,GAAY,IAC9B,MAAM,KAAK,SAAS,wBAAwB;;CAIhD,SAAkC;AAChC,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
|
package/lib/roomle-headless.d.ts
CHANGED
|
@@ -4207,6 +4207,8 @@ export declare class IdbManager implements Context {
|
|
|
4207
4207
|
pruneOldEntries(): Promise<void>;
|
|
4208
4208
|
}
|
|
4209
4209
|
|
|
4210
|
+
export declare type IdentifiablePlanObject = Pick<UiPlanObject, 'catalogItemId' | 'configurationHash'>;
|
|
4211
|
+
|
|
4210
4212
|
export declare interface ImageExportOptions {
|
|
4211
4213
|
ssaa?: number;
|
|
4212
4214
|
size?: number;
|
|
@@ -6402,9 +6404,6 @@ export declare class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
6402
6404
|
private _roomlePlannerCallback;
|
|
6403
6405
|
private _homagIntelligence;
|
|
6404
6406
|
private _itemsLoadingStatePromises;
|
|
6405
|
-
/**
|
|
6406
|
-
* Debounced wrapper around {@link _saveConfiguration}
|
|
6407
|
-
*/
|
|
6408
6407
|
private _debouncedSaveConfiguration;
|
|
6409
6408
|
/**
|
|
6410
6409
|
* In-flight configuration auto-saves (config POST + thumbnails), awaited by
|
|
@@ -6702,6 +6701,7 @@ export declare class PlannerSceneManager extends ConfiguratorSceneManager implem
|
|
|
6702
6701
|
private _insertRapiItems;
|
|
6703
6702
|
insertRapiObjects(rapiIds: InsertItemIdInfo[]): Promise<InsertItemResult[]>;
|
|
6704
6703
|
private _scheduleConfigurationSave;
|
|
6704
|
+
private _createConfigurationSaveRequest;
|
|
6705
6705
|
awaitPendingConfigurationSaves(): Promise<void>;
|
|
6706
6706
|
private _saveConfiguration;
|
|
6707
6707
|
externalObjectRequestAddOnContainers(groupId: string, subArticleId: string): Promise<void>;
|
|
@@ -7454,6 +7454,7 @@ export declare class RapiAccess implements Context {
|
|
|
7454
7454
|
private _itemLoaded;
|
|
7455
7455
|
private _currentToken;
|
|
7456
7456
|
private _savesByHash;
|
|
7457
|
+
private _confirmedIdByRuntimeHash;
|
|
7457
7458
|
private _onlineHandler;
|
|
7458
7459
|
private _configurator;
|
|
7459
7460
|
constructor(creator: string);
|
|
@@ -7507,6 +7508,8 @@ export declare class RapiAccess implements Context {
|
|
|
7507
7508
|
getMaterialsByGroup(groupIdsToCheck: RapiId[]): Promise<RapiMaterialGroup[]>;
|
|
7508
7509
|
private _flushOfflineQueue;
|
|
7509
7510
|
private _setQueuedConfiguration;
|
|
7511
|
+
private _recordConfirmedId;
|
|
7512
|
+
getConfirmedConfigurationId(runtimeHash: string): RapiId | null;
|
|
7510
7513
|
saveConfiguration(configuration: RapiConfiguration): Promise<RapiConfiguration>;
|
|
7511
7514
|
awaitPendingSaves(): Promise<void>;
|
|
7512
7515
|
getShortUrl(referencedId: RapiId, type: SHORT_TYPES): Promise<RapiShortId>;
|
package/lib/roomle-headless.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { a as e, i as t, n, r, t as i } from "./packages-
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./packages-6njsPLBJ.mjs";
|
|
2
2
|
import { i as a, t as o } from "./kernel-BWfRHWkW.mjs";
|
|
3
3
|
import { mt as s, vt as c } from "./threejs-utils-mqRHdm-p.mjs";
|
|
4
4
|
import { Si as l, m as u, nt as d } from "./three.core-0KaTx8dm.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { createRequire as
|
|
5
|
+
import { A as f, F as p, G as m, J as h, K as ee, M as te, N as ne, P as re, S as ie, W as ae, a as oe, at as se, b as ce, ct as le, dt as ue, i as de, j as fe, k as pe, l as g, lt as _, m as v, mt as y, o as b, ot as x, q as S, r as C, s as w, st as T, t as E, u as D, ut as O, x as k, y as A, z as j } from "./roomle-sdk-BdEmEYZg.mjs";
|
|
6
|
+
import { n as M } from "./roomle-renderer-FUqNfNIf.mjs";
|
|
7
|
+
import { n as N } from "./script-loader-BTy3OZVv.mjs";
|
|
8
|
+
import { t as P } from "./configurator-Ducp-Nxf.mjs";
|
|
9
|
+
import { t as F } from "./planner-ABiXTXmc.mjs";
|
|
10
|
+
import { n as I, t as L } from "./glb-viewer-BvnOSeLd.mjs";
|
|
11
|
+
import { t as R } from "./api-COog8C3X.mjs";
|
|
12
|
+
import { t as z } from "./roomle-headless-setup-7xnQlZl3.mjs";
|
|
13
|
+
import { createRequire as B } from "module";
|
|
14
14
|
//#region packages/headless-core/src/headless-script-loader.ts
|
|
15
|
-
var
|
|
15
|
+
var me = B(import.meta.url), V = {}, H = [
|
|
16
16
|
[
|
|
17
17
|
"ConfiguratorKernel.wasm",
|
|
18
18
|
"ConfiguratorKernel",
|
|
@@ -28,7 +28,7 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
28
28
|
"RoomleToolsCore",
|
|
29
29
|
"roomle-core-hsc/wasm_modern/RoomleToolsCore.js"
|
|
30
30
|
]
|
|
31
|
-
],
|
|
31
|
+
], he = class {
|
|
32
32
|
constructor(e) {
|
|
33
33
|
this._creator_ = e;
|
|
34
34
|
}
|
|
@@ -40,7 +40,7 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
40
40
|
}
|
|
41
41
|
let n = this._resolveEntry(e);
|
|
42
42
|
if (n) {
|
|
43
|
-
let [, r, i] = n, a =
|
|
43
|
+
let [, r, i] = n, a = me(e.startsWith("/") ? e : i);
|
|
44
44
|
globalThis[r] = a.default || a, V[t.id] = !0;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -64,12 +64,12 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
64
64
|
return Promise.all(t);
|
|
65
65
|
}
|
|
66
66
|
resolveKernelPaths(e) {
|
|
67
|
-
return
|
|
67
|
+
return N(e);
|
|
68
68
|
}
|
|
69
69
|
cleanUp() {
|
|
70
70
|
V = {};
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, ge = class {
|
|
73
73
|
get _lifeCycleManager() {
|
|
74
74
|
return globalThis.__RML__DI__?.lookup("life-cycle-manager", this._creator_);
|
|
75
75
|
}
|
|
@@ -135,7 +135,7 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
135
135
|
pause() {}
|
|
136
136
|
resume() {}
|
|
137
137
|
destroy() {}
|
|
138
|
-
},
|
|
138
|
+
}, _e = class {
|
|
139
139
|
constructor(e) {
|
|
140
140
|
this._creator_ = e;
|
|
141
141
|
}
|
|
@@ -163,11 +163,11 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
163
163
|
}
|
|
164
164
|
setAlwaysUseCache(e) {}
|
|
165
165
|
preFillAssetCache(e, t) {}
|
|
166
|
-
},
|
|
166
|
+
}, ve = class extends g {
|
|
167
167
|
_getScriptLoaderKernelId(e) {
|
|
168
|
-
return e ===
|
|
168
|
+
return e === f.PLANNER ? "kernel-planner" : "kernel";
|
|
169
169
|
}
|
|
170
|
-
},
|
|
170
|
+
}, ye = class {
|
|
171
171
|
wrap(e) {
|
|
172
172
|
return new Proxy(e, { get(e, t) {
|
|
173
173
|
let n = e[t];
|
|
@@ -180,33 +180,33 @@ var ye = ve(import.meta.url), V = {}, H = [
|
|
|
180
180
|
} : n;
|
|
181
181
|
} });
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, be = class extends de {
|
|
184
184
|
async addReflectiveFloor(e) {}
|
|
185
185
|
}, U = null;
|
|
186
|
-
function
|
|
186
|
+
function xe(e) {
|
|
187
187
|
U = e;
|
|
188
188
|
}
|
|
189
|
-
var W = null,
|
|
189
|
+
var W = null, Se = 256 * 1024 * 1024, Ce = 1, G = 500, K = 512;
|
|
190
190
|
function q(e) {
|
|
191
|
-
return Math.max(1, Math.floor(
|
|
191
|
+
return Math.max(1, Math.floor(Se * .95 / e));
|
|
192
192
|
}
|
|
193
|
-
var
|
|
193
|
+
var we = (e) => {
|
|
194
194
|
W = e;
|
|
195
195
|
}, J = null, Y = {
|
|
196
196
|
minIntervalMs: G,
|
|
197
197
|
maxSize: K
|
|
198
|
-
},
|
|
198
|
+
}, Te = (e, t) => {
|
|
199
199
|
J = e, Y = {
|
|
200
200
|
minIntervalMs: t?.minIntervalMs ?? G,
|
|
201
201
|
maxSize: t?.maxSize ?? K
|
|
202
202
|
};
|
|
203
|
-
},
|
|
203
|
+
}, Ee = class {
|
|
204
204
|
constructor() {
|
|
205
205
|
this._pathTracer = null, this._renderer = null;
|
|
206
206
|
}
|
|
207
207
|
async render(e, t, n, r = 10, i = {}) {
|
|
208
208
|
let a = await this._getPathTracer(e);
|
|
209
|
-
i.bounces !== void 0 && (a.bounces = i.bounces), a.renderScale = i.renderScale ??
|
|
209
|
+
i.bounces !== void 0 && (a.bounces = i.bounces), a.renderScale = i.renderScale ?? Ce;
|
|
210
210
|
let o = this._applyScenePatches(t), s = {
|
|
211
211
|
autoClear: e.autoClear,
|
|
212
212
|
toneMapping: e.toneMapping,
|
|
@@ -335,7 +335,7 @@ var ke = (e) => {
|
|
|
335
335
|
let { WebGPUPathTracer: t } = await import("./webgpu-BMwlJflc.mjs"), n = new t(e);
|
|
336
336
|
return n.useMegakernel(!0), n.dynamicLowRes = !1, n.renderDelay = 0, n.fadeDuration = 0, n.minSamples = 1, this._pathTracer = n, this._renderer = e, n;
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, De = class e extends v {
|
|
339
339
|
constructor(...e) {
|
|
340
340
|
super(...e), this._headlessPathTracerRenderer = null;
|
|
341
341
|
}
|
|
@@ -377,9 +377,9 @@ var ke = (e) => {
|
|
|
377
377
|
}) } : super._renderFrame(e, t, n, r);
|
|
378
378
|
}
|
|
379
379
|
async _renderPathTracedFrame(e, t, n, r) {
|
|
380
|
-
let i = e instanceof
|
|
380
|
+
let i = e instanceof M ? e.renderer : e;
|
|
381
381
|
if (!i.isWebGPURenderer) throw Error("HeadlessImageRenderer: path tracing requires the WebGPU renderer (enable featureFlags.webGpu)");
|
|
382
|
-
this._headlessPathTracerRenderer ||= new
|
|
382
|
+
this._headlessPathTracerRenderer ||= new Ee(), await this._headlessPathTracerRenderer.render(i, t, n, r.samples, r.settings);
|
|
383
383
|
let { imageDataUrl: a } = await this._readFrameAndClear(i);
|
|
384
384
|
return a;
|
|
385
385
|
}
|
|
@@ -413,7 +413,7 @@ var ke = (e) => {
|
|
|
413
413
|
let { width: r, height: i } = e.domElement;
|
|
414
414
|
return t.readbackScaled(Math.max(1, Math.round(r * n)), Math.max(1, Math.round(i * n)));
|
|
415
415
|
}
|
|
416
|
-
},
|
|
416
|
+
}, Oe = {
|
|
417
417
|
add(e) {
|
|
418
418
|
try {
|
|
419
419
|
e.end?.();
|
|
@@ -425,10 +425,10 @@ var ke = (e) => {
|
|
|
425
425
|
return [];
|
|
426
426
|
},
|
|
427
427
|
update() {}
|
|
428
|
-
},
|
|
428
|
+
}, ke = () => {
|
|
429
429
|
let e = window;
|
|
430
|
-
e.TWEEN =
|
|
431
|
-
},
|
|
430
|
+
e.TWEEN = Oe;
|
|
431
|
+
}, X = class extends oe {
|
|
432
432
|
constructor(...e) {
|
|
433
433
|
super(...e), this._callbacks = /* @__PURE__ */ new Set(), this._dispatcherInstalled = !1;
|
|
434
434
|
}
|
|
@@ -438,10 +438,10 @@ var ke = (e) => {
|
|
|
438
438
|
}), !0);
|
|
439
439
|
}
|
|
440
440
|
static async loadEquirectTexture(e) {
|
|
441
|
-
let t = await (e.toLowerCase().endsWith(".exr") ? new
|
|
441
|
+
let t = await (e.toLowerCase().endsWith(".exr") ? new w() : new b()).loadAsync(e);
|
|
442
442
|
return t.mapping = 303, t;
|
|
443
443
|
}
|
|
444
|
-
},
|
|
444
|
+
}, Z = 1024, Ae = "inline-plan-xml#", je = "inline-configuration#", Q = class e {
|
|
445
445
|
constructor() {
|
|
446
446
|
this._initialized = !1, this._configuratorReady = !1, this._plannerReady = !1, this._glbViewerReady = !1, this._loadedConfigurationId = null, this._loadedPlanId = null, this._loadedStaticItemId = null, this._width = 1024, this._height = 768, this._loaderQueue = Promise.resolve(), this._skyboxOriginal = /* @__PURE__ */ new WeakMap(), this._onReadyForRenderArmed = null;
|
|
447
447
|
}
|
|
@@ -458,7 +458,7 @@ var ke = (e) => {
|
|
|
458
458
|
autoQualityMinFps: 0,
|
|
459
459
|
autoQualityMaxFps: 2 ** 53 - 1,
|
|
460
460
|
...e.webGpuConfig
|
|
461
|
-
},
|
|
461
|
+
}, ke(), this._registerHeadlessServices(this._width, this._height), await E.setGlobalInitData({
|
|
462
462
|
configuratorId: e.configuratorId,
|
|
463
463
|
locale: e.locale,
|
|
464
464
|
tenant: e.tenant,
|
|
@@ -484,24 +484,24 @@ var ke = (e) => {
|
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
486
|
_registerHeadlessServices(e, t) {
|
|
487
|
-
let n = new
|
|
487
|
+
let n = new se();
|
|
488
488
|
globalThis.__RML__DI__ = n;
|
|
489
|
-
class r extends
|
|
489
|
+
class r extends ge {
|
|
490
490
|
constructor(n) {
|
|
491
491
|
super(n, e, t);
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
let i = [
|
|
495
|
-
new
|
|
496
|
-
new
|
|
497
|
-
new
|
|
498
|
-
new
|
|
499
|
-
new
|
|
500
|
-
new
|
|
501
|
-
new
|
|
502
|
-
new
|
|
495
|
+
new T("script-loader", he, x.CONTEXT, !0),
|
|
496
|
+
new T("dom-helper", r, x.CONTEXT, !0),
|
|
497
|
+
new T("data-syncer", _e, x.GLOBAL, !0),
|
|
498
|
+
new T("planner-kernel-access", ve, x.GLOBAL, !0),
|
|
499
|
+
new T("kernel-callback-guard", ye, x.GLOBAL, !0),
|
|
500
|
+
new T("web-gpu-ground-shadow-reflection", be, x.CONTEXT, !0),
|
|
501
|
+
new T("image-renderer", De, x.CONTEXT, !0),
|
|
502
|
+
new T("hdr-environment-loader", X, x.GLOBAL, !0)
|
|
503
503
|
];
|
|
504
|
-
n.addDependencyInjectionAssignments(
|
|
504
|
+
n.addDependencyInjectionAssignments(C), n.addDependencyInjectionAssignments(i);
|
|
505
505
|
}
|
|
506
506
|
_makeStubElement() {
|
|
507
507
|
return {
|
|
@@ -515,12 +515,12 @@ var ke = (e) => {
|
|
|
515
515
|
}
|
|
516
516
|
async prewarmConfigurator(e) {
|
|
517
517
|
this._ensureInitialized();
|
|
518
|
-
let t = await
|
|
518
|
+
let t = await E.getConfigurator(this._deepMergeHeadlessInitDefaults(e));
|
|
519
519
|
await t.boot(), this._configuratorMain = t, this._configurator = t.getApi(), await this._configurator.init(this._makeStubElement()), this._configuratorReady = !0;
|
|
520
520
|
}
|
|
521
521
|
async prewarmPlanner(e) {
|
|
522
522
|
this._ensureInitialized();
|
|
523
|
-
let t = await
|
|
523
|
+
let t = await E.getPlanner({
|
|
524
524
|
moc: !0,
|
|
525
525
|
...this._deepMergeHeadlessInitDefaults(e)
|
|
526
526
|
});
|
|
@@ -529,14 +529,14 @@ var ke = (e) => {
|
|
|
529
529
|
}
|
|
530
530
|
async prewarmGlbViewer(e) {
|
|
531
531
|
this._ensureInitialized();
|
|
532
|
-
let t = await
|
|
532
|
+
let t = await E.getGlbViewer(this._deepMergeHeadlessInitDefaults(e));
|
|
533
533
|
await t.boot(), this._glbViewerMain = t, this._glbViewer = t.getApi(), await this._glbViewer.init(this._makeStubElement()), this._glbViewerReady = !0;
|
|
534
534
|
}
|
|
535
535
|
async loadConfiguration(e, t) {
|
|
536
536
|
return this._loadIntoConfigurator(e, () => this._configurator.loadConfigurationById(e), t);
|
|
537
537
|
}
|
|
538
538
|
async loadConfigurationString(e, t) {
|
|
539
|
-
let n = await this._inlineSceneId(
|
|
539
|
+
let n = await this._inlineSceneId(je, e);
|
|
540
540
|
return this._loadIntoConfigurator(n, () => this._configurator.loadConfiguration(e), t);
|
|
541
541
|
}
|
|
542
542
|
async loadConfigurableItemById(e, t) {
|
|
@@ -567,14 +567,14 @@ var ke = (e) => {
|
|
|
567
567
|
}
|
|
568
568
|
async loadObject(e, a) {
|
|
569
569
|
if (this._ensureInitialized(), i(e)) throw Error(`HeadlessRoomleSdk: component ids ("${e}") are not supported. Use loadConfigurableItemById, loadConfiguration, or loadPlan directly.`);
|
|
570
|
-
return n(e) ? this.loadConfigurationString(e, a) : r(e) ? this.loadPlan(e, a) : t(e) ? (await (await
|
|
570
|
+
return n(e) ? this.loadConfigurationString(e, a) : r(e) ? this.loadPlan(e, a) : t(e) ? (await (await E.getRapiAccess()).getItem(e))?.configuration ? this.loadConfigurableItemById(e, a) : this.loadStaticItem(e, a) : this.loadConfiguration(e, a);
|
|
571
571
|
}
|
|
572
572
|
async loadPlan(e, t) {
|
|
573
573
|
return this._ensureInitialized(), this._loadIntoPlanner(e, () => this._planner.loadPlan(e), t);
|
|
574
574
|
}
|
|
575
575
|
async loadPlanXml(e, t) {
|
|
576
576
|
this._ensureInitialized();
|
|
577
|
-
let n = await this._inlineSceneId(
|
|
577
|
+
let n = await this._inlineSceneId(Ae, e);
|
|
578
578
|
return this._loadIntoPlanner(n, () => this._planner.loadPlanXml(e), t);
|
|
579
579
|
}
|
|
580
580
|
async _loadIntoPlanner(e, t, n) {
|
|
@@ -601,7 +601,7 @@ var ke = (e) => {
|
|
|
601
601
|
this._onReadyForRenderArmed &&= (await this._onReadyForRenderArmed, null);
|
|
602
602
|
}
|
|
603
603
|
async _armOnReadyForRender() {
|
|
604
|
-
let e = await
|
|
604
|
+
let e = await E.callbacks;
|
|
605
605
|
if (!e) {
|
|
606
606
|
this._onReadyForRenderArmed = null;
|
|
607
607
|
return;
|
|
@@ -674,7 +674,7 @@ var ke = (e) => {
|
|
|
674
674
|
this._skyboxOriginal.has(t) || this._skyboxOriginal.set(t, {
|
|
675
675
|
background: t.background,
|
|
676
676
|
showEnvironmentBackground: t.userData.showEnvironmentBackground
|
|
677
|
-
}), t.background = await
|
|
677
|
+
}), t.background = await X.loadEquirectTexture(e), t.userData.showEnvironmentBackground = !1;
|
|
678
678
|
}
|
|
679
679
|
resetSkybox() {
|
|
680
680
|
this._ensureInitialized();
|
|
@@ -727,7 +727,7 @@ var ke = (e) => {
|
|
|
727
727
|
if (this._ensureInitialized(), this._loadedStaticItemId) throw Error("HeadlessRoomleSdk: exportTopImage is not supported for static items");
|
|
728
728
|
let n = this._getActiveApi(), r = t.ssaa ?? 2, i = {
|
|
729
729
|
...t,
|
|
730
|
-
size: (t.size ??
|
|
730
|
+
size: (t.size ?? Z) * r,
|
|
731
731
|
showDimensions: t.showDimensions ?? !1,
|
|
732
732
|
preferRawPixels: !0,
|
|
733
733
|
rawPixelsScale: 1 / r
|
|
@@ -758,7 +758,7 @@ var ke = (e) => {
|
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
760
|
_getRenderDimensions(e) {
|
|
761
|
-
let t = e.ssaa ?? (e.pathTracer ? 1 : 2), n = e.width ?? e.size ??
|
|
761
|
+
let t = e.ssaa ?? (e.pathTracer ? 1 : 2), n = e.width ?? e.size ?? Z, r = e.height ?? e.size ?? Z;
|
|
762
762
|
return {
|
|
763
763
|
ssaa: t,
|
|
764
764
|
targetWidth: n,
|
|
@@ -797,10 +797,10 @@ var ke = (e) => {
|
|
|
797
797
|
_ensureInitialized() {
|
|
798
798
|
if (!this._initialized) throw Error("HeadlessRoomleSdk not initialized. Call HeadlessRoomleSdk.create() first.");
|
|
799
799
|
}
|
|
800
|
-
}, $ = () => globalThis.__RML__DI__?.lookup("model-export-state"),
|
|
800
|
+
}, $ = () => globalThis.__RML__DI__?.lookup("model-export-state"), Me = (e) => {
|
|
801
801
|
$()?.setModelExportOngoing(e);
|
|
802
|
-
},
|
|
802
|
+
}, Ne = () => $()?.isModelExportOngoing() ?? !1;
|
|
803
803
|
//#endregion
|
|
804
|
-
export { o as CONFIGURATION_TYPE, s as CORE_EDGE_TYPE, c as CORE_OBJECT_CATEGORY, a as CORE_PERMISSION_TO_DELETE,
|
|
804
|
+
export { o as CONFIGURATION_TYPE, s as CORE_EDGE_TYPE, c as CORE_OBJECT_CATEGORY, a as CORE_PERMISSION_TO_DELETE, P as Configurator, fe as FloorPlanElementViewModel, L as GlbViewer, j as HI_CONTEXT_ACTION, Q as HeadlessRoomleSdk, ie as MeasurementLinePlanElementViewModel, A as PLAN_ELEMENT_CHANGE_TYPES, p as PlanElementViewModel, re as PlanObjectViewModel, F as Planner, le as RapiAccess, _ as RapiInvalidIdError, O as RapiOfflineError, R as RoomDesignerApi, pe as RoomleConfigurator, I as RoomleGLBViewer, y as RoomleLightSource, D as RoomlePlanner, E as RoomleSdk, ne as StaticPlanObjectViewModel, te as WallPlanElementViewModel, ae as createExtObj, h as createExtObjId, ue as getCatalogIdFromConfigurationHash, z as getHeadlessWebGpuMaxTextureDimension, m as isExtObjId, ee as isExternalObject, ce as isFirefox, i as isIdAComponent, n as isIdAConfigurationString, r as isIdAPlan, t as isIdAnItem, Ne as isModelExportOngoing, e as isPlanSnapshotId, k as isSafari, S as removeExtObjIdPrefix, Me as setModelExportOngoing, xe as setPathTracerExternalDenoiser, Te as setPathTracerPreviewHook, we as setPathTracerProgressHook };
|
|
805
805
|
|
|
806
806
|
//# sourceMappingURL=roomle-headless.js.map
|