@ldelia/react-media 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/__tests__/timeline/timeline.test.d.ts +1 -0
- package/dist/components/reproduction-widget/ReproductionWidget.d.ts +17 -0
- package/dist/components/reproduction-widget/index.js +1 -0
- package/dist/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.d.ts +8 -0
- package/dist/components/reproduction-widget/inner-players/YouTubeInnerPlayer.d.ts +10 -0
- package/dist/components/reproduction-widget/models/Player/PlayAlongPlayer.d.ts +30 -0
- package/dist/components/reproduction-widget/models/Player/PlayerEvents.d.ts +4 -0
- package/dist/components/reproduction-widget/models/Player/YouTubePlayer.d.ts +30 -0
- package/dist/components/reproduction-widget/models/Reproduction.d.ts +66 -0
- package/dist/components/reproduction-widget/models/ReproductionBuilder.d.ts +16 -0
- package/dist/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.d.ts +8 -0
- package/dist/components/timeline/Timeline.d.ts +12 -0
- package/dist/components/timeline/TimelineCanvas/TickTime.d.ts +7 -0
- package/dist/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.d.ts +6 -0
- package/dist/components/timeline/TimelineCanvas/TimelineCanvas.d.ts +7 -0
- package/dist/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.d.ts +2 -0
- package/dist/components/timeline/TimelineValue/TimelineValue.d.ts +7 -0
- package/dist/components/timeline/ZoomContext/ZoomContext.d.ts +7 -0
- package/dist/components/timeline/constants.d.ts +1 -0
- package/dist/components/timeline/utils/utils.d.ts +7 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/stories/reproduction-widget.stories.d.ts +4 -0
- package/dist/stories/timeline.stories.d.ts +9 -0
- package/package.json +45 -35
- package/.bitmap +0 -48
- package/.eslintcache +0 -1
- package/.prettierignore +0 -3
- package/.prettierrc +0 -7
- package/.storybook/main.js +0 -38
- package/.storybook/preview.js +0 -4
- package/config/env.js +0 -104
- package/config/getHttpsConfig.js +0 -66
- package/config/jest/babelTransform.js +0 -29
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileTransform.js +0 -40
- package/config/modules.js +0 -134
- package/config/paths.js +0 -77
- package/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
- package/config/webpack.config.js +0 -755
- package/config/webpackDevServer.config.js +0 -127
- package/scripts/build.js +0 -217
- package/scripts/start.js +0 -154
- package/scripts/test.js +0 -52
- package/src/components/__tests__/timeline/timeline.test.tsx +0 -26
- package/src/components/reproduction-widget/README.md +0 -27
- package/src/components/reproduction-widget/ReproductionWidget.tsx +0 -68
- package/src/components/reproduction-widget/index.tsx +0 -1
- package/src/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.tsx +0 -10
- package/src/components/reproduction-widget/inner-players/YouTubeInnerPlayer.tsx +0 -36
- package/src/components/reproduction-widget/models/Player/PlayAlongPlayer.ts +0 -129
- package/src/components/reproduction-widget/models/Player/PlayerEvents.ts +0 -4
- package/src/components/reproduction-widget/models/Player/YouTubePlayer.ts +0 -171
- package/src/components/reproduction-widget/models/Reproduction.ts +0 -272
- package/src/components/reproduction-widget/models/ReproductionBuilder.ts +0 -70
- package/src/components/timeline/README.md +0 -111
- package/src/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.tsx +0 -166
- package/src/components/timeline/Timeline.tsx +0 -139
- package/src/components/timeline/TimelineCanvas/TickTime.tsx +0 -45
- package/src/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.tsx +0 -42
- package/src/components/timeline/TimelineCanvas/TimelineCanvas.tsx +0 -79
- package/src/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.ts +0 -43
- package/src/components/timeline/TimelineValue/TimelineValue.tsx +0 -87
- package/src/components/timeline/ZoomContext/ZoomContext.ts +0 -10
- package/src/components/timeline/constants.ts +0 -13
- package/src/components/timeline/utils/utils.ts +0 -49
- package/src/modules.d.ts +0 -1
- package/src/react-app-env.d.ts +0 -71
- package/src/react-docgen-types.d.ts +0 -37
- package/src/setupTests.ts +0 -5
- package/src/stories/Configure.mdx +0 -364
- package/src/stories/reproduction-widget.stories.tsx +0 -23
- package/src/stories/timeline.stories.custom.css +0 -29
- package/src/stories/timeline.stories.tsx +0 -66
- package/storybook-static/favicon.svg +0 -1
- package/storybook-static/index.html +0 -173
- package/storybook-static/index.json +0 -1
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +0 -1
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +0 -12
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -412
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/links-1/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-common-assets/favicon.svg +0 -1
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/globals-module-info.js +0 -995
- package/storybook-static/sb-manager/globals-runtime.js +0 -53527
- package/storybook-static/sb-manager/globals.js +0 -48
- package/storybook-static/sb-manager/runtime.js +0 -11885
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -9483
- package/tsconfig.json +0 -14
- /package/{src → dist}/components/__tests__/timeline/timeline.test.js +0 -0
- /package/{src/components/index.js → dist/components/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.js} +0 -0
- /package/{src → dist}/components/reproduction-widget/ReproductionWidget.js +0 -0
- /package/{src/components/reproduction-widget/index.js → dist/components/reproduction-widget/index.d.ts} +0 -0
- /package/{src → dist}/components/reproduction-widget/inner-players/PlayAlongInnerPlayer.js +0 -0
- /package/{src → dist}/components/reproduction-widget/inner-players/YouTubeInnerPlayer.js +0 -0
- /package/{src → dist}/components/reproduction-widget/models/Player/PlayAlongPlayer.js +0 -0
- /package/{src → dist}/components/reproduction-widget/models/Player/PlayerEvents.js +0 -0
- /package/{src → dist}/components/reproduction-widget/models/Player/YouTubePlayer.js +0 -0
- /package/{src → dist}/components/reproduction-widget/models/Reproduction.js +0 -0
- /package/{src → dist}/components/reproduction-widget/models/ReproductionBuilder.js +0 -0
- /package/{src → dist}/components/timeline/RangeSelectorCanvas/RangeSelectorCanvas.js +0 -0
- /package/{src → dist}/components/timeline/Timeline.js +0 -0
- /package/{src → dist}/components/timeline/TimelineCanvas/TickTime.js +0 -0
- /package/{src → dist}/components/timeline/TimelineCanvas/TickTimeCollectionDisplay.js +0 -0
- /package/{src → dist}/components/timeline/TimelineCanvas/TimelineCanvas.js +0 -0
- /package/{src → dist}/components/timeline/TimelineCanvas/drawTimeBlocksOnCanvas.js +0 -0
- /package/{src → dist}/components/timeline/TimelineValue/TimelineValue.js +0 -0
- /package/{src → dist}/components/timeline/ZoomContext/ZoomContext.js +0 -0
- /package/{src → dist}/components/timeline/constants.js +0 -0
- /package/{src/components/timeline/index.js → dist/components/timeline/index.d.ts} +0 -0
- /package/{src/components/timeline/index.tsx → dist/components/timeline/index.js} +0 -0
- /package/{src → dist}/components/timeline/utils/utils.js +0 -0
- /package/{src/index.js → dist/index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.js} +0 -0
- /package/{src → dist}/setupTests.js +0 -0
- /package/{src → dist}/stories/reproduction-widget.stories.js +0 -0
- /package/{src → dist}/stories/timeline.stories.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Reproduction } from './models/Reproduction';
|
|
3
|
+
interface BaseProps {
|
|
4
|
+
trainingMode: boolean;
|
|
5
|
+
onInit: (reproduction: Reproduction) => void;
|
|
6
|
+
}
|
|
7
|
+
interface TrainingProps extends BaseProps {
|
|
8
|
+
trainingMode: true;
|
|
9
|
+
videoId: string;
|
|
10
|
+
}
|
|
11
|
+
interface NonTrainingProps extends BaseProps {
|
|
12
|
+
trainingMode: false;
|
|
13
|
+
videoId?: never;
|
|
14
|
+
}
|
|
15
|
+
export type ReproductionWidgetProps = TrainingProps | NonTrainingProps;
|
|
16
|
+
export declare const ReproductionWidget: ({ trainingMode, videoId, onInit, }: ReproductionWidgetProps) => React.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ReproductionWidget';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { YouTubePlayer as InnerYouTubePlayer } from 'react-youtube';
|
|
3
|
+
interface Props {
|
|
4
|
+
videoId: string;
|
|
5
|
+
onReady: (event: {
|
|
6
|
+
target: InnerYouTubePlayer;
|
|
7
|
+
}) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const YouTubeInnerPlayer: ({ videoId, onReady }: Props) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const dispatchOnReadyHandlers: unique symbol;
|
|
2
|
+
declare const dispatchOnFinishHandlers: unique symbol;
|
|
3
|
+
export declare class PlayAlongPlayer {
|
|
4
|
+
private readonly duration;
|
|
5
|
+
private currentTime;
|
|
6
|
+
private isRunning;
|
|
7
|
+
private currentPlaybackRate;
|
|
8
|
+
private innerPlayer;
|
|
9
|
+
private interval;
|
|
10
|
+
private [dispatchOnReadyHandlers];
|
|
11
|
+
private [dispatchOnFinishHandlers];
|
|
12
|
+
static get EVENTS(): {
|
|
13
|
+
readonly READY: "READY";
|
|
14
|
+
readonly FINISH: "FINISH";
|
|
15
|
+
};
|
|
16
|
+
constructor(duration: number, innerPlayer: string);
|
|
17
|
+
private setInnerPlayer;
|
|
18
|
+
play(): void;
|
|
19
|
+
pause(): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
seekTo(seconds: number): void;
|
|
22
|
+
getCurrentTime(): number;
|
|
23
|
+
getDuration(): number;
|
|
24
|
+
isAvailable(): boolean;
|
|
25
|
+
getAvailablePlaybackRates(): number[];
|
|
26
|
+
setPlaybackRate(playbackRate: number): void;
|
|
27
|
+
on(eventName: keyof typeof PlayAlongPlayer.EVENTS, handler: () => void): number | undefined;
|
|
28
|
+
dispatch(eventName: keyof typeof PlayAlongPlayer.EVENTS): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { YouTubePlayer as InnerYouTubePlayer } from 'react-youtube';
|
|
2
|
+
import { PlayAlongPlayer } from './PlayAlongPlayer';
|
|
3
|
+
declare const dispatchOnReadyHandlers: unique symbol;
|
|
4
|
+
declare const dispatchOnFinishHandlers: unique symbol;
|
|
5
|
+
export declare class YouTubePlayer {
|
|
6
|
+
private currentTime;
|
|
7
|
+
private isRunning;
|
|
8
|
+
private innerPlayer;
|
|
9
|
+
private [dispatchOnReadyHandlers];
|
|
10
|
+
private [dispatchOnFinishHandlers];
|
|
11
|
+
static get EVENTS(): {
|
|
12
|
+
readonly READY: "READY";
|
|
13
|
+
readonly FINISH: "FINISH";
|
|
14
|
+
};
|
|
15
|
+
constructor(innerPlayer: InnerYouTubePlayer);
|
|
16
|
+
private setInnerPlayer;
|
|
17
|
+
getInnerPlayer(): any;
|
|
18
|
+
play(): void;
|
|
19
|
+
pause(): void;
|
|
20
|
+
stop(): void;
|
|
21
|
+
seekTo(seconds: number): void;
|
|
22
|
+
getCurrentTime(): any;
|
|
23
|
+
getDuration(): any;
|
|
24
|
+
getAvailablePlaybackRates(): any;
|
|
25
|
+
setPlaybackRate(playbackRate: number): void;
|
|
26
|
+
isAvailable(): boolean;
|
|
27
|
+
on(eventName: keyof typeof PlayAlongPlayer.EVENTS, handler: () => void): number | undefined;
|
|
28
|
+
dispatch(eventName: keyof typeof PlayAlongPlayer.EVENTS): void;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ReproductionBuilder } from './ReproductionBuilder';
|
|
2
|
+
import { PlayAlongPlayer } from './Player/PlayAlongPlayer';
|
|
3
|
+
import { YouTubePlayer } from './Player/YouTubePlayer';
|
|
4
|
+
type Player = PlayAlongPlayer | YouTubePlayer;
|
|
5
|
+
declare const dispatchOnReadyHandlers: unique symbol;
|
|
6
|
+
declare const dispatchOnSongStartHandlers: unique symbol;
|
|
7
|
+
declare const dispatchOnCountingInHandlers: unique symbol;
|
|
8
|
+
declare const dispatchOnPlayHandlers: unique symbol;
|
|
9
|
+
declare const dispatchOnPlayingHandlers: unique symbol;
|
|
10
|
+
declare const dispatchOnPausedHandlers: unique symbol;
|
|
11
|
+
declare const dispatchOnFinishHandlers: unique symbol;
|
|
12
|
+
export declare class Reproduction {
|
|
13
|
+
private player;
|
|
14
|
+
private requiresCountingIn;
|
|
15
|
+
private songTempo;
|
|
16
|
+
private state;
|
|
17
|
+
private ready;
|
|
18
|
+
private interval;
|
|
19
|
+
private countingInCounter;
|
|
20
|
+
private [dispatchOnReadyHandlers];
|
|
21
|
+
private [dispatchOnSongStartHandlers];
|
|
22
|
+
private [dispatchOnCountingInHandlers];
|
|
23
|
+
private [dispatchOnPlayHandlers];
|
|
24
|
+
private [dispatchOnPlayingHandlers];
|
|
25
|
+
private [dispatchOnPausedHandlers];
|
|
26
|
+
private [dispatchOnFinishHandlers];
|
|
27
|
+
static get EVENTS(): {
|
|
28
|
+
readonly READY: "READY";
|
|
29
|
+
readonly START: "START";
|
|
30
|
+
readonly COUNTING_IN: "COUNTING_IN";
|
|
31
|
+
readonly PLAY: "PLAY";
|
|
32
|
+
readonly PLAYING: "PLAYING";
|
|
33
|
+
readonly PAUSED: "PAUSED";
|
|
34
|
+
readonly FINISH: "FINISH";
|
|
35
|
+
};
|
|
36
|
+
static get STATES(): {
|
|
37
|
+
STOPPED: number;
|
|
38
|
+
COUNTING_IN: number;
|
|
39
|
+
PLAYING: number;
|
|
40
|
+
PAUSED: number;
|
|
41
|
+
};
|
|
42
|
+
constructor(player: Player, requiresCountingIn: boolean, songTempo: number);
|
|
43
|
+
on(eventName: keyof typeof Reproduction.EVENTS, handler: () => void): number | undefined;
|
|
44
|
+
dispatch(eventName: keyof typeof Reproduction.EVENTS): void;
|
|
45
|
+
private countIn;
|
|
46
|
+
start(): void;
|
|
47
|
+
play(): void;
|
|
48
|
+
pause(): void;
|
|
49
|
+
stop(): void;
|
|
50
|
+
isReady(): boolean;
|
|
51
|
+
isPlaying(): boolean;
|
|
52
|
+
isStopped(): boolean;
|
|
53
|
+
isPaused(): boolean;
|
|
54
|
+
isCountingIn(): boolean;
|
|
55
|
+
getPlayer(): Player;
|
|
56
|
+
getTempo(): number;
|
|
57
|
+
getCurrentTime(): any;
|
|
58
|
+
getDuration(): any;
|
|
59
|
+
seekTo(seconds: number): void;
|
|
60
|
+
getAvailablePlaybackRates(): any;
|
|
61
|
+
setPlaybackRate(playbackRate: number): void;
|
|
62
|
+
isAvailable(): boolean;
|
|
63
|
+
getBPMInterval(): number;
|
|
64
|
+
static newBuilder(): ReproductionBuilder;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Reproduction } from './Reproduction';
|
|
2
|
+
import { YouTubePlayer as InnerYouTubePlayer } from 'react-youtube';
|
|
3
|
+
export declare class ReproductionBuilder {
|
|
4
|
+
private trainingMode;
|
|
5
|
+
private requiresCountingIn;
|
|
6
|
+
private songDuration;
|
|
7
|
+
private songTempo;
|
|
8
|
+
private innerPlayer;
|
|
9
|
+
constructor();
|
|
10
|
+
withSongDuration(songDuration: number): this;
|
|
11
|
+
withSongTempo(songTempo: number): this;
|
|
12
|
+
withTrainingMode(trainingMode: boolean): this;
|
|
13
|
+
withCountingIn(requiresCountingIn: boolean): this;
|
|
14
|
+
withInnerPlayer(innerPlayer: InnerYouTubePlayer | string): this;
|
|
15
|
+
createReproduction(): Reproduction;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface RangeSelectorCanvasProps {
|
|
3
|
+
selectedRange: number[];
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
onRangeChange: (value: number[]) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.NamedExoticComponent<RangeSelectorCanvasProps>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TimelineProps {
|
|
3
|
+
duration: number;
|
|
4
|
+
value: number;
|
|
5
|
+
zoomLevel?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
selectedRange?: number[];
|
|
8
|
+
withTimeBlocks?: boolean;
|
|
9
|
+
onChange?: (value: number) => void;
|
|
10
|
+
onRangeChange?: (value: number[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const Timeline: React.FC<TimelineProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VaLueLineCanvasProps {
|
|
3
|
+
duration: number;
|
|
4
|
+
withTimeBlocks: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const TimelineCanvas: React.ForwardRefExoticComponent<VaLueLineCanvasProps & React.RefAttributes<HTMLCanvasElement>>;
|
|
7
|
+
export default TimelineCanvas;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const zoomLevelConfigurations: number[][];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ZoomContextType } from '../ZoomContext/ZoomContext';
|
|
2
|
+
export declare const secondsToPixel: (zoomContextValue: ZoomContextType, seconds: number) => number;
|
|
3
|
+
export declare const pixelToSeconds: (zoomContextValue: ZoomContextType, pixel: number) => number;
|
|
4
|
+
export declare const getComputedElementWidth: (element: HTMLElement) => number;
|
|
5
|
+
export declare const numberToPxString: (number: number) => string;
|
|
6
|
+
export declare const getTimelineWrapperWidth: (timeLineContainerWidth: number, zoomLevel: number) => number;
|
|
7
|
+
export declare function getBlockOffsetForZoomLevel(zoomLevel: number, duration: number, timelineWrapperWidth: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReproductionWidgetProps } from '../components/reproduction-widget';
|
|
2
|
+
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/dist/types-a5624094").R, import("@storybook/csf").Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, ReproductionWidgetProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TimelineProps } from '../components/timeline';
|
|
2
|
+
import './timeline.stories.custom.css';
|
|
3
|
+
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/dist/types-a5624094").R, import("@storybook/csf").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, TimelineProps>;
|
|
6
|
+
export declare const WithSelectedRange: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, TimelineProps>;
|
|
7
|
+
export declare const WithCustomClassName: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, TimelineProps>;
|
|
8
|
+
export declare const WithoutTimeBlocks: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, TimelineProps>;
|
|
9
|
+
export declare const Minimalist: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/dist/types-a5624094").R, TimelineProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldelia/react-media",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "A React components collection for media-related features.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -11,7 +11,51 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"bugs": "https://github.com/ldelia/react-media/issues",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
|
+
"module": "dist/index.js",
|
|
14
15
|
"types": "dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"start": "node scripts/start.js",
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"test": "node scripts/test.js",
|
|
29
|
+
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
|
|
30
|
+
"storybook": "storybook dev -p 6006",
|
|
31
|
+
"build-storybook": "storybook build"
|
|
32
|
+
},
|
|
33
|
+
"eslintConfig": {
|
|
34
|
+
"extends": [
|
|
35
|
+
"react-app",
|
|
36
|
+
"react-app/jest",
|
|
37
|
+
"plugin:storybook/recommended",
|
|
38
|
+
"prettier"
|
|
39
|
+
],
|
|
40
|
+
"plugins": [
|
|
41
|
+
"prettier"
|
|
42
|
+
],
|
|
43
|
+
"rules": {
|
|
44
|
+
"prettier/prettier": "error"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"browserslist": {
|
|
48
|
+
"production": [
|
|
49
|
+
">0.2%",
|
|
50
|
+
"not dead",
|
|
51
|
+
"not op_mini all"
|
|
52
|
+
],
|
|
53
|
+
"development": [
|
|
54
|
+
"last 1 chrome version",
|
|
55
|
+
"last 1 firefox version",
|
|
56
|
+
"last 1 safari version"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
15
59
|
"dependencies": {
|
|
16
60
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
17
61
|
"@svgr/webpack": "^8.1.0",
|
|
@@ -64,40 +108,6 @@
|
|
|
64
108
|
"webpack-manifest-plugin": "^4.0.2",
|
|
65
109
|
"workbox-webpack-plugin": "^6.4.1"
|
|
66
110
|
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"start": "node scripts/start.js",
|
|
69
|
-
"build": "tsc",
|
|
70
|
-
"test": "node scripts/test.js",
|
|
71
|
-
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,scss,md}\"",
|
|
72
|
-
"storybook": "storybook dev -p 6006",
|
|
73
|
-
"build-storybook": "storybook build"
|
|
74
|
-
},
|
|
75
|
-
"eslintConfig": {
|
|
76
|
-
"extends": [
|
|
77
|
-
"react-app",
|
|
78
|
-
"react-app/jest",
|
|
79
|
-
"plugin:storybook/recommended",
|
|
80
|
-
"prettier"
|
|
81
|
-
],
|
|
82
|
-
"plugins": [
|
|
83
|
-
"prettier"
|
|
84
|
-
],
|
|
85
|
-
"rules": {
|
|
86
|
-
"prettier/prettier": "error"
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"browserslist": {
|
|
90
|
-
"production": [
|
|
91
|
-
">0.2%",
|
|
92
|
-
"not dead",
|
|
93
|
-
"not op_mini all"
|
|
94
|
-
],
|
|
95
|
-
"development": [
|
|
96
|
-
"last 1 chrome version",
|
|
97
|
-
"last 1 firefox version",
|
|
98
|
-
"last 1 safari version"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
111
|
"devDependencies": {
|
|
102
112
|
"@babel/core": "^7.24.9",
|
|
103
113
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
package/.bitmap
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* THIS IS A BIT-AUTO-GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. */
|
|
2
|
-
|
|
3
|
-
{
|
|
4
|
-
"ldelia.react-media/timeline@1.0.8": {
|
|
5
|
-
"files": [
|
|
6
|
-
{
|
|
7
|
-
"relativePath": "src/components/timeline/README.md",
|
|
8
|
-
"test": false,
|
|
9
|
-
"name": "README.md"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"relativePath": "src/components/timeline/RangeSelectorCanvas.tsx",
|
|
13
|
-
"test": false,
|
|
14
|
-
"name": "RangeSelectorCanvas.tsx"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"relativePath": "src/components/timeline/TickTime.tsx",
|
|
18
|
-
"test": false,
|
|
19
|
-
"name": "TickTime.tsx"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"relativePath": "src/components/timeline/TickTimeCollectionDisplay.tsx",
|
|
23
|
-
"test": false,
|
|
24
|
-
"name": "TickTimeCollectionDisplay.tsx"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"relativePath": "src/components/timeline/VaLueLineCanvas.tsx",
|
|
28
|
-
"test": false,
|
|
29
|
-
"name": "VaLueLineCanvas.tsx"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"relativePath": "src/components/timeline/index.tsx",
|
|
33
|
-
"test": false,
|
|
34
|
-
"name": "index.tsx"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"relativePath": "src/components/timeline/utils/utils.ts",
|
|
38
|
-
"test": false,
|
|
39
|
-
"name": "utils.ts"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"mainFile": "src/components/timeline/index.tsx",
|
|
43
|
-
"trackDir": "src/components/timeline",
|
|
44
|
-
"origin": "AUTHORED",
|
|
45
|
-
"exported": true
|
|
46
|
-
},
|
|
47
|
-
"version": "14.8.8"
|
|
48
|
-
}
|
package/.eslintcache
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"/home/ldelia/Proyectos/react-media/src/components/timeline/index.tsx":"1","/home/ldelia/Proyectos/react-media/src/components/timeline/VaLueLineCanvas.tsx":"2","/home/ldelia/Proyectos/react-media/src/components/timeline/TickTimeCollectionDisplay.tsx":"3","/home/ldelia/Proyectos/react-media/src/components/timeline/RangeSelectorCanvas.tsx":"4","/home/ldelia/Proyectos/react-media/src/components/timeline/utils/utils.ts":"5","/home/ldelia/Proyectos/react-media/src/components/timeline/TickTime.tsx":"6","/home/ldelia/Proyectos/react-media/src/stories/timeline.stories.tsx":"7","/home/ldelia/Proyectos/react-media/src/components/timeline/constants.ts":"8"},{"size":4115,"mtime":1612815036821,"results":"9","hashOfConfig":"10"},{"size":3108,"mtime":1611772905837,"results":"11","hashOfConfig":"10"},{"size":1159,"mtime":1611772905837,"results":"12","hashOfConfig":"10"},{"size":6266,"mtime":1611772905837,"results":"13","hashOfConfig":"10"},{"size":404,"mtime":1611772905841,"results":"14","hashOfConfig":"10"},{"size":988,"mtime":1611772905837,"results":"15","hashOfConfig":"10"},{"size":860,"mtime":1611772905841,"results":"16","hashOfConfig":"10"},{"size":319,"mtime":1612814974971,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"v8ab83",{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/ldelia/Proyectos/react-media/src/components/timeline/index.tsx",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/VaLueLineCanvas.tsx",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/TickTimeCollectionDisplay.tsx",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/RangeSelectorCanvas.tsx",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/utils/utils.ts",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/TickTime.tsx",[],"/home/ldelia/Proyectos/react-media/src/stories/timeline.stories.tsx",[],"/home/ldelia/Proyectos/react-media/src/components/timeline/constants.ts",[]]
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/.storybook/main.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"stories": [
|
|
3
|
-
"../src/**/*.stories.mdx",
|
|
4
|
-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
|
|
5
|
-
],
|
|
6
|
-
"addons": [
|
|
7
|
-
"@storybook/addon-links",
|
|
8
|
-
"@storybook/addon-essentials",
|
|
9
|
-
'@storybook/addon-docs',
|
|
10
|
-
],
|
|
11
|
-
"framework": {
|
|
12
|
-
name: "@storybook/react-webpack5",
|
|
13
|
-
options: {},
|
|
14
|
-
},
|
|
15
|
-
webpackFinal: async (config) => {
|
|
16
|
-
config.module.rules.push({
|
|
17
|
-
test: /\.(ts|tsx)$/,
|
|
18
|
-
use: [
|
|
19
|
-
{
|
|
20
|
-
loader: require.resolve('babel-loader'),
|
|
21
|
-
options: {
|
|
22
|
-
presets: ['@babel/preset-env', '@babel/preset-react', '@babel/preset-typescript'],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
loader: require.resolve('ts-loader'),
|
|
27
|
-
options: {
|
|
28
|
-
transpileOnly: true, // Disable type checking
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
config.resolve.extensions.push('.ts', '.tsx');
|
|
35
|
-
|
|
36
|
-
return config;
|
|
37
|
-
},
|
|
38
|
-
}
|
package/.storybook/preview.js
DELETED
package/config/env.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const paths = require('./paths');
|
|
6
|
-
|
|
7
|
-
// Make sure that including paths.js after env.js will read .env variables.
|
|
8
|
-
delete require.cache[require.resolve('./paths')];
|
|
9
|
-
|
|
10
|
-
const NODE_ENV = process.env.NODE_ENV;
|
|
11
|
-
if (!NODE_ENV) {
|
|
12
|
-
throw new Error(
|
|
13
|
-
'The NODE_ENV environment variable is required but was not specified.'
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
|
18
|
-
const dotenvFiles = [
|
|
19
|
-
`${paths.dotenv}.${NODE_ENV}.local`,
|
|
20
|
-
// Don't include `.env.local` for `test` environment
|
|
21
|
-
// since normally you expect tests to produce the same
|
|
22
|
-
// results for everyone
|
|
23
|
-
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
|
|
24
|
-
`${paths.dotenv}.${NODE_ENV}`,
|
|
25
|
-
paths.dotenv,
|
|
26
|
-
].filter(Boolean);
|
|
27
|
-
|
|
28
|
-
// Load environment variables from .env* files. Suppress warnings using silent
|
|
29
|
-
// if this file is missing. dotenv will never modify any environment variables
|
|
30
|
-
// that have already been set. Variable expansion is supported in .env files.
|
|
31
|
-
// https://github.com/motdotla/dotenv
|
|
32
|
-
// https://github.com/motdotla/dotenv-expand
|
|
33
|
-
dotenvFiles.forEach(dotenvFile => {
|
|
34
|
-
if (fs.existsSync(dotenvFile)) {
|
|
35
|
-
require('dotenv-expand')(
|
|
36
|
-
require('dotenv').config({
|
|
37
|
-
path: dotenvFile,
|
|
38
|
-
})
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// We support resolving modules according to `NODE_PATH`.
|
|
44
|
-
// This lets you use absolute paths in imports inside large monorepos:
|
|
45
|
-
// https://github.com/facebook/create-react-app/issues/253.
|
|
46
|
-
// It works similar to `NODE_PATH` in Node itself:
|
|
47
|
-
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
|
|
48
|
-
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
|
|
49
|
-
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
|
|
50
|
-
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
|
|
51
|
-
// We also resolve them to make sure all tools using them work consistently.
|
|
52
|
-
const appDirectory = fs.realpathSync(process.cwd());
|
|
53
|
-
process.env.NODE_PATH = (process.env.NODE_PATH || '')
|
|
54
|
-
.split(path.delimiter)
|
|
55
|
-
.filter(folder => folder && !path.isAbsolute(folder))
|
|
56
|
-
.map(folder => path.resolve(appDirectory, folder))
|
|
57
|
-
.join(path.delimiter);
|
|
58
|
-
|
|
59
|
-
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
|
|
60
|
-
// injected into the application via DefinePlugin in webpack configuration.
|
|
61
|
-
const REACT_APP = /^REACT_APP_/i;
|
|
62
|
-
|
|
63
|
-
function getClientEnvironment(publicUrl) {
|
|
64
|
-
const raw = Object.keys(process.env)
|
|
65
|
-
.filter(key => REACT_APP.test(key))
|
|
66
|
-
.reduce(
|
|
67
|
-
(env, key) => {
|
|
68
|
-
env[key] = process.env[key];
|
|
69
|
-
return env;
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
// Useful for determining whether we’re running in production mode.
|
|
73
|
-
// Most importantly, it switches React into the correct mode.
|
|
74
|
-
NODE_ENV: process.env.NODE_ENV || 'development',
|
|
75
|
-
// Useful for resolving the correct path to static assets in `public`.
|
|
76
|
-
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
|
|
77
|
-
// This should only be used as an escape hatch. Normally you would put
|
|
78
|
-
// images into the `src` and `import` them in code to get their paths.
|
|
79
|
-
PUBLIC_URL: publicUrl,
|
|
80
|
-
// We support configuring the sockjs pathname during development.
|
|
81
|
-
// These settings let a developer run multiple simultaneous projects.
|
|
82
|
-
// They are used as the connection `hostname`, `pathname` and `port`
|
|
83
|
-
// in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
|
|
84
|
-
// and `sockPort` options in webpack-dev-server.
|
|
85
|
-
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
|
|
86
|
-
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
|
|
87
|
-
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
|
|
88
|
-
// Whether or not react-refresh is enabled.
|
|
89
|
-
// It is defined here so it is available in the webpackHotDevClient.
|
|
90
|
-
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
// Stringify all values so we can feed into webpack DefinePlugin
|
|
94
|
-
const stringified = {
|
|
95
|
-
'process.env': Object.keys(raw).reduce((env, key) => {
|
|
96
|
-
env[key] = JSON.stringify(raw[key]);
|
|
97
|
-
return env;
|
|
98
|
-
}, {}),
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
return { raw, stringified };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
module.exports = getClientEnvironment;
|