architwin 1.2.2 → 1.2.5
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 +1614 -643
- package/lib/architwin.d.ts +11 -21
- package/lib/architwin.js +1 -1
- package/lib/atwinui/components/toolbar/index.d.ts +2 -2
- package/lib/atwinui/components/toolbar/index.js +2 -2
- package/lib/atwinui/components/toolbar/modal.d.ts +3 -1
- package/lib/atwinui/components/toolbar/modal.js +29 -8
- package/lib/atwinui/components/toolbar/tagListPane.js +5 -1
- package/lib/atwinui/index.d.ts +2 -1
- package/lib/atwinui/index.js +2 -2
- package/lib/convert.d.ts +1 -13
- package/lib/convert.js +6 -47
- package/lib/loaders/planeGeometry2.d.ts +10 -0
- package/lib/loaders/planeGeometry2.js +56 -3
- package/lib/minimap.d.ts +7 -1
- package/lib/minimap.js +42 -2
- package/lib/tag.d.ts +2 -1
- package/lib/tag.js +3 -1
- package/lib/types.d.ts +13 -11
- package/lib/types.js +2 -0
- package/package.json +2 -2
- package/pre_deploy.sh +53 -0
- package/lib/architwin.min.js +0 -1
- package/lib/atwinui/components/toolbar/menu-bar.d.ts +0 -4
- package/lib/atwinui/components/toolbar/menu-bar.js +0 -35
- package/lib/atwinui/components/toolbar/sidebar-container.d.ts +0 -5
- package/lib/atwinui/components/toolbar/sidebar-container.js +0 -27
- package/lib/components/Container.d.ts +0 -4
- package/lib/components/Container.js +0 -12
- package/lib/components/componentBuilder.d.ts +0 -4
- package/lib/components/componentBuilder.js +0 -53
- package/lib/components/events.d.ts +0 -9
- package/lib/components/events.js +0 -151
- package/lib/components/index.d.ts +0 -5
- package/lib/components/index.js +0 -52
- package/lib/mediascreen.d.ts +0 -8
- package/lib/mediascreen.js +0 -242
- 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
|
|
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">×</div>
|
|
20
19
|
</div>
|
|
21
20
|
<div class="at_modal-content">
|
|
22
|
-
<h2 class="at_modal-content-heading" id="at-modal-content-heading"
|
|
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
|
-
|
|
23
|
+
|
|
25
24
|
</p>
|
|
26
25
|
<div>
|
|
27
|
-
<button class="at_close-button at_modal-accept-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
|
|
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
|
-
|
|
59
|
-
|
|
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(
|
|
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);
|
package/lib/atwinui/index.d.ts
CHANGED
|
@@ -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 };
|
package/lib/atwinui/index.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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
|
-
|
|
36
|
-
|
|
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)
|
|
53
|
-
const g = parseInt(hexcode.substring(2, 4), 16)
|
|
54
|
-
const b = parseInt(hexcode.substring(4, 6), 16)
|
|
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,
|
|
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({
|
|
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
|
-
|
|
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/tag.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { MpSdk } from "../bundle/sdk";
|
|
2
2
|
import { IAtwinFloor, IAtwinLabel, ITag, EmbedlyData } from "./types";
|
|
3
3
|
import { AxiosInstance } from "axios";
|
|
4
|
-
declare function renderTag({ tag, sdk }: {
|
|
4
|
+
declare function renderTag({ tag, sdk, isTagSharing }: {
|
|
5
5
|
tag: MpSdk.Tag.Descriptor;
|
|
6
6
|
sdk: MpSdk;
|
|
7
|
+
isTagSharing: boolean;
|
|
7
8
|
}): Promise<MpSdk.Tag.TagData>;
|
|
8
9
|
declare function setTagIcon(payload: {
|
|
9
10
|
sdk: MpSdk;
|
package/lib/tag.js
CHANGED
|
@@ -20,7 +20,7 @@ const api = axios.create({
|
|
|
20
20
|
Accept: 'application/json'
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
function renderTag({ tag, sdk }) {
|
|
23
|
+
function renderTag({ tag, sdk, isTagSharing = true }) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
log.info('__@ renderTag() $', tag, sdk);
|
|
26
26
|
if (!tag.anchorPosition) {
|
|
@@ -57,6 +57,8 @@ function renderTag({ tag, sdk }) {
|
|
|
57
57
|
log.info('__@ tagData', tagData);
|
|
58
58
|
log.info('tag to be rendered', tag);
|
|
59
59
|
const tagIds = yield sdk.Tag.add(tag);
|
|
60
|
+
// set toggle sharing property in tag billboard
|
|
61
|
+
sdk.Tag.toggleSharing(isTagSharing);
|
|
60
62
|
if (!tagData.id) {
|
|
61
63
|
tagData.id = tagIds[0];
|
|
62
64
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -130,24 +130,24 @@ 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;
|
|
137
136
|
};
|
|
138
137
|
restrictionConfig?: {
|
|
139
138
|
isTagReadOnly?: boolean;
|
|
139
|
+
isTagToggleSharing?: boolean;
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
export interface IMapConfig {
|
|
143
143
|
mapId: string;
|
|
144
144
|
showDirection?: boolean;
|
|
145
145
|
position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft';
|
|
146
|
-
fixedSized
|
|
146
|
+
fixedSized?: {
|
|
147
147
|
width: number;
|
|
148
148
|
height?: number;
|
|
149
149
|
};
|
|
150
|
-
sweepMarker
|
|
150
|
+
sweepMarker?: {
|
|
151
151
|
showOnHover: boolean;
|
|
152
152
|
backgroundColor: string;
|
|
153
153
|
activeColor: string;
|
|
@@ -629,7 +629,9 @@ export declare enum SPACE_EVENTS {
|
|
|
629
629
|
TAG_LINK_GENERATED = "TAG_LINK_GENERATED",
|
|
630
630
|
SET_TAG_ICON = "SET_TAG_ICON",
|
|
631
631
|
VIEW_TAG_MESSAGE = "VIEW_TAG_MESSAGE",
|
|
632
|
-
TOOLBAR_LOADED = "TOOLBAR_LOADED"
|
|
632
|
+
TOOLBAR_LOADED = "TOOLBAR_LOADED",
|
|
633
|
+
SWEEP_COLLECTION_UPDATED = "SWEEP_COLLECTION_UPDATED",
|
|
634
|
+
MINIMAP_SWEEP_CLICK = "MINIMAP_SWEEP_CLICK"
|
|
633
635
|
}
|
|
634
636
|
export declare const enum TAG_COLOR {
|
|
635
637
|
MAROON = "MAROON",
|
|
@@ -770,6 +772,11 @@ export interface IToolbarConfig {
|
|
|
770
772
|
};
|
|
771
773
|
themeConfig?: IThemeConfig;
|
|
772
774
|
}
|
|
775
|
+
export interface ModalContent {
|
|
776
|
+
title: string;
|
|
777
|
+
description: string;
|
|
778
|
+
buttonLabel?: string;
|
|
779
|
+
}
|
|
773
780
|
export declare const enum IO_ROLE {
|
|
774
781
|
HOST = "host",
|
|
775
782
|
GUEST = "guest"
|
|
@@ -856,12 +863,6 @@ export interface TagMessage {
|
|
|
856
863
|
created_on?: any;
|
|
857
864
|
modified_on?: any;
|
|
858
865
|
}
|
|
859
|
-
export interface ModalContent {
|
|
860
|
-
title: string;
|
|
861
|
-
subtitle: string | undefined;
|
|
862
|
-
content: HTMLElement | undefined;
|
|
863
|
-
action: HTMLElement | undefined;
|
|
864
|
-
}
|
|
865
866
|
export interface EmbedlyData {
|
|
866
867
|
author_name: string;
|
|
867
868
|
author_url: string;
|
|
@@ -892,7 +893,8 @@ export declare const enum SCREEN_POSITIONS {
|
|
|
892
893
|
TOP_LEFT = "topLeft",
|
|
893
894
|
TOP_RIGHT = "topRight",
|
|
894
895
|
BOTTOM_LEFT = "bottomLeft",
|
|
895
|
-
BOTTOM_RIGHT = "bottomRight"
|
|
896
|
+
BOTTOM_RIGHT = "bottomRight",
|
|
897
|
+
CENTER = "center"
|
|
896
898
|
}
|
|
897
899
|
export declare const enum FORM_MODE {
|
|
898
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.
|
|
3
|
+
"version": "1.2.5",
|
|
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": "
|
|
25
|
+
"deploy:package": ". ~/.nvm/nvm.sh && tsc && terser lib/architwin.js -o lib/architwin.js && ./post_deploy.sh"
|
|
26
26
|
},
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|