@aivex/ui 1.2.0-dev.57 → 1.2.0-dev.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DESIGN.md +1 -1
- package/dist/components/Coachmark/Coachmark.cjs.map +1 -1
- package/dist/components/Coachmark/Coachmark.d.cts +2 -1
- package/dist/components/Coachmark/Coachmark.d.ts +2 -1
- package/dist/components/Coachmark/Coachmark.js.map +1 -1
- package/dist/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.d.cts +2 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.cts +28 -0
- package/dist/components/Icon/index.d.ts +28 -0
- package/dist/components/Icon/index.js +280 -250
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.d.cts +4 -5
- package/dist/components/Modal/Modal.d.ts +4 -5
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.cjs +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.cjs.map +1 -1
- package/dist/components/ShapeEditor/ShapeEditor.js +406 -428
- package/dist/components/ShapeEditor/ShapeEditor.js.map +1 -1
- package/dist/components/ShapeEditor/_components/OverlayMarkers.cjs +2 -0
- package/dist/components/ShapeEditor/_components/OverlayMarkers.cjs.map +1 -0
- package/dist/components/ShapeEditor/_components/OverlayMarkers.d.cts +16 -0
- package/dist/components/ShapeEditor/_components/OverlayMarkers.d.ts +16 -0
- package/dist/components/ShapeEditor/_components/OverlayMarkers.js +41 -0
- package/dist/components/ShapeEditor/_components/OverlayMarkers.js.map +1 -0
- package/dist/components/ShapeEditor/_model/types/props.d.cts +3 -1
- package/dist/components/ShapeEditor/_model/types/props.d.ts +3 -1
- package/dist/components/ShapeEditor/_state/createInteractionController.cjs +1 -1
- package/dist/components/ShapeEditor/_state/createInteractionController.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/createInteractionController.js +4 -2
- package/dist/components/ShapeEditor/_state/createInteractionController.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useAssistant.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useAssistant.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useAssistant.d.cts +1 -0
- package/dist/components/ShapeEditor/_state/useAssistant.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useAssistant.js +81 -74
- package/dist/components/ShapeEditor/_state/useAssistant.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useDrawSession.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useDrawSession.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useDrawSession.d.cts +4 -1
- package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +4 -1
- package/dist/components/ShapeEditor/_state/useDrawSession.js +184 -164
- package/dist/components/ShapeEditor/_state/useDrawSession.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorDocument.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useEditorDocument.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.cts +7 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.d.ts +7 -0
- package/dist/components/ShapeEditor/_state/useEditorDocument.js +61 -31
- package/dist/components/ShapeEditor/_state/useEditorDocument.js.map +1 -1
- package/dist/components/ShapeEditor/_state/useSelectionModel.cjs +1 -1
- package/dist/components/ShapeEditor/_state/useSelectionModel.cjs.map +1 -1
- package/dist/components/ShapeEditor/_state/useSelectionModel.js +10 -3
- package/dist/components/ShapeEditor/_state/useSelectionModel.js.map +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +2 -1
- package/dist/components/Toast/Toast.d.ts +2 -1
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +53 -53
- package/dist/llms-full.txt +11 -11
- package/dist/llms.txt +2 -2
- package/dist/utils/dataAttributes.d.cts +7 -0
- package/dist/utils/dataAttributes.d.ts +7 -0
- package/package.json +1 -1
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { SHAPE_TYPE as e, canEditVertices as t, generateId as n, isShapeVisible as r } from "./_model/geometry.js";
|
|
4
4
|
import { mergeEditorStrings as i } from "./_model/strings.js";
|
|
5
|
-
import { TOOL as
|
|
6
|
-
import { AssistantOverlay as
|
|
7
|
-
import { ContextMenu as
|
|
8
|
-
import { CursorGuide as
|
|
9
|
-
import { ImageStateOverlay as
|
|
10
|
-
import { Minimap as
|
|
5
|
+
import { TOOL as a } from "./_model/tools.js";
|
|
6
|
+
import { AssistantOverlay as ee } from "./_components/AssistantOverlay.js";
|
|
7
|
+
import { ContextMenu as te } from "./_components/ContextMenu.js";
|
|
8
|
+
import { CursorGuide as ne } from "./_components/CursorGuide.js";
|
|
9
|
+
import { ImageStateOverlay as re } from "./_components/ImageStateOverlay.js";
|
|
10
|
+
import { Minimap as ie } from "./_components/Minimap.js";
|
|
11
|
+
import { OverlayMarkers as ae } from "./_components/OverlayMarkers.js";
|
|
11
12
|
import { SelectionInfo as oe } from "./_components/SelectionInfo.js";
|
|
12
13
|
import { createClipboardDocumentId as se } from "./_model/clipboard.js";
|
|
13
14
|
import { resolveEditorCursor as ce } from "./_model/cursors.js";
|
|
@@ -16,7 +17,7 @@ import { buildContextMenuItems as ue } from "./_state/buildContextMenuItems.js";
|
|
|
16
17
|
import { buildHotkeyActions as de } from "./_state/buildHotkeyActions.js";
|
|
17
18
|
import { createInteractionController as fe } from "./_state/createInteractionController.js";
|
|
18
19
|
import { useAssistant as pe } from "./_state/useAssistant.js";
|
|
19
|
-
import { useLatestRef as
|
|
20
|
+
import { useLatestRef as o } from "./_state/useLatestRef.js";
|
|
20
21
|
import { useDrawSession as me } from "./_state/useDrawSession.js";
|
|
21
22
|
import { useEditorDocument as he } from "./_state/useEditorDocument.js";
|
|
22
23
|
import { useEditorHandle as ge } from "./_state/useEditorHandle.js";
|
|
@@ -29,199 +30,203 @@ import { useSelectionActions as Se } from "./_state/useSelectionActions.js";
|
|
|
29
30
|
import { useSelectionInfoOverlay as Ce } from "./_state/useSelectionInfoOverlay.js";
|
|
30
31
|
import { useSelectionModel as we } from "./_state/useSelectionModel.js";
|
|
31
32
|
import { useViewportControls as Te } from "./_state/useViewportControls.js";
|
|
32
|
-
import { useCallback as
|
|
33
|
-
import { jsx as
|
|
33
|
+
import { useCallback as s, useEffect as c, useId as Ee, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
34
|
+
import { jsx as p, jsxs as De } from "react/jsx-runtime";
|
|
34
35
|
//#region src/components/ShapeEditor/ShapeEditor.tsx
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
var Oe = {
|
|
37
|
+
scale: 1,
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0
|
|
40
|
+
};
|
|
41
|
+
function m({ document: m, clipboardScope: ke, renderImageState: Ae, dimmed: je = !1, selectedIds: Me, activeTool: h, draftStyle: Ne, draftMeta: Pe, readOnly: Fe, disableMarquee: Ie, locked: g, onLockedInteraction: Le, onDrawAttemptWithoutDraft: Re, onIdleEscape: ze, overrideShapeInteraction: _, defaultViewSettings: Be, viewSettings: Ve, onViewSettingsChange: He, showMinimap: Ue = !0, minimapPosition: We = "bottom-left", showViewSettings: Ge = !0, getContextMenuItems: Ke, strings: qe, viewSettingItems: Je, canMergeSelection: Ye, brushSize: Xe = 20, zoomBound: Ze, zoomAnimationDuration: Qe = 300, decorationShapes: $e, regionMask: v, overlayMarkers: et, renderOverlayMarker: tt, onOverlayMarkerClick: nt, renderImageOverlay: rt, getSelectionLabel: it, hideSelectionLabelDot: at, formatSelectionInfo: ot, externalTools: st, assistant: ct, keymap: lt, handleRef: ut, onActiveToolChange: dt, onSelectionChange: ft, onEditingChange: pt, onShapesCreated: mt, onShapesUpdated: ht, onShapesDeleted: gt, onDrawSessionChange: _t, onDraftShapeChange: vt, onViewportChange: yt, onShapesTransformPreview: bt }) {
|
|
42
|
+
let xt = d(null), y = d(null), St = d(null), Ct = d(null), wt = d(null), Tt = `${Ee()}-minimap`, [b, Et] = f(null), [x, Dt] = f(!1), [S, Ot] = f(!1), [C, kt] = f(null), [At, jt] = f({
|
|
37
43
|
active: !1,
|
|
38
44
|
kind: "none",
|
|
39
45
|
canUndo: !1,
|
|
40
46
|
canRedo: !1
|
|
41
|
-
}), [
|
|
42
|
-
|
|
43
|
-
}, []),
|
|
44
|
-
onShapesCreated:
|
|
45
|
-
onShapesUpdated:
|
|
46
|
-
onShapesDeleted:
|
|
47
|
-
}),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
interactionControllerRef: L,
|
|
62
|
-
engineRef: b
|
|
63
|
-
}), dn = u(!1), V = u("idle"), H = u(null), U = o(() => {
|
|
64
|
-
let e = b.current;
|
|
47
|
+
}), [Mt, Nt] = f(!0), [Pt, Ft] = f(!1), w = m?.id ?? "", It = m?.imageUrl ?? "", Lt = m?.displayImageUrl, Rt = m?.coordinateSize, zt = m?.initialShapes, Bt = m?.initialSelectedIds, Vt = Lt ?? It, [Ht, Ut] = f("loading"), Wt = Ht === "loading" && m !== null && !Vt ? "missing" : Ht, [Gt, Kt] = f(null), qt = s((e, t) => {
|
|
48
|
+
Ut(e), Kt(e === "error" ? t ?? null : null);
|
|
49
|
+
}, []), T = he({
|
|
50
|
+
onShapesCreated: mt,
|
|
51
|
+
onShapesUpdated: ht,
|
|
52
|
+
onShapesDeleted: gt
|
|
53
|
+
}), Jt = u(() => new Map((st ?? []).map((e) => [e.id, e])), [st]), E = o(Jt), Yt = o(At), D = u(() => i(qe), [qe]), { seededDefaults: Xt, view: O, setView: Zt, updateView: Qt } = ve({
|
|
54
|
+
defaultViewSettings: Be,
|
|
55
|
+
viewSettings: Ve,
|
|
56
|
+
onViewSettingsChange: He
|
|
57
|
+
}), k = u(() => !b || !v ? null : le(v, b.w, b.h), [b, v]), $t = o(k), en = o(je), tn = o(b), nn = o(Rt), rn = o(Rt?.imageSize), A = o(h), j = o(Ne), an = o(Pe), on = o(Xe), sn = o(O.simplifyStrength), M = !!Fe || !!g, N = o(M), cn = o(Ie), ln = o(g), un = o(Le), dn = o(Fe), P = s((e = !0) => dn.current || !ln.current || !e ? !1 : (un.current?.(), !0), []), fn = o(Re), pn = o(_), F = o(T), I = d(null), { selectedIds: L, selRef: R, changeSelection: z } = we({
|
|
58
|
+
controlledSelectedIds: Me,
|
|
59
|
+
onSelectionChange: ft,
|
|
60
|
+
docShapes: T.shapes,
|
|
61
|
+
docRef: F,
|
|
62
|
+
overrideInteractionRef: pn,
|
|
63
|
+
interactionControllerRef: I,
|
|
64
|
+
engineRef: y
|
|
65
|
+
}), mn = d(!1), B = d("idle"), V = d(null), H = s(() => {
|
|
66
|
+
let e = y.current;
|
|
65
67
|
if (!e) return;
|
|
66
|
-
let t =
|
|
68
|
+
let t = A.current, n = E.current.get(t), r = Yt.current;
|
|
67
69
|
e.setCursor(ce({
|
|
68
70
|
tool: t,
|
|
69
71
|
externalToolCursor: n?.cursor,
|
|
70
|
-
isSpacePressed:
|
|
71
|
-
interactionMode:
|
|
72
|
-
rendererCursorHint:
|
|
72
|
+
isSpacePressed: mn.current,
|
|
73
|
+
interactionMode: B.current,
|
|
74
|
+
rendererCursorHint: V.current,
|
|
73
75
|
isPolygonDrawing: r.kind === "polygon" && r.active
|
|
74
76
|
}));
|
|
75
|
-
}, []),
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
}, []), U = s(() => {
|
|
78
|
+
B.current = "idle", V.current = null, H();
|
|
79
|
+
}, [H]), W = s((e) => {
|
|
80
|
+
B.current !== e && (B.current = e, H());
|
|
81
|
+
}, [H]), hn = s((e) => {
|
|
82
|
+
V.current !== e && (V.current = e, H());
|
|
83
|
+
}, [H]), gn = o(z), [G, K] = f(null), _n = o(s((e) => K(e), [])), vn = o(G), yn = o(yt), bn = d(null), { registerMinimapShape: xn, applyMinimapPreview: Sn, syncMinimap: q } = xe({
|
|
84
|
+
engineRef: y,
|
|
85
|
+
docRef: F,
|
|
86
|
+
overlayRef: Ct,
|
|
87
|
+
zoomLabelRef: wt,
|
|
88
|
+
minimapRectRef: St,
|
|
85
89
|
minimapSize: 204,
|
|
86
|
-
onViewportChangeRef:
|
|
87
|
-
onScreenOverlaySyncRef:
|
|
88
|
-
}),
|
|
89
|
-
engineRef:
|
|
90
|
-
docRef:
|
|
91
|
-
draftRef:
|
|
92
|
-
draftMetaRef:
|
|
93
|
-
screenOverlaySyncRef:
|
|
94
|
-
formatSelectionInfo:
|
|
95
|
-
onDraftShapeChange:
|
|
96
|
-
}),
|
|
97
|
-
|
|
90
|
+
onViewportChangeRef: yn,
|
|
91
|
+
onScreenOverlaySyncRef: bn
|
|
92
|
+
}), J = Ce({
|
|
93
|
+
engineRef: y,
|
|
94
|
+
docRef: F,
|
|
95
|
+
draftRef: j,
|
|
96
|
+
draftMetaRef: an,
|
|
97
|
+
screenOverlaySyncRef: bn,
|
|
98
|
+
formatSelectionInfo: ot,
|
|
99
|
+
onDraftShapeChange: vt
|
|
100
|
+
}), Cn = J.applyPreview, wn = o(s((e) => {
|
|
101
|
+
Sn(e), Cn(e), bt?.(e);
|
|
98
102
|
}, [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
])),
|
|
103
|
-
let r =
|
|
104
|
-
if (!r ||
|
|
103
|
+
Sn,
|
|
104
|
+
Cn,
|
|
105
|
+
bt
|
|
106
|
+
])), Tn = o(J.onDrawPreview), En = s((e, t) => {
|
|
107
|
+
let r = j.current;
|
|
108
|
+
if (!r || N.current) return;
|
|
105
109
|
let i = n();
|
|
106
|
-
|
|
110
|
+
F.current.create({
|
|
107
111
|
id: i,
|
|
108
112
|
type: e,
|
|
109
113
|
points: t,
|
|
110
114
|
style: r,
|
|
111
|
-
meta:
|
|
112
|
-
}),
|
|
113
|
-
}, [
|
|
114
|
-
toolRef:
|
|
115
|
-
selRef:
|
|
116
|
-
docRef:
|
|
117
|
-
readOnlyRef:
|
|
118
|
-
draftRef:
|
|
119
|
-
brushSizeRef:
|
|
120
|
-
simplifyEpsilonRef:
|
|
121
|
-
draftMeta:
|
|
122
|
-
engineRef:
|
|
123
|
-
onDrawSessionChange:
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
onDraftShapeChange:
|
|
127
|
-
changeSelection:
|
|
128
|
-
createShape:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
115
|
+
meta: an.current
|
|
116
|
+
}), gn.current([i]);
|
|
117
|
+
}, []), Dn = o(En), Y = me({
|
|
118
|
+
toolRef: A,
|
|
119
|
+
selRef: R,
|
|
120
|
+
docRef: F,
|
|
121
|
+
readOnlyRef: N,
|
|
122
|
+
draftRef: j,
|
|
123
|
+
brushSizeRef: on,
|
|
124
|
+
simplifyEpsilonRef: sn,
|
|
125
|
+
draftMeta: Pe,
|
|
126
|
+
engineRef: y,
|
|
127
|
+
onDrawSessionChange: s((e) => {
|
|
128
|
+
jt(e), _t?.(e);
|
|
129
|
+
}, [_t]),
|
|
130
|
+
onDraftShapeChange: vt,
|
|
131
|
+
changeSelection: z,
|
|
132
|
+
createShape: En,
|
|
133
|
+
onDrawAttemptWithoutDraft: Re
|
|
134
|
+
}), On = o(Y), { reset: kn, undoSession: An, redoSession: jn, canUndoSession: Mn, canRedoSession: Nn, handleToolChange: Pn, handleBrushSelectionChange: Fn, syncBrushTargets: In } = Y, X = pe({
|
|
135
|
+
docRef: F,
|
|
136
|
+
draftRef: j,
|
|
137
|
+
draftMeta: Pe,
|
|
138
|
+
changeSelection: z,
|
|
139
|
+
assistantRef: o(ct)
|
|
140
|
+
}), Ln = o(X), Rn = u(() => se(w), [w]), Z = Se({
|
|
141
|
+
doc: T,
|
|
142
|
+
selRef: R,
|
|
143
|
+
effectiveReadOnly: M,
|
|
144
|
+
changeSelection: z,
|
|
145
|
+
canMergeSelection: Ye,
|
|
146
|
+
clipboardDocumentId: Rn,
|
|
147
|
+
clipboardScope: ke ?? Rn
|
|
148
|
+
}), zn = u(() => ({
|
|
144
149
|
undo: () => {
|
|
145
|
-
|
|
150
|
+
N.current || An() || T.undo();
|
|
146
151
|
},
|
|
147
152
|
redo: () => {
|
|
148
|
-
|
|
153
|
+
N.current || jn() || T.redo();
|
|
149
154
|
},
|
|
150
|
-
canUndo: () =>
|
|
151
|
-
canRedo: () =>
|
|
155
|
+
canUndo: () => Mn() || T.canUndo(),
|
|
156
|
+
canRedo: () => Nn() || T.canRedo()
|
|
152
157
|
}), [
|
|
153
|
-
|
|
154
|
-
On,
|
|
155
|
-
kn,
|
|
158
|
+
T,
|
|
156
159
|
An,
|
|
157
|
-
jn
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
jn,
|
|
161
|
+
Mn,
|
|
162
|
+
Nn
|
|
163
|
+
]), { zoomToBounds: Bn, zoomToShapes: Vn, zoomToSelection: Hn, zoomAtCenter: Un } = Te({
|
|
164
|
+
engineRef: y,
|
|
165
|
+
doc: T,
|
|
166
|
+
selRef: R,
|
|
167
|
+
zoomAnimationDuration: Qe,
|
|
168
|
+
zoomBound: Ze,
|
|
164
169
|
ready: S
|
|
165
|
-
}),
|
|
170
|
+
}), Wn = o(O);
|
|
166
171
|
ge({
|
|
167
|
-
handleRef:
|
|
168
|
-
engineRef:
|
|
169
|
-
loadedImageRef:
|
|
170
|
-
regionOverlayRef:
|
|
171
|
-
viewRef:
|
|
172
|
-
doc:
|
|
173
|
-
history:
|
|
174
|
-
drawSession:
|
|
175
|
-
selection:
|
|
176
|
-
changeSelection:
|
|
177
|
-
rejectLockedEdit:
|
|
172
|
+
handleRef: ut,
|
|
173
|
+
engineRef: y,
|
|
174
|
+
loadedImageRef: tn,
|
|
175
|
+
regionOverlayRef: $t,
|
|
176
|
+
viewRef: Wn,
|
|
177
|
+
doc: T,
|
|
178
|
+
history: zn,
|
|
179
|
+
drawSession: Y,
|
|
180
|
+
selection: Z,
|
|
181
|
+
changeSelection: z,
|
|
182
|
+
rejectLockedEdit: P,
|
|
178
183
|
viewport: {
|
|
179
|
-
zoomToBounds:
|
|
180
|
-
zoomToShapes:
|
|
181
|
-
zoomToSelection:
|
|
182
|
-
zoomAtCenter:
|
|
184
|
+
zoomToBounds: Bn,
|
|
185
|
+
zoomToShapes: Vn,
|
|
186
|
+
zoomToSelection: Hn,
|
|
187
|
+
zoomAtCenter: Un
|
|
183
188
|
}
|
|
184
189
|
});
|
|
185
|
-
let
|
|
190
|
+
let Gn = o({ strokeWidth: O.strokeSize }), Kn = s(() => {
|
|
186
191
|
let e = fe({
|
|
187
|
-
engineRef:
|
|
188
|
-
toolRef:
|
|
189
|
-
externalToolMapRef:
|
|
190
|
-
spaceRef:
|
|
191
|
-
docRef:
|
|
192
|
-
renderShapesRef:
|
|
193
|
-
renderDefaultsRef:
|
|
194
|
-
selRef:
|
|
195
|
-
draftRef:
|
|
196
|
-
readOnlyRef:
|
|
197
|
-
disableMarqueeRef:
|
|
198
|
-
lockedRef:
|
|
199
|
-
onLockedInteraction: () =>
|
|
200
|
-
onDrawAttemptWithoutDraft: () =>
|
|
201
|
-
createRef:
|
|
202
|
-
selectRef:
|
|
203
|
-
enterEditRef:
|
|
204
|
-
editingIdRef:
|
|
205
|
-
drawSessionRef:
|
|
206
|
-
assistantRef:
|
|
207
|
-
setCursorHint:
|
|
208
|
-
setInteractionMode:
|
|
209
|
-
syncMinimap:
|
|
210
|
-
onTransformPreview: (e) =>
|
|
211
|
-
onDrawPreview: (e) =>
|
|
192
|
+
engineRef: y,
|
|
193
|
+
toolRef: A,
|
|
194
|
+
externalToolMapRef: E,
|
|
195
|
+
spaceRef: mn,
|
|
196
|
+
docRef: F,
|
|
197
|
+
renderShapesRef: qn,
|
|
198
|
+
renderDefaultsRef: Gn,
|
|
199
|
+
selRef: R,
|
|
200
|
+
draftRef: j,
|
|
201
|
+
readOnlyRef: N,
|
|
202
|
+
disableMarqueeRef: cn,
|
|
203
|
+
lockedRef: ln,
|
|
204
|
+
onLockedInteraction: () => un.current?.(),
|
|
205
|
+
onDrawAttemptWithoutDraft: () => fn.current?.(),
|
|
206
|
+
createRef: Dn,
|
|
207
|
+
selectRef: gn,
|
|
208
|
+
enterEditRef: _n,
|
|
209
|
+
editingIdRef: vn,
|
|
210
|
+
drawSessionRef: On,
|
|
211
|
+
assistantRef: Ln,
|
|
212
|
+
setCursorHint: hn,
|
|
213
|
+
setInteractionMode: W,
|
|
214
|
+
syncMinimap: q,
|
|
215
|
+
onTransformPreview: (e) => wn.current(e),
|
|
216
|
+
onDrawPreview: (e) => Tn.current(e)
|
|
212
217
|
});
|
|
213
|
-
return
|
|
218
|
+
return I.current = e, e;
|
|
214
219
|
}, [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
R,
|
|
221
|
+
hn,
|
|
222
|
+
W,
|
|
223
|
+
q
|
|
219
224
|
]);
|
|
220
|
-
|
|
221
|
-
|
|
225
|
+
c(() => () => {
|
|
226
|
+
I.current = null;
|
|
222
227
|
}, []);
|
|
223
|
-
let
|
|
224
|
-
let e = _ ?
|
|
228
|
+
let Q = u(() => {
|
|
229
|
+
let e = _ ? T.shapes.map((e) => {
|
|
225
230
|
let t = _(e);
|
|
226
231
|
return t ? {
|
|
227
232
|
...e,
|
|
@@ -230,8 +235,8 @@ function p({ document: p, clipboardScope: Oe, renderImageState: ke, dimmed: Ae =
|
|
|
230
235
|
...t
|
|
231
236
|
}
|
|
232
237
|
} : e;
|
|
233
|
-
}) :
|
|
234
|
-
return
|
|
238
|
+
}) : T.shapes;
|
|
239
|
+
return $e?.length ? [...$e.map((e) => ({
|
|
235
240
|
...e,
|
|
236
241
|
interaction: {
|
|
237
242
|
...e.interaction,
|
|
@@ -242,345 +247,318 @@ function p({ document: p, clipboardScope: Oe, renderImageState: ke, dimmed: Ae =
|
|
|
242
247
|
}
|
|
243
248
|
})), ...e] : e;
|
|
244
249
|
}, [
|
|
245
|
-
|
|
250
|
+
T.shapes,
|
|
246
251
|
_,
|
|
247
|
-
|
|
248
|
-
]),
|
|
252
|
+
$e
|
|
253
|
+
]), qn = o(Q);
|
|
249
254
|
ye({
|
|
250
|
-
hostRef:
|
|
251
|
-
engineRef:
|
|
252
|
-
documentId:
|
|
253
|
-
renderedImageUrl:
|
|
254
|
-
makeCallbacks:
|
|
255
|
-
viewRef:
|
|
256
|
-
readOnlyRef:
|
|
257
|
-
toolRef:
|
|
258
|
-
renderShapesRef:
|
|
259
|
-
coordinateSizeRef:
|
|
260
|
-
imageSizeRef:
|
|
261
|
-
selRef:
|
|
262
|
-
regionOverlayRef:
|
|
263
|
-
dimmedRef:
|
|
264
|
-
syncMinimap:
|
|
265
|
-
setImage:
|
|
266
|
-
setImageVisible:
|
|
267
|
-
setReady:
|
|
268
|
-
setImageStatus:
|
|
269
|
-
onContextMenuRequest:
|
|
270
|
-
}),
|
|
271
|
-
|
|
272
|
-
}, [
|
|
273
|
-
Z,
|
|
274
|
-
z,
|
|
275
|
-
K
|
|
276
|
-
]), s(() => {
|
|
277
|
-
b.current?.setSelection(R);
|
|
278
|
-
}, [R]), s(() => {
|
|
279
|
-
b.current?.setEditing(W);
|
|
280
|
-
}, [W, S]);
|
|
281
|
-
let Gn = a(dt);
|
|
282
|
-
s(() => {
|
|
283
|
-
Gn.current?.(W);
|
|
284
|
-
}, [W]), c(() => {
|
|
285
|
-
L.current?.cancelGesture(), G(null);
|
|
286
|
-
}, [m, T]), s(() => {
|
|
287
|
-
W && (R.length !== 1 || R[0] !== W) && G(null);
|
|
288
|
-
}, [R, W]), s(() => {
|
|
289
|
-
let e = b.current;
|
|
290
|
-
e && (e.setFilter(A.brightness, A.contrast), e.setRenderDefaults({ strokeWidth: A.strokeSize }), e.setImageSmoothing(A.imageSmoothing), K());
|
|
255
|
+
hostRef: xt,
|
|
256
|
+
engineRef: y,
|
|
257
|
+
documentId: w,
|
|
258
|
+
renderedImageUrl: Vt,
|
|
259
|
+
makeCallbacks: Kn,
|
|
260
|
+
viewRef: Wn,
|
|
261
|
+
readOnlyRef: N,
|
|
262
|
+
toolRef: A,
|
|
263
|
+
renderShapesRef: qn,
|
|
264
|
+
coordinateSizeRef: nn,
|
|
265
|
+
imageSizeRef: rn,
|
|
266
|
+
selRef: R,
|
|
267
|
+
regionOverlayRef: $t,
|
|
268
|
+
dimmedRef: en,
|
|
269
|
+
syncMinimap: q,
|
|
270
|
+
setImage: Et,
|
|
271
|
+
setImageVisible: Dt,
|
|
272
|
+
setReady: Ot,
|
|
273
|
+
setImageStatus: qt,
|
|
274
|
+
onContextMenuRequest: kt
|
|
275
|
+
}), c(() => {
|
|
276
|
+
y.current?.setShapes(Q, R.current), q();
|
|
291
277
|
}, [
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
A.imageSmoothing,
|
|
296
|
-
K
|
|
278
|
+
Q,
|
|
279
|
+
R,
|
|
280
|
+
q
|
|
297
281
|
]), c(() => {
|
|
298
|
-
|
|
282
|
+
y.current?.setSelection(L);
|
|
283
|
+
}, [L]), c(() => {
|
|
284
|
+
y.current?.setEditing(G);
|
|
285
|
+
}, [G, S]);
|
|
286
|
+
let Jn = o(pt);
|
|
287
|
+
c(() => {
|
|
288
|
+
Jn.current?.(G);
|
|
289
|
+
}, [G]), l(() => {
|
|
290
|
+
I.current?.cancelGesture(), K(null);
|
|
291
|
+
}, [h, w]), c(() => {
|
|
292
|
+
G && (L.length !== 1 || L[0] !== G) && K(null);
|
|
293
|
+
}, [L, G]), c(() => {
|
|
294
|
+
let e = y.current;
|
|
295
|
+
e && (e.setFilter(O.brightness, O.contrast), e.setRenderDefaults({ strokeWidth: O.strokeSize }), e.setImageSmoothing(O.imageSmoothing), q());
|
|
296
|
+
}, [
|
|
297
|
+
O.brightness,
|
|
298
|
+
O.contrast,
|
|
299
|
+
O.strokeSize,
|
|
300
|
+
O.imageSmoothing,
|
|
301
|
+
q
|
|
302
|
+
]), l(() => {
|
|
303
|
+
S && y.current?.setOverlays(O.showRegionMask ? k : null, je);
|
|
299
304
|
}, [
|
|
300
305
|
S,
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
]),
|
|
305
|
-
!S || !
|
|
306
|
+
k,
|
|
307
|
+
O.showRegionMask,
|
|
308
|
+
je
|
|
309
|
+
]), c(() => {
|
|
310
|
+
!S || !b || q();
|
|
306
311
|
}, [
|
|
307
312
|
S,
|
|
308
|
-
|
|
309
|
-
|
|
313
|
+
b,
|
|
314
|
+
O.showRegionMask,
|
|
310
315
|
v,
|
|
311
|
-
|
|
312
|
-
]),
|
|
313
|
-
S &&
|
|
316
|
+
q
|
|
317
|
+
]), c(() => {
|
|
318
|
+
S && y.current?.setTransformEnabled(!M && h !== a.BRUSH);
|
|
314
319
|
}, [
|
|
315
|
-
|
|
320
|
+
M,
|
|
316
321
|
S,
|
|
317
|
-
|
|
318
|
-
]),
|
|
319
|
-
g &&
|
|
320
|
-
}, [g])
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
s(() => {
|
|
325
|
-
Q();
|
|
326
|
-
}, [m, Q]), s(() => {
|
|
327
|
-
V.current = "idle", H.current = null, U();
|
|
328
|
-
}, [m, U]), s(() => {
|
|
329
|
-
Nn(R, P);
|
|
322
|
+
h
|
|
323
|
+
]), c(() => {
|
|
324
|
+
g && K(null);
|
|
325
|
+
}, [g]);
|
|
326
|
+
let Yn = X.finalize, Xn = X.discard;
|
|
327
|
+
c(() => {
|
|
328
|
+
Pn(h, E.current.has(h)), Yn(), U();
|
|
330
329
|
}, [
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
]),
|
|
336
|
-
|
|
330
|
+
h,
|
|
331
|
+
Pn,
|
|
332
|
+
Yn,
|
|
333
|
+
U
|
|
334
|
+
]), c(() => {
|
|
335
|
+
Fn(L, M);
|
|
336
|
+
}, [
|
|
337
|
+
L,
|
|
338
|
+
h,
|
|
339
|
+
M,
|
|
340
|
+
Fn
|
|
341
|
+
]), l(() => {
|
|
342
|
+
In();
|
|
343
|
+
}, [T.shapes, In]), c(() => {
|
|
344
|
+
S && H();
|
|
337
345
|
}, [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
346
|
+
h,
|
|
347
|
+
At,
|
|
348
|
+
Jt,
|
|
341
349
|
S,
|
|
342
|
-
|
|
350
|
+
H
|
|
343
351
|
]);
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
352
|
+
let Zn = o(Bt), $ = m !== null, Qn = $ ? w : null;
|
|
353
|
+
l(() => {
|
|
354
|
+
Xn();
|
|
355
|
+
}, [Qn, Xn]);
|
|
356
|
+
let $n = d(null);
|
|
357
|
+
c(() => {
|
|
358
|
+
let e = Qn;
|
|
359
|
+
$n.current !== e && ($n.current = e, kt(null), K(null), T.reset($ ? zt ?? [] : []), z($ ? Zn.current ?? [] : []), kn(), U());
|
|
348
360
|
}, [
|
|
361
|
+
Qn,
|
|
349
362
|
$,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
Dn,
|
|
355
|
-
Q,
|
|
363
|
+
zt,
|
|
364
|
+
T.reset,
|
|
365
|
+
z,
|
|
366
|
+
kn,
|
|
356
367
|
U
|
|
357
368
|
]), _e({
|
|
358
|
-
keymap:
|
|
359
|
-
hostRef:
|
|
369
|
+
keymap: lt,
|
|
370
|
+
hostRef: xt,
|
|
360
371
|
actions: de({
|
|
361
|
-
history:
|
|
362
|
-
selection:
|
|
363
|
-
drawSession:
|
|
364
|
-
assistant:
|
|
365
|
-
controller: () =>
|
|
366
|
-
externalTool: () =>
|
|
367
|
-
hasSelection: () =>
|
|
368
|
-
rejectLockedEdit:
|
|
369
|
-
editLocked:
|
|
370
|
-
editingId:
|
|
371
|
-
setEditingId:
|
|
372
|
+
history: zn,
|
|
373
|
+
selection: Z,
|
|
374
|
+
drawSession: Y,
|
|
375
|
+
assistant: X,
|
|
376
|
+
controller: () => I.current,
|
|
377
|
+
externalTool: () => E.current.get(A.current),
|
|
378
|
+
hasSelection: () => R.current.length > 0,
|
|
379
|
+
rejectLockedEdit: P,
|
|
380
|
+
editLocked: M,
|
|
381
|
+
editingId: G,
|
|
382
|
+
setEditingId: K,
|
|
372
383
|
vertexEditTarget: () => {
|
|
373
|
-
let e =
|
|
384
|
+
let e = R.current;
|
|
374
385
|
if (e.length !== 1) return null;
|
|
375
|
-
let n =
|
|
386
|
+
let n = F.current.getShapes().find((t) => t.id === e[0]);
|
|
376
387
|
return n && t(n) ? n.id : null;
|
|
377
388
|
},
|
|
378
|
-
deleteEditingVertices:
|
|
379
|
-
let t =
|
|
380
|
-
if (!t ||
|
|
381
|
-
let n =
|
|
389
|
+
deleteEditingVertices: s(() => {
|
|
390
|
+
let t = vn.current;
|
|
391
|
+
if (!t || N.current) return !1;
|
|
392
|
+
let n = y.current, r = new Set(n?.getVertexSelection() ?? []);
|
|
382
393
|
if (!r.size) return !1;
|
|
383
|
-
let i =
|
|
394
|
+
let i = F.current.getShapes().find((e) => e.id === t);
|
|
384
395
|
if (!i) return !1;
|
|
385
|
-
let
|
|
386
|
-
return
|
|
396
|
+
let a = i.points.filter((e, t) => !r.has(t)), ee = i.type === e.LINE ? 2 : 3;
|
|
397
|
+
return a.length < ee ? !1 : (F.current.update([{
|
|
387
398
|
...i,
|
|
388
|
-
points:
|
|
399
|
+
points: a
|
|
389
400
|
}]), n?.setVertexSelection([]), !0);
|
|
390
|
-
}, [
|
|
391
|
-
zoomAtCenter:
|
|
392
|
-
zoom100: () =>
|
|
393
|
-
zoomFit: () =>
|
|
394
|
-
toggleMinimap: () =>
|
|
395
|
-
toggleCursorGuide: () =>
|
|
401
|
+
}, []),
|
|
402
|
+
zoomAtCenter: Un,
|
|
403
|
+
zoom100: () => y.current?.zoom100(),
|
|
404
|
+
zoomFit: () => y.current?.fit(),
|
|
405
|
+
toggleMinimap: () => Nt((e) => !e),
|
|
406
|
+
toggleCursorGuide: () => Zt((e) => ({
|
|
396
407
|
...e,
|
|
397
408
|
showCursorGuide: !e.showCursorGuide
|
|
398
409
|
})),
|
|
399
|
-
togglePixelation: () =>
|
|
410
|
+
togglePixelation: () => Zt((e) => ({
|
|
400
411
|
...e,
|
|
401
412
|
imageSmoothing: !e.imageSmoothing
|
|
402
413
|
})),
|
|
403
|
-
selectTool: (e) =>
|
|
404
|
-
onIdleEscape:
|
|
414
|
+
selectTool: (e) => dt?.(e),
|
|
415
|
+
onIdleEscape: ze
|
|
405
416
|
}),
|
|
406
|
-
spaceRef:
|
|
417
|
+
spaceRef: mn,
|
|
407
418
|
onSpaceDown: () => {
|
|
408
|
-
|
|
419
|
+
y.current?.setPanMode(!0), H();
|
|
409
420
|
},
|
|
410
421
|
onSpaceUp: () => {
|
|
411
|
-
|
|
422
|
+
y.current?.setPanMode(!1), B.current === "panning" ? W("idle") : H();
|
|
412
423
|
},
|
|
413
|
-
nudge: (e, t) =>
|
|
424
|
+
nudge: (e, t) => P(Z.getEditableSelection().length > 0) || Z.nudgeSelection(e, t)
|
|
414
425
|
});
|
|
415
|
-
let
|
|
416
|
-
strings:
|
|
426
|
+
let er = u(() => Q.filter((e) => L.includes(e.id) && r(e)), [Q, L]), tr = u(() => J.drawPreviewShape ? [...er, J.drawPreviewShape] : er, [er, J.drawPreviewShape]), nr = C ? ue({
|
|
427
|
+
strings: D.contextMenu,
|
|
417
428
|
point: C.img,
|
|
418
|
-
shapes:
|
|
419
|
-
selectedIds:
|
|
420
|
-
hostReadOnly: !!
|
|
421
|
-
editLocked:
|
|
422
|
-
selection:
|
|
423
|
-
canMergeSelection:
|
|
424
|
-
history:
|
|
425
|
-
enterVertexEdit:
|
|
426
|
-
zoomToSelection:
|
|
427
|
-
refineShape:
|
|
428
|
-
}) : [],
|
|
429
|
-
selectedIds:
|
|
430
|
-
readOnly:
|
|
431
|
-
}) :
|
|
432
|
-
engineRef:
|
|
433
|
-
image:
|
|
434
|
-
wheelZoom:
|
|
429
|
+
shapes: T.shapes,
|
|
430
|
+
selectedIds: L,
|
|
431
|
+
hostReadOnly: !!Fe,
|
|
432
|
+
editLocked: M,
|
|
433
|
+
selection: Z,
|
|
434
|
+
canMergeSelection: Ye,
|
|
435
|
+
history: zn,
|
|
436
|
+
enterVertexEdit: K,
|
|
437
|
+
zoomToSelection: Hn,
|
|
438
|
+
refineShape: ct ? X.refineShape : void 0
|
|
439
|
+
}) : [], rr = C && Ke ? Ke(nr, {
|
|
440
|
+
selectedIds: L,
|
|
441
|
+
readOnly: M
|
|
442
|
+
}) : nr, ir = be({
|
|
443
|
+
engineRef: y,
|
|
444
|
+
image: b,
|
|
445
|
+
wheelZoom: O.wheelZoom,
|
|
435
446
|
minimapSize: 204
|
|
436
|
-
}),
|
|
437
|
-
|
|
438
|
-
}, []),
|
|
439
|
-
|
|
440
|
-
}, []),
|
|
441
|
-
|
|
442
|
-
}, []),
|
|
443
|
-
|
|
447
|
+
}), ar = y.current?.viewport ?? Oe, or = s(() => {
|
|
448
|
+
y.current?.zoom100();
|
|
449
|
+
}, []), sr = s(() => {
|
|
450
|
+
Nt((e) => !e);
|
|
451
|
+
}, []), cr = s(() => {
|
|
452
|
+
Ft((e) => !e);
|
|
453
|
+
}, []), lr = s(() => {
|
|
454
|
+
Ft(!1);
|
|
444
455
|
}, []);
|
|
445
456
|
return /* @__PURE__ */ De("div", {
|
|
446
457
|
className: "aivex:relative aivex:h-full aivex:w-full aivex:overflow-hidden aivex:bg-black",
|
|
447
458
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
449
|
-
ref:
|
|
459
|
+
/* @__PURE__ */ p("div", {
|
|
460
|
+
ref: xt,
|
|
450
461
|
role: "application",
|
|
451
|
-
"aria-label":
|
|
462
|
+
"aria-label": D.canvasLabel,
|
|
452
463
|
tabIndex: 0,
|
|
453
464
|
onPointerDownCapture: (e) => e.currentTarget.focus({ preventScroll: !0 }),
|
|
454
465
|
className: "aivex:h-full aivex:w-full",
|
|
455
466
|
style: {
|
|
456
|
-
opacity: +!!
|
|
457
|
-
transition:
|
|
467
|
+
opacity: +!!x,
|
|
468
|
+
transition: x ? "opacity 0.3s ease" : "none"
|
|
458
469
|
}
|
|
459
470
|
}),
|
|
460
|
-
|
|
461
|
-
status:
|
|
462
|
-
error:
|
|
463
|
-
render:
|
|
464
|
-
loadingLabel:
|
|
465
|
-
missingLabel:
|
|
466
|
-
errorLabel:
|
|
467
|
-
errorActions:
|
|
468
|
-
errorHints:
|
|
471
|
+
Wt !== "ready" && /* @__PURE__ */ p(re, {
|
|
472
|
+
status: Wt,
|
|
473
|
+
error: Gt,
|
|
474
|
+
render: Ae,
|
|
475
|
+
loadingLabel: D.imageLoading,
|
|
476
|
+
missingLabel: D.imageMissing,
|
|
477
|
+
errorLabel: D.imageLoadError,
|
|
478
|
+
errorActions: D.imageErrorActions,
|
|
479
|
+
errorHints: D.imageErrorHints
|
|
469
480
|
}),
|
|
470
|
-
S &&
|
|
481
|
+
S && b && /* @__PURE__ */ De("div", {
|
|
471
482
|
className: "aivex:pointer-events-none aivex:absolute aivex:inset-0 aivex:overflow-hidden",
|
|
472
|
-
children: [
|
|
483
|
+
children: [tr.length > 0 && /* @__PURE__ */ p("div", {
|
|
473
484
|
className: "aivex:absolute aivex:inset-0",
|
|
474
|
-
children: /* @__PURE__ */
|
|
475
|
-
shapes:
|
|
476
|
-
getLabel:
|
|
477
|
-
hideDot:
|
|
478
|
-
formatInfo:
|
|
479
|
-
register:
|
|
480
|
-
viewport:
|
|
481
|
-
scale: 1,
|
|
482
|
-
x: 0,
|
|
483
|
-
y: 0
|
|
484
|
-
}
|
|
485
|
+
children: /* @__PURE__ */ p(oe, {
|
|
486
|
+
shapes: tr,
|
|
487
|
+
getLabel: it,
|
|
488
|
+
hideDot: at,
|
|
489
|
+
formatInfo: ot,
|
|
490
|
+
register: J.register,
|
|
491
|
+
viewport: ar
|
|
485
492
|
})
|
|
486
493
|
}), /* @__PURE__ */ De("div", {
|
|
487
|
-
ref:
|
|
494
|
+
ref: Ct,
|
|
488
495
|
style: {
|
|
489
496
|
position: "absolute",
|
|
490
497
|
top: 0,
|
|
491
498
|
left: 0,
|
|
492
|
-
width:
|
|
493
|
-
height:
|
|
499
|
+
width: b.w,
|
|
500
|
+
height: b.h,
|
|
494
501
|
transformOrigin: "0 0"
|
|
495
502
|
},
|
|
496
503
|
children: [
|
|
497
|
-
!!
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
height: x.h,
|
|
504
|
-
pointerEvents: "none"
|
|
505
|
-
},
|
|
506
|
-
children: Qe.map((e) => /* @__PURE__ */ f("div", {
|
|
507
|
-
role: e.disabled ? void 0 : "button",
|
|
508
|
-
tabIndex: e.disabled ? void 0 : 0,
|
|
509
|
-
"aria-pressed": e.selected || void 0,
|
|
510
|
-
onClick: (t) => {
|
|
511
|
-
t.stopPropagation(), e.disabled || et?.(e);
|
|
512
|
-
},
|
|
513
|
-
onKeyDown: (t) => {
|
|
514
|
-
e.disabled || t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), et?.(e));
|
|
515
|
-
},
|
|
516
|
-
style: {
|
|
517
|
-
position: "absolute",
|
|
518
|
-
left: e.point.x,
|
|
519
|
-
top: e.point.y,
|
|
520
|
-
transform: e.anchor === "topLeft" ? "scale(var(--editor-overlay-inverse-scale, 1))" : "translate(-50%, -50%) scale(var(--editor-overlay-inverse-scale, 1))",
|
|
521
|
-
transformOrigin: e.anchor === "topLeft" ? "0 0" : "center",
|
|
522
|
-
zIndex: e.selected ? 1 : void 0,
|
|
523
|
-
pointerEvents: e.disabled ? "none" : "auto",
|
|
524
|
-
cursor: e.disabled ? "default" : "pointer"
|
|
525
|
-
},
|
|
526
|
-
children: $e(e)
|
|
527
|
-
}, e.id))
|
|
504
|
+
!!et?.length && tt && /* @__PURE__ */ p(ae, {
|
|
505
|
+
markers: et,
|
|
506
|
+
width: b.w,
|
|
507
|
+
height: b.h,
|
|
508
|
+
render: tt,
|
|
509
|
+
onClick: nt
|
|
528
510
|
}),
|
|
529
|
-
|
|
530
|
-
image:
|
|
531
|
-
viewport:
|
|
532
|
-
scale: 1,
|
|
533
|
-
x: 0,
|
|
534
|
-
y: 0
|
|
535
|
-
}
|
|
511
|
+
rt?.({
|
|
512
|
+
image: b,
|
|
513
|
+
viewport: ar
|
|
536
514
|
}),
|
|
537
|
-
|
|
538
|
-
image:
|
|
539
|
-
points:
|
|
540
|
-
boxes:
|
|
541
|
-
status:
|
|
515
|
+
ct && (X.status === "loading" || X.boxes.length > 0) && /* @__PURE__ */ p(ee, {
|
|
516
|
+
image: b,
|
|
517
|
+
points: X.points,
|
|
518
|
+
boxes: X.boxes,
|
|
519
|
+
status: X.status
|
|
542
520
|
})
|
|
543
521
|
]
|
|
544
522
|
})]
|
|
545
523
|
}),
|
|
546
|
-
S &&
|
|
547
|
-
|
|
548
|
-
image:
|
|
549
|
-
imageUrl:
|
|
550
|
-
imageVisible:
|
|
524
|
+
S && O.showCursorGuide && /* @__PURE__ */ p(ne, { color: "#1e88e5" }),
|
|
525
|
+
b && Ue && /* @__PURE__ */ p(ie, {
|
|
526
|
+
image: b,
|
|
527
|
+
imageUrl: Vt,
|
|
528
|
+
imageVisible: x,
|
|
551
529
|
loading: !S,
|
|
552
|
-
region:
|
|
553
|
-
roiMaskId:
|
|
554
|
-
shapes:
|
|
555
|
-
view:
|
|
556
|
-
viewDefaults:
|
|
557
|
-
onChangeView:
|
|
558
|
-
nav:
|
|
559
|
-
registerShape:
|
|
560
|
-
rectRef:
|
|
561
|
-
zoomLabelRef:
|
|
562
|
-
onZoom100:
|
|
563
|
-
open:
|
|
564
|
-
onToggleOpen:
|
|
565
|
-
position:
|
|
566
|
-
labels:
|
|
567
|
-
settingsLabels:
|
|
568
|
-
settingsItems:
|
|
569
|
-
showSettings:
|
|
570
|
-
settingsOpen:
|
|
571
|
-
onToggleSettings:
|
|
572
|
-
onCloseSettings:
|
|
530
|
+
region: k,
|
|
531
|
+
roiMaskId: Tt,
|
|
532
|
+
shapes: Q,
|
|
533
|
+
view: O,
|
|
534
|
+
viewDefaults: Xt,
|
|
535
|
+
onChangeView: Qt,
|
|
536
|
+
nav: ir,
|
|
537
|
+
registerShape: xn,
|
|
538
|
+
rectRef: St,
|
|
539
|
+
zoomLabelRef: wt,
|
|
540
|
+
onZoom100: or,
|
|
541
|
+
open: Mt,
|
|
542
|
+
onToggleOpen: sr,
|
|
543
|
+
position: We,
|
|
544
|
+
labels: D.minimap,
|
|
545
|
+
settingsLabels: D.viewSettings,
|
|
546
|
+
settingsItems: Je,
|
|
547
|
+
showSettings: Ge,
|
|
548
|
+
settingsOpen: Pt,
|
|
549
|
+
onToggleSettings: cr,
|
|
550
|
+
onCloseSettings: lr
|
|
573
551
|
}),
|
|
574
|
-
C && /* @__PURE__ */
|
|
552
|
+
C && /* @__PURE__ */ p(te, {
|
|
575
553
|
x: C.x,
|
|
576
554
|
y: C.y,
|
|
577
|
-
items:
|
|
578
|
-
onClose: () =>
|
|
555
|
+
items: rr,
|
|
556
|
+
onClose: () => kt(null)
|
|
579
557
|
})
|
|
580
558
|
]
|
|
581
559
|
});
|
|
582
560
|
}
|
|
583
561
|
//#endregion
|
|
584
|
-
export {
|
|
562
|
+
export { m as ShapeEditor };
|
|
585
563
|
|
|
586
564
|
//# sourceMappingURL=ShapeEditor.js.map
|