@operato/scene-basic 1.2.5
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/CHANGELOG.md +11 -0
- package/README.md +0 -0
- package/demo/index.html +158 -0
- package/demo/things-scene-basic.html +6 -0
- package/dist/anchors/ellipse-anchors.d.ts +7 -0
- package/dist/anchors/ellipse-anchors.js +43 -0
- package/dist/anchors/ellipse-anchors.js.map +1 -0
- package/dist/audio.d.ts +25 -0
- package/dist/audio.js +141 -0
- package/dist/audio.js.map +1 -0
- package/dist/cloud.d.ts +13 -0
- package/dist/cloud.js +30 -0
- package/dist/cloud.js.map +1 -0
- package/dist/donut.d.ts +15 -0
- package/dist/donut.js +74 -0
- package/dist/donut.js.map +1 -0
- package/dist/ellipse.d.ts +24 -0
- package/dist/ellipse.js +72 -0
- package/dist/ellipse.js.map +1 -0
- package/dist/gif-view.d.ts +18 -0
- package/dist/gif-view.js +116 -0
- package/dist/gif-view.js.map +1 -0
- package/dist/image-view.d.ts +19 -0
- package/dist/image-view.js +180 -0
- package/dist/image-view.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/outline/ellipse-outline.d.ts +2 -0
- package/dist/outline/ellipse-outline.js +11 -0
- package/dist/outline/ellipse-outline.js.map +1 -0
- package/dist/polygon.d.ts +19 -0
- package/dist/polygon.js +84 -0
- package/dist/polygon.js.map +1 -0
- package/dist/polyline.d.ts +18 -0
- package/dist/polyline.js +102 -0
- package/dist/polyline.js.map +1 -0
- package/dist/rect.d.ts +19 -0
- package/dist/rect.js +60 -0
- package/dist/rect.js.map +1 -0
- package/dist/star.d.ts +13 -0
- package/dist/star.js +80 -0
- package/dist/star.js.map +1 -0
- package/dist/templates/audio.d.ts +14 -0
- package/dist/templates/audio.js +15 -0
- package/dist/templates/audio.js.map +1 -0
- package/dist/templates/color-image.d.ts +22 -0
- package/dist/templates/color-image.js +23 -0
- package/dist/templates/color-image.js.map +1 -0
- package/dist/templates/donut.d.ts +22 -0
- package/dist/templates/donut.js +23 -0
- package/dist/templates/donut.js.map +1 -0
- package/dist/templates/ellipse.d.ts +21 -0
- package/dist/templates/ellipse.js +22 -0
- package/dist/templates/ellipse.js.map +1 -0
- package/dist/templates/gif-image.d.ts +14 -0
- package/dist/templates/gif-image.js +15 -0
- package/dist/templates/gif-image.js.map +1 -0
- package/dist/templates/gray-image.d.ts +22 -0
- package/dist/templates/gray-image.js +23 -0
- package/dist/templates/gray-image.js.map +1 -0
- package/dist/templates/index.d.ts +74 -0
- package/dist/templates/index.js +15 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/polygon.d.ts +22 -0
- package/dist/templates/polygon.js +25 -0
- package/dist/templates/polygon.js.map +1 -0
- package/dist/templates/polyline.d.ts +22 -0
- package/dist/templates/polyline.js +25 -0
- package/dist/templates/polyline.js.map +1 -0
- package/dist/templates/rect.d.ts +21 -0
- package/dist/templates/rect.js +22 -0
- package/dist/templates/rect.js.map +1 -0
- package/dist/templates/star.d.ts +23 -0
- package/dist/templates/star.js +24 -0
- package/dist/templates/star.js.map +1 -0
- package/dist/templates/text.d.ts +27 -0
- package/dist/templates/text.js +28 -0
- package/dist/templates/text.js.map +1 -0
- package/dist/templates/triangle.d.ts +23 -0
- package/dist/templates/triangle.js +24 -0
- package/dist/templates/triangle.js.map +1 -0
- package/dist/text.d.ts +6 -0
- package/dist/text.js +11 -0
- package/dist/text.js.map +1 -0
- package/dist/triangle.d.ts +14 -0
- package/dist/triangle.js +75 -0
- package/dist/triangle.js.map +1 -0
- package/icons/audio.png +0 -0
- package/icons/both-arrow.png +0 -0
- package/icons/color-image.png +0 -0
- package/icons/container.png +0 -0
- package/icons/dash.png +0 -0
- package/icons/donut.png +0 -0
- package/icons/ellipse.png +0 -0
- package/icons/gif-image.png +0 -0
- package/icons/global-reference.png +0 -0
- package/icons/gray-image.png +0 -0
- package/icons/humidity-sensor.png +0 -0
- package/icons/info-window.png +0 -0
- package/icons/line.png +0 -0
- package/icons/local-reference.png +0 -0
- package/icons/no-image.png +0 -0
- package/icons/ortholine.png +0 -0
- package/icons/person.png +0 -0
- package/icons/polygon.png +0 -0
- package/icons/polyline.png +0 -0
- package/icons/popup.png +0 -0
- package/icons/rect.png +0 -0
- package/icons/single-arrow.png +0 -0
- package/icons/star.png +0 -0
- package/icons/text.png +0 -0
- package/icons/triangle.png +0 -0
- package/package.json +61 -0
- package/src/anchors/ellipse-anchors.ts +46 -0
- package/src/audio.ts +173 -0
- package/src/cloud.ts +40 -0
- package/src/donut.ts +92 -0
- package/src/ellipse.ts +90 -0
- package/src/gif-view.ts +146 -0
- package/src/image-view.ts +215 -0
- package/src/index.ts +16 -0
- package/src/outline/ellipse-outline.ts +15 -0
- package/src/polygon.ts +103 -0
- package/src/polyline.ts +122 -0
- package/src/rect.ts +71 -0
- package/src/star.ts +104 -0
- package/src/templates/audio.ts +15 -0
- package/src/templates/color-image.ts +23 -0
- package/src/templates/donut.ts +23 -0
- package/src/templates/ellipse.ts +22 -0
- package/src/templates/gif-image.ts +15 -0
- package/src/templates/gray-image.ts +23 -0
- package/src/templates/index.ts +16 -0
- package/src/templates/polygon.ts +25 -0
- package/src/templates/polyline.ts +25 -0
- package/src/templates/rect.ts +22 -0
- package/src/templates/star.ts +24 -0
- package/src/templates/text.ts +28 -0
- package/src/templates/triangle.ts +24 -0
- package/src/text.ts +12 -0
- package/src/triangle.ts +87 -0
- package/test/basic-test.html +63 -0
- package/test/index.html +22 -0
- package/things-scene.config.js +5 -0
- package/tsconfig.json +23 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
group: string;
|
|
18
|
+
model: {
|
|
19
|
+
type: string;
|
|
20
|
+
rx: number;
|
|
21
|
+
ry: number;
|
|
22
|
+
cx: number;
|
|
23
|
+
cy: number;
|
|
24
|
+
fillStyle: string;
|
|
25
|
+
strokeStyle: string;
|
|
26
|
+
alpha: number;
|
|
27
|
+
hidden: boolean;
|
|
28
|
+
lineWidth: number;
|
|
29
|
+
lineDash: string;
|
|
30
|
+
lineCap: string;
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
type: string;
|
|
34
|
+
description: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
group: string;
|
|
37
|
+
model: {
|
|
38
|
+
type: string;
|
|
39
|
+
path: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
}[];
|
|
43
|
+
fillStyle: string;
|
|
44
|
+
strokeStyle: string;
|
|
45
|
+
alpha: number;
|
|
46
|
+
hidden: boolean;
|
|
47
|
+
lineWidth: number;
|
|
48
|
+
lineDash: string;
|
|
49
|
+
lineCap: string;
|
|
50
|
+
round: number;
|
|
51
|
+
};
|
|
52
|
+
} | {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
icon: string;
|
|
56
|
+
group: string;
|
|
57
|
+
model: {
|
|
58
|
+
type: string;
|
|
59
|
+
x1: number;
|
|
60
|
+
y1: number;
|
|
61
|
+
x2: number;
|
|
62
|
+
y2: number;
|
|
63
|
+
x3: number;
|
|
64
|
+
y3: number;
|
|
65
|
+
fillStyle: string;
|
|
66
|
+
strokeStyle: string;
|
|
67
|
+
alpha: number;
|
|
68
|
+
hidden: boolean;
|
|
69
|
+
lineWidth: number;
|
|
70
|
+
lineDash: string;
|
|
71
|
+
lineCap: string;
|
|
72
|
+
};
|
|
73
|
+
})[];
|
|
74
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// IMPORT
|
|
2
|
+
import audio from './audio';
|
|
3
|
+
import text from './text';
|
|
4
|
+
import colorImage from './color-image';
|
|
5
|
+
import grayImage from './gray-image';
|
|
6
|
+
import donut from './donut';
|
|
7
|
+
import gifImage from './gif-image';
|
|
8
|
+
import ellipse from './ellipse';
|
|
9
|
+
import polyline from './polyline';
|
|
10
|
+
import polygon from './polygon';
|
|
11
|
+
import rect from './rect';
|
|
12
|
+
import star from './star';
|
|
13
|
+
import triangle from './triangle';
|
|
14
|
+
export default [audio, colorImage, grayImage, gifImage, ellipse, donut, polyline, polygon, rect, star, text, triangle];
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,SAAS;AAET,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,UAAU,MAAM,eAAe,CAAA;AACtC,OAAO,SAAS,MAAM,cAAc,CAAA;AACpC,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,QAAQ,MAAM,aAAa,CAAA;AAClC,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,IAAI,MAAM,QAAQ,CAAA;AACzB,OAAO,QAAQ,MAAM,YAAY,CAAA;AAEjC,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["// IMPORT\n\nimport audio from './audio'\nimport text from './text'\nimport colorImage from './color-image'\nimport grayImage from './gray-image'\nimport donut from './donut'\nimport gifImage from './gif-image'\nimport ellipse from './ellipse'\nimport polyline from './polyline'\nimport polygon from './polygon'\nimport rect from './rect'\nimport star from './star'\nimport triangle from './triangle'\n\nexport default [audio, colorImage, grayImage, gifImage, ellipse, donut, polyline, polygon, rect, star, text, triangle]\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
path: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}[];
|
|
12
|
+
fillStyle: string;
|
|
13
|
+
strokeStyle: string;
|
|
14
|
+
alpha: number;
|
|
15
|
+
hidden: boolean;
|
|
16
|
+
lineWidth: number;
|
|
17
|
+
lineDash: string;
|
|
18
|
+
lineCap: string;
|
|
19
|
+
round: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const polygon = new URL('../../icons/polygon.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'polygon',
|
|
4
|
+
description: 'polygon shape',
|
|
5
|
+
icon: polygon,
|
|
6
|
+
group: 'shape',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'polygon',
|
|
9
|
+
path: [
|
|
10
|
+
{ x: 100, y: 100 },
|
|
11
|
+
{ x: 200, y: 100 },
|
|
12
|
+
{ x: 200, y: 200 },
|
|
13
|
+
{ x: 100, y: 200 }
|
|
14
|
+
],
|
|
15
|
+
fillStyle: '#fff',
|
|
16
|
+
strokeStyle: '#000',
|
|
17
|
+
alpha: 1,
|
|
18
|
+
hidden: false,
|
|
19
|
+
lineWidth: 1,
|
|
20
|
+
lineDash: 'solid',
|
|
21
|
+
lineCap: 'butt',
|
|
22
|
+
round: 10
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=polygon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon.js","sourceRoot":"","sources":["../../src/templates/polygon.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAExE,eAAe;IACb,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,eAAe;IAC5B,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;SACnB;QACD,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,EAAE;KACV;CACF,CAAA","sourcesContent":["const polygon = new URL('../../icons/polygon.png', import.meta.url).href\n\nexport default {\n type: 'polygon',\n description: 'polygon shape',\n icon: polygon,\n group: 'shape',\n model: {\n type: 'polygon',\n path: [\n { x: 100, y: 100 },\n { x: 200, y: 100 },\n { x: 200, y: 200 },\n { x: 100, y: 200 }\n ],\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt',\n round: 10\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
path: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}[];
|
|
12
|
+
fillStyle: string;
|
|
13
|
+
strokeStyle: string;
|
|
14
|
+
alpha: number;
|
|
15
|
+
hidden: boolean;
|
|
16
|
+
lineWidth: number;
|
|
17
|
+
lineDash: string;
|
|
18
|
+
lineCap: string;
|
|
19
|
+
round: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const polyline = new URL('../../icons/polyline.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'polyline',
|
|
4
|
+
description: 'polyline',
|
|
5
|
+
icon: polyline,
|
|
6
|
+
group: 'line',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'polyline',
|
|
9
|
+
path: [
|
|
10
|
+
{ x: 100, y: 100 },
|
|
11
|
+
{ x: 200, y: 100 },
|
|
12
|
+
{ x: 200, y: 200 },
|
|
13
|
+
{ x: 100, y: 200 }
|
|
14
|
+
],
|
|
15
|
+
fillStyle: '#fff',
|
|
16
|
+
strokeStyle: '#000',
|
|
17
|
+
alpha: 1,
|
|
18
|
+
hidden: false,
|
|
19
|
+
lineWidth: 1,
|
|
20
|
+
lineDash: 'solid',
|
|
21
|
+
lineCap: 'butt',
|
|
22
|
+
round: 10
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=polyline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polyline.js","sourceRoot":"","sources":["../../src/templates/polyline.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE1E,eAAe;IACb,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,MAAM;IACb,KAAK,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE;YACJ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;SACnB;QACD,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,EAAE;KACV;CACF,CAAA","sourcesContent":["const polyline = new URL('../../icons/polyline.png', import.meta.url).href\n\nexport default {\n type: 'polyline',\n description: 'polyline',\n icon: polyline,\n group: 'line',\n model: {\n type: 'polyline',\n path: [\n { x: 100, y: 100 },\n { x: 200, y: 100 },\n { x: 200, y: 200 },\n { x: 100, y: 200 }\n ],\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt',\n round: 10\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
fillStyle: string;
|
|
13
|
+
strokeStyle: string;
|
|
14
|
+
alpha: number;
|
|
15
|
+
hidden: boolean;
|
|
16
|
+
lineWidth: number;
|
|
17
|
+
lineDash: string;
|
|
18
|
+
lineCap: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const rect = new URL('../../icons/rect.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'rect',
|
|
4
|
+
description: 'rectangle shape',
|
|
5
|
+
icon: rect,
|
|
6
|
+
group: 'shape',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'rect',
|
|
9
|
+
left: 100,
|
|
10
|
+
top: 100,
|
|
11
|
+
width: 100,
|
|
12
|
+
height: 100,
|
|
13
|
+
fillStyle: '#fff',
|
|
14
|
+
strokeStyle: '#000',
|
|
15
|
+
alpha: 1,
|
|
16
|
+
hidden: false,
|
|
17
|
+
lineWidth: 1,
|
|
18
|
+
lineDash: 'solid',
|
|
19
|
+
lineCap: 'butt'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=rect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rect.js","sourceRoot":"","sources":["../../src/templates/rect.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAElE,eAAe;IACb,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iBAAiB;IAC9B,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const rect = new URL('../../icons/rect.png', import.meta.url).href\n\nexport default {\n type: 'rect',\n description: 'rectangle shape',\n icon: rect,\n group: 'shape',\n model: {\n type: 'rect',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
rx: number;
|
|
9
|
+
ry: number;
|
|
10
|
+
cx: number;
|
|
11
|
+
cy: number;
|
|
12
|
+
ratio: number;
|
|
13
|
+
wing: number;
|
|
14
|
+
fillStyle: string;
|
|
15
|
+
strokeStyle: string;
|
|
16
|
+
alpha: number;
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
lineWidth: number;
|
|
19
|
+
lineDash: string;
|
|
20
|
+
lineCap: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const star = new URL('../../icons/star.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'star',
|
|
4
|
+
description: 'star shape',
|
|
5
|
+
icon: star,
|
|
6
|
+
group: 'shape',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'star',
|
|
9
|
+
rx: 50,
|
|
10
|
+
ry: 50,
|
|
11
|
+
cx: 150,
|
|
12
|
+
cy: 150,
|
|
13
|
+
ratio: 30,
|
|
14
|
+
wing: 5,
|
|
15
|
+
fillStyle: '#fff',
|
|
16
|
+
strokeStyle: '#000',
|
|
17
|
+
alpha: 1,
|
|
18
|
+
hidden: false,
|
|
19
|
+
lineWidth: 1,
|
|
20
|
+
lineDash: 'solid',
|
|
21
|
+
lineCap: 'butt'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=star.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"star.js","sourceRoot":"","sources":["../../src/templates/star.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAElE,eAAe;IACb,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,EAAE;QACN,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,CAAC;QACP,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const star = new URL('../../icons/star.png', import.meta.url).href\n\nexport default {\n type: 'star',\n description: 'star shape',\n icon: star,\n group: 'shape',\n model: {\n type: 'star',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n ratio: 30,\n wing: 5,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
text: string;
|
|
13
|
+
fillStyle: string;
|
|
14
|
+
strokeStyle: string;
|
|
15
|
+
alpha: number;
|
|
16
|
+
hidden: boolean;
|
|
17
|
+
lineWidth: number;
|
|
18
|
+
lineDash: string;
|
|
19
|
+
lineCap: string;
|
|
20
|
+
textAlign: string;
|
|
21
|
+
textBaseline: string;
|
|
22
|
+
textWrap: boolean;
|
|
23
|
+
fontFamily: string;
|
|
24
|
+
fontSize: number;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const text = new URL('../../icons/text.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'text',
|
|
4
|
+
description: 'text',
|
|
5
|
+
icon: text,
|
|
6
|
+
group: 'textAndMedia',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'text',
|
|
9
|
+
left: 100,
|
|
10
|
+
top: 100,
|
|
11
|
+
width: 200,
|
|
12
|
+
height: 50,
|
|
13
|
+
text: 'Text',
|
|
14
|
+
fillStyle: '#fff',
|
|
15
|
+
strokeStyle: '#000',
|
|
16
|
+
alpha: 1,
|
|
17
|
+
hidden: false,
|
|
18
|
+
lineWidth: 5,
|
|
19
|
+
lineDash: 'solid',
|
|
20
|
+
lineCap: 'butt',
|
|
21
|
+
textAlign: 'left',
|
|
22
|
+
textBaseline: 'top',
|
|
23
|
+
textWrap: false,
|
|
24
|
+
fontFamily: 'serif',
|
|
25
|
+
fontSize: 30
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/templates/text.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAElE,eAAe;IACb,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;QACf,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,KAAK;QACnB,QAAQ,EAAE,KAAK;QACf,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,EAAE;KACb;CACF,CAAA","sourcesContent":["const text = new URL('../../icons/text.png', import.meta.url).href\n\nexport default {\n type: 'text',\n description: 'text',\n icon: text,\n group: 'textAndMedia',\n model: {\n type: 'text',\n left: 100,\n top: 100,\n width: 200,\n height: 50,\n text: 'Text',\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 5,\n lineDash: 'solid',\n lineCap: 'butt',\n textAlign: 'left',\n textBaseline: 'top',\n textWrap: false,\n fontFamily: 'serif',\n fontSize: 30\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
type: string;
|
|
3
|
+
description: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
group: string;
|
|
6
|
+
model: {
|
|
7
|
+
type: string;
|
|
8
|
+
x1: number;
|
|
9
|
+
y1: number;
|
|
10
|
+
x2: number;
|
|
11
|
+
y2: number;
|
|
12
|
+
x3: number;
|
|
13
|
+
y3: number;
|
|
14
|
+
fillStyle: string;
|
|
15
|
+
strokeStyle: string;
|
|
16
|
+
alpha: number;
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
lineWidth: number;
|
|
19
|
+
lineDash: string;
|
|
20
|
+
lineCap: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const triangle = new URL('../../icons/triangle.png', import.meta.url).href;
|
|
2
|
+
export default {
|
|
3
|
+
type: 'triangle',
|
|
4
|
+
description: 'triangle shape',
|
|
5
|
+
icon: triangle,
|
|
6
|
+
group: 'shape',
|
|
7
|
+
model: {
|
|
8
|
+
type: 'triangle',
|
|
9
|
+
x1: 150,
|
|
10
|
+
y1: 100,
|
|
11
|
+
x2: 100,
|
|
12
|
+
y2: 200,
|
|
13
|
+
x3: 200,
|
|
14
|
+
y3: 200,
|
|
15
|
+
fillStyle: '#fff',
|
|
16
|
+
strokeStyle: '#000',
|
|
17
|
+
alpha: 1,
|
|
18
|
+
hidden: false,
|
|
19
|
+
lineWidth: 1,
|
|
20
|
+
lineDash: 'solid',
|
|
21
|
+
lineCap: 'butt'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=triangle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle.js","sourceRoot":"","sources":["../../src/templates/triangle.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,0BAA0B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAE1E,eAAe;IACb,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,gBAAgB;IAC7B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;QACP,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,MAAM;QACnB,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,MAAM;KAChB;CACF,CAAA","sourcesContent":["const triangle = new URL('../../icons/triangle.png', import.meta.url).href\n\nexport default {\n type: 'triangle',\n description: 'triangle shape',\n icon: triangle,\n group: 'shape',\n model: {\n type: 'triangle',\n x1: 150,\n y1: 100,\n x2: 100,\n y2: 200,\n x3: 200,\n y3: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n alpha: 1,\n hidden: false,\n lineWidth: 1,\n lineDash: 'solid',\n lineCap: 'butt'\n }\n}\n"]}
|
package/dist/text.d.ts
ADDED
package/dist/text.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { Component, RectPath } from '@hatiolab/things-scene';
|
|
5
|
+
export default class Text extends RectPath(Component) {
|
|
6
|
+
is3dish() {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
Component.register('text', Text);
|
|
11
|
+
//# sourceMappingURL=text.js.map
|
package/dist/text.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../src/text.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE5D,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,QAAQ,CAAC,SAAS,CAAC;IACnD,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, RectPath } from '@hatiolab/things-scene'\n\nexport default class Text extends RectPath(Component) {\n is3dish() {\n return true\n }\n}\n\nComponent.register('text', Text)\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
|
+
export default class Triangle extends Shape {
|
|
3
|
+
contains(x: number, y: number): boolean;
|
|
4
|
+
get mutable(): boolean;
|
|
5
|
+
get path(): {
|
|
6
|
+
x: any;
|
|
7
|
+
y: any;
|
|
8
|
+
}[];
|
|
9
|
+
set path(path: {
|
|
10
|
+
x: any;
|
|
11
|
+
y: any;
|
|
12
|
+
}[]);
|
|
13
|
+
get nature(): ComponentNature;
|
|
14
|
+
}
|
package/dist/triangle.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { Component, Shape } from '@hatiolab/things-scene';
|
|
5
|
+
const NATURE = {
|
|
6
|
+
mutable: true,
|
|
7
|
+
resizable: false,
|
|
8
|
+
rotatable: true,
|
|
9
|
+
properties: [
|
|
10
|
+
{
|
|
11
|
+
type: 'number',
|
|
12
|
+
label: 'round',
|
|
13
|
+
name: 'round',
|
|
14
|
+
property: {
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 100,
|
|
17
|
+
step: 1
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
help: 'scene/component/triangle'
|
|
22
|
+
};
|
|
23
|
+
export default class Triangle extends Shape {
|
|
24
|
+
contains(x, y) {
|
|
25
|
+
var { x1, y1, x2, y2, x3, y3 } = this.state;
|
|
26
|
+
var path = [x1, y1, x2, y2, x3, y3];
|
|
27
|
+
var result = false;
|
|
28
|
+
for (let i = 0; i < path.length; i += 2) {
|
|
29
|
+
let j = (i + 2) % path.length;
|
|
30
|
+
let x1 = path[i];
|
|
31
|
+
let y1 = path[i + 1];
|
|
32
|
+
let x2 = path[j];
|
|
33
|
+
let y2 = path[j + 1];
|
|
34
|
+
if (y1 > y != y2 > y && x < ((x2 - x1) * (y - y1)) / (y2 - y1) + x1)
|
|
35
|
+
result = !result;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
get mutable() {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
get path() {
|
|
43
|
+
var { x1, y1, x2, y2, x3, y3 } = this.state;
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
x: x1,
|
|
47
|
+
y: y1
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
x: x2,
|
|
51
|
+
y: y2
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
x: x3,
|
|
55
|
+
y: y3
|
|
56
|
+
}
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
set path(path) {
|
|
60
|
+
this.set({
|
|
61
|
+
x1: path[0].x,
|
|
62
|
+
y1: path[0].y,
|
|
63
|
+
x2: path[1].x,
|
|
64
|
+
y2: path[1].y,
|
|
65
|
+
x3: path[2].x,
|
|
66
|
+
y3: path[2].y
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
get nature() {
|
|
70
|
+
return NATURE;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
Component.memoize(Triangle.prototype, 'path', false);
|
|
74
|
+
Component.register('triangle', Triangle);
|
|
75
|
+
//# sourceMappingURL=triangle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle.js","sourceRoot":"","sources":["../src/triangle.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { Component, ComponentNature, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: true,\n resizable: false,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'round',\n name: 'round',\n property: {\n min: 0,\n max: 100,\n step: 1\n }\n }\n ],\n help: 'scene/component/triangle'\n}\n\nexport default class Triangle extends Shape {\n contains(x: number, y: number) {\n var { x1, y1, x2, y2, x3, y3 } = this.state\n var path = [x1, y1, x2, y2, x3, y3]\n\n var result = false\n\n for (let i = 0; i < path.length; i += 2) {\n let j = (i + 2) % path.length\n let x1 = path[i]\n let y1 = path[i + 1]\n let x2 = path[j]\n let y2 = path[j + 1]\n\n if (y1 > y != y2 > y && x < ((x2 - x1) * (y - y1)) / (y2 - y1) + x1) result = !result\n }\n\n return result\n }\n\n get mutable() {\n return true\n }\n\n get path() {\n var { x1, y1, x2, y2, x3, y3 } = this.state\n\n return [\n {\n x: x1,\n y: y1\n },\n {\n x: x2,\n y: y2\n },\n {\n x: x3,\n y: y3\n }\n ]\n }\n\n set path(path) {\n this.set({\n x1: path[0].x,\n y1: path[0].y,\n x2: path[1].x,\n y2: path[1].y,\n x3: path[2].x,\n y3: path[2].y\n })\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n\nComponent.memoize(Triangle.prototype, 'path', false)\n\nComponent.register('triangle', Triangle)\n"]}
|
package/icons/audio.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/icons/dash.png
ADDED
|
Binary file
|
package/icons/donut.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/icons/line.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/icons/person.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/icons/popup.png
ADDED
|
Binary file
|
package/icons/rect.png
ADDED
|
Binary file
|
|
Binary file
|
package/icons/star.png
ADDED
|
Binary file
|
package/icons/text.png
ADDED
|
Binary file
|
|
Binary file
|