@operato/scene-i18n 10.0.0-beta.2 → 10.0.0-beta.30
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 +29 -9
- package/dist/editors/ox-editor-i18n.js +0 -2
- package/dist/editors/ox-editor-i18n.js.map +1 -1
- package/dist/label.d.ts +37 -38
- package/dist/label.js +0 -3
- package/dist/label.js.map +1 -1
- package/dist/templates/label.js +1 -1
- package/dist/templates/label.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,13 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
# @operato/scene-i18n
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> i18n component for things-scene
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
| ---- | ------------------------------------------ | -------------- | ------ |
|
|
7
|
-
| UMD | things-scene-scene-i18n.js | modern browser | O |
|
|
8
|
-
| UMD | things-scene-scene-i18n-ie.js | ie 11 | O |
|
|
9
|
-
| ESM | things-scene-scene-i18n.mjs | modern browser | O |
|
|
5
|
+
<!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
|
|
10
6
|
|
|
11
|
-
##
|
|
7
|
+
## Components
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
- `Label`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn add @operato/scene-i18n
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Label } from '@operato/scene-i18n'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Build
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn build
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Output: ESM module at `dist/index.js` (single bundle, no UMD/IE legacy).
|
|
30
|
+
|
|
31
|
+
_Version: 10.0.0-beta.14_
|
|
32
|
+
|
|
33
|
+
<!-- AUTOGEN_END -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-editor-i18n.js","sourceRoot":"","sources":["../../src/editors/ox-editor-i18n.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE5E;;;;;;;EAOE;AAEa,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAChD,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCF;KACF,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-editor-i18n.js","sourceRoot":"","sources":["../../src/editors/ox-editor-i18n.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE5E;;;;;;;EAOE;AAEa,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAChD,MAAM,CAAC,MAAM,GAAG;QACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCF;KACF,CAAA;IAQD,YAAY;QACV,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IACvE,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA;;;;;;;;QAQP,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAC7B,IAAI,CAAC,EAA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OAAO,CAAC,CAAa;QACnB,IAAI,MAAM,GAAI,CAAC,CAAC,MAAsB,CAAC,aAAa,CAAA;QACpD,MAAM,GAAG,GAAG,MAAM,EAAE,aAAa,CAAC,YAAY,CAAqB,CAAA;QACnE,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAA;QAEvB,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;;AAnHmC;IAAnC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAsC;AAEpB;IAA5C,QAAQ,CAAC,yBAAyB,CAAC;2CAAqD;AAExE;IAAhB,KAAK,EAAE;gDAA8B;AA9CnB,UAAU;IAD9B,aAAa,CAAC,gBAAgB,CAAC;GACX,UAAU,CA8J9B;eA9JoB,UAAU","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property, queryAll, state } from 'lit/decorators.js'\n\n/**\nmultiple language editor element\n\nExample:\n\n <ox-editor-i18n value=${map}>\n </ox-editor-i18n>\n*/\n@customElement('ox-editor-i18n')\nexport default class EditorI18n extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n align-content: center;\n\n width: 100%;\n overflow: hidden;\n border: 1px solid #ccc;\n margin: 5px 0;\n\n background-color: #ddd;\n }\n\n div {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n }\n\n div > * {\n min-width: 0px;\n min-height: 20px;\n margin: 2px;\n padding: 0;\n }\n\n button {\n width: 20px;\n text-align: center;\n border-radius: 50%;\n font-size: 1em;\n }\n\n input {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) declare value: { [key: string]: any }\n\n @queryAll('[data-record-new] input') declare _inputs: Array<HTMLInputElement> | undefined\n\n @state() declare _changingNow: boolean\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this._onChange.bind(this))\n }\n\n render() {\n return html`\n <datalist id=\"language-list\">\n <option value=\"en\">English</option>\n <option value=\"ko\">한국어</option>\n <option value=\"zh\">中文</option>\n <option value=\"ms\">Bahasa Malaysia</option>\n </datalist>\n\n ${this._toArray(this.value).map(\n item => html`\n <div data-record>\n <input type=\"text\" data-lng placeholder=\"language\" .value=${item.key} list=\"language-list\" />\n <input type=\"text\" data-term placeholder=\"term\" .value=${item.value} />\n <button class=\"record-action\" @click=${(e: MouseEvent) => this._delete(e)} tabindex=\"-1\">x</button>\n </div>\n `\n )}\n\n <div data-record-new>\n <input type=\"text\" data-lng placeholder=\"language\" value=\"\" list=\"language-list\" />\n <input type=\"text\" data-term placeholder=\"term\" value=\"\" />\n <button class=\"record-action\" @click=${() => this._add()} tabindex=\"-1\">+</button>\n </div>\n `\n }\n\n _onChange(e: Event) {\n if (this._changingNow) {\n return\n }\n\n this._changingNow = true\n\n var input = e.target as HTMLInputElement\n var value = input.value\n\n var div = input.parentElement as HTMLElement\n\n if (div.hasAttribute('data-record')) {\n this._build()\n } else if (div.hasAttribute('data-record-new') && input.hasAttribute('data-term')) {\n this._add()\n }\n\n this._changingNow = false\n }\n\n _build(includeNewRecord?: boolean) {\n if (includeNewRecord) var records = this.renderRoot.querySelectorAll('[data-record],[data-record-new]')\n else var records = this.renderRoot.querySelectorAll('[data-record]')\n\n var newmap: { [key: string]: string } = {}\n\n for (var i = 0; i < records.length; i++) {\n var record = records[i]\n\n var key = (record.querySelector('[data-lng]') as HTMLInputElement)?.value\n var input = record.querySelector('[data-term]') as HTMLInputElement\n if (!input) continue\n\n var value = input.value\n\n if (key) {\n newmap[key] = value || ''\n }\n }\n\n this.value = newmap\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n /* map아이템들을 template(dom-repeat)용 배열로 변환하는 함수 */\n _toArray(map: { [key: string]: any }) {\n var array = []\n\n for (var key in map) {\n array.push({\n key: key,\n value: map[key]\n })\n }\n\n return array\n }\n\n _add() {\n this._build(true)\n\n var inputs = this._inputs || []\n\n for (var i = 0; i < inputs.length; i++) {\n let input = inputs[i]\n input.value = ''\n }\n\n inputs[0].focus()\n }\n\n _delete(e: MouseEvent) {\n var record = (e.target as HTMLElement).parentElement\n const lng = record?.querySelector('[data-lng]') as HTMLInputElement\n lng && (lng.value = '')\n\n this._build()\n }\n}\n"]}
|
package/dist/label.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
2
2
|
declare const Label_base: (new (...args: any[]) => {
|
|
3
3
|
contains(x: number, y: number): boolean;
|
|
4
4
|
get path(): {
|
|
@@ -49,7 +49,7 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
49
49
|
get disposed(): boolean;
|
|
50
50
|
isLayer(): boolean;
|
|
51
51
|
isGroup(): boolean;
|
|
52
|
-
isContainer(): this is import("@hatiolab/things-scene
|
|
52
|
+
isContainer(): this is import("@hatiolab/things-scene").Container;
|
|
53
53
|
isLine(): boolean;
|
|
54
54
|
isRoot(): boolean;
|
|
55
55
|
isRootModel(): boolean;
|
|
@@ -65,9 +65,9 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
65
65
|
get(property: any): any;
|
|
66
66
|
set(props: any, propval?: any): any;
|
|
67
67
|
getState(property: any): any;
|
|
68
|
-
setState(props:
|
|
68
|
+
setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
|
|
69
69
|
get model(): any;
|
|
70
|
-
get state():
|
|
70
|
+
get state(): import("@hatiolab/things-scene").State;
|
|
71
71
|
get hierarchy(): any;
|
|
72
72
|
get volatile(): never[];
|
|
73
73
|
_applyProps(target: any, props: any, options: any): any;
|
|
@@ -103,7 +103,7 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
103
103
|
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
104
104
|
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
105
105
|
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
-
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
106
|
+
prepare(resolve: (component: import("@hatiolab/things-scene").Component) => void, reject: (reason: any) => void): void;
|
|
107
107
|
prepareIf(condition: boolean): void;
|
|
108
108
|
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
109
109
|
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
@@ -154,16 +154,16 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
154
154
|
get started(): boolean;
|
|
155
155
|
set started(v: boolean): any;
|
|
156
156
|
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
157
|
-
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
158
|
-
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
159
|
-
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
157
|
+
findFirst(finder: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): import("@hatiolab/things-scene").Component | undefined;
|
|
158
|
+
findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
|
|
159
|
+
capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
|
|
160
160
|
findAnchor(name: string): any;
|
|
161
|
-
isDescendible(container: Component): boolean;
|
|
161
|
+
isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
|
|
162
162
|
getContext(component?: unknown): any;
|
|
163
|
-
get root(): Component;
|
|
164
|
-
get rootModel(): Component;
|
|
165
|
-
get parent(): Component;
|
|
166
|
-
set parent(v: Component): any;
|
|
163
|
+
get root(): import("@hatiolab/things-scene").Component;
|
|
164
|
+
get rootModel(): import("@hatiolab/things-scene").Component;
|
|
165
|
+
get parent(): import("@hatiolab/things-scene").Component;
|
|
166
|
+
set parent(v: import("@hatiolab/things-scene").Component): any;
|
|
167
167
|
get scalable(): boolean;
|
|
168
168
|
get stuck(): boolean;
|
|
169
169
|
get capturable(): boolean;
|
|
@@ -188,20 +188,20 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
188
188
|
ondropfile(transfered: FileList, files: string[]): void;
|
|
189
189
|
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
190
190
|
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
191
|
-
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
-
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
-
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
-
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
-
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
-
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
-
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
191
|
+
transcoordS2T(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
+
transcoordT2P(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
transcoordT2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordS2TR(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordS2O(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordC2S(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordS2C(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
198
198
|
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
199
199
|
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
200
|
-
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
-
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
-
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
-
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
-
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
toScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
fromScene(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
|
|
205
205
|
on(name: string | object, callback: Function, context?: any): any;
|
|
206
206
|
off(name?: string | object, callback?: Function, context?: any): any;
|
|
207
207
|
once(name: string | object, callback: Function, context?: any): any;
|
|
@@ -211,24 +211,24 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
211
211
|
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
212
212
|
calculateBounds?(): void;
|
|
213
213
|
oncreate_element?(element: HTMLElement): void;
|
|
214
|
-
removeComponent(component: Component, ghost?: boolean): void;
|
|
215
|
-
addComponent(component: Component, ghost?: boolean): void;
|
|
216
|
-
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
217
|
-
getOverlay(component: Component): HTMLElement | undefined;
|
|
218
|
-
findById(id: string): Component | undefined;
|
|
219
|
-
findByRefid(ref: string | number): Component | undefined;
|
|
220
|
-
findAllById(id: string): Component[];
|
|
214
|
+
removeComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
215
|
+
addComponent(component: import("@hatiolab/things-scene").Component, ghost?: boolean): void;
|
|
216
|
+
insertComponentAt(component: import("@hatiolab/things-scene").Component, index: number, ghost?: boolean): void;
|
|
217
|
+
getOverlay(component: import("@hatiolab/things-scene").Component): HTMLElement | undefined;
|
|
218
|
+
findById(id: string): import("@hatiolab/things-scene").Component | undefined;
|
|
219
|
+
findByRefid(ref: string | number): import("@hatiolab/things-scene").Component | undefined;
|
|
220
|
+
findAllById(id: string): import("@hatiolab/things-scene").Component[];
|
|
221
221
|
resize(): void;
|
|
222
222
|
fit(type?: string): void;
|
|
223
|
-
get components(): Component[] | undefined;
|
|
223
|
+
get components(): import("@hatiolab/things-scene").Component[] | undefined;
|
|
224
224
|
get layout(): any;
|
|
225
225
|
get auxOverlay(): HTMLElement | undefined;
|
|
226
226
|
get isReady(): boolean;
|
|
227
227
|
get unitScale(): number;
|
|
228
|
-
get selected(): Component[];
|
|
229
|
-
set selected(_v: Component[]): any;
|
|
230
|
-
get focused(): Component | null;
|
|
231
|
-
set focused(_v: Component | null): any;
|
|
228
|
+
get selected(): import("@hatiolab/things-scene").Component[];
|
|
229
|
+
set selected(_v: import("@hatiolab/things-scene").Component[]): any;
|
|
230
|
+
get focused(): import("@hatiolab/things-scene").Component | null;
|
|
231
|
+
set focused(_v: import("@hatiolab/things-scene").Component | null): any;
|
|
232
232
|
get hasSameParentForAllSelected(): boolean;
|
|
233
233
|
set hasSameParentForAllSelected(_v: boolean): any;
|
|
234
234
|
get fitMode(): string | undefined;
|
|
@@ -238,7 +238,6 @@ declare const Label_base: (new (...args: any[]) => {
|
|
|
238
238
|
}) & typeof Shape;
|
|
239
239
|
export default class Label extends Label_base {
|
|
240
240
|
get nature(): ComponentNature;
|
|
241
|
-
is3dish(): boolean;
|
|
242
241
|
get text(): any;
|
|
243
242
|
}
|
|
244
243
|
export {};
|
package/dist/label.js
CHANGED
package/dist/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../src/label.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../src/label.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAmB,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEzF,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,KAAK;SACZ;QACD;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,UAAU;SACjB;KACF;IACD,gBAAgB,EAAE,KAAK;IACvB,IAAI,EAAE,uBAAuB;CAC9B,CAAA;AAGc,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,QAAQ,CAAC,KAAK,CAAC;IAChD,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IACD,IAAI,IAAI;QACN,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEhD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACjC,OAAO,KAAK,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,CAAA;IAC/F,CAAC;CACF,CAAA;AAVoB,KAAK;IADzB,cAAc,CAAC,OAAO,CAAC;GACH,KAAK,CAUzB;eAVoB,KAAK","sourcesContent":["import i18next from 'i18next'\n\nimport { ComponentNature, RectPath, Shape, sceneComponent } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'i18n',\n label: 'terms',\n name: 'terms'\n },\n {\n type: 'string',\n label: 'i18n-key',\n name: 'key'\n },\n {\n type: 'string',\n label: 'fallback',\n name: 'fallback'\n }\n ],\n 'value-property': 'key',\n help: 'scene/component/label'\n}\n\n@sceneComponent('label')\nexport default class Label extends RectPath(Shape) {\n get nature() {\n return NATURE\n }\n get text() {\n const { key, terms = {}, fallback } = this.state\n\n const language = i18next.language\n return terms[language] || terms[language.substr(0, 2)] || (key && i18next.t(key)) || fallback\n }\n}\n"]}
|
package/dist/templates/label.js
CHANGED
|
@@ -3,7 +3,7 @@ export default {
|
|
|
3
3
|
type: 'label',
|
|
4
4
|
description: 'label',
|
|
5
5
|
group: 'textAndMedia',
|
|
6
|
-
/* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|
|
|
6
|
+
/* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|3D|facility|storage|conveyance|transport|form|etc */
|
|
7
7
|
icon,
|
|
8
8
|
model: {
|
|
9
9
|
type: 'label',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/templates/label.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEzE,eAAe;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,OAAO;IACpB,KAAK,EAAE,cAAc;IACrB,
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/templates/label.ts"],"names":[],"mappings":"AAAA,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEzE,eAAe;IACb,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,OAAO;IACpB,KAAK,EAAE,cAAc;IACrB,wHAAwH;IACxH,IAAI;IACJ,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,OAAO;KACrB;CACF,CAAA","sourcesContent":["const icon = new URL('../../icons/scene-label.png', import.meta.url).href\n\nexport default {\n type: 'label',\n description: 'label',\n group: 'textAndMedia',\n /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|3D|facility|storage|conveyance|transport|form|etc */\n icon,\n model: {\n type: 'label',\n left: 10,\n top: 10,\n width: 100,\n height: 20,\n strokeStyle: 'black'\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/scene-i18n",
|
|
3
3
|
"description": "i18n component for things-scene",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.0.0-beta.
|
|
5
|
+
"version": "10.0.0-beta.30",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"prettier --write"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "06b35b1726ec4f27ee76657ce341c6c6f3ba1b3a"
|
|
65
65
|
}
|