hart-estate-widget 4.0.0 → 4.0.2
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 +82 -73
- package/build/api.js +1 -1
- package/build/createWidget.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -166,79 +166,88 @@ html, body
|
|
166
166
|
## Parameters:
|
167
167
|
Here you can see a list of accessible options and examples of usage. There are accessible values for each option below in the block "Types of Elements".
|
168
168
|
|
169
|
-
```
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
logoUrl:
|
202
|
-
|
203
|
-
logoLinkUrl:
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
tabs:
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
169
|
+
```json
|
170
|
+
{
|
171
|
+
// Widget API base URL
|
172
|
+
"baseUrl": "https://backend.estate.hart-digital.com",
|
173
|
+
|
174
|
+
// Widget locale can be one of
|
175
|
+
// "en" - English language
|
176
|
+
// "ru" - Russian language
|
177
|
+
// "de" - German language
|
178
|
+
// "es" - Spanish language
|
179
|
+
// "ja" - Japanese language
|
180
|
+
"locale": "en",
|
181
|
+
// Overrides locale keys with custom text or translation
|
182
|
+
"localeOverrides": {
|
183
|
+
"create-points": "Create a point",
|
184
|
+
"delete-points": "Remove point",
|
185
|
+
"research-plan": "Research plan",
|
186
|
+
"rotate-plan": "Rotate plan",
|
187
|
+
"ok": "Ok",
|
188
|
+
"ruler-ok": "Ok",
|
189
|
+
"made-by-link": "https://getfloorplan.com/",
|
190
|
+
"made-by-text": "getfloorplan.com",
|
191
|
+
"floor": "$0 floor",
|
192
|
+
"floorNumberEndings": {
|
193
|
+
"1": "$0st",
|
194
|
+
"2": "$0nd",
|
195
|
+
"3": "$0d",
|
196
|
+
"rest": "$0th"
|
197
|
+
}
|
198
|
+
},
|
199
|
+
|
200
|
+
// Path/link to the logo
|
201
|
+
"logoUrl": "https://getfloorplan.com/img/logo.58f6cd11.svg",
|
202
|
+
// Link opened when logo is clicked
|
203
|
+
"logoLinkUrl": "https://getfloorplan.com",
|
204
|
+
// Widget color settings in CSS color formal like: "rgba(255, 255, 255, 0)", "#ABCDEF", etc...
|
205
|
+
// "main" - main color of buttons, elements
|
206
|
+
// "mainText" - text color for buttons, elements contrasting with the main color
|
207
|
+
"colors": {
|
208
|
+
"main": "#FFA900",
|
209
|
+
"mainText": "#413E3E"
|
210
|
+
},
|
211
|
+
|
212
|
+
// First opened tab
|
213
|
+
"primaryTab": "panorama",
|
214
|
+
// Available widget tabs array with order:
|
215
|
+
// "panorama" - Panorama 360 tab
|
216
|
+
// "rotation" - Isometric plan rotation tab
|
217
|
+
// "plan" - Original plan tab
|
218
|
+
"tabs": ["plan", "rotation", "panorama"],
|
219
|
+
|
220
|
+
// Controls in bottom bar, can be:
|
221
|
+
// "ruler" - Ruler enable/disable button
|
222
|
+
// "scale" - Scale x1, x2, x0.5 button
|
223
|
+
// "autoRotate" - Auto rotate enable/disable button
|
224
|
+
"controls": ["ruler", "scale", "autoRotate"],
|
225
|
+
|
226
|
+
// Enable/disable modal of instruction in 3D tour
|
227
|
+
"isInstructionsVisible": true,
|
228
|
+
// Enable/disable auto rotation in 3D tour
|
229
|
+
"isAutoRotate": false,
|
230
|
+
// Enable/disable device gyroscope for AR
|
231
|
+
"isGyroscopeEnabled": true,
|
232
|
+
// Show/hide fullscreen button
|
233
|
+
"isFullscreenButtonVisible": true,
|
234
|
+
// Show/hide current room type top label
|
235
|
+
"isRoomLabelVisible": false,
|
236
|
+
|
237
|
+
// Camera persective FOV
|
238
|
+
"cameraFov": 75,
|
239
|
+
|
240
|
+
// Panorama fade time in seconds
|
241
|
+
"panoramaFadeTime": 0.5,
|
242
|
+
|
243
|
+
// Widget external integrations
|
244
|
+
"integrations": {
|
245
|
+
// https://docs.sentry.io/platforms/javascript/configuration/options/
|
246
|
+
"sentry": {
|
247
|
+
"dsn": "https://1234567890abcdef@sentry.com/12345"
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
242
251
|
```
|
243
252
|
|
244
253
|
## Widget object from the REST API
|
package/build/api.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var r={d:(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},e={};r.d(e,{j:()=>t});class t{baseUrl;constructor(r){this.baseUrl=r}get headers(){return{Accept:"application/json;widget-version=4.0.
|
1
|
+
var r={d:(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},e={};r.d(e,{j:()=>t});class t{baseUrl;constructor(r){this.baseUrl=r}get headers(){return{Accept:"application/json;widget-version=4.0.2"}}loadCrmWidgetData=async r=>{if(!r)return this.makeError(404,"No crmPlanId!");try{const e=await this.fetch(`/api/crm/plans/${r}/v4/widget`);return e.ok?e.json():this.makeErrorFromResponse(e,"Failed to get CRM Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadWidgetData=async r=>{if(!r)return this.makeError(404,"No planId!");try{const e=await this.fetch(`/api/plans/${r}/v4/widget`);return e.ok?e.json():this.makeErrorFromResponse(e,"Failed to get Plan widget data!")}catch(r){return this.makeError(520,r.message)}};loadJson=async r=>{try{return(await fetch(r)).json()}catch(r){return this.makeError(500,r.message)}};makeError(r,e="Unknown error"){return{error:{status:r,message:e}}}async makeErrorFromResponse(r,e){if("application/json"===r.headers.get("Content-Type")){const e=await r.json();if("message"in e&&"string"==typeof e.message)return this.makeError(r.status,e.message)}return this.makeError(r.status,e)}fetch(r,e={headers:this.headers}){return fetch(`${this.baseUrl}${r}`,e)}}var a=e.j;export{a as Api};
|