@operato/scene-marker 10.0.0-beta.2 → 10.0.0-beta.68

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 CHANGED
@@ -1,15 +1,33 @@
1
- # things-scene-marker
1
+ # @operato/scene-marker
2
2
 
3
- ## build
3
+ > Marker UI component for things-scene
4
4
 
5
- `$ yarn build`
5
+ <!-- AUTOGEN_BEGIN: do not edit between markers (run scripts/regenerate-readmes.mjs to update) -->
6
6
 
7
- | type | filename | for | tested |
8
- | ---- | ------------------------- | -------------- | ------ |
9
- | UMD | things-scene-marker.js | modern browser | O |
10
- | UMD | things-scene-marker-ie.js | ie 11 | O |
11
- | ESM | things-scene-marker.mjs | modern browser | O |
7
+ ## Components
12
8
 
13
- ## publish
9
+ - `Marker`
14
10
 
15
- `$ yarn publish`
11
+ ## Install
12
+
13
+ ```bash
14
+ yarn add @operato/scene-marker
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import { Marker } from '@operato/scene-marker'
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 -->
package/dist/marker.d.ts CHANGED
@@ -40,6 +40,8 @@ declare const Marker_base: (new (...args: any[]) => {
40
40
  added(parent: any): void;
41
41
  removed(parent: any): void;
42
42
  ready(): Promise<void>;
43
+ _readyInvoked: boolean;
44
+ invokeReady(): void | Promise<void>;
43
45
  touch(): void;
44
46
  clearCache(...attrs: any[]): void;
45
47
  removeSelf(completely: any): void;
@@ -49,7 +51,7 @@ declare const Marker_base: (new (...args: any[]) => {
49
51
  get disposed(): boolean;
50
52
  isLayer(): boolean;
51
53
  isGroup(): boolean;
52
- isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
54
+ isContainer(): this is import("@hatiolab/things-scene").Container;
53
55
  isLine(): boolean;
54
56
  isRoot(): boolean;
55
57
  isRootModel(): boolean;
@@ -65,9 +67,10 @@ declare const Marker_base: (new (...args: any[]) => {
65
67
  get(property: any): any;
66
68
  set(props: any, propval?: any): any;
67
69
  getState(property: any): any;
68
- setState(props: any, propval?: any): any;
70
+ setState(props: Partial<import("@hatiolab/things-scene").State> | string, propval?: any): any;
69
71
  get model(): any;
70
- get state(): any;
72
+ get state(): import("@hatiolab/things-scene").State;
73
+ get refid(): any;
71
74
  get hierarchy(): any;
72
75
  get volatile(): never[];
73
76
  _applyProps(target: any, props: any, options: any): any;
@@ -158,7 +161,7 @@ declare const Marker_base: (new (...args: any[]) => {
158
161
  findAll(s: string | ((c: import("@hatiolab/things-scene").Component) => boolean), ...others: any[]): any[] | undefined;
159
162
  capture(x: number, y: number, except?: (c: import("@hatiolab/things-scene").Component) => boolean): any;
160
163
  findAnchor(name: string): any;
161
- isDescendible(container: import("@hatiolab/things-scene").Component): boolean;
164
+ isDescendible(container: import("@hatiolab/things-scene").Component | any): boolean;
162
165
  getContext(component?: unknown): any;
163
166
  get root(): import("@hatiolab/things-scene").Component;
164
167
  get rootModel(): import("@hatiolab/things-scene").Component;
@@ -202,9 +205,13 @@ declare const Marker_base: (new (...args: any[]) => {
202
205
  toLocal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
203
206
  toGlobal(x: number, y: number, top?: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
204
207
  toOther(x: number, y: number, target: import("@hatiolab/things-scene").Component): import("@hatiolab/things-scene").POINT;
208
+ on<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
205
209
  on(name: string | object, callback: Function, context?: any): any;
210
+ off<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback?: ((...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void) | undefined, context?: any): any;
206
211
  off(name?: string | object, callback?: Function, context?: any): any;
212
+ once<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, callback: (...args: import("@hatiolab/things-scene").ComponentEventMap[K]) => void, context?: any): any;
207
213
  once(name: string | object, callback: Function, context?: any): any;
214
+ trigger<K extends keyof import("@hatiolab/things-scene").ComponentEventMap>(name: K, ...args: import("@hatiolab/things-scene").ComponentEventMap[K]): any;
208
215
  trigger(name: string, ...args: any[]): any;
209
216
  delegate_on(delegator: any): any;
210
217
  delegate_off(delegator: any): any;
@@ -237,7 +244,6 @@ declare const Marker_base: (new (...args: any[]) => {
237
244
  set element(_v: HTMLElement | null): any;
238
245
  }) & typeof Shape;
239
246
  export default class Marker extends Marker_base {
240
- is3dish(): boolean;
241
247
  render(context: CanvasRenderingContext2D): void;
242
248
  get controls(): Control[];
243
249
  postrender(context: CanvasRenderingContext2D): void;
package/dist/marker.js CHANGED
@@ -15,9 +15,6 @@ const NATURE = {
15
15
  help: 'scene/component/marker'
16
16
  };
17
17
  let Marker = class Marker extends RectPath(Shape) {
18
- is3dish() {
19
- return true;
20
- }
21
18
  render(context) {
22
19
  var { innerCircleFillStyle } = this.state;
23
20
  var { top, left, width, height } = this.bounds;
@@ -1 +1 @@
1
- {"version":3,"file":"marker.js","sourceRoot":"","sources":["../src/marker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAA4B,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAElG,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,yBAAyB;YAChC,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,sBAAsB;SACjC;KACF;IACD,IAAI,EAAE,wBAAwB;CAC/B,CAAA;AAGc,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,QA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AG,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;QAE5F,OAAO,CAAC,SAAS,EAAE,CAAA;QAEnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAExB,WAAW;QACX,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;QAC1G,OAAO,CAAC,SAAS,GAAG,oBAAoB,CAAA;QACxC,OAAO,CAAC,IAAI,EAAE,CAAA;QAEd,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,EAAE,CAAA;IACX,CAAC;IAED,UAAU,CAAC,OAAiC;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAvDoB,MAAM;IAD1B,cAAc,CAAC,QAAQ,CAAC;GACJ,MAAM,CAuD1B;eAvDoB,MAAM","sourcesContent":["import { sceneComponent, ComponentNature, Control, RectPath, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'color',\n label: 'inner-circle-fill-style',\n name: 'innerCircleFillStyle',\n property: 'innerCircleFillStyle'\n }\n ],\n help: 'scene/component/marker'\n}\n\n@sceneComponent('marker')\nexport default class Marker extends RectPath(Shape) {\n is3dish() {\n return true\n }\n\n render(context: CanvasRenderingContext2D) {\n var { innerCircleFillStyle } = this.state\n var { top, left, width, height } = this.bounds\n context.translate(left, top)\n\n // 마커 모양 그리기\n context.beginPath()\n\n context.moveTo(width / 2, height * 0.9)\n\n context.bezierCurveTo(width / 2.3, height * 0.6, 0, height / 2, 0, height / 4)\n\n context.ellipse(\n width / 2,\n height / 4,\n Math.abs(width / 2),\n Math.abs(height / 4),\n 0,\n Math.PI * (width < 0 ? 0 : 1),\n Math.PI * (width < 0 ? 1 : 0),\n Math.sign(width) * Math.sign(height) == -1\n )\n\n context.bezierCurveTo(width, height / 2, width / 1.7, height * 0.6, width / 2, height * 0.9)\n\n context.closePath()\n\n this.drawFill(context)\n this.drawStroke(context)\n\n // 안쪽 원 그리기\n context.beginPath()\n context.ellipse(width / 2, height / 4, Math.abs(width * 0.18), Math.abs(height * 0.09), 0, 0, Math.PI * 2)\n context.fillStyle = innerCircleFillStyle\n context.fill()\n\n context.translate(-left, -top)\n }\n\n get controls(): Control[] {\n return []\n }\n\n postrender(context: CanvasRenderingContext2D) {\n this.drawText(context)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
1
+ {"version":3,"file":"marker.js","sourceRoot":"","sources":["../src/marker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAA4B,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAElG,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,yBAAyB;YAChC,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,sBAAsB;SACjC;KACF;IACD,IAAI,EAAE,wBAAwB;CAC/B,CAAA;AAGc,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACjD,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,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AI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QACtB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;QAExB,WAAW;QACX,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,OAAO,CAAC,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAA;QAC1G,OAAO,CAAC,SAAS,GAAG,oBAAoB,CAAA;QACxC,OAAO,CAAC,IAAI,EAAE,CAAA;QAEd,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,EAAE,CAAA;IACX,CAAC;IAED,UAAU,CAAC,OAAiC;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAnDoB,MAAM;IAD1B,cAAc,CAAC,QAAQ,CAAC;GACJ,MAAM,CAmD1B;eAnDoB,MAAM","sourcesContent":["import { sceneComponent, ComponentNature, Control, RectPath, Shape } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'color',\n label: 'inner-circle-fill-style',\n name: 'innerCircleFillStyle',\n property: 'innerCircleFillStyle'\n }\n ],\n help: 'scene/component/marker'\n}\n\n@sceneComponent('marker')\nexport default class Marker extends RectPath(Shape) {\n render(context: CanvasRenderingContext2D) {\n var { innerCircleFillStyle } = this.state\n var { top, left, width, height } = this.bounds\n context.translate(left, top)\n\n // 마커 모양 그리기\n context.beginPath()\n\n context.moveTo(width / 2, height * 0.9)\n\n context.bezierCurveTo(width / 2.3, height * 0.6, 0, height / 2, 0, height / 4)\n\n context.ellipse(\n width / 2,\n height / 4,\n Math.abs(width / 2),\n Math.abs(height / 4),\n 0,\n Math.PI * (width < 0 ? 0 : 1),\n Math.PI * (width < 0 ? 1 : 0),\n Math.sign(width) * Math.sign(height) == -1\n )\n\n context.bezierCurveTo(width, height / 2, width / 1.7, height * 0.6, width / 2, height * 0.9)\n\n context.closePath()\n\n this.drawFill(context)\n this.drawStroke(context)\n\n // 안쪽 원 그리기\n context.beginPath()\n context.ellipse(width / 2, height / 4, Math.abs(width * 0.18), Math.abs(height * 0.09), 0, 0, Math.PI * 2)\n context.fillStyle = innerCircleFillStyle\n context.fill()\n\n context.translate(-left, -top)\n }\n\n get controls(): Control[] {\n return []\n }\n\n postrender(context: CanvasRenderingContext2D) {\n this.drawText(context)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-marker",
3
3
  "description": "Marker UI component for things-scene",
4
4
  "author": "heartyoh",
5
- "version": "10.0.0-beta.2",
5
+ "version": "10.0.0-beta.68",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
@@ -18,22 +18,17 @@
18
18
  "directory": "packages/marker"
19
19
  },
20
20
  "scripts": {
21
- "serve": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"things-factory-dev\"",
22
- "serve:dev": "npm run serve",
23
21
  "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
24
22
  "build": "tsc",
25
23
  "prepublishOnly": "tsc",
26
24
  "lint": "eslint src/ && prettier \"src/**/*.ts\" --check",
27
- "format": "eslint src/ --fix && prettier \"src/**/*.ts\" --write",
28
- "migration": "things-factory-migration"
25
+ "format": "eslint src/ --fix && prettier \"src/**/*.ts\" --write"
29
26
  },
30
27
  "dependencies": {
31
28
  "@hatiolab/things-scene": "^10.0.0-beta.1"
32
29
  },
33
30
  "devDependencies": {
34
31
  "@hatiolab/prettier-config": "^1.0.0",
35
- "@things-factory/builder": "^10.0.0-beta.1",
36
- "@things-factory/operato-board": "^10.0.0-beta.1",
37
32
  "@typescript-eslint/eslint-plugin": "^8.0.0",
38
33
  "@typescript-eslint/parser": "^8.0.0",
39
34
  "@web/dev-server": "^0.1.28",
@@ -58,5 +53,5 @@
58
53
  "prettier --write"
59
54
  ]
60
55
  },
61
- "gitHead": "350ece104754d007967cf8e3f54d0d157465e94a"
56
+ "gitHead": "fce8d69d7bb8af85cfb2e2507a8eee14130d36d7"
62
57
  }