@uniformdev/csk-components 6.1.57 → 6.1.64-alpha.1
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/README.md +74 -81
- package/dist/ThemeSwitcher-EUDUX3QI.mjs +1 -0
- package/dist/accordion-item-7IKL6Z6Q.mjs +1 -0
- package/dist/accordion-item-MORC2F2Q.mjs +1 -0
- package/dist/banner-WOYK426U.mjs +1 -0
- package/dist/carousel-ALNEGOPM.mjs +1 -0
- package/dist/carousel-HKYR3ZBB.mjs +1 -0
- package/dist/chunk-27WJUZYR.mjs +1 -0
- package/dist/chunk-3JU2XCD2.mjs +1 -0
- package/dist/chunk-47YB4P2Q.mjs +1 -0
- package/dist/chunk-6CKVLOIH.mjs +1 -0
- package/dist/chunk-7GVG4HLE.mjs +1 -0
- package/dist/chunk-AOFJCDRO.mjs +1 -0
- package/dist/chunk-AWTML4I7.mjs +1 -0
- package/dist/chunk-CZ4X5ZBK.mjs +1 -0
- package/dist/chunk-D673IM2U.mjs +1 -0
- package/dist/chunk-I6SUO5WR.mjs +1 -0
- package/dist/chunk-JT77BVIX.mjs +1 -0
- package/dist/chunk-LPAOEOU4.mjs +1 -0
- package/dist/chunk-MKOFM4XK.mjs +1 -0
- package/dist/chunk-NKINOJY6.mjs +1 -0
- package/dist/chunk-OKUDTS22.mjs +1 -0
- package/dist/chunk-OL6JBPZ4.mjs +1 -0
- package/dist/chunk-OY6ZJNCE.mjs +1 -0
- package/dist/chunk-PLKWUEFW.mjs +1 -0
- package/dist/chunk-QPQGRQKI.mjs +1 -0
- package/dist/chunk-VWWXSA5H.mjs +1 -0
- package/dist/chunk-WAW7PQYM.mjs +1 -0
- package/dist/chunk-XKCRANRQ.mjs +1 -0
- package/dist/chunk-XYU3TGOU.mjs +1 -0
- package/dist/chunk-Y337A266.mjs +7 -0
- package/dist/chunk-YQYDZJ65.mjs +1 -0
- package/dist/chunk-ZAHWFLY4.mjs +1 -0
- package/dist/{chunk-V4EBWEG4.mjs → chunk-ZWDCDE5W.mjs} +1 -1
- package/dist/components/canvas/emptyPlaceholders.d.mts +5 -4
- package/dist/components/canvas/emptyPlaceholders.mjs +1 -1
- package/dist/components/canvas/index.d.mts +4 -664
- package/dist/components/canvas/index.mjs +1 -2
- package/dist/components/canvas/serverClient.d.mts +694 -0
- package/dist/components/canvas/serverClient.mjs +1 -0
- package/dist/components/canvas/serverOnly.d.mts +41 -0
- package/dist/components/canvas/serverOnly.mjs +1 -0
- package/dist/components/ui/index.d.mts +81 -54
- package/dist/components/ui/index.mjs +1 -1
- package/dist/content/components/canvas/Accordion/accordion.tsx +12 -17
- package/dist/content/components/canvas/Accordion/index.tsx +2 -2
- package/dist/content/components/canvas/AccordionItem/accordion-item.tsx +28 -39
- package/dist/content/components/canvas/AccordionItem/index.tsx +4 -6
- package/dist/content/components/canvas/Badge/badge.tsx +12 -5
- package/dist/content/components/canvas/Badge/index.tsx +2 -3
- package/dist/content/components/canvas/Badge/style-utils.ts +6 -6
- package/dist/content/components/canvas/Banner/banner.tsx +24 -36
- package/dist/content/components/canvas/Banner/index.tsx +7 -11
- package/dist/content/components/canvas/Breadcrumbs/breadcrumbs.tsx +21 -22
- package/dist/content/components/canvas/Breadcrumbs/index.tsx +4 -7
- package/dist/content/components/canvas/Button/button.tsx +19 -11
- package/dist/content/components/canvas/Button/index.tsx +4 -7
- package/dist/content/components/canvas/Card/card.tsx +10 -12
- package/dist/content/components/canvas/Card/index.tsx +3 -3
- package/dist/content/components/canvas/Carousel/carousel.tsx +10 -10
- package/dist/content/components/canvas/Carousel/index.tsx +4 -4
- package/dist/content/components/canvas/Container/container.tsx +7 -10
- package/dist/content/components/canvas/Container/index.tsx +3 -3
- package/dist/content/components/canvas/Container/parameters.ts +0 -4
- package/dist/content/components/canvas/CookieConsent/cookie-consent.tsx +126 -0
- package/dist/content/components/canvas/CookieConsent/empty-placeholder.tsx +12 -0
- package/dist/content/components/canvas/CookieConsent/index.tsx +26 -0
- package/dist/content/components/canvas/Countdown/countdown.tsx +9 -7
- package/dist/content/components/canvas/Countdown/index.tsx +2 -3
- package/dist/content/components/canvas/DemoHero/atoms.tsx +59 -35
- package/dist/content/components/canvas/DemoHero/columns-variant.tsx +5 -11
- package/dist/content/components/canvas/DemoHero/default-variant.tsx +5 -12
- package/dist/content/components/canvas/DemoHero/demo-hero.tsx +43 -22
- package/dist/content/components/canvas/DemoHero/fixed-hero.tsx +63 -65
- package/dist/content/components/canvas/DemoHero/flexible-hero.tsx +8 -2
- package/dist/content/components/canvas/DemoHero/index.tsx +6 -18
- package/dist/content/components/canvas/DemoHero/utils.ts +14 -0
- package/dist/content/components/canvas/Divider/divider.tsx +5 -2
- package/dist/content/components/canvas/Divider/index.tsx +2 -2
- package/dist/content/components/canvas/Flex/flex.tsx +11 -10
- package/dist/content/components/canvas/Flex/index.tsx +6 -6
- package/dist/content/components/canvas/FlexItem/flex-item.tsx +7 -4
- package/dist/content/components/canvas/FlexItem/index.tsx +4 -5
- package/dist/content/components/canvas/Footer/footer.tsx +9 -8
- package/dist/content/components/canvas/Footer/index.tsx +2 -3
- package/dist/content/components/canvas/Grid/grid.tsx +9 -9
- package/dist/content/components/canvas/Grid/index.tsx +5 -5
- package/dist/content/components/canvas/GridItem/grid-item.tsx +10 -8
- package/dist/content/components/canvas/GridItem/index.tsx +5 -5
- package/dist/content/components/canvas/Header/header.tsx +10 -7
- package/dist/content/components/canvas/Header/index.tsx +2 -3
- package/dist/content/components/canvas/IconLabel/icon-label.tsx +16 -8
- package/dist/content/components/canvas/IconLabel/index.tsx +4 -5
- package/dist/content/components/canvas/Image/image.tsx +25 -8
- package/dist/content/components/canvas/Image/index.tsx +2 -3
- package/dist/content/components/canvas/ImageGallery/empty-placeholder.tsx +1 -1
- package/dist/content/components/canvas/ImageGallery/gallery-inner.tsx +6 -6
- package/dist/content/components/canvas/ImageGallery/image-gallery.tsx +21 -36
- package/dist/content/components/canvas/ImageGallery/index.tsx +11 -12
- package/dist/content/components/canvas/Link/index.tsx +2 -3
- package/dist/content/components/canvas/Link/link.tsx +7 -4
- package/dist/content/components/canvas/Modal/index.tsx +2 -2
- package/dist/content/components/canvas/Modal/modal.tsx +16 -74
- package/dist/content/components/canvas/NavigationFlyout/desktop.tsx +9 -13
- package/dist/content/components/canvas/NavigationFlyout/index.tsx +21 -3
- package/dist/content/components/canvas/NavigationFlyout/mobile.tsx +10 -13
- package/dist/content/components/canvas/NavigationFlyout/{navigation-flyout.tsx → navigation-flyout-client.tsx} +26 -20
- package/dist/content/components/canvas/NavigationGroup/desktop.tsx +7 -10
- package/dist/content/components/canvas/NavigationGroup/index.tsx +20 -3
- package/dist/content/components/canvas/NavigationGroup/mobile.tsx +9 -8
- package/dist/content/components/canvas/NavigationGroup/{navigation-group.tsx → navigation-group-client.tsx} +21 -18
- package/dist/content/components/canvas/NavigationLink/index.tsx +2 -4
- package/dist/content/components/canvas/NavigationLink/navigation-link.tsx +12 -9
- package/dist/content/components/canvas/Page/index.tsx +7 -7
- package/dist/content/components/canvas/Page/page.tsx +9 -18
- package/dist/content/components/canvas/Review/default-variant.tsx +3 -5
- package/dist/content/components/canvas/Review/empty-placeholder.tsx +6 -3
- package/dist/content/components/canvas/Review/index.tsx +6 -6
- package/dist/content/components/canvas/Review/multi-column-variant.tsx +3 -5
- package/dist/content/components/canvas/Review/review.tsx +11 -11
- package/dist/content/components/canvas/RichText/index.tsx +7 -6
- package/dist/content/components/canvas/RichText/rich-text.tsx +23 -6
- package/dist/content/components/canvas/Section/columns-variant.tsx +5 -11
- package/dist/content/components/canvas/Section/default-variant.tsx +7 -16
- package/dist/content/components/canvas/Section/empty-placeholder.tsx +5 -2
- package/dist/content/components/canvas/Section/index.tsx +2 -2
- package/dist/content/components/canvas/Section/section.tsx +11 -16
- package/dist/content/components/canvas/SimpleFooter/index.tsx +16 -0
- package/dist/content/components/canvas/SimpleFooter/simple-footer.tsx +85 -0
- package/dist/content/components/canvas/SimpleHeader/index.tsx +22 -0
- package/dist/content/components/canvas/SimpleHeader/simple-header.tsx +63 -0
- package/dist/content/components/canvas/Spacer/index.tsx +2 -2
- package/dist/content/components/canvas/Spacer/spacer.tsx +5 -2
- package/dist/content/components/canvas/Tab/index.tsx +2 -3
- package/dist/content/components/canvas/Tab/tab.tsx +6 -5
- package/dist/content/components/canvas/Table/index.tsx +2 -2
- package/dist/content/components/canvas/Table/table.tsx +9 -13
- package/dist/content/components/canvas/TableCustomCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableCustomCell/table-custom-cell.tsx +7 -4
- package/dist/content/components/canvas/TableDataCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableDataCell/table-data-cell.tsx +7 -4
- package/dist/content/components/canvas/TableHeaderCell/index.tsx +2 -2
- package/dist/content/components/canvas/TableHeaderCell/table-header-cell.tsx +7 -4
- package/dist/content/components/canvas/TableRow/index.tsx +5 -3
- package/dist/content/components/canvas/TableRow/table-row.tsx +6 -3
- package/dist/content/components/canvas/Tabs/index.tsx +7 -7
- package/dist/content/components/canvas/Tabs/style-utils.ts +12 -11
- package/dist/content/components/canvas/Tabs/tabs.tsx +45 -48
- package/dist/content/components/canvas/Testimonial/default-variant.tsx +9 -11
- package/dist/content/components/canvas/Testimonial/index.tsx +2 -2
- package/dist/content/components/canvas/Testimonial/testimonial.tsx +11 -17
- package/dist/content/components/canvas/Testimonial/with-large-avatar-variant.tsx +9 -11
- package/dist/content/components/canvas/Testimonial/with-overlapping-image-variant.tsx +9 -11
- package/dist/content/components/canvas/Text/index.tsx +2 -3
- package/dist/content/components/canvas/Text/text.tsx +21 -15
- package/dist/content/components/canvas/ThemeSwitcher/index.tsx +2 -2
- package/dist/content/components/canvas/ThemeSwitcher/theme-switcher.tsx +6 -3
- package/dist/content/components/canvas/Video/index.tsx +2 -5
- package/dist/content/components/canvas/Video/placeholder.tsx +1 -1
- package/dist/content/components/canvas/Video/video.tsx +9 -7
- package/dist/content/components/ui/Accordion/accordion.tsx +23 -0
- package/dist/content/components/ui/Accordion/index.tsx +9 -0
- package/dist/content/components/ui/AccordionItem/accordion-item.tsx +41 -0
- package/dist/content/components/ui/AccordionItem/index.tsx +16 -0
- package/dist/content/components/ui/Banner/banner.tsx +47 -0
- package/dist/content/components/ui/Banner/index.tsx +29 -0
- package/dist/content/components/{canvas → ui}/Banner/style-utils.ts +1 -2
- package/dist/content/components/ui/Button/index.ts +2 -5
- package/dist/content/components/ui/Carousel/carousel.tsx +2 -2
- package/dist/content/components/ui/Carousel/index.ts +3 -3
- package/dist/content/components/ui/ComponentEmptyPlaceholder/component-empty-placeholder.tsx +13 -0
- package/dist/content/components/ui/ComponentEmptyPlaceholder/index.ts +6 -0
- package/dist/content/components/ui/Container/container.tsx +2 -7
- package/dist/content/components/ui/Container/index.ts +0 -6
- package/dist/content/components/ui/Flex/flex.tsx +21 -27
- package/dist/content/components/ui/Flex/index.ts +3 -5
- package/dist/content/components/ui/FlexItem/index.ts +1 -1
- package/dist/content/components/ui/Footer/index.ts +5 -4
- package/dist/content/components/ui/Grid/grid.tsx +21 -25
- package/dist/content/components/ui/Grid/index.ts +6 -15
- package/dist/content/components/ui/GridItem/grid-item.tsx +10 -1
- package/dist/content/components/ui/GridItem/index.ts +6 -9
- package/dist/content/components/ui/Header/index.ts +1 -1
- package/dist/content/components/ui/IconLabel/icon-label.tsx +2 -0
- package/dist/content/components/ui/IconLabel/index.ts +1 -0
- package/dist/content/components/ui/InlineSVG/index.ts +15 -0
- package/dist/content/components/ui/InlineSVG/inline-svg.tsx +70 -0
- package/dist/content/components/ui/InlineSVG/utils.ts +132 -0
- package/dist/content/components/ui/Modal/index.tsx +22 -0
- package/dist/content/components/ui/Modal/modal.tsx +89 -0
- package/dist/content/components/{canvas → ui}/Modal/style-utils.ts +4 -4
- package/dist/content/components/ui/Rating/index.tsx +1 -1
- package/dist/content/components/ui/Rating/rating.tsx +1 -1
- package/dist/content/components/ui/Text/index.ts +3 -6
- package/dist/content/types/cskTypes.ts +32 -9
- package/dist/content/utils/assets.ts +3 -18
- package/dist/content/utils/createComponentResolver.ts +7 -6
- package/dist/content/utils/createEmptyPlaceholderResolver.tsx +4 -8
- package/dist/content/utils/getSlotComponents.ts +15 -0
- package/dist/content/utils/routing.ts +60 -15
- package/dist/content/utils/useCookiesConsent.ts +17 -0
- package/dist/content/utils/withFlattenParameters.tsx +17 -0
- package/dist/content/utils/withSlotsDataValue.tsx +34 -0
- package/dist/cookie-consent-5QJUCW2K.mjs +1 -0
- package/dist/countdown-FRQZMVKW.mjs +1 -0
- package/dist/image-gallery-HWCMTJL3.mjs +1 -0
- package/dist/index-CrBZatTs.d.mts +18 -0
- package/dist/index-vyIO0XN2.d.mts +90 -0
- package/dist/index.mjs +3 -3
- package/dist/mobile-KBYNJEBM.mjs +1 -0
- package/dist/modal-4TVVGHWS.mjs +1 -0
- package/dist/modal-E5RMA4EO.mjs +1 -0
- package/dist/navigation-flyout-client-WUN4A34X.mjs +1 -0
- package/dist/navigation-group-client-Y72BOPIH.mjs +1 -0
- package/dist/parameters-B8w5Q6Pp.d.mts +29 -0
- package/dist/tabs-VMFTATOP.mjs +1 -0
- package/dist/theme-switcher-QTX46Z7E.mjs +1 -0
- package/dist/theme-switcher-RGY4D3KL.mjs +1 -0
- package/dist/types/cskTypes.d.mts +27 -9
- package/dist/utils/assets.d.mts +8 -17
- package/dist/utils/assets.mjs +1 -1
- package/dist/utils/createComponentResolver.d.mts +3 -9
- package/dist/utils/createComponentResolver.mjs +1 -1
- package/dist/utils/createEmptyPlaceholderResolver.d.mts +4 -2
- package/dist/utils/createEmptyPlaceholderResolver.mjs +1 -1
- package/dist/utils/getSlotComponents.d.mts +11 -0
- package/dist/utils/getSlotComponents.mjs +1 -0
- package/dist/utils/routing.d.mts +21 -8
- package/dist/utils/routing.mjs +1 -1
- package/dist/utils/sitemap.d.mts +21 -0
- package/dist/utils/sitemap.mjs +1 -0
- package/dist/utils/styling.d.mts +4 -1
- package/dist/utils/styling.mjs +1 -1
- package/dist/utils/withFlattenParameters.d.mts +10 -0
- package/dist/utils/withFlattenParameters.mjs +1 -0
- package/dist/utils/withSlotsDataValue.d.mts +12 -0
- package/dist/utils/withSlotsDataValue.mjs +1 -0
- package/dist/video-VG6ZQCKN.mjs +1 -0
- package/package.json +48 -15
- package/dist/ThemeSwitcher-6Q7LCO4Q.mjs +0 -1
- package/dist/accordion-item-G5CNMERW.mjs +0 -1
- package/dist/banner-2B4K5R4N.mjs +0 -1
- package/dist/carousel-BBEW5P4Y.mjs +0 -1
- package/dist/carousel-ERCHOWUS.mjs +0 -1
- package/dist/chunk-2SEOCBRK.mjs +0 -1
- package/dist/chunk-2UV7TQNF.mjs +0 -1
- package/dist/chunk-2YTACEBA.mjs +0 -1
- package/dist/chunk-3PDY7RJC.mjs +0 -7
- package/dist/chunk-4LWAGTFW.mjs +0 -1
- package/dist/chunk-56OQGKRM.mjs +0 -1
- package/dist/chunk-5VM2Y55L.mjs +0 -1
- package/dist/chunk-AKRWCDDG.mjs +0 -1
- package/dist/chunk-FPOIJMYT.mjs +0 -1
- package/dist/chunk-LA36HQWS.mjs +0 -1
- package/dist/chunk-M3BGP5VE.mjs +0 -1
- package/dist/chunk-MSXDLSXH.mjs +0 -1
- package/dist/chunk-QHIWJPL6.mjs +0 -1
- package/dist/chunk-RX4IAAQQ.mjs +0 -1
- package/dist/chunk-TIRCISSU.mjs +0 -1
- package/dist/chunk-TM7Q5NMH.mjs +0 -1
- package/dist/chunk-YEKQJ4YC.mjs +0 -1
- package/dist/chunk-YUCUJWBO.mjs +0 -1
- package/dist/chunk-Z7JSWSPD.mjs +0 -1
- package/dist/content/components/canvas/Banner/types.ts +0 -21
- package/dist/content/components/canvas/Image/placeholder.tsx +0 -20
- package/dist/content/components/ui/Container/utils.ts +0 -18
- package/dist/countdown-LYDXJLEE.mjs +0 -1
- package/dist/image-gallery-F6JLG7XW.mjs +0 -1
- package/dist/index-B9eeSbLG.d.mts +0 -71
- package/dist/mobile-UAUHHXPH.mjs +0 -1
- package/dist/modal-HKMQGV4B.mjs +0 -1
- package/dist/navigation-flyout-MXIJA6PC.mjs +0 -1
- package/dist/navigation-group-DEN3D2BO.mjs +0 -1
- package/dist/tabs-AQFKYC6M.mjs +0 -1
- package/dist/theme-switcher-76F2V343.mjs +0 -1
- package/dist/theme-switcher-WO5JIV2W.mjs +0 -1
- package/dist/video-RC2QHJS2.mjs +0 -1
- /package/dist/content/components/{canvas → ui}/AccordionItem/icon-arrow-down.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/AccordionItem/icon-arrow-up.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/Banner/close-button.tsx +0 -0
- /package/dist/content/components/{canvas → ui}/Modal/close-icon.tsx +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { ResolveComponentFunction, ResolveComponentResult } from '@uniformdev/next-app-router';
|
|
2
|
+
import ComponentEmptyPlaceholder from '@/components/ui/ComponentEmptyPlaceholder';
|
|
3
3
|
|
|
4
|
-
export type ComponentMapping = Record<string, ResolveComponentResult>;
|
|
4
|
+
export type ComponentMapping = Record<string, ResolveComponentResult['component']>;
|
|
5
5
|
|
|
6
6
|
const createComponentResolver =
|
|
7
|
-
(mappings: ComponentMapping) =>
|
|
8
|
-
({ component }
|
|
9
|
-
mappings[component?.type]
|
|
7
|
+
(mappings: ComponentMapping): ResolveComponentFunction =>
|
|
8
|
+
({ component }) => ({
|
|
9
|
+
component: mappings[component?.type] || ComponentEmptyPlaceholder,
|
|
10
|
+
});
|
|
10
11
|
|
|
11
12
|
export default createComponentResolver;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { ComponentProps } from '@uniformdev/
|
|
2
|
+
import { ComponentProps } from '@uniformdev/next-app-router/component';
|
|
3
3
|
import { ResolveEmptyPlaceholderOptions } from '@/types/cskTypes';
|
|
4
4
|
|
|
5
|
-
export const DEFAULT_EMPTY_PLACEHOLDER = { component: () => <div className="h-20 w-full" /> };
|
|
5
|
+
export const DEFAULT_EMPTY_PLACEHOLDER = { component: () => <div className="h-full min-h-20 w-full" /> };
|
|
6
6
|
|
|
7
7
|
export type EmptyPlaceholderMapping = Record<
|
|
8
8
|
string,
|
|
@@ -12,11 +12,7 @@ export type EmptyPlaceholderMapping = Record<
|
|
|
12
12
|
}
|
|
13
13
|
>;
|
|
14
14
|
|
|
15
|
-
const createEmptyPlaceholderResolver =
|
|
16
|
-
(
|
|
17
|
-
({ parentComponent, ...restProps }: ResolveEmptyPlaceholderOptions) =>
|
|
18
|
-
parentComponent
|
|
19
|
-
? mappings[parentComponent.type]?.({ parentComponent, ...restProps }) || DEFAULT_EMPTY_PLACEHOLDER
|
|
20
|
-
: DEFAULT_EMPTY_PLACEHOLDER;
|
|
15
|
+
const createEmptyPlaceholderResolver = (mappings: EmptyPlaceholderMapping) => (props: ResolveEmptyPlaceholderOptions) =>
|
|
16
|
+
mappings[props?.parentComponent?.type]?.(props) || DEFAULT_EMPTY_PLACEHOLDER;
|
|
21
17
|
|
|
22
18
|
export default createEmptyPlaceholderResolver;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'server-only';
|
|
2
|
+
|
|
3
|
+
import { createCompositionCache } from '@uniformdev/next-app-router';
|
|
4
|
+
import { SlotDefinition } from '@uniformdev/next-app-router-shared';
|
|
5
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
6
|
+
|
|
7
|
+
export const compositionCache = createCompositionCache();
|
|
8
|
+
|
|
9
|
+
export const getSlotComponents = <T>(slot: SlotDefinition, context: ComponentProps<T>['context']) =>
|
|
10
|
+
slot.items.map(slot =>
|
|
11
|
+
compositionCache.getUniformComponent({
|
|
12
|
+
componentId: slot!._id,
|
|
13
|
+
compositionId: context._id,
|
|
14
|
+
})
|
|
15
|
+
);
|
|
@@ -1,23 +1,68 @@
|
|
|
1
1
|
import { ResolvedRouteGetResponse, RouteGetResponseEdgehancedComposition, LinkParamValue } from '@uniformdev/canvas';
|
|
2
2
|
|
|
3
|
-
const DYNAMIC_KEY_REGEX = /:([a-zA-Z0-9-_]+)/g;
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
4
|
+
* Replaces dynamic segments in an unresolved path template (with `:tokens`)
|
|
5
|
+
* using values from a resolved path.
|
|
6
|
+
*
|
|
7
|
+
* If the structure doesn't match, returns `undefined` instead of throwing an error.
|
|
8
|
+
*
|
|
9
|
+
* @param {string} unresolved - The path template containing dynamic segments (e.g. `/:locale/:dynamic/static`).
|
|
10
|
+
* @param {string} resolved - The fully resolved path with actual values (e.g. `/en/test/static`).
|
|
11
|
+
* @returns {string | undefined} - The final path with dynamic tokens replaced (e.g. `/en/test/static`), or `undefined` on mismatch.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* resolveRouteToPath("/:locale/:dynamic", "/en/test");
|
|
15
|
+
* // Returns: "/en/test"
|
|
7
16
|
*
|
|
8
|
-
* @
|
|
9
|
-
*
|
|
10
|
-
*
|
|
17
|
+
* @example
|
|
18
|
+
* resolveRouteToPath("/:locale/:dynamic/static/:dynamic", "/en/test/static/foo");
|
|
19
|
+
* // Returns: "/en/test/static/foo"
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* resolveRouteToPath("/:locale/static", "/en/test");
|
|
23
|
+
* // Returns: undefined
|
|
11
24
|
*/
|
|
12
|
-
export const resolveRouteToPath = (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
export const resolveRouteToPath = (unresolved: string, resolved: string): string | undefined => {
|
|
26
|
+
const unresolvedParts = unresolved.split('/').filter(Boolean);
|
|
27
|
+
const resolvedParts = resolved.split('/').filter(Boolean);
|
|
28
|
+
|
|
29
|
+
if (resolvedParts.length < unresolvedParts.length) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { valid, result } = unresolvedParts.reduce<{
|
|
34
|
+
valid: boolean;
|
|
35
|
+
result: string[];
|
|
36
|
+
index: number;
|
|
37
|
+
}>(
|
|
38
|
+
(acc, part) => {
|
|
39
|
+
if (!acc.valid) return acc;
|
|
40
|
+
const currentResolved = resolvedParts[acc.index];
|
|
41
|
+
if (!currentResolved) return { ...acc, valid: false };
|
|
42
|
+
|
|
43
|
+
if (part.startsWith(':')) {
|
|
44
|
+
return {
|
|
45
|
+
...acc,
|
|
46
|
+
result: [...acc.result, currentResolved],
|
|
47
|
+
index: acc.index + 1,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (part === currentResolved) {
|
|
52
|
+
return {
|
|
53
|
+
...acc,
|
|
54
|
+
result: [...acc.result, part],
|
|
55
|
+
index: acc.index + 1,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return { ...acc, valid: false };
|
|
60
|
+
},
|
|
61
|
+
{ valid: true, result: [], index: 0 }
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return valid ? '/' + result.join('/') : undefined;
|
|
65
|
+
};
|
|
21
66
|
|
|
22
67
|
/**
|
|
23
68
|
* Checks if a given route response is free of errors and contains a composition.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
import { useUniformContext } from '@uniformdev/next-app-router-client';
|
|
3
|
+
|
|
4
|
+
const useCookiesConsent = () => {
|
|
5
|
+
const { context } = useUniformContext();
|
|
6
|
+
|
|
7
|
+
const consent = useMemo(() => context?.storage?.data?.consent, [context?.storage?.data?.consent]);
|
|
8
|
+
|
|
9
|
+
const updateConsent = useCallback(
|
|
10
|
+
(value: boolean) => context?.storage.updateData([{ type: 'consent', data: value }]),
|
|
11
|
+
[context?.storage]
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
return { consent, updateConsent };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default useCookiesConsent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentType, FC } from 'react';
|
|
2
|
+
import { flattenValues, FlattenValuesOptions } from '@uniformdev/canvas';
|
|
3
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
4
|
+
|
|
5
|
+
export const withFlattenParameters = <TProps extends ComponentProps<T>, T>(
|
|
6
|
+
WrappedComponent: ComponentType<TProps>,
|
|
7
|
+
options?: FlattenValuesOptions
|
|
8
|
+
): ComponentType<TProps> => {
|
|
9
|
+
const ComponentWithContainer: FC<TProps> = props => (
|
|
10
|
+
<WrappedComponent {...flattenValues(props, options)} {...props} />
|
|
11
|
+
);
|
|
12
|
+
ComponentWithContainer.displayName = `withFlattenParameters(${
|
|
13
|
+
WrappedComponent.displayName || WrappedComponent.name || 'Component'
|
|
14
|
+
})`;
|
|
15
|
+
|
|
16
|
+
return ComponentWithContainer;
|
|
17
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentType, FC } from 'react';
|
|
2
|
+
import { ComponentInstance } from '@uniformdev/canvas';
|
|
3
|
+
import { ComponentProps } from '@/types/cskTypes';
|
|
4
|
+
import { getSlotComponents } from '@/utils/getSlotComponents';
|
|
5
|
+
|
|
6
|
+
export const withSlotsDataValue = <TProps extends ComponentProps<T>, T>(
|
|
7
|
+
WrappedComponent: ComponentType<
|
|
8
|
+
TProps & {
|
|
9
|
+
slotData?: Record<string, ComponentInstance[]>;
|
|
10
|
+
}
|
|
11
|
+
>,
|
|
12
|
+
withSlotData?: string[]
|
|
13
|
+
): ComponentType<TProps> => {
|
|
14
|
+
const ComponentWithContainer: FC<TProps> = props => {
|
|
15
|
+
const slotData = withSlotData?.reduce<Record<string, ComponentInstance[]>>((acc, slotName) => {
|
|
16
|
+
const slot = props.slots[slotName];
|
|
17
|
+
if (slot) {
|
|
18
|
+
return {
|
|
19
|
+
...acc,
|
|
20
|
+
[slotName]: getSlotComponents(slot, props.context).filter(i => i !== null),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return acc;
|
|
24
|
+
}, {});
|
|
25
|
+
|
|
26
|
+
return <WrappedComponent {...props} slotData={slotData} />;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
ComponentWithContainer.displayName = `withSlotsDataValue(${
|
|
30
|
+
WrappedComponent.displayName || WrappedComponent.name || 'Component'
|
|
31
|
+
})`;
|
|
32
|
+
|
|
33
|
+
return ComponentWithContainer;
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as k}from"./chunk-VWWXSA5H.mjs";import{b as m}from"./chunk-QPQGRQKI.mjs";import"./chunk-S7CSCIW4.mjs";import{a as x}from"./chunk-OKUDTS22.mjs";import"./chunk-27WJUZYR.mjs";import{useCallback as g,useEffect as M,useState as O}from"react";import u from"js-cookie";import{UniformSlot as W,UniformText as w}from"@uniformdev/next-app-router/component";import{useCallback as V,useMemo as j}from"react";import{useUniformContext as D}from"@uniformdev/next-app-router-client";var I=()=>{let{context:t}=D(),s=j(()=>t?.storage?.data?.consent,[t?.storage?.data?.consent]),a=V(r=>t?.storage.updateData([{type:"consent",data:r}]),[t?.storage]);return{consent:s,updateConsent:a}},B=I;import{jsx as o,jsxs as h}from"react/jsx-runtime";var c="hasAcceptedCookies",_=({backgroundColor:t,spacing:s,border:a,fluidContent:r,allowTextColor:b,allowButtonColor:P,allowButtonHoverColor:v,declineTextColor:y,declineButtonColor:N,declineButtonHoverColor:S,slots:T,variant:z,parameters:f,component:C,context:A})=>{let[E,n]=O(!1),{consent:l,updateConsent:e}=B(),{defaultConsent:p}=A?.pageState||{};M(()=>{let d=u.get(c),i=d===void 0?void 0:d==="true";if(i===void 0){p||(n(!0),l&&e(!1));return}l!==i&&e(i)},[p,l,e,n]);let F=g(()=>{e(!0),u.set(c,"true"),n(!1)},[e]),U=g(()=>{e(!1),u.set(c,"false"),n(!1)},[e]);return E?o(k,{backgroundColor:t,spacing:s,border:a,fluidContent:r,floating:!0,variant:z,children:h("div",{className:"flex flex-col gap-x-6 md:flex-row p-5 xs:p-10 items-center justify-between w-full",children:[o(W,{slot:T.cookieConsentContent}),h("div",{className:"flex justify-between gap-2 flex-col sm:flex-row md:flex-col lg:flex-row shrink-0 md:justify-start w-full md:w-auto md:space-x-0 md:space-y-2 lg:space-y-0 lg:space-x-3 mt-4 md:mt-0",children:[o(m,{className:"w-full cursor-pointer",size:"button-medium",textSize:"sm",textWeight:"normal",buttonColor:P,textColor:b,hoverButtonColor:v,onClick:F,children:o(w,{placeholder:"allowButtonText",parameter:f.allowButtonText,component:C})}),o(m,{className:"w-full cursor-pointer",size:"button-medium",textSize:"sm",textWeight:"normal",buttonColor:N,textColor:y,hoverButtonColor:S,onClick:U,children:o(w,{placeholder:"declineButtonText",parameter:f.declineButtonText,component:C})})]})]})}):null},te=x(_);export{te as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import"./chunk-YQYDZJ65.mjs";import{a as d,c as a}from"./chunk-S7CSCIW4.mjs";import{a as N}from"./chunk-OKUDTS22.mjs";import"./chunk-LPAOEOU4.mjs";import{useState as T,useEffect as y,useMemo as h}from"react";import{UniformSlot as H}from"@uniformdev/next-app-router/component";var S=({variant:e,backgroundColor:n,border:o,size:t})=>a("flex w-fit p-4 text-center gap-2 items-end leading-none",{"flex-col":e==="labelsUnder",[`bg-${n}`]:!!n,[d(o,"{value}")]:o,"items-center":o,[d(t,"text-{value}")]:!!t,[d(o,"{value}")]:!!o}),_=({textColor:e})=>a("flex gap-5 flex-wrap flex-col sm:flex-row",{[`text-${e}`]:e});import{jsx as u}from"react/jsx-runtime";var c=e=>{let n=new Date(e?.datetime??0).getTime(),o=new Date().getTime(),t=Math.max(Math.floor((n-o)/1e3),0),i=Math.floor(t%60),r=Math.floor(t/60%60),f=Math.floor(t/3600%24);return{days:Math.floor(t/86400),hours:f,minutes:r,seconds:i,timeDifference:t}},x=({maxUnitsCount:e,currentTime:n,unit:o,isAlignEnd:t})=>u("div",{className:"relative mx-auto h-[1.25em] w-[1.75em] overflow-hidden",children:u("div",{className:"absolute transition-transform duration-500 ease-in-out",style:{transform:`translateY(-${n*1.25}em)`},children:Array.from({length:e+1},(i,r)=>u("div",{className:a("flex h-[1.25em] w-[1.75em] justify-center",{"items-end":t,"items-center":!t}),children:r<10?`0${r}`:r},`${o}-${r}`))})});import{jsx as m,jsxs as R}from"react/jsx-runtime";var P=["days","hours","minutes","seconds"],g=({targetDate:e,backgroundColor:n,textColor:o,border:t,size:i,slots:r,variant:f})=>{let[{timeDifference:l,...C},I]=T(c(e)),v=h(()=>{let{days:s}=c(e);return{seconds:59,minutes:59,hours:23,days:s}},[e]);return y(()=>{if(l>0){let s=setInterval(()=>{I(c(e))},1e3);return()=>clearInterval(s)}},[e,l]),m("div",{children:l?m("div",{className:_({textColor:o}),children:P.map(s=>{if(C[s]===0&&s==="days")return null;let U=C[s];return R("div",{className:S({variant:f,backgroundColor:n,border:t,size:i}),children:[m("div",{className:"mx-auto",children:x({maxUnitsCount:v[s],currentTime:U,unit:s,isAlignEnd:!t})}),m("div",{className:"mx-auto",style:{fontSize:"0.5em"},children:s})]},s)})}):m(H,{slot:r.countdownComplete})})},ee=N(g);export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as G}from"./chunk-BK7UG4U4.mjs";import{a as C}from"./chunk-7GVG4HLE.mjs";import{c as d}from"./chunk-S7CSCIW4.mjs";import{a as g}from"./chunk-OKUDTS22.mjs";import h from"react-responsive-masonry";import{Fragment as P,jsx as y}from"react/jsx-runtime";var u={firstLineCount:2,secondLineCount:3,otherLinesCount:4},I=({slot:r,aspectRatio:n,config:i})=>{let{firstLineCount:l=u.firstLineCount,secondLineCount:m=u.secondLineCount,otherLinesCount:s=u.otherLinesCount}=i||{},{items:p=[]}=r||{},f=p.reduce((e,o,t)=>(t<l?e[0]?.push(o?.component):t<l+m?e[1]?.push(o?.component):e[2]?.push(o?.component),e),[[],[],[]])||[];return y(P,{children:f?.map((e,o)=>e.length?y(h,{columnsCount:o<2||e.length<s?e.length:s,gutter:"4px",children:e.map((t,c)=>y("div",{className:d("flex flex-1 items-center justify-center",{[`aspect-${n}`]:!!n}),children:t},`img-${c}`))},`line-${o}`):null)})};import{jsx as a}from"react/jsx-runtime";var L=({slots:r,backgroundColor:n,spacing:i,border:l,fluidContent:m,height:s,aspectRatio:p,config:f,items:e})=>{let o={...r.imageGalleryItems,items:e?.length?e.map((t,c)=>({_id:`image-${c}-${t?.id}`,component:a(G,{src:t.url,alt:t.title||"",style:{objectFit:"cover"},fill:!0}),variantId:void 0,$pzCrit:void 0})):r.imageGalleryItems?.items||[]};return a(C,{backgroundColor:n,spacing:i,border:l,fluidContent:m,height:s,children:a("div",{className:"flex flex-col gap-1",children:a(I,{slot:o,aspectRatio:p,config:f})})})},_=g(L);export{_ as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ViewPort } from './types/cskTypes.mjs';
|
|
3
|
+
|
|
4
|
+
type TextProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
size?: string | ViewPort<string>;
|
|
7
|
+
color?: string;
|
|
8
|
+
weight?: string;
|
|
9
|
+
font?: string;
|
|
10
|
+
transform?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
11
|
+
decoration?: 'underline' | 'overline' | 'line-through' | 'no-underline';
|
|
12
|
+
letterSpacing?: string;
|
|
13
|
+
children: ReactElement | string;
|
|
14
|
+
alignment?: 'left' | 'center' | 'right';
|
|
15
|
+
lineCountRestrictions?: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type { TextProps as T };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, PropsWithChildren, ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { SpaceType, ViewPort } from './types/cskTypes.mjs';
|
|
4
|
+
import { T as TextProps } from './index-CrBZatTs.mjs';
|
|
5
|
+
|
|
6
|
+
type ContainerProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
9
|
+
border?: string | ViewPort<string>;
|
|
10
|
+
fluidContent?: boolean;
|
|
11
|
+
height?: string | ViewPort<string>;
|
|
12
|
+
wrapperClassName?: string;
|
|
13
|
+
maxWidth?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
declare enum ContentAlignment {
|
|
17
|
+
Left = "left",
|
|
18
|
+
Center = "center",
|
|
19
|
+
Right = "right"
|
|
20
|
+
}
|
|
21
|
+
declare enum BannerVariants {
|
|
22
|
+
None = "",
|
|
23
|
+
Top = "top",
|
|
24
|
+
Bottom = "bottom"
|
|
25
|
+
}
|
|
26
|
+
type BannerProps = ContainerProps & {
|
|
27
|
+
iconColor?: string;
|
|
28
|
+
contentAlignment?: ContentAlignment;
|
|
29
|
+
floating?: boolean;
|
|
30
|
+
variant?: BannerVariants;
|
|
31
|
+
};
|
|
32
|
+
declare const _default: react.ComponentType<BannerProps>;
|
|
33
|
+
|
|
34
|
+
declare enum ButtonVariant {
|
|
35
|
+
Link = "link"
|
|
36
|
+
}
|
|
37
|
+
type ButtonProps = PropsWithChildren<{
|
|
38
|
+
variant?: ButtonVariant;
|
|
39
|
+
href?: string;
|
|
40
|
+
border?: string | ViewPort<string>;
|
|
41
|
+
size?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
textColor?: string;
|
|
44
|
+
textSize?: string | ViewPort<string>;
|
|
45
|
+
textWeight?: string;
|
|
46
|
+
textFont?: 'uppercase' | 'lowercase' | 'capitalize' | 'normal-case';
|
|
47
|
+
textTransform?: string;
|
|
48
|
+
buttonColor?: string;
|
|
49
|
+
isActive?: boolean;
|
|
50
|
+
onClick?: () => void;
|
|
51
|
+
icon?: ReactNode;
|
|
52
|
+
iconPosition?: 'left' | 'right';
|
|
53
|
+
hoverButtonColor?: string;
|
|
54
|
+
hoverTextColor?: string;
|
|
55
|
+
}>;
|
|
56
|
+
|
|
57
|
+
type FooterProps = Omit<ContainerProps, 'height' | 'content'> & {
|
|
58
|
+
logo?: ReactNode;
|
|
59
|
+
copyright?: ReactNode;
|
|
60
|
+
content?: ReactNode;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type HeaderProps = PropsWithChildren & Omit<ContainerProps, 'fluidContent' | 'height'> & {
|
|
64
|
+
leftSection?: ReactNode;
|
|
65
|
+
rightSection?: ReactNode;
|
|
66
|
+
color?: string;
|
|
67
|
+
sticky?: boolean;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type IconLabelProps = {
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
children: ReactElement | string;
|
|
73
|
+
textClassName?: string;
|
|
74
|
+
iconClassName?: string;
|
|
75
|
+
className?: string;
|
|
76
|
+
text?: string;
|
|
77
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
78
|
+
size?: TextProps['size'];
|
|
79
|
+
color?: string;
|
|
80
|
+
weight?: TextProps['weight'];
|
|
81
|
+
font?: string;
|
|
82
|
+
alignment?: TextProps['alignment'];
|
|
83
|
+
transform?: TextProps['transform'];
|
|
84
|
+
decoration?: TextProps['decoration'];
|
|
85
|
+
letterSpacing?: TextProps['letterSpacing'];
|
|
86
|
+
iconPosition?: 'left' | 'right';
|
|
87
|
+
lineCountRestrictions?: string;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { type ButtonProps as B, type ContainerProps as C, type FooterProps as F, type HeaderProps as H, type IconLabelProps as I, _default as _, type BannerProps as a, ButtonVariant as b, ContentAlignment as c };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as w,b as y,c as x,d as E,e as F,f as S,g as P,h as R,i as $,j as I,k as _}from"./chunk-Y337A266.mjs";import{program as V}from"commander";import g from"path";import*as b from"ora";import{dirname as N}from"path";import{fileURLToPath as ee}from"url";import{checkbox as te}from"@inquirer/prompts";import U from"fs";var q=(r,t)=>U.readdirSync(r,{withFileTypes:!0}).filter(e=>t==="folder"?e.isDirectory():e.isFile()).map(e=>e.name),T=r=>q(r,"folder");import f from"fs";import a from"path";import{confirm as z}from"@inquirer/prompts";var K=async r=>{f.existsSync(r)||await f.promises.mkdir(r,{recursive:!0})};var O=r=>{let t=y.find(o=>f.existsSync(r+o));if(t)return r+t;let e=y.find(o=>f.existsSync(a.join(r,`index${o}`)));if(e)return a.join(r,`index${e}`)},Q=r=>{let e=f.readFileSync(r,"utf8").match(w)?.map(n=>n.replace(/['"]/g,"")),o=e?.filter(n=>n.startsWith("@/")).map(n=>n.replace("@/","")),s=e?.filter(n=>!n.startsWith("@/")).map(n=>n);return{aliases:o,relativePaths:s}},h=async(r,t,e)=>{e.add(r);let{aliases:o=[],relativePaths:s=[]}=Q(r);if(o.length)for(let n of o){let i=O(a.join(t,n));i&&!e.has(i)&&await h(i,t,e)}if(s.length)for(let n of s){let i=O(a.join(a.dirname(r),n));i&&!e.has(i)&&await h(i,t,e)}},j=5,A=async(r,t,e,o,s)=>{try{let n=new Set;s?.start("Searching for all canvas components and their dependencies...");for(let c of e){let l=a.join(r,c),d=f.readdirSync(l,{withFileTypes:!0}).filter(m=>m.isFile()&&x.includes(m.name));for(let m of d)await h(a.join(m?.path||m.parentPath,m.name),o,n)}let i=Array.from(n),p=i.filter(c=>{let l=a.join(t,a.relative(o,c));return f.existsSync(l)&&f.readFileSync(l,"utf8")!==f.readFileSync(c,"utf8")}),u=await(async()=>{if(!p.length)return!0;s?.stop();let c=p.slice(0,j).map(d=>a.relative(process.cwd(),a.join(t,a.relative(o,d)))).join(`
|
|
2
2
|
`),l=p.length>j?`
|
|
3
3
|
...`:"";return z({message:`Found ${p.length} files that will be overridden:
|
|
4
4
|
${c}${l}
|
|
5
|
-
Do you want to override them?`})})()?i:i.filter(c=>!p.includes(c));s?.start("Extracting canvas components and their dependencies...");for(let c of u){let l=a.join(t,a.relative(o,c));await K(a.dirname(l)),await f.promises.copyFile(c,l)}}catch(n){throw s?.stop(),n}};import v from"
|
|
6
|
-
${t}`)),Z=(r,t,e,o)=>r.replace(E,s=>{let n=new RegExp(S(t));if(n.test(s))return o?.info(`Registration key already in use. Overriding with ${e}.`),s.replace(n,`${t}:
|
|
5
|
+
Do you want to override them?`})})()?i:i.filter(c=>!p.includes(c));s?.start("Extracting canvas components and their dependencies...");for(let c of u){let l=a.join(t,a.relative(o,c));await K(a.dirname(l)),await f.promises.copyFile(c,l)}}catch(n){throw s?.stop(),n}};import v from"fs";import G from"path";import{exec as Y}from"child_process";import B from"prettier";var W=async r=>new Promise((t,e)=>{Y(r,(o,s,n)=>{if(o){e(o.message);return}if(n){e(n);return}t(s)})}),k=(r,t)=>B.format(r,{parser:"typescript",printWidth:120,singleQuote:!0,semi:!0,trailingComma:"es5",tabWidth:2,arrowParens:"avoid",endOfLine:"auto",...t});var D={DemoHero:(r,t)=>[{componentName:"DemoHero.FlexibleHero",importSection:t,componentId:"flexibleHero"},{componentName:"DemoHero.FixedHero",importSection:t,componentId:"fixedHero"}]},L=r=>r.reduce((t,e)=>{let o=`import ${e} from './${e}';`;if(D[e])return[...t,...D[e](e,o)];let s=_[e];return[...t,{componentName:e,importSection:o,componentId:s}]},[]);var J=(r,t,e,o)=>r.replace(F,s=>r.includes(t)?(o?.info(`Import for this component already exists. Skipping for ${e}.`),s):(o?.info(`Import for ${e} added successfully.`),`${s}
|
|
6
|
+
${t}`)),Z=(r,t,e,o)=>r.replace(E,s=>{let n=new RegExp(S(t));if(n.test(s))return o?.info(`Registration key already in use. Overriding with ${e}.`),s.replace(n,`${t}: ${e},`);o?.info(`Registration for ${e} added to the resolver.`);let i=`${t}: ${e},`;return s.replace(P,`${i}}`)}),H=async(r,t,e)=>{try{let o=G.join(r,"components","canvas","index.ts");if(!v.existsSync(o)){e?.fail("Canvas resolver file not found. Please check the main canvas resolver before running to ensure that extracted components are properly added.");return}let s=await v.promises.readFile(o,"utf-8"),n=s===R?$:s,p=L(t).reduce((c,{componentName:l,importSection:d,componentId:m})=>Z(J(c,d,l,e),m,l,e),n),C=await k(p);await v.promises.writeFile(o,C);let u=G.relative(process.cwd(),o);await W(`npx eslint ${u} --fix`).catch(()=>e?.fail("Could not format your resolver file using your lint configuration. Please check it before running.")),e?.succeed(`Canvas components successfully registered in ${o}`)}catch(o){throw e?.stop(),o}};var re=ee(import.meta.url),oe=N(re),X=g.resolve(oe,"content"),M=async r=>{try{let t=b.default(),e=g.resolve(X,"components","canvas"),o=T(e);if(r.some(n=>{let i=o.includes(n);return i||console.error("Invalid component name:",n),!i}))return;if(t.info("Welcome to Uniform Extractor"),r.length)t.info("Canvas components to extract:"),t.info(`${r.join(", ")};`);else{let n=await te({message:"Select the canvas components to extract:",choices:o.map((i,p)=>({value:p,name:i})),loop:!1,instructions:!0,required:!0});r=o.filter((i,p)=>n.includes(p))}t.start("Extracting canvas components and their dependencies..."),await A(g.resolve(e),g.resolve(process.cwd(),"src"),r,X,t),t.succeed("Canvas components and their dependencies successfully extracted"),t?.start("Starting registration...");let s=g.resolve(process.cwd(),"src");await H(s,r,t);return}catch(t){t instanceof Error&&(t.message.includes("force closed")?console.info(`
|
|
7
7
|
\u{1F44B} See you next time! \u{1F9E1}
|
|
8
8
|
`):console.error(`
|
|
9
9
|
\u{1F641} Something went wrong. Please try again.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as u,b as s}from"./chunk-NKINOJY6.mjs";import{a as o}from"./chunk-7GVG4HLE.mjs";import{c as n}from"./chunk-S7CSCIW4.mjs";import{useState as C}from"react";import{jsx as e,jsxs as l}from"react/jsx-runtime";var B=({isOpen:t,onClick:i,color:a})=>e("button",{onClick:i,"aria-label":"Menu",className:n("w-7 h-7 relative focus:outline-none"),children:l("div",{className:"absolute left-1/2 top-1/2 block w-7 -translate-x-1/2 -translate-y-1/2",children:[e("span",{"aria-hidden":"true",className:n("block absolute h-0.5 w-7 transform transition duration-500 ease-in-out",{"rotate-45":t," -translate-y-2":!t,[`bg-${a}`]:!!a})}),e("span",{"aria-hidden":"true",className:n("block absolute h-0.5 w-7 transform transition duration-500 ease-in-out",{"opacity-0":t,[`bg-${a}`]:!!a})}),e("span",{"aria-hidden":"true",className:n("block absolute h-0.5 w-7 transform transition duration-500 ease-in-out",{"-rotate-45":t," translate-y-2":!t,[`bg-${a}`]:!!a})})]})}),G=({leftSection:t,rightSection:i,children:a,backgroundColor:m,spacing:c,border:d,className:p,color:f})=>{let[r,b]=C(!1);return l("nav",{children:[e(o,{id:"mobile-header",fluidContent:!0,backgroundColor:m,spacing:c,border:d,className:p,children:l(u,{className:"items-center",columnsCount:"12",children:[e(s,{columnSpan:"span-2",children:e(B,{isOpen:r,onClick:()=>{b(v=>!v)},color:f})}),e(s,{columnSpan:"span-6",children:e("div",{className:"flex items-center justify-start",children:t})}),e(s,{columnSpan:"span-4",children:e("div",{className:"flex items-center justify-end gap-x-4",children:i})})]})}),e(o,{fluidContent:!0,className:n({"min-h-screen":r}),backgroundColor:m,children:r&&e("div",{className:"size-full py-8",children:e("div",{className:"flex flex-col items-center justify-center gap-y-8",children:a})})})]})};export{G as MobileHeader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as m}from"./chunk-AWTML4I7.mjs";import{a}from"./chunk-OKUDTS22.mjs";import{UniformSlot as r}from"@uniformdev/next-app-router/component";import{jsx as t}from"react/jsx-runtime";var d=({slots:o,maxWidth:e,backgroundColor:l,closeIconColor:i,disableCloseModalOnClickOutside:n})=>t(m,{maxWidth:e,backgroundColor:l,closeIconColor:i,disableCloseModalOnClickOutside:n,trigger:t(r,{slot:o.trigger}),content:t(r,{slot:o.modalContent}),actions:o?.modalActions?.items?.length&&t(r,{slot:o.modalActions})}),M=a(d);export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as g}from"./chunk-AWTML4I7.mjs";import{c as s}from"./chunk-S7CSCIW4.mjs";import{useCallback as m,useState as B,useRef as L,useEffect as k}from"react";import{jsx as v}from"react/jsx-runtime";var h=({className:o,...l})=>v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:s("size-8",o),...l,children:v("path",{d:"m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z"})});var P=({showModal:o})=>s("fixed left-0 top-0 size-full",{hidden:!o,block:o}),M=({maxWidth:o,backgroundColor:l})=>s("rounded-lg shadow-lg relative",g[o||"small"],{[`bg-${l}`]:!!l}),b=({disableCloseModalOnClickOutside:o})=>s("group absolute right-4 top-4 opacity-40 hover:opacity-100",{hidden:o});import{jsx as e,jsxs as x}from"react/jsx-runtime";var O=({trigger:o,content:l,actions:p,maxWidth:E,backgroundColor:F,closeIconColor:f,disableCloseModalOnClickOutside:a,onChangeModalState:i,className:w})=>{let n=L(null),[r,c]=B(!1);k(()=>{i&&i(r)},[r,i]);let N=m(()=>{a||c(!1)},[a]),u=m(()=>{c(t=>!t)},[]),y=m(t=>{t.stopPropagation()},[]);return k(()=>{if(!n.current)return;let t=n.current.querySelectorAll("button, a"),C=()=>c(!1);return t.forEach(d=>{d.addEventListener("click",C)}),()=>t.forEach(d=>{d.removeEventListener("click",C)})},[]),x("div",{children:[e("div",{onClick:u,children:o}),e("div",{className:P({showModal:r}),children:e("dialog",{open:r,onClick:N,"aria-label":"Close modal","aria-modal":"true",className:"flex size-full items-center justify-center bg-black/50 px-4",children:x("form",{method:"dialog",className:s(M({maxWidth:E,backgroundColor:F}),w),onClick:y,children:[e("button",{onClick:u,className:b({disableCloseModalOnClickOutside:a}),children:e(h,{className:s({[`fill-${f}`]:f})})}),e("div",{className:"p-6 md:p-8",children:l}),p&&e("div",{ref:n,className:"border-t p-6 md:p-8",children:p})]})})})]})};export{O as Modal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as k}from"./chunk-6CKVLOIH.mjs";import{a as x}from"./chunk-6TUDWIYU.mjs";import{a as b,b as g}from"./chunk-NKINOJY6.mjs";import{a as h}from"./chunk-BK7UG4U4.mjs";import"./chunk-7GVG4HLE.mjs";import"./chunk-WAW7PQYM.mjs";import{a as m,c as o}from"./chunk-S7CSCIW4.mjs";import{a as P}from"./chunk-OKUDTS22.mjs";import{useCallback as L,useMemo as j,useState as tt}from"react";import{UniformText as ot}from"@uniformdev/next-app-router/component";import{UniformSlot as w}from"@uniformdev/next-app-router/component";import{jsx as r,jsxs as K}from"react/jsx-runtime";var I=({isOpen:t,backgroundColor:a,slots:e,border:s,hasRightContent:i})=>r("div",{className:o("absolute z-10 w-max left-1/2 -translate-x-1/2 pt-4",{hidden:!t,block:t,"w-full md:w-[460px]":!i,"w-full md:w-[460px] xl:w-[768px]":i}),children:r("div",{className:o("p-8",{[`bg-${a}`]:!!a,[m(s,"{value}")]:s}),children:K(b,{columnsCount:"2",gapX:"4",children:[r(g,{children:r("div",{className:"flex flex-col gap-y-4",children:r(w,{slot:e.navigationFlyoutLeftContent})})}),r(g,{children:r(w,{slot:e.navigationFlyoutRightContent})})]})})});import{useEffect as Q,useState as Y}from"react";import{UniformSlot as B}from"@uniformdev/next-app-router/component";import{jsx as p,jsxs as R}from"react/jsx-runtime";var Z=()=>{let[t,a]=Y(0);return Q(()=>{let e=document.getElementById("mobile-header");e&&a(e.offsetHeight)},[]),t},H=({isOpen:t,backgroundColor:a,slots:e,onClose:s})=>{let i=Z();return R("div",{style:{top:i},className:o("fixed left-0 right-0 bottom-0 z-10 w-full pt-4",{[`bg-${a}`]:!!a,hidden:!t,block:t}),children:[p("button",{onClick:s,className:"w-max rotate-180 px-4",children:p(x,{})}),R("div",{className:"flex flex-col items-center justify-center gap-y-8 p-4",children:[p(B,{slot:e.navigationFlyoutLeftContent}),p(B,{slot:e.navigationFlyoutRightContent})]})]})};var M=({isOpen:t})=>o("transition transform hidden md:block",{"rotate-180":t,"rotate-0":!t}),G=({color:t})=>o("flex items-center gap-x-2",{[`text-${t}`]:!!t});import{jsx as n,jsxs as O}from"react/jsx-runtime";var et=({icon:t,caretIcon:a,backgroundColor:e,border:s,size:i,tag:D,color:v,weight:S,font:U,transform:$,decoration:A,letterSpacing:T,alignment:W,component:c,context:d,slots:l,hoverEffect:f="",className:E,parameters:V})=>{let[u,C]=tt(!1),_=L(()=>C(!0),[]),y=L(()=>C(!1),[]),z=j(()=>!!l?.navigationFlyoutRightContent?.items?.filter(J=>!J?._id.startsWith("placeholder_"))?.length,[l]),N=o("transition-all duration-150",{[m(f,"group-hover:{value}")]:!!f}),[X]=a||[],{url:F,title:q=""}=X||{};return O("div",{className:"relative",onMouseLeave:y,children:[O("button",{onMouseEnter:_,className:G({color:v}),children:[n(k,{icon:t,className:o("group",E),iconClassName:N,textClassName:N,size:i,tag:D,color:v,weight:S,font:U,transform:$,decoration:A,letterSpacing:T,alignment:W,children:n(ot,{placeholder:"Text goes here",parameter:V.text,component:c})}),F&&n("div",{className:o("relative size-[1em]",M({isOpen:u}),{[`text-${i}`]:!!i}),children:n(h,{src:F,alt:q,fill:!0})})]}),n("div",{className:"hidden md:block",children:n(I,{hasRightContent:z,isOpen:u,backgroundColor:e,context:d,slots:l,border:s,component:c})}),n("div",{className:"block md:hidden",children:n(H,{onClose:y,isOpen:u,backgroundColor:e,context:d,slots:l,border:s,component:c})})]})},Ht=P(et);export{Ht as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as x}from"./chunk-6CKVLOIH.mjs";import{a as h}from"./chunk-6TUDWIYU.mjs";import{a as b}from"./chunk-BK7UG4U4.mjs";import"./chunk-WAW7PQYM.mjs";import{a as n,c as t}from"./chunk-S7CSCIW4.mjs";import{a as G}from"./chunk-OKUDTS22.mjs";import{useCallback as I,useState as Q}from"react";import{UniformText as X}from"@uniformdev/next-app-router/component";import{UniformSlot as V}from"@uniformdev/next-app-router/component";import{jsx as p}from"react/jsx-runtime";var k=({isOpen:o,backgroundColor:e,slots:a,border:i})=>p("div",{className:t("absolute left-0 max-w-64 z-10 pt-4",{hidden:!o,block:o}),children:p("div",{className:t({[`bg-${e}`]:!!e,[n(i,"{value}")]:i}),children:p("div",{className:"flex flex-col gap-y-4 p-4",children:p(V,{slot:a.links})})})});import{useEffect as W,useState as z}from"react";import{UniformSlot as q}from"@uniformdev/next-app-router/component";import{jsx as l,jsxs as K}from"react/jsx-runtime";var J=()=>{let[o,e]=z(0);return W(()=>{let a=document.getElementById("mobile-header");a&&e(a.offsetHeight)},[]),o},y=({isOpen:o,backgroundColor:e,slots:a,onClose:i})=>{let s=J();return K("div",{style:{top:s},className:t("fixed left-0 right-0 bottom-0 z-10 w-full pt-4",{[`bg-${e}`]:!!e,hidden:!o,block:o}),children:[l("button",{onClick:i,className:"w-max rotate-180 px-4",children:l(h,{})}),l("div",{className:"flex flex-col items-center gap-y-4 p-4",children:l(q,{slot:a.links})})]})};var F=({isOpen:o})=>t("transition transform hidden md:block",{"rotate-180":o,"rotate-0":!o}),B=({color:o})=>t("flex items-center gap-x-2",{[`text-${o}`]:!!o});import{jsx as r,jsxs as w}from"react/jsx-runtime";var Y=({icon:o,caretIcon:e,backgroundColor:a,border:i,size:s,tag:H,color:c,weight:M,font:O,transform:D,decoration:R,letterSpacing:S,alignment:U,component:$,context:u,slots:v,hoverEffect:d="",className:A,parameters:L})=>{let[m,g]=Q(!1),f=I(()=>g(!0),[]),N=I(()=>g(!1),[]),C=t("transition-all duration-150",{[n(d,"group-hover:{value}")]:!!d}),[T]=e||[],{url:P,title:E=""}=T||{};return w("div",{className:"relative",onMouseLeave:N,children:[w("button",{onMouseEnter:f,onClick:f,className:B({color:c}),children:[r(x,{icon:o,className:t("group",A),iconClassName:C,textClassName:C,size:s,tag:H,color:c,weight:M,font:O,transform:D,decoration:R,letterSpacing:S,alignment:U,children:r(X,{placeholder:"Text goes here",parameter:L.text,component:$})}),P&&r("div",{className:t("relative size-[1em]",F({isOpen:m}),{[`text-${s}`]:!!s}),children:r(b,{src:P,alt:E,fill:!0})})]}),r("div",{className:"hidden md:block",children:r(k,{isOpen:m,backgroundColor:a,context:u,slots:v,border:i})}),r("div",{className:"block md:hidden",children:r(y,{onClose:N,isOpen:m,backgroundColor:a,context:u,slots:v})})]})},xo=G(Y);export{xo as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SpaceType, ViewPort } from './types/cskTypes.mjs';
|
|
2
|
+
import { T as TextProps } from './index-CrBZatTs.mjs';
|
|
3
|
+
|
|
4
|
+
type HeightType = 'full' | 'screen' | 'svh' | 'lvh' | 'dvh' | 'min' | 'max' | 'fit';
|
|
5
|
+
type ContainerParameters = {
|
|
6
|
+
displayName?: string;
|
|
7
|
+
anchor?: string;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
spacing?: SpaceType | ViewPort<SpaceType>;
|
|
10
|
+
border?: string | ViewPort<string>;
|
|
11
|
+
fluidContent?: boolean;
|
|
12
|
+
height?: HeightType | ViewPort<HeightType>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type TextParameters = {
|
|
16
|
+
text?: string;
|
|
17
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
18
|
+
size?: TextProps['size'];
|
|
19
|
+
color?: string;
|
|
20
|
+
weight?: TextProps['weight'];
|
|
21
|
+
font?: string;
|
|
22
|
+
alignment?: TextProps['alignment'];
|
|
23
|
+
transform?: TextProps['transform'];
|
|
24
|
+
decoration?: TextProps['decoration'];
|
|
25
|
+
letterSpacing?: TextProps['letterSpacing'];
|
|
26
|
+
lineCountRestrictions?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type { ContainerParameters as C, TextParameters as T };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{b as d,c as T}from"./chunk-OY6ZJNCE.mjs";import{a as c}from"./chunk-7GVG4HLE.mjs";import"./chunk-S7CSCIW4.mjs";import{Fragment as E,useCallback as p,useState as P}from"react";import{flattenValues as A}from"@uniformdev/canvas";import{UniformSlot as B,UniformText as F}from"@uniformdev/next-app-router/component";import{jsx as o,jsxs as R}from"react/jsx-runtime";var u="text",k="text",Y=({slots:C,color:a,backgroundColor:g,spacing:b,border:f,fluidContent:_,height:x,variant:n,slotData:v,context:s})=>{let i=v?.tabItems?.map(t=>({...A(t),id:t?._id||""})),[m,r]=P(i?.[0]?.id||""),I=p(t=>{let e=t.target.id;r(e)},[]),M=p(t=>{let e=t.target.id;s.isContextualEditing&&r(e)},[s.isContextualEditing]);return R(c,{className:"flex flex-col gap-5",backgroundColor:g,spacing:b,border:f,fluidContent:_,height:x,children:[o("div",{className:d({color:a,variant:n}),children:i?.map(({id:t,[u]:e})=>o("button",{id:t,onClick:I,className:T({color:a,variant:n,isActiveTab:t===m}),children:o(F,{id:t,placeholder:"Text goes here",onFocus:M,parameter:{parameterId:u,type:k,value:e,_contextualEditing:{isEditable:!0}},component:{_id:t}})},t))}),o(B,{slot:C.tabItems,children:({child:t,_id:e,key:l})=>e===m?o(E,{children:t},l):o(E,{},l)})]})};export{Y as Tabs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{c as o}from"./chunk-S7CSCIW4.mjs";import{setCookie as h}from"cookies-next";import{useTheme as i}from"next-themes";import{jsx as C}from"react/jsx-runtime";var l=()=>C("svg",{width:"15",height:"15",viewBox:"0 0 15 15",className:"size-[1.2rem] fill-current",children:C("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fillRule:"evenodd",clipRule:"evenodd"})}),s=()=>C("svg",{width:"15",height:"15",viewBox:"0 0 15 15",className:"size-[1.2rem] fill-current",children:C("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fillRule:"evenodd",clipRule:"evenodd"})}),V=({iconColor:L,onChange:r})=>{let{setTheme:m,resolvedTheme:t}=i();return C("button",{"aria-label":"Theme selector",onClick:()=>{let e=t==="dark"?"light":"dark";m(e),h("theme",e),r?.(e)},className:o({[`text-${L}`]:!!L}),children:t==="dark"?C(s,{}):C(l,{})})};export{V as ThemeSwitcher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as t}from"./chunk-OKUDTS22.mjs";import m from"next/dynamic";import{useUniformContext as h}from"@uniformdev/next-app-router/component";import{jsx as s}from"react/jsx-runtime";var n=m(()=>import("./ThemeSwitcher-EUDUX3QI.mjs").then(e=>e.default),{ssr:!1}),i=({iconColor:e})=>{let{context:r}=h();return s(n,{iconColor:e,onChange:o=>{r?.update({quirks:{theme:o}})}})},T=t(i);export{i as ThemeSwitcher,T as default};
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as _uniformdev_next_app_router_component from '@uniformdev/next-app-router/component';
|
|
2
|
+
import { ComponentProps as ComponentProps$1, HTMLAttributes } from 'react';
|
|
3
|
+
import { AssetParamValueItem } from '@uniformdev/canvas';
|
|
4
|
+
import { UniformComposition } from '@uniformdev/next-app-router';
|
|
5
|
+
import { ComponentParameter } from '@uniformdev/next-app-router-shared';
|
|
3
6
|
|
|
4
|
-
type
|
|
5
|
-
|
|
6
|
-
component: ComponentInstance;
|
|
7
|
-
slotName: string;
|
|
8
|
-
slotIndex: number;
|
|
9
|
-
};
|
|
7
|
+
type ResolveEmptyPlaceholderFunction = NonNullable<ComponentProps$1<typeof UniformComposition>['resolveEmptyPlaceholder']>;
|
|
8
|
+
type ResolveEmptyPlaceholderOptions = Parameters<ResolveEmptyPlaceholderFunction>[0];
|
|
10
9
|
type ViewPort<T> = {
|
|
11
10
|
desktop?: T;
|
|
12
11
|
tablet?: T;
|
|
13
12
|
mobile?: T;
|
|
14
13
|
};
|
|
15
14
|
type SpaceType = Pick<NonNullable<HTMLAttributes<HTMLDivElement>['style']>, 'marginTop' | 'marginLeft' | 'paddingTop' | 'marginRight' | 'paddingLeft' | 'marginBottom' | 'paddingRight' | 'paddingBottom'>;
|
|
15
|
+
type ToComponentParameters<T> = {
|
|
16
|
+
[K in keyof T]: ComponentParameter<T[K]>;
|
|
17
|
+
};
|
|
18
|
+
type ComponentProps<T, S extends string = string> = _uniformdev_next_app_router_component.ComponentProps<ToComponentParameters<T>, S>;
|
|
19
|
+
type ValueOfField<F> = F extends {
|
|
20
|
+
value: infer V;
|
|
21
|
+
} ? V : never;
|
|
22
|
+
type FlattenFields<T extends AssetParamValueItem> = {
|
|
23
|
+
[K in keyof T['fields']]: ValueOfField<T['fields'][K]>;
|
|
24
|
+
};
|
|
25
|
+
type RenameKey<T, K extends keyof T, NewName extends PropertyKey> = Omit<T, K> & {
|
|
26
|
+
[P in NewName]: T[K];
|
|
27
|
+
};
|
|
28
|
+
type ResolvedAssetFromItem<T extends AssetParamValueItem> = RenameKey<FlattenFields<T>, 'id', 'file'> & {
|
|
29
|
+
id: T['_id'];
|
|
30
|
+
};
|
|
31
|
+
type ReplaceFieldsWithAssets<T, K extends keyof T> = Omit<T, K> & {
|
|
32
|
+
[P in K]?: ResolvedAssetFromItem<AssetParamValueItem>[];
|
|
33
|
+
};
|
|
16
34
|
|
|
17
|
-
export type { ResolveEmptyPlaceholderOptions, SpaceType, ViewPort };
|
|
35
|
+
export type { ComponentProps, ReplaceFieldsWithAssets, ResolveEmptyPlaceholderOptions, ResolvedAssetFromItem, SpaceType, ViewPort };
|
package/dist/utils/assets.d.mts
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
import { AssetParamValue } from '@uniformdev/assets';
|
|
1
|
+
import { AssetParamValue, AssetParamValueItem } from '@uniformdev/assets';
|
|
2
|
+
import { ResolvedAssetFromItem } from '../types/cskTypes.mjs';
|
|
3
|
+
import '@uniformdev/next-app-router/component';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '@uniformdev/canvas';
|
|
6
|
+
import '@uniformdev/next-app-router';
|
|
7
|
+
import '@uniformdev/next-app-router-shared';
|
|
2
8
|
|
|
3
|
-
type ResolvedAsset = {
|
|
4
|
-
id?: string;
|
|
5
|
-
url: string;
|
|
6
|
-
file?: string;
|
|
7
|
-
size?: number;
|
|
8
|
-
title?: string;
|
|
9
|
-
width?: number;
|
|
10
|
-
height?: number;
|
|
11
|
-
mediaType?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
focalPoint?: {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
9
|
/**
|
|
19
10
|
* Resolves a list of assets, filtering out any entries without a valid URL.
|
|
20
11
|
*
|
|
21
12
|
* @param {AssetParamValue | undefined} image - The list of assets to resolve.
|
|
22
13
|
* @returns {ResolvedAsset[]} - An array of resolved assets with valid URLs.
|
|
23
14
|
*/
|
|
24
|
-
declare const resolveAsset: (image?: AssetParamValue) =>
|
|
15
|
+
declare const resolveAsset: (image?: AssetParamValue) => ResolvedAssetFromItem<AssetParamValueItem>[];
|
|
25
16
|
|
|
26
17
|
export { resolveAsset };
|
package/dist/utils/assets.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-XYU3TGOU.mjs";export{a as resolveAsset};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ComponentInstance } from '@uniformdev/canvas';
|
|
3
|
-
import { ResolveComponentResult } from '@uniformdev/canvas-next-rsc/component';
|
|
1
|
+
import { ResolveComponentResult, ResolveComponentFunction } from '@uniformdev/next-app-router';
|
|
4
2
|
|
|
5
|
-
type ComponentMapping = Record<string, ResolveComponentResult>;
|
|
6
|
-
declare const createComponentResolver: (mappings: ComponentMapping) =>
|
|
7
|
-
component: ComponentInstance;
|
|
8
|
-
}) => ResolveComponentResult | {
|
|
9
|
-
component: ({ component }: _uniformdev_canvas_next_rsc_shared.ComponentProps) => React.JSX.Element | null;
|
|
10
|
-
};
|
|
3
|
+
type ComponentMapping = Record<string, ResolveComponentResult['component']>;
|
|
4
|
+
declare const createComponentResolver: (mappings: ComponentMapping) => ResolveComponentFunction;
|
|
11
5
|
|
|
12
6
|
export { type ComponentMapping, createComponentResolver as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-47YB4P2Q.mjs";import"../chunk-CZ4X5ZBK.mjs";import"../chunk-OKUDTS22.mjs";export{a as default};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ComponentType } from 'react';
|
|
3
|
-
import { ComponentProps } from '@uniformdev/
|
|
3
|
+
import { ComponentProps } from '@uniformdev/next-app-router/component';
|
|
4
4
|
import { ResolveEmptyPlaceholderOptions } from '../types/cskTypes.mjs';
|
|
5
5
|
import '@uniformdev/canvas';
|
|
6
|
+
import '@uniformdev/next-app-router';
|
|
7
|
+
import '@uniformdev/next-app-router-shared';
|
|
6
8
|
|
|
7
9
|
declare const DEFAULT_EMPTY_PLACEHOLDER: {
|
|
8
10
|
component: () => react_jsx_runtime.JSX.Element;
|
|
@@ -10,7 +12,7 @@ declare const DEFAULT_EMPTY_PLACEHOLDER: {
|
|
|
10
12
|
type EmptyPlaceholderMapping = Record<string, (props: ResolveEmptyPlaceholderOptions) => {
|
|
11
13
|
component: ComponentType<ComponentProps<any, any>> | null;
|
|
12
14
|
}>;
|
|
13
|
-
declare const createEmptyPlaceholderResolver: (mappings: EmptyPlaceholderMapping) => (
|
|
15
|
+
declare const createEmptyPlaceholderResolver: (mappings: EmptyPlaceholderMapping) => (props: ResolveEmptyPlaceholderOptions) => {
|
|
14
16
|
component: () => react_jsx_runtime.JSX.Element;
|
|
15
17
|
} | {
|
|
16
18
|
component: ComponentType<ComponentProps<any, any>> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-LPAOEOU4.mjs";export{a as DEFAULT_EMPTY_PLACEHOLDER,b as default};
|