architwin 1.0.90 → 1.0.92
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/lib/atwinui/components/toolbar/tagListPane.js +1 -1
- package/lib/atwinui/events.js +78 -63
- package/lib/tag.js +11 -7
- package/lib/types.d.ts +16 -0
- package/package.json +1 -1
- package/static/atwinui.css +10 -2
|
@@ -34,7 +34,7 @@ export function renderTagListPane() {
|
|
|
34
34
|
<div class="at_panel_header">
|
|
35
35
|
<span>${i18n.t('Tags')}</span>
|
|
36
36
|
</div>
|
|
37
|
-
<div class="at_form_container at_h-min-65">
|
|
37
|
+
<div class="at_form_container at_h-min-65 at_tag_list_pane">
|
|
38
38
|
<div class="at_field at_flex_column" style="${_tagCategories ? '' : 'display: none;'}">
|
|
39
39
|
<label for="">${i18n.t('Category')}</label>
|
|
40
40
|
<div class="at_dropdown" id="at-custom-category-filter-dropdown" data-cy="at-custom-category-filter-dropdown">
|
package/lib/atwinui/events.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { actionBar, renderObjectCards, renderLibraryCards, renderTags, renderTagRow, getTagFormData, addClickEventToTagRow, setActiveCard, setActiveMenu, setActiveActionBtn, removeObjectCard, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown } from "./components/toolbar";
|
|
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,
|
|
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, setObjectTransformation, getSelectedObject, _atwin } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
14
|
import { SPACE_EVENTS } from "../types";
|
|
@@ -17,6 +17,7 @@ import { renderObjectList } from "./components/toolbar/objectListPane";
|
|
|
17
17
|
import { renderLibraryList } from "./components/toolbar/libraryPane";
|
|
18
18
|
import { renderObjectCard } from "./components/toolbar/card";
|
|
19
19
|
import { toggleModelControl, getCoordinateValues } from "./components/toolbar/modelControlsPane";
|
|
20
|
+
import { attachTagMedia } from "../tag";
|
|
20
21
|
import i18n from './components/toolbar/i18n';
|
|
21
22
|
let activeToolbarItem, activeActionItem, activePane, activeActionPane;
|
|
22
23
|
let notyf = new Notyf({ position: { x: 'left', y: 'bottom' }, duration: 4500 });
|
|
@@ -252,7 +253,6 @@ function handlePlaceTag() {
|
|
|
252
253
|
stemVisible: true,
|
|
253
254
|
};
|
|
254
255
|
moveTagBtn.addEventListener('click', () => __awaiter(this, void 0, void 0, function* () {
|
|
255
|
-
var _a;
|
|
256
256
|
const tag = Object.assign({}, initTagData);
|
|
257
257
|
const payload = getTagFormData();
|
|
258
258
|
if (tagFormMode == "ADD" /* FORM_MODE.ADD */) {
|
|
@@ -262,7 +262,10 @@ function handlePlaceTag() {
|
|
|
262
262
|
if (payload && payload.tagName && payload.tagCategoryId && payload.tagSubcategoryId) {
|
|
263
263
|
tag.label = payload.tagName;
|
|
264
264
|
tag.description = payload.tagDescription;
|
|
265
|
-
|
|
265
|
+
if (payload.tagEmbed && !tag.attachments) {
|
|
266
|
+
tag.attachments = [];
|
|
267
|
+
}
|
|
268
|
+
tag.attachments.push(payload.tagEmbed);
|
|
266
269
|
if (targetCategory) {
|
|
267
270
|
console.log("targetCategory is", targetCategory);
|
|
268
271
|
tag.color = targetCategory.json_data.color.rgb;
|
|
@@ -277,23 +280,26 @@ function handlePlaceTag() {
|
|
|
277
280
|
const targetSubCat = targetCategory.subcategories.find(subcat => subcat.uuid === payload.tagSubcategoryId);
|
|
278
281
|
console.log('__@ JOTEST: icon: ', targetSubCat.json_data.iconUrl);
|
|
279
282
|
console.log('__@ JOTEST: Setting tag icon...');
|
|
280
|
-
|
|
283
|
+
//await setTagIcon({tag: iTag, icon: targetSubCat.json_data.iconUrl ?? '', color: iTag.color})
|
|
281
284
|
console.log('__@ JOTEST: Tag icon set!');
|
|
282
285
|
moveTag(iTag.id, onTagPlaced);
|
|
283
286
|
function onTagPlaced() {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
287
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
288
|
+
console.log("tag placed");
|
|
289
|
+
const tagContainer = document.getElementById('at-tag-list-container');
|
|
290
|
+
const row = renderTagRow(iTag);
|
|
291
|
+
tagContainer.appendChild(row);
|
|
292
|
+
addClickEventToTagRow(iTag);
|
|
293
|
+
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
294
|
+
// toggleDisplayPane('at-cancel-tag-form-btn')
|
|
295
|
+
notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
|
|
296
|
+
const tags = getMpTags();
|
|
297
|
+
_tags[tags.length - 1].category_uuid = payload.tagSubcategoryId;
|
|
298
|
+
currentTag = _tags[_tags.length - 1];
|
|
299
|
+
console.log('_tags', _tags);
|
|
300
|
+
console.log("Last Tag Pushed", currentTag);
|
|
301
|
+
clearTagFormDropdown();
|
|
302
|
+
});
|
|
297
303
|
}
|
|
298
304
|
}
|
|
299
305
|
else {
|
|
@@ -308,16 +314,19 @@ function handlePlaceTag() {
|
|
|
308
314
|
console.log('iTag', iTag);
|
|
309
315
|
moveTag(iTag.id, onTagPlaced);
|
|
310
316
|
function onTagPlaced() {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
console.log("tag placed");
|
|
319
|
+
const tagContainer = document.getElementById('at-tag-list-container');
|
|
320
|
+
const row = renderTagRow(iTag);
|
|
321
|
+
tagContainer.appendChild(row);
|
|
322
|
+
addClickEventToTagRow(iTag);
|
|
323
|
+
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
324
|
+
// toggleDisplayPane('at-cancel-tag-form-btn')
|
|
325
|
+
notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
|
|
326
|
+
const tags = getMpTags();
|
|
327
|
+
currentTag = tags[tags.length - 1];
|
|
328
|
+
console.log("Last Tag Pushed", tags[tags.length - 1]);
|
|
329
|
+
});
|
|
321
330
|
}
|
|
322
331
|
}
|
|
323
332
|
else {
|
|
@@ -336,24 +345,27 @@ function handlePlaceTag() {
|
|
|
336
345
|
console.log('iTag', iTag);
|
|
337
346
|
moveTag(iTag.json_data.id, onTagPlaced);
|
|
338
347
|
function onTagPlaced() {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
348
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
+
console.log("tag placed");
|
|
350
|
+
const tagContainer = document.getElementById('at-tag-list-container');
|
|
351
|
+
const row = renderTagRow(iTag);
|
|
352
|
+
tagContainer.appendChild(row);
|
|
353
|
+
addClickEventToTagRow(iTag);
|
|
354
|
+
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
355
|
+
// toggleDisplayPane('at-cancel-tag-form-btn')
|
|
356
|
+
notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
|
|
357
|
+
const tags = getMpTags();
|
|
358
|
+
console.log("tags", tags);
|
|
359
|
+
console.log("_tags", _tags);
|
|
360
|
+
const index = _tags.findIndex(tag => tag.id == iTag.id);
|
|
361
|
+
if (index !== -1) {
|
|
362
|
+
console.log("tag found");
|
|
363
|
+
_tags[index].category_uuid = payload.tagSubcategoryId;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
console.log("tag not found");
|
|
367
|
+
}
|
|
368
|
+
});
|
|
357
369
|
}
|
|
358
370
|
}
|
|
359
371
|
else {
|
|
@@ -368,24 +380,27 @@ function handlePlaceTag() {
|
|
|
368
380
|
const iTag = selectedTag;
|
|
369
381
|
moveTag(iTag.json_data.id, onTagPlaced);
|
|
370
382
|
function onTagPlaced() {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
383
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
384
|
+
console.log("tag placed");
|
|
385
|
+
const tagContainer = document.getElementById('at-tag-list-container');
|
|
386
|
+
const row = renderTagRow(iTag);
|
|
387
|
+
tagContainer.appendChild(row);
|
|
388
|
+
addClickEventToTagRow(iTag);
|
|
389
|
+
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
390
|
+
// toggleDisplayPane('at-cancel-tag-form-btn')
|
|
391
|
+
notyf.success(`${i18n.t('SuccessAddTagToSpace')}`);
|
|
392
|
+
const tags = getMpTags();
|
|
393
|
+
console.log("tags", tags);
|
|
394
|
+
console.log("_tags", _tags);
|
|
395
|
+
const index = _tags.findIndex(tag => tag.id == iTag.id);
|
|
396
|
+
if (index !== -1) {
|
|
397
|
+
console.log("tag found");
|
|
398
|
+
_tags[index].category_uuid = payload.tagSubcategoryId;
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
console.log("tag not found");
|
|
402
|
+
}
|
|
403
|
+
});
|
|
389
404
|
}
|
|
390
405
|
}
|
|
391
406
|
else {
|
package/lib/tag.js
CHANGED
|
@@ -30,9 +30,9 @@ function renderTag({ tag, sdk }) {
|
|
|
30
30
|
console.error('Stem Vector is required');
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
if
|
|
34
|
-
|
|
35
|
-
}
|
|
33
|
+
// if(tag.attachments){
|
|
34
|
+
// delete tag.attachments
|
|
35
|
+
// }
|
|
36
36
|
const tagData = {};
|
|
37
37
|
// remove tag.id if tag.id is falsy; else set tagData.id
|
|
38
38
|
if (!tag.id || tag.id === '') {
|
|
@@ -49,6 +49,10 @@ function renderTag({ tag, sdk }) {
|
|
|
49
49
|
tagData.color = tag.color;
|
|
50
50
|
tagData.anchorPosition = tag.anchorPosition;
|
|
51
51
|
tagData.stemVector = tag.stemVector;
|
|
52
|
+
if (tag.attachments) {
|
|
53
|
+
tagData.attachments = tag.attachments;
|
|
54
|
+
delete tag.attachments;
|
|
55
|
+
}
|
|
52
56
|
console.log('__@ tagData', tagData);
|
|
53
57
|
console.log('tag to be rendered', tag);
|
|
54
58
|
const tagIds = yield sdk.Tag.add(tag);
|
|
@@ -58,11 +62,11 @@ function renderTag({ tag, sdk }) {
|
|
|
58
62
|
// if(tag. && payload.icon.trim() !== ''){
|
|
59
63
|
// await setTagIcon({sdk: sdk, tag: tag, icon: payload.icon,color:payload.tag.color})
|
|
60
64
|
// }
|
|
61
|
-
return tagData;
|
|
62
65
|
// //attach media to tag (Video / Image / PDF); There are still more attachment types pls refer https://matterport.github.io/showcase-sdk/docs/reference/current/enums/tag.attachmenttype.html
|
|
63
|
-
// if(
|
|
64
|
-
// await attachTagMedia({sdk:
|
|
66
|
+
// if(tagData.attachments && tagData.attachments.length > 0){
|
|
67
|
+
// await attachTagMedia({sdk: sdk, tag: tagData, attachments: tagData.attachments})
|
|
65
68
|
// }
|
|
69
|
+
return tagData;
|
|
66
70
|
// // set tag icon
|
|
67
71
|
// if(payload.icon && payload.icon.trim() !== ''){
|
|
68
72
|
// await setTagIcon({sdk: payload.sdk, tag: tag, icon: payload.icon,color:payload.tag.color})
|
|
@@ -174,7 +178,7 @@ function moveTag(payload, callback) {
|
|
|
174
178
|
}
|
|
175
179
|
if (callback) {
|
|
176
180
|
console.log('__@ onCallback()');
|
|
177
|
-
callback(placer);
|
|
181
|
+
yield callback(placer);
|
|
178
182
|
}
|
|
179
183
|
});
|
|
180
184
|
yield placer.moveTag(onClick);
|
package/lib/types.d.ts
CHANGED
|
@@ -839,6 +839,22 @@ export interface ModalContent {
|
|
|
839
839
|
content: HTMLElement | undefined;
|
|
840
840
|
action: HTMLElement | undefined;
|
|
841
841
|
}
|
|
842
|
+
export interface EmbedlyData {
|
|
843
|
+
author_name: string;
|
|
844
|
+
author_url: string;
|
|
845
|
+
height: number;
|
|
846
|
+
html: string;
|
|
847
|
+
provider_name: string;
|
|
848
|
+
provider_url: string;
|
|
849
|
+
thumbnail_height: number;
|
|
850
|
+
thumbnail_url: string;
|
|
851
|
+
thumbnail_width: number;
|
|
852
|
+
title: string;
|
|
853
|
+
type: string;
|
|
854
|
+
url: string;
|
|
855
|
+
version: string;
|
|
856
|
+
width: number;
|
|
857
|
+
}
|
|
842
858
|
export declare const enum IO_PARTICIPANT_COLORS {
|
|
843
859
|
GREEN = "GREEN",
|
|
844
860
|
BLUE = "BLUE",
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
color: var(--text-color-light);
|
|
322
322
|
border-radius: var(--container-border-radius);
|
|
323
323
|
padding: var(--container-padding);
|
|
324
|
-
justify-content: var(--container-justify-content);
|
|
324
|
+
justify-content: var(--container-justify-content);
|
|
325
325
|
flex-wrap: var(--container-wrap);
|
|
326
326
|
gap: 16px;
|
|
327
327
|
flex-direction: column;
|
|
@@ -925,4 +925,12 @@
|
|
|
925
925
|
padding: 0rem 1rem;
|
|
926
926
|
}
|
|
927
927
|
|
|
928
|
-
}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
/* CUSTOM CLASSES */
|
|
932
|
+
.at_tag_list_pane {
|
|
933
|
+
margin: 6px 6px 0px 6px !important;
|
|
934
|
+
gap: 0px !important;
|
|
935
|
+
padding: 10px 10px 5px 10px !important;
|
|
936
|
+
}
|