@hatiolab/things-scene 2.7.13 → 2.7.14

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.
Files changed (172) hide show
  1. package/package.json +4 -4
  2. package/things-scene.d.ts +187 -0
  3. package/things-scene.mjs +1 -1
  4. package/types/animation/animate.d.ts +0 -4
  5. package/types/animation/animations/animation.d.ts +0 -14
  6. package/types/animation/animations/fade.d.ts +0 -4
  7. package/types/animation/animations/heartbeat.d.ts +0 -4
  8. package/types/animation/animations/moving.d.ts +0 -4
  9. package/types/animation/animations/outline.d.ts +0 -10
  10. package/types/animation/animations/rotation.d.ts +0 -4
  11. package/types/animation/animations/vibration.d.ts +0 -4
  12. package/types/animation/compile.d.ts +0 -1
  13. package/types/animation/delta.d.ts +0 -19
  14. package/types/animation/index.d.ts +0 -1
  15. package/types/command/command-change.d.ts +0 -7
  16. package/types/command/command-migrate.d.ts +0 -4
  17. package/types/command/command.d.ts +0 -5
  18. package/types/command/snapshot-commander.d.ts +0 -15
  19. package/types/components/audio.d.ts +0 -44
  20. package/types/components/cloud.d.ts +0 -3
  21. package/types/components/component.d.ts +0 -213
  22. package/types/components/container-abstract.d.ts +0 -48
  23. package/types/components/container.d.ts +0 -37
  24. package/types/components/data/data-mapping.d.ts +0 -15
  25. package/types/components/data/data.d.ts +0 -8
  26. package/types/components/data/evaluator.d.ts +0 -1
  27. package/types/components/donut.d.ts +0 -3
  28. package/types/components/drawer/draw-image-pendable.d.ts +0 -1
  29. package/types/components/drawer/effect.d.ts +0 -1
  30. package/types/components/drawer/fill.d.ts +0 -14
  31. package/types/components/drawer/format.d.ts +0 -1
  32. package/types/components/drawer/line.d.ts +0 -3
  33. package/types/components/drawer/stroke.d.ts +0 -1
  34. package/types/components/drawer/text-wrapper.d.ts +0 -10
  35. package/types/components/drawer/text.d.ts +0 -3
  36. package/types/components/ellipse.d.ts +0 -3
  37. package/types/components/file/ondropfile.d.ts +0 -1
  38. package/types/components/fit/fit.d.ts +0 -15
  39. package/types/components/geometry/transcoord.d.ts +0 -37
  40. package/types/components/geometry/union.d.ts +0 -6
  41. package/types/components/gif/super-gif.d.ts +0 -18
  42. package/types/components/gif-view.d.ts +0 -25
  43. package/types/components/global-ref.d.ts +0 -34
  44. package/types/components/group.d.ts +0 -15
  45. package/types/components/html/elements.d.ts +0 -2
  46. package/types/components/html/fill.d.ts +0 -1
  47. package/types/components/html/reposition.d.ts +0 -1
  48. package/types/components/html/shadow.d.ts +0 -1
  49. package/types/components/html-overlay-container.d.ts +0 -27
  50. package/types/components/html-overlay-element.d.ts +0 -25
  51. package/types/components/image-view.d.ts +0 -66
  52. package/types/components/index.d.ts +0 -31
  53. package/types/components/info-window.d.ts +0 -40
  54. package/types/components/line.d.ts +0 -16
  55. package/types/components/local-ref.d.ts +0 -46
  56. package/types/components/mixins/data-source.d.ts +0 -9
  57. package/types/components/mixins/html-element.d.ts +0 -23
  58. package/types/components/mixins/move-handle.d.ts +0 -11
  59. package/types/components/mixins/rect-path.d.ts +0 -12
  60. package/types/components/mixins/value-holder.d.ts +0 -18
  61. package/types/components/mutater/bounds.d.ts +0 -10
  62. package/types/components/mutater/path.d.ts +0 -5
  63. package/types/components/outline/ellipse-outline.d.ts +0 -1
  64. package/types/components/outline/path-outline.d.ts +0 -1
  65. package/types/components/path.d.ts +0 -3
  66. package/types/components/polygon.d.ts +0 -4
  67. package/types/components/polyline.d.ts +0 -4
  68. package/types/components/popup.d.ts +0 -47
  69. package/types/components/rect.d.ts +0 -35
  70. package/types/components/retention/retention-manager.d.ts +0 -8
  71. package/types/components/root-container.d.ts +0 -76
  72. package/types/components/ruler.d.ts +0 -15
  73. package/types/components/shape.d.ts +0 -22
  74. package/types/components/star.d.ts +0 -3
  75. package/types/components/text/substitutor.d.ts +0 -3
  76. package/types/components/text.d.ts +0 -15
  77. package/types/components/triangle.d.ts +0 -3
  78. package/types/components/variable.d.ts +0 -24
  79. package/types/const.d.ts +0 -31
  80. package/types/core/collection.d.ts +0 -8
  81. package/types/core/debug.d.ts +0 -1
  82. package/types/core/deep-equals.d.ts +0 -1
  83. package/types/core/dom-to-image.d.ts +0 -127
  84. package/types/core/event.d.ts +0 -181
  85. package/types/core/index.d.ts +0 -2
  86. package/types/core/list.d.ts +0 -32
  87. package/types/core/logger.d.ts +0 -3
  88. package/types/core/memoize.d.ts +0 -6
  89. package/types/core/mixin.d.ts +0 -1
  90. package/types/core/obj-accessor.d.ts +0 -1
  91. package/types/core/reference-map.d.ts +0 -14
  92. package/types/core/script-loader.d.ts +0 -3
  93. package/types/core/snapshot-taker.d.ts +0 -12
  94. package/types/core/stack.d.ts +0 -2
  95. package/types/core/timecapsule.d.ts +0 -18
  96. package/types/core/utils.d.ts +0 -4
  97. package/types/effect/gradation.d.ts +0 -1
  98. package/types/effect/index.d.ts +0 -1
  99. package/types/effect/shadow.d.ts +0 -2
  100. package/types/effect/turn.d.ts +0 -1
  101. package/types/event/event-engine.d.ts +0 -12
  102. package/types/event/event-pump.d.ts +0 -11
  103. package/types/event/event-tracker.d.ts +0 -21
  104. package/types/event/index.d.ts +0 -2
  105. package/types/event/ua-event-handler.d.ts +0 -32
  106. package/types/event-map/event-map.d.ts +0 -9
  107. package/types/event-map/index.d.ts +0 -1
  108. package/types/event-map/move-handler.d.ts +0 -1
  109. package/types/event-map/text-editor-lite.d.ts +0 -1
  110. package/types/index.d.ts +0 -1
  111. package/types/layer/action/emphasize.d.ts +0 -2
  112. package/types/layer/action/popup.d.ts +0 -2
  113. package/types/layer/action/pressed.d.ts +0 -2
  114. package/types/layer/guide-layer.d.ts +0 -44
  115. package/types/layer/index.d.ts +0 -6
  116. package/types/layer/layer.d.ts +0 -29
  117. package/types/layer/model-layer.d.ts +0 -39
  118. package/types/layer/modeler/control-handler.d.ts +0 -18
  119. package/types/layer/modeler/focus-outline.d.ts +0 -5
  120. package/types/layer/modeler/group-outline.d.ts +0 -5
  121. package/types/layer/modeler/index.d.ts +0 -6
  122. package/types/layer/modeler/path-handler.d.ts +0 -17
  123. package/types/layer/modeler/resizer.d.ts +0 -16
  124. package/types/layer/modeler/rotator.d.ts +0 -15
  125. package/types/layer/modeling-layer.d.ts +0 -47
  126. package/types/layer/selection-layer.d.ts +0 -42
  127. package/types/layer/shift-layer.d.ts +0 -18
  128. package/types/layer/tag-layer.d.ts +0 -28
  129. package/types/layout/absolute.d.ts +0 -8
  130. package/types/layout/card.d.ts +0 -7
  131. package/types/layout/html-absolute.d.ts +0 -8
  132. package/types/layout/index.d.ts +0 -7
  133. package/types/layout/layout.d.ts +0 -11
  134. package/types/layout/linear-horizontal.d.ts +0 -7
  135. package/types/layout/linear-vertical.d.ts +0 -7
  136. package/types/layout/table.d.ts +0 -9
  137. package/types/license/license.d.ts +0 -18
  138. package/types/link/arrow_straight.d.ts +0 -3
  139. package/types/link/curve.d.ts +0 -3
  140. package/types/link/index.d.ts +0 -4
  141. package/types/link/link.d.ts +0 -7
  142. package/types/link/right_angle_straight.d.ts +0 -3
  143. package/types/link/straight.d.ts +0 -3
  144. package/types/model/compile.d.ts +0 -1
  145. package/types/model/duplicate.d.ts +0 -1
  146. package/types/model/index.d.ts +0 -3
  147. package/types/model/selector.d.ts +0 -2
  148. package/types/style/compile.d.ts +0 -1
  149. package/types/style/index.d.ts +0 -1
  150. package/types/things-scene/api/add.d.ts +0 -5
  151. package/types/things-scene/api/align.d.ts +0 -1
  152. package/types/things-scene/api/change.d.ts +0 -2
  153. package/types/things-scene/api/clipboard.d.ts +0 -3
  154. package/types/things-scene/api/distribute.d.ts +0 -1
  155. package/types/things-scene/api/duplicate.d.ts +0 -4
  156. package/types/things-scene/api/fullscreen.d.ts +0 -1
  157. package/types/things-scene/api/group.d.ts +0 -8
  158. package/types/things-scene/api/index.d.ts +0 -14
  159. package/types/things-scene/api/listener.d.ts +0 -3
  160. package/types/things-scene/api/remove.d.ts +0 -4
  161. package/types/things-scene/api/symmetry.d.ts +0 -2
  162. package/types/things-scene/api/to-data-url.d.ts +0 -1
  163. package/types/things-scene/api/variables.d.ts +0 -13
  164. package/types/things-scene/api/zorder.d.ts +0 -2
  165. package/types/things-scene/application-context.d.ts +0 -33
  166. package/types/things-scene/config.d.ts +0 -4
  167. package/types/things-scene/create.d.ts +0 -12
  168. package/types/things-scene/fps.d.ts +0 -1
  169. package/types/things-scene/index.d.ts +0 -16
  170. package/types/things-scene/polyfill.d.ts +0 -2
  171. package/types/things-scene/scene.d.ts +0 -146
  172. package/types/things-scene/version.d.ts +0 -2
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@hatiolab/things-scene",
3
- "version": "2.7.13",
3
+ "version": "2.7.14",
4
4
  "description": "2D graphic library",
5
5
  "main": "src/index.js",
6
6
  "module": "things-scene.mjs",
7
7
  "jsnext:main": "things-scene.mjs",
8
8
  "browser": "things-scene.mjs",
9
- "types": "types/index.d.ts",
9
+ "types": "things-scene.d.ts",
10
10
  "directories": {
11
11
  "doc": "docs",
12
12
  "test": "test"
@@ -26,10 +26,10 @@
26
26
  "serve": "things-factory",
27
27
  "serve:dev": "things-factory-dev",
28
28
  "serve:simple-http-server": "webpack-dev-server --config webpack.config.dev.js --hot --inline --host 0.0.0.0",
29
- "build": "tsc && webpack && rollup -c",
29
+ "build": "webpack && rollup -c",
30
30
  "build:client": "npm run clean:client && webpack --config node_modules/@things-factory/shell/webpack.config.js",
31
31
  "clean:client": "rm -rf dist-client",
32
- "prepublish": "tsc && webpack && rollup -c",
32
+ "prepublish": "webpack && rollup -c",
33
33
  "migration": "things-factory-migration",
34
34
  "prettify": "prettier --write \"{src,samples,test}/**/*.{js,css,html}\""
35
35
  },
@@ -0,0 +1,187 @@
1
+ declare module '@hatiolab/things-scene' {
2
+ export const MODE_VIEW = 0
3
+ export const MODE_EDIT = 1
4
+ export const MODE_SHIFT = 2
5
+
6
+ type FITMODE = 'both' | 'ratio' | 'width' | 'height' | 'center' | 'none'
7
+ type SCALE = { x: number; y: number }
8
+ type TRANSLATE = { x: number; y: number }
9
+
10
+ export function create({
11
+ target,
12
+ model,
13
+ style,
14
+ layers,
15
+ handlers,
16
+ mode,
17
+ refProvider,
18
+ baseUrl,
19
+ fitMode
20
+ }: {
21
+ target?: HTMLElement
22
+ model: Object
23
+ style?: any
24
+ layers?: Array<any>
25
+ handlers?: Array<any>
26
+ mode?: 0 | 1
27
+ refProvider?: any
28
+ baseUrl?: string | undefined
29
+ fitMode?: FITMODE
30
+ }): Scene
31
+
32
+ export class Component {}
33
+ export class Container {}
34
+
35
+ export class Scene {
36
+ static get residents(): WeakSet<Scene>
37
+
38
+ /**
39
+ * scene에 컴포넌트를 추가한다.
40
+ * @param models {object} - Component Model Object
41
+ * @param boundsOrOffset {object} - x, y, cx, cy, ...
42
+ * @param onto {string} - onto
43
+ */
44
+ add({ models, boundsOrOffset, onto }: { models: object; boundsOrOffset: object; onto: string }): Component
45
+
46
+ /**
47
+ * scene의 컴포넌트를 복제한다.
48
+ * 현재 선택되어있는 컴포넌트가 복제되므로, 컴포넌트를 복제하기 위해서는
49
+ * 먼저 복제하고자하는 컴포넌트를 선택된 상태로 만든 후에(참조. {@link select} 메쏘드) 이 메쏘드를 호출한다.
50
+ */
51
+ duplicate(): void
52
+
53
+ /**
54
+ * scene의 컴포넌트를 삭제한다.
55
+ * 현재 선택되어있는 컴포넌트가 삭제되므로, 컴포넌트를 삭제하기 위해서는
56
+ * 먼저 삭제하고자하는 컴포넌트를 선택된 상태로 만든 후에(참조. {@link select} 메쏘드) 이 메쏘드를 호출한다.
57
+ */
58
+ remove(): void
59
+
60
+ animate({
61
+ duration /* unit: milli-second, 1000 milli-seconds by default */,
62
+ delay /* default 30 */,
63
+ step /* step function */,
64
+ delta /* delta function */,
65
+ ease /* ease function */,
66
+ options,
67
+ repeat /* default false */
68
+ }: {
69
+ duration: number
70
+ delay: number
71
+ step: Function
72
+ delta: 'linear' | 'quad' | 'circ' | 'back' | 'bounce' | 'elastic' | Function
73
+ ease: 'out' | 'inout'
74
+ options?: object
75
+ repeat: boolean
76
+ }): {
77
+ start: Function /* start function */
78
+ stop: Function /* stop function */
79
+ }
80
+
81
+ /**
82
+ * scene이 그려지고 있는 컨테이너를 전체화면 모드에서 표시되도록 한다.
83
+ */
84
+ fullscreen(): void
85
+
86
+ /**
87
+ * 파라미터로 주어지는 id를 가진 컴포넌트의 data 값을 변경한다.
88
+ * @param id {string} - component id
89
+ * @param value {any} - data value
90
+ */
91
+ variable(id: string, value: any): any
92
+
93
+ target: HTMLElement
94
+ scale: SCALE
95
+ translate: TRANSLATE
96
+
97
+ readonly unit: string /* 'px' */
98
+ readonly PPM: number
99
+ readonly PPI: number
100
+ readonly DPPX: number
101
+
102
+ /**
103
+ * Scene 모델의 단위(unit)을 감안한 기본 Scale 값을 제공한다.
104
+ * 통산 'mm', 'cm' 단위의 Scene은 각 값에 10배를 곱한 수치로 모델링된다.(값을 10으로 나눈값이 실제 단위와 일치한다.)
105
+ * unitScale의 의미는 scene에 unitScale값으로 scale하면, 각 단위값이 화면과 일치한다는 의미이다.
106
+ *
107
+ * 모델링의 수치단위가 픽셀이 아니고, mm, cm, inch 등의 단위인 경우에,
108
+ * 화면에서의 크기가 실물과 유사하게 보이는 수준의 기본 스케일을 제공하는 기능이다.
109
+ * 이 값은 내부적으로는, Ruler에서 눈금을 실제 자의 눈금과 일치시키기 위해서 사용한다.
110
+ */
111
+ readonly unitScale: string
112
+
113
+ /**
114
+ * scene이 그려질 모니터 화면의 크기정보 (inch)
115
+ * 예시) 17, 20, 24, 27, 30, ...
116
+ * @type {number}
117
+ */
118
+ screen: number
119
+
120
+ /**
121
+ * 컨테이너의 크기에 맞게 크기를 조정한다.
122
+ */
123
+ resize(): void
124
+
125
+ dispose(): void
126
+
127
+ /* Selection Based API - Modeling APIs */
128
+
129
+ /**
130
+ * scene 내에서 선택된 컴포넌트의 리스트
131
+ * @type {object-array}
132
+ */
133
+ selected: Array<Component>
134
+
135
+ /**
136
+ * scene이 그리고 있는 컴포넌트 모델정보
137
+ * @type {object}
138
+ */
139
+ model: Component
140
+
141
+ /*
142
+ * root는 모델의 최상위 컨테이너인 모델레이어를 의미한다.
143
+ */
144
+ readonly root: Container
145
+
146
+ /*
147
+ * selector에 해당하는 모든 컴포넌트들을 찾는다.
148
+ * @params selector {string}
149
+ */
150
+ findAll(selector: string): Array<Component>
151
+
152
+ /*
153
+ * selector에 해당하는 첫번째 컴포넌트를 찾는다.
154
+ * @params selector {string}
155
+ */
156
+ findFirst(selector: string): Component
157
+
158
+ /*
159
+ * id를 갖는 컴포넌트를 찾는다.
160
+ * @params id {string}
161
+ */
162
+ findById(id: string): Component
163
+
164
+ /*
165
+ * scene이 그리는 모델 오브젝트를 JSON 텍스트로 리턴한다.
166
+ */
167
+ serialize(): string
168
+
169
+ on(event: string, listener: Function, context: any): void
170
+ once(event: string, listener: Function, context: any): void
171
+ off(event: string, listener: Function, context: any): void
172
+
173
+ toDataURL(): string
174
+
175
+ fit(type: FITMODE): void
176
+
177
+ readonly fitMode: FITMODE
178
+ readonly ids: string[]
179
+
180
+ data: object
181
+
182
+ // @deprecated
183
+ variables: object
184
+
185
+ baseUrl: string
186
+ }
187
+ }