hart-estate-widget 3.8.5 → 3.9.0

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
@@ -97,7 +97,7 @@ const createWidget = async (logoUrl) => {
97
97
  const planData = await widgetApiHandler.loadWidgetData(planId);
98
98
  const options = { // the parameters you need that are described below in "Parameters"
99
99
  ...planData.parsed,
100
- API_URL: WIDGET_API_URL,
100
+ api_url: WIDGET_API_URL,
101
101
  rotationMode: rotationModes.DEFAULT,
102
102
  tabs: ['panorama', 'rotation'],
103
103
  locale: 'en',
@@ -146,124 +146,218 @@ body
146
146
  ## Parameters:
147
147
  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".
148
148
 
149
- ```js
150
- {
151
- // elements
152
- tabs: ['rotation', 'panorama'], // included elements
153
-
154
- // logo
155
- logo: '', // path/link to the logo
156
- logoUrl: '', // link opened when logo is clicked
157
-
158
- // localization
159
- // accessible languages are in "Types of Elements"
160
- locale: 'en', // ISO 639 language code
161
-
162
- // width/height
149
+ ```ts
150
+ type TConfig = {
151
+ /** Widget API Backend URL */
152
+ api_url: 'https://backend.example.com/';
153
+
154
+ /** Path/link to the logo */
155
+ logo: '';
156
+ /** Link opened when logo is clicked */
157
+ logoUrl: '';
158
+
159
+ /** Widget container offsetWidth */
163
160
  width: 1920,
161
+ /** Widget container offsetHeight */
164
162
  height: 1080,
165
- resizable: true, // automatically resize the widget to the size of the container when the window is resized
166
-
167
- // values
168
- rotationMode: '', // mode of operation for plan images
169
- panoramaFov: 75, // camera field of view angle for panoramic tour
170
- preloadPerPanoramaCount: 3, // the number of panoramas loaded next to the current one to optimize transitions
171
- enablePreloadMasks: true, // also preload depth textures
172
- forcePreloadNonCached: true, // give preloading a higher priority for unloaded panoramas than by distance from the current one
173
- forceTopViewOnMap: true, // show top view map instead of standard by default
174
- topViewResolutionUpscale: 2, // upscale top view map by coef (200px * 2 = 400px)
175
- enableCameraTransitionBetweenPanoramas: true, // enable/disable camera rotation transition between panoramas (if CameraPoint.Rotation.Yaw is defined in JSON)
176
- enableCameraRotationBetweenPanoramas: true, // enable/disable camera rotation between panoramas (if CameraPoint.Rotation.Yaw is defined in JSON)
177
- instructionVisible: true, // enable/disable modal of instruction in 3D tour
178
- autoRotate: false, // enable/disable auto rotation in 3D tour
179
- primaryCameraPointId: null, // primary camera point ID for panorama tour
180
- floors: [ // array of floors, contains 360° images and panoramic tour data
181
- {
182
- original_plan_img: '', // path to the original plan image (required for panoramic tour)
183
- styled_plan_img: '', // path to the styled plan image (required for panoramic tour)
184
- top_view_img: '', // path to the top view image
185
- panorama: '', // type of panorama and paths to 360° images
186
- rotate: '', // type of images and paths to circular view images (order is mandatory)
187
- }
188
- ],
189
-
190
- // colors
163
+ /** Automatically resize the widget to the size of the container when the window is resized */
164
+ resizable: true;
165
+
166
+ /** Widget localization language (default: en) */
167
+ locale: 'en'
168
+
169
+ /** Use door proactive rectangle instead of door icon. */
170
+ enableDoorVisibility: false;
171
+ /** Type of images that will present in rotation tab, used as whitelist filter, defaults ['carousel', 'plan', 'topView'] */
172
+ availableRotationSteps: ['carousel', 'plan', 'topView'];
173
+
174
+ /** Available widget tabs, defaults ['rotation', 'plan', 'panorama'] */
175
+ tabs: ['rotation', 'plan', 'panorama'];
176
+
177
+ /**
178
+ * Mode of operation for plan images
179
+ * - `rotationModes.DEFAULT` - top view mode (multiple perspectives) and stylized plan view
180
+ * - `rotationModes.THREESIXTY` - image scrolling mode for circular view
181
+ * */
182
+ rotationMode: rotationModes.DEFAULT;
183
+ /** Camera persective FOV */
184
+ panoramaFov: 75;
185
+ /** Enable/disable camera rotation between panoramas (if CameraPoint.Rotation.Yaw is defined in JSON) */
186
+ enableCameraRotationBetweenPanoramas: true;
187
+ /** Enable/disable transition for camera rotation between panoramas (if CameraPoint.Rotation.Yaw is defined in JSON and enableCameraRotationBetweenPanoramas enabled) */
188
+ enableCameraTransitionBetweenPanoramas: false;
189
+ /** Override primary camera point ID over JSON */
190
+ primaryCameraPointId: 'CameraPointId12345678-12345678-12345678';
191
+
192
+ /**
193
+ * Widget color settings
194
+ * - `main`: main color of buttons, elements
195
+ * - `mainText`: text color for buttons, elements contrasting with the main color
196
+ * */
191
197
  colors: {
192
- main: '#HEX', // main color of buttons, elements
193
- mainText: '#HEX', // text color for buttons, elements contrasting with the main color
194
- },
198
+ main: '#FFA900',
199
+ mainText: '#413E3E',
200
+ };
195
201
 
196
- // copyRight: all text in widget
197
- dictionaryOverrides: {
198
- "create-points": "Create a point", // text for create point
199
- "delete-points": "Remove point", // text for delete point
200
- "research-plan": "Research plan", // text for research plan
201
- "rotate-plan": "Rotate plan", // text for rotate plan
202
- "ok": "Ok", // button text
203
- "made-by-link": "https://getfloorplan.com/", // watermark link
204
- "made-by-text": "getfloorplan.com", // watermark text
205
- "instructions-hint-text": "", // additional text on the bottom of instruction modal
206
- "floor": "$0 floor" // floor text
207
- },
208
-
209
- API_URL: '', // API URL
210
-
211
- // branding.
212
- branding: {
213
- company_url: '', // link opened when logo is clicked (higher priority than logoUrl)
214
- company_name: '', // watermark text (higher priority than dictionaryOverrides['made-by-text'])
215
- widget_language: 'en', // ISO 639 language code
216
- logo_path: '', // path to logo
217
-
218
- // panorama icons
202
+ /** Panorama icons */
219
203
  panoramaIcons: {
220
- spot: 'URL', // icon for camera points in one room
221
- door: 'URL' // icon for door
222
- },
223
-
224
- // scales
225
- scales: ['x05', 'x1'],
226
-
227
- // integrations
204
+ /** Icon for camera point links in one room */
205
+ spot: 'https://images.com/image-spot.svg';
206
+ /** Icon for proactive camera point links in one room */
207
+ interactiveSpot: 'https://images.com/image-interactive-spot.svg';
208
+ /** Icon for door link */
209
+ door: 'https://images.com/image-door.png';
210
+ };
211
+
212
+ /** Overrides locale keys with custom text or translation */
213
+ dictionaryOverrides: {
214
+ 'create-points': 'Create a point', // text for create point
215
+ 'delete-points': 'Remove point', // text for delete point
216
+ 'research-plan': 'Research plan', // text for research plan
217
+ 'rotate-plan': 'Rotate plan', // text for rotate plan
218
+ 'ok': 'Ok', // button text
219
+ 'made-by-link': 'https://getfloorplan.com/', // watermark link
220
+ 'made-by-text': 'getfloorplan.com', // watermark text
221
+ 'instructions-hint-text': '', // additional text on the bottom of instruction modal
222
+ 'floor': '$0 floor' // floor text
223
+ };
224
+
225
+ /** Enable/disable modal of instruction in 3D tour */
226
+ instructionVisible: true;
227
+ /** Enable/disable auto rotation in 3D tour */
228
+ autoRotate: false;
229
+ /** Array of scale keys used as filter, can be x05, x1, x2, x3, x4 */
230
+ scales: ['x05', 'x1'];
231
+ /** Enable/disable device gyroscope for AR */
232
+ enableGyroscope: true;
233
+
234
+ /**
235
+ * Scale button type
236
+ * - `img`: legacy button with icons x05, x1, etc...
237
+ * - `text`: button with text content instead of icon x05, x1, etc...
238
+ */
239
+ scaleButtonType: 'img';
240
+ /** Show floor number endings in floors locale translation */
241
+ floorNumberEndingsVisible: false;
242
+
243
+ /**
244
+ * Design type
245
+ * - `standard`: bottom panel without sidebar, external floors select
246
+ * - `sidebar`: all buttons in sidebar, also floors select in sidebar
247
+ * - `custom`: use `bottombarContent` and `sidebarContent` to select required buttons manually
248
+ */
249
+ designType: 'sidebar';
250
+ /** Bottom container button types to show */
251
+ bottombarContent: [];
252
+ /** Sidebar button types to show */
253
+ sidebarContent: ['floors', 'ruler', 'scale', 'rotation', 'furniture'];
254
+ /**
255
+ * Buttons design version
256
+ * - `two`: buttons design v2.0
257
+ * - `three`: buttons design v3.0
258
+ */
259
+ tabsButtonsDesign: 'three';
260
+ /** Proactive cursor type: 'pointer' or 'circle' */
261
+ cursor: 'pointer';
262
+ /** Enable/disable proactive cursor pulse */
263
+ enableCursorPulse: true;
264
+
265
+ /** Widget external integrations */
228
266
  integrations: {
229
- sentry: {
230
- dsn: '<sentry_dsn>',
231
- // Other sentry params
232
- },
233
- },
234
-
235
- cursorType: 'pointer', // can be 'pointer' or 'circle'
236
- enableCursorPulse: true, // enable cursor pulse animation
237
- movementType: 'interroom', // allows movement only within a room or between rooms
238
-
239
- defaultLinkOptions: {
240
- hasRealSize: false, // enable real size icons in classic navigation mode
241
- realSize: 300, // real size
242
- realSizeMobileScale: 1, // mobile scale factor in real size
243
- realSizeMinDistance: 100, // minimal distance to scale down real size icon
244
- realSizeDistanceMinScale: 0.1, // minimal scale for minimal distance scale down
245
- hoverScale: 1.2 // hover scale factor
246
- },
247
-
248
- fadeOptions: {
249
- fadeInTime: 0.5, // fade in duration (in seconds)
250
- fadeOutTime: 0.5, // fade out duration (in seconds)
251
- },
252
-
253
- rulerOptions: {
254
- fontSize: 38, // ruler font size
255
- },
256
-
257
- linkOptions: {
258
- enablePulse: false, // enable hover pulse
259
- pulseFrom: 1, // pulse from scale
260
- pulseTo: 2, // pulse to scale
261
- pulseSpeed: 1, // pulse speed (1 pulse per second)
262
- },
263
-
264
- room_label_visible: false, // show room type label
265
- }
266
-
267
+ /** Configuration options for the Sentry Browser SDK. See: Sentry API BrowserOptions */
268
+ sentry: BrowserOptions;
269
+ };
270
+
271
+ /** Allows movement only within a room or between rooms, can be interroom or intraroom */
272
+ movementType: 'interroom';
273
+
274
+ /** Options for DefaultLink graphics */
275
+ default_link_options: {
276
+ /** Use perspective size for DefaultLink sprite */
277
+ use_real_size: false;
278
+ /** Perspective size */
279
+ real_size: 300;
280
+ /** Perspective size scale on mobile devices */
281
+ real_size_mobile_scale: 1;
282
+ /** Minimal distance to prevent overscale in near distances */
283
+ real_size_min_distance: 100;
284
+ /** Minimal distance scale clamp on near distances */
285
+ real_size_distance_min_scale: 0.1;
286
+ /** Enable/disable scale on hover */
287
+ hover_scale: 1.2;
288
+ };
289
+
290
+ /** Panorama fading options */
291
+ fade_options: {
292
+ /** Time for fade in (seconds) */
293
+ fade_in_time: 0.5;
294
+ /** Time for fade out (seconds) */
295
+ fade_out_time: 0.5;
296
+ };
297
+
298
+ /** Options for DefaultLink graphics */
299
+ ruler_options: {
300
+ /** Font size for ruler text */
301
+ font_size: 38;
302
+ };
303
+
304
+ /** Options for DefaultLink graphics */
305
+ link_options: {
306
+ /** Enable/disable link pulse on hover */
307
+ enable_pulse: false;
308
+ /** Pulse scale from */
309
+ pulse_from_scale: 1;
310
+ /** Pulse scale to */
311
+ pulse_to_scale: 2;
312
+ /** Pulse speed */
313
+ pulse_speed: 1;
314
+
315
+ /** Enable/disable scale on hover */
316
+ enable_point_hover_scale: false;
317
+ /** Hover scale */
318
+ point_hover_scale: 1;
319
+ };
320
+
321
+ /** Options for DefaultLink graphics */
322
+ map_options: {
323
+ /** Map type, should be 'default', 'top_view' or 'multi_floor' */
324
+ type: 'default';
325
+ /** Upscale top view resolution for better rendering */
326
+ top_view_upscale: 2;
327
+ };
328
+
329
+ /** Options for Scene camera */
330
+ camera_options: {
331
+ fov_change_speed: 0;
332
+ };
333
+
334
+ /** Options for DefaultLink graphics */
335
+ lazy_load_options: {
336
+ /** Count panoramas to lazy load after move to another panorama */
337
+ preload_count: 3;
338
+ /** Force lazy load another non-loaded panoramas instead of skipping near cached panoramas */
339
+ force_preload_non_cached: true;
340
+ /** Preload depth maps */
341
+ use_masks_preload: true;
342
+ };
343
+
344
+ /** Widget branding data */
345
+ widget_branding: {
346
+ /** Branded logo path */
347
+ logo_path: 'https://es-logos.com/logo.png';
348
+ /** Branded company name */
349
+ company_name: 'ES Company';
350
+ /** Branded company url */
351
+ company_url: 'https://es.company.com';
352
+ /** Branded widget language (See locale/*) */
353
+ widget_language: 'es';
354
+ }
355
+
356
+ /** Show/hide fullscreen button */
357
+ fullscreen_button_visible: false;
358
+ /** Show/hide room type label */
359
+ room_label_visible: false;
360
+ };
267
361
  ```
268
362
 
269
363
  ## Types of elements
@@ -294,6 +388,8 @@ locale: [
294
388
  scales: [
295
389
  'x1',
296
390
  'x2',
391
+ 'x3',
392
+ 'x4',
297
393
  'x05'
298
394
  ],
299
395
  ```
@@ -329,6 +425,7 @@ panorama: { // type of panorama and paths to 360° images
329
425
  top: null,
330
426
  bottom: null,
331
427
  scene_depth: "", // path to EXR file for depth map if available
428
+ object_ids: "", // path to EXR file for furniture object ids if available
332
429
  ]
333
430
  }
334
431
  ]