dune-react 0.0.21 → 0.0.22
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/index.d.ts +1 -0
- package/dist/components/puck-base/button.d.ts +1 -1
- package/dist/components/puck-base/button.js +5 -6
- package/dist/components/puck-base/card.d.ts +1 -1
- package/dist/components/puck-base/container.js +1 -1
- package/dist/components/puck-base/content.d.ts +1 -1
- package/dist/components/puck-base/image.js +16 -16
- package/dist/components/puck-base/index.d.ts +1 -13
- package/dist/components/puck-block/banner-sections/dismissible-banner/index.d.ts +3 -25
- package/dist/components/puck-block/contact-sections/centered-form/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/contact-modal/contact-modal.js +1 -1
- package/dist/components/puck-block/contact-sections/contact-modal/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/form-with-media/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/header-form-cards/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/location-cards-grid/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/split-info-form/index.d.ts +1 -1
- package/dist/components/puck-block/cta-sections/feature-card-cta/index.d.ts +1 -1
- package/dist/components/puck-block/cta-sections/index.d.ts +2 -0
- package/dist/components/puck-block/cta-sections/mouse-track-cta/index.d.ts +1 -1
- package/dist/components/puck-block/cta-sections/mouse-track-cta/mouse-track-cta.js +88 -59
- package/dist/components/puck-block/cta-sections/props.js +46 -0
- package/dist/components/puck-block/cta-sections/side-media-cta/index.d.ts +1 -73
- package/dist/components/puck-block/cta-sections/side-media-cta/index.js +35 -0
- package/dist/components/puck-block/cta-sections/side-media-cta/side-media-cta.js +84 -0
- package/dist/components/puck-block/cta-sections/text-block-cta/index.d.ts +2 -74
- package/dist/components/puck-block/cta-sections/text-block-cta/index.js +38 -0
- package/dist/components/puck-block/cta-sections/text-block-cta/text-block-cta.d.ts +1 -1
- package/dist/components/puck-block/cta-sections/text-block-cta/text-block-cta.js +165 -0
- package/dist/components/puck-block/faq-sections/dual-column-accordion-faq/index.d.ts +1 -1
- package/dist/components/puck-block/faq-sections/icon-card-faq/index.d.ts +1 -1
- package/dist/components/puck-block/faq-sections/stacked-accordion-faq/index.d.ts +1 -1
- package/dist/components/puck-block/faq-sections/stacked-static-faq/index.d.ts +1 -1
- package/dist/components/puck-block/faq-sections/two-column-accordion-faq/index.d.ts +1 -1
- package/dist/components/puck-block/faq-sections/two-column-static-faq/index.d.ts +1 -1
- package/dist/components/puck-block/feature-sections/feature-cards-grid/index.d.ts +2 -2
- package/dist/components/puck-block/feature-sections/feature-list-split/index.d.ts +2 -2
- package/dist/components/puck-block/feature-sections/tab-feature/component.js +77 -61
- package/dist/components/puck-block/feature-sections/text-media-split/index.d.ts +1 -1
- package/dist/components/puck-block/feature-sections/text-only-section/index.d.ts +1 -1
- package/dist/components/puck-block/footer-sections/compact-newsletter-footer/index.d.ts +1 -1
- package/dist/components/puck-block/footer-sections/cta-links-footer/index.d.ts +1 -1
- package/dist/components/puck-block/footer-sections/links-newsletter-footer/index.d.ts +1 -1
- package/dist/components/puck-block/footer-sections/newsletter-links-footer/index.d.ts +1 -1
- package/dist/components/puck-block/footer-sections/newsletter-top-links-footer/index.d.ts +1 -1
- package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/index.d.ts +25 -28
- package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/index.js +3 -2
- package/dist/components/puck-block/gallery-sections/portfolio-cards/index.d.ts +2 -2
- package/dist/components/puck-block/gallery-sections/portfolio-divider/index.d.ts +2 -2
- package/dist/components/puck-block/gallery-sections/portfolio-divider/portfolio-divider.js +67 -64
- package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/index.d.ts +24 -27
- package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/index.js +3 -2
- package/dist/components/puck-block/header-sections/centered-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/drawer-navbar/drawer-navbar.js +118 -17
- package/dist/components/puck-block/header-sections/drawer-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/floating-bordered-navbar/floating-bordered-navbar.js +161 -22
- package/dist/components/puck-block/header-sections/floating-bordered-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/fullscreen-overlay-navbar/fullscreen-overlay-navbar.js +142 -19
- package/dist/components/puck-block/header-sections/fullscreen-overlay-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/mega-menu-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/standard-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/carousel-hero/component.js +50 -9
- package/dist/components/puck-block/hero-sections/carousel-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/centered-hero/index.d.ts +2 -2
- package/dist/components/puck-block/hero-sections/column-scroll-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/dual-marquee-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/fullscreen-hero/index.d.ts +2 -2
- package/dist/components/puck-block/hero-sections/fullscreen-video-hero/component.js +4 -2
- package/dist/components/puck-block/hero-sections/fullscreen-video-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/grid-expand-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/horizontal-marquee-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/inline-image-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/media-text-hero/index.d.ts +26 -29
- package/dist/components/puck-block/hero-sections/mouse-track-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.d.ts +25 -28
- package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.js +3 -2
- package/dist/components/puck-block/hero-sections/overlapping-image-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/parallax-images-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/scatter-parallax-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/scroll-expand-video-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/scroll-zoom-hero/component.js +91 -44
- package/dist/components/puck-block/hero-sections/scroll-zoom-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/split-hero/index.d.ts +2 -2
- package/dist/components/puck-block/hero-sections/stacked-hero/index.d.ts +2 -2
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/sticky-video-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/tab-hero/index.d.ts +28 -44
- package/dist/components/puck-block/hero-sections/tab-hero/index.js +7 -2
- package/dist/components/puck-block/hero-sections/three-image-parallax-hero/component.js +93 -43
- package/dist/components/puck-block/hero-sections/three-image-parallax-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/vertical-gallery-hero/component.js +27 -4
- package/dist/components/puck-block/hero-sections/vertical-gallery-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/zoom-grid-hero/index.d.ts +1 -1
- package/dist/components/puck-block/index.d.ts +2 -0
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +1 -1
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +1 -1
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +2 -2
- package/dist/components/puck-block/location-sections/props.d.ts +1 -1
- package/dist/components/puck-block/metrics-sections/header-stats-row/index.d.ts +1 -1
- package/dist/components/puck-block/metrics-sections/mixed-grid-stats/index.d.ts +1 -1
- package/dist/components/puck-block/metrics-sections/split-stats/index.d.ts +1 -1
- package/dist/components/puck-block/metrics-sections/tab-stats/index.d.ts +0 -22
- package/dist/components/puck-block/metrics-sections/tab-stats/index.js +1 -1
- package/dist/components/puck-block/metrics-sections/tab-stats/tab-stats.js +36 -23
- package/dist/components/puck-block/pricing-sections/single-pricing-card/index.d.ts +0 -22
- package/dist/components/puck-block/pricing-sections/single-pricing-card/index.js +1 -1
- package/dist/components/puck-block/pricing-sections/split-pricing/index.d.ts +28 -22
- package/dist/components/puck-block/pricing-sections/split-pricing/index.js +8 -1
- package/dist/components/puck-block/registry.generated.d.ts +13141 -0
- package/dist/components/puck-block/registry.generated.js +558 -0
- package/dist/components/puck-block/showcase-sections/compact-timeline/index.d.ts +1 -1
- package/dist/components/puck-block/showcase-sections/horizontal-timeline/index.d.ts +1 -1
- package/dist/components/puck-block/showcase-sections/single-column-timeline/index.d.ts +2 -2
- package/dist/components/puck-block/showcase-sections/sticky-scroll-timeline/index.d.ts +2 -2
- package/dist/components/puck-block/showcase-sections/tab-timeline/index.d.ts +1 -23
- package/dist/components/puck-block/showcase-sections/tab-timeline/index.js +1 -1
- package/dist/components/puck-block/showcase-sections/zigzag-timeline/index.d.ts +2 -2
- package/dist/components/puck-block/team-sections/team-carousel/index.d.ts +1 -23
- package/dist/components/puck-block/team-sections/team-carousel/index.js +1 -2
- package/dist/components/puck-block/team-sections/team-grid/index.d.ts +1 -23
- package/dist/components/puck-block/team-sections/team-grid/index.js +1 -2
- package/dist/components/puck-block/team-sections/team-inline-card/index.d.ts +1 -23
- package/dist/components/puck-block/team-sections/team-inline-card/index.js +1 -2
- package/dist/components/puck-block/team-sections/team-two-column/index.d.ts +1 -1
- package/dist/components/puck-block/testimonial-sections/sticky-testimonial/index.d.ts +1 -1
- package/dist/components/puck-block/text-sections/aside-nav-content/index.d.ts +0 -22
- package/dist/components/puck-block/text-sections/aside-nav-content/index.js +1 -1
- package/dist/components/puck-block/text-sections/blog-article/index.d.ts +0 -22
- package/dist/components/puck-block/text-sections/blog-article/index.js +1 -1
- package/dist/components/puck-block/text-sections/prose-sidebar/index.d.ts +1 -23
- package/dist/components/puck-block/text-sections/text-header/index.d.ts +2 -2
- package/dist/components/puck-core/core/props/content.js +41 -1
- package/dist/components/puck-core/core/props/form.js +76 -0
- package/dist/components/puck-core/core/props/index.js +34 -0
- package/dist/components/puck-core/core/props/interactive.js +17 -0
- package/dist/components/puck-core/core/props/media.js +8 -4
- package/dist/components/puck-core/core/styles.d.ts +1 -1
- package/dist/components/{puck-base → puck-core}/core/styles.js +3 -1
- package/dist/components/{puck-base → puck-core}/core/with-editable.js +1 -1
- package/dist/components/puck-core/fields/action-field.js +1 -1
- package/dist/components/{puck-base → puck-core/fields}/image-upload-field.js +4 -4
- package/dist/components/{puck-base → puck-core}/fields/location-field.js +1 -1
- package/dist/components/puck-core/index.d.ts +1 -0
- package/dist/components/{puck-base → puck-core}/inline-editable.js +1 -1
- package/dist/index.js +121 -104
- package/package.json +1 -1
- package/dist/components/puck-base/core/fields.d.ts +0 -827
- package/dist/components/puck-base/core/fields.js +0 -267
- package/dist/components/puck-base/core/hooks.d.ts +0 -19
- package/dist/components/puck-base/core/icon-catalog.d.ts +0 -14
- package/dist/components/puck-base/core/icon-catalog.js +0 -193
- package/dist/components/puck-base/core/styles.d.ts +0 -1942
- package/dist/components/puck-base/core/types.d.ts +0 -20
- package/dist/components/puck-base/core/types.js +0 -26
- package/dist/components/puck-base/core/utils.d.ts +0 -5
- package/dist/components/puck-base/core/with-editable.d.ts +0 -16
- package/dist/components/puck-base/error-boundary.d.ts +0 -4
- package/dist/components/puck-base/fields/action-field.d.ts +0 -30
- package/dist/components/puck-base/fields/action-field.js +0 -265
- package/dist/components/puck-base/fields/auto-field.d.ts +0 -2
- package/dist/components/puck-base/fields/color-field.d.ts +0 -6
- package/dist/components/puck-base/fields/index.d.ts +0 -8
- package/dist/components/puck-base/fields/location-field.d.ts +0 -44
- package/dist/components/puck-base/fields/object-field.d.ts +0 -8
- package/dist/components/puck-base/fields/radio-toggle-field.d.ts +0 -10
- package/dist/components/puck-base/fields/types.d.ts +0 -29
- package/dist/components/puck-base/fields/virtualized-select-field.d.ts +0 -13
- package/dist/components/puck-base/icon-picker-field.d.ts +0 -8
- package/dist/components/puck-base/icon-picker-field.js +0 -153
- package/dist/components/puck-base/image-upload-field.d.ts +0 -7
- package/dist/components/puck-base/inline-editable.d.ts +0 -14
- package/dist/components/puck-base/use-upload.d.ts +0 -42
- /package/dist/components/{puck-base → puck-core}/core/hooks.js +0 -0
- /package/dist/components/{puck-base → puck-core}/core/utils.js +0 -0
- /package/dist/components/{puck-base → puck-core}/error-boundary.js +0 -0
- /package/dist/components/{puck-base → puck-core}/fields/auto-field.js +0 -0
- /package/dist/components/{puck-base → puck-core}/fields/color-field.js +0 -0
- /package/dist/components/{puck-base → puck-core}/fields/object-field.js +0 -0
- /package/dist/components/{puck-base → puck-core}/fields/radio-toggle-field.js +0 -0
- /package/dist/components/{puck-base → puck-core}/fields/virtualized-select-field.js +0 -0
- /package/dist/components/{puck-base → puck-core}/use-upload.js +0 -0
|
@@ -4,12 +4,11 @@ import { useState, useCallback } from "react";
|
|
|
4
4
|
import { SafeDynamicIcon } from "./safe-dynamic-icon.js";
|
|
5
5
|
import { Button, buttonVariants } from "../shadcn/button.js";
|
|
6
6
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "../shadcn/dialog.js";
|
|
7
|
-
import { button } from "./core/fields.js";
|
|
8
7
|
import { cn } from "../../utils/css-utils.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { AutoField } from "
|
|
12
|
-
const BUTTON_FIELDS =
|
|
8
|
+
import { withEditable } from "../puck-core/core/with-editable.js";
|
|
9
|
+
import { buttonField, resolveActionUrl } from "../puck-core/core/props/interactive.js";
|
|
10
|
+
import { AutoField } from "../puck-core/fields/auto-field.js";
|
|
11
|
+
const BUTTON_FIELDS = buttonField.objectFields;
|
|
13
12
|
function ButtonEditDialog({
|
|
14
13
|
open,
|
|
15
14
|
onOpenChange,
|
|
@@ -80,7 +79,7 @@ function CompoundButtonBase(props) {
|
|
|
80
79
|
}
|
|
81
80
|
const EditableButton = withEditable(CompoundButtonBase, {
|
|
82
81
|
type: "button",
|
|
83
|
-
fields:
|
|
82
|
+
fields: buttonField.objectFields
|
|
84
83
|
});
|
|
85
84
|
const CompoundButton = (props) => {
|
|
86
85
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../utils/css-utils.js";
|
|
3
|
-
import { ErrorBoundary } from "
|
|
3
|
+
import { ErrorBoundary } from "../puck-core/error-boundary.js";
|
|
4
4
|
const SECTION_STYLE_VARS = {
|
|
5
5
|
dark: {
|
|
6
6
|
"--background": "oklch(0.145 0 0)",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CompoundBadgeProps } from "./badge";
|
|
2
2
|
import { CompoundButtonProps } from "./button";
|
|
3
|
-
import { Feature } from "
|
|
3
|
+
import { Feature } from "@/components/puck-core/core/types";
|
|
4
4
|
export interface CompoundContentProps {
|
|
5
5
|
badge?: CompoundBadgeProps;
|
|
6
6
|
heading?: string;
|
|
@@ -4,8 +4,7 @@ import { useState, useEffect, useRef, useCallback } from "react";
|
|
|
4
4
|
import Cropper from "react-easy-crop";
|
|
5
5
|
import { Pencil, Search, Upload, Loader2, Check } from "lucide-react";
|
|
6
6
|
import { cn } from "../../utils/css-utils.js";
|
|
7
|
-
import { withEditable } from "
|
|
8
|
-
import { image } from "./core/fields.js";
|
|
7
|
+
import { withEditable } from "../puck-core/core/with-editable.js";
|
|
9
8
|
import { Button } from "../shadcn/button.js";
|
|
10
9
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "../shadcn/dialog.js";
|
|
11
10
|
import { Input } from "../shadcn/input.js";
|
|
@@ -13,20 +12,21 @@ import { Label } from "../shadcn/label.js";
|
|
|
13
12
|
import { ScrollArea } from "../shadcn/scroll-area.js";
|
|
14
13
|
import { Slider } from "../shadcn/slider.js";
|
|
15
14
|
import { Tabs, TabsList, TabsTrigger } from "../shadcn/tabs.js";
|
|
16
|
-
import useUpload from "
|
|
15
|
+
import useUpload from "../puck-core/use-upload.js";
|
|
17
16
|
import { useEditorContext } from "../puck-core/core/context/editor-context.js";
|
|
17
|
+
import { imageField } from "../puck-core/core/props/media.js";
|
|
18
18
|
const createImage = (url) => new Promise((resolve, reject) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const image = new Image();
|
|
20
|
+
image.addEventListener("load", () => resolve(image));
|
|
21
|
+
image.addEventListener("error", (error) => reject(error));
|
|
22
|
+
image.setAttribute("crossOrigin", "anonymous");
|
|
23
|
+
image.src = url;
|
|
24
24
|
});
|
|
25
25
|
const getCroppedImg = async (imageSrc, pixelCrop, rotation) => {
|
|
26
|
-
const
|
|
26
|
+
const image = await createImage(imageSrc);
|
|
27
27
|
const canvas = document.createElement("canvas");
|
|
28
28
|
const ctx = canvas.getContext("2d");
|
|
29
|
-
const maxSize = Math.max(
|
|
29
|
+
const maxSize = Math.max(image.width, image.height);
|
|
30
30
|
const safeArea = 2 * (maxSize / 2 * Math.sqrt(2));
|
|
31
31
|
canvas.width = safeArea;
|
|
32
32
|
canvas.height = safeArea;
|
|
@@ -34,17 +34,17 @@ const getCroppedImg = async (imageSrc, pixelCrop, rotation) => {
|
|
|
34
34
|
ctx.rotate(rotation * Math.PI / 180);
|
|
35
35
|
ctx.translate(-safeArea / 2, -safeArea / 2);
|
|
36
36
|
ctx.drawImage(
|
|
37
|
-
|
|
38
|
-
safeArea / 2 -
|
|
39
|
-
safeArea / 2 -
|
|
37
|
+
image,
|
|
38
|
+
safeArea / 2 - image.width * 0.5,
|
|
39
|
+
safeArea / 2 - image.height * 0.5
|
|
40
40
|
);
|
|
41
41
|
const data = ctx.getImageData(0, 0, safeArea, safeArea);
|
|
42
42
|
canvas.width = pixelCrop.width;
|
|
43
43
|
canvas.height = pixelCrop.height;
|
|
44
44
|
ctx.putImageData(
|
|
45
45
|
data,
|
|
46
|
-
Math.round(0 - safeArea / 2 +
|
|
47
|
-
Math.round(0 - safeArea / 2 +
|
|
46
|
+
Math.round(0 - safeArea / 2 + image.width * 0.5 - pixelCrop.x),
|
|
47
|
+
Math.round(0 - safeArea / 2 + image.height * 0.5 - pixelCrop.y)
|
|
48
48
|
);
|
|
49
49
|
return new Promise((resolve) => {
|
|
50
50
|
canvas.toBlob((blob) => resolve(blob), "image/jpeg", 0.95);
|
|
@@ -326,7 +326,7 @@ function ImageEditDialog({
|
|
|
326
326
|
}
|
|
327
327
|
const EditableImage = withEditable(CompoundImageBase, {
|
|
328
328
|
type: "image",
|
|
329
|
-
fields:
|
|
329
|
+
fields: imageField.objectFields
|
|
330
330
|
});
|
|
331
331
|
const CompoundImage = (props) => {
|
|
332
332
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
@@ -7,17 +7,5 @@ export { CompoundField, type CompoundFieldProps, fieldTypes, type FieldTypes } f
|
|
|
7
7
|
export { CompoundForm, type CompoundFormProps, formMethods, type FormMethods } from "./form";
|
|
8
8
|
export { CompoundImage, type CompoundImageProps } from "./image";
|
|
9
9
|
export { CompoundArticleCard, type CompoundArticleCardProps } from "./article-card";
|
|
10
|
-
export { ImageUploadField } from "./image-upload-field";
|
|
11
|
-
export { ActionField, ACTION_TYPE_FIELD_MAP, ACTION_TYPE_OPTIONS, PageActionFields, ExternalActionFields, EmailActionFields, PhoneActionFields, SectionActionFields, DownloadActionFields, type ActionTypeFieldProps, } from "./fields";
|
|
12
|
-
export { ErrorBoundary } from "./error-boundary";
|
|
13
10
|
export { GradientText, type GradientTextProps } from "./gradient-text";
|
|
14
|
-
export {
|
|
15
|
-
export { type IconName, type Feature, type ActionType, type Action, resolveActionUrl, } from "./core/types";
|
|
16
|
-
export { withEditable } from "./core/with-editable";
|
|
17
|
-
export { usePuckDispatch, usePuckAppState, usePuckHistory, usePuckConfig, usePuckGetSelectorForId, type PuckComponentInfo, } from "./core/hooks";
|
|
18
|
-
export { findComponentById, getRandomAdjective } from "./core/utils";
|
|
19
|
-
export { icon, action, actionDefaults, button, buttons, badge, image, images, padding, paddingDefaults, paddingLevel, heading, description, features, contentFields, contentFieldsWithFeatures, card, cards, field, fieldDefaults, form, formDefaults, getPlaceholderImageUrl, image16x9Placeholder, image1x1Placeholder, image9x16Placeholder, sectionStyle, sectionOverlay, backgroundColor, backgroundImage, } from "./core/fields";
|
|
20
|
-
export { EditorContextProvider, useEditorContext } from "@/components/puck-core/core/context/editor-context";
|
|
21
|
-
export { SectionIdProvider, useSectionId } from "@/components/puck-core/core/context/section-id-context";
|
|
22
|
-
export { AutoField, type FieldDef, type AutoFieldProps, type FieldsPanelProps } from "./fields";
|
|
23
|
-
export { default as useUpload, type UploadFileItem, type UploadStatus, type UseUploadOptions } from "./use-upload";
|
|
11
|
+
export { SafeDynamicIcon } from "./safe-dynamic-icon";
|
|
@@ -34,7 +34,7 @@ declare const conf: {
|
|
|
34
34
|
readonly action: {
|
|
35
35
|
type: "custom";
|
|
36
36
|
label: string;
|
|
37
|
-
render: typeof import("
|
|
37
|
+
render: typeof import("../../..").ActionField;
|
|
38
38
|
};
|
|
39
39
|
readonly variant: {
|
|
40
40
|
readonly type: "select";
|
|
@@ -112,7 +112,7 @@ declare const conf: {
|
|
|
112
112
|
readonly action: {
|
|
113
113
|
type: "custom";
|
|
114
114
|
label: string;
|
|
115
|
-
render: typeof import("
|
|
115
|
+
render: typeof import("../../..").ActionField;
|
|
116
116
|
};
|
|
117
117
|
readonly variant: {
|
|
118
118
|
readonly type: "select";
|
|
@@ -170,31 +170,9 @@ declare const conf: {
|
|
|
170
170
|
action: {
|
|
171
171
|
type: "custom";
|
|
172
172
|
label: string;
|
|
173
|
-
render: typeof import("
|
|
173
|
+
render: typeof import("../../..").ActionField;
|
|
174
174
|
};
|
|
175
175
|
title: {
|
|
176
|
-
className: {
|
|
177
|
-
readonly type: "text";
|
|
178
|
-
readonly label: "Class Name";
|
|
179
|
-
readonly ai: {
|
|
180
|
-
readonly instructions: "Additional Tailwind CSS classes to apply to the section wrapper.";
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
style: {
|
|
184
|
-
readonly type: "object";
|
|
185
|
-
readonly label: "Style";
|
|
186
|
-
readonly objectFields: {};
|
|
187
|
-
readonly ai: {
|
|
188
|
-
readonly instructions: "Inline CSSProperties object for the section wrapper, e.g. { backgroundColor: 'red', minHeight: '100vh' }.";
|
|
189
|
-
};
|
|
190
|
-
};
|
|
191
|
-
css: {
|
|
192
|
-
readonly type: "textarea";
|
|
193
|
-
readonly label: "Custom CSS";
|
|
194
|
-
readonly ai: {
|
|
195
|
-
readonly instructions: "Custom CSS rules. Use & as a placeholder for the section selector.";
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
176
|
type: string;
|
|
199
177
|
};
|
|
200
178
|
};
|
|
@@ -144,7 +144,7 @@ const ContactModal = (props) => {
|
|
|
144
144
|
] }) }) });
|
|
145
145
|
}
|
|
146
146
|
return /* @__PURE__ */ jsx(SectionWrapper, { className: cn("px-[5%] py-8 md:py-12 lg:py-14", sectionClassName), style: sectionStyle, css, children: /* @__PURE__ */ jsx("div", { className: "container max-w-lg text-center", children: /* @__PURE__ */ jsxs(Dialog, { children: [
|
|
147
|
-
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
147
|
+
/* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90", children: "Open modal" }) }),
|
|
148
148
|
/* @__PURE__ */ jsx(
|
|
149
149
|
DialogContent,
|
|
150
150
|
{
|
|
@@ -26,11 +26,20 @@ const imageVariants = {
|
|
|
26
26
|
right: { x: -50, transition: { type: "spring", duration: 1, bounce: 0 } }
|
|
27
27
|
};
|
|
28
28
|
const MouseTrackCta = (props) => {
|
|
29
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
tagline,
|
|
31
|
+
hoverLinks = [],
|
|
32
|
+
styles
|
|
33
|
+
} = {
|
|
30
34
|
...MouseTrackCtaDefaults,
|
|
31
35
|
...props
|
|
32
36
|
};
|
|
33
|
-
const {
|
|
37
|
+
const {
|
|
38
|
+
className: sectionClassName,
|
|
39
|
+
style: sectionStyle,
|
|
40
|
+
css,
|
|
41
|
+
listStyle = "center"
|
|
42
|
+
} = styles ?? {};
|
|
34
43
|
const isNumbered = listStyle === "numbered";
|
|
35
44
|
const [cursorPosition, setCursorPosition] = useState({ x: 0, y: 0 });
|
|
36
45
|
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
@@ -47,7 +56,10 @@ const MouseTrackCta = (props) => {
|
|
|
47
56
|
const containerRect = container.getBoundingClientRect();
|
|
48
57
|
const leftBoundary = containerRect.left + containerRect.width / 2 - 100;
|
|
49
58
|
const rightBoundary = containerRect.right / 2 + 100;
|
|
50
|
-
const clampedX = Math.max(
|
|
59
|
+
const clampedX = Math.max(
|
|
60
|
+
leftBoundary,
|
|
61
|
+
Math.min(rightBoundary, e.clientX)
|
|
62
|
+
);
|
|
51
63
|
const smoothFactor = 0.1;
|
|
52
64
|
setCursorPosition((prev) => ({
|
|
53
65
|
x: prev.x + (clampedX - prev.x) * smoothFactor,
|
|
@@ -64,64 +76,81 @@ const MouseTrackCta = (props) => {
|
|
|
64
76
|
const translateBottomInverse = direction === "bottom" ? isNumbered ? 25 : 50 : 0;
|
|
65
77
|
const translateLeftInverse = direction === "left" ? isNumbered ? -25 : -50 : 0;
|
|
66
78
|
const translateRightInverse = direction === "right" ? isNumbered ? 25 : 50 : 0;
|
|
67
|
-
return /* @__PURE__ */ jsx(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
isNumbered ? "relative justify-start border-b border-border-primary py-5 md:py-6" : "justify-center",
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
SectionWrapper,
|
|
81
|
+
{
|
|
82
|
+
className: cn("isolate px-[5%] py-8 md:py-12 lg:py-14", sectionClassName),
|
|
83
|
+
style: sectionStyle,
|
|
84
|
+
css,
|
|
85
|
+
onMouseMove: !isNumbered ? handleMouseMove : void 0,
|
|
86
|
+
children: /* @__PURE__ */ jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: cn("container", { "max-w-xl text-center": !isNumbered }),
|
|
90
|
+
onMouseMove: isNumbered ? handleMouseMove : void 0,
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx("p", { className: "mb-6 font-semibold md:mb-8", children: tagline }),
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
motion.div,
|
|
84
95
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
initial: "initial",
|
|
97
|
+
whileHover: direction,
|
|
98
|
+
onMouseEnter: handleMouseEnter,
|
|
99
|
+
onMouseLeave: handleMouseLeave,
|
|
100
|
+
children: hoverLinks.map((link, index) => /* @__PURE__ */ jsxs(
|
|
101
|
+
"a",
|
|
102
|
+
{
|
|
103
|
+
href: resolveActionUrl(link.action ?? { type: "none" }) ?? "#",
|
|
104
|
+
onMouseEnter: () => setHoveredIndex(index),
|
|
105
|
+
className: cn(
|
|
106
|
+
"flex items-center p-4 transition-colors duration-300",
|
|
107
|
+
isNumbered ? "relative justify-start border-b border-border-primary py-5 md:py-6" : "justify-center",
|
|
108
|
+
{
|
|
109
|
+
"lg:text-black/20": hoveredIndex !== index && hoveredIndex !== null,
|
|
110
|
+
"lg:text-black": hoveredIndex === index || hoveredIndex === null
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
children: [
|
|
114
|
+
isNumbered && link.listNumber && /* @__PURE__ */ jsx("p", { className: "mr-6 whitespace-nowrap text-xl font-bold md:mr-8 md:text-2xl", children: link.listNumber }),
|
|
115
|
+
/* @__PURE__ */ jsx("h3", { className: "text-5xl font-bold md:text-9xl lg:text-10xl", children: link.heading }),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
motion.div,
|
|
118
|
+
{
|
|
119
|
+
className: cn(
|
|
120
|
+
"pointer-events-none fixed inset-0 hidden size-[600px] transition-opacity duration-300 lg:block",
|
|
121
|
+
isNumbered ? "-z-10 ml-[300px]" : "-z-10",
|
|
122
|
+
{
|
|
123
|
+
"opacity-70": hoveredIndex === index,
|
|
124
|
+
"opacity-0": hoveredIndex !== index
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
animate: {
|
|
128
|
+
x: cursorPosition.x - 300 + translateLeftInverse + translateRightInverse,
|
|
129
|
+
y: cursorPosition.y - 300 + translateTopInverse + translateBottomInverse
|
|
130
|
+
},
|
|
131
|
+
transition: { type: "spring", damping: 20, stiffness: 150, mass: 0.5 },
|
|
132
|
+
children: /* @__PURE__ */ jsx(
|
|
133
|
+
motion.img,
|
|
134
|
+
{
|
|
135
|
+
className: "size-full max-w-md",
|
|
136
|
+
variants: imageVariants,
|
|
137
|
+
src: link.image.src,
|
|
138
|
+
alt: link.image.alt
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
106
144
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
index
|
|
121
|
-
))
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
] }) });
|
|
145
|
+
index
|
|
146
|
+
))
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
);
|
|
125
154
|
};
|
|
126
155
|
const MouseTrackCtaDefaults = {
|
|
127
156
|
tagline: "Tagline",
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
const ctaStyleFields = {
|
|
2
|
+
textLayout: {
|
|
3
|
+
type: "select",
|
|
4
|
+
label: "Text Layout",
|
|
5
|
+
options: [
|
|
6
|
+
{ label: "Left", value: "left" },
|
|
7
|
+
{ label: "Center", value: "center" },
|
|
8
|
+
{ label: "Two Column", value: "twoColumn" },
|
|
9
|
+
{ label: "Inline Row", value: "inlineRow" }
|
|
10
|
+
]
|
|
11
|
+
},
|
|
2
12
|
textAlign: {
|
|
3
13
|
type: "radio",
|
|
4
14
|
label: "Text Align",
|
|
@@ -7,6 +17,42 @@ const ctaStyleFields = {
|
|
|
7
17
|
{ label: "Center", value: "center" }
|
|
8
18
|
]
|
|
9
19
|
},
|
|
20
|
+
mediaPosition: {
|
|
21
|
+
type: "radio",
|
|
22
|
+
label: "Media Position",
|
|
23
|
+
options: [
|
|
24
|
+
{ label: "Left", value: "left" },
|
|
25
|
+
{ label: "Right", value: "right" }
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
bgMedia: {
|
|
29
|
+
type: "select",
|
|
30
|
+
label: "Background Media",
|
|
31
|
+
options: [
|
|
32
|
+
{ label: "None", value: "none" },
|
|
33
|
+
{ label: "Fullscreen Image", value: "fullscreenImage" },
|
|
34
|
+
{ label: "Fullscreen Video", value: "fullscreenVideo" },
|
|
35
|
+
{ label: "Container Image", value: "containerImage" },
|
|
36
|
+
{ label: "Container Video", value: "containerVideo" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
bordered: {
|
|
40
|
+
type: "radio",
|
|
41
|
+
label: "Bordered",
|
|
42
|
+
options: [
|
|
43
|
+
{ label: "Yes", value: "true" },
|
|
44
|
+
{ label: "No", value: "false" }
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
bottomContent: {
|
|
48
|
+
type: "select",
|
|
49
|
+
label: "Bottom Content",
|
|
50
|
+
options: [
|
|
51
|
+
{ label: "None", value: "none" },
|
|
52
|
+
{ label: "Image", value: "image" },
|
|
53
|
+
{ label: "Logos", value: "logos" }
|
|
54
|
+
]
|
|
55
|
+
},
|
|
10
56
|
listStyle: {
|
|
11
57
|
type: "radio",
|
|
12
58
|
label: "List Style",
|
|
@@ -25,7 +25,7 @@ declare const conf: {
|
|
|
25
25
|
readonly action: {
|
|
26
26
|
type: "custom";
|
|
27
27
|
label: string;
|
|
28
|
-
render: typeof import("
|
|
28
|
+
render: typeof import("../../..").ActionField;
|
|
29
29
|
};
|
|
30
30
|
readonly variant: {
|
|
31
31
|
readonly type: "select";
|
|
@@ -108,67 +108,6 @@ declare const conf: {
|
|
|
108
108
|
src: string;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
inputPlaceholder: {
|
|
112
|
-
type: string;
|
|
113
|
-
};
|
|
114
|
-
formButton: {
|
|
115
|
-
readonly type: "object";
|
|
116
|
-
readonly objectFields: {
|
|
117
|
-
readonly label: {
|
|
118
|
-
readonly type: "text";
|
|
119
|
-
};
|
|
120
|
-
readonly action: {
|
|
121
|
-
type: "custom";
|
|
122
|
-
label: string;
|
|
123
|
-
render: typeof import("../../../puck-core").ActionField;
|
|
124
|
-
};
|
|
125
|
-
readonly variant: {
|
|
126
|
-
readonly type: "select";
|
|
127
|
-
readonly options: readonly [{
|
|
128
|
-
readonly label: "primary";
|
|
129
|
-
readonly value: "default";
|
|
130
|
-
}, {
|
|
131
|
-
readonly label: "secondary";
|
|
132
|
-
readonly value: "secondary";
|
|
133
|
-
}, {
|
|
134
|
-
readonly label: "outline";
|
|
135
|
-
readonly value: "outline";
|
|
136
|
-
}, {
|
|
137
|
-
readonly label: "ghost";
|
|
138
|
-
readonly value: "ghost";
|
|
139
|
-
}, {
|
|
140
|
-
readonly label: "link";
|
|
141
|
-
readonly value: "link";
|
|
142
|
-
}, {
|
|
143
|
-
readonly label: "destructive";
|
|
144
|
-
readonly value: "destructive";
|
|
145
|
-
}];
|
|
146
|
-
};
|
|
147
|
-
readonly size: {
|
|
148
|
-
readonly type: "select";
|
|
149
|
-
readonly options: readonly [{
|
|
150
|
-
readonly label: "default";
|
|
151
|
-
readonly value: "default";
|
|
152
|
-
}, {
|
|
153
|
-
readonly label: "sm";
|
|
154
|
-
readonly value: "sm";
|
|
155
|
-
}, {
|
|
156
|
-
readonly label: "lg";
|
|
157
|
-
readonly value: "lg";
|
|
158
|
-
}, {
|
|
159
|
-
readonly label: "icon";
|
|
160
|
-
readonly value: "icon";
|
|
161
|
-
}];
|
|
162
|
-
};
|
|
163
|
-
readonly icon: {
|
|
164
|
-
type: "custom";
|
|
165
|
-
render: typeof import("../../../puck-core/fields/icon-picker-field").IconPickerField;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
termsAndConditions: {
|
|
170
|
-
type: string;
|
|
171
|
-
};
|
|
172
111
|
styles: {
|
|
173
112
|
type: string;
|
|
174
113
|
label: string;
|
|
@@ -217,17 +156,6 @@ declare const conf: {
|
|
|
217
156
|
readonly value: "false";
|
|
218
157
|
}];
|
|
219
158
|
};
|
|
220
|
-
formType: {
|
|
221
|
-
readonly type: "radio";
|
|
222
|
-
readonly label: "Form Type";
|
|
223
|
-
readonly options: readonly [{
|
|
224
|
-
readonly label: "Buttons";
|
|
225
|
-
readonly value: "buttons";
|
|
226
|
-
}, {
|
|
227
|
-
readonly label: "Email";
|
|
228
|
-
readonly value: "email";
|
|
229
|
-
}];
|
|
230
|
-
};
|
|
231
159
|
};
|
|
232
160
|
};
|
|
233
161
|
};
|