door_models 5.2.3 → 5.2.4

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/dist/index.esm.js CHANGED
@@ -1958,7 +1958,8 @@ function DoorLeaf(_ref8) {
1958
1958
  testBackDoorPlaneMaterial,
1959
1959
  glassDepth,
1960
1960
  cpid,
1961
- handleParseCpid
1961
+ handleParseCpid,
1962
+ materials
1962
1963
  } = useConfigurator();
1963
1964
 
1964
1965
  // here i get material names from context
@@ -1997,15 +1998,24 @@ function DoorLeaf(_ref8) {
1997
1998
  } = backDoorPlane;
1998
1999
 
1999
2000
  // --- Material Logic ---
2000
- const doorMaterial = useMemo(() => placeholderMaterial, [testDoorMaterial, doorMaterialName]);
2001
- const frameMaterial = useMemo(() => placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
2002
- const gasketMaterial = useMemo(() => new THREE.MeshStandardMaterial({
2003
- color: "#111111"
2004
- }), [testGasketMaterial, gasketMaterialName]);
2001
+ const pers = useMemo(() => {
2002
+ const dynamicMaterials = {};
2003
+ for (const key in materials) {
2004
+ if (Object.prototype.hasOwnProperty.call(materials, key)) {
2005
+ const value = materials[key];
2006
+ dynamicMaterials[key] = createMaterialFromProp(value);
2007
+ }
2008
+ }
2009
+ return dynamicMaterials;
2010
+ }, [materials]);
2011
+ // --- Material Logic ---
2012
+ const doorMaterial = useMemo(() => pers.D_SRF_DECOR_2 || placeholderMaterial, [testDoorMaterial, doorMaterialName]);
2013
+ const frameMaterial = useMemo(() => pers.D_PRF_COLOR || pers.D_FR_SRF_DECOR || pers.D_FR_SRF_DECOR_S2 || placeholderMaterialforFrames, [testFrameMaterial, frameMaterialName]);
2014
+ const gasketMaterial = useMemo(() => pers.D_GASKET || availableMaterials.black, [testGasketMaterial, gasketMaterialName]);
2005
2015
  useMemo(() => {
2006
- return frameMaterial;
2016
+ return pers.D_PRF_COLOR || pers.D_FR_SRF_DECOR || pers.D_FR_SRF_DECOR_S2 || frameMaterial;
2007
2017
  }, [testDoorStopMaterial, doorStopMaterialName, frameType, frameMaterial]);
2008
- useMemo(() => placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
2018
+ useMemo(() => pers.D_SRF_DECOR_2 || placeholderMaterial, [testInteriorFanlightMaterial, interiorFanlightMaterialName]);
2009
2019
  useMemo(() => placeholderMaterial, [testExteriorFanlightMaterial, exteriorFanlightMaterialName]);
2010
2020
  const occulusInfillMaterial = useMemo(() => placeholderMaterial, [testOcculusInfillMaterial, occulusInfillMaterialName]);
2011
2021
  const glassInfillMaterial = useMemo(() => placeholderMaterial, [testGlassInfillMaterial, glassInfillMaterialName]);
@@ -2016,8 +2026,8 @@ function DoorLeaf(_ref8) {
2016
2026
  }), [testHingeMaterial, hingeMaterialName]);
2017
2027
  useMemo(() => placeholderMaterial, [testFrontCoverPanelMaterial, frontCoverPanelMaterialName]);
2018
2028
  useMemo(() => placeholderMaterial, [testBackCoverPanelMaterial, backCoverPanelMaterialName]);
2019
- const frontDoorPlaneMaterial = useMemo(() => placeholderMaterial, [testFrontDoorPlaneMaterial, frontDoorPlaneMaterialName]);
2020
- const backDoorPlaneMaterial = useMemo(() => placeholderMaterial, [testBackDoorPlaneMaterial, backDoorPlaneMaterialName]);
2029
+ useMemo(() => placeholderMaterial, [testFrontDoorPlaneMaterial, frontDoorPlaneMaterialName]);
2030
+ useMemo(() => placeholderMaterial, [testBackDoorPlaneMaterial, backDoorPlaneMaterialName]);
2021
2031
  const hingeAccentMaterial = useMemo(() => new THREE.MeshStandardMaterial({
2022
2032
  color: "#1a1a1a",
2023
2033
  roughness: 0.1
@@ -2205,7 +2215,8 @@ function DoorLeaf(_ref8) {
2205
2215
 
2206
2216
  // --- DYNAMIC TEXTURE MATERIALS ---
2207
2217
  const dynamicFrontDoorPlaneMaterial = useMemo(() => {
2208
- const newMaterial = frontDoorPlaneMaterial.clone();
2218
+ const sourceMaterial = pers.D_SRF_DECOR_2 || placeholderMaterial;
2219
+ const newMaterial = sourceMaterial.clone();
2209
2220
  if (newMaterial.map) {
2210
2221
  newMaterial.map = newMaterial.map.clone();
2211
2222
  newMaterial.map.needsUpdate = true;
@@ -2219,9 +2230,10 @@ function DoorLeaf(_ref8) {
2219
2230
  console.log(repeatX, repeatY);
2220
2231
  }
2221
2232
  return newMaterial;
2222
- }, [frontDoorPlaneMaterial, mainDoorHeightM, doorWidthM]);
2233
+ }, [pers.D_SRF_DECOR_2, mainDoorHeightM, doorWidthM]);
2223
2234
  const dynamicBackDoorPlaneMaterial = useMemo(() => {
2224
- const newMaterial = backDoorPlaneMaterial.clone();
2235
+ const sourceMaterial = pers.D_SRF_DECOR || placeholderMaterial;
2236
+ const newMaterial = sourceMaterial.clone();
2225
2237
  if (newMaterial.map) {
2226
2238
  newMaterial.map = newMaterial.map.clone();
2227
2239
  newMaterial.map.needsUpdate = true;
@@ -2234,7 +2246,7 @@ function DoorLeaf(_ref8) {
2234
2246
  newMaterial.map.repeat.set(repeatX, repeatY * 2);
2235
2247
  }
2236
2248
  return newMaterial;
2237
- }, [backDoorPlaneMaterial, mainDoorHeightM, doorWidthM]);
2249
+ }, [pers.D_SRF_DECOR, mainDoorHeightM, doorWidthM]);
2238
2250
  return /*#__PURE__*/jsxs("group", {
2239
2251
  "position-x": xOffset,
2240
2252
  children: [isStandardHingeVisible && standardHingeYPositions.map((y, index) => /*#__PURE__*/jsxs("group", {