architwin 1.8.0 → 1.8.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.
- package/lib/architwin.d.ts +2 -0
- package/lib/atwinui/components/toolbar/menu-bar.d.ts +4 -0
- package/lib/atwinui/components/toolbar/menu-bar.js +35 -0
- package/lib/atwinui/components/toolbar/sidebar-container.d.ts +5 -0
- package/lib/atwinui/components/toolbar/sidebar-container.js +27 -0
- package/lib/convert.d.ts +14 -1
- package/lib/convert.js +63 -6
- package/lib/loaders/viewpointLoader.d.ts +1 -0
- package/lib/loaders/viewpointLoader.js +3 -1
- package/package.json +1 -1
package/lib/architwin.d.ts
CHANGED
|
@@ -358,6 +358,7 @@ declare function updateObject(id: number, payload: FileUpload): Promise<I3DObjec
|
|
|
358
358
|
/**
|
|
359
359
|
* Delete an object from from the s3 bucket
|
|
360
360
|
* @param id - The object id of the target object to be deleted
|
|
361
|
+
* @deprecated - use disposeModel instead
|
|
361
362
|
* @returns
|
|
362
363
|
*/
|
|
363
364
|
declare function deleteObject(id: number): Promise<void>;
|
|
@@ -365,6 +366,7 @@ declare function deleteObject(id: number): Promise<void>;
|
|
|
365
366
|
* Deletes an object added to a showcase space. Not to be confused with delete object which totally deletes an
|
|
366
367
|
* object from the s3 storage
|
|
367
368
|
* @param id - The showcase id of the object
|
|
369
|
+
* @deprecated - use disposeModel instead
|
|
368
370
|
* @returns
|
|
369
371
|
*/
|
|
370
372
|
declare function deleteShowcaseObject(id: number): Promise<void>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { customElement } from 'lit/decorators.js';
|
|
9
|
+
let Menubar = class Menubar extends LitElement {
|
|
10
|
+
render() {
|
|
11
|
+
return html `
|
|
12
|
+
<div class="at_toolbar_container" id="at-menu-bar">
|
|
13
|
+
<div class="at_sidebar_button_icon">
|
|
14
|
+
<span class="mdi mdi-bullseye" id="at-expand-btn"></span>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="at_sidebar_button_icon">
|
|
17
|
+
<span class="mdi mdi-cube-outline" id="at-object-list-btn"></span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="at_sidebar_button_icon">
|
|
20
|
+
<span class="mdi mdi-map" id="at-minimap-btn" target-pane="at-map"></span>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="at_sidebar_button_icon">
|
|
23
|
+
<span class="mdi mdi-message-video" id="at-videocall-btn"></span>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="at_sidebar_button_icon">
|
|
26
|
+
<span class="mdi mdi-monitor-screenshot" id="at-screenshot-btn"></span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
Menubar = __decorate([
|
|
33
|
+
customElement('at-menubar')
|
|
34
|
+
], Menubar);
|
|
35
|
+
export { Menubar };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
let SidebarContainer = class SidebarContainer extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.checked = false;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return html `
|
|
16
|
+
<div class="at_sidebar_container at_topRight" id="at-sidebar-container">
|
|
17
|
+
</div>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
property()
|
|
23
|
+
], SidebarContainer.prototype, "checked", void 0);
|
|
24
|
+
SidebarContainer = __decorate([
|
|
25
|
+
customElement('at-sidebar-container')
|
|
26
|
+
], SidebarContainer);
|
|
27
|
+
export { SidebarContainer };
|
package/lib/convert.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
export declare let generatedIds: Array<number>;
|
|
1
2
|
export declare function meterToMillimeter(meter: number, decimal?: number): number;
|
|
2
3
|
export declare function generateRandomUniqueNumber(currentIds: Array<number>): number;
|
|
3
|
-
export declare function generateUUID(
|
|
4
|
+
export declare function generateUUID(config?: {
|
|
5
|
+
length?: number;
|
|
6
|
+
separator?: string;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function generateRandomUsername(): string;
|
|
4
9
|
export declare function useHexToRgb(hexcode: string): {
|
|
5
10
|
r: number;
|
|
6
11
|
g: number;
|
|
@@ -11,3 +16,11 @@ export declare function useRgbToHex(color: {
|
|
|
11
16
|
g: number;
|
|
12
17
|
b: number;
|
|
13
18
|
}): string;
|
|
19
|
+
export declare function convertToCssRgb(values: {
|
|
20
|
+
r: number;
|
|
21
|
+
g: number;
|
|
22
|
+
b: number;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function arrayBufferToBase64(buffer: any): string;
|
|
25
|
+
export declare function isUrlValid(userInput: string): boolean;
|
|
26
|
+
export declare function dateTimeFormat(d: any): string;
|
package/lib/convert.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { format, toDate } from 'date-fns';
|
|
2
|
+
import { ja } from 'date-fns/locale';
|
|
3
|
+
export let generatedIds = [];
|
|
1
4
|
export function meterToMillimeter(meter, decimal = 2) {
|
|
2
5
|
const mm = meter * 1000;
|
|
3
6
|
return parseFloat(mm.toFixed(decimal));
|
|
@@ -13,7 +16,7 @@ export function generateRandomUniqueNumber(currentIds) {
|
|
|
13
16
|
} while (currentIds.indexOf(randomNumber) !== -1);
|
|
14
17
|
return randomNumber;
|
|
15
18
|
}
|
|
16
|
-
export function generateUUID() {
|
|
19
|
+
export function generateUUID(config) {
|
|
17
20
|
const cryptoObj = window.crypto;
|
|
18
21
|
if (!cryptoObj) {
|
|
19
22
|
console.error('crypto.getRandomValues() is not supported in this browser.');
|
|
@@ -29,16 +32,42 @@ export function generateUUID() {
|
|
|
29
32
|
}
|
|
30
33
|
hex.push(val);
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
let randUUID = `${hex[0]}${hex[1]}-${hex[2]}-${hex[3]}-${hex[4]}-${hex[5]}${hex[6]}${hex[7]}`;
|
|
36
|
+
if (config && config.length) {
|
|
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;
|
|
47
|
+
}
|
|
48
|
+
export function generateRandomUsername() {
|
|
49
|
+
// Helper function to generate a random word
|
|
50
|
+
function getRandomWord(length) {
|
|
51
|
+
let result = '';
|
|
52
|
+
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
|
53
|
+
const charactersLength = characters.length;
|
|
54
|
+
for (let i = 0; i < length; i++) {
|
|
55
|
+
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
const randomWord = getRandomWord(Math.floor(Math.random() * 5) + 4);
|
|
60
|
+
const randomNumber = Math.floor(Math.random() * 10000);
|
|
61
|
+
const username = `${randomWord}${randomNumber}`;
|
|
62
|
+
return username;
|
|
34
63
|
}
|
|
35
64
|
export function useHexToRgb(hexcode) {
|
|
36
65
|
// Remove '#' symbol if it exists
|
|
37
66
|
hexcode = hexcode.replace("#", "");
|
|
38
67
|
// Parse hex values for red, green, and blue
|
|
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);
|
|
68
|
+
const r = parseInt(hexcode.substring(0, 2), 16) / 255;
|
|
69
|
+
const g = parseInt(hexcode.substring(2, 4), 16) / 255;
|
|
70
|
+
const b = parseInt(hexcode.substring(4, 6), 16) / 255;
|
|
42
71
|
return { r, g, b };
|
|
43
72
|
}
|
|
44
73
|
export function useRgbToHex(color) {
|
|
@@ -52,3 +81,31 @@ export function useRgbToHex(color) {
|
|
|
52
81
|
const hexB = color.b.toString(16).padStart(2, "0");
|
|
53
82
|
return `${hexR}${hexG}${hexB}`;
|
|
54
83
|
}
|
|
84
|
+
export function convertToCssRgb(values) {
|
|
85
|
+
// console.log('convertToCssRgb()', values)
|
|
86
|
+
if (!values) {
|
|
87
|
+
console.log('values is undefined');
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let r = Math.round(values.r * 255);
|
|
91
|
+
let g = Math.round(values.g * 255);
|
|
92
|
+
let b = Math.round(values.b * 255);
|
|
93
|
+
return `rgb(${r},${g},${b})`;
|
|
94
|
+
}
|
|
95
|
+
export function arrayBufferToBase64(buffer) {
|
|
96
|
+
let binary = '';
|
|
97
|
+
const bytes = new Uint8Array(buffer);
|
|
98
|
+
const len = bytes.byteLength;
|
|
99
|
+
for (let i = 0; i < len; i++) {
|
|
100
|
+
binary += String.fromCharCode(bytes[i]);
|
|
101
|
+
}
|
|
102
|
+
return btoa(binary);
|
|
103
|
+
}
|
|
104
|
+
export function isUrlValid(userInput) {
|
|
105
|
+
const urlPattern = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/;
|
|
106
|
+
return urlPattern.test(userInput);
|
|
107
|
+
}
|
|
108
|
+
export function dateTimeFormat(d) {
|
|
109
|
+
const local = format(toDate(d), 'yyyy年M月d日 HH:mm:ss', { locale: ja });
|
|
110
|
+
return local;
|
|
111
|
+
}
|
|
@@ -22,7 +22,8 @@ class ViewpointLoader {
|
|
|
22
22
|
bevelSegments: 3,
|
|
23
23
|
textColor: '#FFFFFF',
|
|
24
24
|
maxLineLength: null,
|
|
25
|
-
customPointerTexture: null
|
|
25
|
+
customPointerTexture: null,
|
|
26
|
+
pointerTextureOpacity: 0.6
|
|
26
27
|
};
|
|
27
28
|
this.events = {
|
|
28
29
|
'INTERACTION.CLICK': true,
|
|
@@ -69,6 +70,7 @@ class ViewpointLoader {
|
|
|
69
70
|
this.planeMaterial = new THREE.MeshBasicMaterial({
|
|
70
71
|
map: texture,
|
|
71
72
|
transparent: true,
|
|
73
|
+
opacity: this.pointerTextureOpacity,
|
|
72
74
|
side: THREE.DoubleSide
|
|
73
75
|
});
|
|
74
76
|
this.planeMesh = new THREE.Mesh(this.planeGeometry, this.planeMaterial);
|