marquee-content 5.0.0-dev.2 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -102
- package/dist/index.cjs +643 -58
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +134 -0
- package/dist/index.d.ts +134 -4
- package/dist/index.js +647 -0
- package/dist/index.js.map +1 -0
- package/dist/marquee-content.css +1 -1
- package/package.json +49 -29
- package/dist/index.es.js +0 -558
- package/dist/index.umd.js +0 -71
- package/dist/marquee-content.d.ts +0 -166
- package/dist/styles.d.ts +0 -10
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { MarqueeContentStyleInput } from './styles';
|
|
2
|
-
export type MarqueeContentDirection = 'rtl' | 'ltr' | 'scroll';
|
|
3
|
-
export interface MarqueeContentOptions {
|
|
4
|
-
speed?: number | string | null;
|
|
5
|
-
direction?: MarqueeContentDirection | null;
|
|
6
|
-
minGroupWidthRatio?: number | string | null;
|
|
7
|
-
responsiveSpeed?: boolean | string | null;
|
|
8
|
-
referenceWidth?: number | string | null;
|
|
9
|
-
minSpeedFactor?: number | string | null;
|
|
10
|
-
maxSpeedFactor?: number | string | null;
|
|
11
|
-
pauseOnHover?: boolean | string | null;
|
|
12
|
-
pauseWhenOutOfView?: boolean | string | null;
|
|
13
|
-
recalculateAfterFontsReady?: boolean | string | null;
|
|
14
|
-
scrollVelocityFactor?: number | string | null;
|
|
15
|
-
scrollMinExtraSpeed?: number | string | null;
|
|
16
|
-
scrollMaxExtraSpeed?: number | string | null;
|
|
17
|
-
scrollInertiaDuration?: number | string | null;
|
|
18
|
-
debug?: boolean | string | null;
|
|
19
|
-
}
|
|
20
|
-
export interface MarqueeContentResolvedOptions {
|
|
21
|
-
speed: number;
|
|
22
|
-
direction: MarqueeContentDirection;
|
|
23
|
-
minGroupWidthRatio: number;
|
|
24
|
-
responsiveSpeed: boolean;
|
|
25
|
-
referenceWidth: number;
|
|
26
|
-
minSpeedFactor: number;
|
|
27
|
-
maxSpeedFactor: number;
|
|
28
|
-
pauseOnHover: boolean;
|
|
29
|
-
pauseWhenOutOfView: boolean;
|
|
30
|
-
recalculateAfterFontsReady: boolean;
|
|
31
|
-
scrollVelocityFactor: number;
|
|
32
|
-
scrollMinExtraSpeed: number;
|
|
33
|
-
scrollMaxExtraSpeed: number;
|
|
34
|
-
scrollInertiaDuration: number;
|
|
35
|
-
debug: boolean;
|
|
36
|
-
}
|
|
37
|
-
export interface DefineMarqueeContentOptions {
|
|
38
|
-
stylesheet?: MarqueeContentStyleInput;
|
|
39
|
-
styleOverrides?: MarqueeContentStyleInput;
|
|
40
|
-
}
|
|
41
|
-
export interface InitMarqueeContentsOptions extends DefineMarqueeContentOptions {
|
|
42
|
-
tagName?: string;
|
|
43
|
-
}
|
|
44
|
-
export declare const MARQUEE_CONTENT_TAG = "marquee-content";
|
|
45
|
-
export declare class MarqueeContent extends HTMLElement {
|
|
46
|
-
static get observedAttributes(): string[];
|
|
47
|
-
private static readonly instances;
|
|
48
|
-
private static stylesheetEntry;
|
|
49
|
-
private static styleOverridesEntry;
|
|
50
|
-
static configureStyles(options?: DefineMarqueeContentOptions): void;
|
|
51
|
-
static setStylesheet(stylesheet: MarqueeContentStyleInput): void;
|
|
52
|
-
static setStyleOverrides(styleOverrides: MarqueeContentStyleInput): void;
|
|
53
|
-
private readonly shadow;
|
|
54
|
-
private readonly sourceSlot;
|
|
55
|
-
private readonly track;
|
|
56
|
-
private options;
|
|
57
|
-
private sourceNodes;
|
|
58
|
-
private resizeObserver;
|
|
59
|
-
private mutationObserver;
|
|
60
|
-
private intersectionObserver;
|
|
61
|
-
private abortController;
|
|
62
|
-
private reducedMotionMediaQuery;
|
|
63
|
-
private animationFrameId;
|
|
64
|
-
private rebuildFrameId;
|
|
65
|
-
private lastFrameTime;
|
|
66
|
-
private mounted;
|
|
67
|
-
private isHovered;
|
|
68
|
-
private isInViewport;
|
|
69
|
-
private reducedMotion;
|
|
70
|
-
private distance;
|
|
71
|
-
private offset;
|
|
72
|
-
private emptySourceRebuildCount;
|
|
73
|
-
private hasWarnedMissingSourceNodes;
|
|
74
|
-
private scrollDirectionFactor;
|
|
75
|
-
private scrollBoostStartValue;
|
|
76
|
-
private scrollBoostStartedAt;
|
|
77
|
-
private lastScrollY;
|
|
78
|
-
private lastScrollTime;
|
|
79
|
-
constructor();
|
|
80
|
-
connectedCallback(): void;
|
|
81
|
-
disconnectedCallback(): void;
|
|
82
|
-
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
83
|
-
get speed(): number;
|
|
84
|
-
set speed(value: number | string | null | undefined);
|
|
85
|
-
get direction(): MarqueeContentDirection;
|
|
86
|
-
set direction(value: MarqueeContentDirection | null | undefined);
|
|
87
|
-
get minGroupWidthRatio(): number;
|
|
88
|
-
set minGroupWidthRatio(value: number | string | null | undefined);
|
|
89
|
-
get responsiveSpeed(): boolean;
|
|
90
|
-
set responsiveSpeed(value: boolean | string | null | undefined);
|
|
91
|
-
get referenceWidth(): number;
|
|
92
|
-
set referenceWidth(value: number | string | null | undefined);
|
|
93
|
-
get minSpeedFactor(): number;
|
|
94
|
-
set minSpeedFactor(value: number | string | null | undefined);
|
|
95
|
-
get maxSpeedFactor(): number;
|
|
96
|
-
set maxSpeedFactor(value: number | string | null | undefined);
|
|
97
|
-
get pauseOnHover(): boolean;
|
|
98
|
-
set pauseOnHover(value: boolean | string | null | undefined);
|
|
99
|
-
get pauseWhenOutOfView(): boolean;
|
|
100
|
-
set pauseWhenOutOfView(value: boolean | string | null | undefined);
|
|
101
|
-
get recalculateAfterFontsReady(): boolean;
|
|
102
|
-
set recalculateAfterFontsReady(value: boolean | string | null | undefined);
|
|
103
|
-
get scrollVelocityFactor(): number;
|
|
104
|
-
set scrollVelocityFactor(value: number | string | null | undefined);
|
|
105
|
-
get scrollMinExtraSpeed(): number;
|
|
106
|
-
set scrollMinExtraSpeed(value: number | string | null | undefined);
|
|
107
|
-
get scrollMaxExtraSpeed(): number;
|
|
108
|
-
set scrollMaxExtraSpeed(value: number | string | null | undefined);
|
|
109
|
-
get scrollInertiaDuration(): number;
|
|
110
|
-
set scrollInertiaDuration(value: number | string | null | undefined);
|
|
111
|
-
get debug(): boolean;
|
|
112
|
-
set debug(value: boolean | string | null | undefined);
|
|
113
|
-
update(options?: MarqueeContentOptions): void;
|
|
114
|
-
refresh(): void;
|
|
115
|
-
adoptStyles(stylesheet: MarqueeContentStyleInput): void;
|
|
116
|
-
adoptStyleOverrides(styleOverrides: MarqueeContentStyleInput): void;
|
|
117
|
-
private applyAllStyles;
|
|
118
|
-
private applyFallbackStyleElement;
|
|
119
|
-
private removeFallbackStyleElements;
|
|
120
|
-
private teardown;
|
|
121
|
-
private handleSlotChange;
|
|
122
|
-
private handlePointerEnter;
|
|
123
|
-
private handlePointerLeave;
|
|
124
|
-
private handleIntersectionChange;
|
|
125
|
-
private handleReducedMotionChange;
|
|
126
|
-
private handleScroll;
|
|
127
|
-
private scheduleRebuild;
|
|
128
|
-
private cancelScheduledRebuild;
|
|
129
|
-
private rebuild;
|
|
130
|
-
private warnAboutMissingSourceNodes;
|
|
131
|
-
private createGroup;
|
|
132
|
-
private expandGroupToWidth;
|
|
133
|
-
private appendSourceNodes;
|
|
134
|
-
private cloneSourceNode;
|
|
135
|
-
private getSourceNodes;
|
|
136
|
-
private watchSourceNodes;
|
|
137
|
-
private setupReducedMotionWatcher;
|
|
138
|
-
private removeReducedMotionWatcher;
|
|
139
|
-
private updateAnimationLoopState;
|
|
140
|
-
private canAnimate;
|
|
141
|
-
private startAnimationLoop;
|
|
142
|
-
private stopAnimationLoop;
|
|
143
|
-
private tick;
|
|
144
|
-
private getCurrentTimeScale;
|
|
145
|
-
private getScrollBoost;
|
|
146
|
-
private applyTransform;
|
|
147
|
-
private normalizeOffset;
|
|
148
|
-
private getCurrentSpeed;
|
|
149
|
-
private resolveOptions;
|
|
150
|
-
private num;
|
|
151
|
-
private parseNumber;
|
|
152
|
-
private parseBoolean;
|
|
153
|
-
private parseDirection;
|
|
154
|
-
private setNullableAttribute;
|
|
155
|
-
private getScrollY;
|
|
156
|
-
private clamp;
|
|
157
|
-
private easeOutCubic;
|
|
158
|
-
private rebuildAfterFontsReady;
|
|
159
|
-
}
|
|
160
|
-
export declare function defineMarqueeContent(tagName?: string, options?: DefineMarqueeContentOptions): void;
|
|
161
|
-
export declare function initMarqueeContents(options?: InitMarqueeContentsOptions): void;
|
|
162
|
-
declare global {
|
|
163
|
-
interface HTMLElementTagNameMap {
|
|
164
|
-
'marquee-content': MarqueeContent;
|
|
165
|
-
}
|
|
166
|
-
}
|
package/dist/styles.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type MarqueeContentStyleInput = CSSStyleSheet | string | null | undefined;
|
|
2
|
-
export interface MarqueeContentStyleEntry {
|
|
3
|
-
sheet: CSSStyleSheet | null;
|
|
4
|
-
cssText: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const marqueeContentCssText: string;
|
|
7
|
-
export declare function createConstructableStyleSheet(cssText: string): CSSStyleSheet | null;
|
|
8
|
-
export declare function cssStyleSheetToText(sheet: CSSStyleSheet): string;
|
|
9
|
-
export declare function normalizeStyleInput(input: MarqueeContentStyleInput): MarqueeContentStyleEntry;
|
|
10
|
-
export declare function canUseAdoptedStyleSheets(root: ShadowRoot): boolean;
|