architwin 1.2.4 → 1.2.6

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 (36) hide show
  1. package/README.md +1614 -643
  2. package/lib/architwin.d.ts +11 -21
  3. package/lib/architwin.js +1 -1
  4. package/lib/atwinui/components/toolbar/index.d.ts +2 -2
  5. package/lib/atwinui/components/toolbar/index.js +2 -2
  6. package/lib/atwinui/components/toolbar/modal.d.ts +3 -1
  7. package/lib/atwinui/components/toolbar/modal.js +29 -8
  8. package/lib/atwinui/components/toolbar/tagListPane.js +5 -1
  9. package/lib/atwinui/index.d.ts +2 -1
  10. package/lib/atwinui/index.js +2 -2
  11. package/lib/convert.d.ts +1 -13
  12. package/lib/convert.js +6 -47
  13. package/lib/loaders/planeGeometry2.d.ts +10 -0
  14. package/lib/loaders/planeGeometry2.js +56 -3
  15. package/lib/minimap.d.ts +7 -1
  16. package/lib/minimap.js +42 -2
  17. package/lib/types.d.ts +12 -11
  18. package/lib/types.js +2 -0
  19. package/package.json +2 -2
  20. package/pre_deploy.sh +48 -0
  21. package/lib/architwin.min.js +0 -1
  22. package/lib/atwinui/components/toolbar/menu-bar.d.ts +0 -4
  23. package/lib/atwinui/components/toolbar/menu-bar.js +0 -35
  24. package/lib/atwinui/components/toolbar/sidebar-container.d.ts +0 -5
  25. package/lib/atwinui/components/toolbar/sidebar-container.js +0 -27
  26. package/lib/components/Container.d.ts +0 -4
  27. package/lib/components/Container.js +0 -12
  28. package/lib/components/componentBuilder.d.ts +0 -4
  29. package/lib/components/componentBuilder.js +0 -53
  30. package/lib/components/events.d.ts +0 -9
  31. package/lib/components/events.js +0 -151
  32. package/lib/components/index.d.ts +0 -5
  33. package/lib/components/index.js +0 -52
  34. package/lib/mediascreen.d.ts +0 -8
  35. package/lib/mediascreen.js +0 -242
  36. package/lib/supervizTypes.js +0 -95
@@ -13,7 +13,7 @@ import { renderThemePane, setActiveThemeCard } from "./themePane";
13
13
  import { setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard } from "./card";
14
14
  import { renderRecepientOptions, renderTagMessages, createTagMessage, setTagMessagingDetails } from "./tagMessagingPane";
15
15
  import { clearTagFormDropdown, clearTagFilterDropdown } from "./tagFormPane";
16
- import { renderModal, toggleModal } from "./modal";
16
+ import { renderModal, toggleModal, setModalAction } from "./modal";
17
17
  import { renderModelControlPane, toggleModelControl } from "./modelControlsPane";
18
18
  import { getURLParams } from "../../../utils";
19
19
  import './i18n';
@@ -99,4 +99,4 @@ function renderToolbarUI(payload) {
99
99
  tagMessagingPane.style.display = 'none';
100
100
  themePane.style.display = 'none';
101
101
  }
102
- export { actionBar, tagFormMode, selectedTag, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, toggleModelControl };
102
+ export { actionBar, tagFormMode, selectedTag, renderToolbarUI, renderObjectCards, setActiveMenu, clearActiveMenu, setActiveActionBtn, renderLibraryCards, renderTags, getTagFormData, renderTagRow, addClickEventToTagRow, setTagCategoriesOption, setActiveThemeCard, setActiveCard, setActiveLibraryCard, clearActiveCard, clearActiveLibraryCard, removeObjectCard, renderRecepientOptions, renderTagMessages, createTagMessage, renderCategoryDropdownOptions, toggleDropdown, setTagLink, getTagLink, setTagMessagingDetails, clearTagFormDropdown, clearTagFilterDropdown, getObjectListStatus, toggleModal, setModalAction, toggleModelControl };
@@ -1,4 +1,6 @@
1
+ import type { ModalContent } from '../../../types';
1
2
  export declare let activeModal: boolean;
2
3
  export declare function renderModal(): void;
3
4
  export declare function toggleModal(visible?: boolean): void;
4
- export declare function setModalAction(label: string, callback: Function): Promise<void>;
5
+ export declare function closeModal(): void;
6
+ export declare function setModalAction(content: ModalContent, callback: Function): Promise<void>;
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import i18n from './i18n';
11
10
  export let activeModal = false;
12
11
  export function renderModal() {
13
12
  const element = document.createElement('div');
@@ -19,12 +18,12 @@ export function renderModal() {
19
18
  <div class="at_modal-close-button at_close-icon">&times;</div>
20
19
  </div>
21
20
  <div class="at_modal-content">
22
- <h2 class="at_modal-content-heading" id="at-modal-content-heading">${i18n.t('DeleteTag')}</h2>
21
+ <h2 class="at_modal-content-heading" id="at-modal-content-heading"></h2>
23
22
  <p class="at_modal-content-subheading" id="at-modal-content-subheading">
24
- ${i18n.t('ConfirmDeleteTag')}
23
+
25
24
  </p>
26
25
  <div>
27
- <button class="at_close-button at_modal-accept-button">${i18n.t('YesDelete')}</button>
26
+ <button class="at_close-button at_modal-accept-button"></button>
28
27
  </div>
29
28
  </div>
30
29
  </div>
@@ -51,18 +50,40 @@ export function toggleModal(visible = true) {
51
50
  modalOverlay.style.display = 'none';
52
51
  return;
53
52
  }
54
- export function setModalAction(label, callback) {
53
+ export function closeModal() {
54
+ const modalOverlay = document.getElementById('at-modal-overlay');
55
+ const modalClose = document.querySelector('.at_modal-close-button');
56
+ if (modalClose) {
57
+ modalClose.addEventListener('click', (event) => {
58
+ modalOverlay.style.display = 'none';
59
+ });
60
+ }
61
+ }
62
+ export function setModalAction(content, callback) {
55
63
  return __awaiter(this, void 0, void 0, function* () {
56
64
  const modalAcceptBtn = document.querySelector('.at_modal-accept-button');
65
+ const modalTitle = document.getElementById('at-modal-content-heading');
66
+ const modelDesc = document.getElementById('at-modal-content-subheading');
67
+ if (content) {
68
+ if (modalTitle && content.title) {
69
+ modalTitle.textContent = content.title;
70
+ }
71
+ if (modelDesc && content.description) {
72
+ modelDesc.textContent = content.description;
73
+ }
74
+ }
57
75
  if (modalAcceptBtn) {
58
- // if (label) {
59
- // modalAcceptBtn.textContent = label
60
- // }
76
+ if (content && content.buttonLabel) {
77
+ modalAcceptBtn.textContent = content.buttonLabel;
78
+ }
61
79
  if (callback) {
62
80
  modalAcceptBtn.onclick = () => __awaiter(this, void 0, void 0, function* () {
63
81
  yield callback();
64
82
  });
65
83
  }
84
+ else {
85
+ modalAcceptBtn.onclick = closeModal;
86
+ }
66
87
  }
67
88
  });
68
89
  }
@@ -181,7 +181,11 @@ export function renderTags(tags, showOwnTagsOnly = false) {
181
181
  const tag = document.getElementById(event.target.id);
182
182
  if (tag) {
183
183
  toggleModal();
184
- setModalAction('Yes, delete', () => __awaiter(this, void 0, void 0, function* () {
184
+ setModalAction({
185
+ title: `${i18n.t('DeleteTag')}`,
186
+ description: `${i18n.t('ConfirmDeleteTag')}`,
187
+ buttonLabel: `${i18n.t('YesDelete')}`
188
+ }, () => __awaiter(this, void 0, void 0, function* () {
185
189
  const tagId = tag.getAttribute('tag-id');
186
190
  if (tagId && tagId !== null) {
187
191
  console.log("TAG DELETE", tagId, _tags);
@@ -1,6 +1,7 @@
1
1
  import { setActiveToolbarItem } from './events';
2
2
  import '../../static/atwinui.css';
3
+ import { toggleModal, setModalAction } from './components/toolbar';
3
4
  import { IToolbarData, IThemeConfig } from '../types';
4
5
  declare function initToolbarUI(payload: IToolbarData): void;
5
6
  declare function themeManager(config: IThemeConfig): void;
6
- export { initToolbarUI, setActiveToolbarItem, themeManager };
7
+ export { initToolbarUI, setActiveToolbarItem, themeManager, toggleModal, setModalAction };
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { batchAddEventListenerByClassName, batchAddEventListenerById, setActiveToolbarItem, toggleDisplayPane, toggleActionBar, setupIndividualEventListeners, setupSpaceEventSubscriptions, handleShowMinimap, handleRenderMeetingUI } from './events';
11
11
  import '../../static/atwinui.css';
12
- import { renderToolbarUI, setActiveMenu, setActiveActionBtn, setActiveThemeCard, toggleModelControl } from './components/toolbar';
12
+ import { renderToolbarUI, setActiveMenu, setActiveActionBtn, setActiveThemeCard, toggleModelControl, toggleModal, setModalAction } from './components/toolbar';
13
13
  import { SPACE_EVENTS } from '../types';
14
14
  import { dispatchSpaceEvent } from '../architwin';
15
15
  import log from 'loglevel';
@@ -174,4 +174,4 @@ function themeManager(config) {
174
174
  }
175
175
  export {
176
176
  //actionBar,
177
- initToolbarUI, setActiveToolbarItem, themeManager };
177
+ initToolbarUI, setActiveToolbarItem, themeManager, toggleModal, setModalAction };
package/lib/convert.d.ts CHANGED
@@ -1,10 +1,6 @@
1
- export declare let generatedIds: Array<number>;
2
1
  export declare function meterToMillimeter(meter: number, decimal?: number): number;
3
2
  export declare function generateRandomUniqueNumber(currentIds: Array<number>): number;
4
- export declare function generateUUID(config?: {
5
- length?: number;
6
- separator?: string;
7
- }): string;
3
+ export declare function generateUUID(): string;
8
4
  export declare function useHexToRgb(hexcode: string): {
9
5
  r: number;
10
6
  g: number;
@@ -15,11 +11,3 @@ export declare function useRgbToHex(color: {
15
11
  g: number;
16
12
  b: number;
17
13
  }): string;
18
- export declare function convertToCssRgb(values: {
19
- r: number;
20
- g: number;
21
- b: number;
22
- }): string;
23
- export declare function arrayBufferToBase64(buffer: any): string;
24
- export declare function isUrlValid(userInput: string): boolean;
25
- export declare function dateTimeFormat(d: any): string;
package/lib/convert.js CHANGED
@@ -1,6 +1,3 @@
1
- import { format, toDate } from 'date-fns';
2
- import { ja } from 'date-fns/locale';
3
- export let generatedIds = [];
4
1
  export function meterToMillimeter(meter, decimal = 2) {
5
2
  const mm = meter * 1000;
6
3
  return parseFloat(mm.toFixed(decimal));
@@ -16,7 +13,7 @@ export function generateRandomUniqueNumber(currentIds) {
16
13
  } while (currentIds.indexOf(randomNumber) !== -1);
17
14
  return randomNumber;
18
15
  }
19
- export function generateUUID(config) {
16
+ export function generateUUID() {
20
17
  const cryptoObj = window.crypto;
21
18
  if (!cryptoObj) {
22
19
  console.error('crypto.getRandomValues() is not supported in this browser.');
@@ -32,26 +29,16 @@ export function generateUUID(config) {
32
29
  }
33
30
  hex.push(val);
34
31
  }
35
- let randUUID = `${hex[0]}${hex[1]}-${hex[2]}-${hex[3]}-${hex[4]}-${hex[5]}${hex[6]}${hex[7]}`;
36
- if (config && config.length) {
37
- console.log('Length set');
38
- randUUID = randUUID.slice(0, config.length);
39
- }
40
- if (config && config.separator) {
41
- console.log('Separator set');
42
- if (config.separator === 'none') {
43
- randUUID = randUUID.replace(/-/g, config.separator);
44
- }
45
- }
46
- return randUUID;
32
+ // The UUID string format is "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
33
+ return `${hex[0]}${hex[1]}-${hex[2]}-${hex[3]}-${hex[4]}-${hex[5]}${hex[6]}${hex[7]}`;
47
34
  }
48
35
  export function useHexToRgb(hexcode) {
49
36
  // Remove '#' symbol if it exists
50
37
  hexcode = hexcode.replace("#", "");
51
38
  // Parse hex values for red, green, and blue
52
- const r = parseInt(hexcode.substring(0, 2), 16) / 255;
53
- const g = parseInt(hexcode.substring(2, 4), 16) / 255;
54
- const b = parseInt(hexcode.substring(4, 6), 16) / 255;
39
+ const r = parseInt(hexcode.substring(0, 2), 16);
40
+ const g = parseInt(hexcode.substring(2, 4), 16);
41
+ const b = parseInt(hexcode.substring(4, 6), 16);
55
42
  return { r, g, b };
56
43
  }
57
44
  export function useRgbToHex(color) {
@@ -65,31 +52,3 @@ export function useRgbToHex(color) {
65
52
  const hexB = color.b.toString(16).padStart(2, "0");
66
53
  return `${hexR}${hexG}${hexB}`;
67
54
  }
68
- export function convertToCssRgb(values) {
69
- // console.log('convertToCssRgb()', values)
70
- if (!values) {
71
- console.log('values is undefined');
72
- return;
73
- }
74
- let r = Math.round(values.r * 255);
75
- let g = Math.round(values.g * 255);
76
- let b = Math.round(values.b * 255);
77
- return `rgb(${r},${g},${b})`;
78
- }
79
- export function arrayBufferToBase64(buffer) {
80
- let binary = '';
81
- const bytes = new Uint8Array(buffer);
82
- const len = bytes.byteLength;
83
- for (let i = 0; i < len; i++) {
84
- binary += String.fromCharCode(bytes[i]);
85
- }
86
- return btoa(binary);
87
- }
88
- export function isUrlValid(userInput) {
89
- const urlPattern = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;
90
- return urlPattern.test(userInput);
91
- }
92
- export function dateTimeFormat(d) {
93
- const local = format(toDate(d), 'yyyy年M月d日 HH:mm:ss', { locale: ja });
94
- return local;
95
- }
@@ -21,6 +21,11 @@ interface IScreenPositions {
21
21
  y: number;
22
22
  z: number;
23
23
  };
24
+ [SCREEN_POSITIONS.CENTER]?: {
25
+ x: number;
26
+ y: number;
27
+ z: number;
28
+ };
24
29
  }
25
30
  declare class PlaneImage {
26
31
  inputs: {
@@ -83,6 +88,8 @@ declare class PlaneVideo {
83
88
  visible: boolean;
84
89
  isFirstLoad: boolean;
85
90
  autoplay: boolean;
91
+ fitToScreen: boolean;
92
+ hudMode: string;
86
93
  };
87
94
  outputs: Record<string, unknown> & MpSdk.Scene.PredefinedOutputs;
88
95
  context: MpSdk.Scene.IComponentContext;
@@ -104,6 +111,7 @@ declare class PlaneVideo {
104
111
  muteBtnTexture: THREE.Texture;
105
112
  unmuteBtnTexture: THREE.Texture;
106
113
  hasOnEndedEventAdded: boolean;
114
+ isFitScreen: boolean;
107
115
  playbackState: 'pause' | 'play' | 'mute' | 'unmute';
108
116
  audio: string;
109
117
  mediaScreenPositions: IScreenPositions;
@@ -138,6 +146,8 @@ declare class PlaneVideo {
138
146
  onInit(): void;
139
147
  onEvent(eventType: string, eventData?: unknown): void;
140
148
  onInputsUpdated(): void;
149
+ dismissFitToScreen(): void;
150
+ activateFitToScreen(): void;
141
151
  renderPlayButtonModel(): void;
142
152
  renderPauseButtonModel(): void;
143
153
  renderMuteModel(): void;
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { _mpConfig, canSetHud, disableFitScreen, enableFitScreen, getMediaScreenHUDs, isFitScreenOccupied, removeMediaScreenHud, saveMediaScreenHud } from "../architwin";
10
+ import { _mpConfig, disableFitScreen, enableFitScreen, getMediaScreenHUDs, isFitScreenOccupied, removeMediaScreenHud, saveMediaScreenHud } from "../architwin";
11
11
  import log from 'loglevel';
12
12
  let _staticAssetPath = '../';
13
13
  const _expandBtn = 'expandBtn';
@@ -192,6 +192,8 @@ class PlaneVideo {
192
192
  visible: true,
193
193
  isFirstLoad: true,
194
194
  autoplay: false,
195
+ fitToScreen: false,
196
+ hudMode: ''
195
197
  };
196
198
  this.events = {
197
199
  'INTERACTION.CLICK': true,
@@ -200,6 +202,7 @@ class PlaneVideo {
200
202
  'planeEvents': true,
201
203
  };
202
204
  this.hasOnEndedEventAdded = false;
205
+ this.isFitScreen = false;
203
206
  this.playbackState = 'pause';
204
207
  this.audio = 'unmuted';
205
208
  this.mediaScreenPositions = {
@@ -207,6 +210,7 @@ class PlaneVideo {
207
210
  ["topLeft" /* SCREEN_POSITIONS.TOP_LEFT */]: { x: -2.2, y: 1.5, z: -2.7 },
208
211
  ["bottomLeft" /* SCREEN_POSITIONS.BOTTOM_LEFT */]: { x: -2.2, y: -1.5, z: -2.7 },
209
212
  ["bottomRight" /* SCREEN_POSITIONS.BOTTOM_RIGHT */]: { x: 2.2, y: -1.5, z: -2.7 },
213
+ ["center" /* SCREEN_POSITIONS.CENTER */]: { x: 0, y: 0, z: -1.5 }
210
214
  };
211
215
  this.expandBtnPositions = {
212
216
  ["topRight" /* SCREEN_POSITIONS.TOP_RIGHT */]: {
@@ -300,6 +304,33 @@ class PlaneVideo {
300
304
  this.planeElement.play();
301
305
  }
302
306
  this.mesh.visible = this.inputs.visible;
307
+ if (this.inputs.fitToScreen || this.inputs.hudMode !== '') {
308
+ console.log("fitToScreen active");
309
+ const hudPosition = this.inputs.hudMode.includes(_expandBtn) ? this.inputs.hudMode : `expandBtn|${this.inputs}`;
310
+ const position = hudPosition.includes(_expandBtn) ? this.inputs.hudMode : 'expandBtn|topRight';
311
+ onClickExpandBtn({
312
+ eventData: {
313
+ collider: {
314
+ name: position
315
+ }
316
+ },
317
+ inputs: this.inputs,
318
+ outputs: this.outputs,
319
+ mesh: this.mesh,
320
+ context: this.context,
321
+ screenPositions: this.mediaScreenPositions,
322
+ });
323
+ if (this.inputs.fitToScreen) {
324
+ onFitScreen({
325
+ inputs: this.inputs,
326
+ outputs: this.outputs,
327
+ mesh: this.mesh,
328
+ context: this.context,
329
+ position: this.fitScreenPos
330
+ });
331
+ this.isFitScreen = true;
332
+ }
333
+ }
303
334
  // throw new Error("Method not implemented.");
304
335
  }
305
336
  onEvent(eventType, eventData) {
@@ -380,6 +411,28 @@ class PlaneVideo {
380
411
  log.info("onInputsUpdated()");
381
412
  this.onInit();
382
413
  }
414
+ dismissFitToScreen() {
415
+ console.log("toggleFitToScreen");
416
+ if (this.isFitScreen) {
417
+ console.log("Fit screen mode active");
418
+ this.context.camera.children[this.context.camera.children.length - 1].visible = false;
419
+ this.context.camera.remove(this.context.camera.children[this.context.camera.children.length - 1]);
420
+ this.isFitScreen = false;
421
+ }
422
+ }
423
+ activateFitToScreen() {
424
+ if (this.isFitScreen == false) {
425
+ this.onEvent('INTERACTION.CLICK', {
426
+ collider: {
427
+ name: '_dismissBtn'
428
+ },
429
+ input: {
430
+ type: 'click'
431
+ }
432
+ });
433
+ this.isFitScreen = true;
434
+ }
435
+ }
383
436
  renderPlayButtonModel() {
384
437
  log.info('renderPlayButtonModel()');
385
438
  const THREE = this.context.three;
@@ -568,7 +621,7 @@ class PlanePdf {
568
621
  ["topRight" /* SCREEN_POSITIONS.TOP_RIGHT */]: { x: 2.2, y: 1.0, z: -2.7 },
569
622
  ["topLeft" /* SCREEN_POSITIONS.TOP_LEFT */]: { x: -2.2, y: 1.0, z: -2.7 },
570
623
  ["bottomLeft" /* SCREEN_POSITIONS.BOTTOM_LEFT */]: { x: -2.2, y: -1.0, z: -2.7 },
571
- ["bottomRight" /* SCREEN_POSITIONS.BOTTOM_RIGHT */]: { x: 2.2, y: -1.0, z: -2.7 },
624
+ ["bottomRight" /* SCREEN_POSITIONS.BOTTOM_RIGHT */]: { x: 2.2, y: -1.0, z: -2.7 }
572
625
  };
573
626
  this.expandBtnPositions = {
574
627
  ["topRight" /* SCREEN_POSITIONS.TOP_RIGHT */]: {
@@ -987,7 +1040,7 @@ function onClickExpandBtn(p) {
987
1040
  saveMediaScreenHud({ meshUuid: p.mesh.uuid, screenPos });
988
1041
  return;
989
1042
  }
990
- let y = p.refresh ? true : canSetHud({ screenPos, meshUuid: p.eventData['collider']['parent']['uuid'] });
1043
+ //let y = p.refresh ? true : canSetHud({screenPos, meshUuid: p.eventData['collider']['parent']['uuid']})
991
1044
  if (x) {
992
1045
  setHudState({
993
1046
  outputs: p.outputs,
package/lib/minimap.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { MpSdk } from "../bundle/sdk";
2
2
  import { ISweep } from "./types";
3
+ import 'notyf/notyf.min.css';
3
4
  declare let isMinimapNavigation: boolean;
4
5
  declare function setMap(mpSdk: MpSdk, appKey: string, mapId: string): Promise<void>;
5
6
  declare function locateAvatar(): Promise<void>;
@@ -8,4 +9,9 @@ declare function hideMinimap(): void;
8
9
  declare function resetSweepMarkerColors(): void;
9
10
  declare function renderOverlaySweep(item: ISweep, socketId: string, color: string): void;
10
11
  declare function showDirection(): void;
11
- export { isMinimapNavigation, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, };
12
+ /**
13
+ * Toggles the visibility of the minimap. This will display a toast notification if the CDN is unavailable or has not
14
+ * finished fetching map data
15
+ */
16
+ declare function toggleMinimapVisibility(): void;
17
+ export { isMinimapNavigation, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, toggleMinimapVisibility };
package/lib/minimap.js CHANGED
@@ -8,11 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import * as superviz from './superviz';
11
- import { _mpConfig, getCurrentCameraPose, getCurrentSweep, getMapConfig } from "./architwin";
11
+ import { _mpConfig, getCurrentCameraPose, getCurrentSweep, getMapConfig, dispatchSpaceEvent, isCdnMapDataAvailable } from "./architwin";
12
+ import { SPACE_EVENTS } from "./types";
12
13
  import { isValidCSSColor } from "./color";
13
14
  import { _participants } from "./participant";
14
15
  import { getAtwinSdk } from "./architwin";
15
16
  import log from 'loglevel';
17
+ import { Notyf } from 'notyf';
18
+ import i18n from './atwinui/components/toolbar/i18n';
19
+ import 'notyf/notyf.min.css';
16
20
  let _miniMapData;
17
21
  let _mapContainer;
18
22
  let _mapBox;
@@ -22,7 +26,15 @@ let _thisParticipant;
22
26
  let _mapImg = null;
23
27
  let _mapWidth;
24
28
  let isMinimapNavigation = false;
29
+ let _minimapSweepCollection = {};
25
30
  const _minimapId = 'minimapCanvas';
31
+ let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500, types: [
32
+ {
33
+ type: 'info',
34
+ background: 'blue',
35
+ icon: '<span class="mdi mdi-information-outline"></span>'
36
+ }
37
+ ] });
26
38
  //Map placement presets
27
39
  const mapPositions = ['topLeft', 'topRight', 'bottomLeft', 'bottomRight'];
28
40
  setInterval(locateAvatar, 5000);
@@ -237,6 +249,7 @@ function setMap(mpSdk, appKey, mapId) {
237
249
  },
238
250
  onCollectionUpdated: function (collection) {
239
251
  log.info('the entire up-to-date collection', collection);
252
+ _minimapSweepCollection = collection;
240
253
  }
241
254
  });
242
255
  // On click - move
@@ -256,6 +269,9 @@ function setMap(mpSdk, appKey, mapId) {
256
269
  if (superviz.isMeetingInitialized) {
257
270
  yield locateAvatar();
258
271
  }
272
+ let clickedSweep;
273
+ clickedSweep = _minimapSweepCollection[event.target.value];
274
+ dispatchSpaceEvent(SPACE_EVENTS.MINIMAP_SWEEP_CLICK, clickedSweep);
259
275
  });
260
276
  })
261
277
  .catch(function (handleError) {
@@ -482,6 +498,30 @@ function showDirection() {
482
498
  ctx.fill();
483
499
  }
484
500
  }
501
+ /**
502
+ * Toggles the visibility of the minimap. This will display a toast notification if the CDN is unavailable or has not
503
+ * finished fetching map data
504
+ */
505
+ function toggleMinimapVisibility() {
506
+ console.log("toggleMinimapVisibility()");
507
+ if (isCdnMapDataAvailable) {
508
+ const minimap = document.getElementById('at-map');
509
+ const style = window.getComputedStyle(minimap);
510
+ log.info("Minimap width", style.display);
511
+ if (style.display === "none") {
512
+ log.info("Showing minimap");
513
+ minimap.style.display = 'block';
514
+ }
515
+ else {
516
+ log.info("Hiding minimap");
517
+ minimap.style.display = 'none';
518
+ }
519
+ }
520
+ else {
521
+ notyf.error(`${i18n.t("MinimapUnavailable")}`);
522
+ log.error("Matterport CDN content is unavailable. Architwin package tried to fetch map data from CDN but got an empty response. Please try again later");
523
+ }
524
+ }
485
525
  export {
486
526
  // _miniMapData as minimapData,
487
- isMinimapNavigation, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, };
527
+ isMinimapNavigation, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, toggleMinimapVisibility };
package/lib/types.d.ts CHANGED
@@ -130,7 +130,6 @@ export interface IMPConfig {
130
130
  meetSdkKey?: string;
131
131
  meetSecretKey?: string;
132
132
  avatartwinKey?: string;
133
- appName?: string;
134
133
  };
135
134
  debug?: {
136
135
  logLevel: string;
@@ -144,11 +143,11 @@ export interface IMapConfig {
144
143
  mapId: string;
145
144
  showDirection?: boolean;
146
145
  position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft';
147
- fixedSized: {
146
+ fixedSized?: {
148
147
  width: number;
149
148
  height?: number;
150
149
  };
151
- sweepMarker: {
150
+ sweepMarker?: {
152
151
  showOnHover: boolean;
153
152
  backgroundColor: string;
154
153
  activeColor: string;
@@ -630,7 +629,9 @@ export declare enum SPACE_EVENTS {
630
629
  TAG_LINK_GENERATED = "TAG_LINK_GENERATED",
631
630
  SET_TAG_ICON = "SET_TAG_ICON",
632
631
  VIEW_TAG_MESSAGE = "VIEW_TAG_MESSAGE",
633
- TOOLBAR_LOADED = "TOOLBAR_LOADED"
632
+ TOOLBAR_LOADED = "TOOLBAR_LOADED",
633
+ SWEEP_COLLECTION_UPDATED = "SWEEP_COLLECTION_UPDATED",
634
+ MINIMAP_SWEEP_CLICK = "MINIMAP_SWEEP_CLICK"
634
635
  }
635
636
  export declare const enum TAG_COLOR {
636
637
  MAROON = "MAROON",
@@ -771,6 +772,11 @@ export interface IToolbarConfig {
771
772
  };
772
773
  themeConfig?: IThemeConfig;
773
774
  }
775
+ export interface ModalContent {
776
+ title: string;
777
+ description: string;
778
+ buttonLabel?: string;
779
+ }
774
780
  export declare const enum IO_ROLE {
775
781
  HOST = "host",
776
782
  GUEST = "guest"
@@ -857,12 +863,6 @@ export interface TagMessage {
857
863
  created_on?: any;
858
864
  modified_on?: any;
859
865
  }
860
- export interface ModalContent {
861
- title: string;
862
- subtitle: string | undefined;
863
- content: HTMLElement | undefined;
864
- action: HTMLElement | undefined;
865
- }
866
866
  export interface EmbedlyData {
867
867
  author_name: string;
868
868
  author_url: string;
@@ -893,7 +893,8 @@ export declare const enum SCREEN_POSITIONS {
893
893
  TOP_LEFT = "topLeft",
894
894
  TOP_RIGHT = "topRight",
895
895
  BOTTOM_LEFT = "bottomLeft",
896
- BOTTOM_RIGHT = "bottomRight"
896
+ BOTTOM_RIGHT = "bottomRight",
897
+ CENTER = "center"
897
898
  }
898
899
  export declare const enum FORM_MODE {
899
900
  ADD = "ADD",
package/lib/types.js CHANGED
@@ -41,6 +41,8 @@ export var SPACE_EVENTS;
41
41
  SPACE_EVENTS["SET_TAG_ICON"] = "SET_TAG_ICON";
42
42
  SPACE_EVENTS["VIEW_TAG_MESSAGE"] = "VIEW_TAG_MESSAGE";
43
43
  SPACE_EVENTS["TOOLBAR_LOADED"] = "TOOLBAR_LOADED";
44
+ SPACE_EVENTS["SWEEP_COLLECTION_UPDATED"] = "SWEEP_COLLECTION_UPDATED";
45
+ SPACE_EVENTS["MINIMAP_SWEEP_CLICK"] = "MINIMAP_SWEEP_CLICK";
44
46
  })(SPACE_EVENTS || (SPACE_EVENTS = {}));
45
47
  export var MEETING_SIDEBAR;
46
48
  (function (MEETING_SIDEBAR) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",
@@ -22,7 +22,7 @@
22
22
  "scripts": {
23
23
  "test": "echo \"Error: no test specified\" && exit 1",
24
24
  "build": "tsc && terser lib/architwin.js -o lib/architwin.js",
25
- "deploy:package": "tsc && terser lib/architwin.js -o lib/architwin.js && ./post_deploy.sh"
25
+ "deploy:package": ". ~/.nvm/nvm.sh && ./pre_deploy.sh && ./post_deploy.sh"
26
26
  },
27
27
  "author": "",
28
28
  "license": "ISC",
package/pre_deploy.sh ADDED
@@ -0,0 +1,48 @@
1
+ #!/bin/bash
2
+
3
+ # -o option
4
+ # This option is supported if the system supports the User Portability Utilities op‐
5
+ # tion. It shall set various options, many of which shall be equivalent to the single
6
+ # option letters. The following values of option shall be supported:
7
+
8
+ # allexport Equivalent to -a.
9
+
10
+ # === to support environment files ===
11
+
12
+ # Load nvm
13
+ export NVM_DIR="$HOME/.nvm"
14
+ # This loads nvm
15
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
16
+ # This loads nvm bash_completion
17
+ [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
18
+
19
+ set -a
20
+ . .env.local
21
+ set +a
22
+
23
+ export ROOT=`pwd`
24
+ export HOME=/home/$USER
25
+
26
+ # latest TAG
27
+ export TAG_LATEST=$(git tag | tail -n1 | cut -f1)
28
+ # use export TAG=<v#.#.#_rc###> to set TAG, otherwise use latest
29
+ if [ -z "$TAG" ]; then
30
+ export TAG=$TAG_LATEST
31
+ fi
32
+
33
+ echo "\n=> TAG to publish...$TAG"
34
+ # Pause the script
35
+ read -p "Press Enter to continue..."
36
+
37
+ echo "\n=> Force PUSH TAGS to Origin..."
38
+ git push -f --tags -v
39
+
40
+ echo "\n=> Locally, checkout deployment TAG and build..."
41
+ git checkout $TAG
42
+
43
+ echo "\n=> Building..."
44
+ npm run build
45
+
46
+ # We must clear temp TAG!!!
47
+ echo "\n Cleaning up environment..."
48
+ export TAG=