angular-three-tweakpane 4.2.3 → 4.2.4

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.
@@ -0,0 +1,102 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { BladeApi, BladeController, View, ViewProps, BaseBladeParams, Emitter } from '@tweakpane/core';
3
+ import { TpPluginBundle } from 'tweakpane';
4
+ import * as i1 from 'angular-three-tweakpane';
5
+
6
+ interface TweakpaneCurvePoint {
7
+ x: number;
8
+ y: number;
9
+ r_in?: number;
10
+ r_out?: number;
11
+ w_in?: number;
12
+ w_out?: number;
13
+ }
14
+ /** Structurally compatible with `NgteEcctrlCurveData` without depending on Ecctrl. */
15
+ interface TweakpaneCurveData {
16
+ points: ReadonlyArray<TweakpaneCurvePoint>;
17
+ samples?: number;
18
+ }
19
+ interface TweakpaneCurveParams {
20
+ minX?: number;
21
+ maxX?: number;
22
+ minY?: number;
23
+ maxY?: number;
24
+ }
25
+ interface CurveBladeParams extends BaseBladeParams, Required<TweakpaneCurveParams> {
26
+ view: 'angular-three-curve';
27
+ value: TweakpaneCurveData;
28
+ label?: string;
29
+ }
30
+ interface CurveEvents {
31
+ change: {
32
+ value: TweakpaneCurveData;
33
+ last: boolean;
34
+ };
35
+ }
36
+ type CurveSelectionKind = 'point' | 'in' | 'out';
37
+ interface CurveSelection {
38
+ index: number;
39
+ kind: CurveSelectionKind;
40
+ }
41
+ declare class CurveView implements View {
42
+ readonly element: HTMLElement;
43
+ readonly svg: SVGSVGElement;
44
+ readonly path: SVGPathElement;
45
+ readonly tangents: SVGGElement;
46
+ readonly points: SVGGElement;
47
+ readonly label: HTMLDivElement;
48
+ constructor(document: Document, viewProps: ViewProps);
49
+ render(value: TweakpaneCurveData, params: Required<TweakpaneCurveParams>, selected: CurveSelection | null): void;
50
+ private renderTangent;
51
+ }
52
+ declare class CurveController extends BladeController<CurveView> {
53
+ readonly params: CurveBladeParams;
54
+ readonly emitter: Emitter<CurveEvents>;
55
+ private curveData;
56
+ private selected;
57
+ private pointerId;
58
+ constructor(document: Document, params: CurveBladeParams, blade: ConstructorParameters<typeof BladeController>[0]['blade'], viewProps: ViewProps);
59
+ getValue(): TweakpaneCurveData;
60
+ setValue(value: TweakpaneCurveData, emit?: boolean, last?: boolean): void;
61
+ private onPointerDown;
62
+ private onPointerMove;
63
+ private onPointerEnd;
64
+ private onDoubleClick;
65
+ private onContextMenu;
66
+ private onKeyDown;
67
+ private moveSelected;
68
+ private updateSelectedPoint;
69
+ private updateSelectedTangent;
70
+ private render;
71
+ private disposeListeners;
72
+ }
73
+ interface TweakpaneCurveApiEvents {
74
+ change: {
75
+ value: TweakpaneCurveData;
76
+ last: boolean;
77
+ };
78
+ }
79
+ declare class TweakpaneCurveApi extends BladeApi<CurveController> {
80
+ get value(): TweakpaneCurveData;
81
+ set value(value: TweakpaneCurveData);
82
+ on(eventName: 'change', handler: (event: TweakpaneCurveApiEvents['change']) => void): this;
83
+ off(eventName: 'change', handler: (event: TweakpaneCurveApiEvents['change']) => void): this;
84
+ }
85
+ declare const TWEAKPANE_CURVE_PLUGIN: TpPluginBundle;
86
+ /** A two-way Tweakpane curve editor compatible with Ecctrl's curve DTO. */
87
+ declare class TweakpaneCurve {
88
+ value: _angular_core.ModelSignal<TweakpaneCurveData>;
89
+ label: _angular_core.InputSignal<string | undefined>;
90
+ params: _angular_core.InputSignal<TweakpaneCurveParams>;
91
+ private readonly folder;
92
+ private readonly pane;
93
+ private readonly blade;
94
+ private readonly api;
95
+ constructor();
96
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TweakpaneCurve, never>;
97
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TweakpaneCurve, "tweakpane-curve", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "params": { "alias": "params"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, [{ directive: typeof i1.TweakpaneBlade; inputs: { "hidden": "hidden"; "disabled": "disabled"; }; outputs: {}; }]>;
98
+ }
99
+ declare function normalizeCurveData(value: TweakpaneCurveData, params?: TweakpaneCurveParams): TweakpaneCurveData;
100
+
101
+ export { TWEAKPANE_CURVE_PLUGIN, TweakpaneCurve, TweakpaneCurveApi, normalizeCurveData };
102
+ export type { TweakpaneCurveApiEvents, TweakpaneCurveData, TweakpaneCurveParams, TweakpaneCurvePoint };
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Signal, ViewContainerRef, ComponentRef, InjectionToken, ElementRef, WritableSignal, Injector } from '@angular/core';
3
- import { BladeApi, FolderApi, TpChangeEvent, ButtonApi, BooleanInputParams, ColorInputParams, NumberInputParams, Point2dInputParams, Point3dInputParams, Point4dInputParams, StringInputParams } from 'tweakpane';
3
+ import { BladeApi, FolderApi, TpChangeEvent, ButtonApi, BooleanInputParams, ColorInputParams, NumberInputParams, TpPluginBundle, Point2dInputParams, Point3dInputParams, Point4dInputParams, StringInputParams } from 'tweakpane';
4
4
  import { BindingParams, TpMouseEvent } from '@tweakpane/core';
5
5
 
6
6
  /**
@@ -623,7 +623,11 @@ declare class TweakpanePane {
623
623
  private tweakpaneAnchor;
624
624
  private pane;
625
625
  private paneContainer?;
626
+ private readonly pendingPlugins;
627
+ private readonly registeredPluginIds;
626
628
  constructor();
629
+ /** Registers a custom Tweakpane plugin before or after the pane is mounted. */
630
+ registerPlugin(plugin: TpPluginBundle): void;
627
631
  /**
628
632
  * Updates a CSS style property on the pane's parent element.
629
633
  * @param propertyName - The name of the style property to update