@maycolem/stories 1.0.1 → 3.0.0
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.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1581 -2507
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/ProfileStories.d.ts +6 -3
- package/dist/src/components/ProfileStory.d.ts +2 -1
- package/dist/src/components/StoryPlayer.d.ts +1 -1
- package/dist/src/hooks/useLocalStorageStories.d.ts +25 -0
- package/dist/stories.css +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IStoriesProfile } from '../types/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
className?: string;
|
|
4
|
+
data: IStoriesProfile[];
|
|
5
|
+
}
|
|
6
|
+
declare const ProfileStories: ({ className, data }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
4
7
|
export default ProfileStories;
|
|
@@ -5,6 +5,7 @@ interface Props {
|
|
|
5
5
|
className?: any;
|
|
6
6
|
onProfileClick?: any;
|
|
7
7
|
width?: string;
|
|
8
|
+
hasSeenAllStories?: any;
|
|
8
9
|
}
|
|
9
|
-
declare const ProfileStory: ({ image, title, color, className, onProfileClick, width, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const ProfileStory: ({ image, title, color, className, onProfileClick, width, hasSeenAllStories, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default ProfileStory;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { StoriesProps } from './StoryPlayerTypes';
|
|
3
3
|
interface Props extends StoriesProps {
|
|
4
|
-
loop?: boolean;
|
|
5
4
|
currentIndex?: any;
|
|
6
5
|
onAllStoriesEnd?: any;
|
|
7
6
|
onOverlayClick?: any;
|
|
8
7
|
inline?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const StoryPlayer: React.FC<Props>;
|
|
11
11
|
export default StoryPlayer;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
container?: string;
|
|
3
|
+
}
|
|
4
|
+
declare const useLocalStorageStories: ({ container }?: Props) => {
|
|
5
|
+
markStorySeen: (profileId: string, storyId: string) => void;
|
|
6
|
+
hasSeenAllStories: (profile: {
|
|
7
|
+
id: string;
|
|
8
|
+
stories: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
}>;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
getNextUnseenStoryIndex: (profile: {
|
|
13
|
+
id: string;
|
|
14
|
+
stories: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
}>;
|
|
17
|
+
}) => number;
|
|
18
|
+
sortProfilesBySeenStatus: <T extends {
|
|
19
|
+
id: string;
|
|
20
|
+
stories: Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
}>;
|
|
23
|
+
}>(originalProfiles: T[]) => T[];
|
|
24
|
+
};
|
|
25
|
+
export default useLocalStorageStories;
|
package/dist/stories.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Antonio:wght@100..700&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";.App{padding:1rem}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;font-family:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{line-height:1;width:100%;height:100%;font-family:Rubik}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}._ProfileStories_1akh2_1{display:flex;padding:1rem;gap:.75rem;justify-items:center;overflow:auto}._ScrollMenu_1akh2_9{position:relative}._scrollContainerClassName_1akh2_13{padding:16px 14px 14px;scrollbar-width:none;-ms-overflow-style:none}._scrollContainerClassName_1akh2_13::-webkit-scrollbar{display:none}._itemClassName_1akh2_22{padding-right:10px}._itemClassName_1akh2_22:last-child{padding-right:0}.
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Antonio:wght@100..700&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";.App{padding:1rem}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;font-family:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{line-height:1;width:100%;height:100%;font-family:Rubik}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}._ProfileStories_1akh2_1{display:flex;padding:1rem;gap:.75rem;justify-items:center;overflow:auto}._ScrollMenu_1akh2_9{position:relative}._scrollContainerClassName_1akh2_13{padding:16px 14px 14px;scrollbar-width:none;-ms-overflow-style:none}._scrollContainerClassName_1akh2_13::-webkit-scrollbar{display:none}._itemClassName_1akh2_22{padding-right:10px}._itemClassName_1akh2_22:last-child{padding-right:0}._ProfileStory_1t16h_1{display:flex;flex-direction:column;width:var(--story-width);cursor:pointer;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}._ProfileStory_1t16h_1._hasSeenAllStories_1t16h_10{filter:grayscale(100%)}._ProfileStoryWrap_1t16h_14{border:2px solid var(--story-color);box-shadow:0 0 3px var(--story-color),0 0 10px var(--story-color);aspect-ratio:1;border-radius:50%;position:relative;padding:2px}._ProfileStory__wrapImage_1t16h_23{width:100%;height:100%;border-radius:50%;background:linear-gradient(to top,#535353,#d5d5d5,transparent)}._ProfileStory__image_1t16h_30{position:absolute;height:auto;width:100%;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center}._ProfileStory__image_1t16h_30>img{position:absolute;bottom:0;height:125%;width:auto;object-fit:cover;-webkit-user-drag:none}._ProfileStory__title_1t16h_47{color:#222;font-size:calc(calc((var(--story-width) / 60) * 10));width:100%;text-align:center;margin:auto;margin-top:.5rem}.react-horizontal-scrolling-menu--scroll-container{display:flex;height:max-content;overflow-y:hidden;position:relative;width:100%}.react-horizontal-scrolling-menu--scroll-container.rtl{direction:rtl}.react-horizontal-scrolling-menu--inner-wrapper{display:flex;overflow-y:hidden}.react-horizontal-scrolling-menu--wrapper{display:flex;flex-direction:column}.react-horizontal-scrolling-menu--footer,.react-horizontal-scrolling-menu--header{width:100%}.react-horizontal-scrolling-menu--arrow-left,.react-horizontal-scrolling-menu--arrow-right{display:flex}.Actions-styles_left__eky50{left:0}.Actions-styles_left__eky50,.Actions-styles_right__zguoH{bottom:0;height:100%;position:absolute;top:0;width:50%;z-index:1}.Actions-styles_right__zguoH{right:0}.ProgressBar-styles_wrapper__oqUCo{background-color:#6a6a6a;border-radius:2px;height:2px;position:relative}.ProgressBar-styles_bar__x0O50{background-color:#eae8e8;border-radius:2px;bottom:0;height:2px;left:0;position:absolute;right:0;top:0;width:0}.progress-styles_wrapper__qQPyW{grid-gap:4px;display:grid;height:2px;left:0;padding:4px;position:absolute;right:0;top:0}.Story-styles_wrapper__oJP7j{align-content:center;align-items:center;display:flex;height:100%;width:100%}.Story-styles_header__-rnWL{left:0;position:absolute;right:0;top:12px}.Image-styles_image__gnfW1{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.Video-styles_video__BykuO{max-height:100%;max-width:100%;-o-object-fit:cover;object-fit:cover;width:100%}.Video-styles_loaderWrapper__TqVWk{align-content:center;align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.Video-styles_loader__FxxSV{animation:Video-styles_spin__ilbIB 1s linear infinite;border:4px solid #f3f3f3;border-radius:50%;border-top-color:#a5b0b7;height:40px;width:40px}.Video-styles_soundIcon__ZvYXE{background:transparent;border:none;cursor:pointer;outline:none;padding:16px;position:absolute;right:0;top:0;z-index:2}@keyframes Video-styles_spin__ilbIB{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.CustomComponents-styles_component__w87Wx{height:100%;width:100%}.SeeMore-styles_seeMoreWrapper__kwjif{background-color:inherit;border:none;bottom:24px;cursor:pointer;display:flex;justify-content:center;left:0;outline:none;position:absolute;right:0;width:100%;z-index:2}.SeeMore-styles_defaultSeeMore__-B1QW{align-items:center;color:#fff;display:flex;flex-direction:column;font-size:14px;font-weight:600;justify-content:center;line-height:.8;width:100%}.SeeMore-styles_defaultSeeMore__-B1QW p{margin:0;padding:0}.SeeMoreComponent-styles_seeMoreComponentWrapper__0T6Ap{animation:SeeMoreComponent-styles_up__sRaEA .2s ease-in-out;animation-fill-mode:forwards;background-color:#fff;bottom:0;left:0;max-height:100%;overflow-y:auto;position:absolute;right:0;top:0;z-index:3}.SeeMoreComponent-styles_closeIcon__LMm3b{background-color:inherit;background:transparent;border:none;cursor:pointer;font-size:16px;outline:none;padding:16px;position:absolute;right:0;top:0}@keyframes SeeMoreComponent-styles_up__sRaEA{0%{transform:translateY(10%)}to{transform:translateY(0)}}.styles_main__-0FEu{-webkit-touch-callout:none;background-color:#000;position:relative;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;user-select:none}._StoryPlayer_vqtc3_1{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;z-index:1000}._Overlay_vqtc3_13{background:#000000d9;height:100%;width:100%;position:absolute;left:0;top:0;cursor:pointer}._StoryPlayer__Wrap_vqtc3_23{position:relative;width:100%;height:100%}@media screen and (min-width: 600px){._StoryPlayer__Wrap_vqtc3_23{height:90dvh;height:90vh;width:initial;aspect-ratio:9 / 16}}._progressContainer_vqtc3_35{z-index:2}._StoryPlayer_vqtc3_1._inline_vqtc3_40{position:relative;width:100%;height:auto;max-width:350px;aspect-ratio:9 / 16;z-index:-1}._StoryPlayer_vqtc3_1._inline_vqtc3_40 ._Overlay_vqtc3_13{display:none}@media screen and (min-width: 600px){._StoryPlayer_vqtc3_1._inline_vqtc3_40 ._StoryPlayer__Wrap_vqtc3_23{height:100%;width:100%;aspect-ratio:initial}}._story_yiu96_1{height:100%;width:100%;position:relative}._story_yiu96_1>img{width:100%;height:100%;object-fit:cover}._Button_yiu96_12{position:absolute;bottom:1rem;width:60%;padding:.7rem;background:#fb3333;border:0;outline:0;color:#fff;font-weight:500;font-size:1rem;left:50%;transform:translate(-50%) skew(-10deg);z-index:2;cursor:pointer;text-align:center;text-decoration:none}._StoryHeaderPlayer_1oqtd_1{padding:5px 10px;display:flex;align-items:center;gap:.5rem;position:relative}._StoryHeaderPlayer_1oqtd_1:before{content:"";position:absolute;height:calc(100% + 1rem);width:100%;top:-12px;background:linear-gradient(to top,transparent,#000000df);left:0}._StoryHeaderPlayer__ProfileStory_1oqtd_18{width:30px;height:30px;z-index:2}._StoryHeaderPlayer__title_1oqtd_24{color:#fff;font-size:13px;font-weight:500;z-index:2;text-shadow:2px 2px 4px rgba(0,0,0,.5)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maycolem/stories",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "vite",
|
|
12
12
|
"build": "tsc -b && vite build",
|
|
13
|
+
"buildnl": "vite build",
|
|
13
14
|
"lint": "eslint .",
|
|
14
15
|
"preview": "vite preview"
|
|
15
16
|
},
|