@fiddle-digital/string-tune 1.1.51-alpha.0 → 1.1.52
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 +4 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +92 -153
- package/dist/index.d.ts +92 -153
- package/dist/index.js +4 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1058,7 +1058,7 @@ interface ISplitOptionItem {
|
|
|
1058
1058
|
* Holds arrays of option definitions for each split type.
|
|
1059
1059
|
*/
|
|
1060
1060
|
interface ISplitOptions {
|
|
1061
|
-
fit?:
|
|
1061
|
+
fit?: boolean;
|
|
1062
1062
|
line?: ISplitOptionItem[];
|
|
1063
1063
|
word?: ISplitOptionItem[];
|
|
1064
1064
|
char?: ISplitOptionItem[];
|
|
@@ -1737,6 +1737,7 @@ declare class StringCursor extends StringModule {
|
|
|
1737
1737
|
private getFrameAdjustedLerp;
|
|
1738
1738
|
private getObjectDimensions;
|
|
1739
1739
|
private calculateOffset;
|
|
1740
|
+
private reverseOffset;
|
|
1740
1741
|
removeObject(id: string): void;
|
|
1741
1742
|
destroy(): void;
|
|
1742
1743
|
}
|
|
@@ -2670,167 +2671,105 @@ declare class ScrollController {
|
|
|
2670
2671
|
}
|
|
2671
2672
|
|
|
2672
2673
|
/**
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
*
|
|
2679
|
-
* through the interactive HUD panel (hover top-right corner).
|
|
2674
|
+
* What the trigger does when activated.
|
|
2675
|
+
* Defaults to "toggle" when not specified.
|
|
2676
|
+
*/
|
|
2677
|
+
type RulersTriggerAction = "toggle" | "show" | "hide";
|
|
2678
|
+
/**
|
|
2679
|
+
* Keyboard shortcut trigger.
|
|
2680
2680
|
*
|
|
2681
|
-
*
|
|
2682
|
-
*
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
onObjectConnected(object: StringObject): void;
|
|
2694
|
-
onObjectDisconnected(object: StringObject): void;
|
|
2695
|
-
onResize(): void;
|
|
2696
|
-
destroy(): void;
|
|
2697
|
-
private handleAdd;
|
|
2698
|
-
private handleRemove;
|
|
2699
|
-
private handleToggle;
|
|
2700
|
-
private handleSettingChange;
|
|
2701
|
-
private renderElement;
|
|
2702
|
-
private refreshHUD;
|
|
2703
|
-
private destroyElement;
|
|
2704
|
-
private registerBuiltInAdapters;
|
|
2705
|
-
private registerExternalAdapters;
|
|
2706
|
-
private injectStyles;
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
/**
|
|
2710
|
-
* Discriminated union of all UI field descriptors.
|
|
2711
|
-
* Each adapter returns an array of these to describe its settings panel.
|
|
2712
|
-
*/
|
|
2713
|
-
type UIFieldDescriptor = UIFieldNumber | UIFieldRange | UIFieldColor | UIFieldSelect | UIFieldToggle | UIFieldDivider;
|
|
2714
|
-
interface UIFieldNumber {
|
|
2715
|
-
readonly type: "number";
|
|
2716
|
-
readonly key: string;
|
|
2717
|
-
readonly label: string;
|
|
2718
|
-
readonly default: number;
|
|
2719
|
-
readonly min?: number;
|
|
2720
|
-
readonly max?: number;
|
|
2721
|
-
readonly step?: number;
|
|
2722
|
-
}
|
|
2723
|
-
interface UIFieldRange {
|
|
2724
|
-
readonly type: "range";
|
|
2725
|
-
readonly key: string;
|
|
2726
|
-
readonly label: string;
|
|
2727
|
-
readonly default: number;
|
|
2728
|
-
readonly min: number;
|
|
2729
|
-
readonly max: number;
|
|
2730
|
-
readonly step?: number;
|
|
2731
|
-
/** When provided, a compact unit dropdown is shown next to the value input. */
|
|
2732
|
-
readonly units?: ReadonlyArray<{
|
|
2733
|
-
value: string;
|
|
2734
|
-
label: string;
|
|
2735
|
-
}>;
|
|
2736
|
-
/** Default unit value (used when no persisted unit exists). */
|
|
2737
|
-
readonly defaultUnit?: string;
|
|
2738
|
-
}
|
|
2739
|
-
interface UIFieldColor {
|
|
2740
|
-
readonly type: "color";
|
|
2741
|
-
readonly key: string;
|
|
2742
|
-
readonly label: string;
|
|
2743
|
-
readonly default: string;
|
|
2744
|
-
}
|
|
2745
|
-
interface UIFieldSelect {
|
|
2746
|
-
readonly type: "select";
|
|
2747
|
-
readonly key: string;
|
|
2748
|
-
readonly label: string;
|
|
2749
|
-
readonly default: string;
|
|
2750
|
-
readonly options: ReadonlyArray<{
|
|
2751
|
-
value: string;
|
|
2752
|
-
label: string;
|
|
2753
|
-
}>;
|
|
2681
|
+
* @example
|
|
2682
|
+
* { type: "keyboard", key: "R", shiftKey: true }
|
|
2683
|
+
*/
|
|
2684
|
+
interface KeyboardRulersTrigger {
|
|
2685
|
+
type: "keyboard";
|
|
2686
|
+
/** The KeyboardEvent.key value (case-sensitive, e.g. "R", "g", "F2"). */
|
|
2687
|
+
key: string;
|
|
2688
|
+
shiftKey?: boolean;
|
|
2689
|
+
ctrlKey?: boolean;
|
|
2690
|
+
altKey?: boolean;
|
|
2691
|
+
metaKey?: boolean;
|
|
2692
|
+
action?: RulersTriggerAction;
|
|
2754
2693
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2694
|
+
/**
|
|
2695
|
+
* DOM element trigger — binds to one or more elements matching a CSS selector.
|
|
2696
|
+
* The element(s) must exist in the DOM when the module subscribes (at `start()` time).
|
|
2697
|
+
* For dynamically-added controls, prefer `type: "event"` instead.
|
|
2698
|
+
*
|
|
2699
|
+
* @example
|
|
2700
|
+
* { type: "element", selector: "#rulers-toggle-btn" }
|
|
2701
|
+
* { type: "element", selector: ".dev-toolbar [data-action='rulers']", event: "pointerdown" }
|
|
2702
|
+
*/
|
|
2703
|
+
interface ElementRulersTrigger {
|
|
2704
|
+
type: "element";
|
|
2705
|
+
/** CSS selector. All matching elements are bound. */
|
|
2706
|
+
selector: string;
|
|
2707
|
+
/** DOM event type. Defaults to "click". */
|
|
2708
|
+
event?: string;
|
|
2709
|
+
action?: RulersTriggerAction;
|
|
2760
2710
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2711
|
+
/**
|
|
2712
|
+
* StringTune event-bus trigger — reacts to a named event emitted via the event manager.
|
|
2713
|
+
* Useful for toolbar integrations, programmatic control, and cross-module communication.
|
|
2714
|
+
*
|
|
2715
|
+
* @example
|
|
2716
|
+
* { type: "event", name: "dev:rulers:toggle" }
|
|
2717
|
+
*
|
|
2718
|
+
* Activate via:
|
|
2719
|
+
* stringTune.emit("dev:rulers:toggle", null)
|
|
2720
|
+
*/
|
|
2721
|
+
interface EventRulersTrigger {
|
|
2722
|
+
type: "event";
|
|
2723
|
+
/** Event name on the StringTune event bus. */
|
|
2724
|
+
name: string;
|
|
2725
|
+
action?: RulersTriggerAction;
|
|
2764
2726
|
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Discriminated union of all supported ruler trigger descriptors.
|
|
2729
|
+
*/
|
|
2730
|
+
type StringRulersTrigger = KeyboardRulersTrigger | ElementRulersTrigger | EventRulersTrigger;
|
|
2765
2731
|
|
|
2766
2732
|
/**
|
|
2767
|
-
*
|
|
2733
|
+
* Column-based layout grid.
|
|
2734
|
+
*
|
|
2735
|
+
* Displays a fixed set of equally-spaced column bands across the viewport.
|
|
2736
|
+
* Column width is derived from the viewport width, margins, count, and gap.
|
|
2737
|
+
*
|
|
2738
|
+
* @example
|
|
2739
|
+
* { type: "columns", count: 12, marginLeft: 40, marginRight: 40, gap: 20 }
|
|
2740
|
+
*/
|
|
2741
|
+
interface ColumnsLayoutGrid {
|
|
2742
|
+
type: "columns";
|
|
2743
|
+
/** Number of columns. */
|
|
2744
|
+
count: number;
|
|
2745
|
+
/** Space reserved on the left edge of the viewport (px). Default: 0. */
|
|
2746
|
+
marginLeft?: number;
|
|
2747
|
+
/** Space reserved on the right edge of the viewport (px). Default: 0. */
|
|
2748
|
+
marginRight?: number;
|
|
2749
|
+
/** Gutter between columns (px). Default: 0. */
|
|
2750
|
+
gap?: number;
|
|
2751
|
+
/** Fill color for column bands. Default: "rgba(255, 0, 80, 0.08)". */
|
|
2752
|
+
color?: string;
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* Row-based layout grid.
|
|
2768
2756
|
*
|
|
2769
|
-
*
|
|
2770
|
-
*
|
|
2771
|
-
* - Describes its UI schema for the settings panel
|
|
2772
|
-
* - Renders itself into an SVG overlay
|
|
2757
|
+
* Displays repeating horizontal stripes across the full document height.
|
|
2758
|
+
* Stripes scroll with the page content.
|
|
2773
2759
|
*
|
|
2774
|
-
*
|
|
2775
|
-
*
|
|
2760
|
+
* @example
|
|
2761
|
+
* { type: "rows", height: 8, gap: 0 }
|
|
2776
2762
|
*/
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
* Returns the default settings for this adapter.
|
|
2786
|
-
* These are used when a new grid instance is created.
|
|
2787
|
-
*/
|
|
2788
|
-
abstract getDefaults(): Record<string, any>;
|
|
2789
|
-
/**
|
|
2790
|
-
* Returns the UI field descriptors that GridUIBuilder
|
|
2791
|
-
* uses to construct the settings panel.
|
|
2792
|
-
*/
|
|
2793
|
-
abstract getUISchema(): UIFieldDescriptor[];
|
|
2794
|
-
/**
|
|
2795
|
-
* Renders the grid into the given SVG element.
|
|
2796
|
-
*
|
|
2797
|
-
* @param svg The SVG overlay element (same size as target)
|
|
2798
|
-
* @param width Element width in px
|
|
2799
|
-
* @param height Element height in px
|
|
2800
|
-
* @param settings Current settings for this instance
|
|
2801
|
-
*/
|
|
2802
|
-
abstract render(svg: SVGSVGElement, width: number, height: number, settings: Record<string, any>): void;
|
|
2803
|
-
/**
|
|
2804
|
-
* Removes all elements previously rendered by this adapter.
|
|
2805
|
-
* Default implementation clears the adapter's group element.
|
|
2806
|
-
*/
|
|
2807
|
-
clear(svg: SVGSVGElement, instanceId: string): void;
|
|
2808
|
-
/**
|
|
2809
|
-
* Creates or retrieves a <g> group element scoped to a grid instance.
|
|
2810
|
-
* All rendering should happen inside this group for clean cleanup.
|
|
2811
|
-
*/
|
|
2812
|
-
protected getGroup(svg: SVGSVGElement, instanceId: string): SVGGElement;
|
|
2813
|
-
/**
|
|
2814
|
-
* Helper: creates an SVG line element.
|
|
2815
|
-
*/
|
|
2816
|
-
protected createLine(x1: number, y1: number, x2: number, y2: number, color: string, opacity: number, strokeWidth?: number): SVGLineElement;
|
|
2817
|
-
/**
|
|
2818
|
-
* Helper: creates an SVG rect element.
|
|
2819
|
-
*/
|
|
2820
|
-
protected createRect(x: number, y: number, width: number, height: number, fill: string, opacity: number): SVGRectElement;
|
|
2821
|
-
/**
|
|
2822
|
-
* Converts a value from the given unit to pixels.
|
|
2823
|
-
*
|
|
2824
|
-
* @param value Raw numeric value
|
|
2825
|
-
* @param unit "px" | "%" | "vw" | "vh"
|
|
2826
|
-
* @param dimension Reference dimension (element width or height) for "%" mode
|
|
2827
|
-
*/
|
|
2828
|
-
protected resolveUnit(value: number, unit: string, dimension: number): number;
|
|
2829
|
-
/**
|
|
2830
|
-
* Helper: creates an SVG path element.
|
|
2831
|
-
*/
|
|
2832
|
-
protected createPath(d: string, stroke: string, opacity: number, strokeWidth?: number, fill?: string): SVGPathElement;
|
|
2763
|
+
interface RowsLayoutGrid {
|
|
2764
|
+
type: "rows";
|
|
2765
|
+
/** Height of each row band (px). */
|
|
2766
|
+
height: number;
|
|
2767
|
+
/** Gap between row bands (px). Default: 0. */
|
|
2768
|
+
gap?: number;
|
|
2769
|
+
/** Fill color for row bands. Default: "rgba(0, 120, 255, 0.06)". */
|
|
2770
|
+
color?: string;
|
|
2833
2771
|
}
|
|
2772
|
+
type RulersLayoutGrid = ColumnsLayoutGrid | RowsLayoutGrid;
|
|
2834
2773
|
|
|
2835
2774
|
interface ModuleBatchContext {
|
|
2836
2775
|
module: StringModule;
|
|
@@ -3131,4 +3070,4 @@ declare class StringTune {
|
|
|
3131
3070
|
destroy(): void;
|
|
3132
3071
|
}
|
|
3133
3072
|
|
|
3134
|
-
export { CursorReactiveModule, DOMBatcher,
|
|
3073
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1058,7 +1058,7 @@ interface ISplitOptionItem {
|
|
|
1058
1058
|
* Holds arrays of option definitions for each split type.
|
|
1059
1059
|
*/
|
|
1060
1060
|
interface ISplitOptions {
|
|
1061
|
-
fit?:
|
|
1061
|
+
fit?: boolean;
|
|
1062
1062
|
line?: ISplitOptionItem[];
|
|
1063
1063
|
word?: ISplitOptionItem[];
|
|
1064
1064
|
char?: ISplitOptionItem[];
|
|
@@ -1737,6 +1737,7 @@ declare class StringCursor extends StringModule {
|
|
|
1737
1737
|
private getFrameAdjustedLerp;
|
|
1738
1738
|
private getObjectDimensions;
|
|
1739
1739
|
private calculateOffset;
|
|
1740
|
+
private reverseOffset;
|
|
1740
1741
|
removeObject(id: string): void;
|
|
1741
1742
|
destroy(): void;
|
|
1742
1743
|
}
|
|
@@ -2670,167 +2671,105 @@ declare class ScrollController {
|
|
|
2670
2671
|
}
|
|
2671
2672
|
|
|
2672
2673
|
/**
|
|
2673
|
-
*
|
|
2674
|
-
*
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
*
|
|
2679
|
-
* through the interactive HUD panel (hover top-right corner).
|
|
2674
|
+
* What the trigger does when activated.
|
|
2675
|
+
* Defaults to "toggle" when not specified.
|
|
2676
|
+
*/
|
|
2677
|
+
type RulersTriggerAction = "toggle" | "show" | "hide";
|
|
2678
|
+
/**
|
|
2679
|
+
* Keyboard shortcut trigger.
|
|
2680
2680
|
*
|
|
2681
|
-
*
|
|
2682
|
-
*
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
onObjectConnected(object: StringObject): void;
|
|
2694
|
-
onObjectDisconnected(object: StringObject): void;
|
|
2695
|
-
onResize(): void;
|
|
2696
|
-
destroy(): void;
|
|
2697
|
-
private handleAdd;
|
|
2698
|
-
private handleRemove;
|
|
2699
|
-
private handleToggle;
|
|
2700
|
-
private handleSettingChange;
|
|
2701
|
-
private renderElement;
|
|
2702
|
-
private refreshHUD;
|
|
2703
|
-
private destroyElement;
|
|
2704
|
-
private registerBuiltInAdapters;
|
|
2705
|
-
private registerExternalAdapters;
|
|
2706
|
-
private injectStyles;
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
/**
|
|
2710
|
-
* Discriminated union of all UI field descriptors.
|
|
2711
|
-
* Each adapter returns an array of these to describe its settings panel.
|
|
2712
|
-
*/
|
|
2713
|
-
type UIFieldDescriptor = UIFieldNumber | UIFieldRange | UIFieldColor | UIFieldSelect | UIFieldToggle | UIFieldDivider;
|
|
2714
|
-
interface UIFieldNumber {
|
|
2715
|
-
readonly type: "number";
|
|
2716
|
-
readonly key: string;
|
|
2717
|
-
readonly label: string;
|
|
2718
|
-
readonly default: number;
|
|
2719
|
-
readonly min?: number;
|
|
2720
|
-
readonly max?: number;
|
|
2721
|
-
readonly step?: number;
|
|
2722
|
-
}
|
|
2723
|
-
interface UIFieldRange {
|
|
2724
|
-
readonly type: "range";
|
|
2725
|
-
readonly key: string;
|
|
2726
|
-
readonly label: string;
|
|
2727
|
-
readonly default: number;
|
|
2728
|
-
readonly min: number;
|
|
2729
|
-
readonly max: number;
|
|
2730
|
-
readonly step?: number;
|
|
2731
|
-
/** When provided, a compact unit dropdown is shown next to the value input. */
|
|
2732
|
-
readonly units?: ReadonlyArray<{
|
|
2733
|
-
value: string;
|
|
2734
|
-
label: string;
|
|
2735
|
-
}>;
|
|
2736
|
-
/** Default unit value (used when no persisted unit exists). */
|
|
2737
|
-
readonly defaultUnit?: string;
|
|
2738
|
-
}
|
|
2739
|
-
interface UIFieldColor {
|
|
2740
|
-
readonly type: "color";
|
|
2741
|
-
readonly key: string;
|
|
2742
|
-
readonly label: string;
|
|
2743
|
-
readonly default: string;
|
|
2744
|
-
}
|
|
2745
|
-
interface UIFieldSelect {
|
|
2746
|
-
readonly type: "select";
|
|
2747
|
-
readonly key: string;
|
|
2748
|
-
readonly label: string;
|
|
2749
|
-
readonly default: string;
|
|
2750
|
-
readonly options: ReadonlyArray<{
|
|
2751
|
-
value: string;
|
|
2752
|
-
label: string;
|
|
2753
|
-
}>;
|
|
2681
|
+
* @example
|
|
2682
|
+
* { type: "keyboard", key: "R", shiftKey: true }
|
|
2683
|
+
*/
|
|
2684
|
+
interface KeyboardRulersTrigger {
|
|
2685
|
+
type: "keyboard";
|
|
2686
|
+
/** The KeyboardEvent.key value (case-sensitive, e.g. "R", "g", "F2"). */
|
|
2687
|
+
key: string;
|
|
2688
|
+
shiftKey?: boolean;
|
|
2689
|
+
ctrlKey?: boolean;
|
|
2690
|
+
altKey?: boolean;
|
|
2691
|
+
metaKey?: boolean;
|
|
2692
|
+
action?: RulersTriggerAction;
|
|
2754
2693
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2694
|
+
/**
|
|
2695
|
+
* DOM element trigger — binds to one or more elements matching a CSS selector.
|
|
2696
|
+
* The element(s) must exist in the DOM when the module subscribes (at `start()` time).
|
|
2697
|
+
* For dynamically-added controls, prefer `type: "event"` instead.
|
|
2698
|
+
*
|
|
2699
|
+
* @example
|
|
2700
|
+
* { type: "element", selector: "#rulers-toggle-btn" }
|
|
2701
|
+
* { type: "element", selector: ".dev-toolbar [data-action='rulers']", event: "pointerdown" }
|
|
2702
|
+
*/
|
|
2703
|
+
interface ElementRulersTrigger {
|
|
2704
|
+
type: "element";
|
|
2705
|
+
/** CSS selector. All matching elements are bound. */
|
|
2706
|
+
selector: string;
|
|
2707
|
+
/** DOM event type. Defaults to "click". */
|
|
2708
|
+
event?: string;
|
|
2709
|
+
action?: RulersTriggerAction;
|
|
2760
2710
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2711
|
+
/**
|
|
2712
|
+
* StringTune event-bus trigger — reacts to a named event emitted via the event manager.
|
|
2713
|
+
* Useful for toolbar integrations, programmatic control, and cross-module communication.
|
|
2714
|
+
*
|
|
2715
|
+
* @example
|
|
2716
|
+
* { type: "event", name: "dev:rulers:toggle" }
|
|
2717
|
+
*
|
|
2718
|
+
* Activate via:
|
|
2719
|
+
* stringTune.emit("dev:rulers:toggle", null)
|
|
2720
|
+
*/
|
|
2721
|
+
interface EventRulersTrigger {
|
|
2722
|
+
type: "event";
|
|
2723
|
+
/** Event name on the StringTune event bus. */
|
|
2724
|
+
name: string;
|
|
2725
|
+
action?: RulersTriggerAction;
|
|
2764
2726
|
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Discriminated union of all supported ruler trigger descriptors.
|
|
2729
|
+
*/
|
|
2730
|
+
type StringRulersTrigger = KeyboardRulersTrigger | ElementRulersTrigger | EventRulersTrigger;
|
|
2765
2731
|
|
|
2766
2732
|
/**
|
|
2767
|
-
*
|
|
2733
|
+
* Column-based layout grid.
|
|
2734
|
+
*
|
|
2735
|
+
* Displays a fixed set of equally-spaced column bands across the viewport.
|
|
2736
|
+
* Column width is derived from the viewport width, margins, count, and gap.
|
|
2737
|
+
*
|
|
2738
|
+
* @example
|
|
2739
|
+
* { type: "columns", count: 12, marginLeft: 40, marginRight: 40, gap: 20 }
|
|
2740
|
+
*/
|
|
2741
|
+
interface ColumnsLayoutGrid {
|
|
2742
|
+
type: "columns";
|
|
2743
|
+
/** Number of columns. */
|
|
2744
|
+
count: number;
|
|
2745
|
+
/** Space reserved on the left edge of the viewport (px). Default: 0. */
|
|
2746
|
+
marginLeft?: number;
|
|
2747
|
+
/** Space reserved on the right edge of the viewport (px). Default: 0. */
|
|
2748
|
+
marginRight?: number;
|
|
2749
|
+
/** Gutter between columns (px). Default: 0. */
|
|
2750
|
+
gap?: number;
|
|
2751
|
+
/** Fill color for column bands. Default: "rgba(255, 0, 80, 0.08)". */
|
|
2752
|
+
color?: string;
|
|
2753
|
+
}
|
|
2754
|
+
/**
|
|
2755
|
+
* Row-based layout grid.
|
|
2768
2756
|
*
|
|
2769
|
-
*
|
|
2770
|
-
*
|
|
2771
|
-
* - Describes its UI schema for the settings panel
|
|
2772
|
-
* - Renders itself into an SVG overlay
|
|
2757
|
+
* Displays repeating horizontal stripes across the full document height.
|
|
2758
|
+
* Stripes scroll with the page content.
|
|
2773
2759
|
*
|
|
2774
|
-
*
|
|
2775
|
-
*
|
|
2760
|
+
* @example
|
|
2761
|
+
* { type: "rows", height: 8, gap: 0 }
|
|
2776
2762
|
*/
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
* Returns the default settings for this adapter.
|
|
2786
|
-
* These are used when a new grid instance is created.
|
|
2787
|
-
*/
|
|
2788
|
-
abstract getDefaults(): Record<string, any>;
|
|
2789
|
-
/**
|
|
2790
|
-
* Returns the UI field descriptors that GridUIBuilder
|
|
2791
|
-
* uses to construct the settings panel.
|
|
2792
|
-
*/
|
|
2793
|
-
abstract getUISchema(): UIFieldDescriptor[];
|
|
2794
|
-
/**
|
|
2795
|
-
* Renders the grid into the given SVG element.
|
|
2796
|
-
*
|
|
2797
|
-
* @param svg The SVG overlay element (same size as target)
|
|
2798
|
-
* @param width Element width in px
|
|
2799
|
-
* @param height Element height in px
|
|
2800
|
-
* @param settings Current settings for this instance
|
|
2801
|
-
*/
|
|
2802
|
-
abstract render(svg: SVGSVGElement, width: number, height: number, settings: Record<string, any>): void;
|
|
2803
|
-
/**
|
|
2804
|
-
* Removes all elements previously rendered by this adapter.
|
|
2805
|
-
* Default implementation clears the adapter's group element.
|
|
2806
|
-
*/
|
|
2807
|
-
clear(svg: SVGSVGElement, instanceId: string): void;
|
|
2808
|
-
/**
|
|
2809
|
-
* Creates or retrieves a <g> group element scoped to a grid instance.
|
|
2810
|
-
* All rendering should happen inside this group for clean cleanup.
|
|
2811
|
-
*/
|
|
2812
|
-
protected getGroup(svg: SVGSVGElement, instanceId: string): SVGGElement;
|
|
2813
|
-
/**
|
|
2814
|
-
* Helper: creates an SVG line element.
|
|
2815
|
-
*/
|
|
2816
|
-
protected createLine(x1: number, y1: number, x2: number, y2: number, color: string, opacity: number, strokeWidth?: number): SVGLineElement;
|
|
2817
|
-
/**
|
|
2818
|
-
* Helper: creates an SVG rect element.
|
|
2819
|
-
*/
|
|
2820
|
-
protected createRect(x: number, y: number, width: number, height: number, fill: string, opacity: number): SVGRectElement;
|
|
2821
|
-
/**
|
|
2822
|
-
* Converts a value from the given unit to pixels.
|
|
2823
|
-
*
|
|
2824
|
-
* @param value Raw numeric value
|
|
2825
|
-
* @param unit "px" | "%" | "vw" | "vh"
|
|
2826
|
-
* @param dimension Reference dimension (element width or height) for "%" mode
|
|
2827
|
-
*/
|
|
2828
|
-
protected resolveUnit(value: number, unit: string, dimension: number): number;
|
|
2829
|
-
/**
|
|
2830
|
-
* Helper: creates an SVG path element.
|
|
2831
|
-
*/
|
|
2832
|
-
protected createPath(d: string, stroke: string, opacity: number, strokeWidth?: number, fill?: string): SVGPathElement;
|
|
2763
|
+
interface RowsLayoutGrid {
|
|
2764
|
+
type: "rows";
|
|
2765
|
+
/** Height of each row band (px). */
|
|
2766
|
+
height: number;
|
|
2767
|
+
/** Gap between row bands (px). Default: 0. */
|
|
2768
|
+
gap?: number;
|
|
2769
|
+
/** Fill color for row bands. Default: "rgba(0, 120, 255, 0.06)". */
|
|
2770
|
+
color?: string;
|
|
2833
2771
|
}
|
|
2772
|
+
type RulersLayoutGrid = ColumnsLayoutGrid | RowsLayoutGrid;
|
|
2834
2773
|
|
|
2835
2774
|
interface ModuleBatchContext {
|
|
2836
2775
|
module: StringModule;
|
|
@@ -3131,4 +3070,4 @@ declare class StringTune {
|
|
|
3131
3070
|
destroy(): void;
|
|
3132
3071
|
}
|
|
3133
3072
|
|
|
3134
|
-
export { CursorReactiveModule, DOMBatcher,
|
|
3073
|
+
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 };
|