@operato/image-marker 9.0.0-beta.4 → 9.0.0-beta.47
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 +135 -0
- package/dist/src/base-image-marker.d.ts +1 -1
- package/dist/src/base-image-marker.js +1 -1
- package/dist/src/base-image-marker.js.map +1 -1
- package/dist/src/default-image-provider.d.ts +1 -1
- package/dist/src/default-image-provider.js.map +1 -1
- package/dist/src/ox-image-marker-mode.d.ts +1 -1
- package/dist/src/ox-image-marker-mode.js.map +1 -1
- package/dist/src/ox-image-marker.d.ts +4 -4
- package/dist/src/ox-image-marker.js +2 -2
- package/dist/src/ox-image-marker.js.map +1 -1
- package/dist/stories/ox-image-marker-view.stories.js +1 -1
- package/dist/stories/ox-image-marker-view.stories.js.map +1 -1
- package/dist/stories/ox-image-marker.stories.js +1 -1
- package/dist/stories/ox-image-marker.stories.js.map +1 -1
- package/dist/stories/test-image-provider.d.ts +1 -1
- package/dist/stories/test-image-provider.js.map +1 -1
- package/dist/stories/test-image-provider.stories.js +1 -1
- package/dist/stories/test-image-provider.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,141 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.0.0-beta.47](https://github.com/hatiolab/operato/compare/v9.0.0-beta.46...v9.0.0-beta.47) (2025-02-14)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [9.0.0-beta.38](https://github.com/hatiolab/operato/compare/v9.0.0-beta.37...v9.0.0-beta.38) (2025-02-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [9.0.0-beta.37](https://github.com/hatiolab/operato/compare/v9.0.0-beta.36...v9.0.0-beta.37) (2025-02-01)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [9.0.0-beta.34](https://github.com/hatiolab/operato/compare/v9.0.0-beta.33...v9.0.0-beta.34) (2025-01-31)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [9.0.0-beta.33](https://github.com/hatiolab/operato/compare/v9.0.0-beta.32...v9.0.0-beta.33) (2025-01-31)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [9.0.0-beta.32](https://github.com/hatiolab/operato/compare/v9.0.0-beta.31...v9.0.0-beta.32) (2025-01-31)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [9.0.0-beta.28](https://github.com/hatiolab/operato/compare/v9.0.0-beta.27...v9.0.0-beta.28) (2025-01-28)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [9.0.0-beta.21](https://github.com/hatiolab/operato/compare/v9.0.0-beta.20...v9.0.0-beta.21) (2025-01-28)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## [9.0.0-beta.20](https://github.com/hatiolab/operato/compare/v9.0.0-beta.19...v9.0.0-beta.20) (2025-01-27)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### :rocket: New Features
|
|
74
|
+
|
|
75
|
+
* module property-panel ([03fb303](https://github.com/hatiolab/operato/commit/03fb303816c1629adca2a0ad843a8696ffaa4bef))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [9.0.0-beta.18](https://github.com/hatiolab/operato/compare/v9.0.0-beta.17...v9.0.0-beta.18) (2025-01-27)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [9.0.0-beta.15](https://github.com/hatiolab/operato/compare/v9.0.0-beta.14...v9.0.0-beta.15) (2025-01-27)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @operato/image-marker
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## [9.0.0-beta.14](https://github.com/hatiolab/operato/compare/v9.0.0-beta.13...v9.0.0-beta.14) (2025-01-27)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
### :rocket: New Features
|
|
99
|
+
|
|
100
|
+
* module property-panel ([d78e4cf](https://github.com/hatiolab/operato/commit/d78e4cf7080b95fa74e61b42094b9f3f59f1409b))
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## [9.0.0-beta.11](https://github.com/hatiolab/operato/compare/v9.0.0-beta.10...v9.0.0-beta.11) (2025-01-25)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
### :bug: Bug Fix
|
|
108
|
+
|
|
109
|
+
* tsconfig option useDefineForClassFields=false ([0d77c0a](https://github.com/hatiolab/operato/commit/0d77c0aa620282c65b3c05f8e0b559e82836b6ab))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
## [9.0.0-beta.10](https://github.com/hatiolab/operato/compare/v9.0.0-beta.9...v9.0.0-beta.10) (2025-01-25)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### :bug: Bug Fix
|
|
117
|
+
|
|
118
|
+
* i18next@24.2.1 ([1c5920c](https://github.com/hatiolab/operato/commit/1c5920c6f77d28f07051a0a49997b9fb1dbf08bf))
|
|
119
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
### :bug: Bug Fix
|
|
127
|
+
|
|
128
|
+
* esm module ([9642b97](https://github.com/hatiolab/operato/commit/9642b97650623d9ce71f6db0fd1995a2379205b5))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### :bug: Bug Fix
|
|
136
|
+
|
|
137
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
6
141
|
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
7
142
|
|
|
8
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement, nothing, PropertyValues } from 'lit';
|
|
2
2
|
import { GestureEventDoubleTap, GestureEventDrag, GestureEventPinch } from '@operato/utils/gesture-helper.js';
|
|
3
|
-
import { ImageProvider, Shape } from './types';
|
|
3
|
+
import { ImageProvider, Shape } from './types.js';
|
|
4
4
|
export declare class BaseImageMarker extends LitElement {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
imageUrl: string;
|
|
@@ -3,7 +3,7 @@ import { LitElement, css, svg, nothing } from 'lit';
|
|
|
3
3
|
import { property, state, query } from 'lit/decorators.js';
|
|
4
4
|
import { debounce } from 'lodash-es';
|
|
5
5
|
import { GestureHelper } from '@operato/utils/gesture-helper.js';
|
|
6
|
-
import { DefaultImageProvider } from './default-image-provider';
|
|
6
|
+
import { DefaultImageProvider } from './default-image-provider.js';
|
|
7
7
|
export class BaseImageMarker extends LitElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-image-marker.js","sourceRoot":"","sources":["../../src/base-image-marker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAQ,GAAG,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAIL,aAAa,EACd,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE/D,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QA4B8B,aAAQ,GAAW,EAAE,CAAA;QACtB,WAAM,GAAY,EAAE,CAAA;QAG5B,YAAO,GAAG,aAAa,CAAA;QACvB,cAAS,GAAG,CAAC,CAAA;QACf,kBAAa,GAAmB,IAAI,oBAAoB,EAAE,CAAA;QAEjE,yBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;QACjE,eAAU,GAAG,GAAG,CAAA;QAChB,kBAAa,GAAG,IAAI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AES,iBAAiB,CAAC,KAAmD;QAC7E,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YACvB,OAAO;gBACL,CAAC,EAAE,KAAK,CAAC,OAAO;gBAChB,CAAC,EAAE,KAAK,CAAC,OAAO;aACjB,CAAA;QACH,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;YACzC,OAAO;gBACL,CAAC,EAAE,OAAO;gBACV,CAAC,EAAE,OAAO;aACX,CAAA;QACH,CAAC;IACH,CAAC;;AAjO2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAqB;AAE5B;IAAlB,KAAK,EAAE;qDAAgC;AACrB;IAAlB,KAAK,EAAE;gDAAkC;AACvB;IAAlB,KAAK,EAAE;kDAAwB;AACf;IAAhB,KAAK,EAAE;sDAAmE;AAQnD;IAAvB,KAAK,CAAC,KAAK,CAAC;4CAA8B;AACjB;IAAzB,KAAK,CAAC,OAAO,CAAC;8CAAkC","sourcesContent":["import { LitElement, css, html, svg, nothing, PropertyValues } from 'lit'\nimport { property, state, query } from 'lit/decorators.js'\nimport { debounce } from 'lodash-es'\n\nimport {\n GestureEventDoubleTap,\n GestureEventDrag,\n GestureEventPinch,\n GestureHelper\n} from '@operato/utils/gesture-helper.js'\nimport { ImageProvider, Shape } from './types'\nimport { DefaultImageProvider } from './default-image-provider'\n\nexport class BaseImageMarker extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n }\n\n .container {\n flex: 1;\n position: relative;\n }\n\n svg {\n position: absolute;\n top: 0;\n left: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n touch-action: none;\n }\n\n .link:hover {\n cursor: pointer;\n }\n `\n ]\n\n @property({ type: String }) imageUrl: string = ''\n @property({ type: Array }) shapes: Shape[] = []\n\n @state() protected currentImage?: string\n @state() protected viewBox = '0 0 800 600'\n @state() protected zoomLevel = 1\n @state() private imageProvider?: ImageProvider = new DefaultImageProvider()\n\n protected debouncedUpdateImage = debounce(this.updateImage.bind(this), 300)\n protected zoomFactor = 0.1\n protected zoomThreshold = 0.05\n\n protected initialViewBox: string | null = null\n\n @query('svg') protected svg!: SVGSVGElement\n @query('image') protected image!: SVGImageElement\n\n private gestureHelper: GestureHelper | null = null\n\n connectedCallback(): void {\n super.connectedCallback()\n requestAnimationFrame(() => {\n this.gestureHelper = new GestureHelper(this.svg)\n })\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n this.gestureHelper?.dispose()\n this.gestureHelper = null\n }\n\n protected updated(changes: PropertyValues): void {\n if (changes.has('imageUrl') || changes.has('imageProvider')) {\n this.zoomLevel = 1\n this.initialViewBox = null\n this.updateImage()\n }\n }\n\n public setImageProvider(provider: ImageProvider) {\n this.imageProvider = provider\n }\n\n protected onImageLoad(event: Event) {\n const element = event.target as SVGImageElement\n const img = new Image()\n\n img.onload = () => {\n const width = img.naturalWidth\n const height = img.naturalHeight\n\n if (!this.initialViewBox) {\n this.initialViewBox = `0 0 ${width} ${height}`\n this.viewBox = this.initialViewBox\n\n element.setAttribute('width', width.toString())\n element.setAttribute('height', height.toString())\n element.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n } else {\n const [initialX, initialY, initialWidth, initialHeight] = this.initialViewBox.split(' ').map(Number)\n const scale = initialWidth / width\n\n element.setAttribute('width', (width * scale).toString())\n element.setAttribute('height', (height * scale).toString())\n }\n }\n\n img.src = this.currentImage!\n }\n\n protected async updateImage() {\n if (!this.imageProvider) {\n throw new Error('ImageProvider is not set')\n }\n\n if (!this.imageUrl) {\n return\n }\n\n const options = {\n id: this.imageUrl, // 이미지 ID는 imageUrl 속성을 사용\n scale: this.zoomLevel, // scale은 zoomLevel 속성을 사용\n offsetX: 0, // offsetX는 0으로 설정\n offsetY: 0, // offsetY는 0으로 설정\n currentImage: this.currentImage // 기존 이미지 객체 전달\n }\n\n this.currentImage = await this.imageProvider.getImage(options)\n }\n\n protected onSvgWheel(event: WheelEvent) {\n event.preventDefault()\n\n const { offsetX, offsetY, deltaY } = event\n const scale = deltaY > 0 ? 1 - this.zoomFactor : 1 + this.zoomFactor\n\n this.zoom(scale, offsetX, offsetY)\n }\n\n protected onSvgPinch(e: GestureEventPinch) {\n e.stopPropagation()\n\n const { scale, centerX, centerY } = e.detail\n\n console.log('pinch', e.detail)\n\n this.zoom(scale, centerX, centerY)\n }\n\n protected onSvgDoubleTap(e: GestureEventDoubleTap) {\n e.stopPropagation()\n\n this.reset()\n }\n\n protected onSvgDrag(e: GestureEventDrag) {\n const { deltaX, deltaY } = e.detail\n console.log('drag', e.detail)\n\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n\n const scaleX = vbWidth / this.svg.clientWidth\n const scaleY = vbHeight / this.svg.clientHeight\n const scale = Math.max(scaleX, scaleY)\n\n const newVbX = vbX - deltaX * scale\n const newVbY = vbY - deltaY * scale\n\n this.viewBox = `${newVbX} ${newVbY} ${vbWidth} ${vbHeight}`\n\n this.debouncedUpdateImage()\n }\n\n zoom(scale: number, offsetX: number, offsetY: number) {\n if (Math.abs(scale) > this.zoomThreshold) {\n this.zoomLevel *= scale\n\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n const mouseX = vbX + (offsetX / this.svg.clientWidth) * vbWidth\n const mouseY = vbY + (offsetY / this.svg.clientHeight) * vbHeight\n\n const newVbWidth = vbWidth / scale\n const newVbHeight = vbHeight / scale\n\n const newVbX = mouseX - (offsetX / this.svg.clientWidth) * newVbWidth\n const newVbY = mouseY - (offsetY / this.svg.clientHeight) * newVbHeight\n\n this.viewBox = `${newVbX} ${newVbY} ${newVbWidth} ${newVbHeight}`\n\n this.debouncedUpdateImage()\n }\n }\n\n public reset() {\n if (!this.initialViewBox) {\n this.zoomLevel = 1\n return\n }\n\n this.viewBox = this.initialViewBox!\n this.zoomLevel = 1\n\n this.debouncedUpdateImage()\n }\n\n protected handleLinkClick(shape: Shape) {\n this.dispatchEvent(\n new CustomEvent('link-clicked', {\n detail: { id: shape.id, link: shape.link },\n bubbles: true,\n composed: true\n })\n )\n }\n\n protected renderShape(shape: Shape) {\n const commonAttrs = {\n stroke: 'red',\n 'stroke-width': 1,\n fill: 'transparent'\n }\n\n switch (shape.type) {\n case 'text':\n return svg`<text x=\"${shape.x}\" y=\"${shape.y}\" text-anchor=\"middle\" alignment-baseline=\"middle\" fill=\"black\">${shape.text}</text>`\n case 'rectangle':\n return svg`<rect x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" fill=\"${commonAttrs.fill}\"></rect>`\n case 'circle':\n return svg`<circle cx=\"${shape.cx}\" cy=\"${shape.cy}\" r=\"${shape.r}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" fill=\"${commonAttrs.fill}\"></circle>`\n case 'line':\n return svg`<line x1=\"${shape.x1}\" y1=\"${shape.y1}\" x2=\"${shape.x2}\" y2=\"${shape.y2}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\"></line>`\n case 'arrow':\n return svg`\n <defs>\n <marker id=\"arrowhead-${shape.id}\" markerWidth=\"10\" markerHeight=\"7\" refX=\"10\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"${commonAttrs.stroke}\"></polygon>\n </marker>\n </defs>\n <line x1=\"${shape.x1}\" y1=\"${shape.y1}\" x2=\"${shape.x2}\" y2=\"${shape.y2}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" marker-end=\"url(#arrowhead-${shape.id})\"></line>`\n case 'link':\n return svg`\n <rect class=\"link\" x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" \n stroke=\"${commonAttrs.stroke}\" stroke-width=\"0\" \n fill=\"${commonAttrs.stroke}\" fill-opacity=\"0.3\" @click=\"${() => this.handleLinkClick(shape)}\">\n </rect>`\n default:\n return nothing\n }\n }\n\n protected getPointFromEvent(event: MouseEvent | PointerEvent | GestureEventDrag) {\n if ('clientX' in event) {\n return {\n x: event.clientX,\n y: event.clientY\n }\n } else {\n const { clientX, clientY } = event.detail\n return {\n x: clientX,\n y: clientY\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base-image-marker.js","sourceRoot":"","sources":["../../src/base-image-marker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAQ,GAAG,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,OAAO,EAIL,aAAa,EACd,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAElE,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QA4B8B,aAAQ,GAAW,EAAE,CAAA;QACtB,WAAM,GAAY,EAAE,CAAA;QAG5B,YAAO,GAAG,aAAa,CAAA;QACvB,cAAS,GAAG,CAAC,CAAA;QACf,kBAAa,GAAmB,IAAI,oBAAoB,EAAE,CAAA;QAEjE,yBAAoB,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;QACjE,eAAU,GAAG,GAAG,CAAA;QAChB,kBAAa,GAAG,IAAI,CAAA;QAEpB,mBAAc,GAAkB,IAAI,CAAA;QAKtC,kBAAa,GAAyB,IAAI,CAAA;IAiNpD,CAAC;aA7PQ,WAAM,GAAG;QACd,GAAG,CAAA;;;;;;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AE,KAAK,CAAC,OAAO;aACjB,CAAA;QACH,CAAC;aAAM,CAAC;YACN,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;YACzC,OAAO;gBACL,CAAC,EAAE,OAAO;gBACV,CAAC,EAAE,OAAO;aACX,CAAA;QACH,CAAC;IACH,CAAC;;AAjO2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAsB;AACtB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;+CAAqB;AAE5B;IAAlB,KAAK,EAAE;qDAAgC;AACrB;IAAlB,KAAK,EAAE;gDAAkC;AACvB;IAAlB,KAAK,EAAE;kDAAwB;AACf;IAAhB,KAAK,EAAE;sDAAmE;AAQnD;IAAvB,KAAK,CAAC,KAAK,CAAC;4CAA8B;AACjB;IAAzB,KAAK,CAAC,OAAO,CAAC;8CAAkC","sourcesContent":["import { LitElement, css, html, svg, nothing, PropertyValues } from 'lit'\nimport { property, state, query } from 'lit/decorators.js'\nimport { debounce } from 'lodash-es'\n\nimport {\n GestureEventDoubleTap,\n GestureEventDrag,\n GestureEventPinch,\n GestureHelper\n} from '@operato/utils/gesture-helper.js'\nimport { ImageProvider, Shape } from './types.js'\nimport { DefaultImageProvider } from './default-image-provider.js'\n\nexport class BaseImageMarker extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n }\n\n .container {\n flex: 1;\n position: relative;\n }\n\n svg {\n position: absolute;\n top: 0;\n left: 0;\n cursor: pointer;\n width: 100%;\n height: 100%;\n touch-action: none;\n }\n\n .link:hover {\n cursor: pointer;\n }\n `\n ]\n\n @property({ type: String }) imageUrl: string = ''\n @property({ type: Array }) shapes: Shape[] = []\n\n @state() protected currentImage?: string\n @state() protected viewBox = '0 0 800 600'\n @state() protected zoomLevel = 1\n @state() private imageProvider?: ImageProvider = new DefaultImageProvider()\n\n protected debouncedUpdateImage = debounce(this.updateImage.bind(this), 300)\n protected zoomFactor = 0.1\n protected zoomThreshold = 0.05\n\n protected initialViewBox: string | null = null\n\n @query('svg') protected svg!: SVGSVGElement\n @query('image') protected image!: SVGImageElement\n\n private gestureHelper: GestureHelper | null = null\n\n connectedCallback(): void {\n super.connectedCallback()\n requestAnimationFrame(() => {\n this.gestureHelper = new GestureHelper(this.svg)\n })\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback()\n\n this.gestureHelper?.dispose()\n this.gestureHelper = null\n }\n\n protected updated(changes: PropertyValues): void {\n if (changes.has('imageUrl') || changes.has('imageProvider')) {\n this.zoomLevel = 1\n this.initialViewBox = null\n this.updateImage()\n }\n }\n\n public setImageProvider(provider: ImageProvider) {\n this.imageProvider = provider\n }\n\n protected onImageLoad(event: Event) {\n const element = event.target as SVGImageElement\n const img = new Image()\n\n img.onload = () => {\n const width = img.naturalWidth\n const height = img.naturalHeight\n\n if (!this.initialViewBox) {\n this.initialViewBox = `0 0 ${width} ${height}`\n this.viewBox = this.initialViewBox\n\n element.setAttribute('width', width.toString())\n element.setAttribute('height', height.toString())\n element.setAttribute('preserveAspectRatio', 'xMidYMid meet')\n } else {\n const [initialX, initialY, initialWidth, initialHeight] = this.initialViewBox.split(' ').map(Number)\n const scale = initialWidth / width\n\n element.setAttribute('width', (width * scale).toString())\n element.setAttribute('height', (height * scale).toString())\n }\n }\n\n img.src = this.currentImage!\n }\n\n protected async updateImage() {\n if (!this.imageProvider) {\n throw new Error('ImageProvider is not set')\n }\n\n if (!this.imageUrl) {\n return\n }\n\n const options = {\n id: this.imageUrl, // 이미지 ID는 imageUrl 속성을 사용\n scale: this.zoomLevel, // scale은 zoomLevel 속성을 사용\n offsetX: 0, // offsetX는 0으로 설정\n offsetY: 0, // offsetY는 0으로 설정\n currentImage: this.currentImage // 기존 이미지 객체 전달\n }\n\n this.currentImage = await this.imageProvider.getImage(options)\n }\n\n protected onSvgWheel(event: WheelEvent) {\n event.preventDefault()\n\n const { offsetX, offsetY, deltaY } = event\n const scale = deltaY > 0 ? 1 - this.zoomFactor : 1 + this.zoomFactor\n\n this.zoom(scale, offsetX, offsetY)\n }\n\n protected onSvgPinch(e: GestureEventPinch) {\n e.stopPropagation()\n\n const { scale, centerX, centerY } = e.detail\n\n console.log('pinch', e.detail)\n\n this.zoom(scale, centerX, centerY)\n }\n\n protected onSvgDoubleTap(e: GestureEventDoubleTap) {\n e.stopPropagation()\n\n this.reset()\n }\n\n protected onSvgDrag(e: GestureEventDrag) {\n const { deltaX, deltaY } = e.detail\n console.log('drag', e.detail)\n\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n\n const scaleX = vbWidth / this.svg.clientWidth\n const scaleY = vbHeight / this.svg.clientHeight\n const scale = Math.max(scaleX, scaleY)\n\n const newVbX = vbX - deltaX * scale\n const newVbY = vbY - deltaY * scale\n\n this.viewBox = `${newVbX} ${newVbY} ${vbWidth} ${vbHeight}`\n\n this.debouncedUpdateImage()\n }\n\n zoom(scale: number, offsetX: number, offsetY: number) {\n if (Math.abs(scale) > this.zoomThreshold) {\n this.zoomLevel *= scale\n\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n const mouseX = vbX + (offsetX / this.svg.clientWidth) * vbWidth\n const mouseY = vbY + (offsetY / this.svg.clientHeight) * vbHeight\n\n const newVbWidth = vbWidth / scale\n const newVbHeight = vbHeight / scale\n\n const newVbX = mouseX - (offsetX / this.svg.clientWidth) * newVbWidth\n const newVbY = mouseY - (offsetY / this.svg.clientHeight) * newVbHeight\n\n this.viewBox = `${newVbX} ${newVbY} ${newVbWidth} ${newVbHeight}`\n\n this.debouncedUpdateImage()\n }\n }\n\n public reset() {\n if (!this.initialViewBox) {\n this.zoomLevel = 1\n return\n }\n\n this.viewBox = this.initialViewBox!\n this.zoomLevel = 1\n\n this.debouncedUpdateImage()\n }\n\n protected handleLinkClick(shape: Shape) {\n this.dispatchEvent(\n new CustomEvent('link-clicked', {\n detail: { id: shape.id, link: shape.link },\n bubbles: true,\n composed: true\n })\n )\n }\n\n protected renderShape(shape: Shape) {\n const commonAttrs = {\n stroke: 'red',\n 'stroke-width': 1,\n fill: 'transparent'\n }\n\n switch (shape.type) {\n case 'text':\n return svg`<text x=\"${shape.x}\" y=\"${shape.y}\" text-anchor=\"middle\" alignment-baseline=\"middle\" fill=\"black\">${shape.text}</text>`\n case 'rectangle':\n return svg`<rect x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" fill=\"${commonAttrs.fill}\"></rect>`\n case 'circle':\n return svg`<circle cx=\"${shape.cx}\" cy=\"${shape.cy}\" r=\"${shape.r}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" fill=\"${commonAttrs.fill}\"></circle>`\n case 'line':\n return svg`<line x1=\"${shape.x1}\" y1=\"${shape.y1}\" x2=\"${shape.x2}\" y2=\"${shape.y2}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\"></line>`\n case 'arrow':\n return svg`\n <defs>\n <marker id=\"arrowhead-${shape.id}\" markerWidth=\"10\" markerHeight=\"7\" refX=\"10\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"${commonAttrs.stroke}\"></polygon>\n </marker>\n </defs>\n <line x1=\"${shape.x1}\" y1=\"${shape.y1}\" x2=\"${shape.x2}\" y2=\"${shape.y2}\" stroke=\"${commonAttrs.stroke}\" stroke-width=\"${commonAttrs['stroke-width']}\" marker-end=\"url(#arrowhead-${shape.id})\"></line>`\n case 'link':\n return svg`\n <rect class=\"link\" x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" \n stroke=\"${commonAttrs.stroke}\" stroke-width=\"0\" \n fill=\"${commonAttrs.stroke}\" fill-opacity=\"0.3\" @click=\"${() => this.handleLinkClick(shape)}\">\n </rect>`\n default:\n return nothing\n }\n }\n\n protected getPointFromEvent(event: MouseEvent | PointerEvent | GestureEventDrag) {\n if ('clientX' in event) {\n return {\n x: event.clientX,\n y: event.clientY\n }\n } else {\n const { clientX, clientY } = event.detail\n return {\n x: clientX,\n y: clientY\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-image-provider.js","sourceRoot":"","sources":["../../src/default-image-provider.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,oBAAoB;IAC/B,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,OAAO,OAAO,CAAC,EAAE,CAAA;IACnB,CAAC;CACF","sourcesContent":["import { ImageOptions, ImageProvider } from './types'\n\nexport class DefaultImageProvider implements ImageProvider {\n async getImage(options: ImageOptions): Promise<string> {\n return options.id\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"default-image-provider.js","sourceRoot":"","sources":["../../src/default-image-provider.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,oBAAoB;IAC/B,KAAK,CAAC,QAAQ,CAAC,OAAqB;QAClC,OAAO,OAAO,CAAC,EAAE,CAAA;IACnB,CAAC;CACF","sourcesContent":["import { ImageOptions, ImageProvider } from './types.js'\n\nexport class DefaultImageProvider implements ImageProvider {\n async getImage(options: ImageOptions): Promise<string> {\n return options.id\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
import { ImageMarkerMode, ShapeType } from './types';
|
|
3
|
+
import { ImageMarkerMode, ShapeType } from './types.js';
|
|
4
4
|
export declare class OxImageMarkerMode extends LitElement {
|
|
5
5
|
static styles: import("lit").CSSResult;
|
|
6
6
|
currentMode: ImageMarkerMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-image-marker-mode.js","sourceRoot":"","sources":["../../src/ox-image-marker-mode.ts"],"names":[],"mappings":";AAA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E,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,UAAU,EAAE;YAC1B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;YAC9B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;;AApH2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAsC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAA6B;AAlC7C,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsJ7B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ImageMarkerMode, ShapeType } from './types'\n\n@customElement('ox-image-marker-mode')\nexport class OxImageMarkerMode extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium);\n }\n\n .palette {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n justify-content: center;\n margin: var(--spacing-medium);\n\n --md-icon-size: 16px;\n }\n\n .palette > * {\n padding: var(--spacing-small);\n cursor: pointer;\n background-color: #f0f0f0;\n border: 1px solid #ccc;\n border-radius: 4px;\n width: 12px;\n height: 12px;\n }\n\n .palette [selected] {\n background-color: #d0d0d0;\n }\n `\n\n @property({ type: String }) currentMode: ImageMarkerMode = 'edit'\n @property({ type: String }) currentShapeType?: ShapeType\n\n render() {\n return html`\n <div class=\"palette\">\n <md-icon\n title=\"Edit or View\"\n ?selected=${this.currentMode !== 'shape'}\n @click=${() => this.setMode(this.currentMode !== 'edit' ? 'edit' : 'view')}\n >${this.currentMode !== 'view' ? 'brush' : 'drag_pan'}</md-icon\n >\n\n <md-icon\n title=\"Text\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'text'}\n @click=${() => this.setShape('text')}\n >match_case</md-icon\n >\n\n <md-icon\n title=\"Rectangle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'rectangle'}\n @click=${() => this.setShape('rectangle')}\n >rectangle</md-icon\n >\n\n <md-icon\n title=\"Circle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'circle'}\n @click=${() => this.setShape('circle')}\n >circle</md-icon\n >\n\n <md-icon\n title=\"Triangle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'triangle'}\n @click=${() => this.setShape('triangle')}\n >change_history</md-icon\n >\n\n <md-icon\n title=\"Line\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'line'}\n @click=${() => this.setShape('line')}\n >shape_line</md-icon\n >\n\n <md-icon\n title=\"Arrow\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'arrow'}\n @click=${() => this.setShape('arrow')}\n >line_end_arrow</md-icon\n >\n </div>\n\n <div class=\"palette\">\n <md-icon title=\"Fit size\" @click=${() => this.onClickFitSize()}>recenter</md-icon>\n </div>\n\n <div class=\"palette\">\n <md-icon title=\"Delete\" @click=${() => this.onClickDelete()}>delete</md-icon>\n <md-icon title=\"Save\" @click=${() => this.onClickSave()}>save</md-icon>\n </div>\n `\n }\n\n public setMode(mode: ImageMarkerMode) {\n this.currentMode = mode\n\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n detail: { mode: this.currentMode, shapeType: this.currentShapeType },\n bubbles: true,\n composed: true\n })\n )\n }\n\n protected setShape(shapeType: ShapeType) {\n this.currentMode = 'shape'\n this.currentShapeType = shapeType\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n detail: { mode: 'shape', shapeType: this.currentShapeType },\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickDelete() {\n this.dispatchEvent(\n new CustomEvent('tap-delete', {\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickSave() {\n this.dispatchEvent(\n new CustomEvent('tap-save', {\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickFitSize() {\n this.dispatchEvent(\n new CustomEvent('tap-fit-size', {\n bubbles: true,\n composed: true\n })\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-image-marker-mode.js","sourceRoot":"","sources":["../../src/ox-image-marker-mode.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAIpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAA1C;;QAiCuB,gBAAW,GAAoB,MAAM,CAAA;IAqHnE,CAAC;aArJQ,WAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BlB,AA9BY,CA8BZ;IAKD,MAAM;QACJ,OAAO,IAAI,CAAA;;;;sBAIO,IAAI,CAAC,WAAW,KAAK,OAAO;mBAC/B,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;aACvE,IAAI,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;;;;;sBAKzC,IAAI,CAAC,WAAW,KAAK,OAAO,IAAI,IAAI,CAAC,gBAAgB,KAAK,MAAM;mBACnE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;;;;;;sBAMxB,IAAI,CAAC,WAAW,KAAK,OAAO,IAAI,IAAI,CAAC,gBAAgB,KAAK,WAAW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BAAgB,GAAG,SAAS,CAAA;QACjC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;YAC9B,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAC3D,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,YAAY,EAAE;YAC5B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,UAAU,EAAE;YAC1B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;IAEO,cAAc;QACpB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;YAC9B,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CACH,CAAA;IACH,CAAC;;AApH2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAsC;AACrC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAA6B;AAlC7C,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsJ7B","sourcesContent":["import '@material/web/icon/icon.js'\n\nimport { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { ImageMarkerMode, ShapeType } from './types.js'\n\n@customElement('ox-image-marker-mode')\nexport class OxImageMarkerMode extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium);\n }\n\n .palette {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n justify-content: center;\n margin: var(--spacing-medium);\n\n --md-icon-size: 16px;\n }\n\n .palette > * {\n padding: var(--spacing-small);\n cursor: pointer;\n background-color: #f0f0f0;\n border: 1px solid #ccc;\n border-radius: 4px;\n width: 12px;\n height: 12px;\n }\n\n .palette [selected] {\n background-color: #d0d0d0;\n }\n `\n\n @property({ type: String }) currentMode: ImageMarkerMode = 'edit'\n @property({ type: String }) currentShapeType?: ShapeType\n\n render() {\n return html`\n <div class=\"palette\">\n <md-icon\n title=\"Edit or View\"\n ?selected=${this.currentMode !== 'shape'}\n @click=${() => this.setMode(this.currentMode !== 'edit' ? 'edit' : 'view')}\n >${this.currentMode !== 'view' ? 'brush' : 'drag_pan'}</md-icon\n >\n\n <md-icon\n title=\"Text\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'text'}\n @click=${() => this.setShape('text')}\n >match_case</md-icon\n >\n\n <md-icon\n title=\"Rectangle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'rectangle'}\n @click=${() => this.setShape('rectangle')}\n >rectangle</md-icon\n >\n\n <md-icon\n title=\"Circle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'circle'}\n @click=${() => this.setShape('circle')}\n >circle</md-icon\n >\n\n <md-icon\n title=\"Triangle\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'triangle'}\n @click=${() => this.setShape('triangle')}\n >change_history</md-icon\n >\n\n <md-icon\n title=\"Line\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'line'}\n @click=${() => this.setShape('line')}\n >shape_line</md-icon\n >\n\n <md-icon\n title=\"Arrow\"\n ?selected=${this.currentMode === 'shape' && this.currentShapeType === 'arrow'}\n @click=${() => this.setShape('arrow')}\n >line_end_arrow</md-icon\n >\n </div>\n\n <div class=\"palette\">\n <md-icon title=\"Fit size\" @click=${() => this.onClickFitSize()}>recenter</md-icon>\n </div>\n\n <div class=\"palette\">\n <md-icon title=\"Delete\" @click=${() => this.onClickDelete()}>delete</md-icon>\n <md-icon title=\"Save\" @click=${() => this.onClickSave()}>save</md-icon>\n </div>\n `\n }\n\n public setMode(mode: ImageMarkerMode) {\n this.currentMode = mode\n\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n detail: { mode: this.currentMode, shapeType: this.currentShapeType },\n bubbles: true,\n composed: true\n })\n )\n }\n\n protected setShape(shapeType: ShapeType) {\n this.currentMode = 'shape'\n this.currentShapeType = shapeType\n this.dispatchEvent(\n new CustomEvent('mode-changed', {\n detail: { mode: 'shape', shapeType: this.currentShapeType },\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickDelete() {\n this.dispatchEvent(\n new CustomEvent('tap-delete', {\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickSave() {\n this.dispatchEvent(\n new CustomEvent('tap-save', {\n bubbles: true,\n composed: true\n })\n )\n }\n\n private onClickFitSize() {\n this.dispatchEvent(\n new CustomEvent('tap-fit-size', {\n bubbles: true,\n composed: true\n })\n )\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import './ox-image-marker-mode';
|
|
1
|
+
import './ox-image-marker-mode.js';
|
|
2
2
|
import { nothing } from 'lit';
|
|
3
3
|
import { GestureEventDrag, GestureEventPinch } from '@operato/utils/gesture-helper.js';
|
|
4
|
-
import { Shape } from './types';
|
|
5
|
-
import { BaseImageMarker } from './base-image-marker';
|
|
6
|
-
import { OxImageMarkerMode } from './ox-image-marker-mode';
|
|
4
|
+
import { Shape } from './types.js';
|
|
5
|
+
import { BaseImageMarker } from './base-image-marker.js';
|
|
6
|
+
import { OxImageMarkerMode } from './ox-image-marker-mode.js';
|
|
7
7
|
export declare class OxImageMarker extends BaseImageMarker {
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
private currentShapeType?;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import './ox-image-marker-mode';
|
|
2
|
+
import './ox-image-marker-mode.js';
|
|
3
3
|
import { html, css, svg, nothing } from 'lit';
|
|
4
4
|
import { query, state, customElement } from 'lit/decorators.js';
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
6
|
import { keyed } from 'lit/directives/keyed.js';
|
|
7
|
-
import { BaseImageMarker } from './base-image-marker';
|
|
7
|
+
import { BaseImageMarker } from './base-image-marker.js';
|
|
8
8
|
let OxImageMarker = class OxImageMarker extends BaseImageMarker {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-image-marker.js","sourceRoot":"","sources":["../../src/ox-image-marker.ts"],"names":[],"mappings":";AAAA,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAK/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAI9C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,eAAe;IAA3C;;QAgCY,gBAAW,GAAoB,MAAM,CAAA;QACrC,kBAAa,GAAiB,IAAI,CAAA;QAInD,0CAA0C;QAClC,YAAO,GAAY,KAAK,CAAA;QACxB,WAAM,GAAW,CAAC,CAAA;QAClB,WAAM,GAAW,CAAC,CAAA;QAClB,YAAO,GAAW,CAAC,CAAA;QACnB,YAAO,GAAW,CAAC,CAAA;QACnB,uBAAkB,GAAW,EAAE,CAAA;QAC/B,uBAAkB,GAAG,KAAK,CAAA;QAka1B,yBAAoB,GAAG,CAAC,KAAmB,EAAE,EAAE;YACrD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,OAAM;YACR,CAAC;YAED,iDAAiD;YACj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ent":["import './ox-image-marker-mode'\n\nimport { html, css, svg, nothing } from 'lit'\nimport { query, state, customElement } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { GestureEventDrag, GestureEventPinch } from '@operato/utils/gesture-helper.js'\n\nimport { ImageMarkerMode, Shape, ShapeType } from './types'\nimport { BaseImageMarker } from './base-image-marker'\nimport { OxImageMarkerMode } from './ox-image-marker-mode'\n\n@customElement('ox-image-marker')\nexport class OxImageMarker extends BaseImageMarker {\n static styles = [\n ...BaseImageMarker.styles,\n css`\n :host {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n }\n\n ox-image-marker-mode {\n position: absolute;\n top: 0;\n right: 0;\n }\n\n svg {\n cursor: default;\n }\n\n svg[drawing] {\n cursor: crosshair;\n }\n\n .resize-handle {\n cursor: nwse-resize;\n }\n `\n ]\n\n @state() private currentShapeType?: ShapeType\n @state() private currentMode: ImageMarkerMode = 'edit'\n @state() private selectedShape: Shape | null = null\n\n @query('ox-image-marker-mode') imageMarkerMode!: OxImageMarkerMode\n\n // private drawingStarted: boolean = false\n private drawing: boolean = false\n private startX: number = 0\n private startY: number = 0\n private offsetX: number = 0\n private offsetY: number = 0\n private shapeMoveThreshold: number = 10\n private shapeMoveInitiated = false\n\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('tabindex', '0')\n this.addEventListener('focus', this.onFocus)\n this.addEventListener('blur', this.onBlur)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListener('focus', this.onFocus)\n this.removeEventListener('blur', this.onBlur)\n }\n\n render() {\n return html`\n <div class=\"container\">\n <svg\n @wheel=${this.onSvgWheel}\n @doubletap=${this.onSvgDoubleTap}\n @pinch=${this.onSvgPinch}\n @drag=${this.onSvgDrag}\n @click=${this.onSvgClick}\n viewBox=${this.viewBox}\n ?drawing=${this.currentMode == 'shape'}\n >\n <image href=${this.currentImage} @load=${this.onImageLoad}></image>\n ${this.shapes.map(shape => keyed(shape.id, this.renderShape(shape)))}\n </svg>\n </div>\n\n <ox-image-marker-mode\n currentMode=${this.currentMode}\n currentShapeType=${ifDefined(this.currentShapeType)}\n @mode-changed=${(e: CustomEvent) => {\n const { mode, shapeType } = e.detail\n this.setMode(mode, shapeType)\n }}\n @tap-fit-size=${() => this.reset()}\n @tap-delete=${() => this.deleteSelectedShape()}\n @tap-save=${() => {\n this.dispatchEvent(\n new CustomEvent('shapes-changed', {\n detail: this.shapes,\n bubbles: true,\n composed: true\n })\n )\n }}\n ></ox-image-marker-mode>\n `\n }\n\n private setMode(mode: ImageMarkerMode, shapeType: ShapeType) {\n if (mode == 'view') {\n this.setSelectedShape(null)\n }\n\n this.currentMode = mode\n this.currentShapeType = shapeType\n }\n\n protected onSvgPinch(e: GestureEventPinch) {\n e.stopPropagation()\n\n const { scale, centerX, centerY } = e.detail\n\n this.zoom(scale, centerX, centerY)\n }\n\n protected onSvgDrag(e: GestureEventDrag) {\n const { deltaX, deltaY, end } = e.detail\n\n if (this.currentMode === 'shape') {\n this.drawShape(e)\n } else {\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n\n const scaleX = vbWidth / this.svg.clientWidth\n const scaleY = vbHeight / this.svg.clientHeight\n const scale = Math.max(scaleX, scaleY)\n\n const newVbX = vbX - deltaX * scale\n const newVbY = vbY - deltaY * scale\n\n this.viewBox = `${newVbX} ${newVbY} ${vbWidth} ${vbHeight}`\n\n this.debouncedUpdateImage()\n }\n }\n\n protected onSvgClick(e: MouseEvent) {\n if (this.currentMode === 'shape' && this.currentShapeType === 'text') {\n const { x, y } = this.getSvgPoint(e)\n\n const textElement = document.createElementNS('http://www.w3.org/2000/svg', 'text')\n\n textElement.setAttribute('x', x.toString())\n textElement.setAttribute('y', y.toString())\n textElement.textContent = 'ABC'\n\n this.svg.appendChild(textElement)\n\n /* 강제 지연은 iOS에서 input focus를 받지 못하는 현상이 있다. */\n this.showTextInput(textElement, null, { x, y })\n\n this.imageMarkerMode.setMode('edit')\n }\n }\n\n private drawShape(e: GestureEventDrag) {\n const { end } = e.detail\n const { x, y } = this.getSvgPoint(e)\n\n if (!this.drawing) {\n this.startX = x\n this.startY = y\n this.setSelectedShape(null)\n\n this.drawing = true\n } else if (this.drawing) {\n const minDistance = 5\n const distance = Math.sqrt(Math.pow(x - this.startX, 2) + Math.pow(y - this.startY, 2))\n\n if (!this.selectedShape && distance >= minDistance) {\n let newShape: Shape\n\n switch (this.currentShapeType) {\n case 'rectangle':\n newShape = {\n id: Date.now().toString(),\n type: 'rectangle',\n x: this.startX,\n y: this.startY,\n width: 0,\n height: 0\n }\n break\n case 'circle':\n newShape = {\n id: Date.now().toString(),\n type: 'circle',\n cx: this.startX,\n cy: this.startY,\n r: 0\n }\n break\n case 'triangle':\n newShape = {\n id: Date.now().toString(),\n type: 'triangle',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0,\n points: `${this.startX},${this.startY} ${this.startX},${this.startY} ${this.startX},${this.startY}`\n }\n break\n case 'line':\n newShape = {\n id: Date.now().toString(),\n type: 'line',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0\n }\n break\n case 'arrow':\n newShape = {\n id: Date.now().toString(),\n type: 'arrow',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0\n }\n break\n default:\n return\n }\n\n this.shapes = [...this.shapes, newShape]\n this.setSelectedShape(newShape)\n }\n\n if (this.selectedShape) {\n switch (this.selectedShape.type) {\n case 'rectangle':\n this.selectedShape.x = Math.min(x, this.startX)\n this.selectedShape.y = Math.min(y, this.startY)\n this.selectedShape.width = Math.abs(x - this.startX)\n this.selectedShape.height = Math.abs(y - this.startY)\n break\n case 'circle':\n const dx = x - this.selectedShape.cx!\n const dy = y - this.selectedShape.cy!\n this.selectedShape.r = Math.sqrt(dx * dx + dy * dy)\n break\n case 'triangle':\n const x2 = x\n const y2 = y\n const x3 = this.startX - (x - this.startX)\n const y3 = y\n this.selectedShape.points = `${this.startX},${this.startY} ${x2},${y2} ${x3},${y3}`\n break\n case 'line':\n case 'arrow':\n this.selectedShape.x2 = x\n this.selectedShape.y2 = y\n break\n }\n\n this.requestUpdate()\n }\n\n if (end) {\n this.drawing = false\n this.imageMarkerMode.setMode('edit')\n\n this.requestUpdate()\n }\n }\n }\n\n private setSelectedShape(shape: Shape | null) {\n this.selectedShape = shape\n\n if (!shape) {\n this.shapes = this.shapes.map(s => {\n return { ...s, selected: false }\n })\n } else {\n this.selectedShape!.selected = true\n }\n }\n\n private getSvgPoint(event: MouseEvent | PointerEvent | GestureEventDrag) {\n const { x, y } = this.getPointFromEvent(event)\n\n const svg = this.svg\n const point = svg.createSVGPoint()\n point.x = x\n point.y = y\n const ctm = svg.getScreenCTM()!.inverse()\n\n return point.matrixTransform(ctm)\n }\n\n protected renderShape(shape: Shape) {\n const commonAttrs = {\n stroke: shape.selected ? 'blue' : 'red',\n 'stroke-width': 1,\n fill: 'transparent',\n cursor: 'pointer'\n }\n\n switch (shape.type) {\n case 'text':\n return svg`\n <text\n x=\"${shape.x!}\"\n y=\"${shape.y!}\"\n fill=\"${commonAttrs.stroke}\"\n style=\"cursor: ${commonAttrs.cursor}; font-size: 16px;\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @dblclick=\"${(e: MouseEvent) => this.onTextDoubleClick(e, shape)}\"\n >${shape.text}</text>\n `\n\n case 'rectangle':\n return svg`\n <rect\n x=\"${shape.x!}\"\n y=\"${shape.y!}\"\n width=\"${shape.width!}\"\n height=\"${shape.height!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></rect>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'circle':\n return svg`\n <circle\n cx=\"${shape.cx!}\"\n cy=\"${shape.cy!}\"\n r=\"${shape.r!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></circle>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'triangle':\n return svg`\n <polygon\n points=\"${shape.points!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></polygon>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'line':\n return svg`\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n ></line>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"25\"\n stroke-opacity=\"0\"\n pointer-events=\"stroke\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @mouseenter=\"${() => (this.svg.style.cursor = 'pointer')}\"\n @mouseleave=\"${() => (this.svg.style.cursor = 'default')}\"\n ></line>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'arrow':\n return svg`\n <defs>\n <marker id=\"arrowhead-${shape.id}\" markerWidth=\"10\" markerHeight=\"7\" refX=\"10\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"${commonAttrs.stroke}\"></polygon>\n </marker>\n </defs>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n marker-end=\"url(#arrowhead-${shape.id})\"\n style=\"cursor: ${commonAttrs.cursor}\"\n ></line>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"25\"\n stroke-opacity=\"0\"\n pointer-events=\"stroke\"\n @mousedown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @mouseenter=\"${() => (this.svg.style.cursor = 'pointer')}\"\n @mouseleave=\"${() => (this.svg.style.cursor = 'default')}\"\n @pointerdown=\"${(e: PointerEvent) => this.currentMode == 'edit' && e.stopPropagation()}\"\n ></line>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'link':\n return svg`\n <rect class=\"link\" x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" \n stroke=\"${commonAttrs.stroke}\" stroke-width=\"0\" \n fill=\"${commonAttrs.stroke}\" fill-opacity=\"0.3\" @click=\"${() => this.handleLinkClick(shape)}\">\n </rect>\n `\n default:\n return nothing\n }\n }\n\n private onPointerDownOnShape(event: PointerEvent, shape: Shape) {\n if (this.currentMode !== 'edit') {\n return\n }\n\n // TODO check if single touch ... (멀티터치를 제외해야한다).\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.stopPropagation()\n event.preventDefault()\n\n this.shapes = this.shapes.map(s => ({\n ...s,\n selected: s.id === shape.id\n }))\n\n this.shapeMoveInitiated = false\n this.setSelectedShape(this.shapes.find(s => s.id == shape.id)!)\n\n const { x, y } = this.getSvgPoint(event)\n\n this.offsetX = x\n this.offsetY = y\n\n document.addEventListener('pointermove', this.onPointerMoveOnShape)\n document.addEventListener('pointerup', this.onPointerUpOnShape)\n }\n\n private onPointerMoveOnShape = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n // TODO check if single touch ... (멀티터치를 제외해야한다).\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.preventDefault()\n\n const { x, y } = this.getSvgPoint(event)\n\n const dx = x - this.offsetX\n const dy = y - this.offsetY\n\n if (!this.shapeMoveInitiated) {\n const distance = Math.sqrt(dx * dx + dy * dy)\n\n if (distance < this.shapeMoveThreshold) {\n return\n }\n\n this.shapeMoveInitiated = true\n }\n\n this.offsetX = x\n this.offsetY = y\n\n switch (this.selectedShape.type) {\n case 'text':\n case 'rectangle':\n this.selectedShape.x! += dx\n this.selectedShape.y! += dy\n break\n case 'circle':\n this.selectedShape.cx! += dx\n this.selectedShape.cy! += dy\n break\n case 'triangle':\n const points = this.selectedShape.points!.split(' ').map(p => p.split(',').map(Number))\n\n this.selectedShape.points = points.map(([px, py]) => [px + dx, py + dy].join(',')).join(' ')\n break\n case 'line':\n case 'arrow':\n this.selectedShape.x1! += dx\n this.selectedShape.x2! += dx\n this.selectedShape.y1! += dy\n this.selectedShape.y2! += dy\n break\n }\n\n this.requestUpdate()\n }\n\n private onPointerUpOnShape = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n // TODO\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.preventDefault()\n\n document.removeEventListener('pointermove', this.onPointerMoveOnShape)\n document.removeEventListener('pointerup', this.onPointerUpOnShape)\n }\n\n private renderResizeHandles(shape: Shape) {\n let handles: Array<{ x: number; y: number; cursor: string }> = []\n\n switch (shape.type) {\n case 'text':\n case 'rectangle':\n handles = [\n { x: shape.x!, y: shape.y!, cursor: 'nwse-resize' },\n { x: shape.x! + shape.width!, y: shape.y!, cursor: 'nesw-resize' },\n { x: shape.x!, y: shape.y! + shape.height!, cursor: 'nesw-resize' },\n { x: shape.x! + shape.width!, y: shape.y! + shape.height!, cursor: 'nwse-resize' }\n ]\n break\n case 'circle':\n handles = [\n { x: shape.cx! + shape.r!, y: shape.cy!, cursor: 'ew-resize' },\n { x: shape.cx! - shape.r!, y: shape.cy!, cursor: 'ew-resize' },\n { x: shape.cx!, y: shape.cy! + shape.r!, cursor: 'ns-resize' },\n { x: shape.cx!, y: shape.cy! - shape.r!, cursor: 'ns-resize' }\n ]\n break\n case 'triangle':\n const points = shape.points!.split(' ').map(p => p.split(',').map(Number))\n handles = points.map(([x, y]) => ({ x, y, cursor: 'move' }))\n break\n case 'line':\n case 'arrow':\n handles = [\n { x: shape.x1!, y: shape.y1!, cursor: 'move' },\n { x: shape.x2!, y: shape.y2!, cursor: 'move' }\n ]\n break\n }\n\n return svg`\n ${handles.map(\n handle => svg`\n <g\n class=\"resize-handle-group\"\n style=\"transform: translate(${handle.x}px, ${handle.y}px) scale(${1 / this.zoomLevel});\"\n >\n <rect\n x=\"-5\"\n y=\"-5\"\n width=\"10\"\n height=\"10\"\n fill=\"white\"\n stroke=\"black\"\n class=\"resize-handle\"\n style=\"cursor: ${handle.cursor};\"\n @pointerdown=\"${(e: PointerEvent) => this.onResizeHandlePointerDown(e, shape, handle)}\"\n ></rect>\n </g>\n `\n )}\n `\n }\n\n private onResizeHandlePointerDown(event: PointerEvent, shape: Shape, handle: any) {\n event.stopPropagation()\n event.preventDefault()\n\n this.setSelectedShape(shape)\n\n this.offsetX = handle.x\n this.offsetY = handle.y\n\n document.addEventListener('pointermove', this.onResizeHandlePointerMove)\n document.addEventListener('pointerup', this.onResizeHandlePointerUp)\n }\n\n private onResizeHandlePointerMove = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n event.preventDefault()\n\n const { x, y } = this.getSvgPoint(event)\n\n switch (this.selectedShape.type) {\n case 'rectangle':\n const startX = this.selectedShape.x!\n const startY = this.selectedShape.y!\n const width = this.selectedShape.width!\n const height = this.selectedShape.height!\n\n // 핸들의 좌표에 따라 너비 및 높이 조정\n if (this.offsetX === startX && this.offsetY === startY) {\n // 상좌 핸들 (왼쪽 위)\n this.selectedShape.x = x\n this.selectedShape.y = y\n this.selectedShape.width = width + (startX - x)\n this.selectedShape.height = height + (startY - y)\n } else if (this.offsetX === startX + width && this.offsetY === startY) {\n // 상우 핸들 (오른쪽 위)\n this.selectedShape.y = y\n this.selectedShape.width = Math.abs(x - startX)\n this.selectedShape.height = height + (startY - y)\n } else if (this.offsetX === startX && this.offsetY === startY + height) {\n // 하좌 핸들 (왼쪽 아래)\n this.selectedShape.x = x\n this.selectedShape.width = width + (startX - x)\n this.selectedShape.height = Math.abs(y - startY)\n } else if (this.offsetX === startX + width && this.offsetY === startY + height) {\n // 하우 핸들 (오른쪽 아래)\n this.selectedShape.width = Math.abs(x - startX)\n this.selectedShape.height = Math.abs(y - startY)\n }\n\n // 최소 너비 및 높이 유지\n this.selectedShape.width = Math.max(10, this.selectedShape.width!)\n this.selectedShape.height = Math.max(10, this.selectedShape.height!)\n\n this.offsetX = x\n this.offsetY = y\n\n break\n case 'circle':\n const dx = x - this.selectedShape.cx!\n const dy = y - this.selectedShape.cy!\n this.selectedShape.r = Math.sqrt(dx * dx + dy * dy)\n break\n case 'triangle':\n const points = this.selectedShape.points!.split(' ').map(p => p.split(',').map(Number))\n const index = points.findIndex(([px, py]) => px === this.offsetX && py === this.offsetY)\n if (index !== -1) {\n points[index] = [x, y]\n this.selectedShape.points = points.map(p => p.join(',')).join(' ')\n this.offsetX = x\n this.offsetY = y\n }\n break\n case 'line':\n case 'arrow':\n if (this.offsetX === this.selectedShape.x1 && this.offsetY === this.selectedShape.y1) {\n this.selectedShape.x1 = x\n this.selectedShape.y1 = y\n } else if (this.offsetX === this.selectedShape.x2 && this.offsetY === this.selectedShape.y2) {\n this.selectedShape.x2 = x\n this.selectedShape.y2 = y\n }\n this.offsetX = x\n this.offsetY = y\n break\n }\n\n this.requestUpdate()\n }\n\n private onResizeHandlePointerUp = (event: PointerEvent) => {\n event.preventDefault()\n\n document.removeEventListener('pointermove', this.onResizeHandlePointerMove)\n document.removeEventListener('pointerup', this.onResizeHandlePointerUp)\n }\n\n private onTextDoubleClick(event: MouseEvent, shape: Shape) {\n event.stopPropagation()\n event.preventDefault()\n\n const textElement = event.target as SVGTextElement\n\n this.showTextInput(textElement, shape)\n }\n\n private showTextInput(textElement: SVGTextElement, shape: Shape | null = null, options?: { x: number; y: number }) {\n const input: HTMLInputElement = document.createElement('input')\n input.style.position = 'absolute'\n\n const ctm = textElement.getScreenCTM() || { a: 1, e: 0, d: 1, f: 0 }\n const bbox = textElement.getBBox()\n\n const screenX = bbox.x * ctm.a + ctm.e\n const screenY = bbox.y * ctm.d + ctm.f\n\n input.style.left = `${screenX}px`\n input.style.top = `${screenY}px`\n\n const computedStyle = window.getComputedStyle(textElement)\n const fontSize = parseFloat(computedStyle.fontSize) * ctm.a\n const fontFamily = computedStyle.fontFamily\n const fontWeight = computedStyle.fontWeight\n const textColor = computedStyle.fill || computedStyle.color\n const lineHeight = parseFloat(computedStyle.lineHeight) * ctm.d\n\n input.style.fontSize = `${fontSize}px`\n input.style.fontFamily = fontFamily\n input.style.fontWeight = fontWeight\n input.style.color = textColor\n input.style.lineHeight = `${lineHeight}px`\n input.style.padding = '0'\n input.style.margin = '0'\n input.style.border = 'none'\n input.style.outline = 'none'\n input.style.background = 'transparent'\n\n if (shape) {\n input.value = shape.text || ''\n }\n\n textElement.style.visibility = 'hidden'\n\n document.body.appendChild(input)\n this.adjustInputWidth(input)\n\n /* iOS에서는 딜레이를 주었을 때 focus()를 받지 못하는 현상이 있으므로, delay 없이 바로 focus를 설정함. */\n input.focus()\n\n input.addEventListener('input', () => {\n this.adjustInputWidth(input)\n })\n\n input.addEventListener('keydown', e => {\n if (e.key === 'Enter') {\n const textValue = input.value.trim()\n\n if (textValue) {\n if (shape) {\n shape.text = textValue\n } else {\n const newShape: Shape = {\n id: Date.now().toString(),\n type: 'text',\n x: options!.x,\n y: options!.y,\n text: textValue\n }\n\n this.shapes = [...this.shapes, newShape]\n }\n } else if (shape) {\n this.shapes = this.shapes.filter(s => s.id !== shape.id)\n }\n\n document.body.removeChild(input)\n\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n\n this.requestUpdate()\n } else if (e.key === 'Escape') {\n document.body.removeChild(input)\n\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n }\n })\n\n input.addEventListener('blur', () => {\n requestAnimationFrame(() => {\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n\n if (input.parentElement) {\n document.body.removeChild(input)\n }\n })\n })\n }\n\n private adjustInputWidth(input: HTMLInputElement) {\n const minWidth = 50\n const textWidth = this.measureTextWidth(input.value || input.placeholder, input)\n input.style.width = `${Math.max(textWidth + 10, minWidth)}px`\n }\n\n private measureTextWidth(text: string, input: HTMLInputElement): number {\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')!\n context.font = window.getComputedStyle(input).font\n\n return context.measureText(text).width\n }\n\n private onFocus = () => {\n this.addEventListener('keydown', this.handleKeyDown)\n }\n\n private onBlur = () => {\n this.removeEventListener('keydown', this.handleKeyDown)\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if ((event.key === 'Delete' || event.key === 'Backspace') && this.selectedShape) {\n this.deleteSelectedShape()\n }\n }\n\n private deleteSelectedShape() {\n if (this.selectedShape) {\n this.shapes = this.shapes.filter(s => s.id !== this.selectedShape!.id)\n\n this.setSelectedShape(null)\n\n this.requestUpdate()\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-image-marker.js","sourceRoot":"","sources":["../../src/ox-image-marker.ts"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAA;AAElC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MA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IAAI,CAAE,CAAA;QACxC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAA;QAElD,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAA;IACxC,CAAC;IAgBO,mBAAmB;QACzB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,aAAc,CAAC,EAAE,CAAC,CAAA;YAEtE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;YAE3B,IAAI,CAAC,aAAa,EAAE,CAAA;QACtB,CAAC;IACH,CAAC;;AA1yBgB;IAAhB,KAAK,EAAE;uDAAqC;AAC5B;IAAhB,KAAK,EAAE;kDAA8C;AACrC;IAAhB,KAAK,EAAE;oDAA2C;AAEpB;IAA9B,KAAK,CAAC,sBAAsB,CAAC;sDAAoC;AAnCvD,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA00BzB","sourcesContent":["import './ox-image-marker-mode.js'\n\nimport { html, css, svg, nothing } from 'lit'\nimport { query, state, customElement } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { keyed } from 'lit/directives/keyed.js'\n\nimport { GestureEventDrag, GestureEventPinch } from '@operato/utils/gesture-helper.js'\n\nimport { ImageMarkerMode, Shape, ShapeType } from './types.js'\nimport { BaseImageMarker } from './base-image-marker.js'\nimport { OxImageMarkerMode } from './ox-image-marker-mode.js'\n\n@customElement('ox-image-marker')\nexport class OxImageMarker extends BaseImageMarker {\n static styles = [\n ...BaseImageMarker.styles,\n css`\n :host {\n position: relative;\n display: flex;\n width: 100%;\n height: 100%;\n }\n\n ox-image-marker-mode {\n position: absolute;\n top: 0;\n right: 0;\n }\n\n svg {\n cursor: default;\n }\n\n svg[drawing] {\n cursor: crosshair;\n }\n\n .resize-handle {\n cursor: nwse-resize;\n }\n `\n ]\n\n @state() private currentShapeType?: ShapeType\n @state() private currentMode: ImageMarkerMode = 'edit'\n @state() private selectedShape: Shape | null = null\n\n @query('ox-image-marker-mode') imageMarkerMode!: OxImageMarkerMode\n\n // private drawingStarted: boolean = false\n private drawing: boolean = false\n private startX: number = 0\n private startY: number = 0\n private offsetX: number = 0\n private offsetY: number = 0\n private shapeMoveThreshold: number = 10\n private shapeMoveInitiated = false\n\n connectedCallback() {\n super.connectedCallback()\n this.setAttribute('tabindex', '0')\n this.addEventListener('focus', this.onFocus)\n this.addEventListener('blur', this.onBlur)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListener('focus', this.onFocus)\n this.removeEventListener('blur', this.onBlur)\n }\n\n render() {\n return html`\n <div class=\"container\">\n <svg\n @wheel=${this.onSvgWheel}\n @doubletap=${this.onSvgDoubleTap}\n @pinch=${this.onSvgPinch}\n @drag=${this.onSvgDrag}\n @click=${this.onSvgClick}\n viewBox=${this.viewBox}\n ?drawing=${this.currentMode == 'shape'}\n >\n <image href=${this.currentImage} @load=${this.onImageLoad}></image>\n ${this.shapes.map(shape => keyed(shape.id, this.renderShape(shape)))}\n </svg>\n </div>\n\n <ox-image-marker-mode\n currentMode=${this.currentMode}\n currentShapeType=${ifDefined(this.currentShapeType)}\n @mode-changed=${(e: CustomEvent) => {\n const { mode, shapeType } = e.detail\n this.setMode(mode, shapeType)\n }}\n @tap-fit-size=${() => this.reset()}\n @tap-delete=${() => this.deleteSelectedShape()}\n @tap-save=${() => {\n this.dispatchEvent(\n new CustomEvent('shapes-changed', {\n detail: this.shapes,\n bubbles: true,\n composed: true\n })\n )\n }}\n ></ox-image-marker-mode>\n `\n }\n\n private setMode(mode: ImageMarkerMode, shapeType: ShapeType) {\n if (mode == 'view') {\n this.setSelectedShape(null)\n }\n\n this.currentMode = mode\n this.currentShapeType = shapeType\n }\n\n protected onSvgPinch(e: GestureEventPinch) {\n e.stopPropagation()\n\n const { scale, centerX, centerY } = e.detail\n\n this.zoom(scale, centerX, centerY)\n }\n\n protected onSvgDrag(e: GestureEventDrag) {\n const { deltaX, deltaY, end } = e.detail\n\n if (this.currentMode === 'shape') {\n this.drawShape(e)\n } else {\n const [vbX, vbY, vbWidth, vbHeight] = this.viewBox.split(' ').map(Number)\n\n const scaleX = vbWidth / this.svg.clientWidth\n const scaleY = vbHeight / this.svg.clientHeight\n const scale = Math.max(scaleX, scaleY)\n\n const newVbX = vbX - deltaX * scale\n const newVbY = vbY - deltaY * scale\n\n this.viewBox = `${newVbX} ${newVbY} ${vbWidth} ${vbHeight}`\n\n this.debouncedUpdateImage()\n }\n }\n\n protected onSvgClick(e: MouseEvent) {\n if (this.currentMode === 'shape' && this.currentShapeType === 'text') {\n const { x, y } = this.getSvgPoint(e)\n\n const textElement = document.createElementNS('http://www.w3.org/2000/svg', 'text')\n\n textElement.setAttribute('x', x.toString())\n textElement.setAttribute('y', y.toString())\n textElement.textContent = 'ABC'\n\n this.svg.appendChild(textElement)\n\n /* 강제 지연은 iOS에서 input focus를 받지 못하는 현상이 있다. */\n this.showTextInput(textElement, null, { x, y })\n\n this.imageMarkerMode.setMode('edit')\n }\n }\n\n private drawShape(e: GestureEventDrag) {\n const { end } = e.detail\n const { x, y } = this.getSvgPoint(e)\n\n if (!this.drawing) {\n this.startX = x\n this.startY = y\n this.setSelectedShape(null)\n\n this.drawing = true\n } else if (this.drawing) {\n const minDistance = 5\n const distance = Math.sqrt(Math.pow(x - this.startX, 2) + Math.pow(y - this.startY, 2))\n\n if (!this.selectedShape && distance >= minDistance) {\n let newShape: Shape\n\n switch (this.currentShapeType) {\n case 'rectangle':\n newShape = {\n id: Date.now().toString(),\n type: 'rectangle',\n x: this.startX,\n y: this.startY,\n width: 0,\n height: 0\n }\n break\n case 'circle':\n newShape = {\n id: Date.now().toString(),\n type: 'circle',\n cx: this.startX,\n cy: this.startY,\n r: 0\n }\n break\n case 'triangle':\n newShape = {\n id: Date.now().toString(),\n type: 'triangle',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0,\n points: `${this.startX},${this.startY} ${this.startX},${this.startY} ${this.startX},${this.startY}`\n }\n break\n case 'line':\n newShape = {\n id: Date.now().toString(),\n type: 'line',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0\n }\n break\n case 'arrow':\n newShape = {\n id: Date.now().toString(),\n type: 'arrow',\n x1: this.startX,\n y1: this.startY,\n width: 0,\n height: 0\n }\n break\n default:\n return\n }\n\n this.shapes = [...this.shapes, newShape]\n this.setSelectedShape(newShape)\n }\n\n if (this.selectedShape) {\n switch (this.selectedShape.type) {\n case 'rectangle':\n this.selectedShape.x = Math.min(x, this.startX)\n this.selectedShape.y = Math.min(y, this.startY)\n this.selectedShape.width = Math.abs(x - this.startX)\n this.selectedShape.height = Math.abs(y - this.startY)\n break\n case 'circle':\n const dx = x - this.selectedShape.cx!\n const dy = y - this.selectedShape.cy!\n this.selectedShape.r = Math.sqrt(dx * dx + dy * dy)\n break\n case 'triangle':\n const x2 = x\n const y2 = y\n const x3 = this.startX - (x - this.startX)\n const y3 = y\n this.selectedShape.points = `${this.startX},${this.startY} ${x2},${y2} ${x3},${y3}`\n break\n case 'line':\n case 'arrow':\n this.selectedShape.x2 = x\n this.selectedShape.y2 = y\n break\n }\n\n this.requestUpdate()\n }\n\n if (end) {\n this.drawing = false\n this.imageMarkerMode.setMode('edit')\n\n this.requestUpdate()\n }\n }\n }\n\n private setSelectedShape(shape: Shape | null) {\n this.selectedShape = shape\n\n if (!shape) {\n this.shapes = this.shapes.map(s => {\n return { ...s, selected: false }\n })\n } else {\n this.selectedShape!.selected = true\n }\n }\n\n private getSvgPoint(event: MouseEvent | PointerEvent | GestureEventDrag) {\n const { x, y } = this.getPointFromEvent(event)\n\n const svg = this.svg\n const point = svg.createSVGPoint()\n point.x = x\n point.y = y\n const ctm = svg.getScreenCTM()!.inverse()\n\n return point.matrixTransform(ctm)\n }\n\n protected renderShape(shape: Shape) {\n const commonAttrs = {\n stroke: shape.selected ? 'blue' : 'red',\n 'stroke-width': 1,\n fill: 'transparent',\n cursor: 'pointer'\n }\n\n switch (shape.type) {\n case 'text':\n return svg`\n <text\n x=\"${shape.x!}\"\n y=\"${shape.y!}\"\n fill=\"${commonAttrs.stroke}\"\n style=\"cursor: ${commonAttrs.cursor}; font-size: 16px;\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @dblclick=\"${(e: MouseEvent) => this.onTextDoubleClick(e, shape)}\"\n >${shape.text}</text>\n `\n\n case 'rectangle':\n return svg`\n <rect\n x=\"${shape.x!}\"\n y=\"${shape.y!}\"\n width=\"${shape.width!}\"\n height=\"${shape.height!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></rect>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'circle':\n return svg`\n <circle\n cx=\"${shape.cx!}\"\n cy=\"${shape.cy!}\"\n r=\"${shape.r!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></circle>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'triangle':\n return svg`\n <polygon\n points=\"${shape.points!}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n fill=\"${commonAttrs.fill}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n ></polygon>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'line':\n return svg`\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n style=\"cursor: ${commonAttrs.cursor}\"\n ></line>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"25\"\n stroke-opacity=\"0\"\n pointer-events=\"stroke\"\n @pointerdown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @mouseenter=\"${() => (this.svg.style.cursor = 'pointer')}\"\n @mouseleave=\"${() => (this.svg.style.cursor = 'default')}\"\n ></line>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'arrow':\n return svg`\n <defs>\n <marker id=\"arrowhead-${shape.id}\" markerWidth=\"10\" markerHeight=\"7\" refX=\"10\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"${commonAttrs.stroke}\"></polygon>\n </marker>\n </defs>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"${commonAttrs['stroke-width']}\"\n marker-end=\"url(#arrowhead-${shape.id})\"\n style=\"cursor: ${commonAttrs.cursor}\"\n ></line>\n <line\n x1=\"${shape.x1!}\"\n y1=\"${shape.y1!}\"\n x2=\"${shape.x2 ?? shape.x1}\"\n y2=\"${shape.y2 ?? shape.y1}\"\n stroke=\"${commonAttrs.stroke}\"\n stroke-width=\"25\"\n stroke-opacity=\"0\"\n pointer-events=\"stroke\"\n @mousedown=\"${(e: PointerEvent) => this.onPointerDownOnShape(e, shape)}\"\n @mouseenter=\"${() => (this.svg.style.cursor = 'pointer')}\"\n @mouseleave=\"${() => (this.svg.style.cursor = 'default')}\"\n @pointerdown=\"${(e: PointerEvent) => this.currentMode == 'edit' && e.stopPropagation()}\"\n ></line>\n ${shape.selected ? this.renderResizeHandles(shape) : ''}\n `\n\n case 'link':\n return svg`\n <rect class=\"link\" x=\"${shape.x}\" y=\"${shape.y}\" width=\"${shape.width}\" height=\"${shape.height}\" \n stroke=\"${commonAttrs.stroke}\" stroke-width=\"0\" \n fill=\"${commonAttrs.stroke}\" fill-opacity=\"0.3\" @click=\"${() => this.handleLinkClick(shape)}\">\n </rect>\n `\n default:\n return nothing\n }\n }\n\n private onPointerDownOnShape(event: PointerEvent, shape: Shape) {\n if (this.currentMode !== 'edit') {\n return\n }\n\n // TODO check if single touch ... (멀티터치를 제외해야한다).\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.stopPropagation()\n event.preventDefault()\n\n this.shapes = this.shapes.map(s => ({\n ...s,\n selected: s.id === shape.id\n }))\n\n this.shapeMoveInitiated = false\n this.setSelectedShape(this.shapes.find(s => s.id == shape.id)!)\n\n const { x, y } = this.getSvgPoint(event)\n\n this.offsetX = x\n this.offsetY = y\n\n document.addEventListener('pointermove', this.onPointerMoveOnShape)\n document.addEventListener('pointerup', this.onPointerUpOnShape)\n }\n\n private onPointerMoveOnShape = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n // TODO check if single touch ... (멀티터치를 제외해야한다).\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.preventDefault()\n\n const { x, y } = this.getSvgPoint(event)\n\n const dx = x - this.offsetX\n const dy = y - this.offsetY\n\n if (!this.shapeMoveInitiated) {\n const distance = Math.sqrt(dx * dx + dy * dy)\n\n if (distance < this.shapeMoveThreshold) {\n return\n }\n\n this.shapeMoveInitiated = true\n }\n\n this.offsetX = x\n this.offsetY = y\n\n switch (this.selectedShape.type) {\n case 'text':\n case 'rectangle':\n this.selectedShape.x! += dx\n this.selectedShape.y! += dy\n break\n case 'circle':\n this.selectedShape.cx! += dx\n this.selectedShape.cy! += dy\n break\n case 'triangle':\n const points = this.selectedShape.points!.split(' ').map(p => p.split(',').map(Number))\n\n this.selectedShape.points = points.map(([px, py]) => [px + dx, py + dy].join(',')).join(' ')\n break\n case 'line':\n case 'arrow':\n this.selectedShape.x1! += dx\n this.selectedShape.x2! += dx\n this.selectedShape.y1! += dy\n this.selectedShape.y2! += dy\n break\n }\n\n this.requestUpdate()\n }\n\n private onPointerUpOnShape = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n // TODO\n // if ('touches' in event && event.touches.length > 1) {\n // return\n // }\n\n event.preventDefault()\n\n document.removeEventListener('pointermove', this.onPointerMoveOnShape)\n document.removeEventListener('pointerup', this.onPointerUpOnShape)\n }\n\n private renderResizeHandles(shape: Shape) {\n let handles: Array<{ x: number; y: number; cursor: string }> = []\n\n switch (shape.type) {\n case 'text':\n case 'rectangle':\n handles = [\n { x: shape.x!, y: shape.y!, cursor: 'nwse-resize' },\n { x: shape.x! + shape.width!, y: shape.y!, cursor: 'nesw-resize' },\n { x: shape.x!, y: shape.y! + shape.height!, cursor: 'nesw-resize' },\n { x: shape.x! + shape.width!, y: shape.y! + shape.height!, cursor: 'nwse-resize' }\n ]\n break\n case 'circle':\n handles = [\n { x: shape.cx! + shape.r!, y: shape.cy!, cursor: 'ew-resize' },\n { x: shape.cx! - shape.r!, y: shape.cy!, cursor: 'ew-resize' },\n { x: shape.cx!, y: shape.cy! + shape.r!, cursor: 'ns-resize' },\n { x: shape.cx!, y: shape.cy! - shape.r!, cursor: 'ns-resize' }\n ]\n break\n case 'triangle':\n const points = shape.points!.split(' ').map(p => p.split(',').map(Number))\n handles = points.map(([x, y]) => ({ x, y, cursor: 'move' }))\n break\n case 'line':\n case 'arrow':\n handles = [\n { x: shape.x1!, y: shape.y1!, cursor: 'move' },\n { x: shape.x2!, y: shape.y2!, cursor: 'move' }\n ]\n break\n }\n\n return svg`\n ${handles.map(\n handle => svg`\n <g\n class=\"resize-handle-group\"\n style=\"transform: translate(${handle.x}px, ${handle.y}px) scale(${1 / this.zoomLevel});\"\n >\n <rect\n x=\"-5\"\n y=\"-5\"\n width=\"10\"\n height=\"10\"\n fill=\"white\"\n stroke=\"black\"\n class=\"resize-handle\"\n style=\"cursor: ${handle.cursor};\"\n @pointerdown=\"${(e: PointerEvent) => this.onResizeHandlePointerDown(e, shape, handle)}\"\n ></rect>\n </g>\n `\n )}\n `\n }\n\n private onResizeHandlePointerDown(event: PointerEvent, shape: Shape, handle: any) {\n event.stopPropagation()\n event.preventDefault()\n\n this.setSelectedShape(shape)\n\n this.offsetX = handle.x\n this.offsetY = handle.y\n\n document.addEventListener('pointermove', this.onResizeHandlePointerMove)\n document.addEventListener('pointerup', this.onResizeHandlePointerUp)\n }\n\n private onResizeHandlePointerMove = (event: PointerEvent) => {\n if (!this.selectedShape) {\n return\n }\n\n event.preventDefault()\n\n const { x, y } = this.getSvgPoint(event)\n\n switch (this.selectedShape.type) {\n case 'rectangle':\n const startX = this.selectedShape.x!\n const startY = this.selectedShape.y!\n const width = this.selectedShape.width!\n const height = this.selectedShape.height!\n\n // 핸들의 좌표에 따라 너비 및 높이 조정\n if (this.offsetX === startX && this.offsetY === startY) {\n // 상좌 핸들 (왼쪽 위)\n this.selectedShape.x = x\n this.selectedShape.y = y\n this.selectedShape.width = width + (startX - x)\n this.selectedShape.height = height + (startY - y)\n } else if (this.offsetX === startX + width && this.offsetY === startY) {\n // 상우 핸들 (오른쪽 위)\n this.selectedShape.y = y\n this.selectedShape.width = Math.abs(x - startX)\n this.selectedShape.height = height + (startY - y)\n } else if (this.offsetX === startX && this.offsetY === startY + height) {\n // 하좌 핸들 (왼쪽 아래)\n this.selectedShape.x = x\n this.selectedShape.width = width + (startX - x)\n this.selectedShape.height = Math.abs(y - startY)\n } else if (this.offsetX === startX + width && this.offsetY === startY + height) {\n // 하우 핸들 (오른쪽 아래)\n this.selectedShape.width = Math.abs(x - startX)\n this.selectedShape.height = Math.abs(y - startY)\n }\n\n // 최소 너비 및 높이 유지\n this.selectedShape.width = Math.max(10, this.selectedShape.width!)\n this.selectedShape.height = Math.max(10, this.selectedShape.height!)\n\n this.offsetX = x\n this.offsetY = y\n\n break\n case 'circle':\n const dx = x - this.selectedShape.cx!\n const dy = y - this.selectedShape.cy!\n this.selectedShape.r = Math.sqrt(dx * dx + dy * dy)\n break\n case 'triangle':\n const points = this.selectedShape.points!.split(' ').map(p => p.split(',').map(Number))\n const index = points.findIndex(([px, py]) => px === this.offsetX && py === this.offsetY)\n if (index !== -1) {\n points[index] = [x, y]\n this.selectedShape.points = points.map(p => p.join(',')).join(' ')\n this.offsetX = x\n this.offsetY = y\n }\n break\n case 'line':\n case 'arrow':\n if (this.offsetX === this.selectedShape.x1 && this.offsetY === this.selectedShape.y1) {\n this.selectedShape.x1 = x\n this.selectedShape.y1 = y\n } else if (this.offsetX === this.selectedShape.x2 && this.offsetY === this.selectedShape.y2) {\n this.selectedShape.x2 = x\n this.selectedShape.y2 = y\n }\n this.offsetX = x\n this.offsetY = y\n break\n }\n\n this.requestUpdate()\n }\n\n private onResizeHandlePointerUp = (event: PointerEvent) => {\n event.preventDefault()\n\n document.removeEventListener('pointermove', this.onResizeHandlePointerMove)\n document.removeEventListener('pointerup', this.onResizeHandlePointerUp)\n }\n\n private onTextDoubleClick(event: MouseEvent, shape: Shape) {\n event.stopPropagation()\n event.preventDefault()\n\n const textElement = event.target as SVGTextElement\n\n this.showTextInput(textElement, shape)\n }\n\n private showTextInput(textElement: SVGTextElement, shape: Shape | null = null, options?: { x: number; y: number }) {\n const input: HTMLInputElement = document.createElement('input')\n input.style.position = 'absolute'\n\n const ctm = textElement.getScreenCTM() || { a: 1, e: 0, d: 1, f: 0 }\n const bbox = textElement.getBBox()\n\n const screenX = bbox.x * ctm.a + ctm.e\n const screenY = bbox.y * ctm.d + ctm.f\n\n input.style.left = `${screenX}px`\n input.style.top = `${screenY}px`\n\n const computedStyle = window.getComputedStyle(textElement)\n const fontSize = parseFloat(computedStyle.fontSize) * ctm.a\n const fontFamily = computedStyle.fontFamily\n const fontWeight = computedStyle.fontWeight\n const textColor = computedStyle.fill || computedStyle.color\n const lineHeight = parseFloat(computedStyle.lineHeight) * ctm.d\n\n input.style.fontSize = `${fontSize}px`\n input.style.fontFamily = fontFamily\n input.style.fontWeight = fontWeight\n input.style.color = textColor\n input.style.lineHeight = `${lineHeight}px`\n input.style.padding = '0'\n input.style.margin = '0'\n input.style.border = 'none'\n input.style.outline = 'none'\n input.style.background = 'transparent'\n\n if (shape) {\n input.value = shape.text || ''\n }\n\n textElement.style.visibility = 'hidden'\n\n document.body.appendChild(input)\n this.adjustInputWidth(input)\n\n /* iOS에서는 딜레이를 주었을 때 focus()를 받지 못하는 현상이 있으므로, delay 없이 바로 focus를 설정함. */\n input.focus()\n\n input.addEventListener('input', () => {\n this.adjustInputWidth(input)\n })\n\n input.addEventListener('keydown', e => {\n if (e.key === 'Enter') {\n const textValue = input.value.trim()\n\n if (textValue) {\n if (shape) {\n shape.text = textValue\n } else {\n const newShape: Shape = {\n id: Date.now().toString(),\n type: 'text',\n x: options!.x,\n y: options!.y,\n text: textValue\n }\n\n this.shapes = [...this.shapes, newShape]\n }\n } else if (shape) {\n this.shapes = this.shapes.filter(s => s.id !== shape.id)\n }\n\n document.body.removeChild(input)\n\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n\n this.requestUpdate()\n } else if (e.key === 'Escape') {\n document.body.removeChild(input)\n\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n }\n })\n\n input.addEventListener('blur', () => {\n requestAnimationFrame(() => {\n if (!shape) {\n this.svg.removeChild(textElement)\n } else {\n textElement.style.visibility = 'visible'\n }\n\n if (input.parentElement) {\n document.body.removeChild(input)\n }\n })\n })\n }\n\n private adjustInputWidth(input: HTMLInputElement) {\n const minWidth = 50\n const textWidth = this.measureTextWidth(input.value || input.placeholder, input)\n input.style.width = `${Math.max(textWidth + 10, minWidth)}px`\n }\n\n private measureTextWidth(text: string, input: HTMLInputElement): number {\n const canvas = document.createElement('canvas')\n const context = canvas.getContext('2d')!\n context.font = window.getComputedStyle(input).font\n\n return context.measureText(text).width\n }\n\n private onFocus = () => {\n this.addEventListener('keydown', this.handleKeyDown)\n }\n\n private onBlur = () => {\n this.removeEventListener('keydown', this.handleKeyDown)\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if ((event.key === 'Delete' || event.key === 'Backspace') && this.selectedShape) {\n this.deleteSelectedShape()\n }\n }\n\n private deleteSelectedShape() {\n if (this.selectedShape) {\n this.shapes = this.shapes.filter(s => s.id !== this.selectedShape!.id)\n\n this.setSelectedShape(null)\n\n this.requestUpdate()\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../src/ox-image-marker-view.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles';
|
|
3
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
|
4
4
|
export default {
|
|
5
5
|
title: 'ox-image-marker-view',
|
|
6
6
|
component: 'ox-image-marker-view',
|