@fiddle-digital/string-tune 1.1.53 → 1.1.54
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.cjs +613 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +175 -2
- package/dist/index.d.ts +175 -2
- package/dist/index.js +613 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +613 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -524,6 +524,9 @@ declare class StringObject {
|
|
|
524
524
|
* modules it is associated with.
|
|
525
525
|
*/
|
|
526
526
|
remove(): void;
|
|
527
|
+
setInviewAutoBlocked(blocked: boolean): void;
|
|
528
|
+
isInviewAutoBlocked(): boolean;
|
|
529
|
+
syncInviewClass(): void;
|
|
527
530
|
/**
|
|
528
531
|
* Shows the object, applies visual class and notifies connected modules.
|
|
529
532
|
*/
|
|
@@ -1341,6 +1344,9 @@ declare class StringModule implements IStringModule {
|
|
|
1341
1344
|
* 6. Sets the processed attributes as properties on the `StringObject` instance.
|
|
1342
1345
|
*/
|
|
1343
1346
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1347
|
+
protected cacheLayoutSnapshot(object: StringObject, element: HTMLElement): void;
|
|
1348
|
+
private getOffsetSize;
|
|
1349
|
+
private getOffsetChainPosition;
|
|
1344
1350
|
/**
|
|
1345
1351
|
* Calculates object-specific positions or metrics based on the current layout or scroll state.
|
|
1346
1352
|
* This method is intended to be overridden in subclasses if the module needs to precompute
|
|
@@ -1960,6 +1966,7 @@ declare class StringProgress extends StringModule {
|
|
|
1960
1966
|
constructor(context: StringContext);
|
|
1961
1967
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1962
1968
|
private sanitizeRawProgress;
|
|
1969
|
+
private resolveRawProgress;
|
|
1963
1970
|
private applyRawProgress;
|
|
1964
1971
|
private recomputeProgress;
|
|
1965
1972
|
private ensureBatchCapacity;
|
|
@@ -2671,6 +2678,138 @@ declare class ScrollController {
|
|
|
2671
2678
|
scrollTo(position: number, immediate?: boolean): void;
|
|
2672
2679
|
}
|
|
2673
2680
|
|
|
2681
|
+
/**
|
|
2682
|
+
* Discriminated union of all UI field descriptors.
|
|
2683
|
+
* Each devtool module returns an array of these to describe its settings panel.
|
|
2684
|
+
*/
|
|
2685
|
+
type StringDevUIFieldDescriptor = StringDevUIFieldNumber | StringDevUIFieldRange | StringDevUIFieldColor | StringDevUIFieldSelect | StringDevUIFieldToggle | StringDevUIFieldDivider;
|
|
2686
|
+
interface StringDevUIFieldNumber {
|
|
2687
|
+
readonly type: "number";
|
|
2688
|
+
readonly key: string;
|
|
2689
|
+
readonly label: string;
|
|
2690
|
+
readonly default: number;
|
|
2691
|
+
readonly min?: number;
|
|
2692
|
+
readonly max?: number;
|
|
2693
|
+
readonly step?: number;
|
|
2694
|
+
}
|
|
2695
|
+
interface StringDevUIFieldRange {
|
|
2696
|
+
readonly type: "range";
|
|
2697
|
+
readonly key: string;
|
|
2698
|
+
readonly label: string;
|
|
2699
|
+
readonly default: number;
|
|
2700
|
+
readonly min: number;
|
|
2701
|
+
readonly max: number;
|
|
2702
|
+
readonly step?: number;
|
|
2703
|
+
/** When provided, a compact unit dropdown is shown next to the value input. */
|
|
2704
|
+
readonly units?: ReadonlyArray<{
|
|
2705
|
+
value: string;
|
|
2706
|
+
label: string;
|
|
2707
|
+
}>;
|
|
2708
|
+
/** Default unit value (used when no persisted unit exists). */
|
|
2709
|
+
readonly defaultUnit?: string;
|
|
2710
|
+
}
|
|
2711
|
+
interface StringDevUIFieldColor {
|
|
2712
|
+
readonly type: "color";
|
|
2713
|
+
readonly key: string;
|
|
2714
|
+
readonly label: string;
|
|
2715
|
+
readonly default: string;
|
|
2716
|
+
}
|
|
2717
|
+
interface StringDevUIFieldSelect {
|
|
2718
|
+
readonly type: "select";
|
|
2719
|
+
readonly key: string;
|
|
2720
|
+
readonly label: string;
|
|
2721
|
+
readonly default: string;
|
|
2722
|
+
readonly options: ReadonlyArray<{
|
|
2723
|
+
value: string;
|
|
2724
|
+
label: string;
|
|
2725
|
+
}>;
|
|
2726
|
+
}
|
|
2727
|
+
interface StringDevUIFieldToggle {
|
|
2728
|
+
readonly type: "toggle";
|
|
2729
|
+
readonly key: string;
|
|
2730
|
+
readonly label: string;
|
|
2731
|
+
readonly default: boolean;
|
|
2732
|
+
}
|
|
2733
|
+
interface StringDevUIFieldDivider {
|
|
2734
|
+
readonly type: "divider";
|
|
2735
|
+
readonly label?: string;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Abstract base class for all grid adapters.
|
|
2740
|
+
*
|
|
2741
|
+
* Each adapter is a self-contained unit that:
|
|
2742
|
+
* - Declares its own default settings
|
|
2743
|
+
* - Describes its UI schema for the settings panel
|
|
2744
|
+
* - Renders itself into an SVG overlay
|
|
2745
|
+
*
|
|
2746
|
+
* To create a new grid type, extend this class and implement
|
|
2747
|
+
* all abstract members. The system handles everything else.
|
|
2748
|
+
*/
|
|
2749
|
+
declare abstract class GridAdapter {
|
|
2750
|
+
/** Unique type key used for serialization and registry lookup */
|
|
2751
|
+
abstract readonly type: string;
|
|
2752
|
+
/** Human-readable label shown in the HUD menu */
|
|
2753
|
+
abstract readonly label: string;
|
|
2754
|
+
/** SVG icon string (inline SVG markup) */
|
|
2755
|
+
abstract readonly icon: string;
|
|
2756
|
+
/**
|
|
2757
|
+
* Returns the default settings for this adapter.
|
|
2758
|
+
* These are used when a new grid instance is created.
|
|
2759
|
+
*/
|
|
2760
|
+
abstract getDefaults(): Record<string, any>;
|
|
2761
|
+
/**
|
|
2762
|
+
* Returns the UI field descriptors that GridUIBuilder
|
|
2763
|
+
* uses to construct the settings panel.
|
|
2764
|
+
*/
|
|
2765
|
+
abstract getUISchema(): StringDevUIFieldDescriptor[];
|
|
2766
|
+
/**
|
|
2767
|
+
* Renders the grid into the given SVG element.
|
|
2768
|
+
*
|
|
2769
|
+
* @param svg The SVG overlay element (same size as target)
|
|
2770
|
+
* @param width Element width in px
|
|
2771
|
+
* @param height Element height in px
|
|
2772
|
+
* @param settings Current settings for this instance
|
|
2773
|
+
*/
|
|
2774
|
+
abstract render(svg: SVGSVGElement, width: number, height: number, settings: Record<string, any>): void;
|
|
2775
|
+
/**
|
|
2776
|
+
* Removes all elements previously rendered by this adapter.
|
|
2777
|
+
* Default implementation clears the adapter's group element.
|
|
2778
|
+
*/
|
|
2779
|
+
clear(svg: SVGSVGElement, instanceId: string): void;
|
|
2780
|
+
/**
|
|
2781
|
+
* Creates or retrieves a <g> group element scoped to a grid instance.
|
|
2782
|
+
* All rendering should happen inside this group for clean cleanup.
|
|
2783
|
+
*/
|
|
2784
|
+
protected getGroup(svg: SVGSVGElement, instanceId: string): SVGGElement;
|
|
2785
|
+
/**
|
|
2786
|
+
* Helper: creates an SVG line element.
|
|
2787
|
+
*/
|
|
2788
|
+
protected createLine(x1: number, y1: number, x2: number, y2: number, color: string, opacity: number, strokeWidth?: number): SVGLineElement;
|
|
2789
|
+
/**
|
|
2790
|
+
* Helper: creates an SVG rect element.
|
|
2791
|
+
*/
|
|
2792
|
+
protected createRect(x: number, y: number, width: number, height: number, fill: string, opacity: number): SVGRectElement;
|
|
2793
|
+
/**
|
|
2794
|
+
* Converts a value from the given unit to pixels.
|
|
2795
|
+
*
|
|
2796
|
+
* @param value Raw numeric value
|
|
2797
|
+
* @param unit "px" | "%" | "vw" | "vh" | "em" | "rem"
|
|
2798
|
+
* @param dimension Reference dimension (element width or height) for "%" mode
|
|
2799
|
+
*/
|
|
2800
|
+
protected resolveUnit(value: number, unit: string, dimension: number, referenceElement?: Element | null): number;
|
|
2801
|
+
/**
|
|
2802
|
+
* Helper: creates an SVG path element.
|
|
2803
|
+
*/
|
|
2804
|
+
protected createPath(d: string, stroke: string, opacity: number, strokeWidth?: number, fill?: string): SVGPathElement;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
declare function resolveDevtoolsIcon(iconOrId: string): string;
|
|
2808
|
+
|
|
2809
|
+
type StringDevStyleTokens = Record<string, string>;
|
|
2810
|
+
declare function buildDevtoolsThemeBlock(selectors: string | string[], overrides?: StringDevStyleTokens): string;
|
|
2811
|
+
declare function ensureStringDevtoolsSharedStyles(): HTMLStyleElement | null;
|
|
2812
|
+
|
|
2674
2813
|
/**
|
|
2675
2814
|
* What the trigger does when activated.
|
|
2676
2815
|
* Defaults to "toggle" when not specified.
|
|
@@ -2772,6 +2911,22 @@ interface RowsLayoutGrid {
|
|
|
2772
2911
|
}
|
|
2773
2912
|
type RulersLayoutGrid = ColumnsLayoutGrid | RowsLayoutGrid;
|
|
2774
2913
|
|
|
2914
|
+
interface StringDevtoolState {
|
|
2915
|
+
active: boolean;
|
|
2916
|
+
}
|
|
2917
|
+
interface StringDevtoolDefinition {
|
|
2918
|
+
id: string;
|
|
2919
|
+
label: string;
|
|
2920
|
+
icon: string;
|
|
2921
|
+
order?: number;
|
|
2922
|
+
getState: () => StringDevtoolState;
|
|
2923
|
+
setActive: (active: boolean) => void;
|
|
2924
|
+
subscribe?: (listener: (state: StringDevtoolState) => void) => () => void;
|
|
2925
|
+
}
|
|
2926
|
+
interface StringDevtoolProvider {
|
|
2927
|
+
getDevtoolDefinition(): StringDevtoolDefinition | null;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2775
2930
|
interface ModuleBatchContext {
|
|
2776
2931
|
module: StringModule;
|
|
2777
2932
|
object: StringObject;
|
|
@@ -2860,6 +3015,9 @@ declare class StringTune {
|
|
|
2860
3015
|
private centers;
|
|
2861
3016
|
/** Tracks hover states of string objects. */
|
|
2862
3017
|
private hoverManager;
|
|
3018
|
+
private devtools;
|
|
3019
|
+
private devtoolsFpsLastSampleTime;
|
|
3020
|
+
private devtoolsFpsFrameCount;
|
|
2863
3021
|
private observerContainerResize;
|
|
2864
3022
|
canRebuild: boolean;
|
|
2865
3023
|
/**
|
|
@@ -3057,6 +3215,7 @@ declare class StringTune {
|
|
|
3057
3215
|
* Triggers scroll engine, modules, and global `update` event.
|
|
3058
3216
|
*/
|
|
3059
3217
|
private onUpdateEvent;
|
|
3218
|
+
private updateDevtoolsFPS;
|
|
3060
3219
|
/**
|
|
3061
3220
|
* Handles resize events from scroll container or window.
|
|
3062
3221
|
* Ignores height-only changes on mobile to prevent layout jumps.
|
|
@@ -3064,11 +3223,25 @@ declare class StringTune {
|
|
|
3064
3223
|
*/
|
|
3065
3224
|
onResize(force?: boolean): void;
|
|
3066
3225
|
invalidateCenter(id: string): void;
|
|
3067
|
-
scrollTo(
|
|
3226
|
+
scrollTo(position: number): void;
|
|
3227
|
+
scrollTo(selector: string): void;
|
|
3228
|
+
scrollTo(element: HTMLElement): void;
|
|
3229
|
+
scrollTo(options: {
|
|
3068
3230
|
position: number;
|
|
3069
3231
|
immediate?: boolean;
|
|
3232
|
+
offset?: number;
|
|
3233
|
+
} | {
|
|
3234
|
+
selector: string;
|
|
3235
|
+
immediate?: boolean;
|
|
3236
|
+
offset?: number;
|
|
3237
|
+
} | {
|
|
3238
|
+
element: HTMLElement;
|
|
3239
|
+
immediate?: boolean;
|
|
3240
|
+
offset?: number;
|
|
3070
3241
|
}): void;
|
|
3242
|
+
private resolveScrollToValue;
|
|
3243
|
+
private resolveElementScrollPosition;
|
|
3071
3244
|
destroy(): void;
|
|
3072
3245
|
}
|
|
3073
3246
|
|
|
3074
|
-
export { CursorReactiveModule, DOMBatcher, type RulersLayoutGrid, type RulersTriggerAction, ScrollController, type ScrollMarkRule as ScrollTriggerRule, StringAnchor, type StringContext, StringCursor, StringData, StringDelayLerpTracker, StringFPSTracker, StringForm, StringGlide, StringImpulse, StringLazy, StringLerp, StringLerpTracker, StringLoading, StringMagnetic, StringMasonry, StringModule, StringObject, StringParallax, StringPositionTracker, StringProgress, StringProgressPart, StringRandom, StringResponsive, type StringRulersTrigger, StringScrollContainer, StringScrollbar, StringScroller, StringSequence, StringSplit, StringSpotlight, StringTune, StringVideoAutoplay, StringTune as default, frameDOM, styleTxn };
|
|
3247
|
+
export { CursorReactiveModule, DOMBatcher, GridAdapter, type RulersLayoutGrid, type RulersTriggerAction, ScrollController, type ScrollMarkRule as ScrollTriggerRule, StringAnchor, type StringContext, StringCursor, StringData, StringDelayLerpTracker, type StringDevStyleTokens, type StringDevtoolDefinition, type StringDevtoolProvider, type StringDevtoolState, StringFPSTracker, StringForm, StringGlide, StringImpulse, StringLazy, StringLerp, StringLerpTracker, StringLoading, StringMagnetic, StringMasonry, StringModule, StringObject, StringParallax, StringPositionTracker, StringProgress, StringProgressPart, StringRandom, StringResponsive, type StringRulersTrigger, StringScrollContainer, StringScrollbar, StringScroller, StringSequence, StringSplit, StringSpotlight, StringTune, StringVideoAutoplay, buildDevtoolsThemeBlock, StringTune as default, ensureStringDevtoolsSharedStyles, frameDOM, resolveDevtoolsIcon, styleTxn };
|
package/dist/index.d.ts
CHANGED
|
@@ -524,6 +524,9 @@ declare class StringObject {
|
|
|
524
524
|
* modules it is associated with.
|
|
525
525
|
*/
|
|
526
526
|
remove(): void;
|
|
527
|
+
setInviewAutoBlocked(blocked: boolean): void;
|
|
528
|
+
isInviewAutoBlocked(): boolean;
|
|
529
|
+
syncInviewClass(): void;
|
|
527
530
|
/**
|
|
528
531
|
* Shows the object, applies visual class and notifies connected modules.
|
|
529
532
|
*/
|
|
@@ -1341,6 +1344,9 @@ declare class StringModule implements IStringModule {
|
|
|
1341
1344
|
* 6. Sets the processed attributes as properties on the `StringObject` instance.
|
|
1342
1345
|
*/
|
|
1343
1346
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1347
|
+
protected cacheLayoutSnapshot(object: StringObject, element: HTMLElement): void;
|
|
1348
|
+
private getOffsetSize;
|
|
1349
|
+
private getOffsetChainPosition;
|
|
1344
1350
|
/**
|
|
1345
1351
|
* Calculates object-specific positions or metrics based on the current layout or scroll state.
|
|
1346
1352
|
* This method is intended to be overridden in subclasses if the module needs to precompute
|
|
@@ -1960,6 +1966,7 @@ declare class StringProgress extends StringModule {
|
|
|
1960
1966
|
constructor(context: StringContext);
|
|
1961
1967
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1962
1968
|
private sanitizeRawProgress;
|
|
1969
|
+
private resolveRawProgress;
|
|
1963
1970
|
private applyRawProgress;
|
|
1964
1971
|
private recomputeProgress;
|
|
1965
1972
|
private ensureBatchCapacity;
|
|
@@ -2671,6 +2678,138 @@ declare class ScrollController {
|
|
|
2671
2678
|
scrollTo(position: number, immediate?: boolean): void;
|
|
2672
2679
|
}
|
|
2673
2680
|
|
|
2681
|
+
/**
|
|
2682
|
+
* Discriminated union of all UI field descriptors.
|
|
2683
|
+
* Each devtool module returns an array of these to describe its settings panel.
|
|
2684
|
+
*/
|
|
2685
|
+
type StringDevUIFieldDescriptor = StringDevUIFieldNumber | StringDevUIFieldRange | StringDevUIFieldColor | StringDevUIFieldSelect | StringDevUIFieldToggle | StringDevUIFieldDivider;
|
|
2686
|
+
interface StringDevUIFieldNumber {
|
|
2687
|
+
readonly type: "number";
|
|
2688
|
+
readonly key: string;
|
|
2689
|
+
readonly label: string;
|
|
2690
|
+
readonly default: number;
|
|
2691
|
+
readonly min?: number;
|
|
2692
|
+
readonly max?: number;
|
|
2693
|
+
readonly step?: number;
|
|
2694
|
+
}
|
|
2695
|
+
interface StringDevUIFieldRange {
|
|
2696
|
+
readonly type: "range";
|
|
2697
|
+
readonly key: string;
|
|
2698
|
+
readonly label: string;
|
|
2699
|
+
readonly default: number;
|
|
2700
|
+
readonly min: number;
|
|
2701
|
+
readonly max: number;
|
|
2702
|
+
readonly step?: number;
|
|
2703
|
+
/** When provided, a compact unit dropdown is shown next to the value input. */
|
|
2704
|
+
readonly units?: ReadonlyArray<{
|
|
2705
|
+
value: string;
|
|
2706
|
+
label: string;
|
|
2707
|
+
}>;
|
|
2708
|
+
/** Default unit value (used when no persisted unit exists). */
|
|
2709
|
+
readonly defaultUnit?: string;
|
|
2710
|
+
}
|
|
2711
|
+
interface StringDevUIFieldColor {
|
|
2712
|
+
readonly type: "color";
|
|
2713
|
+
readonly key: string;
|
|
2714
|
+
readonly label: string;
|
|
2715
|
+
readonly default: string;
|
|
2716
|
+
}
|
|
2717
|
+
interface StringDevUIFieldSelect {
|
|
2718
|
+
readonly type: "select";
|
|
2719
|
+
readonly key: string;
|
|
2720
|
+
readonly label: string;
|
|
2721
|
+
readonly default: string;
|
|
2722
|
+
readonly options: ReadonlyArray<{
|
|
2723
|
+
value: string;
|
|
2724
|
+
label: string;
|
|
2725
|
+
}>;
|
|
2726
|
+
}
|
|
2727
|
+
interface StringDevUIFieldToggle {
|
|
2728
|
+
readonly type: "toggle";
|
|
2729
|
+
readonly key: string;
|
|
2730
|
+
readonly label: string;
|
|
2731
|
+
readonly default: boolean;
|
|
2732
|
+
}
|
|
2733
|
+
interface StringDevUIFieldDivider {
|
|
2734
|
+
readonly type: "divider";
|
|
2735
|
+
readonly label?: string;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Abstract base class for all grid adapters.
|
|
2740
|
+
*
|
|
2741
|
+
* Each adapter is a self-contained unit that:
|
|
2742
|
+
* - Declares its own default settings
|
|
2743
|
+
* - Describes its UI schema for the settings panel
|
|
2744
|
+
* - Renders itself into an SVG overlay
|
|
2745
|
+
*
|
|
2746
|
+
* To create a new grid type, extend this class and implement
|
|
2747
|
+
* all abstract members. The system handles everything else.
|
|
2748
|
+
*/
|
|
2749
|
+
declare abstract class GridAdapter {
|
|
2750
|
+
/** Unique type key used for serialization and registry lookup */
|
|
2751
|
+
abstract readonly type: string;
|
|
2752
|
+
/** Human-readable label shown in the HUD menu */
|
|
2753
|
+
abstract readonly label: string;
|
|
2754
|
+
/** SVG icon string (inline SVG markup) */
|
|
2755
|
+
abstract readonly icon: string;
|
|
2756
|
+
/**
|
|
2757
|
+
* Returns the default settings for this adapter.
|
|
2758
|
+
* These are used when a new grid instance is created.
|
|
2759
|
+
*/
|
|
2760
|
+
abstract getDefaults(): Record<string, any>;
|
|
2761
|
+
/**
|
|
2762
|
+
* Returns the UI field descriptors that GridUIBuilder
|
|
2763
|
+
* uses to construct the settings panel.
|
|
2764
|
+
*/
|
|
2765
|
+
abstract getUISchema(): StringDevUIFieldDescriptor[];
|
|
2766
|
+
/**
|
|
2767
|
+
* Renders the grid into the given SVG element.
|
|
2768
|
+
*
|
|
2769
|
+
* @param svg The SVG overlay element (same size as target)
|
|
2770
|
+
* @param width Element width in px
|
|
2771
|
+
* @param height Element height in px
|
|
2772
|
+
* @param settings Current settings for this instance
|
|
2773
|
+
*/
|
|
2774
|
+
abstract render(svg: SVGSVGElement, width: number, height: number, settings: Record<string, any>): void;
|
|
2775
|
+
/**
|
|
2776
|
+
* Removes all elements previously rendered by this adapter.
|
|
2777
|
+
* Default implementation clears the adapter's group element.
|
|
2778
|
+
*/
|
|
2779
|
+
clear(svg: SVGSVGElement, instanceId: string): void;
|
|
2780
|
+
/**
|
|
2781
|
+
* Creates or retrieves a <g> group element scoped to a grid instance.
|
|
2782
|
+
* All rendering should happen inside this group for clean cleanup.
|
|
2783
|
+
*/
|
|
2784
|
+
protected getGroup(svg: SVGSVGElement, instanceId: string): SVGGElement;
|
|
2785
|
+
/**
|
|
2786
|
+
* Helper: creates an SVG line element.
|
|
2787
|
+
*/
|
|
2788
|
+
protected createLine(x1: number, y1: number, x2: number, y2: number, color: string, opacity: number, strokeWidth?: number): SVGLineElement;
|
|
2789
|
+
/**
|
|
2790
|
+
* Helper: creates an SVG rect element.
|
|
2791
|
+
*/
|
|
2792
|
+
protected createRect(x: number, y: number, width: number, height: number, fill: string, opacity: number): SVGRectElement;
|
|
2793
|
+
/**
|
|
2794
|
+
* Converts a value from the given unit to pixels.
|
|
2795
|
+
*
|
|
2796
|
+
* @param value Raw numeric value
|
|
2797
|
+
* @param unit "px" | "%" | "vw" | "vh" | "em" | "rem"
|
|
2798
|
+
* @param dimension Reference dimension (element width or height) for "%" mode
|
|
2799
|
+
*/
|
|
2800
|
+
protected resolveUnit(value: number, unit: string, dimension: number, referenceElement?: Element | null): number;
|
|
2801
|
+
/**
|
|
2802
|
+
* Helper: creates an SVG path element.
|
|
2803
|
+
*/
|
|
2804
|
+
protected createPath(d: string, stroke: string, opacity: number, strokeWidth?: number, fill?: string): SVGPathElement;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
declare function resolveDevtoolsIcon(iconOrId: string): string;
|
|
2808
|
+
|
|
2809
|
+
type StringDevStyleTokens = Record<string, string>;
|
|
2810
|
+
declare function buildDevtoolsThemeBlock(selectors: string | string[], overrides?: StringDevStyleTokens): string;
|
|
2811
|
+
declare function ensureStringDevtoolsSharedStyles(): HTMLStyleElement | null;
|
|
2812
|
+
|
|
2674
2813
|
/**
|
|
2675
2814
|
* What the trigger does when activated.
|
|
2676
2815
|
* Defaults to "toggle" when not specified.
|
|
@@ -2772,6 +2911,22 @@ interface RowsLayoutGrid {
|
|
|
2772
2911
|
}
|
|
2773
2912
|
type RulersLayoutGrid = ColumnsLayoutGrid | RowsLayoutGrid;
|
|
2774
2913
|
|
|
2914
|
+
interface StringDevtoolState {
|
|
2915
|
+
active: boolean;
|
|
2916
|
+
}
|
|
2917
|
+
interface StringDevtoolDefinition {
|
|
2918
|
+
id: string;
|
|
2919
|
+
label: string;
|
|
2920
|
+
icon: string;
|
|
2921
|
+
order?: number;
|
|
2922
|
+
getState: () => StringDevtoolState;
|
|
2923
|
+
setActive: (active: boolean) => void;
|
|
2924
|
+
subscribe?: (listener: (state: StringDevtoolState) => void) => () => void;
|
|
2925
|
+
}
|
|
2926
|
+
interface StringDevtoolProvider {
|
|
2927
|
+
getDevtoolDefinition(): StringDevtoolDefinition | null;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2775
2930
|
interface ModuleBatchContext {
|
|
2776
2931
|
module: StringModule;
|
|
2777
2932
|
object: StringObject;
|
|
@@ -2860,6 +3015,9 @@ declare class StringTune {
|
|
|
2860
3015
|
private centers;
|
|
2861
3016
|
/** Tracks hover states of string objects. */
|
|
2862
3017
|
private hoverManager;
|
|
3018
|
+
private devtools;
|
|
3019
|
+
private devtoolsFpsLastSampleTime;
|
|
3020
|
+
private devtoolsFpsFrameCount;
|
|
2863
3021
|
private observerContainerResize;
|
|
2864
3022
|
canRebuild: boolean;
|
|
2865
3023
|
/**
|
|
@@ -3057,6 +3215,7 @@ declare class StringTune {
|
|
|
3057
3215
|
* Triggers scroll engine, modules, and global `update` event.
|
|
3058
3216
|
*/
|
|
3059
3217
|
private onUpdateEvent;
|
|
3218
|
+
private updateDevtoolsFPS;
|
|
3060
3219
|
/**
|
|
3061
3220
|
* Handles resize events from scroll container or window.
|
|
3062
3221
|
* Ignores height-only changes on mobile to prevent layout jumps.
|
|
@@ -3064,11 +3223,25 @@ declare class StringTune {
|
|
|
3064
3223
|
*/
|
|
3065
3224
|
onResize(force?: boolean): void;
|
|
3066
3225
|
invalidateCenter(id: string): void;
|
|
3067
|
-
scrollTo(
|
|
3226
|
+
scrollTo(position: number): void;
|
|
3227
|
+
scrollTo(selector: string): void;
|
|
3228
|
+
scrollTo(element: HTMLElement): void;
|
|
3229
|
+
scrollTo(options: {
|
|
3068
3230
|
position: number;
|
|
3069
3231
|
immediate?: boolean;
|
|
3232
|
+
offset?: number;
|
|
3233
|
+
} | {
|
|
3234
|
+
selector: string;
|
|
3235
|
+
immediate?: boolean;
|
|
3236
|
+
offset?: number;
|
|
3237
|
+
} | {
|
|
3238
|
+
element: HTMLElement;
|
|
3239
|
+
immediate?: boolean;
|
|
3240
|
+
offset?: number;
|
|
3070
3241
|
}): void;
|
|
3242
|
+
private resolveScrollToValue;
|
|
3243
|
+
private resolveElementScrollPosition;
|
|
3071
3244
|
destroy(): void;
|
|
3072
3245
|
}
|
|
3073
3246
|
|
|
3074
|
-
export { CursorReactiveModule, DOMBatcher, type RulersLayoutGrid, type RulersTriggerAction, ScrollController, type ScrollMarkRule as ScrollTriggerRule, StringAnchor, type StringContext, StringCursor, StringData, StringDelayLerpTracker, StringFPSTracker, StringForm, StringGlide, StringImpulse, StringLazy, StringLerp, StringLerpTracker, StringLoading, StringMagnetic, StringMasonry, StringModule, StringObject, StringParallax, StringPositionTracker, StringProgress, StringProgressPart, StringRandom, StringResponsive, type StringRulersTrigger, StringScrollContainer, StringScrollbar, StringScroller, StringSequence, StringSplit, StringSpotlight, StringTune, StringVideoAutoplay, StringTune as default, frameDOM, styleTxn };
|
|
3247
|
+
export { CursorReactiveModule, DOMBatcher, GridAdapter, type RulersLayoutGrid, type RulersTriggerAction, ScrollController, type ScrollMarkRule as ScrollTriggerRule, StringAnchor, type StringContext, StringCursor, StringData, StringDelayLerpTracker, type StringDevStyleTokens, type StringDevtoolDefinition, type StringDevtoolProvider, type StringDevtoolState, StringFPSTracker, StringForm, StringGlide, StringImpulse, StringLazy, StringLerp, StringLerpTracker, StringLoading, StringMagnetic, StringMasonry, StringModule, StringObject, StringParallax, StringPositionTracker, StringProgress, StringProgressPart, StringRandom, StringResponsive, type StringRulersTrigger, StringScrollContainer, StringScrollbar, StringScroller, StringSequence, StringSplit, StringSpotlight, StringTune, StringVideoAutoplay, buildDevtoolsThemeBlock, StringTune as default, ensureStringDevtoolsSharedStyles, frameDOM, resolveDevtoolsIcon, styleTxn };
|