door_models 3.0.9 → 4.0.1

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.cjs.js CHANGED
@@ -96,8 +96,10 @@ const _excluded = ["doorDepth"];
96
96
  const ConfiguratorContext = /*#__PURE__*/react.createContext(undefined);
97
97
  const ConfiguratorProvider = _ref => {
98
98
  let {
99
- children
99
+ children,
100
+ initialIs2D = false
100
101
  } = _ref;
102
+ const [is2D, setIs2D] = react.useState(initialIs2D);
101
103
  const [isPlaneVisible, setIsPlaneVisible] = react.useState(false);
102
104
  const [isFrameVisible, setIsFrameVisible] = react.useState(true);
103
105
  const [cpid, setCpid] = react.useState("");
@@ -194,6 +196,9 @@ const ConfiguratorProvider = _ref => {
194
196
  type: "",
195
197
  text: ""
196
198
  });
199
+ react.useEffect(() => {
200
+ setIs2D(initialIs2D);
201
+ }, [initialIs2D]);
197
202
  const handleParseCpid = react.useCallback(cpidToParse => {
198
203
  const showMessage = function (text) {
199
204
  let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "error";
@@ -630,6 +635,8 @@ const ConfiguratorProvider = _ref => {
630
635
  }, [totalWidth, doorFrame.sidesThk]);
631
636
  return /*#__PURE__*/jsxRuntime.jsx(ConfiguratorContext.Provider, {
632
637
  value: {
638
+ is2D,
639
+ setIs2D,
633
640
  isPlaneVisible,
634
641
  setIsPlaneVisible,
635
642
  isFrameVisible,
@@ -891,6 +898,9 @@ function DoorModels(_ref3) {
891
898
  doorName
892
899
  } = _ref3;
893
900
  const {
901
+ is2D,
902
+ totalWidth,
903
+ totalHeight,
894
904
  isPlaneVisible,
895
905
  isFrameVisible,
896
906
  door,
@@ -1195,6 +1205,18 @@ function DoorModels(_ref3) {
1195
1205
  }
1196
1206
  return true;
1197
1207
  }, [isFrameVisible, frameType, isGlassDoor]);
1208
+ if (is2D) {
1209
+ return /*#__PURE__*/jsxRuntime.jsx("group", {
1210
+ children: /*#__PURE__*/jsxRuntime.jsxs("mesh", {
1211
+ children: [/*#__PURE__*/jsxRuntime.jsx("boxGeometry", {
1212
+ args: [totalWidth / 1000, 0.1, frameDepth / 1000]
1213
+ }), /*#__PURE__*/jsxRuntime.jsx("meshBasicMaterial", {
1214
+ color: "white",
1215
+ side: THREE__namespace.DoubleSide
1216
+ })]
1217
+ })
1218
+ });
1219
+ }
1198
1220
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1199
1221
  children: [frontCoverPanel.visible && /*#__PURE__*/jsxRuntime.jsxs("group", {
1200
1222
  "position-z": frontArchitraveZ,
@@ -1612,9 +1634,11 @@ function DoorModels(_ref3) {
1612
1634
  const DoorConfigurator = _ref => {
1613
1635
  let {
1614
1636
  doorName,
1615
- showInterface = true
1637
+ showInterface = true,
1638
+ is2D = false
1616
1639
  } = _ref;
1617
1640
  return /*#__PURE__*/jsxRuntime.jsx(ConfiguratorProvider, {
1641
+ initialIs2D: is2D,
1618
1642
  children: /*#__PURE__*/jsxRuntime.jsx(DoorModels, {
1619
1643
  doorName: doorName
1620
1644
  })