@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.
Files changed (43) hide show
  1. package/.eslintrc.js +5 -0
  2. package/.turbo/turbo-build.log +13 -0
  3. package/.turbo/turbo-lint.log +5 -0
  4. package/CHANGELOG.md +7 -0
  5. package/dist/devlink-engine/_Builtin/BackgroundVideo.d.ts +25 -0
  6. package/dist/devlink-engine/_Builtin/BackgroundVideo.js +38 -0
  7. package/dist/devlink-engine/_Builtin/Basic.d.ts +740 -0
  8. package/dist/devlink-engine/_Builtin/Basic.js +100 -0
  9. package/dist/devlink-engine/_Builtin/Dropdown.d.ts +38 -0
  10. package/dist/devlink-engine/_Builtin/Dropdown.js +47 -0
  11. package/dist/devlink-engine/_Builtin/Facebook.d.ts +11 -0
  12. package/dist/devlink-engine/_Builtin/Facebook.js +22 -0
  13. package/dist/devlink-engine/_Builtin/Form.d.ts +8401 -0
  14. package/dist/devlink-engine/_Builtin/Form.js +316 -0
  15. package/dist/devlink-engine/_Builtin/Map.d.ts +14 -0
  16. package/dist/devlink-engine/_Builtin/Map.js +71 -0
  17. package/dist/devlink-engine/_Builtin/Navbar.d.ts +53 -0
  18. package/dist/devlink-engine/_Builtin/Navbar.js +240 -0
  19. package/dist/devlink-engine/_Builtin/Slider.d.ts +876 -0
  20. package/dist/devlink-engine/_Builtin/Slider.js +304 -0
  21. package/dist/devlink-engine/_Builtin/Tabs.d.ts +34 -0
  22. package/dist/devlink-engine/_Builtin/Tabs.js +84 -0
  23. package/dist/devlink-engine/_Builtin/Twitter.d.ts +17 -0
  24. package/dist/devlink-engine/_Builtin/Twitter.js +41 -0
  25. package/dist/devlink-engine/_Builtin/Typography.d.ts +291 -0
  26. package/dist/devlink-engine/_Builtin/Typography.js +38 -0
  27. package/dist/devlink-engine/_Builtin/Video.d.ts +8 -0
  28. package/dist/devlink-engine/_Builtin/Video.js +8 -0
  29. package/dist/devlink-engine/_Builtin/YouTubeVideo.d.ts +15 -0
  30. package/dist/devlink-engine/_Builtin/YouTubeVideo.js +27 -0
  31. package/dist/devlink-engine/_Builtin/index.d.ts +13 -0
  32. package/dist/devlink-engine/_Builtin/index.js +13 -0
  33. package/dist/devlink-engine/interactions.d.ts +13 -0
  34. package/dist/devlink-engine/interactions.js +86 -0
  35. package/dist/devlink-engine/types.d.ts +32 -0
  36. package/dist/devlink-engine/types.js +1 -0
  37. package/dist/devlink-engine/utils.d.ts +66 -0
  38. package/dist/devlink-engine/utils.js +133 -0
  39. package/dist/index.js +197591 -0
  40. package/package.json +30 -0
  41. package/src/index.ts +33 -0
  42. package/tsconfig.json +5 -0
  43. package/tsup.config.ts +6 -0
@@ -0,0 +1,100 @@
1
+ import * as React from "react";
2
+ import * as utils from "../utils";
3
+ export function Block({ tag = "div", ...props }) {
4
+ return React.createElement(tag, props);
5
+ }
6
+ export function Span(props) {
7
+ return React.createElement("span", { ...props });
8
+ }
9
+ export function Blockquote(props) {
10
+ return React.createElement("blockquote", { ...props });
11
+ }
12
+ export const Link = React.forwardRef(function Link({ options = { href: "#" }, className = "", button = false, ...props }, ref) {
13
+ if (button)
14
+ className += " w-button";
15
+ const { href, target, preload = "none" } = options;
16
+ const shouldRenderResource = preload !== "none" && typeof href === "string" && !href.startsWith("#");
17
+ return (React.createElement(React.Fragment, null,
18
+ React.createElement("a", { href: href, target: target, className: className, ref: ref, ...props }),
19
+ shouldRenderResource && React.createElement("link", { rel: preload, href: href })));
20
+ });
21
+ export function List({ tag = "ul", unstyled = true, className = "", ...props }) {
22
+ return React.createElement(tag, {
23
+ role: "list",
24
+ className: className + (unstyled ? " w-list-unstyled" : ""),
25
+ ...props,
26
+ });
27
+ }
28
+ export function ListItem(props) {
29
+ return React.createElement("li", props);
30
+ }
31
+ export function Image(props) {
32
+ return React.createElement("img", props);
33
+ }
34
+ export function Section({ tag = "section", ...props }) {
35
+ return React.createElement(tag, props);
36
+ }
37
+ export const Container = React.forwardRef(function Container({ tag = "div", className = "", ...props }, ref) {
38
+ return React.createElement(tag, {
39
+ className: className + " w-container",
40
+ ref,
41
+ ...props,
42
+ });
43
+ });
44
+ export function HtmlEmbed({ tag = "div", className = "", value = "", ...props }) {
45
+ return React.createElement(tag, {
46
+ className: className + " w-embed",
47
+ dangerouslySetInnerHTML: { __html: utils.removeUnescaped(value) },
48
+ ...props,
49
+ });
50
+ }
51
+ export function Grid({ tag = "div", className = "", ...props }) {
52
+ return React.createElement(tag, {
53
+ className: className + " w-layout-grid",
54
+ ...props,
55
+ });
56
+ }
57
+ export function Icon({ widget, className = "", ...props }) {
58
+ return React.createElement("div", {
59
+ className: className + ` w-icon-${widget.icon}`,
60
+ ...props,
61
+ });
62
+ }
63
+ export function Column({ tag = "div", className = "", columnClasses = "", grid: _, ...props }) {
64
+ return React.createElement(tag, {
65
+ className: className + " w-col " + columnClasses,
66
+ ...props,
67
+ });
68
+ }
69
+ const transformWidths = (width, index) => {
70
+ const widths = width?.split("|") ?? [];
71
+ return widths.length > 1 ? widths[index] : width;
72
+ };
73
+ const columnClass = (width, key) => {
74
+ if (/stack$/.test(width))
75
+ return "w-col-stack";
76
+ if (/main$/.test(key))
77
+ return `w-col-${width}`;
78
+ return `w-col-${key}-${width}`;
79
+ };
80
+ export function Row({ tag = "div", className = "", grid, children, ...props }) {
81
+ return React.createElement(tag, { className: className + " w-row", ...props }, grid
82
+ ? React.Children.map(children, (child, index) => {
83
+ if (child && typeof child === "object" && child.type !== Column)
84
+ return child;
85
+ const columnClasses = Object.entries(grid.cols ?? {}).reduce((acc, [key, value]) => {
86
+ const width = transformWidths(value === "custom" ? "6|6" : value, index);
87
+ acc.add(width ? columnClass(width, key) : "");
88
+ return acc;
89
+ }, new Set());
90
+ return React.cloneElement(child, {
91
+ // @ts-ignore
92
+ columnClasses: [...columnClasses].join(" "),
93
+ ...child.props,
94
+ });
95
+ })
96
+ : children);
97
+ }
98
+ export function NotSupported({ _atom = "" }) {
99
+ return React.createElement("div", null, `This builtin is not currently supported: ${_atom}`);
100
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { LinkProps } from "./Basic";
3
+ type DropdownProps = React.PropsWithChildren<{
4
+ tag?: keyof HTMLElementTagNameMap;
5
+ className?: string;
6
+ }>;
7
+ type DropdownWrapperProps = DropdownProps & {
8
+ children: React.ReactElement<DropdownToggleProps | DropdownListProps>;
9
+ };
10
+ export declare function DropdownWrapper(props: DropdownWrapperProps): JSX.Element;
11
+ type DropdownToggleProps = DropdownProps;
12
+ export declare function DropdownToggle({ tag, className, ...props }: DropdownToggleProps): React.DetailedReactHTMLElement<{
13
+ "aria-haspopup": "menu";
14
+ "aria-expanded": boolean;
15
+ className: string;
16
+ onClick: () => void;
17
+ children?: React.ReactNode;
18
+ }, HTMLElement>;
19
+ type DropdownListProps = DropdownProps & {
20
+ children: React.ReactElement<DropdownLinkProps> | React.ReactElement<DropdownLinkProps>[];
21
+ };
22
+ export declare function DropdownList({ tag, className, ...props }: DropdownListProps): React.DetailedReactHTMLElement<{
23
+ className: string;
24
+ children: React.ReactNode & (React.ReactElement<DropdownLinkProps, string | React.JSXElementConstructor<any>> | React.ReactElement<DropdownLinkProps, string | React.JSXElementConstructor<any>>[]);
25
+ }, HTMLElement>;
26
+ type DropdownLinkProps = DropdownProps & LinkProps;
27
+ export declare function DropdownLink({ className, ...props }: DropdownLinkProps): React.FunctionComponentElement<import("./Basic").ElementProps<"a"> & {
28
+ options?: {
29
+ href: string;
30
+ target?: "_self" | "_blank" | undefined;
31
+ preload?: "prerender" | "prefetch" | "none" | undefined;
32
+ } | undefined;
33
+ className?: string | undefined;
34
+ button?: boolean | undefined;
35
+ } & {
36
+ children?: React.ReactNode;
37
+ } & React.RefAttributes<any>>;
38
+ export {};
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ import { cj } from "../utils";
3
+ import { Link } from "./Basic";
4
+ import { NavbarContext } from "./Navbar";
5
+ const DropdownContext = React.createContext({
6
+ isOpen: false,
7
+ toggleOpen: () => { },
8
+ });
9
+ export function DropdownWrapper(props) {
10
+ const [isOpen, setIsOpen] = React.useState(false);
11
+ const toggleOpen = () => setIsOpen((isOpen) => !isOpen);
12
+ return (React.createElement(DropdownContext.Provider, { value: { isOpen, toggleOpen } },
13
+ React.createElement(Dropdown, { ...props })));
14
+ }
15
+ function Dropdown({ tag = "div", className = "", ...props }) {
16
+ const { isOpen: isNavbarOpen } = React.useContext(NavbarContext);
17
+ return React.createElement(tag, {
18
+ ...props,
19
+ className: cj(className, "w-dropdown", isNavbarOpen && "w--nav-dropdown-open"),
20
+ });
21
+ }
22
+ export function DropdownToggle({ tag = "div", className = "", ...props }) {
23
+ const { isOpen, toggleOpen } = React.useContext(DropdownContext);
24
+ const { isOpen: isNavbarOpen } = React.useContext(NavbarContext);
25
+ return React.createElement(tag, {
26
+ ...props,
27
+ "aria-haspopup": "menu",
28
+ "aria-expanded": isOpen,
29
+ className: cj(className, "w-dropdown-toggle", isNavbarOpen && "w--nav-dropdown-toggle-open"),
30
+ onClick: toggleOpen,
31
+ });
32
+ }
33
+ export function DropdownList({ tag = "nav", className = "", ...props }) {
34
+ const { isOpen } = React.useContext(DropdownContext);
35
+ const { isOpen: isNavbarOpen } = React.useContext(NavbarContext);
36
+ return React.createElement(tag, {
37
+ ...props,
38
+ className: cj(className, "w-dropdown-list", isOpen && "w--open", isNavbarOpen && "w--nav-dropdown-list-open"),
39
+ });
40
+ }
41
+ export function DropdownLink({ className = "", ...props }) {
42
+ const { isOpen: isNavbarOpen } = React.useContext(NavbarContext);
43
+ return React.createElement(Link, {
44
+ ...props,
45
+ className: cj(className, "w-dropdown-link", isNavbarOpen && "w--nav-link-open"),
46
+ });
47
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ type FacebookProps = React.PropsWithChildren<{
3
+ className?: string;
4
+ layout?: string;
5
+ width?: number;
6
+ height?: number;
7
+ url?: string;
8
+ locale?: string;
9
+ }>;
10
+ export declare function Facebook({ className, layout, width, height, url, locale, ...props }: FacebookProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { isUrl } from "../utils";
3
+ export function Facebook({ className = "", layout = "standard", width = 250, height = 50, url = "https://facebook.com/webflow", locale = "en_US", ...props }) {
4
+ if (!isUrl(url)) {
5
+ url = "https://facebook.com/webflow";
6
+ }
7
+ if (!/^http/.test(url)) {
8
+ url = "http://" + url;
9
+ }
10
+ const params = {
11
+ href: url,
12
+ layout: layout,
13
+ locale: locale,
14
+ action: "like",
15
+ show_faces: "false",
16
+ share: "false",
17
+ };
18
+ const queryParams = Object.keys(params).map((key) => `${key}=${encodeURIComponent(params[key])}`);
19
+ const frameSrc = `https://www.facebook.com/plugins/like.php?${queryParams.join("&")}`;
20
+ return (React.createElement("div", { ...props, className: className + " w-widget w-widget-facebook" },
21
+ React.createElement("iframe", { title: "Facebook Like Button", src: frameSrc, style: { border: "none", overflow: "hidden", width, height } })));
22
+ }