rete-angular-plugin 2.1.2 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/18/core.d.ts +68 -0
  2. package/18/esm2022/core.mjs +127 -0
  3. package/18/esm2022/index.mjs +12 -0
  4. package/18/esm2022/module.mjs +50 -0
  5. package/18/esm2022/presets/classic/components/connection/connection-wrapper.component.mjs +91 -0
  6. package/18/esm2022/presets/classic/components/connection/connection.component.mjs +33 -0
  7. package/18/esm2022/presets/classic/components/control/control.component.mjs +55 -0
  8. package/18/esm2022/presets/classic/components/index.mjs +6 -0
  9. package/18/esm2022/presets/classic/components/node/node.component.mjs +134 -0
  10. package/18/esm2022/presets/classic/components/socket/socket.component.mjs +35 -0
  11. package/18/esm2022/presets/classic/index.mjs +114 -0
  12. package/18/esm2022/presets/classic/types.mjs +2 -0
  13. package/18/esm2022/presets/context-menu/components/index.mjs +4 -0
  14. package/18/esm2022/presets/context-menu/components/item/item.component.mjs +115 -0
  15. package/18/esm2022/presets/context-menu/components/menu/menu.component.mjs +111 -0
  16. package/18/esm2022/presets/context-menu/components/search/search.component.mjs +24 -0
  17. package/18/esm2022/presets/context-menu/debounce.mjs +17 -0
  18. package/18/esm2022/presets/context-menu/index.mjs +41 -0
  19. package/18/esm2022/presets/context-menu/module.mjs +35 -0
  20. package/18/esm2022/presets/context-menu/types.mjs +2 -0
  21. package/18/esm2022/presets/index.mjs +9 -0
  22. package/18/esm2022/presets/minimap/components/index.mjs +4 -0
  23. package/18/esm2022/presets/minimap/components/mini-node/mini-node.component.mjs +55 -0
  24. package/18/esm2022/presets/minimap/components/mini-viewport/mini-viewport.component.mjs +81 -0
  25. package/18/esm2022/presets/minimap/components/minimap/minimap.component.mjs +110 -0
  26. package/18/esm2022/presets/minimap/index.mjs +45 -0
  27. package/18/esm2022/presets/minimap/module.mjs +35 -0
  28. package/18/esm2022/presets/minimap/types.mjs +2 -0
  29. package/18/esm2022/presets/reroute/components/index.mjs +3 -0
  30. package/18/esm2022/presets/reroute/components/pin/pin.component.mjs +86 -0
  31. package/18/esm2022/presets/reroute/components/pins/pins.component.mjs +58 -0
  32. package/18/esm2022/presets/reroute/index.mjs +43 -0
  33. package/18/esm2022/presets/reroute/module.mjs +30 -0
  34. package/18/esm2022/presets/reroute/types.mjs +2 -0
  35. package/18/esm2022/presets/types.mjs +2 -0
  36. package/18/esm2022/ref.mjs +30 -0
  37. package/18/esm2022/rete-angular-plugin-ng18.mjs +5 -0
  38. package/18/esm2022/shared/drag.mjs +23 -0
  39. package/18/esm2022/types.mjs +2 -0
  40. package/18/fesm2022/rete-angular-plugin-ng18.mjs +1540 -0
  41. package/18/fesm2022/rete-angular-plugin-ng18.mjs.map +1 -0
  42. package/18/index.d.ts +13 -0
  43. package/18/module.d.ts +13 -0
  44. package/18/package.json +24 -0
  45. package/18/presets/classic/components/connection/connection-wrapper.component.d.ts +30 -0
  46. package/18/presets/classic/components/connection/connection.component.d.ts +11 -0
  47. package/18/presets/classic/components/control/control.component.d.ts +14 -0
  48. package/18/presets/classic/components/index.d.ts +5 -0
  49. package/18/presets/classic/components/node/node.component.d.ts +25 -0
  50. package/18/presets/classic/components/socket/socket.component.d.ts +12 -0
  51. package/18/presets/classic/index.d.ts +21 -0
  52. package/18/presets/classic/types.d.ts +49 -0
  53. package/18/presets/context-menu/components/index.d.ts +3 -0
  54. package/18/presets/context-menu/components/item/item.component.d.ts +26 -0
  55. package/18/presets/context-menu/components/menu/menu.component.d.ts +27 -0
  56. package/18/presets/context-menu/components/search/search.component.d.ts +8 -0
  57. package/18/presets/context-menu/debounce.d.ts +5 -0
  58. package/18/presets/context-menu/index.d.ts +9 -0
  59. package/18/presets/context-menu/module.d.ts +10 -0
  60. package/18/presets/context-menu/types.d.ts +12 -0
  61. package/18/presets/index.d.ts +8 -0
  62. package/18/presets/minimap/components/index.d.ts +3 -0
  63. package/18/presets/minimap/components/mini-node/mini-node.component.d.ts +14 -0
  64. package/18/presets/minimap/components/mini-viewport/mini-viewport.component.d.ts +27 -0
  65. package/18/presets/minimap/components/minimap/minimap.component.d.ts +25 -0
  66. package/18/presets/minimap/index.d.ts +9 -0
  67. package/18/presets/minimap/module.d.ts +10 -0
  68. package/18/presets/minimap/types.d.ts +22 -0
  69. package/18/presets/reroute/components/index.d.ts +2 -0
  70. package/18/presets/reroute/components/pin/pin.component.d.ts +30 -0
  71. package/18/presets/reroute/components/pins/pins.component.d.ts +17 -0
  72. package/18/presets/reroute/index.d.ts +13 -0
  73. package/18/presets/reroute/module.d.ts +9 -0
  74. package/18/presets/reroute/types.d.ts +18 -0
  75. package/18/presets/types.d.ts +15 -0
  76. package/18/ref.d.ts +12 -0
  77. package/18/shared/drag.d.ts +10 -0
  78. package/18/types.d.ts +29 -0
  79. package/CHANGELOG.md +14 -0
  80. package/package.json +4 -4
@@ -0,0 +1,27 @@
1
+ import { MinimapData } from '../../types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class MiniViewportComponent {
4
+ left: number;
5
+ top: number;
6
+ width: number;
7
+ height: number;
8
+ containerWidth: number;
9
+ translate: MinimapData['translate'];
10
+ drag: {
11
+ start(e: {
12
+ pageX: number;
13
+ pageY: number;
14
+ }): void;
15
+ };
16
+ get styleLeft(): string;
17
+ get styleTop(): string;
18
+ get styleWidth(): string;
19
+ get styleHeight(): string;
20
+ pointerdown(event: PointerEvent): void;
21
+ px(value: number): string;
22
+ scale(v: number): number;
23
+ invert(v: number): number;
24
+ onDrag(dx: number, dy: number): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<MiniViewportComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<MiniViewportComponent, "minimap-mini-viewport", never, { "left": { "alias": "left"; "required": false; }; "top": { "alias": "top"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "containerWidth": { "alias": "containerWidth"; "required": false; }; "translate": { "alias": "translate"; "required": false; }; }, {}, never, never, false, never>;
27
+ }
@@ -0,0 +1,25 @@
1
+ import { ChangeDetectorRef, OnChanges, ElementRef } from '@angular/core';
2
+ import { MinimapData } from '../../types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class MinimapComponent implements OnChanges {
5
+ el: ElementRef;
6
+ private cdr;
7
+ rendered: () => void;
8
+ size: number;
9
+ ratio: MinimapData['ratio'];
10
+ nodes: MinimapData['nodes'];
11
+ viewport: MinimapData['viewport'];
12
+ translate: MinimapData['translate'];
13
+ point: MinimapData['point'];
14
+ get width(): string;
15
+ get height(): string;
16
+ pointerdown(event: PointerEvent): void;
17
+ dblclick(event: MouseEvent): void;
18
+ constructor(el: ElementRef, cdr: ChangeDetectorRef);
19
+ ngOnChanges(): void;
20
+ px(value: number): string;
21
+ scale(value: number): number;
22
+ identifyMiniNode(_: number, item: MinimapData['nodes'][number]): string;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<MinimapComponent, never>;
24
+ static ɵcmp: i0.ɵɵComponentDeclaration<MinimapComponent, "ng-component", never, { "rendered": { "alias": "rendered"; "required": false; }; "size": { "alias": "size"; "required": false; }; "ratio": { "alias": "ratio"; "required": false; }; "nodes": { "alias": "nodes"; "required": false; }; "viewport": { "alias": "viewport"; "required": false; }; "translate": { "alias": "translate"; "required": false; }; "point": { "alias": "point"; "required": false; }; }, {}, never, never, false, never>;
25
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseSchemes } from 'rete';
2
+ import { RenderPreset } from '../types';
3
+ import { MinimapRender } from './types';
4
+ /**
5
+ * Preset for rendering minimap.
6
+ */
7
+ export declare function setup<Schemes extends BaseSchemes, K extends MinimapRender>(props?: {
8
+ size?: number;
9
+ }): RenderPreset<Schemes, K>;
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./components/minimap/minimap.component";
3
+ import * as i2 from "./components/mini-viewport/mini-viewport.component";
4
+ import * as i3 from "./components/mini-node/mini-node.component";
5
+ import * as i4 from "@angular/common";
6
+ export declare class ReteMinimapModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReteMinimapModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ReteMinimapModule, [typeof i1.MinimapComponent, typeof i2.MiniViewportComponent, typeof i3.MiniNodeComponent], [typeof i4.CommonModule], [typeof i1.MinimapComponent, typeof i2.MiniViewportComponent, typeof i3.MiniNodeComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<ReteMinimapModule>;
10
+ }
@@ -0,0 +1,22 @@
1
+ import { RenderSignal } from '../../types';
2
+ export type Rect = {
3
+ width: number;
4
+ height: number;
5
+ left: number;
6
+ top: number;
7
+ };
8
+ export type Transform = {
9
+ x: number;
10
+ y: number;
11
+ k: number;
12
+ };
13
+ export type Translate = (dx: number, dy: number) => void;
14
+ export type MinimapData = {
15
+ ratio: number;
16
+ nodes: Rect[];
17
+ viewport: Rect;
18
+ start(): Transform;
19
+ translate: Translate;
20
+ point(x: number, y: number): void;
21
+ };
22
+ export type MinimapRender = RenderSignal<'minimap', MinimapData>;
@@ -0,0 +1,2 @@
1
+ export { PinsComponent } from './pins/pins.component';
2
+ export { PinComponent } from './pin/pin.component';
@@ -0,0 +1,30 @@
1
+ import { ChangeDetectorRef, OnChanges, EventEmitter } from '@angular/core';
2
+ import { Position } from '../../types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PinComponent implements OnChanges {
5
+ private cdr;
6
+ position: Position;
7
+ selected?: boolean;
8
+ getPointer: () => Position;
9
+ menu: EventEmitter<void>;
10
+ translate: EventEmitter<{
11
+ dx: number;
12
+ dy: number;
13
+ }>;
14
+ down: EventEmitter<void>;
15
+ drag: {
16
+ start(e: {
17
+ pageX: number;
18
+ pageY: number;
19
+ }): void;
20
+ };
21
+ get _selected(): boolean;
22
+ get top(): string;
23
+ get left(): string;
24
+ pointerdown(event: PointerEvent): void;
25
+ contextmenu(event: MouseEvent): void;
26
+ constructor(cdr: ChangeDetectorRef);
27
+ ngOnChanges(): void;
28
+ static ɵfac: i0.ɵɵFactoryDeclaration<PinComponent, never>;
29
+ static ɵcmp: i0.ɵɵComponentDeclaration<PinComponent, "reroute-pin", never, { "position": { "alias": "position"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "getPointer": { "alias": "getPointer"; "required": false; }; }, { "menu": "menu"; "translate": "translate"; "down": "down"; }, never, never, false, never>;
30
+ }
@@ -0,0 +1,17 @@
1
+ import { ChangeDetectorRef, OnChanges } from '@angular/core';
2
+ import { Pin, PinData, Position } from '../../types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PinsComponent implements OnChanges {
5
+ private cdr;
6
+ rendered: () => void;
7
+ pins: PinData['pins'];
8
+ down?: (id: string) => void;
9
+ translate?: (id: string, dx: number, dy: number) => void;
10
+ menu?: (id: string) => void;
11
+ getPointer?: () => Position;
12
+ constructor(cdr: ChangeDetectorRef);
13
+ ngOnChanges(): void;
14
+ track(_: number, item: Pin): string;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<PinsComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<PinsComponent, "ng-component", never, { "rendered": { "alias": "rendered"; "required": false; }; "pins": { "alias": "pins"; "required": false; }; "down": { "alias": "down"; "required": false; }; "translate": { "alias": "translate"; "required": false; }; "menu": { "alias": "menu"; "required": false; }; "getPointer": { "alias": "getPointer"; "required": false; }; }, {}, never, never, false, never>;
17
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseSchemes } from 'rete';
2
+ import { RenderPreset } from '../types';
3
+ import { PinsRender } from './types';
4
+ type Props = {
5
+ translate?: (id: string, dx: number, dy: number) => void;
6
+ contextMenu?: (id: string) => void;
7
+ pointerdown?: (id: string) => void;
8
+ };
9
+ /**
10
+ * Preset for rendering pins.
11
+ */
12
+ export declare function setup<Schemes extends BaseSchemes, K extends PinsRender>(props?: Props): RenderPreset<Schemes, K>;
13
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./components/pins/pins.component";
3
+ import * as i2 from "./components/pin/pin.component";
4
+ import * as i3 from "@angular/common";
5
+ export declare class ReteRerouteModule {
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReteRerouteModule, never>;
7
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ReteRerouteModule, [typeof i1.PinsComponent, typeof i2.PinComponent], [typeof i3.CommonModule], [typeof i1.PinsComponent, typeof i2.PinComponent]>;
8
+ static ɵinj: i0.ɵɵInjectorDeclaration<ReteRerouteModule>;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { ConnectionId } from 'rete';
2
+ import { RenderSignal } from '../../types';
3
+ export type Position = {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ export type Pin = {
8
+ id: string;
9
+ position: Position;
10
+ selected?: boolean;
11
+ };
12
+ export type PinData = {
13
+ id: ConnectionId;
14
+ pins: Pin[];
15
+ };
16
+ export type PinsRender = RenderSignal<'reroute-pins', {
17
+ data: PinData;
18
+ }>;
@@ -0,0 +1,15 @@
1
+ import { BaseSchemes } from 'rete';
2
+ import { AngularPlugin } from '../core';
3
+ export type RenderPreset<Schemes extends BaseSchemes, T> = {
4
+ attach?: (plugin: AngularPlugin<Schemes, T>) => void;
5
+ update: (context: Extract<T, {
6
+ type: 'render';
7
+ }>, plugin: AngularPlugin<Schemes, T>) => Record<string, unknown> | undefined | null | void;
8
+ mount: (context: Extract<T, {
9
+ type: 'render';
10
+ }>, plugin: AngularPlugin<Schemes, T>) => {
11
+ key: string;
12
+ component: any;
13
+ props: Record<string, unknown>;
14
+ } | undefined | null | void;
15
+ };
package/18/ref.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { ElementRef, OnChanges, OnDestroy } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class RefDirective implements OnChanges, OnDestroy {
4
+ private el;
5
+ data: any;
6
+ emit: any;
7
+ constructor(el: ElementRef);
8
+ ngOnChanges(): void;
9
+ ngOnDestroy(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<RefDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RefDirective, "[refComponent]", never, { "data": { "alias": "data"; "required": false; }; "emit": { "alias": "emit"; "required": false; }; }, {}, never, never, false, never>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Position } from '../types';
2
+ type Translate = (dx: number, dy: number) => void;
3
+ type StartEvent = {
4
+ pageX: number;
5
+ pageY: number;
6
+ };
7
+ export declare function useDrag(translate: Translate, getPointer: (e: StartEvent) => Position): {
8
+ start(e: StartEvent): void;
9
+ };
10
+ export {};
package/18/types.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { NgElement as NgEl, NgElementStrategy } from '@angular/elements';
2
+ export type NgElement = NgEl & {
3
+ ngElementStrategy: NgElementStrategy & {
4
+ setInputValue(key: string, value: any): void;
5
+ };
6
+ };
7
+ export type NodeProps = {
8
+ data: any;
9
+ rendered: any;
10
+ emit: any;
11
+ } & NgElement;
12
+ export type Position = {
13
+ x: number;
14
+ y: number;
15
+ };
16
+ export type RenderSignal<Type extends string, Data> = {
17
+ type: 'render';
18
+ data: {
19
+ element: HTMLElement;
20
+ filled?: boolean;
21
+ type: Type;
22
+ } & Data;
23
+ } | {
24
+ type: 'rendered';
25
+ data: {
26
+ element: HTMLElement;
27
+ type: Type;
28
+ } & Data;
29
+ };
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.2.1](https://github.com/retejs/angular-plugin/compare/v2.2.0...v2.2.1) (2024-09-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * fix peer dependencies constraints ([5870f77](https://github.com/retejs/angular-plugin/commit/5870f773b4029d211f99af1490af12196e3b0ccb))
7
+
8
+ # [2.2.0](https://github.com/retejs/angular-plugin/compare/v2.1.2...v2.2.0) (2024-09-14)
9
+
10
+
11
+ ### Features
12
+
13
+ * add support for angular 18 ([3189913](https://github.com/retejs/angular-plugin/commit/31899136770001f8ebde4fe51d7ac2437dfb630d))
14
+
1
15
  ## [2.1.2](https://github.com/retejs/angular-plugin/compare/v2.1.1...v2.1.2) (2024-08-23)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rete-angular-plugin",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "author": "Vitaliy Stoliarov",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -18,9 +18,9 @@
18
18
  "url": "https://github.com/retejs/angular-plugin/issues"
19
19
  },
20
20
  "peerDependencies": {
21
- "@angular/common": ">= 12 < 18",
22
- "@angular/core": ">= 12 < 18",
23
- "@angular/elements": ">= 12 < 18",
21
+ "@angular/common": ">= 12 < 19",
22
+ "@angular/core": ">= 12 < 19",
23
+ "@angular/elements": ">= 12 < 19",
24
24
  "rete": "^2.0.1",
25
25
  "rete-area-plugin": "^2.0.0",
26
26
  "rete-render-utils": "^2.0.0",