architwin 1.13.0 → 1.13.1

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.
@@ -167,6 +167,7 @@ i18n
167
167
  "RotateMinimap": "Rotate Minimap",
168
168
  "General Settings": "General Settings",
169
169
  "UploadImage": "Upload Image",
170
+ "Unsend": "Unsend",
170
171
  "Pipes": "Pipes",
171
172
  "SelectPipeType": "Select Pipe Type",
172
173
  "AddPipeType": "Add Pipe Type",
@@ -255,7 +256,7 @@ i18n
255
256
  "Object": "オブジェクト",
256
257
  "Minimap": "ミニマップ",
257
258
  "Meeting": "打ち合わせ",
258
- "Screenshot": "スクリーンショット",
259
+ "Screenshot": "スクショ",
259
260
  "Close": "閉じる",
260
261
  "Translate": "移動",
261
262
  "Rotate": "回転",
@@ -355,9 +356,10 @@ i18n
355
356
  "General Settings": "一般設定",
356
357
  "BIM Settings": "BIM設定",
357
358
  "Due to restrictions, original minimap is unavailable in password protected spaces. Please select and setup a custom minimap instead.": "制限事項により、パスワードで保護されたスペースではオリジナルのミニマップはご利用いただけません。代わりにカスタムミニマップを選択して設定してください。",
358
- "RotateMinimap": "ミニマップの回転",
359
+ "RotateMinimap": "画像回転",
359
360
  "Search...": "検索...",
360
361
  "UploadImage": "画像をアップロード",
362
+ "Unsend": "取り消し",
361
363
  "Pipes": "配管",
362
364
  "SelectPipeType": "配管種別選択",
363
365
  "AddPipeType": "配管種別を追加",
@@ -17,3 +17,4 @@ export declare function renderCategoryDropdownOptions(elementId: string, items:
17
17
  export declare function renderSubcategoryDropdownOptions(elementId: string, items: Array<ITagCategory>): void;
18
18
  export declare function clearTagFormDropdown(): void;
19
19
  export declare function clearTagFilterDropdown(): void;
20
+ export declare function setTagFormMode(formMode: FORM_MODE): void;
@@ -7,7 +7,7 @@ let tagNameInput, tagDescriptionInput, tagEmbedInput, tagCategoryDropdown, tagSu
7
7
  let selectedCategoryId = undefined;
8
8
  let selectedSubCategoryId = undefined;
9
9
  let isChevronEventAdded = false;
10
- export let tagFormMode = "ADD" /* FORM_MODE.ADD */;
10
+ export let tagFormMode = "NONE" /* FORM_MODE.NONE */;
11
11
  export let selectedTag = undefined;
12
12
  export function renderTagFormPane() {
13
13
  const element = document.createElement('div');
@@ -531,3 +531,6 @@ export function clearTagFilterDropdown() {
531
531
  }
532
532
  selectOption(noSelection, 'at-subcategory-filter-dropdown-toggle', subcatSkipToggle);
533
533
  }
534
+ export function setTagFormMode(formMode) {
535
+ tagFormMode = formMode;
536
+ }
@@ -134,6 +134,7 @@ export function renderTagMessage(message, optimisticUpdate = false) {
134
134
  //const created_on = format(new Date(), 'yyyy-MM-dd HH:mm:ss')
135
135
  const parsedDate = parseISO(message.created_on);
136
136
  const created_on = dateToString(parsedDate);
137
+ const displayUnsendBtn = `display: ${message.is_sender ? 'block' : 'none'}`;
137
138
  if (optimisticUpdate && message.binaryFile) {
138
139
  const reader = new FileReader();
139
140
  reader.onload = function (event) {
@@ -153,8 +154,8 @@ export function renderTagMessage(message, optimisticUpdate = false) {
153
154
  ` : ``}
154
155
  <small>${created_on}</small><br>
155
156
  <div class="at_flex at_justify_center at_comment_unsend_container" style="${checkTimeoutDifference(message.created_on, 'check') == true ? 'at_comment_unsend_container' : 'display: none'} id="at-unsend-container-${message.uuid}">
156
- <small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text">&nbsp;</small>
157
- <small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-user-text-${created_on}">Unsend</small>
157
+ <small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text" style="${displayUnsendBtn}">&nbsp;</small>
158
+ <small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-user-text-${created_on}" style="${displayUnsendBtn}">${i18n.t('Unsend')}</small>
158
159
  </div>
159
160
  </div>
160
161
  </div>
@@ -179,8 +180,8 @@ export function renderTagMessage(message, optimisticUpdate = false) {
179
180
  ` : ``}
180
181
  <small>${created_on}</small><br>
181
182
  <div class="at_flex at_justify_center at_comment_unsend_container" id="at-unsend-container-${message.uuid}" style="${checkTimeoutDifference(message.created_on, 'check') == true ? 'at_comment_unsend_container' : 'display: none'}">
182
- <small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text">&nbsp;</small>
183
- <small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-admin-text-${message.uuid}" value="${message.uuid}">Unsend</small>
183
+ <small class="mdi mdi-arrow-u-left-top at_text_xxs at_align_center at_comment_unsend_text" style="${displayUnsendBtn}">&nbsp;</small>
184
+ <small class="at_text_xxs at_align_center at_comment_unsend_text" id="at-unsend-admin-text-${message.uuid}" value="${message.uuid}" style="${displayUnsendBtn}">${i18n.t('Unsend')}</small>
184
185
  </div>
185
186
  </div>
186
187
 
@@ -350,7 +351,6 @@ export function unsendComment(payload) {
350
351
  }
351
352
  // this sets the Interval to check if Timeout hadn't pass yet
352
353
  export function timedoutComment(payload) {
353
- console.log('timedoutComment()', payload);
354
354
  setInterval(function () {
355
355
  // console.log("This message prints every 5 seconds.", payload);
356
356
  payload.filter((message) => __awaiter(this, void 0, void 0, function* () {
@@ -11,8 +11,8 @@ import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTag
11
11
  import { getTargetPosition, addMediaScreen, _3DXObjects, selectedObject, setTransformControls, copyObject, revertTransform, clearSelectedObject, removeTransformControls, getLibrary, getMpTags, renderTag, captureSpaceScreenshot, moveTag, subscribeSpaceEvent, setModelVisibility, disposeModel, disposeTag, _tags, _tagCategories, dispatchSpaceEvent, editTagLabel, editTagDescription, setTagMessageRecepients, setTagMessages, setSelectedTagUuid, renderMeetingSidebar, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, _modelDetails, actionHistory, get3DXObjects, transformHistory, goToModel, themeManager, _partitionNodes, setSpacePartitionNodes, getSpaceId, setFloorBaseHeight, toggleWallVisibility, getChildrenOfModel, toggleFloorVisibility, renderPolygon, getCurrentPolygon, getFloorBaseHeight, setSelectedObject, redoDrawAction, undoDrawAction, setWallBaseHeight, clearWallBaseHeight, clearFloorBaseHeight, isToolbarFeatureEnabled, captureCurrentView, getCurrentFloor, setPipeCategories, setPipes, detachTagMedia, getTagDataCollection } from "../architwin";
12
12
  import { Notyf } from 'notyf';
13
13
  import 'notyf/notyf.min.css';
14
- import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS } from "../types";
15
- import { initFormData } from "./components/toolbar/tagFormPane";
14
+ import { SPACE_EVENTS, COORDINATE_SYSTEM, UNITS, DEGREE, MAP_OPTIONS, CUSTOM_MAP_MODE } from "../types";
15
+ import { initFormData, setTagFormMode } from "./components/toolbar/tagFormPane";
16
16
  import { renderObjectList } from "./components/toolbar/objectListPane";
17
17
  import { renderLibraryList } from "./components/toolbar/libraryPane";
18
18
  import { renderObjectCard } from "./components/toolbar/card";
@@ -222,6 +222,7 @@ function toggleDisplayPane(targetId) {
222
222
  }
223
223
  if (paneId === 'at-tag-form-pane') {
224
224
  log.info("Tag Form Pane");
225
+ setTagFormMode("ADD" /* FORM_MODE.ADD */);
225
226
  clearTagFormDropdown();
226
227
  initFormData();
227
228
  setTagCategoriesOption();
@@ -1049,6 +1050,7 @@ function handleSaveTag() {
1049
1050
  clearTagFormDropdown();
1050
1051
  iTag = null;
1051
1052
  saveTagBtn.classList.remove('at_disabled');
1053
+ setTagFormMode("NONE" /* FORM_MODE.NONE */);
1052
1054
  }));
1053
1055
  }
1054
1056
  function handleScreenshot() {
@@ -2607,21 +2609,37 @@ function handleShowCustomMinimapSettings() {
2607
2609
  settingsBtn.addEventListener('click', () => {
2608
2610
  isCustomMapControlsVisible = !isCustomMapControlsVisible;
2609
2611
  if (mapControlsContainer) {
2612
+ // Shows setting controls
2610
2613
  if (isCustomMapControlsVisible) {
2611
2614
  mapControlsContainer.classList.add('show');
2612
2615
  minimapPane.classList.add('show-settings');
2616
+ minimap.setCustomMapMode(CUSTOM_MAP_MODE.EDIT);
2617
+ // Enter edit mode; Update sweep color
2618
+ updateSweepColor(CUSTOM_MAP_MODE.EDIT);
2613
2619
  }
2614
2620
  else {
2621
+ // Hides setting controld
2615
2622
  mapControlsContainer.classList.remove('show');
2616
2623
  if (minimap.getMinimapPosition().includes('bottom')) {
2617
2624
  minimapPane.classList.add('no-transition');
2618
2625
  }
2619
2626
  minimapPane.classList.remove('show-settings');
2627
+ minimap.setCustomMapMode(CUSTOM_MAP_MODE.DEFAULT);
2628
+ // Exit edit mode; Back to default color
2629
+ updateSweepColor(CUSTOM_MAP_MODE.DEFAULT);
2620
2630
  }
2621
2631
  }
2622
2632
  });
2623
2633
  }
2624
2634
  }
2635
+ function updateSweepColor(mode) {
2636
+ const addClass = mode === CUSTOM_MAP_MODE.EDIT ? 'at_sweep_color_edit' : 'at_sweep_color_default';
2637
+ const removeClass = mode === CUSTOM_MAP_MODE.EDIT ? 'at_sweep_color_default' : 'at_sweep_color_edit';
2638
+ document.querySelectorAll('.at_custom_sweep').forEach(el => {
2639
+ el.classList.remove(removeClass);
2640
+ el.classList.add(addClass);
2641
+ });
2642
+ }
2625
2643
  /**
2626
2644
  * Closes the custom minimap panel.
2627
2645
  */
package/lib/minimap.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { MpSdk } from "../bundle/sdk";
2
- import { ISweep, SweepColor, DEGREE, CustomMapFloorData } from "./types";
2
+ import { ISweep, SweepColor, DEGREE, CustomMapFloorData, CUSTOM_MAP_MODE } from "./types";
3
3
  import 'notyf/notyf.min.css';
4
4
  declare let isMinimapNavigation: boolean;
5
5
  interface FloorData {
@@ -120,4 +120,6 @@ declare function getCustomMapFloorData(index?: number): CustomMapFloorData[] | C
120
120
  declare function resetCustomMapSettingValues(): void;
121
121
  declare function setMpSDK(mpSdk: MpSdk): void;
122
122
  declare function getMpSdk(): MpSdk;
123
- export { isMinimapNavigation, mapPositions, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, toggleMinimapVisibility, setSweepMarkerColor, setStandaloneMap, toggleMinimapFloor, getFloorsInSpace, createDropdown, setMinimapPosition, setCurrentMinimapPosition, setCustomMap, setupCustomMinimapPane, setCustomMinimapRotation, getCustomMinimapRotation, generateCustomMinimap, setCustomMapScale, setCustomMapTranslate, setCustomMapXOffset, setCustomMapYOffset, getCustomMapScale, getCustomMapTranslate, getCustomMapXOffset, getCustomMapYOffset, setMinAndMax, setCustomMapFloorData, getCustomMapFloorData, resetCustomMapSettingValues, getMinimapPosition, subscribeToFloorChanges, setMpSDK, getMpSdk };
123
+ declare function setCustomMapMode(mode: CUSTOM_MAP_MODE): void;
124
+ declare function getCustomMapMode(): CUSTOM_MAP_MODE;
125
+ export { isMinimapNavigation, mapPositions, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, toggleMinimapVisibility, setSweepMarkerColor, setStandaloneMap, toggleMinimapFloor, getFloorsInSpace, createDropdown, setMinimapPosition, setCurrentMinimapPosition, setCustomMap, setupCustomMinimapPane, setCustomMinimapRotation, getCustomMinimapRotation, generateCustomMinimap, setCustomMapScale, setCustomMapTranslate, setCustomMapXOffset, setCustomMapYOffset, getCustomMapScale, getCustomMapTranslate, getCustomMapXOffset, getCustomMapYOffset, setMinAndMax, setCustomMapFloorData, getCustomMapFloorData, resetCustomMapSettingValues, getMinimapPosition, subscribeToFloorChanges, setMpSDK, getMpSdk, setCustomMapMode, getCustomMapMode };
package/lib/minimap.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import * as superviz from './superviz';
11
11
  import { _mpConfig, getCurrentCameraPose, getCurrentSweep, getMapConfig, dispatchSpaceEvent, isCdnMapDataAvailable, getCurrentFloor, minimap } from "./architwin";
12
- import { SPACE_EVENTS, DEGREE, MAP_OPTIONS } from "./types";
12
+ import { SPACE_EVENTS, DEGREE, MAP_OPTIONS, CUSTOM_MAP_MODE } from "./types";
13
13
  import { isValidCSSColor } from "./color";
14
14
  import { _participants } from "./participant";
15
15
  import { getAtwinSdk } from "./architwin";
@@ -46,6 +46,7 @@ let _customMapContainer;
46
46
  let _customMapFloorData = [];
47
47
  let _minimapPosition = "bottomRight";
48
48
  let _mpSdk;
49
+ let _customMapMode = CUSTOM_MAP_MODE.DEFAULT;
49
50
  let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500, types: [
50
51
  {
51
52
  type: 'info',
@@ -1343,7 +1344,12 @@ function displaySweepToCustomMap(sweepItem, mpSdk) {
1343
1344
  const posY = sweepItem.y;
1344
1345
  let thisSweep = document.createElement('button');
1345
1346
  log.info("getCurrentSweep().id ==> ", getCurrentSweep().id);
1346
- const cList = getCurrentSweep().id === sweepItem.id ? 'at_custom_sweep active' : 'at_custom_sweep';
1347
+ const isActive = getCurrentSweep().id === sweepItem.id;
1348
+ const isDefaultMode = _customMapMode === CUSTOM_MAP_MODE.DEFAULT;
1349
+ const cList = isActive
1350
+ ? 'at_custom_sweep active'
1351
+ : `at_custom_sweep ${isDefaultMode ? 'at_sweep_color_default' : 'at_sweep_color_edit'}`;
1352
+ // const cList = getCurrentSweep().id === sweepItem.id ? 'at_custom_sweep active' : 'at_custom_sweep'
1347
1353
  const scaleX = _customMapScale;
1348
1354
  const scaleY = (_customMapScale * 21 / 9) / _customMapTranslate;
1349
1355
  const scaledX = scaleToContainer(posX, minX, maxX, scaleX, 0);
@@ -1618,8 +1624,15 @@ function setMpSDK(mpSdk) {
1618
1624
  function getMpSdk() {
1619
1625
  return _mpSdk;
1620
1626
  }
1627
+ function setCustomMapMode(mode) {
1628
+ log.info("__@ setCustomMapMode: ", mode);
1629
+ _customMapMode = mode;
1630
+ }
1631
+ function getCustomMapMode() {
1632
+ return _customMapMode;
1633
+ }
1621
1634
  export {
1622
1635
  // _miniMapData as minimapData,
1623
1636
  isMinimapNavigation, mapPositions, setMap, showMinimap, hideMinimap, locateAvatar, resetSweepMarkerColors, renderOverlaySweep, showDirection, toggleMinimapVisibility, setSweepMarkerColor, setStandaloneMap, toggleMinimapFloor, getFloorsInSpace, createDropdown, setMinimapPosition, setCurrentMinimapPosition,
1624
1637
  // custom minimap
1625
- setCustomMap, setupCustomMinimapPane, setCustomMinimapRotation, getCustomMinimapRotation, generateCustomMinimap, setCustomMapScale, setCustomMapTranslate, setCustomMapXOffset, setCustomMapYOffset, getCustomMapScale, getCustomMapTranslate, getCustomMapXOffset, getCustomMapYOffset, setMinAndMax, setCustomMapFloorData, getCustomMapFloorData, resetCustomMapSettingValues, getMinimapPosition, subscribeToFloorChanges, setMpSDK, getMpSdk };
1638
+ setCustomMap, setupCustomMinimapPane, setCustomMinimapRotation, getCustomMinimapRotation, generateCustomMinimap, setCustomMapScale, setCustomMapTranslate, setCustomMapXOffset, setCustomMapYOffset, getCustomMapScale, getCustomMapTranslate, getCustomMapXOffset, getCustomMapYOffset, setMinAndMax, setCustomMapFloorData, getCustomMapFloorData, resetCustomMapSettingValues, getMinimapPosition, subscribeToFloorChanges, setMpSDK, getMpSdk, setCustomMapMode, getCustomMapMode };
package/lib/types.d.ts CHANGED
@@ -1007,6 +1007,7 @@ export interface TagMessage {
1007
1007
  binaryFile?: File;
1008
1008
  created_on?: any;
1009
1009
  modified_on?: any;
1010
+ is_sender?: boolean;
1010
1011
  }
1011
1012
  export interface EmbedlyData {
1012
1013
  author_name: string;
@@ -1116,7 +1117,8 @@ export declare const enum SCREEN_POSITIONS {
1116
1117
  }
1117
1118
  export declare const enum FORM_MODE {
1118
1119
  ADD = "ADD",
1119
- EDIT = "EDIT"
1120
+ EDIT = "EDIT",
1121
+ NONE = "NONE"
1120
1122
  }
1121
1123
  export declare enum ZOOM_COMMAND {
1122
1124
  TOGGLE_VIDEO_ON = "TOGGLE VIDEO ON",
@@ -1335,6 +1337,10 @@ export declare enum MAP_OPTIONS {
1335
1337
  DEFAULT_MAP = "Default Minimap",
1336
1338
  CUSTOM_MAP = "Custom Minimap"
1337
1339
  }
1340
+ export declare enum CUSTOM_MAP_MODE {
1341
+ DEFAULT = "DEFAULT",
1342
+ EDIT = "EDIT"
1343
+ }
1338
1344
  export interface VetexData {
1339
1345
  uuid: string;
1340
1346
  name: string;
package/lib/types.js CHANGED
@@ -167,6 +167,11 @@ export var MAP_OPTIONS;
167
167
  MAP_OPTIONS["DEFAULT_MAP"] = "Default Minimap";
168
168
  MAP_OPTIONS["CUSTOM_MAP"] = "Custom Minimap";
169
169
  })(MAP_OPTIONS || (MAP_OPTIONS = {}));
170
+ export var CUSTOM_MAP_MODE;
171
+ (function (CUSTOM_MAP_MODE) {
172
+ CUSTOM_MAP_MODE["DEFAULT"] = "DEFAULT";
173
+ CUSTOM_MAP_MODE["EDIT"] = "EDIT";
174
+ })(CUSTOM_MAP_MODE || (CUSTOM_MAP_MODE = {}));
170
175
  export var COLLAPSE;
171
176
  (function (COLLAPSE) {
172
177
  COLLAPSE["TOGGLE_ID"] = "at-collapse-toggle-btn";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",
package/static/map.css CHANGED
@@ -397,7 +397,7 @@ display: inline-block;
397
397
  width: 0.5rem;
398
398
  opacity: var(--map-sweep-opacity);
399
399
  /* border: 0.20rem solid rgba(255, 255, 0, 0.79); */
400
- border: 0.20rem solid var(--map-sweep-color);
400
+ /* border: 0.20rem solid var(--map-sweep-color); */
401
401
  border-radius: 50%;
402
402
  box-sizing: content-box;
403
403
  background-color: transparent;
@@ -405,6 +405,14 @@ display: inline-block;
405
405
  cursor: pointer;
406
406
  }
407
407
 
408
+ .at_sweep_color_edit {
409
+ border: 0.20rem solid rgba(255, 255, 0, 0.79);
410
+ }
411
+
412
+ .at_sweep_color_default {
413
+ border: 0.20rem solid var(--map-sweep-color);
414
+ }
415
+
408
416
  .at_custom_sweep.active {
409
417
  background-color: orangered;
410
418
  /* background-color: var(--map-sweep-color); */