@operato/scene-manufacturing 1.3.18 → 1.3.20
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 +18 -0
- package/db.sqlite +0 -0
- package/dist/tact-timer-mask.d.ts +1 -0
- package/dist/tact-timer-mask.js +35 -0
- package/dist/tact-timer-mask.js.map +1 -0
- package/dist/tact-timer.d.ts +2 -2
- package/dist/tact-timer.js +21 -10
- package/dist/tact-timer.js.map +1 -1
- package/icons/tact-timer-mask.svg +5 -1
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +6 -21
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +15 -0
- package/logs/{application-2024-07-06-11.log → application-2024-07-11-12.log} +8 -8
- package/logs/application-2024-07-11-13.log +23 -0
- package/logs/connections-2024-07-06-12.log +50 -0
- package/logs/connections-2024-07-11-12.log +47 -0
- package/logs/connections-2024-07-11-13.log +47 -0
- package/package.json +2 -2
- package/src/tact-timer-mask.ts +34 -0
- package/src/tact-timer.ts +27 -16
- package/translations/en.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -1
- package/translations/zh.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/logs/application-2024-07-05-08.log +0 -105
- package/logs/application-2024-07-05-12.log +0 -105
- package/logs/application-2024-07-06-01.log +0 -105
- package/logs/application-2024-07-06-03.log +0 -105
package/src/tact-timer.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Component, ComponentNature, Properties, RectPath, Shape } from '@hatiolab/things-scene'
|
|
2
2
|
import format from './libs/format'
|
|
3
|
-
|
|
4
|
-
const mask = new URL('../icons/tact-timer-mask.svg', import.meta.url).href
|
|
3
|
+
import { MASK } from './tact-timer-mask'
|
|
5
4
|
|
|
6
5
|
const NATURE: ComponentNature = {
|
|
7
6
|
mutable: false,
|
|
@@ -34,6 +33,11 @@ const NATURE: ComponentNature = {
|
|
|
34
33
|
options: ['', 'increase', 'decrease']
|
|
35
34
|
}
|
|
36
35
|
},
|
|
36
|
+
{
|
|
37
|
+
type: 'color',
|
|
38
|
+
label: 'tact-timer-mask-color',
|
|
39
|
+
name: 'maskColor'
|
|
40
|
+
},
|
|
37
41
|
{
|
|
38
42
|
type: 'color',
|
|
39
43
|
label: 'increase-progress-color',
|
|
@@ -90,19 +94,9 @@ const NATURE: ComponentNature = {
|
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
export default class TactTimer extends RectPath(Shape) {
|
|
93
|
-
static MASK: HTMLImageElement
|
|
94
|
-
|
|
95
|
-
static get mask() {
|
|
96
|
-
if (!TactTimer.MASK) {
|
|
97
|
-
TactTimer.MASK = new Image()
|
|
98
|
-
TactTimer.MASK.src = mask
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return TactTimer.MASK
|
|
102
|
-
}
|
|
103
|
-
|
|
104
97
|
private _start: number = 0
|
|
105
98
|
private _due: number = 0
|
|
99
|
+
private imageElement?: HTMLImageElement
|
|
106
100
|
|
|
107
101
|
get nature() {
|
|
108
102
|
return NATURE
|
|
@@ -136,6 +130,21 @@ export default class TactTimer extends RectPath(Shape) {
|
|
|
136
130
|
if ('startTime' in after || 'endTime' in after) {
|
|
137
131
|
this.start()
|
|
138
132
|
}
|
|
133
|
+
if ('maskColor' in after) {
|
|
134
|
+
delete this.imageElement
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
getImageElement(): HTMLImageElement | undefined {
|
|
139
|
+
if (!this.imageElement) {
|
|
140
|
+
const { maskColor = 'black' } = this.state
|
|
141
|
+
|
|
142
|
+
this.imageElement = new Image()
|
|
143
|
+
this.imageElement.src =
|
|
144
|
+
'data:image/svg+xml;charset=UTF-8;base64,' + btoa(MASK.replace(/{{fillColor}}/g, maskColor))
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return this.imageElement
|
|
139
148
|
}
|
|
140
149
|
|
|
141
150
|
counting() {
|
|
@@ -170,6 +179,7 @@ export default class TactTimer extends RectPath(Shape) {
|
|
|
170
179
|
width,
|
|
171
180
|
round = 0,
|
|
172
181
|
fontColor,
|
|
182
|
+
maskColor,
|
|
173
183
|
increaseFontColor,
|
|
174
184
|
decreaseFontColor,
|
|
175
185
|
increaseProgressColor = 'transparent',
|
|
@@ -177,8 +187,7 @@ export default class TactTimer extends RectPath(Shape) {
|
|
|
177
187
|
underThresholdColor = 'transparent',
|
|
178
188
|
progressDirection = 'increase',
|
|
179
189
|
progressThreshold = 0,
|
|
180
|
-
showProgress
|
|
181
|
-
showTimer
|
|
190
|
+
showProgress
|
|
182
191
|
} = this.state
|
|
183
192
|
|
|
184
193
|
const increase = this.countdown > 0
|
|
@@ -220,7 +229,9 @@ export default class TactTimer extends RectPath(Shape) {
|
|
|
220
229
|
context.beginPath()
|
|
221
230
|
}
|
|
222
231
|
|
|
223
|
-
this.
|
|
232
|
+
const image = this.getImageElement()
|
|
233
|
+
this.drawImage(context, image!, left, top, width, height)
|
|
234
|
+
|
|
224
235
|
context.roundRect(left, top, width, height, round)
|
|
225
236
|
|
|
226
237
|
this.setState('fontColor', (increase ? increaseFontColor : decreaseFontColor) || fontColor)
|
package/translations/en.json
CHANGED
package/translations/ja.json
CHANGED
package/translations/ko.json
CHANGED
package/translations/ms.json
CHANGED