@knotx/plugins-minimap 0.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 格桑
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ Install
2
+
3
+ ```bash
4
+ pnpm add interactjs @knotx/plugins-canvas @knotx/core @knotx/decorators @knotx/utils
5
+ ```
6
+
7
+ Usage
8
+
9
+ ```tsx
10
+ import { Minimap } from '@knotx/plugins-minimap'
11
+ ```
package/dist/index.cjs ADDED
@@ -0,0 +1,527 @@
1
+ 'use strict';
2
+
3
+ const jsxRuntime = require('@knotx/jsx/jsx-runtime');
4
+ const core = require('@knotx/core');
5
+ const decorators = require('@knotx/decorators');
6
+ const interact = require('interactjs');
7
+ const rxjs = require('rxjs');
8
+ const operators = require('rxjs/operators');
9
+
10
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
11
+
12
+ const interact__default = /*#__PURE__*/_interopDefaultCompat(interact);
13
+
14
+ var __create = Object.create;
15
+ var __defProp = Object.defineProperty;
16
+ var __defProps = Object.defineProperties;
17
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
18
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
19
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
20
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
21
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
22
+ var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
23
+ var __typeError = (msg) => {
24
+ throw TypeError(msg);
25
+ };
26
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
27
+ var __spreadValues = (a, b) => {
28
+ for (var prop in b || (b = {}))
29
+ if (__hasOwnProp.call(b, prop))
30
+ __defNormalProp(a, prop, b[prop]);
31
+ if (__getOwnPropSymbols)
32
+ for (var prop of __getOwnPropSymbols(b)) {
33
+ if (__propIsEnum.call(b, prop))
34
+ __defNormalProp(a, prop, b[prop]);
35
+ }
36
+ return a;
37
+ };
38
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
39
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
40
+ var __decoratorStart = (base) => {
41
+ var _a2;
42
+ return [, , , __create((_a2 = base == null ? void 0 : base[__knownSymbol("metadata")]) != null ? _a2 : null)];
43
+ };
44
+ var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
45
+ var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
46
+ var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
47
+ var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
48
+ var __runInitializers = (array, flags, self, value) => {
49
+ for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
50
+ return value;
51
+ };
52
+ var __decorateElement = (array, flags, name, decorators, target, extra) => {
53
+ var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
54
+ var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
55
+ var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
56
+ var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
57
+ return __privateGet(this, extra);
58
+ }, set [name](x) {
59
+ return __privateSet(this, extra, x);
60
+ } }, name));
61
+ k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
62
+ for (var i = decorators.length - 1; i >= 0; i--) {
63
+ ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
64
+ if (k) {
65
+ ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
66
+ if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
67
+ if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
68
+ }
69
+ it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
70
+ if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
71
+ else if (typeof it !== "object" || it === null) __typeError("Object expected");
72
+ else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
73
+ }
74
+ return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
75
+ };
76
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
77
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
78
+ var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
79
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
80
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
81
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
82
+ var _render_dec, _destroy_dec, _init_dec, _nodes_dec, _canvasRef_dec, _transform_dec, _container_dec, _a, _init;
83
+ const defaultProps = {
84
+ width: 200,
85
+ height: 150,
86
+ maskColor: "rgba(240, 240, 240, 0.6)",
87
+ viewBoxColor: "#4752E6",
88
+ showControls: true,
89
+ zoomable: true,
90
+ pannable: true,
91
+ padding: 12,
92
+ nodeBorderRadius: 2,
93
+ nodeStrokeWidth: 1,
94
+ zoomStep: 0.2
95
+ };
96
+ function getNodesBounds(nodes) {
97
+ var _a2, _b;
98
+ if (!nodes.length)
99
+ return { x: 0, y: 0, width: 0, height: 0 };
100
+ let minX = Infinity;
101
+ let minY = Infinity;
102
+ let maxX = -Infinity;
103
+ let maxY = -Infinity;
104
+ for (const node of nodes) {
105
+ const { x, y } = node.position;
106
+ const width = ((_a2 = node.measured) == null ? void 0 : _a2.width) || 0;
107
+ const height = ((_b = node.measured) == null ? void 0 : _b.height) || 0;
108
+ minX = Math.min(minX, x);
109
+ minY = Math.min(minY, y);
110
+ maxX = Math.max(maxX, x + width);
111
+ maxY = Math.max(maxY, y + height);
112
+ }
113
+ return {
114
+ x: minX,
115
+ y: minY,
116
+ width: maxX - minX,
117
+ height: maxY - minY
118
+ };
119
+ }
120
+ function getBoundsOfRects(bounds1, bounds2) {
121
+ const minX = Math.min(bounds1.x, bounds2.x);
122
+ const minY = Math.min(bounds1.y, bounds2.y);
123
+ const maxX = Math.max(bounds1.x + bounds1.width, bounds2.x + bounds2.width);
124
+ const maxY = Math.max(bounds1.y + bounds1.height, bounds2.y + bounds2.height);
125
+ return {
126
+ x: minX,
127
+ y: minY,
128
+ width: maxX - minX,
129
+ height: maxY - minY
130
+ };
131
+ }
132
+ class Minimap extends (_a = core.BasePlugin, _container_dec = [decorators.inject.container()], _transform_dec = [decorators.inject.canvas.transform()], _canvasRef_dec = [decorators.inject.canvas.ref()], _nodes_dec = [decorators.inject.nodes()], _init_dec = [decorators.OnInit], _destroy_dec = [decorators.OnDestroy], _render_dec = [decorators.panel("right-bottom")], _a) {
133
+ constructor(props = {}) {
134
+ super();
135
+ this.props = props;
136
+ __runInitializers(_init, 5, this);
137
+ __publicField(this, "name", "minimap");
138
+ __publicField(this, "options");
139
+ __publicField(this, "subscription");
140
+ __publicField(this, "currentInteractable");
141
+ __publicField(this, "dragStart$", new rxjs.Subject());
142
+ __publicField(this, "dragMove$", new rxjs.Subject());
143
+ __publicField(this, "dragEnd$", new rxjs.Subject());
144
+ __publicField(this, "container", __runInitializers(_init, 8, this)), __runInitializers(_init, 11, this);
145
+ __publicField(this, "transform", __runInitializers(_init, 12, this)), __runInitializers(_init, 15, this);
146
+ __publicField(this, "canvasRef", __runInitializers(_init, 16, this)), __runInitializers(_init, 19, this);
147
+ __publicField(this, "nodes", __runInitializers(_init, 20, this)), __runInitializers(_init, 23, this);
148
+ /**
149
+ * 处理小地图上的点击事件,移动视图
150
+ */
151
+ __publicField(this, "handleMinimapClick", (event) => {
152
+ if (!this.options.pannable || !this.canvasRef)
153
+ return;
154
+ const svg = event.currentTarget;
155
+ const svgRect = svg.getBoundingClientRect();
156
+ const { left, top } = svgRect;
157
+ const svgPoint = {
158
+ x: event.clientX - left,
159
+ y: event.clientY - top
160
+ };
161
+ const { pointX, pointY } = this.getSvgToGraphCoordinates(svgPoint, svgRect);
162
+ const { scale } = this.transform;
163
+ const newPositionX = -pointX * scale + this.container.width / 2;
164
+ const newPositionY = -pointY * scale + this.container.height / 2;
165
+ this.canvasRef.setTransform(newPositionX, newPositionY, scale, 300);
166
+ });
167
+ /**
168
+ * 处理缩放按钮点击事件
169
+ */
170
+ __publicField(this, "handleZoom", (isZoomIn) => {
171
+ if (!this.options.zoomable || !this.canvasRef)
172
+ return;
173
+ const step = this.options.zoomStep;
174
+ if (isZoomIn) {
175
+ this.canvasRef.zoomIn(step, 300);
176
+ } else {
177
+ this.canvasRef.zoomOut(step, 300);
178
+ }
179
+ });
180
+ /**
181
+ * 重置视图
182
+ */
183
+ __publicField(this, "handleReset", () => {
184
+ if (!this.canvasRef)
185
+ return;
186
+ this.canvasRef.resetTransform(300);
187
+ });
188
+ this.options = __spreadProps(__spreadValues(__spreadValues({}, defaultProps), props), {
189
+ nodeColor: props.nodeColor || "#AB7BFE",
190
+ nodeStrokeColor: props.nodeStrokeColor || "transparent"
191
+ });
192
+ }
193
+ get classNames() {
194
+ return {
195
+ wrapper: core.bem(this.name, "wrapper"),
196
+ svg: core.bem(this.name, "svg"),
197
+ viewBox: core.bem(this.name, "view-box"),
198
+ mask: core.bem(this.name, "mask"),
199
+ node: core.bem(this.name, "node"),
200
+ control: core.bem(this.name, "control"),
201
+ zoomIn: core.bem(this.name, "zoom-in"),
202
+ zoomOut: core.bem(this.name, "zoom-out"),
203
+ reset: core.bem(this.name, "reset")
204
+ };
205
+ }
206
+ /**
207
+ * 计算视图变换和缩放
208
+ */
209
+ getViewTransform() {
210
+ const nodesBounds = getNodesBounds(this.nodes);
211
+ const viewRect = {
212
+ x: -this.transform.positionX / this.transform.scale,
213
+ y: -this.transform.positionY / this.transform.scale,
214
+ width: this.container.width / this.transform.scale,
215
+ height: this.container.height / this.transform.scale
216
+ };
217
+ const boundingRect = this.nodes.length > 0 ? getBoundsOfRects(nodesBounds, viewRect) : viewRect;
218
+ const { width: elementWidth, height: elementHeight } = this.options;
219
+ const scaledWidth = boundingRect.width / elementWidth;
220
+ const scaledHeight = boundingRect.height / elementHeight;
221
+ const viewScale = Math.max(scaledWidth, scaledHeight, 0.1);
222
+ const viewWidth = viewScale * elementWidth;
223
+ const viewHeight = viewScale * elementHeight;
224
+ const offset = this.options.padding * viewScale;
225
+ const x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;
226
+ const y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;
227
+ const width = viewWidth + offset * 2;
228
+ const height = viewHeight + offset * 2;
229
+ return {
230
+ viewRect,
231
+ boundingRect,
232
+ offset,
233
+ viewBox: `${x} ${y} ${width} ${height}`,
234
+ viewScale,
235
+ x,
236
+ y,
237
+ width,
238
+ height
239
+ };
240
+ }
241
+ /**
242
+ * 计算节点颜色
243
+ */
244
+ getNodeColor(node) {
245
+ const { nodeColor } = this.options;
246
+ return typeof nodeColor === "function" ? nodeColor(node) : nodeColor;
247
+ }
248
+ /**
249
+ * 计算节点边框颜色
250
+ */
251
+ getNodeStrokeColor(node) {
252
+ const { nodeStrokeColor } = this.options;
253
+ return typeof nodeStrokeColor === "function" ? nodeStrokeColor(node) : nodeStrokeColor;
254
+ }
255
+ /**
256
+ * 从SVG坐标转换为流程图坐标
257
+ */
258
+ getSvgToGraphCoordinates(svgPoint, svgRect) {
259
+ const transform = this.getViewTransform();
260
+ const relativeX = svgPoint.x / svgRect.width;
261
+ const relativeY = svgPoint.y / svgRect.height;
262
+ const pointX = transform.x + relativeX * transform.width;
263
+ const pointY = transform.y + relativeY * transform.height;
264
+ return { pointX, pointY };
265
+ }
266
+ init() {
267
+ this.setupDragStream();
268
+ this.setupInteractable();
269
+ }
270
+ /**
271
+ * 设置拖拽流
272
+ */
273
+ setupDragStream() {
274
+ this.subscription = this.dragStart$.pipe(
275
+ // 对每次拖拽开始事件,创建一个新的拖拽流程
276
+ operators.switchMap((startEvent) => {
277
+ const { startPositionX, startPositionY } = startEvent;
278
+ const viewTransform = this.getViewTransform();
279
+ const moveFactorX = this.transform.scale / viewTransform.viewScale;
280
+ const moveFactorY = this.transform.scale / viewTransform.viewScale;
281
+ let newPositionX = startPositionX;
282
+ let newPositionY = startPositionY;
283
+ return this.dragMove$.pipe(
284
+ // 计算新的位置
285
+ operators.map((moveEvent) => {
286
+ const deltaX = moveEvent.dx / moveFactorX;
287
+ const deltaY = moveEvent.dy / moveFactorY;
288
+ newPositionX -= deltaX;
289
+ newPositionY -= deltaY;
290
+ return { newPositionX, newPositionY };
291
+ }),
292
+ // 实时更新位置
293
+ operators.tap(({ newPositionX: newPositionX2, newPositionY: newPositionY2 }) => {
294
+ if (!this.canvasRef)
295
+ return;
296
+ this.canvasRef.setTransform(newPositionX2, newPositionY2, this.transform.scale, 0);
297
+ }),
298
+ // 直到拖拽结束
299
+ operators.takeUntil(this.dragEnd$)
300
+ );
301
+ })
302
+ ).subscribe();
303
+ }
304
+ /**
305
+ * 初始化 interact.js 的拖拽功能
306
+ */
307
+ setupInteractable() {
308
+ if (this.currentInteractable)
309
+ return;
310
+ this.currentInteractable = interact__default(`.${this.classNames.viewBox}[data-plugin-id="${this.pluginId}"]`).draggable({
311
+ listeners: {
312
+ // 开始拖拽时,记录初始状态
313
+ start: (event) => {
314
+ if (!this.canvasRef)
315
+ return;
316
+ this.dragStart$.next({
317
+ x: event.clientX,
318
+ y: event.clientY,
319
+ startPositionX: this.transform.positionX,
320
+ startPositionY: this.transform.positionY
321
+ });
322
+ },
323
+ // 拖拽过程中,发送位移信息
324
+ move: (event) => {
325
+ this.dragMove$.next({
326
+ dx: event.dx,
327
+ dy: event.dy
328
+ });
329
+ },
330
+ // 拖拽结束
331
+ end: () => {
332
+ this.dragEnd$.next();
333
+ }
334
+ },
335
+ cursorChecker: () => "move"
336
+ });
337
+ }
338
+ destroy() {
339
+ var _a2, _b;
340
+ (_a2 = this.subscription) == null ? void 0 : _a2.unsubscribe();
341
+ (_b = this.currentInteractable) == null ? void 0 : _b.unset();
342
+ this.dragStart$.complete();
343
+ this.dragMove$.complete();
344
+ this.dragEnd$.complete();
345
+ }
346
+ render() {
347
+ const { wrapper, svg, mask, control, zoomIn, zoomOut, reset, viewBox } = this.classNames;
348
+ const { width, height, viewBoxColor, maskColor, showControls, nodeBorderRadius, nodeStrokeWidth } = this.options;
349
+ const container = core.use(() => this.container);
350
+ const transform = core.use(() => this.transform);
351
+ const nodes = core.use(() => this.nodes);
352
+ if (!container || !transform)
353
+ return null;
354
+ const viewTransform = this.getViewTransform();
355
+ const { viewBox: viewBoxAttr, viewRect } = viewTransform;
356
+ return /* @__PURE__ */ jsxRuntime.jsxs(
357
+ "div",
358
+ {
359
+ className: wrapper,
360
+ style: {
361
+ width,
362
+ height: height + (showControls ? 30 : 0),
363
+ background: "white",
364
+ borderRadius: "4px",
365
+ boxShadow: "0 2px 5px rgba(0, 0, 0, 0.1)",
366
+ display: "flex",
367
+ flexDirection: "column",
368
+ overflow: "hidden",
369
+ userSelect: "none"
370
+ },
371
+ children: [
372
+ /* @__PURE__ */ jsxRuntime.jsxs(
373
+ "svg",
374
+ {
375
+ className: svg,
376
+ width,
377
+ height,
378
+ viewBox: viewBoxAttr,
379
+ onClick: this.handleMinimapClick,
380
+ style: {
381
+ cursor: this.options.pannable ? "pointer" : "default",
382
+ userSelect: "none",
383
+ flexShrink: 0
384
+ },
385
+ children: [
386
+ nodes.map((node) => {
387
+ if (!node.measured)
388
+ return null;
389
+ const { x, y } = node.position;
390
+ const width2 = node.measured.width || 0;
391
+ const height2 = node.measured.height || 0;
392
+ return /* @__PURE__ */ jsxRuntime.jsx(
393
+ "rect",
394
+ {
395
+ className: this.classNames.node,
396
+ x,
397
+ y,
398
+ width: width2,
399
+ height: height2,
400
+ fill: this.getNodeColor(node),
401
+ stroke: this.getNodeStrokeColor(node),
402
+ strokeWidth: nodeStrokeWidth,
403
+ rx: nodeBorderRadius,
404
+ ry: nodeBorderRadius
405
+ },
406
+ node.id
407
+ );
408
+ }),
409
+ /* @__PURE__ */ jsxRuntime.jsx(
410
+ "path",
411
+ {
412
+ className: mask,
413
+ d: `M${viewTransform.x - viewTransform.offset},${viewTransform.y - viewTransform.offset}
414
+ h${viewTransform.width + viewTransform.offset * 2}
415
+ v${viewTransform.height + viewTransform.offset * 2}
416
+ h${-viewTransform.width - viewTransform.offset * 2}z
417
+ M${viewRect.x},${viewRect.y}
418
+ h${viewRect.width}
419
+ v${viewRect.height}
420
+ h${-viewRect.width}z`,
421
+ fill: maskColor,
422
+ fillRule: "evenodd",
423
+ pointerEvents: "none"
424
+ }
425
+ ),
426
+ /* @__PURE__ */ jsxRuntime.jsx(
427
+ "rect",
428
+ {
429
+ className: viewBox,
430
+ "data-plugin-id": this.pluginId,
431
+ x: viewRect.x,
432
+ y: viewRect.y,
433
+ width: viewRect.width,
434
+ height: viewRect.height,
435
+ fill: "transparent",
436
+ stroke: viewBoxColor,
437
+ strokeWidth: 2,
438
+ style: {
439
+ cursor: "move",
440
+ pointerEvents: "all"
441
+ }
442
+ }
443
+ )
444
+ ]
445
+ }
446
+ ),
447
+ showControls && /* @__PURE__ */ jsxRuntime.jsxs(
448
+ "div",
449
+ {
450
+ className: control,
451
+ style: {
452
+ display: "flex",
453
+ justifyContent: "center",
454
+ alignItems: "center",
455
+ padding: "4px 0",
456
+ gap: "12px"
457
+ },
458
+ children: [
459
+ /* @__PURE__ */ jsxRuntime.jsx(
460
+ "button",
461
+ {
462
+ className: zoomIn,
463
+ onClick: () => this.handleZoom(true),
464
+ disabled: !this.options.zoomable,
465
+ style: {
466
+ border: "none",
467
+ background: "none",
468
+ cursor: this.options.zoomable ? "pointer" : "default",
469
+ fontSize: "16px",
470
+ color: "#555",
471
+ padding: "2px 6px"
472
+ },
473
+ children: "+"
474
+ }
475
+ ),
476
+ /* @__PURE__ */ jsxRuntime.jsx(
477
+ "button",
478
+ {
479
+ className: zoomOut,
480
+ onClick: () => this.handleZoom(false),
481
+ disabled: !this.options.zoomable,
482
+ style: {
483
+ border: "none",
484
+ background: "none",
485
+ cursor: this.options.zoomable ? "pointer" : "default",
486
+ fontSize: "16px",
487
+ color: "#555",
488
+ padding: "2px 6px"
489
+ },
490
+ children: "-"
491
+ }
492
+ ),
493
+ /* @__PURE__ */ jsxRuntime.jsx(
494
+ "button",
495
+ {
496
+ className: reset,
497
+ onClick: this.handleReset,
498
+ style: {
499
+ border: "none",
500
+ background: "none",
501
+ cursor: "pointer",
502
+ fontSize: "14px",
503
+ color: "#555",
504
+ padding: "2px 6px"
505
+ },
506
+ children: "reset"
507
+ }
508
+ )
509
+ ]
510
+ }
511
+ )
512
+ ]
513
+ }
514
+ );
515
+ }
516
+ }
517
+ _init = __decoratorStart(_a);
518
+ __decorateElement(_init, 1, "init", _init_dec, Minimap);
519
+ __decorateElement(_init, 1, "destroy", _destroy_dec, Minimap);
520
+ __decorateElement(_init, 1, "render", _render_dec, Minimap);
521
+ __decorateElement(_init, 5, "container", _container_dec, Minimap);
522
+ __decorateElement(_init, 5, "transform", _transform_dec, Minimap);
523
+ __decorateElement(_init, 5, "canvasRef", _canvasRef_dec, Minimap);
524
+ __decorateElement(_init, 5, "nodes", _nodes_dec, Minimap);
525
+ __decoratorMetadata(_init, Minimap);
526
+
527
+ exports.Minimap = Minimap;