dune-react 0.0.21 → 0.0.23
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/css-marquee-banner/css-marquee-banner.js +13 -13
- package/dist/components/puck-block/banner-sections/dismissible-banner/index.d.ts +3 -25
- package/dist/components/puck-block/banner-sections/dual-row-marquee/dual-row-marquee.js +8 -8
- package/dist/components/puck-block/banner-sections/scroll-driven-marquee/scroll-driven-marquee.js +8 -6
- package/dist/components/puck-block/banner-sections/scroll-parallax-text/scroll-parallax-text.js +3 -1
- package/dist/components/puck-block/contact-sections/centered-form/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/contact-cards-grid/contact-cards-grid.js +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/form-with-media.js +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/header-form-cards.js +1 -1
- package/dist/components/puck-block/contact-sections/header-form-cards/index.d.ts +1 -1
- package/dist/components/puck-block/contact-sections/header-info-fullwidth/header-info-fullwidth.js +2 -2
- package/dist/components/puck-block/contact-sections/info-cards-media/info-cards-media.js +2 -2
- 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/contact-sections/split-info-form/split-info-form.js +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 +92 -63
- 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/component.js +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/component.js +1 -1
- 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 +80 -64
- package/dist/components/puck-block/feature-sections/text-media-split/component.js +1 -1
- 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/centered-minimal-footer/centered-minimal-footer.js +72 -18
- package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.d.ts +79 -0
- package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.js +43 -1
- package/dist/components/puck-block/footer-sections/compact-newsletter-footer/index.d.ts +42 -1
- package/dist/components/puck-block/footer-sections/contact-links-footer/contact-links-footer.js +4 -3
- package/dist/components/puck-block/footer-sections/contact-links-footer/index.d.ts +86 -0
- package/dist/components/puck-block/footer-sections/contact-links-footer/index.js +1 -1
- package/dist/components/puck-block/footer-sections/cta-links-footer/cta-links-footer.js +3 -2
- package/dist/components/puck-block/footer-sections/cta-links-footer/index.d.ts +38 -1
- package/dist/components/puck-block/footer-sections/cta-links-footer/index.js +1 -1
- package/dist/components/puck-block/footer-sections/links-newsletter-footer/index.d.ts +55 -1
- package/dist/components/puck-block/footer-sections/newsletter-links-footer/index.d.ts +42 -1
- package/dist/components/puck-block/footer-sections/newsletter-top-links-footer/index.d.ts +55 -1
- package/dist/components/puck-block/footer-sections/props.d.ts +3 -0
- package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/fullscreen-portfolio.js +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/interactive-portfolio/interactive-portfolio.js +1 -1
- package/dist/components/puck-block/gallery-sections/portfolio-cards/index.d.ts +2 -2
- package/dist/components/puck-block/gallery-sections/portfolio-cards/portfolio-cards.js +1 -1
- 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 +68 -65
- package/dist/components/puck-block/gallery-sections/props.d.ts +11 -1
- package/dist/components/puck-block/gallery-sections/props.js +7 -2
- package/dist/components/puck-block/gallery-sections/scroll-parallax/scroll-parallax.js +18 -0
- 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/gallery-sections/scroll-parallax-portfolio/scroll-parallax-portfolio.js +25 -22
- package/dist/components/puck-block/gallery-sections/split-carousel/index.d.ts +11 -1
- package/dist/components/puck-block/header-sections/centered-navbar/centered-navbar.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 +119 -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 +162 -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 +143 -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/mega-menu-navbar/mega-menu-navbar.js +3 -2
- package/dist/components/puck-block/header-sections/props.d.ts +3 -0
- package/dist/components/puck-block/header-sections/standard-navbar/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/standard-navbar/standard-navbar.js +3 -2
- 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/component.js +8 -8
- 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/component.js +6 -6
- 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 +5 -3
- 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/component.js +26 -17
- 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/component.js +3 -3
- 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/component.js +60 -19
- 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/multi-image-grid-hero/multi-image-grid-hero.js +2 -2
- package/dist/components/puck-block/hero-sections/overlapping-image-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/overlapping-image-hero/overlapping-image-hero.js +3 -3
- package/dist/components/puck-block/hero-sections/parallax-images-hero/component.js +18 -6
- 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/component.js +9 -7
- 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/component.js +7 -5
- 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 +93 -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/component.js +1 -1
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.d.ts +14 -6
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.js +2 -2
- package/dist/components/puck-block/hero-sections/sticky-video-hero/component.js +2 -2
- package/dist/components/puck-block/hero-sections/sticky-video-hero/index.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/tab-hero/component.js +4 -4
- 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 +96 -46
- 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 +33 -10
- 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/component.js +14 -12
- 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/center-media-stats/center-media-stats.js +1 -1
- package/dist/components/puck-block/metrics-sections/header-stats-row/header-stats-row.js +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/mixed-grid-stats/mixed-grid-stats.js +2 -2
- package/dist/components/puck-block/metrics-sections/split-stats/index.d.ts +1 -1
- package/dist/components/puck-block/metrics-sections/split-stats/split-stats.js +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 +39 -26
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.d.ts +47 -0
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.js +34 -0
- 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/component.js +3 -3
- 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 +13408 -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/component.js +1 -1
- 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/bento-testimonial/component.js +2 -2
- package/dist/components/puck-block/testimonial-sections/sticky-testimonial/index.d.ts +1 -1
- package/dist/components/puck-block/testimonial-sections/tab-testimonial/component.js +2 -2
- 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-content/component.js +1 -1
- package/dist/components/puck-block/text-sections/prose-sidebar/index.d.ts +1 -23
- package/dist/components/puck-block/text-sections/side-media-content/component.js +1 -1
- package/dist/components/puck-block/text-sections/sticky-text-multi-image/component.js +3 -3
- 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 +14 -5
- 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-core/fields/array-field.d.ts +7 -0
- package/dist/components/puck-core/fields/array-field.js +229 -0
- package/dist/components/{puck-base → puck-core}/fields/auto-field.js +11 -0
- package/dist/components/{puck-base → puck-core/fields}/image-upload-field.js +5 -5
- package/dist/components/puck-core/fields/index.d.ts +1 -0
- package/dist/components/{puck-base → puck-core}/fields/location-field.js +1 -1
- package/dist/components/{puck-base → puck-core}/fields/object-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/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.4/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +59 -0
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@dnd-kit/core/dist/core.esm.js +3093 -0
- package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4__react@19.2.4/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +592 -0
- package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +301 -0
- package/package.json +4 -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/color-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
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { useRef, useMemo, useLayoutEffect, useEffect, useCallback } from "react";
|
|
2
|
+
function useCombinedRefs() {
|
|
3
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4
|
+
refs[_key] = arguments[_key];
|
|
5
|
+
}
|
|
6
|
+
return useMemo(
|
|
7
|
+
() => (node) => {
|
|
8
|
+
refs.forEach((ref) => ref(node));
|
|
9
|
+
},
|
|
10
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11
|
+
refs
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
const canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
|
|
15
|
+
function isWindow(element) {
|
|
16
|
+
const elementString = Object.prototype.toString.call(element);
|
|
17
|
+
return elementString === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
18
|
+
elementString === "[object global]";
|
|
19
|
+
}
|
|
20
|
+
function isNode(node) {
|
|
21
|
+
return "nodeType" in node;
|
|
22
|
+
}
|
|
23
|
+
function getWindow(target) {
|
|
24
|
+
var _target$ownerDocument, _target$ownerDocument2;
|
|
25
|
+
if (!target) {
|
|
26
|
+
return window;
|
|
27
|
+
}
|
|
28
|
+
if (isWindow(target)) {
|
|
29
|
+
return target;
|
|
30
|
+
}
|
|
31
|
+
if (!isNode(target)) {
|
|
32
|
+
return window;
|
|
33
|
+
}
|
|
34
|
+
return (_target$ownerDocument = (_target$ownerDocument2 = target.ownerDocument) == null ? void 0 : _target$ownerDocument2.defaultView) != null ? _target$ownerDocument : window;
|
|
35
|
+
}
|
|
36
|
+
function isDocument(node) {
|
|
37
|
+
const {
|
|
38
|
+
Document
|
|
39
|
+
} = getWindow(node);
|
|
40
|
+
return node instanceof Document;
|
|
41
|
+
}
|
|
42
|
+
function isHTMLElement(node) {
|
|
43
|
+
if (isWindow(node)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return node instanceof getWindow(node).HTMLElement;
|
|
47
|
+
}
|
|
48
|
+
function isSVGElement(node) {
|
|
49
|
+
return node instanceof getWindow(node).SVGElement;
|
|
50
|
+
}
|
|
51
|
+
function getOwnerDocument(target) {
|
|
52
|
+
if (!target) {
|
|
53
|
+
return document;
|
|
54
|
+
}
|
|
55
|
+
if (isWindow(target)) {
|
|
56
|
+
return target.document;
|
|
57
|
+
}
|
|
58
|
+
if (!isNode(target)) {
|
|
59
|
+
return document;
|
|
60
|
+
}
|
|
61
|
+
if (isDocument(target)) {
|
|
62
|
+
return target;
|
|
63
|
+
}
|
|
64
|
+
if (isHTMLElement(target) || isSVGElement(target)) {
|
|
65
|
+
return target.ownerDocument;
|
|
66
|
+
}
|
|
67
|
+
return document;
|
|
68
|
+
}
|
|
69
|
+
const useIsomorphicLayoutEffect = canUseDOM ? useLayoutEffect : useEffect;
|
|
70
|
+
function useEvent(handler) {
|
|
71
|
+
const handlerRef = useRef(handler);
|
|
72
|
+
useIsomorphicLayoutEffect(() => {
|
|
73
|
+
handlerRef.current = handler;
|
|
74
|
+
});
|
|
75
|
+
return useCallback(function() {
|
|
76
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
77
|
+
args[_key] = arguments[_key];
|
|
78
|
+
}
|
|
79
|
+
return handlerRef.current == null ? void 0 : handlerRef.current(...args);
|
|
80
|
+
}, []);
|
|
81
|
+
}
|
|
82
|
+
function useInterval() {
|
|
83
|
+
const intervalRef = useRef(null);
|
|
84
|
+
const set = useCallback((listener, duration) => {
|
|
85
|
+
intervalRef.current = setInterval(listener, duration);
|
|
86
|
+
}, []);
|
|
87
|
+
const clear = useCallback(() => {
|
|
88
|
+
if (intervalRef.current !== null) {
|
|
89
|
+
clearInterval(intervalRef.current);
|
|
90
|
+
intervalRef.current = null;
|
|
91
|
+
}
|
|
92
|
+
}, []);
|
|
93
|
+
return [set, clear];
|
|
94
|
+
}
|
|
95
|
+
function useLatestValue(value, dependencies) {
|
|
96
|
+
if (dependencies === void 0) {
|
|
97
|
+
dependencies = [value];
|
|
98
|
+
}
|
|
99
|
+
const valueRef = useRef(value);
|
|
100
|
+
useIsomorphicLayoutEffect(() => {
|
|
101
|
+
if (valueRef.current !== value) {
|
|
102
|
+
valueRef.current = value;
|
|
103
|
+
}
|
|
104
|
+
}, dependencies);
|
|
105
|
+
return valueRef;
|
|
106
|
+
}
|
|
107
|
+
function useLazyMemo(callback, dependencies) {
|
|
108
|
+
const valueRef = useRef();
|
|
109
|
+
return useMemo(
|
|
110
|
+
() => {
|
|
111
|
+
const newValue = callback(valueRef.current);
|
|
112
|
+
valueRef.current = newValue;
|
|
113
|
+
return newValue;
|
|
114
|
+
},
|
|
115
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
116
|
+
[...dependencies]
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
function useNodeRef(onChange) {
|
|
120
|
+
const onChangeHandler = useEvent(onChange);
|
|
121
|
+
const node = useRef(null);
|
|
122
|
+
const setNodeRef = useCallback(
|
|
123
|
+
(element) => {
|
|
124
|
+
if (element !== node.current) {
|
|
125
|
+
onChangeHandler == null ? void 0 : onChangeHandler(element, node.current);
|
|
126
|
+
}
|
|
127
|
+
node.current = element;
|
|
128
|
+
},
|
|
129
|
+
//eslint-disable-next-line
|
|
130
|
+
[]
|
|
131
|
+
);
|
|
132
|
+
return [node, setNodeRef];
|
|
133
|
+
}
|
|
134
|
+
function usePrevious(value) {
|
|
135
|
+
const ref = useRef();
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
ref.current = value;
|
|
138
|
+
}, [value]);
|
|
139
|
+
return ref.current;
|
|
140
|
+
}
|
|
141
|
+
let ids = {};
|
|
142
|
+
function useUniqueId(prefix, value) {
|
|
143
|
+
return useMemo(() => {
|
|
144
|
+
if (value) {
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
const id = ids[prefix] == null ? 0 : ids[prefix] + 1;
|
|
148
|
+
ids[prefix] = id;
|
|
149
|
+
return prefix + "-" + id;
|
|
150
|
+
}, [prefix, value]);
|
|
151
|
+
}
|
|
152
|
+
function createAdjustmentFn(modifier) {
|
|
153
|
+
return function(object) {
|
|
154
|
+
for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
155
|
+
adjustments[_key - 1] = arguments[_key];
|
|
156
|
+
}
|
|
157
|
+
return adjustments.reduce((accumulator, adjustment) => {
|
|
158
|
+
const entries = Object.entries(adjustment);
|
|
159
|
+
for (const [key, valueAdjustment] of entries) {
|
|
160
|
+
const value = accumulator[key];
|
|
161
|
+
if (value != null) {
|
|
162
|
+
accumulator[key] = value + modifier * valueAdjustment;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return accumulator;
|
|
166
|
+
}, {
|
|
167
|
+
...object
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
const add = /* @__PURE__ */ createAdjustmentFn(1);
|
|
172
|
+
const subtract = /* @__PURE__ */ createAdjustmentFn(-1);
|
|
173
|
+
function hasViewportRelativeCoordinates(event) {
|
|
174
|
+
return "clientX" in event && "clientY" in event;
|
|
175
|
+
}
|
|
176
|
+
function isKeyboardEvent(event) {
|
|
177
|
+
if (!event) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
const {
|
|
181
|
+
KeyboardEvent
|
|
182
|
+
} = getWindow(event.target);
|
|
183
|
+
return KeyboardEvent && event instanceof KeyboardEvent;
|
|
184
|
+
}
|
|
185
|
+
function isTouchEvent(event) {
|
|
186
|
+
if (!event) {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const {
|
|
190
|
+
TouchEvent
|
|
191
|
+
} = getWindow(event.target);
|
|
192
|
+
return TouchEvent && event instanceof TouchEvent;
|
|
193
|
+
}
|
|
194
|
+
function getEventCoordinates(event) {
|
|
195
|
+
if (isTouchEvent(event)) {
|
|
196
|
+
if (event.touches && event.touches.length) {
|
|
197
|
+
const {
|
|
198
|
+
clientX: x,
|
|
199
|
+
clientY: y
|
|
200
|
+
} = event.touches[0];
|
|
201
|
+
return {
|
|
202
|
+
x,
|
|
203
|
+
y
|
|
204
|
+
};
|
|
205
|
+
} else if (event.changedTouches && event.changedTouches.length) {
|
|
206
|
+
const {
|
|
207
|
+
clientX: x,
|
|
208
|
+
clientY: y
|
|
209
|
+
} = event.changedTouches[0];
|
|
210
|
+
return {
|
|
211
|
+
x,
|
|
212
|
+
y
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (hasViewportRelativeCoordinates(event)) {
|
|
217
|
+
return {
|
|
218
|
+
x: event.clientX,
|
|
219
|
+
y: event.clientY
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
const CSS = /* @__PURE__ */ Object.freeze({
|
|
225
|
+
Translate: {
|
|
226
|
+
toString(transform) {
|
|
227
|
+
if (!transform) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const {
|
|
231
|
+
x,
|
|
232
|
+
y
|
|
233
|
+
} = transform;
|
|
234
|
+
return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
Scale: {
|
|
238
|
+
toString(transform) {
|
|
239
|
+
if (!transform) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const {
|
|
243
|
+
scaleX,
|
|
244
|
+
scaleY
|
|
245
|
+
} = transform;
|
|
246
|
+
return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
Transform: {
|
|
250
|
+
toString(transform) {
|
|
251
|
+
if (!transform) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
Transition: {
|
|
258
|
+
toString(_ref) {
|
|
259
|
+
let {
|
|
260
|
+
property,
|
|
261
|
+
duration,
|
|
262
|
+
easing
|
|
263
|
+
} = _ref;
|
|
264
|
+
return property + " " + duration + "ms " + easing;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
const SELECTOR = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
269
|
+
function findFirstFocusableNode(element) {
|
|
270
|
+
if (element.matches(SELECTOR)) {
|
|
271
|
+
return element;
|
|
272
|
+
}
|
|
273
|
+
return element.querySelector(SELECTOR);
|
|
274
|
+
}
|
|
275
|
+
export {
|
|
276
|
+
CSS,
|
|
277
|
+
add,
|
|
278
|
+
canUseDOM,
|
|
279
|
+
findFirstFocusableNode,
|
|
280
|
+
getEventCoordinates,
|
|
281
|
+
getOwnerDocument,
|
|
282
|
+
getWindow,
|
|
283
|
+
hasViewportRelativeCoordinates,
|
|
284
|
+
isDocument,
|
|
285
|
+
isHTMLElement,
|
|
286
|
+
isKeyboardEvent,
|
|
287
|
+
isNode,
|
|
288
|
+
isSVGElement,
|
|
289
|
+
isTouchEvent,
|
|
290
|
+
isWindow,
|
|
291
|
+
subtract,
|
|
292
|
+
useCombinedRefs,
|
|
293
|
+
useEvent,
|
|
294
|
+
useInterval,
|
|
295
|
+
useIsomorphicLayoutEffect,
|
|
296
|
+
useLatestValue,
|
|
297
|
+
useLazyMemo,
|
|
298
|
+
useNodeRef,
|
|
299
|
+
usePrevious,
|
|
300
|
+
useUniqueId
|
|
301
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dune-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -407,6 +407,9 @@
|
|
|
407
407
|
"strip-ansi": "^6"
|
|
408
408
|
},
|
|
409
409
|
"dependencies": {
|
|
410
|
+
"@dnd-kit/core": "^6.3.1",
|
|
411
|
+
"@dnd-kit/sortable": "^10.0.0",
|
|
412
|
+
"@dnd-kit/utilities": "^3.2.2",
|
|
410
413
|
"@emotion/is-prop-valid": "1.4.0",
|
|
411
414
|
"@relume_io/relume-tailwind": "^1.3.0",
|
|
412
415
|
"embla-carousel-autoplay": "8.6.0",
|