architwin 1.6.5 → 1.6.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.
package/README.md
CHANGED
|
@@ -98,6 +98,7 @@ ArchiTwin Library
|
|
|
98
98
|
- [getCurrentSweep()](#getcurrentsweep)
|
|
99
99
|
- [getCurrentSweepPosition()](#getcurrentsweepposition)
|
|
100
100
|
- [getAllSweeps()](#getallsweeps)
|
|
101
|
+
- [disableSweeps()](#disableSweeps)
|
|
101
102
|
- [Video](#video)
|
|
102
103
|
- [playVideo()](#playvideo)
|
|
103
104
|
- [pauseVideo()](#pausevideo)
|
|
@@ -175,7 +176,12 @@ ArchiTwin Library
|
|
|
175
176
|
- [createLocalVideoTrack()](#createlocalvideotrack)
|
|
176
177
|
- [createLocalAudioTrack()](#createlocalaudiotrack)
|
|
177
178
|
- [initializeHTMLElements()](#initializehtmlelements)
|
|
178
|
-
|
|
179
|
+
- [setupMeetingSession()](#setupMeetingSession)
|
|
180
|
+
- [sendCommand()](#sendCommand)
|
|
181
|
+
- [attachParticipantVideo()](#attachParticipantVideo)
|
|
182
|
+
- [Viewpoint](#viewpoint)
|
|
183
|
+
- [renderViewpointMarker()](#renderViewpointMarker)
|
|
184
|
+
- [toggleViewpointVisibility()](#toggleViewpointVisibility)
|
|
179
185
|
## Installation
|
|
180
186
|
### Install Using NPM
|
|
181
187
|
To install the latest ArchiTwin package:
|
|
@@ -595,7 +601,7 @@ You can subscribe your method to more than one event. Currently, we support subs
|
|
|
595
601
|
- CLICK
|
|
596
602
|
- HOVER
|
|
597
603
|
- DRAG
|
|
598
|
-
-
|
|
604
|
+
- DRAG_BEGIN
|
|
599
605
|
- DRAG_END
|
|
600
606
|
- LOADING_PHASE
|
|
601
607
|
- STARTING_PHASE
|
|
@@ -609,12 +615,17 @@ You can subscribe your method to more than one event. Currently, we support subs
|
|
|
609
615
|
- MEDIA_PAUSE
|
|
610
616
|
- MEDIA_MUTE
|
|
611
617
|
- MEDIA_UNMUTE
|
|
618
|
+
- MEDIA_ENDED
|
|
619
|
+
- CURRENT_USER_LOADED
|
|
620
|
+
- CURRENT_USER_CHANGED
|
|
621
|
+
- PARTICIPANT_CHANGED
|
|
612
622
|
- PARTICIPANT_ADDED
|
|
613
623
|
- PARTICIPANT_REMOVED
|
|
614
624
|
- PARTICIPANT_VIDEO_ON
|
|
615
625
|
- PARTICIPANT_VIDEO_OFF
|
|
616
626
|
- PARTICIPANT_AUDIO_STATE
|
|
617
627
|
- MEETING_ENDED
|
|
628
|
+
- MEETING_CLOSED
|
|
618
629
|
- SELECTED_TAG
|
|
619
630
|
- MODEL_RENDERED
|
|
620
631
|
- MODEL_DISPOSED
|
|
@@ -627,6 +638,16 @@ You can subscribe your method to more than one event. Currently, we support subs
|
|
|
627
638
|
- SET_TAG_ICON
|
|
628
639
|
- VIEW_TAG_MESSAGE
|
|
629
640
|
- TOOLBAR_LOADED
|
|
641
|
+
- SWEEP_COLLECTION_UPDATED
|
|
642
|
+
- MINIMAP_SWEEP_CLICK
|
|
643
|
+
- MINIMAP_SWEEPS_RENDERED
|
|
644
|
+
- SCREENSHOT_CAPTURED
|
|
645
|
+
- ON_MOVE_SWEEP
|
|
646
|
+
- ON_CAMERA_MOVE
|
|
647
|
+
- USER_VIEW_POINT
|
|
648
|
+
- TAGPLACER_CREATED
|
|
649
|
+
- ROOM_CHANGED
|
|
650
|
+
- ARRIVED_ON_SWEEP
|
|
630
651
|
|
|
631
652
|
For more information regarding the loading,starting, and playing phase events. Please refer to [this section](#executing-methods-on-specific-app-phases)
|
|
632
653
|
|
|
@@ -3161,7 +3182,7 @@ export interface IMPConfig {
|
|
|
3161
3182
|
embedlyKey: string //for rendering attachments
|
|
3162
3183
|
meetSdkKey?: string //zoom sdk key
|
|
3163
3184
|
meetSecretKey?: string //zoom secret key
|
|
3164
|
-
|
|
3185
|
+
avatartwinKey?: string //superviz key
|
|
3165
3186
|
appName?: string // app name / title
|
|
3166
3187
|
}
|
|
3167
3188
|
debug?: {
|
|
@@ -4332,6 +4353,22 @@ const allSweeps = atwin.getAllSweeps();
|
|
|
4332
4353
|
console.log('All Sweeps:', allSweeps);
|
|
4333
4354
|
```
|
|
4334
4355
|
|
|
4356
|
+
#### disableSweeps()
|
|
4357
|
+
|
|
4358
|
+
This function disables all Sweeps when the iframeId is passed.
|
|
4359
|
+
|
|
4360
|
+
*Function Signature*
|
|
4361
|
+
```typescript
|
|
4362
|
+
function disableSweeps(iframeId: string)
|
|
4363
|
+
```
|
|
4364
|
+
|
|
4365
|
+
*Example:*
|
|
4366
|
+
```typescript
|
|
4367
|
+
import * as atwin from 'architwin'const
|
|
4368
|
+
iframeId = "mp-showcase";
|
|
4369
|
+
const disableSweeps = atwin.disableSweeps(iframeId) (edited)
|
|
4370
|
+
```
|
|
4371
|
+
|
|
4335
4372
|
#### Using custom sweep pucks
|
|
4336
4373
|
|
|
4337
4374
|
Custom sweep pucks allow you to place a 2D circle or 3D torus as an additional visual indicator in your sweeps. Do take note that the sweep pucks do not replace the existing sweep markers on the space. To add custom sweep pucks to your space simply add the following to your config object that you pass to `connectSpace`
|
|
@@ -5357,10 +5394,8 @@ await atwin.disposeModel(target)
|
|
|
5357
5394
|
});
|
|
5358
5395
|
```
|
|
5359
5396
|
|
|
5360
|
-
-----
|
|
5361
|
-
|
|
5362
5397
|
|
|
5363
|
-
<!-- ## Meeting
|
|
5398
|
+
<!-- ## Meeting
|
|
5364
5399
|
|
|
5365
5400
|
### createMeeting()
|
|
5366
5401
|
|
|
@@ -6343,5 +6378,120 @@ const participantCanvas = document.getElementById("at-participant-canvas") as HT
|
|
|
6343
6378
|
await atwin.meet.initializeHTMLElements(videoElement, canvasElement, participantCanvas);
|
|
6344
6379
|
````
|
|
6345
6380
|
|
|
6346
|
-
|
|
6381
|
+
### setupMeetingSession()
|
|
6382
|
+
|
|
6383
|
+
This method sets up the Meeting Session
|
|
6384
|
+
|
|
6385
|
+
*Function Signature*
|
|
6386
|
+
```typescript
|
|
6387
|
+
async function setupMeetingSession(): Promise<boolean>
|
|
6388
|
+
```
|
|
6389
|
+
|
|
6390
|
+
*Example:*
|
|
6391
|
+
````typescript
|
|
6392
|
+
import * as atwin from 'architwin'
|
|
6393
|
+
|
|
6394
|
+
await atwin.meet.setupMeetingSession();
|
|
6395
|
+
````
|
|
6396
|
+
|
|
6397
|
+
### sendCommand()
|
|
6398
|
+
|
|
6399
|
+
This function will send a command to given userId
|
|
6400
|
+
|
|
6401
|
+
*Function Signature*
|
|
6402
|
+
```typescript
|
|
6403
|
+
async function sendCommand(
|
|
6404
|
+
command: ZOOM_COMMAND,
|
|
6405
|
+
userId?: number
|
|
6406
|
+
): Promise<ExecutedFailure | CommandChannelMsg>
|
|
6407
|
+
```
|
|
6408
|
+
|
|
6409
|
+
*Parameter Table*
|
|
6410
|
+
| parameter | type | required | default | values |
|
|
6411
|
+
| :----: | :----: | :---: | :---: | :---: |
|
|
6412
|
+
| command | ZOOM_COMMAND | yes | null | string from ZOOM_COMMAND enum |
|
|
6413
|
+
| userId | number | optional | null | Participant userId |
|
|
6414
|
+
|
|
6415
|
+
*Example:*
|
|
6416
|
+
````typescript
|
|
6417
|
+
import * as atwin from 'architwin'
|
|
6418
|
+
|
|
6419
|
+
await atwin.meet.sendCommand(command, userId);
|
|
6420
|
+
````
|
|
6421
|
+
|
|
6422
|
+
|
|
6423
|
+
### attachParticipantVideo()
|
|
6424
|
+
|
|
6425
|
+
This function will send a command to given userId
|
|
6426
|
+
|
|
6427
|
+
*Function Signature*
|
|
6428
|
+
```typescript
|
|
6429
|
+
async function attachParticipantVideo(userId: number): Promise<boolean>
|
|
6430
|
+
```
|
|
6431
|
+
|
|
6432
|
+
*Parameter Table*
|
|
6433
|
+
| parameter | type | required | default | values |
|
|
6434
|
+
| :----: | :----: | :---: | :---: | :---: |
|
|
6435
|
+
| userId | number | optional | null | Participant userId |
|
|
6436
|
+
|
|
6437
|
+
*Example:*
|
|
6438
|
+
````typescript
|
|
6439
|
+
import * as atwin from 'architwin'
|
|
6440
|
+
|
|
6441
|
+
await atwin.meet.attachParticipantVideo(userId)
|
|
6442
|
+
````
|
|
6443
|
+
|
|
6444
|
+
## Viewpoint
|
|
6445
|
+
|
|
6446
|
+
Viewpoints are pointers composed of a 2 dimensional line and a 2D marker at the opposite that can be used to act as markers of where a user or object is looking at. This can be especially useful for if you plan on implementing multiplayer functionalities in your space. The next few sections will explain how you can render, customize, and manipulate viewpoints.
|
|
6447
|
+
|
|
6448
|
+
### renderViewpointMarker()
|
|
6449
|
+
|
|
6450
|
+
Function that renders an object with an eye icon that serves as a visual representation of a user's line of sight.
|
|
6451
|
+
|
|
6452
|
+
*Function Signature*
|
|
6453
|
+
```typescript
|
|
6454
|
+
async function renderViewpointMarker(transform:{position:Vector3,rotation?:Vector3},options?:ComponentOptions)
|
|
6455
|
+
```
|
|
6456
|
+
|
|
6457
|
+
*Parameter Table*
|
|
6458
|
+
| parameter | type | required | default | values |
|
|
6459
|
+
| :----: | :----: | :---: | :---: | :---: |
|
|
6460
|
+
| position | Vector3 | required | null | x,y,z position of the anchor of the marker |
|
|
6461
|
+
| rotation | Vector3 | optional | null | x,y,z rotation of the anchor |
|
|
6462
|
+
|
|
6463
|
+
*Example:*
|
|
6464
|
+
````typescript
|
|
6465
|
+
import * as atwin from 'architwin'
|
|
6466
|
+
|
|
6467
|
+
await atwin.renderViewpointMarker(position, rotation)
|
|
6468
|
+
````
|
|
6469
|
+
|
|
6470
|
+
### toggleViewpointVisibility()
|
|
6471
|
+
|
|
6472
|
+
Toggle the visibility of a single, group, or all viewpoints. This method requires the object id of the viewpoint
|
|
6473
|
+
|
|
6474
|
+
*Function Signature*
|
|
6475
|
+
```typescript
|
|
6476
|
+
function toggleViewpointVisibility(viewpointIds?:number|Array<number>):void
|
|
6477
|
+
```
|
|
6478
|
+
|
|
6479
|
+
*Parameter Table*
|
|
6480
|
+
| parameter | type | required | default | values |
|
|
6481
|
+
| :----: | :----: | :---: | :---: | :---: |
|
|
6482
|
+
| viewpointIds | number | optional | null | number|Array |
|
|
6483
|
+
|
|
6484
|
+
*Example:*
|
|
6485
|
+
````typescript
|
|
6486
|
+
import * as atwin from 'architwin'
|
|
6487
|
+
|
|
6488
|
+
// without array[]
|
|
6489
|
+
await atwin.toggleViewpointVisibility()
|
|
6490
|
+
|
|
6491
|
+
// with array[]
|
|
6492
|
+
|
|
6493
|
+
// Replace with actual viewpoint ids
|
|
6494
|
+
const ids = [012345, 6789,]
|
|
6347
6495
|
|
|
6496
|
+
await atwin.toggleViewpointVisibility(ids)
|
|
6497
|
+
````
|
|
@@ -5,7 +5,7 @@ export declare let selectedSubCategoryFilterId: any;
|
|
|
5
5
|
export declare function renderTagListPane(): HTMLElement;
|
|
6
6
|
export declare function isTagPartOfCategory(categoryUUID: string): boolean;
|
|
7
7
|
export declare function renderTags(tags: Array<ITag>, showOwnTagsOnly?: boolean): void;
|
|
8
|
-
export declare function renderTagRow(tag: MpSdk.Tag.TagData): HTMLElement;
|
|
8
|
+
export declare function renderTagRow(tag: MpSdk.Tag.TagData, tagIconUrl: string): HTMLElement;
|
|
9
9
|
export declare function setTagLink(link: string): void;
|
|
10
10
|
export declare function getTagLink(): void;
|
|
11
11
|
export declare function addClickEventToTagRow(tag: MpSdk.Tag.TagData): void;
|
|
@@ -125,12 +125,12 @@ export function renderTags(tags, showOwnTagsOnly = false) {
|
|
|
125
125
|
tags.forEach(tag => {
|
|
126
126
|
if (showOwnTagsOnly) {
|
|
127
127
|
if (isTagPartOfCategory(tag.category_uuid)) {
|
|
128
|
-
const row = renderTagRow(tag.json_data);
|
|
128
|
+
const row = renderTagRow(tag.json_data, tag.tag_icon_url);
|
|
129
129
|
tagContainer.appendChild(row);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
else {
|
|
133
|
-
const row = renderTagRow(tag.json_data);
|
|
133
|
+
const row = renderTagRow(tag.json_data, tag.tag_icon_url);
|
|
134
134
|
tagContainer.appendChild(row);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
@@ -222,7 +222,7 @@ export function renderTags(tags, showOwnTagsOnly = false) {
|
|
|
222
222
|
}));
|
|
223
223
|
initDropdownEventListeners();
|
|
224
224
|
}
|
|
225
|
-
export function renderTagRow(tag) {
|
|
225
|
+
export function renderTagRow(tag, tagIconUrl) {
|
|
226
226
|
const element = document.createElement('tr');
|
|
227
227
|
element.classList.add('at_tag_row'); //this class is not defined and I only use it as an identifier for attaching events
|
|
228
228
|
element.setAttribute('id', `at-tag-row-${tag.id}`);
|
|
@@ -230,9 +230,13 @@ export function renderTagRow(tag) {
|
|
|
230
230
|
// get read only value from mpconfig
|
|
231
231
|
const isTagReadOnly = _mpConfig.restrictionConfig.isTagReadOnly;
|
|
232
232
|
console.log("_isTagReadOnly: ", isTagReadOnly);
|
|
233
|
+
// Displays tag icon with tag color indicator
|
|
234
|
+
const thisTagIconURL = tagIconUrl === 'button.png' || tagIconUrl === '' || tagIconUrl === undefined ? "https://cdn.jsdelivr.net/npm/architwin@latest/static/images/button.png" : tagIconUrl;
|
|
233
235
|
element.innerHTML = `
|
|
234
|
-
<td>
|
|
235
|
-
<div class="at_colored-indicator" style="background-color:${convertToCssRgb(tag.color)}"
|
|
236
|
+
<td style="padding-top: 5px;">
|
|
237
|
+
<div class="at_colored-indicator" style="background-color:${convertToCssRgb(tag.color)}">
|
|
238
|
+
<div class="at_colored-indicator-img" style="background-image: url(${thisTagIconURL});"></div>
|
|
239
|
+
</div>
|
|
236
240
|
</td>
|
|
237
241
|
<td id="at-tag-row-${tag.id}" data-cy="at-tag-row-${tag.id}" tag-id="${tag.id}">
|
|
238
242
|
<span>${tag.label}</span>
|
package/lib/atwinui/events.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function setActiveToolbarItem(itemId: string): void;
|
|
|
6
6
|
declare function toggleDisplayPane(targetId: string): Promise<void>;
|
|
7
7
|
declare function toggleActionBar(state: string): void;
|
|
8
8
|
declare function setupIndividualEventListeners(): void;
|
|
9
|
-
declare function handleModelVisibility(objId: string): void
|
|
9
|
+
declare function handleModelVisibility(objId: string): Promise<void>;
|
|
10
10
|
declare function handleDeleteModel(objId: string): Promise<void>;
|
|
11
11
|
declare function handleShowMinimap(): void;
|
|
12
12
|
declare function handleScrollToView(scrollContainerId: string, targetId: string): void;
|
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, removeObjectCard, setTagCategoriesOption, toggleDropdown, tagFormMode, selectedTag, renderRecepientOptions, renderTagMessages, createTagMessage, setTagLink, setTagMessagingDetails, renderCategoryDropdownOptions, clearTagFormDropdown, clearActiveActionBtn, clearActiveCard, toggleActionBarButtons, selectedCategoryFilterId, selectedSubCategoryFilterId, filterTagList, toggleModal, setModalAction } 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, setTagIcon, setObjectTransformation, getSelectedObject, _atwin, isCdnMapDataAvailable, captureScreenshotAndCameraDetails, _mpConfig, cancelModelPlacement, actionHistory, get3DXObjects, transformHistory } from "../architwin";
|
|
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, actionHistory, get3DXObjects, transformHistory, goToModel } from "../architwin";
|
|
12
12
|
import { Notyf } from 'notyf';
|
|
13
13
|
import 'notyf/notyf.min.css';
|
|
14
14
|
import { SPACE_EVENTS } from "../types";
|
|
@@ -418,12 +418,14 @@ function handlePlaceTag() {
|
|
|
418
418
|
iTag = yield renderTag({ tag: tag }, true);
|
|
419
419
|
}
|
|
420
420
|
log.info('iTag', iTag);
|
|
421
|
+
let targetIconUrl = "";
|
|
421
422
|
try {
|
|
422
423
|
// set tag icon
|
|
423
424
|
const targetSubCat = targetCategory.subcategories.find(subcat => subcat.uuid === payload.tagSubcategoryId);
|
|
424
425
|
log.info('__@ [onMoveTag] Icon URL: ', targetSubCat.json_data);
|
|
425
426
|
if (targetSubCat.json_data && targetSubCat.json_data.iconUrl && targetSubCat.json_data.iconUrl !== '' && targetSubCat.json_data.iconUrl.includes('https')) {
|
|
426
|
-
|
|
427
|
+
targetIconUrl = (_a = targetSubCat.json_data.iconUrl) !== null && _a !== void 0 ? _a : '';
|
|
428
|
+
yield setTagIcon({ tag: iTag, iconName: (_b = targetSubCat.json_data.icon) !== null && _b !== void 0 ? _b : '', iconUrl: targetIconUrl, color: iTag.color });
|
|
427
429
|
log.info('__@ [onMoveTag] Tag icon set!');
|
|
428
430
|
}
|
|
429
431
|
}
|
|
@@ -435,7 +437,7 @@ function handlePlaceTag() {
|
|
|
435
437
|
return __awaiter(this, void 0, void 0, function* () {
|
|
436
438
|
log.info("tag placed");
|
|
437
439
|
const tagContainer = document.getElementById('at-tag-list-container');
|
|
438
|
-
const row = renderTagRow(iTag);
|
|
440
|
+
const row = renderTagRow(iTag, targetIconUrl);
|
|
439
441
|
tagContainer.appendChild(row);
|
|
440
442
|
addClickEventToTagRow(iTag);
|
|
441
443
|
if (iTag.attachments && iTag.attachments.length > 0) {
|
|
@@ -470,7 +472,7 @@ function handlePlaceTag() {
|
|
|
470
472
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
473
|
log.info("tag placed");
|
|
472
474
|
const tagContainer = document.getElementById('at-tag-list-container');
|
|
473
|
-
const row = renderTagRow(iTag);
|
|
475
|
+
const row = renderTagRow(iTag, '');
|
|
474
476
|
tagContainer.appendChild(row);
|
|
475
477
|
addClickEventToTagRow(iTag);
|
|
476
478
|
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
@@ -516,7 +518,7 @@ function handlePlaceTag() {
|
|
|
516
518
|
return __awaiter(this, void 0, void 0, function* () {
|
|
517
519
|
log.info("tag placed");
|
|
518
520
|
const tagContainer = document.getElementById('at-tag-list-container');
|
|
519
|
-
const row = renderTagRow(iTag);
|
|
521
|
+
const row = renderTagRow(iTag, '');
|
|
520
522
|
tagContainer.appendChild(row);
|
|
521
523
|
addClickEventToTagRow(iTag);
|
|
522
524
|
if (iTag.attachments && iTag.attachments.length > 0) {
|
|
@@ -556,7 +558,7 @@ function handlePlaceTag() {
|
|
|
556
558
|
return __awaiter(this, void 0, void 0, function* () {
|
|
557
559
|
log.info("tag placed");
|
|
558
560
|
const tagContainer = document.getElementById('at-tag-list-container');
|
|
559
|
-
const row = renderTagRow(iTag);
|
|
561
|
+
const row = renderTagRow(iTag, '');
|
|
560
562
|
tagContainer.appendChild(row);
|
|
561
563
|
addClickEventToTagRow(iTag);
|
|
562
564
|
yield attachTagMedia({ sdk: _atwin, tag: iTag, attachments: iTag.attachments });
|
|
@@ -644,7 +646,7 @@ function handleSaveTag() {
|
|
|
644
646
|
log.info('handleSaveTag()');
|
|
645
647
|
const saveTagBtn = document.getElementById('at-save-tag-btn');
|
|
646
648
|
saveTagBtn.addEventListener('click', (event) => __awaiter(this, void 0, void 0, function* () {
|
|
647
|
-
var _a, _b;
|
|
649
|
+
var _a, _b, _c, _d;
|
|
648
650
|
log.info("save clicked");
|
|
649
651
|
const tagFormPayload = getTagFormData();
|
|
650
652
|
log.info('=== tagFormPayload ===', tagFormPayload);
|
|
@@ -660,6 +662,15 @@ function handleSaveTag() {
|
|
|
660
662
|
currentTag.media_url = tagFormPayload.tagEmbed;
|
|
661
663
|
currentTag.json_data.label = tagFormPayload.tagName;
|
|
662
664
|
currentTag.json_data.description = tagFormPayload.tagDescription;
|
|
665
|
+
// Add tag icon data
|
|
666
|
+
const targetCategory = _tagCategories.find(cat => cat.uuid === tagFormPayload.tagCategoryId);
|
|
667
|
+
if (targetCategory) {
|
|
668
|
+
const targetSubCat = targetCategory.subcategories.find(subcat => subcat.uuid === tagFormPayload.tagSubcategoryId);
|
|
669
|
+
if (targetSubCat.json_data && targetSubCat.json_data.iconUrl && targetSubCat.json_data.iconUrl !== '') {
|
|
670
|
+
currentTag.tag_icon_name = targetSubCat.json_data.icon;
|
|
671
|
+
currentTag.tag_icon_url = targetSubCat.json_data.iconUrl;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
663
674
|
let payload = { tag: currentTag };
|
|
664
675
|
console.log("@__ handleSaveTag payload ", payload);
|
|
665
676
|
dispatchSpaceEvent(SPACE_EVENTS.TAG_SAVED, payload);
|
|
@@ -707,6 +718,8 @@ function handleSaveTag() {
|
|
|
707
718
|
if (selectedTag && tagFormPayload && tagFormPayload.tagName && tagFormPayload.tagCategoryId && tagFormPayload.tagSubcategoryId) {
|
|
708
719
|
log.info('selectedTag', selectedTag);
|
|
709
720
|
const targetCategory = _tagCategories.find(cat => cat.uuid === tagFormPayload.tagCategoryId);
|
|
721
|
+
let thisTagIconName = "";
|
|
722
|
+
let thisTagIconURL = "";
|
|
710
723
|
if (index !== -1) {
|
|
711
724
|
// Replace the existing object with the current payload
|
|
712
725
|
editTagLabel({ tagId: selectedTag.json_data.id, label: tagFormPayload.tagName });
|
|
@@ -721,7 +734,11 @@ function handleSaveTag() {
|
|
|
721
734
|
const targetSubCat = targetCategory.subcategories.find(subcat => subcat.uuid === tagFormPayload.tagSubcategoryId);
|
|
722
735
|
log.info('__@ [onMoveTag] Icon URL: ', targetSubCat.json_data);
|
|
723
736
|
if (targetSubCat.json_data && targetSubCat.json_data.iconUrl && targetSubCat.json_data.iconUrl !== '' && targetSubCat.json_data.iconUrl.includes('https')) {
|
|
724
|
-
|
|
737
|
+
// Set tag icon name and url
|
|
738
|
+
thisTagIconName = (_a = targetSubCat.json_data.icon) !== null && _a !== void 0 ? _a : '';
|
|
739
|
+
thisTagIconURL = (_b = targetSubCat.json_data.iconUrl) !== null && _b !== void 0 ? _b : '';
|
|
740
|
+
// Set tag icon
|
|
741
|
+
yield setTagIcon({ tag: selectedTag.json_data, iconName: thisTagIconName, iconUrl: thisTagIconURL, color: targetCategory.json_data.color.rgb });
|
|
725
742
|
log.info('__@ [onSaveTag] Tag icon set!');
|
|
726
743
|
}
|
|
727
744
|
}
|
|
@@ -730,6 +747,15 @@ function handleSaveTag() {
|
|
|
730
747
|
notyf.error("Error apply subcategory icon");
|
|
731
748
|
}
|
|
732
749
|
}
|
|
750
|
+
else {
|
|
751
|
+
if (targetCategory) {
|
|
752
|
+
const targetSubCat = targetCategory.subcategories.find(subcat => subcat.uuid === tagFormPayload.tagSubcategoryId);
|
|
753
|
+
if (targetSubCat.json_data && targetSubCat.json_data.iconUrl && targetSubCat.json_data.iconUrl !== '') {
|
|
754
|
+
thisTagIconName = (_c = targetSubCat.json_data.icon) !== null && _c !== void 0 ? _c : '';
|
|
755
|
+
thisTagIconURL = (_d = targetSubCat.json_data.iconUrl) !== null && _d !== void 0 ? _d : '';
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
733
759
|
_tags[index].category_uuid = tagFormPayload.tagSubcategoryId;
|
|
734
760
|
_tags[index].json_data.color = targetCategory.json_data.color.rgb;
|
|
735
761
|
if (tagFormPayload.tagEmbed !== _tags[index].media_url) {
|
|
@@ -741,6 +767,9 @@ function handleSaveTag() {
|
|
|
741
767
|
yield attachTagMedia({ sdk: _atwin, tag: tagData, attachments: mediaAttachment });
|
|
742
768
|
}
|
|
743
769
|
_tags[index].media_url = tagFormPayload.tagEmbed;
|
|
770
|
+
// Add tag icon data
|
|
771
|
+
_tags[index].tag_icon_name = thisTagIconName;
|
|
772
|
+
_tags[index].tag_icon_url = thisTagIconURL;
|
|
744
773
|
log.info("Object updated successfully:", _tags[index]);
|
|
745
774
|
notyf.success(`${i18n.t('SuccessUpdateTag')}`);
|
|
746
775
|
}
|
|
@@ -827,27 +856,30 @@ function handleScreenshot() {
|
|
|
827
856
|
}));
|
|
828
857
|
}
|
|
829
858
|
function handleModelVisibility(objId) {
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
859
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
860
|
+
console.log("handleModelVisibility ", objId);
|
|
861
|
+
const setVisibilityBtn = document.getElementById(objId);
|
|
862
|
+
if (setVisibilityBtn) {
|
|
863
|
+
const cardId = setVisibilityBtn.getAttribute('card-id');
|
|
864
|
+
if (cardId) {
|
|
865
|
+
const targetId = Number.parseInt(cardId);
|
|
866
|
+
const target = _3DXObjects.find(obj => obj.object.id === targetId);
|
|
867
|
+
console.log("_3DXObjects ", _3DXObjects);
|
|
868
|
+
//@ts-ignore
|
|
869
|
+
if (target.component.mesh.visible) {
|
|
870
|
+
setModelVisibility(targetId, false);
|
|
871
|
+
setVisibilityBtn.classList.remove('mdi-eye-off');
|
|
872
|
+
setVisibilityBtn.classList.add('mdi-eye');
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
setModelVisibility(targetId, true);
|
|
876
|
+
setVisibilityBtn.classList.remove('mdi-eye');
|
|
877
|
+
setVisibilityBtn.classList.add('mdi-eye-off');
|
|
878
|
+
}
|
|
879
|
+
yield goToModel(targetId);
|
|
848
880
|
}
|
|
849
881
|
}
|
|
850
|
-
}
|
|
882
|
+
});
|
|
851
883
|
}
|
|
852
884
|
function handleDeleteModel(objId) {
|
|
853
885
|
return __awaiter(this, void 0, void 0, function* () {
|
package/package.json
CHANGED
package/static/atwinui.css
CHANGED
|
@@ -347,13 +347,41 @@
|
|
|
347
347
|
color: var(--bg-secondary)
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
|
|
350
|
+
/* ORIGINAL CSS */
|
|
351
|
+
/* .at_colored-indicator {
|
|
351
352
|
width: 1em;
|
|
352
353
|
height: 1em;
|
|
353
354
|
border-radius: 50%;
|
|
354
355
|
border: solid black 1px;
|
|
355
356
|
display: inline-block;
|
|
356
357
|
margin-right: 0.5em;
|
|
358
|
+
} */
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
.at_colored-indicator {
|
|
362
|
+
width: 1.2em;
|
|
363
|
+
height: 1.2em;
|
|
364
|
+
border-radius: 50%;
|
|
365
|
+
border: solid black 1px;
|
|
366
|
+
/* display: inline-block; */
|
|
367
|
+
margin-right: 0.5em;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.at_colored-indicator-img {
|
|
371
|
+
width: 80%;
|
|
372
|
+
height: 80%;
|
|
373
|
+
border-radius: 50%;
|
|
374
|
+
background-size: cover;
|
|
375
|
+
background-position: center;
|
|
376
|
+
background-repeat: no-repeat;
|
|
377
|
+
padding: 0.4em;
|
|
378
|
+
box-sizing: border-box;
|
|
379
|
+
position: absolute;
|
|
380
|
+
top: 0;
|
|
381
|
+
left: 0;
|
|
382
|
+
top: 50%;
|
|
383
|
+
left: 50%;
|
|
384
|
+
transform: translate(-50%, -50%);
|
|
357
385
|
}
|
|
358
386
|
|
|
359
387
|
.at_table_button_row {
|