hart-estate-widget 1.1.6 → 2.0.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/README.md CHANGED
@@ -40,7 +40,7 @@ const WIDGET_API_URL = 'https://backend.estate.hart-digital.com';
40
40
  const createWidget = async (logoUrl) => {
41
41
  const widgetApiHandler = new ApiStore(WIDGET_API_URL)
42
42
 
43
- const searchParams = (new URL(document.location)).searchParams;
43
+ const { searchParams } = new URL(document.location);
44
44
  const planId = searchParams.get("id");
45
45
 
46
46
  const planData = await widgetApiHandler.loadWidgetData(planId);
@@ -48,10 +48,10 @@ const createWidget = async (logoUrl) => {
48
48
  ...planData.parsed,
49
49
  API_URL: WIDGET_API_URL,
50
50
  rotationMode: rotationModes.DEFAULT,
51
- logo: logo,
52
51
  tabs: ['panorama', 'rotation'],
53
52
  locale: 'en',
54
53
  logoUrl,
54
+ logo,
55
55
  }
56
56
 
57
57
  new Widget('#widget', options); // must match the element id
@@ -99,6 +99,7 @@ body
99
99
  height: 100%
100
100
  ```
101
101
 
102
+
102
103
  ### Run
103
104
  8. `rm -rf dist && npx parcel ./src/index.html`
104
105
  9. open: http://localhost:1234/?id=4c834af9-e08a-4ede-bd53-b231bcae38da
@@ -122,13 +123,18 @@ body
122
123
  height: 1080,
123
124
  resizable: true, // automatically resize the widget to the size of the container when the window is resized
124
125
 
125
- // values
126
- planImage: '', // path to the plan image (required for panoramic tour)
127
- topViewImage: '', // path to the top view image
126
+ // значения
128
127
  rotationMode: 'default', // mode of operation for plan images
129
- rotationData: {}, // type of images and paths to circular view images (order is mandatory)
130
- panoramaData: {}, // type of panorama and paths to 360° images
131
128
  panoramaFov: 75, // camera field of view angle for panoramic tour
129
+ floors: [ // array of floors, contains 360° images and panoramic tour data
130
+ {
131
+ original_plan_img: '', // path to the original plan image (required for panoramic tour)
132
+ styled_plan_img: '', // path to the styled plan image (required for panoramic tour)
133
+ top_view_img: '', // path to the top view image
134
+ panorama: '', // type of panorama and paths to 360° images
135
+ rotate: '', // type of images and paths to circular view images (order is mandatory)
136
+ }
137
+ ],
132
138
 
133
139
  // colors
134
140
  colors: {
@@ -149,11 +155,11 @@ rotationMode: [
149
155
  rotationModes.DEFAULT, // top view mode (multiple perspectives) and stylized plan view
150
156
  rotationModes.THREESIXTY, // image scrolling mode for circular view
151
157
  ],
152
- rotationData.type: [
158
+ floors[0].rotate.type: [
153
159
  'top_down', // full model
154
160
  'middle_cut', // model with cut in the middle
155
161
  ],
156
- panoramaData.type: [
162
+ floors[0].panorama.type: [
157
163
  'sphere', // 360° panorama
158
164
  'cube', // panorama with 6 images (top, down, left, right, front, back)
159
165
  ],
package/package.json CHANGED
@@ -1,66 +1,66 @@
1
- {
2
- "name": "hart-estate-widget",
3
- "description": "HART Estate widget",
4
- "author": "HART",
5
- "keywords": [
6
- "estate",
7
- "widget",
8
- "hart"
9
- ],
10
- "sideEffects": [
11
- "*.sass"
12
- ],
13
- "version": "1.1.6",
14
- "private": false,
15
- "main": "build/widget.module.js",
16
- "module": "build/widget.module.js",
17
- "files": [
18
- "build",
19
- "README.md"
20
- ],
21
- "engines": {
22
- "node": "^16.13.1"
23
- },
24
- "scripts": {
25
- "cleanup": "rm -rf build",
26
- "start": "npm run cleanup && webpack-dev-server --config webpack-development.config.js",
27
- "build": "npm run cleanup && webpack --config webpack-production.config.js",
28
- "local-tunnel": "Lt --port 9000 --subdomain estate-widget --local-host localhost"
29
- },
30
- "devDependencies": {
31
- "@babel/core": "^7.17.0",
32
- "@babel/eslint-parser": "^7.16.3",
33
- "@babel/plugin-proposal-class-properties": "^7.18.6",
34
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
35
- "@babel/preset-env": "^7.16.11",
36
- "@babel/preset-react": "^7.18.6",
37
- "babel-loader": "^8.2.5",
38
- "css-loader": "^6.6.0",
39
- "eslint": "^8.0.0",
40
- "eslint-config-react-app": "^7.0.0",
41
- "eslint-plugin-react": "^7.28.0",
42
- "path": "^0.12.7",
43
- "sass": "^1.46.0",
44
- "sass-loader": "^12.4.0",
45
- "style-loader": "^3.3.1",
46
- "webpack": "^5.74.0",
47
- "webpack-cli": "^4.10.0",
48
- "webpack-dev-server": "^4.7.4",
49
- "@fontsource/roboto-mono": "^4.5.8",
50
- "geometric": "^2.2.10",
51
- "mobx": "^6.3.13",
52
- "mobx-react-lite": "^3.2.3",
53
- "panolens": "^0.12.1",
54
- "panzoom": "^9.4.2",
55
- "react": "^17.0.2",
56
- "react-dom": "^17.0.2",
57
- "react-select": "^5.7.2",
58
- "screenfull": "^6.0.1",
59
- "ua-parser-js": "^1.0.2"
60
- },
61
- "browserslist": [
62
- ">0.2%",
63
- "not dead",
64
- "not op_mini all"
65
- ]
66
- }
1
+ {
2
+ "name": "hart-estate-widget",
3
+ "description": "HART Estate widget",
4
+ "author": "HART",
5
+ "keywords": [
6
+ "estate",
7
+ "widget",
8
+ "hart"
9
+ ],
10
+ "sideEffects": [
11
+ "*.sass"
12
+ ],
13
+ "version": "2.0.3",
14
+ "private": false,
15
+ "main": "build/widget.module.js",
16
+ "module": "build/widget.module.js",
17
+ "files": [
18
+ "build",
19
+ "README.md"
20
+ ],
21
+ "scripts": {
22
+ "cleanup": "rm -rf build",
23
+ "start": "npm run cleanup && webpack-dev-server --config webpack-development.config.js",
24
+ "build": "npm run cleanup && webpack --config webpack-production.config.js",
25
+ "local-tunnel": "Lt --port 9000 --subdomain estate-widget --local-host localhost"
26
+ },
27
+ "devDependencies": {
28
+ "@babel/core": "^7.17.0",
29
+ "@babel/eslint-parser": "^7.16.3",
30
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
31
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
32
+ "@babel/preset-env": "^7.16.11",
33
+ "@babel/preset-react": "^7.18.6",
34
+ "babel-loader": "^8.2.5",
35
+ "camera-controls": "^2.7.3",
36
+ "css-loader": "^6.6.0",
37
+ "eslint": "^8.0.0",
38
+ "eslint-config-prettier": "^8.5.0",
39
+ "eslint-config-react-app": "^7.0.0",
40
+ "eslint-plugin-prettier": "^5.0.0",
41
+ "eslint-plugin-react": "^7.28.0",
42
+ "path": "^0.12.7",
43
+ "sass": "^1.46.0",
44
+ "sass-loader": "^12.4.0",
45
+ "style-loader": "^3.3.1",
46
+ "three": "^0.158.0",
47
+ "webpack": "^5.74.0",
48
+ "webpack-cli": "^4.10.0",
49
+ "webpack-dev-server": "^4.7.4",
50
+ "@fontsource/roboto-mono": "^4.5.8",
51
+ "geometric": "^2.2.10",
52
+ "mobx": "^6.3.13",
53
+ "mobx-react-lite": "^3.2.3",
54
+ "panzoom": "^9.4.2",
55
+ "react": "^17.0.2",
56
+ "react-dom": "^17.0.2",
57
+ "react-select": "^5.7.2",
58
+ "screenfull": "^6.0.1",
59
+ "ua-parser-js": "^1.0.2"
60
+ },
61
+ "browserslist": [
62
+ ">0.2%",
63
+ "not dead",
64
+ "not op_mini all"
65
+ ]
66
+ }