@operato/scene-clock 9.0.0-beta.2 → 9.0.0-beta.7
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/dist/clock-text.d.ts +3 -3
- package/dist/clock-text.js +5 -5
- package/dist/clock-text.js.map +1 -1
- package/package.json +4 -4
package/dist/clock-text.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import 'dayjs/esm/locale/ko';
|
|
2
|
-
import 'dayjs/esm/locale/zh-cn';
|
|
3
|
-
import 'dayjs/esm/locale/ja';
|
|
1
|
+
import 'dayjs/esm/locale/ko.js';
|
|
2
|
+
import 'dayjs/esm/locale/zh-cn.js';
|
|
3
|
+
import 'dayjs/esm/locale/ja.js';
|
|
4
4
|
import { ComponentNature, Text } from '@hatiolab/things-scene';
|
|
5
5
|
export default class ClockText extends Text {
|
|
6
6
|
private _raf?;
|
package/dist/clock-text.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import 'dayjs/esm/locale/ko';
|
|
5
|
-
import 'dayjs/esm/locale/zh-cn';
|
|
6
|
-
import 'dayjs/esm/locale/ja';
|
|
7
|
-
import dayjs from 'dayjs/esm/index';
|
|
8
|
-
import utc from 'dayjs/esm/plugin/utc';
|
|
4
|
+
import 'dayjs/esm/locale/ko.js';
|
|
5
|
+
import 'dayjs/esm/locale/zh-cn.js';
|
|
6
|
+
import 'dayjs/esm/locale/ja.js';
|
|
7
|
+
import dayjs from 'dayjs/esm/index.js';
|
|
8
|
+
import utc from 'dayjs/esm/plugin/utc/index.js';
|
|
9
9
|
import { Component, Text } from '@hatiolab/things-scene';
|
|
10
10
|
dayjs.extend(utc);
|
|
11
11
|
const NATURE = {
|
package/dist/clock-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clock-text.js","sourceRoot":"","sources":["../src/clock-text.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"clock-text.js","sourceRoot":"","sources":["../src/clock-text.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,wBAAwB,CAAA;AAC/B,OAAO,2BAA2B,CAAA;AAClC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,KAAK,MAAM,oBAAoB,CAAA;AACtC,OAAO,GAAG,MAAM,+BAA+B,CAAA;AAE/C,OAAO,EAAE,SAAS,EAAmB,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAEzE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAEjB,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,YAAY;SACnB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,WAAW;SAClB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;SACZ;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,cAAc;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE;oBACP;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,IAAI;qBACZ;oBACD;wBACE,OAAO,EAAE,QAAQ;wBACjB,KAAK,EAAE,IAAI;qBACZ;oBACD;wBACE,OAAO,EAAE,SAAS;wBAClB,KAAK,EAAE,OAAO;qBACf;oBACD;wBACE,OAAO,EAAE,UAAU;wBACnB,KAAK,EAAE,IAAI;qBACZ;iBACF;aACF;SACF;KACF;IACD,IAAI,EAAE,4BAA4B;CACnC,CAAA;AAED,MAAM,CAAC,OAAO,OAAO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O,EAAE,CAAA;QACf,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5D,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport 'dayjs/esm/locale/ko.js'\nimport 'dayjs/esm/locale/zh-cn.js'\nimport 'dayjs/esm/locale/ja.js'\n\nimport dayjs from 'dayjs/esm/index.js'\nimport utc from 'dayjs/esm/plugin/utc/index.js'\n\nimport { Component, ComponentNature, Text } from '@hatiolab/things-scene'\n\ndayjs.extend(utc)\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'time-format',\n name: 'timeFormat'\n },\n {\n type: 'checkbox',\n label: 'is-local-time',\n name: 'localTime'\n },\n {\n type: 'number',\n label: 'utc',\n name: 'utc'\n },\n {\n type: 'select',\n label: 'week-language',\n name: 'weekLanguage',\n property: {\n options: [\n {\n display: 'English',\n value: 'en'\n },\n {\n display: 'Korean',\n value: 'ko'\n },\n {\n display: 'Chinese',\n value: 'zh-cn'\n },\n {\n display: 'Japanese',\n value: 'ja'\n }\n ]\n }\n }\n ],\n help: 'scene/component/clock-text'\n}\n\nexport default class ClockText extends Text {\n private _raf?: number\n\n is3dish() {\n return false\n }\n\n get nature() {\n return NATURE\n }\n\n ready() {\n this.timing()\n }\n\n timing() {\n this._raf = requestAnimationFrame(() => {\n setTimeout(() => {\n this.setState('data', this._getTimeStamp())\n\n this.timing()\n }, 1000)\n })\n }\n\n _getTimeStamp() {\n var d = dayjs()\n\n var utc = this.getState('utc')\n var formatStr = this.getState('timeFormat') || 'YYYY-MM-DD HH:mm:ss'\n var week_lang = this.getState('weekLanguage')\n if (!this.getState('weekLanguage')) {\n week_lang = 'en'\n }\n if (this.getState('localTime')) {\n return d.local().locale(week_lang).format(formatStr)\n } else {\n return d.utc().utcOffset(Number(utc)).locale(week_lang).format(formatStr)\n }\n }\n\n dispose() {\n super.dispose()\n this._raf !== undefined && cancelAnimationFrame(this._raf)\n }\n}\n\nComponent.register('clock-text', ClockText)\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-clock",
|
|
3
3
|
"description": "Clock component for things-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "9.0.0-beta.
|
|
5
|
+
"version": "9.0.0-beta.7",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@typescript-eslint/parser": "^4.33.0",
|
|
40
40
|
"@web/dev-server": "^0.1.28",
|
|
41
41
|
"concurrently": "^8.0.1",
|
|
42
|
-
"eslint": "^
|
|
43
|
-
"eslint-config-prettier": "^
|
|
42
|
+
"eslint": "^9.18.0",
|
|
43
|
+
"eslint-config-prettier": "^10.0.1",
|
|
44
44
|
"husky": "^8.0.3",
|
|
45
45
|
"lint-staged": "^13.2.2",
|
|
46
46
|
"prettier": "^2.4.1",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"prettier --write"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "97e5af48dff339375c9fb2668741276409321b0b"
|
|
63
63
|
}
|