@fiddle-digital/string-tune 1.1.53 → 1.1.55
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 +2978 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +757 -30
- package/dist/index.d.ts +757 -30
- package/dist/index.js +2978 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2978 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -407,6 +407,22 @@ declare class EventManager {
|
|
|
407
407
|
clearAll(): void;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
+
type StringTokenModeSpec = {
|
|
411
|
+
kind: "default";
|
|
412
|
+
values: [];
|
|
413
|
+
} | {
|
|
414
|
+
kind: "all";
|
|
415
|
+
values: [];
|
|
416
|
+
} | {
|
|
417
|
+
kind: "include";
|
|
418
|
+
values: ScrollMode[];
|
|
419
|
+
};
|
|
420
|
+
interface StringToken {
|
|
421
|
+
raw: string;
|
|
422
|
+
key: string;
|
|
423
|
+
modeSpec: StringTokenModeSpec;
|
|
424
|
+
}
|
|
425
|
+
|
|
410
426
|
type MirrorEasingFn = (value: number) => number;
|
|
411
427
|
/**
|
|
412
428
|
* Lightweight wrapper that mirrors a primary StringObject while keeping
|
|
@@ -448,6 +464,7 @@ declare class StringObject {
|
|
|
448
464
|
* Space-separated list of all attribute keys associated with this object.
|
|
449
465
|
*/
|
|
450
466
|
keys: string[];
|
|
467
|
+
tokens: StringToken[];
|
|
451
468
|
/**
|
|
452
469
|
* Mirror objects linked via `string-copy-from`.
|
|
453
470
|
*/
|
|
@@ -458,28 +475,6 @@ declare class StringObject {
|
|
|
458
475
|
private properties;
|
|
459
476
|
private eventNameCache;
|
|
460
477
|
private eventNameSuffixCache;
|
|
461
|
-
/**
|
|
462
|
-
* Direct properties for extremely hot, per-frame accessed metrics
|
|
463
|
-
* to avoid going through the Map and incurring overhead.
|
|
464
|
-
*/
|
|
465
|
-
progress: number;
|
|
466
|
-
progressRaw: number;
|
|
467
|
-
startPosition: number;
|
|
468
|
-
differencePosition: number;
|
|
469
|
-
transformValue: {
|
|
470
|
-
transform: string;
|
|
471
|
-
} | null;
|
|
472
|
-
eventProgressName: string | null;
|
|
473
|
-
lerp: number;
|
|
474
|
-
glide: number;
|
|
475
|
-
isMagneting: boolean;
|
|
476
|
-
magneticX: number;
|
|
477
|
-
magneticY: number;
|
|
478
|
-
magneticTargetX: number;
|
|
479
|
-
magneticTargetY: number;
|
|
480
|
-
eventLerpName: string | null;
|
|
481
|
-
eventGlideName: string | null;
|
|
482
|
-
eventMagneticName: string | null;
|
|
483
478
|
/**
|
|
484
479
|
* Modules currently connected to this object.
|
|
485
480
|
*/
|
|
@@ -524,6 +519,9 @@ declare class StringObject {
|
|
|
524
519
|
* modules it is associated with.
|
|
525
520
|
*/
|
|
526
521
|
remove(): void;
|
|
522
|
+
setInviewAutoBlocked(blocked: boolean): void;
|
|
523
|
+
isInviewAutoBlocked(): boolean;
|
|
524
|
+
syncInviewClass(): void;
|
|
527
525
|
/**
|
|
528
526
|
* Shows the object, applies visual class and notifies connected modules.
|
|
529
527
|
*/
|
|
@@ -537,6 +535,10 @@ declare class StringObject {
|
|
|
537
535
|
* @param module - The module to connect
|
|
538
536
|
*/
|
|
539
537
|
connect(module: IStringModule): boolean;
|
|
538
|
+
disconnect(module: IStringModule): boolean;
|
|
539
|
+
isConnectedTo(module: IStringModule): boolean;
|
|
540
|
+
setTokens(tokens: StringToken[]): void;
|
|
541
|
+
getToken(key: string): StringToken | null;
|
|
540
542
|
addMirror(mirror: StringMirrorObject): void;
|
|
541
543
|
removeMirror(id: string): void;
|
|
542
544
|
get mirrorObjects(): StringMirrorObject[];
|
|
@@ -1262,23 +1264,28 @@ declare class StringModule implements IStringModule {
|
|
|
1262
1264
|
* This map is used to manage and track `StringObject` instances on a page.
|
|
1263
1265
|
*/
|
|
1264
1266
|
protected objectMapOnPage: Map<string, StringObject>;
|
|
1267
|
+
protected allObjectMapOnPage: Map<string, StringObject>;
|
|
1265
1268
|
/**
|
|
1266
1269
|
* A protected array that holds the collection of `StringObject` instances
|
|
1267
1270
|
* currently present on the page.
|
|
1268
1271
|
*/
|
|
1269
1272
|
protected objectsOnPage: StringObject[];
|
|
1273
|
+
protected allObjectsOnPage: StringObject[];
|
|
1270
1274
|
/**
|
|
1271
1275
|
* A map of all entered objects by their unique ID.
|
|
1272
1276
|
*/
|
|
1273
1277
|
protected objectMap: Map<string, StringObject>;
|
|
1278
|
+
protected allObjectMap: Map<string, StringObject>;
|
|
1274
1279
|
/**
|
|
1275
1280
|
* A flat array of all connected objects.
|
|
1276
1281
|
*/
|
|
1277
1282
|
protected objects: StringObject[];
|
|
1283
|
+
protected allObjects: StringObject[];
|
|
1278
1284
|
/**
|
|
1279
1285
|
* The HTML attribute key that identifies objects this module is responsible for.
|
|
1280
1286
|
*/
|
|
1281
1287
|
protected htmlKey: string;
|
|
1288
|
+
protected defaultModeScope: "all" | ScrollMode[];
|
|
1282
1289
|
/**
|
|
1283
1290
|
* Module type ID used internally to categorize module behavior.
|
|
1284
1291
|
*/
|
|
@@ -1288,6 +1295,7 @@ declare class StringModule implements IStringModule {
|
|
|
1288
1295
|
* Type 1 = core module, type 2 = UI module.
|
|
1289
1296
|
*/
|
|
1290
1297
|
get type(): number;
|
|
1298
|
+
get key(): string;
|
|
1291
1299
|
/**
|
|
1292
1300
|
* Tools container providing utilities for attribute parsing, unit conversion, etc.
|
|
1293
1301
|
* Acts as a dependency injection hub for core IStringTool implementations.
|
|
@@ -1341,6 +1349,9 @@ declare class StringModule implements IStringModule {
|
|
|
1341
1349
|
* 6. Sets the processed attributes as properties on the `StringObject` instance.
|
|
1342
1350
|
*/
|
|
1343
1351
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1352
|
+
protected cacheLayoutSnapshot(object: StringObject, element: HTMLElement): void;
|
|
1353
|
+
private getOffsetSize;
|
|
1354
|
+
private getOffsetChainPosition;
|
|
1344
1355
|
/**
|
|
1345
1356
|
* Calculates object-specific positions or metrics based on the current layout or scroll state.
|
|
1346
1357
|
* This method is intended to be overridden in subclasses if the module needs to precompute
|
|
@@ -1373,6 +1384,9 @@ declare class StringModule implements IStringModule {
|
|
|
1373
1384
|
* @returns `true` if the module can connect, `false` otherwise.
|
|
1374
1385
|
*/
|
|
1375
1386
|
canConnect(object: StringObject): boolean;
|
|
1387
|
+
protected isTokenEnabledInCurrentMode(token: StringToken): boolean;
|
|
1388
|
+
protected isObjectEnabledInCurrentMode(object: StringObject): boolean;
|
|
1389
|
+
disconnectObject(object: StringObject): void;
|
|
1376
1390
|
/**
|
|
1377
1391
|
* Registers the module on a given object, adds the object to internal list,
|
|
1378
1392
|
* and triggers connection logic.
|
|
@@ -1449,6 +1463,10 @@ declare class StringModule implements IStringModule {
|
|
|
1449
1463
|
* Returns a cached per-object event name to avoid building strings in hot paths.
|
|
1450
1464
|
*/
|
|
1451
1465
|
protected getObjectEventName(object: StringObject, prefix: string, suffix?: string): string;
|
|
1466
|
+
protected clearManagedStyles(object: StringObject): void;
|
|
1467
|
+
protected onObjectModeActivated(object: StringObject): void;
|
|
1468
|
+
protected onObjectModeDeactivated(object: StringObject): void;
|
|
1469
|
+
protected rebuildActiveObjectsForCurrentMode(): void;
|
|
1452
1470
|
/**
|
|
1453
1471
|
* Cleans up internal state and detaches the module from the system.
|
|
1454
1472
|
*/
|
|
@@ -1566,6 +1584,8 @@ declare class ObjectManager {
|
|
|
1566
1584
|
add(el: HTMLElement): void;
|
|
1567
1585
|
setDOMBatcherEnabled(enabled: boolean): void;
|
|
1568
1586
|
setIntersectionObserverEnabled(enabled: boolean): void;
|
|
1587
|
+
attachModule(module: StringModule): void;
|
|
1588
|
+
refreshModuleConnectionsForCurrentMode(): void;
|
|
1569
1589
|
invalidateInviewIndex(): void;
|
|
1570
1590
|
refreshLayoutForRoot(root: HTMLElement): void;
|
|
1571
1591
|
/**
|
|
@@ -1636,6 +1656,8 @@ declare class ObjectManager {
|
|
|
1636
1656
|
private rebuildInviewIndex;
|
|
1637
1657
|
private upperBound;
|
|
1638
1658
|
private splitPipeAndTrim;
|
|
1659
|
+
private parseStringTokens;
|
|
1660
|
+
private splitTopLevelPipe;
|
|
1639
1661
|
destroy(): void;
|
|
1640
1662
|
}
|
|
1641
1663
|
|
|
@@ -1884,6 +1906,7 @@ declare class StringAnchor extends StringModule {
|
|
|
1884
1906
|
* to create a smooth scrolling effect for objects.
|
|
1885
1907
|
*/
|
|
1886
1908
|
declare class StringGlide extends StringModule {
|
|
1909
|
+
protected defaultModeScope: string[];
|
|
1887
1910
|
private previousLerp;
|
|
1888
1911
|
private displacement;
|
|
1889
1912
|
private acceleration;
|
|
@@ -1896,9 +1919,8 @@ declare class StringGlide extends StringModule {
|
|
|
1896
1919
|
constructor(context: StringContext);
|
|
1897
1920
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1898
1921
|
private setupItem;
|
|
1899
|
-
private
|
|
1900
|
-
private
|
|
1901
|
-
private onUpdateEvent;
|
|
1922
|
+
private updateTransforms;
|
|
1923
|
+
private resetObjectStyles;
|
|
1902
1924
|
private calcExpanderFactor;
|
|
1903
1925
|
onStart(): void;
|
|
1904
1926
|
onResize(): void;
|
|
@@ -1906,7 +1928,9 @@ declare class StringGlide extends StringModule {
|
|
|
1906
1928
|
onScrollStart(): void;
|
|
1907
1929
|
onScrollStop(): void;
|
|
1908
1930
|
onFrame(data: StringData): void;
|
|
1931
|
+
protected onObjectModeDeactivated(object: StringObject): void;
|
|
1909
1932
|
onMutate(): void;
|
|
1933
|
+
private applyPendingGlideStylesForObject;
|
|
1910
1934
|
private applyPendingGlideStyles;
|
|
1911
1935
|
private flushPendingGlideStyles;
|
|
1912
1936
|
}
|
|
@@ -1917,6 +1941,7 @@ declare class StringGlide extends StringModule {
|
|
|
1917
1941
|
*/
|
|
1918
1942
|
declare class StringLerp extends StringModule {
|
|
1919
1943
|
private hasInitializedCSS;
|
|
1944
|
+
protected defaultModeScope: string[];
|
|
1920
1945
|
constructor(context: StringContext);
|
|
1921
1946
|
/**
|
|
1922
1947
|
* Initialize lerp value when object connects.
|
|
@@ -1960,6 +1985,7 @@ declare class StringProgress extends StringModule {
|
|
|
1960
1985
|
constructor(context: StringContext);
|
|
1961
1986
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1962
1987
|
private sanitizeRawProgress;
|
|
1988
|
+
private resolveRawProgress;
|
|
1963
1989
|
private applyRawProgress;
|
|
1964
1990
|
private recomputeProgress;
|
|
1965
1991
|
private ensureBatchCapacity;
|
|
@@ -1979,6 +2005,7 @@ declare class StringProgress extends StringModule {
|
|
|
1979
2005
|
* necessary transformations based on scroll progress and viewport size.
|
|
1980
2006
|
*/
|
|
1981
2007
|
declare class StringParallax extends StringProgress {
|
|
2008
|
+
protected defaultModeScope: string[];
|
|
1982
2009
|
private updateScheduledTransform;
|
|
1983
2010
|
private calculateParallaxForObject;
|
|
1984
2011
|
constructor(context: StringContext);
|
|
@@ -1988,11 +2015,9 @@ declare class StringParallax extends StringProgress {
|
|
|
1988
2015
|
initializeObject(globalId: number, object: StringObject, element: HTMLElement, attributes: Record<string, any>): void;
|
|
1989
2016
|
calculatePositions(object: StringObject, windowSize: number): void;
|
|
1990
2017
|
onScroll(data: StringData): void;
|
|
1991
|
-
onResize(): void;
|
|
1992
2018
|
onScrollMeasure(data: StringData): void;
|
|
1993
2019
|
onMutate(): void;
|
|
1994
|
-
private
|
|
1995
|
-
private calculateMobileParallax;
|
|
2020
|
+
private calculateParallax;
|
|
1996
2021
|
}
|
|
1997
2022
|
|
|
1998
2023
|
declare class StringScrollbar extends StringModule {
|
|
@@ -2671,6 +2696,672 @@ declare class ScrollController {
|
|
|
2671
2696
|
scrollTo(position: number, immediate?: boolean): void;
|
|
2672
2697
|
}
|
|
2673
2698
|
|
|
2699
|
+
interface StringDevtoolState {
|
|
2700
|
+
active: boolean;
|
|
2701
|
+
}
|
|
2702
|
+
interface StringDevtoolDefinition {
|
|
2703
|
+
id: string;
|
|
2704
|
+
label: string;
|
|
2705
|
+
icon: string;
|
|
2706
|
+
order?: number;
|
|
2707
|
+
getState: () => StringDevtoolState;
|
|
2708
|
+
setActive: (active: boolean) => void;
|
|
2709
|
+
subscribe?: (listener: (state: StringDevtoolState) => void) => () => void;
|
|
2710
|
+
}
|
|
2711
|
+
interface StringDevtoolProvider {
|
|
2712
|
+
getDevtoolDefinition(): StringDevtoolDefinition | null;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
declare class StringDevViewportLayer {
|
|
2716
|
+
private readonly id;
|
|
2717
|
+
private readonly zIndex;
|
|
2718
|
+
private screenRoot;
|
|
2719
|
+
private world;
|
|
2720
|
+
private screen;
|
|
2721
|
+
private worldHost;
|
|
2722
|
+
private hostPositionWasPatched;
|
|
2723
|
+
private hostPositionInlineValue;
|
|
2724
|
+
constructor(id: string, zIndex: number);
|
|
2725
|
+
ensure(host?: HTMLElement | null): HTMLDivElement;
|
|
2726
|
+
getElement(): HTMLDivElement | null;
|
|
2727
|
+
getWorldElement(host?: HTMLElement | null): HTMLDivElement;
|
|
2728
|
+
getScreenElement(): HTMLDivElement;
|
|
2729
|
+
destroy(): void;
|
|
2730
|
+
private attachWorldToHost;
|
|
2731
|
+
private restoreHostPosition;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
declare class StringDevOverlayRegistry {
|
|
2735
|
+
private static instance;
|
|
2736
|
+
private readonly layers;
|
|
2737
|
+
static getInstance(): StringDevOverlayRegistry;
|
|
2738
|
+
acquire(id: string, zIndex: number): StringDevViewportLayer;
|
|
2739
|
+
release(id: string): void;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
interface StringDevModuleDefinitionConfig {
|
|
2743
|
+
id: string;
|
|
2744
|
+
label: string;
|
|
2745
|
+
icon: string;
|
|
2746
|
+
order?: number;
|
|
2747
|
+
}
|
|
2748
|
+
interface StringDevOverlayConfig {
|
|
2749
|
+
/** Unique layer name, e.g. "devtools-progress" */
|
|
2750
|
+
layerName: string;
|
|
2751
|
+
/** Z-index for the viewport layer */
|
|
2752
|
+
zIndex: number;
|
|
2753
|
+
/** Data-attribute added to the layer root, e.g. "data-string-progress-layer" */
|
|
2754
|
+
layerAttribute?: string;
|
|
2755
|
+
/** Overlay ID used for the anchor/collision system. Omit if not needed. */
|
|
2756
|
+
overlayId?: string;
|
|
2757
|
+
/** Whether the overlay starts enabled before dock preferences apply. Default: false */
|
|
2758
|
+
defaultEnabled?: boolean;
|
|
2759
|
+
/** For badge overlay modules: data-attribute placed on each badge element */
|
|
2760
|
+
badgeAttribute?: string;
|
|
2761
|
+
}
|
|
2762
|
+
interface StringDevModuleConfig extends StringDevModuleDefinitionConfig {
|
|
2763
|
+
/** Declare CSS styles to inject once. Can be a string or a lazy getter. */
|
|
2764
|
+
styles?: string | (() => string);
|
|
2765
|
+
/** Overlay layer configuration. Declare for any module that uses a viewport layer. */
|
|
2766
|
+
overlay?: StringDevOverlayConfig;
|
|
2767
|
+
}
|
|
2768
|
+
declare class StringDevModule extends StringModule implements StringDevtoolProvider {
|
|
2769
|
+
/** Declare module metadata statically. Subclasses override this. */
|
|
2770
|
+
static devtool: StringDevModuleConfig | null;
|
|
2771
|
+
protected readonly overlayRegistry: StringDevOverlayRegistry;
|
|
2772
|
+
private readonly acquiredViewportLayers;
|
|
2773
|
+
private readonly devtoolListeners;
|
|
2774
|
+
protected devtoolConfig: StringDevModuleDefinitionConfig | null;
|
|
2775
|
+
constructor(context: StringContext);
|
|
2776
|
+
protected getStyleScopeId(stylesText: string): string;
|
|
2777
|
+
protected getStyles(): string | null;
|
|
2778
|
+
getDevtoolDefinition(): StringDevtoolDefinition | null;
|
|
2779
|
+
protected configureDevtool(config: StringDevModuleDefinitionConfig): void;
|
|
2780
|
+
protected emitDevtoolState(active?: boolean): void;
|
|
2781
|
+
protected acquireViewportLayer(id: string, zIndex: number): StringDevViewportLayer;
|
|
2782
|
+
protected releaseViewportLayer(id: string): void;
|
|
2783
|
+
protected ensureStyle(styleId: string, cssText: string): HTMLStyleElement;
|
|
2784
|
+
protected getWorldHost(): HTMLElement;
|
|
2785
|
+
protected getDevtoolActiveState(): boolean;
|
|
2786
|
+
protected setDevtoolActiveState(_active: boolean): void;
|
|
2787
|
+
destroy(): void;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
declare function buildGridCSS(): string;
|
|
2791
|
+
|
|
2792
|
+
/**
|
|
2793
|
+
* StringDevLayout — developer utility module for layout overlays.
|
|
2794
|
+
*
|
|
2795
|
+
* Usage:
|
|
2796
|
+
* <div string="grid">...</div>
|
|
2797
|
+
*
|
|
2798
|
+
* No configuration attributes needed. All configuration happens
|
|
2799
|
+
* through the interactive HUD panel (hover top-right corner).
|
|
2800
|
+
*
|
|
2801
|
+
* Supports multiple grid types via the adapter pattern:
|
|
2802
|
+
* - Columns, Rows, Center
|
|
2803
|
+
* - Rule of Thirds, Phi Grid, Golden Rectangle, Harmonic Armature
|
|
2804
|
+
* - Extensible via `st.use(StringDevLayout, { adapters: [MyAdapter] })`
|
|
2805
|
+
*/
|
|
2806
|
+
declare class StringDevLayout extends StringDevModule {
|
|
2807
|
+
private gridManager;
|
|
2808
|
+
private viewportLayer;
|
|
2809
|
+
private overlays;
|
|
2810
|
+
private huds;
|
|
2811
|
+
private elementMap;
|
|
2812
|
+
private triggerEntries;
|
|
2813
|
+
private triggerMeasurements;
|
|
2814
|
+
private enabled;
|
|
2815
|
+
private needsMeasure;
|
|
2816
|
+
private hasPendingMutate;
|
|
2817
|
+
static devtool: {
|
|
2818
|
+
id: string;
|
|
2819
|
+
label: string;
|
|
2820
|
+
icon: string;
|
|
2821
|
+
order: number;
|
|
2822
|
+
styles: typeof buildGridCSS;
|
|
2823
|
+
};
|
|
2824
|
+
constructor(context: StringContext);
|
|
2825
|
+
onInit(): void;
|
|
2826
|
+
onObjectConnected(object: StringObject): void;
|
|
2827
|
+
onObjectDisconnected(object: StringObject): void;
|
|
2828
|
+
onResize(): void;
|
|
2829
|
+
onScroll(): void;
|
|
2830
|
+
onScrollMeasure(): void;
|
|
2831
|
+
onMutate(): void;
|
|
2832
|
+
onDOMRebuild(): void;
|
|
2833
|
+
destroy(): void;
|
|
2834
|
+
setEnabled(enabled: boolean): void;
|
|
2835
|
+
isEnabled(): boolean;
|
|
2836
|
+
protected getDevtoolActiveState(): boolean;
|
|
2837
|
+
protected setDevtoolActiveState(active: boolean): void;
|
|
2838
|
+
private handleAdd;
|
|
2839
|
+
private handleRemove;
|
|
2840
|
+
private handleToggle;
|
|
2841
|
+
private handleSettingChange;
|
|
2842
|
+
private handleReorder;
|
|
2843
|
+
private handleMoveToEnd;
|
|
2844
|
+
private handleSelectLayout;
|
|
2845
|
+
private handleUpdateLayoutMinWidth;
|
|
2846
|
+
private handlePreviewResponsiveLayout;
|
|
2847
|
+
private handleCommitResponsiveLayout;
|
|
2848
|
+
private handleRenameInstance;
|
|
2849
|
+
private handleHUDOpen;
|
|
2850
|
+
private handleHUDClose;
|
|
2851
|
+
private handleLayoutPanelOpen;
|
|
2852
|
+
private handleLayoutPanelClose;
|
|
2853
|
+
private handleExport;
|
|
2854
|
+
private handleImport;
|
|
2855
|
+
private renderElement;
|
|
2856
|
+
private refreshHUD;
|
|
2857
|
+
private resolveActiveLayoutState;
|
|
2858
|
+
private syncSelectedLayoutToResolved;
|
|
2859
|
+
private destroyElement;
|
|
2860
|
+
private ensureTriggerLayer;
|
|
2861
|
+
private applyTriggerLayerState;
|
|
2862
|
+
private scheduleTriggerSync;
|
|
2863
|
+
private collectTriggerMeasurements;
|
|
2864
|
+
private measureTrigger;
|
|
2865
|
+
private applyTriggerMeasurement;
|
|
2866
|
+
protected getWorldHost(): HTMLElement;
|
|
2867
|
+
private getObjectDocY;
|
|
2868
|
+
private getViewportScrollLeft;
|
|
2869
|
+
private getViewportScrollTop;
|
|
2870
|
+
private resolveTriggerStackOffset;
|
|
2871
|
+
private registerBuiltInAdapters;
|
|
2872
|
+
private registerExternalAdapters;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* Discriminated union of all UI field descriptors.
|
|
2877
|
+
* Each devtool module returns an array of these to describe its settings panel.
|
|
2878
|
+
*/
|
|
2879
|
+
type StringDevUIFieldDescriptor = StringDevUIFieldNumber | StringDevUIFieldRange | StringDevUIFieldColor | StringDevUIFieldSelect | StringDevUIFieldToggle | StringDevUIFieldDivider;
|
|
2880
|
+
interface StringDevUIFieldNumber {
|
|
2881
|
+
readonly type: "number";
|
|
2882
|
+
readonly key: string;
|
|
2883
|
+
readonly label: string;
|
|
2884
|
+
readonly default: number;
|
|
2885
|
+
readonly min?: number;
|
|
2886
|
+
readonly max?: number;
|
|
2887
|
+
readonly step?: number;
|
|
2888
|
+
}
|
|
2889
|
+
interface StringDevUIFieldRange {
|
|
2890
|
+
readonly type: "range";
|
|
2891
|
+
readonly key: string;
|
|
2892
|
+
readonly label: string;
|
|
2893
|
+
readonly default: number;
|
|
2894
|
+
readonly min: number;
|
|
2895
|
+
readonly max: number;
|
|
2896
|
+
readonly step?: number;
|
|
2897
|
+
/** When provided, a compact unit dropdown is shown next to the value input. */
|
|
2898
|
+
readonly units?: ReadonlyArray<{
|
|
2899
|
+
value: string;
|
|
2900
|
+
label: string;
|
|
2901
|
+
}>;
|
|
2902
|
+
/** Default unit value (used when no persisted unit exists). */
|
|
2903
|
+
readonly defaultUnit?: string;
|
|
2904
|
+
}
|
|
2905
|
+
interface StringDevUIFieldColor {
|
|
2906
|
+
readonly type: "color";
|
|
2907
|
+
readonly key: string;
|
|
2908
|
+
readonly label: string;
|
|
2909
|
+
readonly default: string;
|
|
2910
|
+
}
|
|
2911
|
+
interface StringDevUIFieldSelect {
|
|
2912
|
+
readonly type: "select";
|
|
2913
|
+
readonly key: string;
|
|
2914
|
+
readonly label: string;
|
|
2915
|
+
readonly default: string;
|
|
2916
|
+
readonly options: ReadonlyArray<{
|
|
2917
|
+
value: string;
|
|
2918
|
+
label: string;
|
|
2919
|
+
}>;
|
|
2920
|
+
}
|
|
2921
|
+
interface StringDevUIFieldToggle {
|
|
2922
|
+
readonly type: "toggle";
|
|
2923
|
+
readonly key: string;
|
|
2924
|
+
readonly label: string;
|
|
2925
|
+
readonly default: boolean;
|
|
2926
|
+
}
|
|
2927
|
+
interface StringDevUIFieldDivider {
|
|
2928
|
+
readonly type: "divider";
|
|
2929
|
+
readonly label?: string;
|
|
2930
|
+
}
|
|
2931
|
+
|
|
2932
|
+
/**
|
|
2933
|
+
* Abstract base class for all grid adapters.
|
|
2934
|
+
*
|
|
2935
|
+
* Each adapter is a self-contained unit that:
|
|
2936
|
+
* - Declares its own default settings
|
|
2937
|
+
* - Describes its UI schema for the settings panel
|
|
2938
|
+
* - Renders itself into an SVG overlay
|
|
2939
|
+
*
|
|
2940
|
+
* To create a new grid type, extend this class and implement
|
|
2941
|
+
* all abstract members. The system handles everything else.
|
|
2942
|
+
*/
|
|
2943
|
+
declare abstract class GridAdapter {
|
|
2944
|
+
/** Unique type key used for serialization and registry lookup */
|
|
2945
|
+
abstract readonly type: string;
|
|
2946
|
+
/** Human-readable label shown in the HUD menu */
|
|
2947
|
+
abstract readonly label: string;
|
|
2948
|
+
/** SVG icon string (inline SVG markup) */
|
|
2949
|
+
abstract readonly icon: string;
|
|
2950
|
+
/**
|
|
2951
|
+
* Returns the default settings for this adapter.
|
|
2952
|
+
* These are used when a new grid instance is created.
|
|
2953
|
+
*/
|
|
2954
|
+
abstract getDefaults(): Record<string, any>;
|
|
2955
|
+
/**
|
|
2956
|
+
* Returns the UI field descriptors that GridUIBuilder
|
|
2957
|
+
* uses to construct the settings panel.
|
|
2958
|
+
*/
|
|
2959
|
+
abstract getUISchema(): StringDevUIFieldDescriptor[];
|
|
2960
|
+
/**
|
|
2961
|
+
* Renders the grid into the given SVG element.
|
|
2962
|
+
*
|
|
2963
|
+
* @param svg The SVG overlay element (same size as target)
|
|
2964
|
+
* @param width Element width in px
|
|
2965
|
+
* @param height Element height in px
|
|
2966
|
+
* @param settings Current settings for this instance
|
|
2967
|
+
*/
|
|
2968
|
+
abstract render(svg: SVGSVGElement, width: number, height: number, settings: Record<string, any>): void;
|
|
2969
|
+
/**
|
|
2970
|
+
* Removes all elements previously rendered by this adapter.
|
|
2971
|
+
* Default implementation clears the adapter's group element.
|
|
2972
|
+
*/
|
|
2973
|
+
clear(svg: SVGSVGElement, instanceId: string): void;
|
|
2974
|
+
/**
|
|
2975
|
+
* Creates or retrieves a <g> group element scoped to a grid instance.
|
|
2976
|
+
* All rendering should happen inside this group for clean cleanup.
|
|
2977
|
+
*/
|
|
2978
|
+
protected getGroup(svg: SVGSVGElement, instanceId: string): SVGGElement;
|
|
2979
|
+
/**
|
|
2980
|
+
* Helper: creates an SVG line element.
|
|
2981
|
+
*/
|
|
2982
|
+
protected createLine(x1: number, y1: number, x2: number, y2: number, color: string, opacity: number, strokeWidth?: number): SVGLineElement;
|
|
2983
|
+
/**
|
|
2984
|
+
* Helper: creates an SVG rect element.
|
|
2985
|
+
*/
|
|
2986
|
+
protected createRect(x: number, y: number, width: number, height: number, fill: string, opacity: number): SVGRectElement;
|
|
2987
|
+
/**
|
|
2988
|
+
* Converts a value from the given unit to pixels.
|
|
2989
|
+
*
|
|
2990
|
+
* @param value Raw numeric value
|
|
2991
|
+
* @param unit "px" | "%" | "vw" | "vh" | "em" | "rem"
|
|
2992
|
+
* @param dimension Reference dimension (element width or height) for "%" mode
|
|
2993
|
+
*/
|
|
2994
|
+
protected resolveUnit(value: number, unit: string, dimension: number, referenceElement?: Element | null): number;
|
|
2995
|
+
/**
|
|
2996
|
+
* Helper: creates an SVG path element.
|
|
2997
|
+
*/
|
|
2998
|
+
protected createPath(d: string, stroke: string, opacity: number, strokeWidth?: number, fill?: string): SVGPathElement;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
type StringDevtoolsOverlayId = string;
|
|
3002
|
+
|
|
3003
|
+
interface OverlayBaseMetrics {
|
|
3004
|
+
visible: boolean;
|
|
3005
|
+
contentX: number;
|
|
3006
|
+
contentY: number;
|
|
3007
|
+
width: number;
|
|
3008
|
+
height: number;
|
|
3009
|
+
isOffscreen: boolean;
|
|
3010
|
+
baseAnchorX: number;
|
|
3011
|
+
baseAnchorY: number;
|
|
3012
|
+
collisionOffset: number;
|
|
3013
|
+
}
|
|
3014
|
+
interface StringDevOverlayBadgeInit {
|
|
3015
|
+
targetId: string;
|
|
3016
|
+
selectorAttribute?: string;
|
|
3017
|
+
depth?: number;
|
|
3018
|
+
attributes?: Record<string, string | boolean | number | null | undefined>;
|
|
3019
|
+
}
|
|
3020
|
+
interface StringDevOverlayBadgeState {
|
|
3021
|
+
visible?: boolean;
|
|
3022
|
+
active?: boolean;
|
|
3023
|
+
disabled?: boolean;
|
|
3024
|
+
title?: string;
|
|
3025
|
+
html?: string;
|
|
3026
|
+
attributes?: Record<string, string | boolean | number | null | undefined>;
|
|
3027
|
+
}
|
|
3028
|
+
declare abstract class StringDevOverlayModule<TEntry = unknown, TMeasurement = unknown> extends StringDevModule {
|
|
3029
|
+
private _viewportLayer?;
|
|
3030
|
+
protected get viewportLayer(): StringDevViewportLayer;
|
|
3031
|
+
protected readonly entries: Map<string, TEntry>;
|
|
3032
|
+
protected readonly measurements: Map<string, TMeasurement>;
|
|
3033
|
+
protected enabled: boolean;
|
|
3034
|
+
protected needsMeasure: boolean;
|
|
3035
|
+
protected hasPendingMutate: boolean;
|
|
3036
|
+
private readonly onOverlayLayoutChangeBind;
|
|
3037
|
+
private get _overlayConfig();
|
|
3038
|
+
/** Override to provide the overlay ID for the anchor/collision system. */
|
|
3039
|
+
protected get overlayId(): StringDevtoolsOverlayId | null;
|
|
3040
|
+
/** Override to define your viewport layer name. Falls back to devtool.overlay.layerName. */
|
|
3041
|
+
protected get layerName(): string;
|
|
3042
|
+
/** Override to define your viewport layer z-index. Falls back to devtool.overlay.zIndex. */
|
|
3043
|
+
protected get layerZIndex(): number;
|
|
3044
|
+
/** Override to define the data-attribute added to the layer root. Falls back to devtool.overlay.layerAttribute. */
|
|
3045
|
+
protected get layerAttribute(): string;
|
|
3046
|
+
/** Override when an overlay module should start enabled before dock preferences apply. Falls back to devtool.overlay.defaultEnabled. */
|
|
3047
|
+
protected get defaultEnabled(): boolean;
|
|
3048
|
+
constructor(context: StringContext);
|
|
3049
|
+
onInit(): void;
|
|
3050
|
+
onObjectConnected(object: StringObject): void;
|
|
3051
|
+
onObjectDisconnected(object: StringObject): void;
|
|
3052
|
+
setEnabled(enabled: boolean): void;
|
|
3053
|
+
isEnabled(): boolean;
|
|
3054
|
+
protected getDevtoolActiveState(): boolean;
|
|
3055
|
+
protected setDevtoolActiveState(active: boolean): void;
|
|
3056
|
+
/** Create DOM and return state for the given element */
|
|
3057
|
+
protected abstract createOverlayEntry(object: StringObject): TEntry | null;
|
|
3058
|
+
/** Clean up DOM and listeners for the given element */
|
|
3059
|
+
protected abstract destroyOverlayEntry(entry: TEntry): void;
|
|
3060
|
+
/** Produce a custom measurement state utilizing the provided base metrics */
|
|
3061
|
+
protected abstract measureEntry(entry: TEntry, baseMetrics: OverlayBaseMetrics): TMeasurement;
|
|
3062
|
+
/** Render DOM efficiently utilizing `styleTxn` */
|
|
3063
|
+
protected abstract applyMeasurement(entry: TEntry, measurement: TMeasurement | undefined): void;
|
|
3064
|
+
/** Called when `setEnabled` state flips, allowing subclasses to show/hide specific entries */
|
|
3065
|
+
protected onEnabledChange(_enabled: boolean): void;
|
|
3066
|
+
onScroll(): void;
|
|
3067
|
+
onScrollMeasure(): void;
|
|
3068
|
+
onMutate(): void;
|
|
3069
|
+
onResize(): void;
|
|
3070
|
+
onDOMRebuild(): void;
|
|
3071
|
+
protected scheduleFullSync(): void;
|
|
3072
|
+
protected collectMeasurements(): void;
|
|
3073
|
+
protected flushMeasurements(): void;
|
|
3074
|
+
protected ensureLayer(): HTMLDivElement;
|
|
3075
|
+
protected applyEnabledState(): void;
|
|
3076
|
+
protected resolveOverlayTargetId(object: StringObject): string;
|
|
3077
|
+
protected resolveOverlayObjectDepth(element: HTMLElement): number;
|
|
3078
|
+
protected createOverlayBadge(init: StringDevOverlayBadgeInit): HTMLButtonElement;
|
|
3079
|
+
protected applyOverlayBadgeState(badge: HTMLElement, state: StringDevOverlayBadgeState): void;
|
|
3080
|
+
protected applyOverlayBadgePosition(badge: HTMLElement, measurement: {
|
|
3081
|
+
visible: boolean;
|
|
3082
|
+
docX: number;
|
|
3083
|
+
docY: number;
|
|
3084
|
+
} | undefined): void;
|
|
3085
|
+
protected computeBaseMetrics(entry: any): OverlayBaseMetrics;
|
|
3086
|
+
private getHiddenMetrics;
|
|
3087
|
+
protected getObjectDocY(object: StringObject): number;
|
|
3088
|
+
protected getViewportScrollLeft(): number;
|
|
3089
|
+
protected getViewportScrollTop(): number;
|
|
3090
|
+
destroy(): void;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
interface StringDevBadgeMeasurement {
|
|
3094
|
+
visible: boolean;
|
|
3095
|
+
docX: number;
|
|
3096
|
+
docY: number;
|
|
3097
|
+
}
|
|
3098
|
+
interface StringDevBadgeEntry<TExtra = undefined> {
|
|
3099
|
+
object: StringObject;
|
|
3100
|
+
targetId: string;
|
|
3101
|
+
badge: HTMLButtonElement;
|
|
3102
|
+
depth: number;
|
|
3103
|
+
extra: TExtra;
|
|
3104
|
+
cleanup: Array<() => void>;
|
|
3105
|
+
}
|
|
3106
|
+
declare abstract class StringDevBadgeOverlayModule<TExtra = undefined, TMeasurement extends StringDevBadgeMeasurement = StringDevBadgeMeasurement> extends StringDevOverlayModule<StringDevBadgeEntry<TExtra>, TMeasurement> {
|
|
3107
|
+
/** Override to define the data-attribute on the badge element. Falls back to devtool.overlay.badgeAttribute. */
|
|
3108
|
+
protected get badgeAttribute(): string;
|
|
3109
|
+
protected createOverlayEntry(object: StringObject): StringDevBadgeEntry<TExtra>;
|
|
3110
|
+
protected destroyOverlayEntry(entry: StringDevBadgeEntry<TExtra>): void;
|
|
3111
|
+
protected measureEntry(_entry: StringDevBadgeEntry<TExtra>, metrics: OverlayBaseMetrics): TMeasurement;
|
|
3112
|
+
protected applyMeasurement(entry: StringDevBadgeEntry<TExtra>, measurement: TMeasurement | undefined): void;
|
|
3113
|
+
protected onEnabledChange(_enabled: boolean): void;
|
|
3114
|
+
protected createBadgeExtra(_object: StringObject, _badge: HTMLButtonElement, _targetId: string, _depth: number): TExtra;
|
|
3115
|
+
protected destroyBadgeExtra(_entry: StringDevBadgeEntry<TExtra>): void;
|
|
3116
|
+
protected bindBadge(_entry: StringDevBadgeEntry<TExtra>): Array<() => void> | void;
|
|
3117
|
+
protected resolveBadgeDepth(object: StringObject): number;
|
|
3118
|
+
protected getInitialBadgeAttributes(_object: StringObject, _targetId: string, _depth: number): Record<string, string | boolean | number | null | undefined> | undefined;
|
|
3119
|
+
protected applyBadgeEnabledState(entry: StringDevBadgeEntry<TExtra>): void;
|
|
3120
|
+
protected renderBadge(entry: StringDevBadgeEntry<TExtra>): void;
|
|
3121
|
+
protected afterBadgeMeasurement(_entry: StringDevBadgeEntry<TExtra>, _measurement: TMeasurement | undefined): void;
|
|
3122
|
+
protected abstract onBadgeClick(entry: StringDevBadgeEntry<TExtra>, event: MouseEvent): void;
|
|
3123
|
+
protected abstract getBadgeState(entry: StringDevBadgeEntry<TExtra>): StringDevOverlayBadgeState;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
interface InviewToggleExtra {
|
|
3127
|
+
onInviewChange: () => void;
|
|
3128
|
+
}
|
|
3129
|
+
declare class StringDevInviewToggle extends StringDevBadgeOverlayModule<InviewToggleExtra> {
|
|
3130
|
+
static devtool: {
|
|
3131
|
+
id: string;
|
|
3132
|
+
label: string;
|
|
3133
|
+
icon: string;
|
|
3134
|
+
order: number;
|
|
3135
|
+
styles: string;
|
|
3136
|
+
overlay: {
|
|
3137
|
+
layerName: string;
|
|
3138
|
+
zIndex: number;
|
|
3139
|
+
layerAttribute: string;
|
|
3140
|
+
overlayId: string;
|
|
3141
|
+
badgeAttribute: string;
|
|
3142
|
+
defaultEnabled: boolean;
|
|
3143
|
+
};
|
|
3144
|
+
};
|
|
3145
|
+
canConnect(_object: StringObject): boolean;
|
|
3146
|
+
protected createBadgeExtra(object: StringObject): InviewToggleExtra;
|
|
3147
|
+
protected bindBadge(entry: StringDevBadgeEntry<InviewToggleExtra>): Array<() => void>;
|
|
3148
|
+
protected onBadgeClick(entry: StringDevBadgeEntry<InviewToggleExtra>, _event: MouseEvent): void;
|
|
3149
|
+
protected getBadgeState(entry: StringDevBadgeEntry<InviewToggleExtra>): StringDevOverlayBadgeState;
|
|
3150
|
+
}
|
|
3151
|
+
|
|
3152
|
+
/**
|
|
3153
|
+
* StringDevRulers — developer utility module for guide-line rulers.
|
|
3154
|
+
*
|
|
3155
|
+
* Usage:
|
|
3156
|
+
* st.use(StringDevRulers)
|
|
3157
|
+
* st.use(StringDevRulers, { triggers: [...], grid: { type: "columns", count: 12, ... } })
|
|
3158
|
+
*
|
|
3159
|
+
* Default trigger: Shift + R
|
|
3160
|
+
*
|
|
3161
|
+
* Settings:
|
|
3162
|
+
* triggers — array of trigger descriptors (keyboard / element / event)
|
|
3163
|
+
* rulers-snap — grid step in px (0 = off)
|
|
3164
|
+
* rulers-snap-elements — snap to [string] element edges (default: true)
|
|
3165
|
+
* rulers-snap-threshold — snap pull radius in px (default: 8)
|
|
3166
|
+
* rulers-snap-selector — CSS selector for snap targets
|
|
3167
|
+
* grid — RulersLayoutGrid | RulersLayoutGrid[]
|
|
3168
|
+
*
|
|
3169
|
+
* Snap visual feedback:
|
|
3170
|
+
* amber → snapping to a DOM element edge / center
|
|
3171
|
+
* green → snapping to a layout-grid line
|
|
3172
|
+
*/
|
|
3173
|
+
declare class StringDevRulers extends StringDevModule {
|
|
3174
|
+
private manager;
|
|
3175
|
+
private overlay;
|
|
3176
|
+
private visible;
|
|
3177
|
+
private dockDisabled;
|
|
3178
|
+
private currentModeId;
|
|
3179
|
+
private readonly viewportLayer;
|
|
3180
|
+
private _kbHandlers;
|
|
3181
|
+
private _elHandlers;
|
|
3182
|
+
private _evHandlers;
|
|
3183
|
+
static devtool: {
|
|
3184
|
+
id: string;
|
|
3185
|
+
label: string;
|
|
3186
|
+
icon: string;
|
|
3187
|
+
order: number;
|
|
3188
|
+
styles: string;
|
|
3189
|
+
};
|
|
3190
|
+
constructor(context: StringContext);
|
|
3191
|
+
onInit(): void;
|
|
3192
|
+
onSettingsChange(): void;
|
|
3193
|
+
onSubscribe(): void;
|
|
3194
|
+
onUnsubscribe(): void;
|
|
3195
|
+
onFrame(data: StringData): void;
|
|
3196
|
+
onResize(): void;
|
|
3197
|
+
destroy(): void;
|
|
3198
|
+
toggle(): void;
|
|
3199
|
+
show(): void;
|
|
3200
|
+
hide(): void;
|
|
3201
|
+
isVisible(): boolean;
|
|
3202
|
+
protected getDevtoolActiveState(): boolean;
|
|
3203
|
+
protected setDevtoolActiveState(active: boolean): void;
|
|
3204
|
+
private _bindTriggers;
|
|
3205
|
+
private _unbindTriggers;
|
|
3206
|
+
private _applyAction;
|
|
3207
|
+
private setVisible;
|
|
3208
|
+
private setDockActive;
|
|
3209
|
+
private mountOverlay;
|
|
3210
|
+
private cycleMode;
|
|
3211
|
+
private switchMode;
|
|
3212
|
+
private applyStyleSettings;
|
|
3213
|
+
private clearStyleSettings;
|
|
3214
|
+
/** Normalises the `grid` setting to RulersLayoutGrid[] (or undefined). */
|
|
3215
|
+
private _resolveGrids;
|
|
3216
|
+
private syncOverlayMetrics;
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3219
|
+
interface OffsetOverlayEntry {
|
|
3220
|
+
object: StringObject;
|
|
3221
|
+
root: HTMLDivElement;
|
|
3222
|
+
box: HTMLDivElement;
|
|
3223
|
+
topZone: HTMLDivElement;
|
|
3224
|
+
bottomZone: HTMLDivElement;
|
|
3225
|
+
topMarker: HTMLDivElement;
|
|
3226
|
+
bottomMarker: HTMLDivElement;
|
|
3227
|
+
topMarkerValue: HTMLSpanElement;
|
|
3228
|
+
bottomMarkerValue: HTMLSpanElement;
|
|
3229
|
+
badge: HTMLButtonElement;
|
|
3230
|
+
badgeDepth: number;
|
|
3231
|
+
onBadgeClick: (event: MouseEvent) => void;
|
|
3232
|
+
}
|
|
3233
|
+
interface OffsetOverlayMeasurement {
|
|
3234
|
+
visible: boolean;
|
|
3235
|
+
overlayVisible: boolean;
|
|
3236
|
+
badgeVisible: boolean;
|
|
3237
|
+
inview: boolean;
|
|
3238
|
+
boxDocX: number;
|
|
3239
|
+
boxDocY: number;
|
|
3240
|
+
width: number;
|
|
3241
|
+
height: number;
|
|
3242
|
+
borderRadius: string;
|
|
3243
|
+
topZoneDocX: number;
|
|
3244
|
+
topZoneDocY: number;
|
|
3245
|
+
topZoneWidth: number;
|
|
3246
|
+
topZoneHeight: number;
|
|
3247
|
+
topZoneEmpty: boolean;
|
|
3248
|
+
bottomZoneDocX: number;
|
|
3249
|
+
bottomZoneDocY: number;
|
|
3250
|
+
bottomZoneWidth: number;
|
|
3251
|
+
bottomZoneHeight: number;
|
|
3252
|
+
bottomZoneEmpty: boolean;
|
|
3253
|
+
topMarkerDocX: number;
|
|
3254
|
+
topMarkerDocY: number;
|
|
3255
|
+
topMarkerValue: string;
|
|
3256
|
+
bottomMarkerDocX: number;
|
|
3257
|
+
bottomMarkerDocY: number;
|
|
3258
|
+
bottomMarkerValue: string;
|
|
3259
|
+
badgeDocX: number;
|
|
3260
|
+
badgeDocY: number;
|
|
3261
|
+
}
|
|
3262
|
+
declare class StringDevOffsets extends StringDevOverlayModule<OffsetOverlayEntry, OffsetOverlayMeasurement> {
|
|
3263
|
+
static devtool: {
|
|
3264
|
+
id: string;
|
|
3265
|
+
label: string;
|
|
3266
|
+
icon: string;
|
|
3267
|
+
order: number;
|
|
3268
|
+
styles: string;
|
|
3269
|
+
overlay: {
|
|
3270
|
+
layerName: string;
|
|
3271
|
+
zIndex: number;
|
|
3272
|
+
layerAttribute: string;
|
|
3273
|
+
overlayId: string;
|
|
3274
|
+
};
|
|
3275
|
+
};
|
|
3276
|
+
private entryEnabled;
|
|
3277
|
+
canConnect(_object: StringObject): boolean;
|
|
3278
|
+
protected createOverlayEntry(object: StringObject): OffsetOverlayEntry;
|
|
3279
|
+
protected destroyOverlayEntry(entry: OffsetOverlayEntry): void;
|
|
3280
|
+
protected measureEntry(entry: OffsetOverlayEntry, metrics: OverlayBaseMetrics): OffsetOverlayMeasurement;
|
|
3281
|
+
protected applyMeasurement(entry: OffsetOverlayEntry, measurement: OffsetOverlayMeasurement | undefined): void;
|
|
3282
|
+
private hiddenMeasurement;
|
|
3283
|
+
private isEntryEnabled;
|
|
3284
|
+
private setEntryEnabled;
|
|
3285
|
+
private getViewportAnchorOffset;
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
interface ProgressEntry {
|
|
3289
|
+
object: StringObject;
|
|
3290
|
+
chrome: HTMLDivElement;
|
|
3291
|
+
badge: HTMLButtonElement;
|
|
3292
|
+
panel: HTMLDivElement;
|
|
3293
|
+
title: HTMLSpanElement;
|
|
3294
|
+
slider: HTMLInputElement;
|
|
3295
|
+
easedValue: HTMLSpanElement;
|
|
3296
|
+
rawValue: HTMLSpanElement;
|
|
3297
|
+
rangeValue: HTMLSpanElement;
|
|
3298
|
+
onBadgeClick: (event: MouseEvent) => void;
|
|
3299
|
+
onSliderInput: () => void;
|
|
3300
|
+
}
|
|
3301
|
+
interface ProgressMeasurement {
|
|
3302
|
+
visible: boolean;
|
|
3303
|
+
docX: number;
|
|
3304
|
+
docY: number;
|
|
3305
|
+
targetLabel: string;
|
|
3306
|
+
progress: number;
|
|
3307
|
+
rawProgress: number;
|
|
3308
|
+
startPosition: number;
|
|
3309
|
+
endPosition: number;
|
|
3310
|
+
currentScroll: number;
|
|
3311
|
+
key: string;
|
|
3312
|
+
}
|
|
3313
|
+
declare class StringDevProgress extends StringDevOverlayModule<ProgressEntry, ProgressMeasurement> {
|
|
3314
|
+
static devtool: {
|
|
3315
|
+
id: string;
|
|
3316
|
+
label: string;
|
|
3317
|
+
icon: string;
|
|
3318
|
+
order: number;
|
|
3319
|
+
styles: string;
|
|
3320
|
+
overlay: {
|
|
3321
|
+
layerName: string;
|
|
3322
|
+
zIndex: number;
|
|
3323
|
+
layerAttribute: string;
|
|
3324
|
+
overlayId: string;
|
|
3325
|
+
};
|
|
3326
|
+
};
|
|
3327
|
+
private openEntryId;
|
|
3328
|
+
private readonly onDocumentPointerDownBind;
|
|
3329
|
+
constructor(context: any);
|
|
3330
|
+
onInit(): void;
|
|
3331
|
+
destroy(): void;
|
|
3332
|
+
protected createOverlayEntry(object: StringObject): ProgressEntry;
|
|
3333
|
+
protected destroyOverlayEntry(entry: ProgressEntry): void;
|
|
3334
|
+
protected measureEntry(entry: ProgressEntry, metrics: OverlayBaseMetrics): ProgressMeasurement;
|
|
3335
|
+
protected applyMeasurement(entry: ProgressEntry, measurement: ProgressMeasurement | undefined): void;
|
|
3336
|
+
protected onEnabledChange(enabled: boolean): void;
|
|
3337
|
+
private applyEntryEnabledState;
|
|
3338
|
+
private openPanel;
|
|
3339
|
+
private closePanel;
|
|
3340
|
+
private closeAllPanels;
|
|
3341
|
+
private onDocumentPointerDown;
|
|
3342
|
+
private resolveEntryRawProgress;
|
|
3343
|
+
private resolveEasedProgress;
|
|
3344
|
+
private setEntryProgressOverride;
|
|
3345
|
+
private clearEntryProgressOverride;
|
|
3346
|
+
private clearAllProgressOverrides;
|
|
3347
|
+
private applyObjectProgress;
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
declare class StringDevIconRegistry {
|
|
3351
|
+
private static instance;
|
|
3352
|
+
private readonly icons;
|
|
3353
|
+
private constructor();
|
|
3354
|
+
static getInstance(): StringDevIconRegistry;
|
|
3355
|
+
register(id: string, svg: string): void;
|
|
3356
|
+
get(id: string): string | null;
|
|
3357
|
+
resolve(iconOrId: string): string;
|
|
3358
|
+
}
|
|
3359
|
+
declare function resolveDevtoolsIcon(iconOrId: string): string;
|
|
3360
|
+
|
|
3361
|
+
type StringDevStyleTokens = Record<string, string>;
|
|
3362
|
+
declare function buildDevtoolsThemeBlock(selectors: string | string[], overrides?: StringDevStyleTokens): string;
|
|
3363
|
+
declare function ensureStringDevtoolsSharedStyles(): HTMLStyleElement | null;
|
|
3364
|
+
|
|
2674
3365
|
/**
|
|
2675
3366
|
* What the trigger does when activated.
|
|
2676
3367
|
* Defaults to "toggle" when not specified.
|
|
@@ -2804,12 +3495,16 @@ declare class DOMBatcher {
|
|
|
2804
3495
|
}
|
|
2805
3496
|
|
|
2806
3497
|
declare class StringTune {
|
|
3498
|
+
private static readonly DEVTOOLS_ACCESS_URL;
|
|
3499
|
+
private static readonly DEVTOOLS_LOG_PREFIX;
|
|
2807
3500
|
/** Bound handler for the scroll start event */
|
|
2808
3501
|
private onScrollStartBind;
|
|
2809
3502
|
/** Bound handler for the scroll stop event */
|
|
2810
3503
|
private onScrollStopBind;
|
|
2811
3504
|
/** Bound handler for the scroll direction change event */
|
|
2812
3505
|
private onDirectionChangeBind;
|
|
3506
|
+
/** Bound handler for scroll mode/config changes */
|
|
3507
|
+
private onScrollConfigChangeBind;
|
|
2813
3508
|
/** Bound wheel event handler */
|
|
2814
3509
|
private onWheelBind;
|
|
2815
3510
|
/** Bound scroll event handler */
|
|
@@ -2860,7 +3555,16 @@ declare class StringTune {
|
|
|
2860
3555
|
private centers;
|
|
2861
3556
|
/** Tracks hover states of string objects. */
|
|
2862
3557
|
private hoverManager;
|
|
3558
|
+
private devtools;
|
|
3559
|
+
private devtoolsFpsLastSampleTime;
|
|
3560
|
+
private devtoolsFpsFrameCount;
|
|
2863
3561
|
private observerContainerResize;
|
|
3562
|
+
private devtoolsAccessToken;
|
|
3563
|
+
private devtoolsAccessState;
|
|
3564
|
+
private devtoolsAccessRequestId;
|
|
3565
|
+
private pendingDevtoolUses;
|
|
3566
|
+
private hasStarted;
|
|
3567
|
+
private devtoolsAccessLastMessage;
|
|
2864
3568
|
canRebuild: boolean;
|
|
2865
3569
|
/**
|
|
2866
3570
|
* Sets the scroll position manually.
|
|
@@ -2870,6 +3574,7 @@ declare class StringTune {
|
|
|
2870
3574
|
* @param value The new scroll position in pixels.
|
|
2871
3575
|
*/
|
|
2872
3576
|
set scrollPosition(value: number);
|
|
3577
|
+
set accessDevtoolToken(value: string);
|
|
2873
3578
|
/**
|
|
2874
3579
|
* Configures the container element(s) used for scroll tracking.
|
|
2875
3580
|
* Accepts either the `Window` object or an `HTMLElement`.
|
|
@@ -2937,6 +3642,11 @@ declare class StringTune {
|
|
|
2937
3642
|
* @param settings Optional settings specific to this module.
|
|
2938
3643
|
*/
|
|
2939
3644
|
use(objectClass: typeof StringModule, settings?: any): void;
|
|
3645
|
+
private instantiateModule;
|
|
3646
|
+
private shouldDeferDevtoolModule;
|
|
3647
|
+
private validateDevtoolsAccess;
|
|
3648
|
+
private logDevtoolsAccess;
|
|
3649
|
+
private resolveDevtoolsAccessResponse;
|
|
2940
3650
|
/**
|
|
2941
3651
|
* Registers a new scroll mode (provider) to the system.
|
|
2942
3652
|
* Allows integrating custom scroll implementations (e.g. Lenis, Locomotive).
|
|
@@ -3040,6 +3750,8 @@ declare class StringTune {
|
|
|
3040
3750
|
* Triggers module scroll stop lifecycle hook.
|
|
3041
3751
|
*/
|
|
3042
3752
|
private onDirectionChange;
|
|
3753
|
+
private onScrollConfigChange;
|
|
3754
|
+
private syncDebugScrollState;
|
|
3043
3755
|
/**
|
|
3044
3756
|
* Called when global or module settings are updated.
|
|
3045
3757
|
* Notifies all managers and modules to re-read new settings.
|
|
@@ -3057,6 +3769,7 @@ declare class StringTune {
|
|
|
3057
3769
|
* Triggers scroll engine, modules, and global `update` event.
|
|
3058
3770
|
*/
|
|
3059
3771
|
private onUpdateEvent;
|
|
3772
|
+
private updateDevtoolsFPS;
|
|
3060
3773
|
/**
|
|
3061
3774
|
* Handles resize events from scroll container or window.
|
|
3062
3775
|
* Ignores height-only changes on mobile to prevent layout jumps.
|
|
@@ -3064,11 +3777,25 @@ declare class StringTune {
|
|
|
3064
3777
|
*/
|
|
3065
3778
|
onResize(force?: boolean): void;
|
|
3066
3779
|
invalidateCenter(id: string): void;
|
|
3067
|
-
scrollTo(
|
|
3780
|
+
scrollTo(position: number): void;
|
|
3781
|
+
scrollTo(selector: string): void;
|
|
3782
|
+
scrollTo(element: HTMLElement): void;
|
|
3783
|
+
scrollTo(options: {
|
|
3068
3784
|
position: number;
|
|
3069
3785
|
immediate?: boolean;
|
|
3786
|
+
offset?: number;
|
|
3787
|
+
} | {
|
|
3788
|
+
selector: string;
|
|
3789
|
+
immediate?: boolean;
|
|
3790
|
+
offset?: number;
|
|
3791
|
+
} | {
|
|
3792
|
+
element: HTMLElement;
|
|
3793
|
+
immediate?: boolean;
|
|
3794
|
+
offset?: number;
|
|
3070
3795
|
}): void;
|
|
3796
|
+
private resolveScrollToValue;
|
|
3797
|
+
private resolveElementScrollPosition;
|
|
3071
3798
|
destroy(): void;
|
|
3072
3799
|
}
|
|
3073
3800
|
|
|
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 };
|
|
3801
|
+
export { CursorReactiveModule, DOMBatcher, GridAdapter, type RulersLayoutGrid, type RulersTriggerAction, ScrollController, type ScrollMarkRule as ScrollTriggerRule, StringAnchor, type StringContext, StringCursor, StringData, StringDelayLerpTracker, StringDevIconRegistry, StringDevInviewToggle, StringDevLayout, StringDevModule, StringDevOffsets, StringDevOverlayRegistry, StringDevProgress, StringDevRulers, 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 };
|