kitchen-simulator 1.1.1-test.57 → 1.1.1-test.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/es/index.js +22 -2
  2. package/lib/index.js +22 -7
  3. package/package.json +21 -36
package/es/index.js CHANGED
@@ -1,3 +1,23 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
1
3
  import KitchenConfiguratorApp from "./KitchenConfiguratorApp";
2
- export { KitchenConfiguratorApp };
3
- export default KitchenConfiguratorApp;
4
+
5
+ /**
6
+ * Mount the Kitchen Configurator micro-frontend inside a DOM container.
7
+ *
8
+ * @param {HTMLElement} container - The DOM node to mount into.
9
+ * @param {object} props - The same props KitchenConfiguratorApp expects (width, height, data, etc).
10
+ * @returns {object} { root, unmount() }
11
+ */
12
+ export function renderKitchenSimulator(container, props) {
13
+ if (!container) throw new Error('Container element is required');
14
+ var root = ReactDOM.createRoot(container);
15
+ root.render(/*#__PURE__*/React.createElement(KitchenConfiguratorApp, props));
16
+ return {
17
+ root: root,
18
+ unmount: function unmount() {
19
+ root.unmount();
20
+ }
21
+ };
22
+ }
23
+ export default renderKitchenSimulator;
package/lib/index.js CHANGED
@@ -3,13 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "KitchenConfiguratorApp", {
7
- enumerable: true,
8
- get: function get() {
9
- return _KitchenConfiguratorApp["default"];
10
- }
11
- });
12
6
  exports["default"] = void 0;
7
+ exports.renderKitchenSimulator = renderKitchenSimulator;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _client = _interopRequireDefault(require("react-dom/client"));
13
10
  var _KitchenConfiguratorApp = _interopRequireDefault(require("./KitchenConfiguratorApp"));
14
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
15
- var _default = exports["default"] = _KitchenConfiguratorApp["default"];
12
+ /**
13
+ * Mount the Kitchen Configurator micro-frontend inside a DOM container.
14
+ *
15
+ * @param {HTMLElement} container - The DOM node to mount into.
16
+ * @param {object} props - The same props KitchenConfiguratorApp expects (width, height, data, etc).
17
+ * @returns {object} { root, unmount() }
18
+ */
19
+ function renderKitchenSimulator(container, props) {
20
+ if (!container) throw new Error('Container element is required');
21
+ var root = _client["default"].createRoot(container);
22
+ root.render(/*#__PURE__*/_react["default"].createElement(_KitchenConfiguratorApp["default"], props));
23
+ return {
24
+ root: root,
25
+ unmount: function unmount() {
26
+ root.unmount();
27
+ }
28
+ };
29
+ }
30
+ var _default = exports["default"] = renderKitchenSimulator;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kitchen-simulator",
3
- "version": "1.1.1-test.57",
4
- "description": "It is a kitchen simulator.",
3
+ "version": "1.1.1-test.59",
4
+ "description": "It is a kitchen simulator (self-contained micro-frontend).",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "module": "es/index.js",
@@ -11,16 +11,9 @@
11
11
  "require": "./lib/index.js"
12
12
  }
13
13
  },
14
- "files": [
15
- "lib",
16
- "es",
17
- "README.md",
18
- "LICENSE"
19
- ],
20
- "sideEffects": [
21
- "*.css",
22
- "*.scss"
23
- ],
14
+ "files": ["lib", "es", "README.md", "LICENSE"],
15
+ "sideEffects": ["*.css", "*.scss"],
16
+
24
17
  "scripts": {
25
18
  "start": "webpack-dev-server --config demo/webpack.config.js --port 9000 --mode development",
26
19
  "start9010": "webpack-dev-server --config demo/webpack.config.js --port 9010 --mode development",
@@ -34,6 +27,7 @@
34
27
  "prepublishOnly": "cross-env NODE_ENV=production npm run build",
35
28
  "test": "echo \"Error: no test specified\" && exit 1"
36
29
  },
30
+
37
31
  "repository": {
38
32
  "type": "git",
39
33
  "url": "git+https://github.com/orgs/4DPixel/teams/kitchen-simulator.git"
@@ -57,19 +51,7 @@
57
51
  "component",
58
52
  "redux"
59
53
  ],
60
- "peerDependencies": {
61
- "hoist-non-react-statics": "2.5.5",
62
- "immutable": "3.8.2",
63
- "immutablediff": "0.4.4",
64
- "immutablepatch": "0.5.0",
65
- "invariant": "^2.0.0",
66
- "polylabel": "1.0.2",
67
- "prop-types": "^15.8.1",
68
- "react": ">=16.9 <19",
69
- "react-dom": ">=16.9 <19",
70
- "react-redux": "5.0.7",
71
- "redux": "4.0.1"
72
- },
54
+
73
55
  "dependencies": {
74
56
  "@sentry/react": "^9.10.1",
75
57
  "axios": "^0.20.0",
@@ -81,14 +63,25 @@
81
63
  "nanoid": "^5.1.6",
82
64
  "path-browserify": "^1.0.1",
83
65
  "posthog-js": "^1.271.0",
66
+ "react": "^16.9.0",
67
+ "react-dom": "16.9.0",
68
+ "redux": "4.0.1",
69
+ "react-redux": "5.0.7",
84
70
  "react-icons": "3.5.0",
71
+ "react-container-dimensions": "1.4.1",
85
72
  "react-svg-pan-zoom": "^3.13.1",
86
73
  "stream-browserify": "^3.0.0",
87
- "three": "0.166.0"
74
+ "three": "0.166.0",
75
+ "hoist-non-react-statics": "2.5.5",
76
+ "immutable": "3.8.2",
77
+ "immutablediff": "0.4.4",
78
+ "immutablepatch": "0.5.0",
79
+ "invariant": "^2.0.0",
80
+ "polylabel": "1.0.2",
81
+ "prop-types": "^15.8.1"
88
82
  },
83
+
89
84
  "devDependencies": {
90
- "react-redux": "5.0.7",
91
- "redux": "4.0.1",
92
85
  "@babel/cli": "^7.28.3",
93
86
  "@babel/core": "^7.28.4",
94
87
  "@babel/preset-env": "^7.28.3",
@@ -104,14 +97,6 @@
104
97
  "css-loader": "*",
105
98
  "file-loader": "6.2.0",
106
99
  "html-webpack-plugin": "5.6.0",
107
- "immutable": "3.8.2",
108
- "immutablediff": "0.4.4",
109
- "immutablepatch": "0.5.0",
110
- "polylabel": "1.0.2",
111
- "prop-types": "^15.8.1",
112
- "react": "^16.9.0",
113
- "react-container-dimensions": "1.4.1",
114
- "react-dom": "16.9.0",
115
100
  "rimraf": "^2.6.3",
116
101
  "style-loader": "*",
117
102
  "webpack": "5.92.1",