architwin 1.1.4 → 1.1.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.
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { SPACE_EVENTS } from "../../../types";
11
11
  import { batchAddEventListenerByClassName, toggleDisplayPane } from "../../events";
12
12
  import { convertToCssRgb } from "../../../utils";
13
- import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories } from "../../../architwin";
13
+ import { gotoTag, disposeTag, dispatchSpaceEvent, _tags, getUserAssignedCategories, _mpConfig } from "../../../architwin";
14
14
  import { initFormData, toggleDropdown } from "./tagFormPane";
15
15
  import { toggleModal, setModalAction } from "./modal";
16
16
  import { Notyf } from 'notyf';
@@ -68,7 +68,7 @@ export function renderTagListPane() {
68
68
  <table id="at-tag-list-container">
69
69
  </table>
70
70
  </div>
71
- <div class="at_button_row at_justify_end">
71
+ <div class="at_button_row at_justify_end ${_mpConfig.restrictionConfig.isReadOnlyMode ? 'at_disabled' : ''}">
72
72
  <div class="at_button at_ghost" id="at-add-tag-btn" data-cy="at-add-tag-btn" target-pane="at-tag-form-pane">
73
73
  ${i18n.t('AddTag')}
74
74
  <span class="mdi mdi-plus-circle-outline"></span>
@@ -106,6 +106,8 @@ export function isTagPartOfCategory(categoryUUID) {
106
106
  export function renderTags(tags, showOwnTagsOnly = false) {
107
107
  console.log("renderTags");
108
108
  const tagContainer = document.getElementById('at-tag-list-container');
109
+ // get value from mp config
110
+ const isReadOnly = _mpConfig.restrictionConfig.isReadOnlyMode;
109
111
  if (!tagContainer) {
110
112
  console.error("Tag container does not exist in DOM");
111
113
  return;
@@ -217,6 +219,8 @@ export function renderTagRow(tag) {
217
219
  element.classList.add('at_tag_row'); //this class is not defined and I only use it as an identifier for attaching events
218
220
  element.setAttribute('id', `at-tag-row-${tag.id}`);
219
221
  // element.setAttribute('tag-id',tag.json_data.id)
222
+ // get read only value from mpconfig
223
+ const isReadOnly = _mpConfig.restrictionConfig.isReadOnlyMode;
220
224
  element.innerHTML = `
221
225
  <td>
222
226
  <div class="at_colored-indicator" style="background-color:${convertToCssRgb(tag.color)}"></div>
@@ -225,10 +229,10 @@ export function renderTagRow(tag) {
225
229
  <span>${tag.label}</span>
226
230
  </td>
227
231
  <td class="at_table_button_row">
228
- <span class="mdi mdi-pencil at_edit_tag_btn" id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-form-pane"></span>
229
- <span class="mdi mdi-content-copy at_copy_tag_btn" id="at-copy-tag-${tag.id}" data-cy="at-copy-tag-${tag.id}" tag-id="${tag.id}"></span>
232
+ <span class="mdi mdi-pencil at_edit_tag_btn ${isReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}" data-cy="at-edit-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-form-pane"></span>
233
+ <span class="mdi mdi-content-copy at_copy_tag_btn ${isReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}"" id="at-copy-tag-${tag.id}" data-cy="at-copy-tag-${tag.id}" tag-id="${tag.id}"></span>
230
234
  <span class="mdi mdi-message at_message_tag_btn" id="at-message-tag-${tag.id}" data-cy="at-message-tag-${tag.id}" tag-id="${tag.id}" target-pane="at-tag-messaging-pane"></span>
231
- <span class="mdi mdi-trash-can-outline at_delete_tag_btn" id="at-delete-tag-${tag.id}" data-cy="at-delete-tag-${tag.id}" tag-id="${tag.id}"></span>
235
+ <span class="mdi mdi-trash-can-outline at_delete_tag_btn ${isReadOnly ? 'at_disabled' : ''} id="at-edit-tag-${tag.id}" id="at-delete-tag-${tag.id}" data-cy="at-delete-tag-${tag.id}" tag-id="${tag.id}"></span>
232
236
  </td>
233
237
  `;
234
238
  return element;
package/lib/types.d.ts CHANGED
@@ -40,6 +40,7 @@ export interface ITagCategory {
40
40
  color: ITagColor;
41
41
  icon?: string;
42
42
  iconUrl?: string;
43
+ isReadOnly?: boolean;
43
44
  };
44
45
  subcategories: Array<ITagCategory>;
45
46
  }
@@ -129,10 +130,14 @@ export interface IMPConfig {
129
130
  meetSdkKey?: string;
130
131
  meetSecretKey?: string;
131
132
  avatartwinKey?: string;
133
+ appName?: string;
132
134
  };
133
135
  debug?: {
134
136
  logLevel: string;
135
137
  };
138
+ restrictionConfig?: {
139
+ isReadOnlyMode?: boolean;
140
+ };
136
141
  }
137
142
  export interface IMapConfig {
138
143
  mapId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architwin",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "ArchiTwin Library for Matterport",
5
5
  "main": "./lib/architwin.js",
6
6
  "types": "./lib/architwin.d.ts",
@@ -933,4 +933,8 @@
933
933
  margin: 6px 6px 0px 6px !important;
934
934
  gap: 0px !important;
935
935
  padding: 10px 10px 5px 10px !important;
936
+ }
937
+
938
+ .at_disabled {
939
+ pointer-events: none;
936
940
  }