@webflow/webflow-cli 1.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/.eslintrc.js +5 -0
- package/.turbo/turbo-build.log +13 -0
- package/.turbo/turbo-lint.log +5 -0
- package/CHANGELOG.md +7 -0
- package/dist/devlink-engine/_Builtin/BackgroundVideo.d.ts +25 -0
- package/dist/devlink-engine/_Builtin/BackgroundVideo.js +38 -0
- package/dist/devlink-engine/_Builtin/Basic.d.ts +740 -0
- package/dist/devlink-engine/_Builtin/Basic.js +100 -0
- package/dist/devlink-engine/_Builtin/Dropdown.d.ts +38 -0
- package/dist/devlink-engine/_Builtin/Dropdown.js +47 -0
- package/dist/devlink-engine/_Builtin/Facebook.d.ts +11 -0
- package/dist/devlink-engine/_Builtin/Facebook.js +22 -0
- package/dist/devlink-engine/_Builtin/Form.d.ts +8401 -0
- package/dist/devlink-engine/_Builtin/Form.js +316 -0
- package/dist/devlink-engine/_Builtin/Map.d.ts +14 -0
- package/dist/devlink-engine/_Builtin/Map.js +71 -0
- package/dist/devlink-engine/_Builtin/Navbar.d.ts +53 -0
- package/dist/devlink-engine/_Builtin/Navbar.js +240 -0
- package/dist/devlink-engine/_Builtin/Slider.d.ts +876 -0
- package/dist/devlink-engine/_Builtin/Slider.js +304 -0
- package/dist/devlink-engine/_Builtin/Tabs.d.ts +34 -0
- package/dist/devlink-engine/_Builtin/Tabs.js +84 -0
- package/dist/devlink-engine/_Builtin/Twitter.d.ts +17 -0
- package/dist/devlink-engine/_Builtin/Twitter.js +41 -0
- package/dist/devlink-engine/_Builtin/Typography.d.ts +291 -0
- package/dist/devlink-engine/_Builtin/Typography.js +38 -0
- package/dist/devlink-engine/_Builtin/Video.d.ts +8 -0
- package/dist/devlink-engine/_Builtin/Video.js +8 -0
- package/dist/devlink-engine/_Builtin/YouTubeVideo.d.ts +15 -0
- package/dist/devlink-engine/_Builtin/YouTubeVideo.js +27 -0
- package/dist/devlink-engine/_Builtin/index.d.ts +13 -0
- package/dist/devlink-engine/_Builtin/index.js +13 -0
- package/dist/devlink-engine/interactions.d.ts +13 -0
- package/dist/devlink-engine/interactions.js +86 -0
- package/dist/devlink-engine/types.d.ts +32 -0
- package/dist/devlink-engine/types.js +1 -0
- package/dist/devlink-engine/utils.d.ts +66 -0
- package/dist/devlink-engine/utils.js +133 -0
- package/dist/index.js +197591 -0
- package/package.json +30 -0
- package/src/index.ts +33 -0
- package/tsconfig.json +5 -0
- package/tsup.config.ts +6 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
npm WARN ignoring workspace config at /Users/federico/source/webflow-cli/apps/webflow-cli/.npmrc
|
|
2
|
+
|
|
3
|
+
> @webflow/webflow-cli@1.0.0 build
|
|
4
|
+
> rm -fr ./dist; tsup; cp -R ../../packages/devlink/engine/dist ./dist/devlink-engine
|
|
5
|
+
|
|
6
|
+
CLI Building entry: ./src/index.ts
|
|
7
|
+
CLI Using tsconfig: tsconfig.json
|
|
8
|
+
CLI tsup v6.7.0
|
|
9
|
+
CLI Using tsup config: /Users/federico/source/webflow-cli/apps/webflow-cli/tsup.config.ts
|
|
10
|
+
CLI Target: node14
|
|
11
|
+
CJS Build start
|
|
12
|
+
CJS dist/index.js 9.87 MB
|
|
13
|
+
CJS ⚡️ Build success in 469ms
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type BackgroundVideoWrapperProps = {
|
|
3
|
+
tag?: keyof HTMLElementTagNameMap;
|
|
4
|
+
className?: string;
|
|
5
|
+
sources?: string[];
|
|
6
|
+
posterImage?: "";
|
|
7
|
+
autoPlay?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
children?: React.ReactElement<BackgroundVideoPlayPauseButtonProps>;
|
|
10
|
+
};
|
|
11
|
+
export declare const BackgroundVideoWrapper: ({ tag, className, autoPlay, loop, sources, posterImage, children, }: BackgroundVideoWrapperProps) => JSX.Element;
|
|
12
|
+
type BackgroundVideoPlayPauseButtonProps = {
|
|
13
|
+
className?: string;
|
|
14
|
+
children: React.ReactElement<BackgroundVideoPlayPauseButtonPlayingProps | BackgroundVideoPlayPauseButtonPausedProps>[];
|
|
15
|
+
};
|
|
16
|
+
export declare const BackgroundVideoPlayPauseButton: ({ children, className, }: BackgroundVideoPlayPauseButtonProps) => JSX.Element;
|
|
17
|
+
type BackgroundVideoPlayPauseButtonPlayingProps = {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare const BackgroundVideoPlayPauseButtonPlaying: ({ children, }: BackgroundVideoPlayPauseButtonPlayingProps) => JSX.Element;
|
|
21
|
+
type BackgroundVideoPlayPauseButtonPausedProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
export declare const BackgroundVideoPlayPauseButtonPaused: ({ children, }: BackgroundVideoPlayPauseButtonPausedProps) => JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { cj, debounce } from "../utils";
|
|
3
|
+
const BgVideoContext = React.createContext({ isPlaying: true, togglePlay: () => { } });
|
|
4
|
+
export const BackgroundVideoWrapper = ({ tag = "div", className = "", autoPlay = true, loop = true, sources = [], posterImage = "", children, }) => {
|
|
5
|
+
const [isPlaying, setIsPlaying] = React.useState(autoPlay);
|
|
6
|
+
const video = React.useRef(null);
|
|
7
|
+
const togglePlay = debounce(() => {
|
|
8
|
+
setIsPlaying(!isPlaying);
|
|
9
|
+
if (!video?.current)
|
|
10
|
+
return;
|
|
11
|
+
if (video.current.paused) {
|
|
12
|
+
video.current.play();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
video.current.pause();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return (React.createElement(BgVideoContext.Provider, { value: { isPlaying, togglePlay } },
|
|
19
|
+
React.createElement(tag, {
|
|
20
|
+
className: cj(className, "w-background-video", "w-background-video-atom"),
|
|
21
|
+
}, React.createElement("video", { ref: video, autoPlay: autoPlay, loop: loop, style: posterImage
|
|
22
|
+
? { backgroundImage: `url("${posterImage}")` }
|
|
23
|
+
: undefined, muted: true, playsInline: true }, sources.map((url) => (React.createElement("source", { src: url, key: url }))))),
|
|
24
|
+
children));
|
|
25
|
+
};
|
|
26
|
+
export const BackgroundVideoPlayPauseButton = ({ children, className, }) => {
|
|
27
|
+
const { togglePlay } = React.useContext(BgVideoContext);
|
|
28
|
+
return (React.createElement("div", { "aria-live": "polite" },
|
|
29
|
+
React.createElement("button", { type: "button", className: cj(className, "w-backgroundvideo-backgroundvideoplaypausebutton", "w-background-video--control"), onClick: togglePlay }, children)));
|
|
30
|
+
};
|
|
31
|
+
export const BackgroundVideoPlayPauseButtonPlaying = ({ children, }) => {
|
|
32
|
+
const { isPlaying } = React.useContext(BgVideoContext);
|
|
33
|
+
return React.createElement("span", { hidden: !isPlaying }, children);
|
|
34
|
+
};
|
|
35
|
+
export const BackgroundVideoPlayPauseButtonPaused = ({ children, }) => {
|
|
36
|
+
const { isPlaying } = React.useContext(BgVideoContext);
|
|
37
|
+
return React.createElement("span", { hidden: isPlaying }, children);
|
|
38
|
+
};
|