@flowgram-vue/minimap-plugin 0.2.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/dist/index.js ADDED
@@ -0,0 +1,626 @@
1
+ import { defineComponent, inject as inject$1, shallowRef, onMounted, onBeforeUnmount, h, provide } from 'vue';
2
+ import { PlaygroundConfigEntity, PlaygroundVueContainerKey, PlaygroundVueRefKey, Playground, PlaygroundContainerFactory, observeEntityDatas, observeEntity, definePluginCreator, MouseTouchEvent, Layer } from '@flowgram-vue/core';
3
+ import { throttle } from 'lodash-es';
4
+ import { inject, injectable } from 'inversify';
5
+ import { DisposableCollection, Rectangle, domUtils } from '@flowgram-vue/utils';
6
+ import { FlowDocument, FlowNodeEntity, FlowNodeTransformData, FlowDocumentTransformerEntity, FlowNodeBaseType } from '@flowgram-vue/document';
7
+
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __decorateClass = (decorators, target, key, kind) => {
11
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
12
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
13
+ if (decorator = decorators[i])
14
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
15
+ if (kind && result) __defProp(target, key, result);
16
+ return result;
17
+ };
18
+
19
+ // src/draw.ts
20
+ var MinimapDraw;
21
+ ((MinimapDraw2) => {
22
+ const isRectValid = (rect) => rect.width > 0 && rect.height > 0;
23
+ MinimapDraw2.clear = (params) => {
24
+ const { canvas, context } = params;
25
+ context.clearRect(0, 0, canvas.width, canvas.height);
26
+ };
27
+ MinimapDraw2.backgroundColor = (params) => {
28
+ const { canvas, context, color } = params;
29
+ context.fillStyle = color;
30
+ context.fillRect(0, 0, canvas.width, canvas.height);
31
+ };
32
+ MinimapDraw2.rectangle = (params) => {
33
+ const { context, rect, color } = params;
34
+ if (!isRectValid(rect)) {
35
+ return;
36
+ }
37
+ context.fillStyle = color;
38
+ context.fillRect(rect.x, rect.y, rect.width, rect.height);
39
+ };
40
+ MinimapDraw2.roundRectangle = (params) => {
41
+ const { context, rect, color, radius, borderColor, borderDashLength, borderWidth = 0 } = params;
42
+ const { x, y, width, height } = rect;
43
+ if (!isRectValid(rect)) {
44
+ return;
45
+ }
46
+ context.beginPath();
47
+ const drawRoundedRectPath = () => {
48
+ context.moveTo(x + radius, y);
49
+ context.lineTo(x + width - radius, y);
50
+ context.quadraticCurveTo(x + width, y, x + width, y + radius);
51
+ context.lineTo(x + width, y + height - radius);
52
+ context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
53
+ context.lineTo(x + radius, y + height);
54
+ context.quadraticCurveTo(x, y + height, x, y + height - radius);
55
+ context.lineTo(x, y + radius);
56
+ context.quadraticCurveTo(x, y, x + radius, y);
57
+ context.closePath();
58
+ };
59
+ drawRoundedRectPath();
60
+ context.fillStyle = color;
61
+ context.fill();
62
+ if (borderColor && borderWidth > 0) {
63
+ context.strokeStyle = borderColor;
64
+ context.lineWidth = borderWidth;
65
+ if (borderDashLength) {
66
+ context.setLineDash([borderDashLength, borderDashLength]);
67
+ } else {
68
+ context.setLineDash([]);
69
+ }
70
+ context.stroke();
71
+ context.setLineDash([]);
72
+ }
73
+ };
74
+ MinimapDraw2.overlay = (params) => {
75
+ const { canvas, context, offset, scale, rect, color } = params;
76
+ if (!isRectValid(rect)) {
77
+ return;
78
+ }
79
+ context.fillStyle = color;
80
+ context.fillRect(0, 0, canvas.width, (rect.y + offset.y) * scale);
81
+ context.fillRect(
82
+ 0,
83
+ (rect.y + rect.height + offset.y) * scale,
84
+ canvas.width,
85
+ canvas.height - (rect.y + rect.height + offset.y) * scale
86
+ );
87
+ context.fillRect(
88
+ 0,
89
+ (rect.y + offset.y) * scale,
90
+ (rect.x + offset.x) * scale,
91
+ rect.height * scale
92
+ );
93
+ context.fillRect(
94
+ (rect.x + rect.width + offset.x) * scale,
95
+ (rect.y + offset.y) * scale,
96
+ canvas.width - (rect.x + rect.width + offset.x) * scale,
97
+ rect.height * scale
98
+ );
99
+ };
100
+ })(MinimapDraw || (MinimapDraw = {}));
101
+
102
+ // src/constant.ts
103
+ var MinimapDefaultCanvasStyle = {
104
+ canvasWidth: 250,
105
+ canvasHeight: 250,
106
+ canvasPadding: 50,
107
+ canvasBackground: "rgba(242, 243, 245, 1)",
108
+ canvasBorderRadius: 10,
109
+ viewportBackground: "rgba(255, 255, 255, 1)",
110
+ viewportBorderRadius: 4,
111
+ viewportBorderColor: "rgba(6, 7, 9, 0.10)",
112
+ viewportBorderWidth: 1,
113
+ viewportBorderDashLength: void 0,
114
+ nodeColor: "rgba(0, 0, 0, 0.10)",
115
+ nodeBorderRadius: 2,
116
+ nodeBorderWidth: 0.145,
117
+ nodeBorderColor: "rgba(6, 7, 9, 0.10)",
118
+ overlayColor: "rgba(255, 255, 255, 0.55)"
119
+ };
120
+ var MinimapDefaultInactiveStyle = {
121
+ scale: 0.7,
122
+ opacity: 1,
123
+ translateX: 15,
124
+ translateY: 15
125
+ };
126
+ var MinimapDefaultOptions = {
127
+ canvasStyle: MinimapDefaultCanvasStyle,
128
+ canvasClassName: "gedit-minimap-canvas",
129
+ enableDisplayAllNodes: false,
130
+ activeThrottleTime: 0,
131
+ inactiveThrottleTime: 24
132
+ };
133
+
134
+ // src/service.ts
135
+ var FlowMinimapService = class {
136
+ constructor() {
137
+ this.visible = false;
138
+ this.onActive = (callback) => {
139
+ this.onActiveCallbacks.add(callback);
140
+ return {
141
+ dispose: () => {
142
+ this.onActiveCallbacks.delete(callback);
143
+ }
144
+ };
145
+ };
146
+ /**
147
+ * 触发渲染
148
+ */
149
+ this.render = this._render;
150
+ this.handleWheel = (event) => {
151
+ };
152
+ this.handleStartDrag = (event) => {
153
+ MouseTouchEvent.preventDefault(event);
154
+ event.stopPropagation();
155
+ const renderContext = this.createRenderContext();
156
+ const { viewRect, scale, offset } = renderContext;
157
+ const canvasRect = this.canvas.getBoundingClientRect();
158
+ const { clientX, clientY } = MouseTouchEvent.getEventCoord(event);
159
+ const mousePoint = {
160
+ x: clientX - canvasRect.left,
161
+ y: clientY - canvasRect.top
162
+ };
163
+ const viewRectOnCanvas = this.rectOnCanvas({
164
+ rect: viewRect,
165
+ scale,
166
+ offset
167
+ });
168
+ if (!this.isPointInRect({ point: mousePoint, rect: viewRectOnCanvas })) {
169
+ return;
170
+ }
171
+ this.isDragging = true;
172
+ this.dragStart = mousePoint;
173
+ document.addEventListener("mousemove", this.handleDragging);
174
+ document.addEventListener("mouseup", this.handleEndDrag);
175
+ document.addEventListener("touchmove", this.handleDragging, { passive: false });
176
+ document.addEventListener("touchend", this.handleEndDrag);
177
+ document.addEventListener("touchcancel", this.handleEndDrag);
178
+ };
179
+ this.handleDragging = (event) => {
180
+ if (!this.isDragging || !this.dragStart) return;
181
+ MouseTouchEvent.preventDefault(event);
182
+ event.stopPropagation();
183
+ const renderContext = this.createRenderContext();
184
+ const { scale } = renderContext;
185
+ const canvasRect = this.canvas.getBoundingClientRect();
186
+ const { clientX, clientY } = MouseTouchEvent.getEventCoord(event);
187
+ const mouseX = clientX - canvasRect.left;
188
+ const mouseY = clientY - canvasRect.top;
189
+ const deltaX = (mouseX - this.dragStart.x) / scale;
190
+ const deltaY = (mouseY - this.dragStart.y) / scale;
191
+ this.updateScrollPosition(deltaX, deltaY);
192
+ this.dragStart = { x: mouseX, y: mouseY };
193
+ this.render();
194
+ };
195
+ this.handleEndDrag = (event) => {
196
+ MouseTouchEvent.preventDefault(event);
197
+ event.stopPropagation();
198
+ document.removeEventListener("mousemove", this.handleDragging);
199
+ document.removeEventListener("mouseup", this.handleEndDrag);
200
+ document.removeEventListener("touchmove", this.handleDragging);
201
+ document.removeEventListener("touchend", this.handleEndDrag);
202
+ document.removeEventListener("touchcancel", this.handleEndDrag);
203
+ this.isDragging = false;
204
+ this.dragStart = void 0;
205
+ this.setActivate(this.isMouseInCanvas(event));
206
+ };
207
+ this.handleCursor = (event) => {
208
+ if (!this.activated) return;
209
+ const renderContext = this.createRenderContext();
210
+ const { viewRect, scale, offset } = renderContext;
211
+ const canvasRect = this.canvas.getBoundingClientRect();
212
+ const mousePoint = {
213
+ x: event.clientX - canvasRect.left,
214
+ y: event.clientY - canvasRect.top
215
+ };
216
+ const viewRectOnCanvas = this.rectOnCanvas({
217
+ rect: viewRect,
218
+ scale,
219
+ offset
220
+ });
221
+ if (this.isPointInRect({ point: mousePoint, rect: viewRectOnCanvas })) {
222
+ this.canvas.style.cursor = "grab";
223
+ } else {
224
+ this.canvas.style.cursor = "default";
225
+ }
226
+ };
227
+ this.canvas = document.createElement("canvas");
228
+ this.context2D = this.canvas.getContext("2d");
229
+ this.initialized = !!this.context2D;
230
+ this.onActiveCallbacks = /* @__PURE__ */ new Set();
231
+ this.toDispose = new DisposableCollection();
232
+ this.render = this._render;
233
+ this.activated = false;
234
+ this.isDragging = false;
235
+ }
236
+ init(options) {
237
+ this.options = MinimapDefaultOptions;
238
+ Object.assign(this.options, options);
239
+ this.setThrottle(this.options.inactiveThrottleTime);
240
+ this.initStyle();
241
+ }
242
+ dispose() {
243
+ this.toDispose.dispose();
244
+ this.initialized = false;
245
+ this.activated = false;
246
+ this.removeEventListeners();
247
+ }
248
+ setVisible(visible) {
249
+ this.visible = visible;
250
+ }
251
+ setActivate(activate) {
252
+ if (activate === this.activated) {
253
+ return;
254
+ }
255
+ if (!activate && this.isDragging) {
256
+ return;
257
+ }
258
+ this.activated = activate;
259
+ if (activate) {
260
+ this.setThrottle(this.options.activeThrottleTime);
261
+ this.addEventListeners();
262
+ } else {
263
+ this.setThrottle(this.options.inactiveThrottleTime);
264
+ this.removeEventListeners();
265
+ }
266
+ this.render();
267
+ this.onActiveCallbacks.forEach((callback) => callback(activate));
268
+ }
269
+ initStyle() {
270
+ if (!this.initialized) {
271
+ return;
272
+ }
273
+ const { canvasClassName, canvasStyle } = this.options;
274
+ this.canvas.className = canvasClassName;
275
+ this.style = {
276
+ ...MinimapDefaultCanvasStyle,
277
+ ...canvasStyle
278
+ };
279
+ this.canvas.width = this.style.canvasWidth;
280
+ this.canvas.height = this.style.canvasHeight;
281
+ this.canvas.style.borderRadius = this.style.canvasBorderRadius ? `${this.style.canvasBorderRadius}px` : "unset";
282
+ }
283
+ setThrottle(throttleTime) {
284
+ this.render = throttle(this._render, throttleTime);
285
+ }
286
+ _render() {
287
+ if (!this.initialized || !this.visible) {
288
+ return;
289
+ }
290
+ const renderContext = this.createRenderContext();
291
+ this.renderCanvas(renderContext);
292
+ }
293
+ createRenderContext() {
294
+ const { canvas, context2D } = this;
295
+ const nodeTransforms = this.transformVisibles;
296
+ const nodeRects = nodeTransforms.map((transform) => transform.bounds);
297
+ const viewRect = this.viewRect();
298
+ const renderRect = this.renderRect(nodeRects).withPadding({
299
+ top: this.style.canvasPadding,
300
+ bottom: this.style.canvasPadding,
301
+ left: this.style.canvasPadding,
302
+ right: this.style.canvasPadding
303
+ });
304
+ const canvasRect = Rectangle.enlarge([viewRect, renderRect]);
305
+ const { scale, offset } = this.calculateScaleAndOffset({ canvasRect });
306
+ return {
307
+ canvas,
308
+ context2D,
309
+ nodeRects,
310
+ canvasRect,
311
+ viewRect,
312
+ renderRect,
313
+ scale,
314
+ offset
315
+ };
316
+ }
317
+ renderCanvas(renderContext) {
318
+ const { canvas, context2D, nodeRects, viewRect, scale, offset } = renderContext;
319
+ MinimapDraw.clear({ canvas, context: context2D });
320
+ MinimapDraw.backgroundColor({
321
+ canvas,
322
+ context: context2D,
323
+ color: this.style.canvasBackground
324
+ });
325
+ MinimapDraw.roundRectangle({
326
+ context: context2D,
327
+ rect: this.rectOnCanvas({ rect: viewRect, scale, offset }),
328
+ color: this.style.viewportBackground,
329
+ radius: this.style.viewportBorderRadius
330
+ });
331
+ nodeRects.forEach((nodeRect) => {
332
+ MinimapDraw.roundRectangle({
333
+ context: context2D,
334
+ rect: this.rectOnCanvas({ rect: nodeRect, scale, offset }),
335
+ color: this.style.nodeColor,
336
+ radius: this.style.nodeBorderRadius,
337
+ borderWidth: this.style.nodeBorderWidth,
338
+ borderColor: this.style.nodeBorderColor
339
+ });
340
+ });
341
+ MinimapDraw.roundRectangle({
342
+ context: context2D,
343
+ rect: this.rectOnCanvas({ rect: viewRect, scale, offset }),
344
+ color: "rgba(255, 255, 255, 0)",
345
+ radius: this.style.viewportBorderRadius,
346
+ borderColor: this.style.viewportBorderColor,
347
+ borderWidth: this.style.viewportBorderWidth,
348
+ borderDashLength: this.style.viewportBorderDashLength
349
+ });
350
+ MinimapDraw.overlay({
351
+ canvas,
352
+ context: context2D,
353
+ offset,
354
+ scale,
355
+ rect: viewRect,
356
+ color: this.style.overlayColor
357
+ });
358
+ }
359
+ calculateScaleAndOffset(params) {
360
+ const { canvasRect } = params;
361
+ const { width: canvasWidth, height: canvasHeight } = this.canvas;
362
+ const scaleX = canvasWidth / canvasRect.width;
363
+ const scaleY = canvasHeight / canvasRect.height;
364
+ const scale = Math.min(scaleX, scaleY);
365
+ const scaledWidth = canvasRect.width * scale;
366
+ const scaledHeight = canvasRect.height * scale;
367
+ const centerOffsetX = (canvasWidth - scaledWidth) / 2;
368
+ const centerOffsetY = (canvasHeight - scaledHeight) / 2;
369
+ const offset = {
370
+ x: centerOffsetX / scale - canvasRect.x,
371
+ y: centerOffsetY / scale - canvasRect.y
372
+ };
373
+ return { scale, offset };
374
+ }
375
+ get transformVisibles() {
376
+ const transformVisible = this.document.getRenderDatas(
377
+ FlowNodeTransformData,
378
+ false
379
+ );
380
+ return transformVisible.filter((transform) => {
381
+ const node = transform.entity;
382
+ if (node.hidden) return false;
383
+ if (node.flowNodeType === FlowNodeBaseType.ROOT) return;
384
+ if (!this.options.enableDisplayAllNodes && node.parent && node.parent.flowNodeType !== FlowNodeBaseType.ROOT)
385
+ return;
386
+ return true;
387
+ });
388
+ }
389
+ renderRect(rects) {
390
+ return Rectangle.enlarge(rects);
391
+ }
392
+ viewRect() {
393
+ const { width, height, scrollX, scrollY, zoom } = this.playgroundConfig.config;
394
+ return new Rectangle(scrollX / zoom, scrollY / zoom, width / zoom, height / zoom);
395
+ }
396
+ /** 计算画布坐标系下的矩形 */
397
+ rectOnCanvas(params) {
398
+ const { rect, scale, offset } = params;
399
+ return new Rectangle(
400
+ (rect.x + offset.x) * scale,
401
+ (rect.y + offset.y) * scale,
402
+ rect.width * scale,
403
+ rect.height * scale
404
+ );
405
+ }
406
+ isPointInRect(params) {
407
+ const { point, rect } = params;
408
+ return point.x >= rect.x && point.x <= rect.x + rect.width && point.y >= rect.y && point.y <= rect.y + rect.height;
409
+ }
410
+ addEventListeners() {
411
+ this.canvas.addEventListener("wheel", this.handleWheel);
412
+ this.canvas.addEventListener("mousedown", this.handleStartDrag);
413
+ this.canvas.addEventListener("touchstart", this.handleStartDrag, { passive: false });
414
+ this.canvas.addEventListener("mousemove", this.handleCursor);
415
+ }
416
+ removeEventListeners() {
417
+ this.canvas.removeEventListener("wheel", this.handleWheel);
418
+ this.canvas.removeEventListener("mousedown", this.handleStartDrag);
419
+ this.canvas.removeEventListener("touchstart", this.handleStartDrag);
420
+ this.canvas.removeEventListener("mousemove", this.handleCursor);
421
+ }
422
+ isMouseInCanvas(event) {
423
+ const canvasRect = this.canvas.getBoundingClientRect();
424
+ const { clientX, clientY } = MouseTouchEvent.getEventCoord(event);
425
+ return clientX >= canvasRect.left && clientX <= canvasRect.right && clientY >= canvasRect.top && clientY <= canvasRect.bottom;
426
+ }
427
+ updateScrollPosition(deltaX, deltaY) {
428
+ const { scrollX, scrollY, zoom } = this.playgroundConfig.config;
429
+ this.playgroundConfig.updateConfig({
430
+ scrollX: scrollX + deltaX * zoom,
431
+ scrollY: scrollY + deltaY * zoom
432
+ });
433
+ }
434
+ };
435
+ __decorateClass([
436
+ inject(FlowDocument)
437
+ ], FlowMinimapService.prototype, "document", 2);
438
+ __decorateClass([
439
+ inject(PlaygroundConfigEntity)
440
+ ], FlowMinimapService.prototype, "playgroundConfig", 2);
441
+ FlowMinimapService = __decorateClass([
442
+ injectable()
443
+ ], FlowMinimapService);
444
+
445
+ // src/component.ts
446
+ var MinimapRender = defineComponent({
447
+ name: "MinimapRender",
448
+ props: {
449
+ service: { type: Object },
450
+ panelStyles: { type: Object, default: () => ({}) },
451
+ containerStyles: { type: Object, default: () => ({}) },
452
+ inactiveStyle: {
453
+ type: Object,
454
+ default: () => ({})
455
+ }
456
+ },
457
+ setup(props) {
458
+ const inactiveStyle = {
459
+ ...MinimapDefaultInactiveStyle,
460
+ ...props.inactiveStyle
461
+ };
462
+ const playgroundContainer = inject$1(PlaygroundVueContainerKey, void 0);
463
+ const service = props.service || playgroundContainer?.get(FlowMinimapService);
464
+ const panelRef = shallowRef(null);
465
+ const activated = shallowRef(false);
466
+ let disposer;
467
+ onMounted(() => {
468
+ const canvasContainer = panelRef.value;
469
+ if (canvasContainer && service.canvas) {
470
+ canvasContainer.appendChild(service.canvas);
471
+ }
472
+ disposer = service.onActive((activate) => {
473
+ activated.value = activate;
474
+ });
475
+ service.setVisible(true);
476
+ service.render();
477
+ });
478
+ onBeforeUnmount(() => {
479
+ disposer?.dispose();
480
+ service.setVisible(false);
481
+ });
482
+ return () => {
483
+ const scale = activated.value ? 1 : inactiveStyle.scale;
484
+ const opacity = activated.value ? 1 : inactiveStyle.opacity;
485
+ const translateX = activated.value ? 0 : inactiveStyle.translateX;
486
+ const translateY = activated.value ? 0 : inactiveStyle.translateY;
487
+ return h(
488
+ "div",
489
+ {
490
+ class: "minimap-container",
491
+ style: {
492
+ position: "fixed",
493
+ right: "30px",
494
+ bottom: "70px",
495
+ transition: "all 0.3s ease",
496
+ transform: `scale(${scale}) translate(${translateX}px, ${translateY}px)`,
497
+ opacity,
498
+ transformOrigin: "bottom right",
499
+ ...props.containerStyles
500
+ }
501
+ },
502
+ [
503
+ h("div", {
504
+ class: "minimap-panel",
505
+ style: {
506
+ display: "flex",
507
+ width: "100%",
508
+ height: "100%",
509
+ borderRadius: "10px",
510
+ backgroundColor: "rgba(255, 255, 255, 1)",
511
+ border: "0.572px solid rgba(6, 7, 9, 0.10)",
512
+ overflow: "hidden",
513
+ boxShadow: "0px 2.289px 6.867px 0px rgba(0, 0, 0, 0.08), 0px 4.578px 13.733px 0px rgba(0, 0, 0, 0.04)",
514
+ boxSizing: "border-box",
515
+ padding: "8px",
516
+ ...props.panelStyles
517
+ },
518
+ "data-flow-editor-selectable": "false",
519
+ ref: (el) => {
520
+ panelRef.value = el || null;
521
+ },
522
+ onMouseenter: () => {
523
+ service.setActivate(true);
524
+ },
525
+ onMouseleave: () => {
526
+ service.setActivate(false);
527
+ },
528
+ onTouchstartCapture: () => {
529
+ service.setActivate(true);
530
+ },
531
+ onTouchendCapture: () => {
532
+ service.setActivate(false);
533
+ }
534
+ })
535
+ ]
536
+ );
537
+ };
538
+ }
539
+ });
540
+ var LayerVueProvide = defineComponent({
541
+ name: "LayerVueProvide",
542
+ props: {
543
+ factory: {
544
+ type: Object,
545
+ required: true
546
+ }
547
+ },
548
+ setup(props) {
549
+ const factory = props.factory;
550
+ provide(PlaygroundVueContainerKey, factory);
551
+ try {
552
+ provide(PlaygroundVueRefKey, factory.get(Playground));
553
+ } catch {
554
+ }
555
+ },
556
+ render() {
557
+ return this.$slots.default?.();
558
+ }
559
+ });
560
+ function wrapLayerRender(factory, children) {
561
+ return h(LayerVueProvide, { factory }, () => children);
562
+ }
563
+
564
+ // src/layer.ts
565
+ var FlowMinimapLayer = class extends Layer {
566
+ constructor() {
567
+ super();
568
+ this.className = "gedit-minimap-layer gedit-playground-layer";
569
+ this.node = domUtils.createDivWithClass(this.className);
570
+ this.node.style.zIndex = "9999";
571
+ }
572
+ render() {
573
+ if (this.documentTransformer.loading) return null;
574
+ this.documentTransformer.refresh();
575
+ this.service.render();
576
+ if (this.options.disableLayer) {
577
+ return null;
578
+ }
579
+ return wrapLayerRender(
580
+ this.playgroundContainer,
581
+ h(MinimapRender, {
582
+ service: this.service,
583
+ panelStyles: this.options.panelStyles,
584
+ containerStyles: this.options.containerStyles,
585
+ inactiveStyle: this.options.inactiveStyle
586
+ })
587
+ );
588
+ }
589
+ };
590
+ FlowMinimapLayer.type = "FlowMinimapLayer";
591
+ __decorateClass([
592
+ inject(FlowMinimapService)
593
+ ], FlowMinimapLayer.prototype, "service", 2);
594
+ __decorateClass([
595
+ inject(PlaygroundContainerFactory)
596
+ ], FlowMinimapLayer.prototype, "playgroundContainer", 2);
597
+ __decorateClass([
598
+ observeEntityDatas(FlowNodeEntity, FlowNodeTransformData)
599
+ ], FlowMinimapLayer.prototype, "transformDatas", 2);
600
+ __decorateClass([
601
+ observeEntity(PlaygroundConfigEntity)
602
+ ], FlowMinimapLayer.prototype, "configEntity", 2);
603
+ __decorateClass([
604
+ observeEntity(FlowDocumentTransformerEntity)
605
+ ], FlowMinimapLayer.prototype, "documentTransformer", 2);
606
+ FlowMinimapLayer = __decorateClass([
607
+ injectable()
608
+ ], FlowMinimapLayer);
609
+
610
+ // src/create-plugin.ts
611
+ var createMinimapPlugin = definePluginCreator({
612
+ onBind: ({ bind }) => {
613
+ bind(FlowMinimapService).toSelf().inSingletonScope();
614
+ },
615
+ onInit: (ctx, opts) => {
616
+ ctx.playground.registerLayer(FlowMinimapLayer, opts);
617
+ ctx.get(FlowMinimapService).init(opts);
618
+ },
619
+ onDispose: (ctx) => {
620
+ ctx.get(FlowMinimapService).dispose();
621
+ }
622
+ });
623
+
624
+ export { FlowMinimapLayer, FlowMinimapService, MinimapDefaultCanvasStyle, MinimapDefaultInactiveStyle, MinimapDefaultOptions, MinimapRender, createMinimapPlugin };
625
+ //# sourceMappingURL=index.js.map
626
+ //# sourceMappingURL=index.js.map