@pixelated-tech/components 3.1.4
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 +231 -0
- package/dist/components/buzzwordbingo/buzzwordbingo.css +42 -0
- package/dist/components/buzzwordbingo/buzzwordbingo.js +35 -0
- package/dist/components/callout/callout.js +95 -0
- package/dist/components/callout/callout.scss +331 -0
- package/dist/components/carousel/carousel.css +178 -0
- package/dist/components/carousel/carousel.drag.js +203 -0
- package/dist/components/carousel/carousel.js +124 -0
- package/dist/components/cms/calendly.js +20 -0
- package/dist/components/cms/cloudinary.image.js +132 -0
- package/dist/components/cms/cloudinary.js +106 -0
- package/dist/components/cms/contentful.delivery.js +247 -0
- package/dist/components/cms/contentful.items.components.js +243 -0
- package/dist/components/cms/contentful.items.css +131 -0
- package/dist/components/cms/contentful.management.js +254 -0
- package/dist/components/cms/flickr.js +160 -0
- package/dist/components/cms/google.reviews.components.js +36 -0
- package/dist/components/cms/google.reviews.functions.js +26 -0
- package/dist/components/cms/gravatar.components.js +41 -0
- package/dist/components/cms/gravatar.functions.js +52 -0
- package/dist/components/cms/hubspot.components.js +45 -0
- package/dist/components/cms/hubspot.js +34 -0
- package/dist/components/cms/instagram.components.js +40 -0
- package/dist/components/cms/instagram.functions.js +67 -0
- package/dist/components/cms/wordpress.components.js +47 -0
- package/dist/components/cms/wordpress.css +55 -0
- package/dist/components/cms/wordpress.functions.js +49 -0
- package/dist/components/config/config.client.js +22 -0
- package/dist/components/config/config.example.js +70 -0
- package/dist/components/config/config.js +53 -0
- package/dist/components/config/config.server.js +11 -0
- package/dist/components/config/config.types.js +2 -0
- package/dist/components/general/css.js +60 -0
- package/dist/components/general/headers.css +16 -0
- package/dist/components/general/headers.js +27 -0
- package/dist/components/general/image.js +81 -0
- package/dist/components/general/layout.js +147 -0
- package/dist/components/general/layout.scss +47 -0
- package/dist/components/general/loading.js +36 -0
- package/dist/components/general/loading.scss +80 -0
- package/dist/components/general/microinteractions.css +229 -0
- package/dist/components/general/microinteractions.js +87 -0
- package/dist/components/general/modal.css +65 -0
- package/dist/components/general/modal.js +52 -0
- package/dist/components/general/table.css +73 -0
- package/dist/components/general/table.js +108 -0
- package/dist/components/linkedin/pixelated.linkedin.js +180 -0
- package/dist/components/linkedin/pixelated.linkedin1.js +102 -0
- package/dist/components/linkedin/pixelated.linkedin2.js +92 -0
- package/dist/components/markdown/markdown.css +12 -0
- package/dist/components/markdown/markdown.js +39 -0
- package/dist/components/menu/menu-accordion.css +198 -0
- package/dist/components/menu/menu-accordion.js +183 -0
- package/dist/components/menu/menu-expando.css +127 -0
- package/dist/components/menu/menu-expando.js +48 -0
- package/dist/components/menu/menu-simple.css +76 -0
- package/dist/components/menu/menu-simple.js +56 -0
- package/dist/components/nerdjoke/nerdjoke.css +69 -0
- package/dist/components/nerdjoke/nerdjoke.js +95 -0
- package/dist/components/pagebuilder/components/ComponentPropertiesForm.js +15 -0
- package/dist/components/pagebuilder/components/ComponentSelector.js +67 -0
- package/dist/components/pagebuilder/components/ComponentTree.js +95 -0
- package/dist/components/pagebuilder/components/PageBuilderUI.js +48 -0
- package/dist/components/pagebuilder/components/PageEngine.js +97 -0
- package/dist/components/pagebuilder/components/SaveLoadSection.js +168 -0
- package/dist/components/pagebuilder/components/pagebuilder.scss +123 -0
- package/dist/components/pagebuilder/form/form.css +101 -0
- package/dist/components/pagebuilder/form/form.js +455 -0
- package/dist/components/pagebuilder/form/form.submit.js +65 -0
- package/dist/components/pagebuilder/form/formcomponents.js +359 -0
- package/dist/components/pagebuilder/form/formvalidations.js +80 -0
- package/dist/components/pagebuilder/lib/componentGeneration.js +105 -0
- package/dist/components/pagebuilder/lib/componentMap.js +32 -0
- package/dist/components/pagebuilder/lib/componentMetadata.js +146 -0
- package/dist/components/pagebuilder/lib/pageStorageContentful.js +142 -0
- package/dist/components/pagebuilder/lib/pageStorageLocal.js +143 -0
- package/dist/components/pagebuilder/lib/pageStorageTypes.js +1 -0
- package/dist/components/pagebuilder/lib/propTypeIntrospection.js +177 -0
- package/dist/components/pagebuilder/lib/types.js +4 -0
- package/dist/components/pagebuilder/lib/usePageBuilder.js +234 -0
- package/dist/components/recipe/recipe.css +107 -0
- package/dist/components/recipe/recipe.js +161 -0
- package/dist/components/resume/resume.css +162 -0
- package/dist/components/resume/resume.js +195 -0
- package/dist/components/seo/404.css +25 -0
- package/dist/components/seo/404.js +32 -0
- package/dist/components/seo/googleanalytics.js +70 -0
- package/dist/components/seo/googlemap.js +15 -0
- package/dist/components/seo/googlesearch.css +30 -0
- package/dist/components/seo/googlesearch.js +37 -0
- package/dist/components/seo/metadata.js +156 -0
- package/dist/components/seo/sitemap.js +171 -0
- package/dist/components/shoppingcart/ebay.components.js +203 -0
- package/dist/components/shoppingcart/ebay.css +131 -0
- package/dist/components/shoppingcart/ebay.functions.js +240 -0
- package/dist/components/shoppingcart/paypal.js +169 -0
- package/dist/components/shoppingcart/shoppingcart.components.js +257 -0
- package/dist/components/shoppingcart/shoppingcart.css +122 -0
- package/dist/components/shoppingcart/shoppingcart.functions.js +324 -0
- package/dist/components/sidepanel/sidepanel.css +129 -0
- package/dist/components/sidepanel/sidepanel.js +54 -0
- package/dist/components/socialcard/socialcard.css +118 -0
- package/dist/components/socialcard/socialcard.js +317 -0
- package/dist/components/tiles/tiles.css +77 -0
- package/dist/components/tiles/tiles.js +38 -0
- package/dist/components/timeline/timeline.css +139 -0
- package/dist/components/timeline/timeline.js +28 -0
- package/dist/components/utilities/api.js +36 -0
- package/dist/components/utilities/functions.js +98 -0
- package/dist/components/yelp/yelp.js +50 -0
- package/dist/css/pixelated.font.scss +68 -0
- package/dist/css/pixelated.global.css +548 -0
- package/dist/css/pixelated.grid.scss +82 -0
- package/dist/data/404-data.json +104 -0
- package/dist/data/buzzwords.js +28 -0
- package/dist/data/form.json +370 -0
- package/dist/data/recipes.json +1917 -0
- package/dist/data/references.json +139 -0
- package/dist/data/requests.json +137 -0
- package/dist/data/resume.json +2577 -0
- package/dist/data/routes.json +184 -0
- package/dist/data/routes2.json +117 -0
- package/dist/data/shipping.to.json +422 -0
- package/dist/index.js +78 -0
- package/dist/index.server.js +35 -0
- package/dist/types/components/buzzwordbingo/buzzwordbingo.d.ts +26 -0
- package/dist/types/components/buzzwordbingo/buzzwordbingo.d.ts.map +1 -0
- package/dist/types/components/callout/callout.d.ts +53 -0
- package/dist/types/components/callout/callout.d.ts.map +1 -0
- package/dist/types/components/carousel/carousel.d.ts +28 -0
- package/dist/types/components/carousel/carousel.d.ts.map +1 -0
- package/dist/types/components/carousel/carousel.drag.d.ts +12 -0
- package/dist/types/components/carousel/carousel.drag.d.ts.map +1 -0
- package/dist/types/components/cms/calendly.d.ts +11 -0
- package/dist/types/components/cms/calendly.d.ts.map +1 -0
- package/dist/types/components/cms/cloudinary.d.ts +27 -0
- package/dist/types/components/cms/cloudinary.d.ts.map +1 -0
- package/dist/types/components/cms/cloudinary.image.d.ts +56 -0
- package/dist/types/components/cms/cloudinary.image.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.delivery.d.ts +149 -0
- package/dist/types/components/cms/contentful.delivery.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.items.components.d.ts +38 -0
- package/dist/types/components/cms/contentful.items.components.d.ts.map +1 -0
- package/dist/types/components/cms/contentful.management.d.ts +71 -0
- package/dist/types/components/cms/contentful.management.d.ts.map +1 -0
- package/dist/types/components/cms/flickr.d.ts +39 -0
- package/dist/types/components/cms/flickr.d.ts.map +1 -0
- package/dist/types/components/cms/google.reviews.components.d.ts +7 -0
- package/dist/types/components/cms/google.reviews.components.d.ts.map +1 -0
- package/dist/types/components/cms/google.reviews.functions.d.ts +25 -0
- package/dist/types/components/cms/google.reviews.functions.d.ts.map +1 -0
- package/dist/types/components/cms/gravatar.components.d.ts +26 -0
- package/dist/types/components/cms/gravatar.components.d.ts.map +1 -0
- package/dist/types/components/cms/gravatar.functions.d.ts +53 -0
- package/dist/types/components/cms/gravatar.functions.d.ts.map +1 -0
- package/dist/types/components/cms/hubspot.components.d.ts +15 -0
- package/dist/types/components/cms/hubspot.components.d.ts.map +1 -0
- package/dist/types/components/cms/hubspot.d.ts +18 -0
- package/dist/types/components/cms/hubspot.d.ts.map +1 -0
- package/dist/types/components/cms/instagram.components.d.ts +10 -0
- package/dist/types/components/cms/instagram.components.d.ts.map +1 -0
- package/dist/types/components/cms/instagram.functions.d.ts +63 -0
- package/dist/types/components/cms/instagram.functions.d.ts.map +1 -0
- package/dist/types/components/cms/wordpress.components.d.ts +11 -0
- package/dist/types/components/cms/wordpress.components.d.ts.map +1 -0
- package/dist/types/components/cms/wordpress.functions.d.ts +28 -0
- package/dist/types/components/cms/wordpress.functions.d.ts.map +1 -0
- package/dist/types/components/config/config.client.d.ts +13 -0
- package/dist/types/components/config/config.client.d.ts.map +1 -0
- package/dist/types/components/config/config.d.ts +12 -0
- package/dist/types/components/config/config.d.ts.map +1 -0
- package/dist/types/components/config/config.example.d.ts +4 -0
- package/dist/types/components/config/config.example.d.ts.map +1 -0
- package/dist/types/components/config/config.server.d.ts +7 -0
- package/dist/types/components/config/config.server.d.ts.map +1 -0
- package/dist/types/components/config/config.types.d.ts +84 -0
- package/dist/types/components/config/config.types.d.ts.map +1 -0
- package/dist/types/components/general/css.d.ts +3 -0
- package/dist/types/components/general/css.d.ts.map +1 -0
- package/dist/types/components/general/headers.d.ts +19 -0
- package/dist/types/components/general/headers.d.ts.map +1 -0
- package/dist/types/components/general/image.d.ts +3 -0
- package/dist/types/components/general/image.d.ts.map +1 -0
- package/dist/types/components/general/layout.d.ts +73 -0
- package/dist/types/components/general/layout.d.ts.map +1 -0
- package/dist/types/components/general/loading.d.ts +11 -0
- package/dist/types/components/general/loading.d.ts.map +1 -0
- package/dist/types/components/general/microinteractions.d.ts +20 -0
- package/dist/types/components/general/microinteractions.d.ts.map +1 -0
- package/dist/types/components/general/modal.d.ts +8 -0
- package/dist/types/components/general/modal.d.ts.map +1 -0
- package/dist/types/components/general/table.d.ts +12 -0
- package/dist/types/components/general/table.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin1.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin1.d.ts.map +1 -0
- package/dist/types/components/linkedin/pixelated.linkedin2.d.ts +2 -0
- package/dist/types/components/linkedin/pixelated.linkedin2.d.ts.map +1 -0
- package/dist/types/components/markdown/markdown.d.ts +12 -0
- package/dist/types/components/markdown/markdown.d.ts.map +1 -0
- package/dist/types/components/menu/menu-accordion.d.ts +44 -0
- package/dist/types/components/menu/menu-accordion.d.ts.map +1 -0
- package/dist/types/components/menu/menu-expando.d.ts +20 -0
- package/dist/types/components/menu/menu-expando.d.ts.map +1 -0
- package/dist/types/components/menu/menu-simple.d.ts +28 -0
- package/dist/types/components/menu/menu-simple.d.ts.map +1 -0
- package/dist/types/components/nerdjoke/nerdjoke.d.ts +23 -0
- package/dist/types/components/nerdjoke/nerdjoke.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentPropertiesForm.d.ts +11 -0
- package/dist/types/components/pagebuilder/components/ComponentPropertiesForm.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentSelector.d.ts +15 -0
- package/dist/types/components/pagebuilder/components/ComponentSelector.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/ComponentTree.d.ts +17 -0
- package/dist/types/components/pagebuilder/components/ComponentTree.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/PageBuilderUI.d.ts +10 -0
- package/dist/types/components/pagebuilder/components/PageBuilderUI.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/PageEngine.d.ts +23 -0
- package/dist/types/components/pagebuilder/components/PageEngine.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/components/SaveLoadSection.d.ts +12 -0
- package/dist/types/components/pagebuilder/components/SaveLoadSection.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/form.d.ts +46 -0
- package/dist/types/components/pagebuilder/form/form.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/form.submit.d.ts +3 -0
- package/dist/types/components/pagebuilder/form/form.submit.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/formcomponents.d.ts +205 -0
- package/dist/types/components/pagebuilder/form/formcomponents.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/form/formvalidations.d.ts +29 -0
- package/dist/types/components/pagebuilder/form/formvalidations.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentGeneration.d.ts +17 -0
- package/dist/types/components/pagebuilder/lib/componentGeneration.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentMap.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/componentMap.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/componentMetadata.d.ts +22 -0
- package/dist/types/components/pagebuilder/lib/componentMetadata.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageContentful.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/pageStorageContentful.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageLocal.d.ts +23 -0
- package/dist/types/components/pagebuilder/lib/pageStorageLocal.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/pageStorageTypes.d.ts +25 -0
- package/dist/types/components/pagebuilder/lib/pageStorageTypes.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/propTypeIntrospection.d.ts +24 -0
- package/dist/types/components/pagebuilder/lib/propTypeIntrospection.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/types.d.ts +34 -0
- package/dist/types/components/pagebuilder/lib/types.d.ts.map +1 -0
- package/dist/types/components/pagebuilder/lib/usePageBuilder.d.ts +24 -0
- package/dist/types/components/pagebuilder/lib/usePageBuilder.d.ts.map +1 -0
- package/dist/types/components/recipe/recipe.d.ts +66 -0
- package/dist/types/components/recipe/recipe.d.ts.map +1 -0
- package/dist/types/components/resume/resume.d.ts +85 -0
- package/dist/types/components/resume/resume.d.ts.map +1 -0
- package/dist/types/components/seo/404.d.ts +10 -0
- package/dist/types/components/seo/404.d.ts.map +1 -0
- package/dist/types/components/seo/googleanalytics.d.ts +23 -0
- package/dist/types/components/seo/googleanalytics.d.ts.map +1 -0
- package/dist/types/components/seo/googlemap.d.ts +15 -0
- package/dist/types/components/seo/googlemap.d.ts.map +1 -0
- package/dist/types/components/seo/googlesearch.d.ts +10 -0
- package/dist/types/components/seo/googlesearch.d.ts.map +1 -0
- package/dist/types/components/seo/metadata.d.ts +35 -0
- package/dist/types/components/seo/metadata.d.ts.map +1 -0
- package/dist/types/components/seo/sitemap.d.ts +47 -0
- package/dist/types/components/seo/sitemap.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts +46 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/ebay.functions.d.ts +76 -0
- package/dist/types/components/shoppingcart/ebay.functions.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/paypal.d.ts +16 -0
- package/dist/types/components/shoppingcart/paypal.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts +35 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts.map +1 -0
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts +89 -0
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts.map +1 -0
- package/dist/types/components/sidepanel/sidepanel.d.ts +18 -0
- package/dist/types/components/sidepanel/sidepanel.d.ts.map +1 -0
- package/dist/types/components/socialcard/socialcard.d.ts +20 -0
- package/dist/types/components/socialcard/socialcard.d.ts.map +1 -0
- package/dist/types/components/tiles/tiles.d.ts +28 -0
- package/dist/types/components/tiles/tiles.d.ts.map +1 -0
- package/dist/types/components/timeline/timeline.d.ts +31 -0
- package/dist/types/components/timeline/timeline.d.ts.map +1 -0
- package/dist/types/components/utilities/api.d.ts +16 -0
- package/dist/types/components/utilities/api.d.ts.map +1 -0
- package/dist/types/components/utilities/functions.d.ts +11 -0
- package/dist/types/components/utilities/functions.d.ts.map +1 -0
- package/dist/types/components/yelp/yelp.d.ts +5 -0
- package/dist/types/components/yelp/yelp.d.ts.map +1 -0
- package/dist/types/data/buzzwords.d.ts +2 -0
- package/dist/types/data/buzzwords.d.ts.map +1 -0
- package/dist/types/index.d.ts +76 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.server.d.ts +30 -0
- package/dist/types/index.server.d.ts.map +1 -0
- package/dist/types/stories/buzzword-bingo.stories.d.ts +13 -0
- package/dist/types/stories/buzzword-bingo.stories.d.ts.map +1 -0
- package/dist/types/stories/callout.many.stories.d.ts +8 -0
- package/dist/types/stories/callout.many.stories.d.ts.map +1 -0
- package/dist/types/stories/callout.stories.d.ts +69 -0
- package/dist/types/stories/callout.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-hero.stories.d.ts +22 -0
- package/dist/types/stories/carousel-hero.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-reviews.stories.d.ts +38 -0
- package/dist/types/stories/carousel-reviews.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel-workportfolio.stories.d.ts +22 -0
- package/dist/types/stories/carousel-workportfolio.stories.d.ts.map +1 -0
- package/dist/types/stories/carousel.stories.d.ts +41 -0
- package/dist/types/stories/carousel.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.item.stories.d.ts +21 -0
- package/dist/types/stories/cms.contentful.item.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.items.stories.d.ts +20 -0
- package/dist/types/stories/cms.contentful.items.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.contentful.stories.d.ts +9 -0
- package/dist/types/stories/cms.contentful.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.google.reviews.stories.d.ts +11 -0
- package/dist/types/stories/cms.google.reviews.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.gravatar.stories.d.ts +88 -0
- package/dist/types/stories/cms.gravatar.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.instagram.stories.d.ts +16 -0
- package/dist/types/stories/cms.instagram.stories.d.ts.map +1 -0
- package/dist/types/stories/cms.wordpress.stories.d.ts +26 -0
- package/dist/types/stories/cms.wordpress.stories.d.ts.map +1 -0
- package/dist/types/stories/general.headers.stories.d.ts +27 -0
- package/dist/types/stories/general.headers.stories.d.ts.map +1 -0
- package/dist/types/stories/general.loading.stories.d.ts +11 -0
- package/dist/types/stories/general.loading.stories.d.ts.map +1 -0
- package/dist/types/stories/general.microinteractions.stories.d.ts +9 -0
- package/dist/types/stories/general.microinteractions.stories.d.ts.map +1 -0
- package/dist/types/stories/general.modal.stories.d.ts +9 -0
- package/dist/types/stories/general.modal.stories.d.ts.map +1 -0
- package/dist/types/stories/general.table.stories.d.ts +15 -0
- package/dist/types/stories/general.table.stories.d.ts.map +1 -0
- package/dist/types/stories/layout.stories.d.ts +299 -0
- package/dist/types/stories/layout.stories.d.ts.map +1 -0
- package/dist/types/stories/markdown.stories.d.ts +13 -0
- package/dist/types/stories/markdown.stories.d.ts.map +1 -0
- package/dist/types/stories/menu-accordion.stories.d.ts +34 -0
- package/dist/types/stories/menu-accordion.stories.d.ts.map +1 -0
- package/dist/types/stories/menu-simple.stories.d.ts +43 -0
- package/dist/types/stories/menu-simple.stories.d.ts.map +1 -0
- package/dist/types/stories/nerdjoke.stories.d.ts +10 -0
- package/dist/types/stories/nerdjoke.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-builder.stories.d.ts +10 -0
- package/dist/types/stories/pagebuilder.form-builder.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-engine.stories.d.ts +16 -0
- package/dist/types/stories/pagebuilder.form-engine.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.form-extractor.stories.d.ts +10 -0
- package/dist/types/stories/pagebuilder.form-extractor.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.stories.d.ts +29 -0
- package/dist/types/stories/pagebuilder.stories.d.ts.map +1 -0
- package/dist/types/stories/pagebuilder.usageguide.stories.d.ts +29 -0
- package/dist/types/stories/pagebuilder.usageguide.stories.d.ts.map +1 -0
- package/dist/types/stories/pageengine.stories.d.ts +32 -0
- package/dist/types/stories/pageengine.stories.d.ts.map +1 -0
- package/dist/types/stories/recipe.stories.d.ts +16 -0
- package/dist/types/stories/recipe.stories.d.ts.map +1 -0
- package/dist/types/stories/resume.stories.d.ts +283 -0
- package/dist/types/stories/resume.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.404.stories.d.ts +18 -0
- package/dist/types/stories/seo.404.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.googleanalytics.stories.d.ts +12 -0
- package/dist/types/stories/seo.googleanalytics.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.googlesearch.stories.d.ts +12 -0
- package/dist/types/stories/seo.googlesearch.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.metadata.stories.d.ts +25 -0
- package/dist/types/stories/seo.metadata.stories.d.ts.map +1 -0
- package/dist/types/stories/seo.sitemap.stories.d.ts +8 -0
- package/dist/types/stories/seo.sitemap.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.ebay.item.stories.d.ts +21 -0
- package/dist/types/stories/shoppingcart.ebay.item.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.ebay.items.stories.d.ts +21 -0
- package/dist/types/stories/shoppingcart.ebay.items.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart.stories.d.ts +9 -0
- package/dist/types/stories/shoppingcart.stories.d.ts.map +1 -0
- package/dist/types/stories/sidepanel.stories.d.ts +85 -0
- package/dist/types/stories/sidepanel.stories.d.ts.map +1 -0
- package/dist/types/stories/socialcard.stories.d.ts +81 -0
- package/dist/types/stories/socialcard.stories.d.ts.map +1 -0
- package/dist/types/stories/tiles.stories.d.ts +9 -0
- package/dist/types/stories/tiles.stories.d.ts.map +1 -0
- package/dist/types/stories/timeline.stories.d.ts +19 -0
- package/dist/types/stories/timeline.stories.d.ts.map +1 -0
- package/dist/types/tests/pixelated.api.test.d.ts +2 -0
- package/dist/types/tests/pixelated.api.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.callout.test.d.ts +2 -0
- package/dist/types/tests/pixelated.callout.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.carousel.test.d.ts +2 -0
- package/dist/types/tests/pixelated.carousel.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.menu-accordion.test.d.ts +2 -0
- package/dist/types/tests/pixelated.menu-accordion.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.menu-simple.test.d.ts +2 -0
- package/dist/types/tests/pixelated.menu-simple.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.nerdjoke.test.d.ts +2 -0
- package/dist/types/tests/pixelated.nerdjoke.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.recipe.test.d.ts +2 -0
- package/dist/types/tests/pixelated.recipe.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.resume.test.d.ts +2 -0
- package/dist/types/tests/pixelated.resume.test.d.ts.map +1 -0
- package/dist/types/tests/pixelated.socialcard.test.d.ts +2 -0
- package/dist/types/tests/pixelated.socialcard.test.d.ts.map +1 -0
- package/package.json +136 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useRef } from 'react';
|
|
4
|
+
import PropTypes /* , { InferProps } */ from 'prop-types';
|
|
5
|
+
import { DragHandler } from './carousel.drag';
|
|
6
|
+
import './carousel.css';
|
|
7
|
+
import { SmartImage } from '../cms/cloudinary.image';
|
|
8
|
+
import { usePixelatedConfig } from '../config/config.client';
|
|
9
|
+
function capitalize(str) {
|
|
10
|
+
return str && String(str[0]).toUpperCase() + String(str).slice(1);
|
|
11
|
+
}
|
|
12
|
+
/* ========== CAROUSEL ========== */
|
|
13
|
+
Carousel.propTypes = {
|
|
14
|
+
cards: PropTypes.array.isRequired,
|
|
15
|
+
draggable: PropTypes.bool,
|
|
16
|
+
imgFit: PropTypes.oneOf(['contain', 'cover', 'fill'])
|
|
17
|
+
};
|
|
18
|
+
// export type CarouselType = InferProps<typeof Carousel.propTypes>;
|
|
19
|
+
export function Carousel(props) {
|
|
20
|
+
const debug = false;
|
|
21
|
+
let timer = useRef(null);
|
|
22
|
+
const [cardIndex, setcardIndex] = useState(0);
|
|
23
|
+
function startTimer() {
|
|
24
|
+
if (timer.current)
|
|
25
|
+
clearTimeout(timer.current);
|
|
26
|
+
timer.current = setTimeout(nextCard, 5000);
|
|
27
|
+
}
|
|
28
|
+
function stopTimer() {
|
|
29
|
+
if (timer.current)
|
|
30
|
+
clearTimeout(timer.current);
|
|
31
|
+
}
|
|
32
|
+
function previousCard() {
|
|
33
|
+
if (debug)
|
|
34
|
+
console.log("Going to Previous card : ", cardIndex, " => ", cardIndex - 1);
|
|
35
|
+
if (cardIndex === 0) {
|
|
36
|
+
setcardIndex(props.cards.length - 1);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
setcardIndex(cardIndex - 1);
|
|
40
|
+
}
|
|
41
|
+
startTimer();
|
|
42
|
+
}
|
|
43
|
+
;
|
|
44
|
+
function nextCard() {
|
|
45
|
+
if (debug)
|
|
46
|
+
console.log("Going to Next card : ", cardIndex, " => ", cardIndex + 1);
|
|
47
|
+
if (cardIndex === props.cards.length - 1) {
|
|
48
|
+
setcardIndex(0);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setcardIndex(cardIndex + 1);
|
|
52
|
+
}
|
|
53
|
+
startTimer();
|
|
54
|
+
}
|
|
55
|
+
;
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (typeof document !== 'undefined') {
|
|
58
|
+
startTimer();
|
|
59
|
+
}
|
|
60
|
+
}, [cardIndex]);
|
|
61
|
+
/* ========== DRAGGABLE HANDLER ========== */
|
|
62
|
+
if (props.draggable && props.draggable === true) {
|
|
63
|
+
if (debug)
|
|
64
|
+
console.log('CarouselSimple: Dragging enabled');
|
|
65
|
+
DragHandler({
|
|
66
|
+
activeIndex: cardIndex,
|
|
67
|
+
targetDiv: 'carouselCardWrapper',
|
|
68
|
+
nextImage: nextCard,
|
|
69
|
+
previousImage: previousCard
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (debug)
|
|
74
|
+
console.log('CarouselSimple: Dragging disabled');
|
|
75
|
+
}
|
|
76
|
+
if (props.cards && props.cards.length > 0) {
|
|
77
|
+
return (_jsxs("div", { className: "carouselContainer", children: [_jsx("div", { className: "carouselCardsContainer", children: props.cards.map((card, i) => (_jsx(CarouselCard, { index: i, cardIndex: cardIndex, cardLength: props.cards.length, link: card.link, linkTarget: card.linkTarget || '_self', image: card.image, imageAlt: card.imageAlt, imgFit: props.imgFit ? props.imgFit : 'fill', headerText: card.headerText, subHeaderText: card.subHeaderText, bodyText: card.bodyText }, i))) }), _jsxs("div", { className: "carouselButtons", children: [_jsx(CarouselButton, { clickFunction: previousCard, glyph: '\u25C0' }), _jsx(CarouselButton, { clickFunction: stopTimer, glyph: '\u23F8' }), _jsx(CarouselButton, { clickFunction: nextCard, glyph: '\u25B6' })] })] }));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return (_jsx("div", { className: 'section-container', children: _jsx("div", { className: "carouselContainer", children: _jsx(CarouselLoading, {}) }) }));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/* ========== CAROUSEL CARD ========== */
|
|
84
|
+
function CarouselCard(props) {
|
|
85
|
+
const myZindex = props.cardLength - props.index;
|
|
86
|
+
const styles = {
|
|
87
|
+
zIndex: myZindex
|
|
88
|
+
};
|
|
89
|
+
styles.transition = 'all 1.0s ease 0.1s';
|
|
90
|
+
if (props.index > props.cardIndex) {
|
|
91
|
+
styles.transform = 'translateX(100%)';
|
|
92
|
+
}
|
|
93
|
+
else if (props.index === props.cardIndex) {
|
|
94
|
+
styles.transform = 'translateX(0%)';
|
|
95
|
+
}
|
|
96
|
+
else if (props.index < props.cardIndex) {
|
|
97
|
+
styles.transform = 'translateX(-100%)';
|
|
98
|
+
}
|
|
99
|
+
const imgFit = props.imgFit ? "img" + capitalize(props.imgFit) : 'imgFill';
|
|
100
|
+
const config = usePixelatedConfig();
|
|
101
|
+
const cardBody = (_jsxs("div", { draggable: 'false', children: [(props.link) ? _jsx("div", { draggable: 'false', className: "carouselCardLink" }) : null, (props.image) ? _jsx("div", { draggable: 'false', className: "carouselCardImage", children: _jsx(SmartImage, { draggable: false, src: props.image, title: props?.imageAlt, alt: props?.imageAlt || "", className: imgFit, cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined }) }) : null, (props.headerText) ? _jsx("div", { draggable: 'false', className: "carouselCardHeader", children: _jsx("h3", { draggable: 'false', children: props.headerText }) }) : null, (props.subHeaderText) ? _jsx("div", { draggable: 'false', className: "carouselCardSubHeader", children: _jsx("h4", { draggable: 'false', children: props.subHeaderText }) }) : null, (props.bodyText) ? _jsx("div", { draggable: 'false', className: "carouselCardBody", children: props.bodyText }) : null] }));
|
|
102
|
+
return (_jsx("div", { draggable: 'true', id: 'c-' + props.index, className: "carouselCardWrapper", style: styles, children: _jsx("div", { draggable: 'false', className: "carouselCard", children: (props.link) ? _jsx("a", { draggable: 'false', href: props.link, target: props.linkTarget, children: cardBody }) : cardBody }) }));
|
|
103
|
+
}
|
|
104
|
+
// REMOVED PROPTYPE AS TYPESCRIPT TYPE COVERS THIS
|
|
105
|
+
/* ========== CAROUSEL ARROW ========== */
|
|
106
|
+
CarouselButton.propTypes = {
|
|
107
|
+
clickFunction: PropTypes.func.isRequired,
|
|
108
|
+
glyph: PropTypes.string.isRequired
|
|
109
|
+
};
|
|
110
|
+
function CarouselButton(props) {
|
|
111
|
+
return (_jsx("div", { className: `carouselButton textOutline`, onClick: props.clickFunction, children: props.glyph }));
|
|
112
|
+
}
|
|
113
|
+
CarouselArrow.propTypes = {
|
|
114
|
+
direction: PropTypes.string.isRequired,
|
|
115
|
+
clickFunction: PropTypes.func.isRequired,
|
|
116
|
+
glyph: PropTypes.string.isRequired
|
|
117
|
+
};
|
|
118
|
+
function CarouselArrow(props) {
|
|
119
|
+
return (_jsx("div", { className: `carouselButton${capitalize(props.direction)} textOutline`, onClick: props.clickFunction, children: props.glyph }));
|
|
120
|
+
}
|
|
121
|
+
/* ========== CAROUSEL LOADING ========== */
|
|
122
|
+
function CarouselLoading() {
|
|
123
|
+
return (_jsx("div", { className: "carouselLoading horizontal-centered vertical-centered centered", children: _jsx("div", { children: "Loading..." }) }));
|
|
124
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
Calendly.propTypes = {
|
|
5
|
+
url: PropTypes.string.isRequired,
|
|
6
|
+
width: PropTypes.string.isRequired,
|
|
7
|
+
height: PropTypes.string.isRequired,
|
|
8
|
+
};
|
|
9
|
+
export function Calendly({ url, width, height }) {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const head = document.querySelector("head");
|
|
12
|
+
const script = document.createElement("script");
|
|
13
|
+
script.setAttribute("src", "https://assets.calendly.com/assets/external/widget.js");
|
|
14
|
+
script.setAttribute("type", "text/javascript");
|
|
15
|
+
script.setAttribute("async", "true");
|
|
16
|
+
if (head)
|
|
17
|
+
head.appendChild(script);
|
|
18
|
+
}, []);
|
|
19
|
+
return (_jsx("div", { className: "calendly-inline-widget", "data-url": url, style: { minWidth: width || "320px", height: height || "700px" }, "data-resize": "true", suppressHydrationWarning: true }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { buildCloudinaryUrl } from './cloudinary';
|
|
6
|
+
import { usePixelatedConfig } from '../config/config.client';
|
|
7
|
+
const CLOUDINARY_DOMAIN = 'https://res.cloudinary.com/';
|
|
8
|
+
const CLOUDINARY_TRANSFORMS = 'f_auto,c_limit,q_auto,dpr_auto';
|
|
9
|
+
function parseNumber(v) {
|
|
10
|
+
if (typeof v === 'number')
|
|
11
|
+
return v > 0 ? v : undefined;
|
|
12
|
+
if (typeof v === 'string') {
|
|
13
|
+
const n = parseInt(v, 10);
|
|
14
|
+
return Number.isFinite(n) && n > 0 ? n : undefined;
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
function safeString(str) {
|
|
19
|
+
return (str === undefined || str === null)
|
|
20
|
+
? undefined
|
|
21
|
+
: String(str);
|
|
22
|
+
}
|
|
23
|
+
function sanitizeString(str) {
|
|
24
|
+
return (str === undefined || str === null)
|
|
25
|
+
? undefined
|
|
26
|
+
: String(str).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
|
27
|
+
}
|
|
28
|
+
function generateSrcSet(src, productEnv, widths, opts) {
|
|
29
|
+
if (!productEnv)
|
|
30
|
+
return '';
|
|
31
|
+
return widths.map(w => `${buildCloudinaryUrl({
|
|
32
|
+
src, productEnv,
|
|
33
|
+
width: w,
|
|
34
|
+
quality: opts.quality ?? 75,
|
|
35
|
+
transforms: opts.transforms ?? undefined,
|
|
36
|
+
cloudinaryDomain: opts.cloudinaryDomain
|
|
37
|
+
})} ${w}w`).join(', ');
|
|
38
|
+
}
|
|
39
|
+
const SMARTIMAGE_PROP_TYPES = {
|
|
40
|
+
cloudinaryEnv: PropTypes.string,
|
|
41
|
+
cloudinaryDomain: PropTypes.string,
|
|
42
|
+
cloudinaryTransforms: PropTypes.string,
|
|
43
|
+
src: PropTypes.string.isRequired,
|
|
44
|
+
alt: PropTypes.string.isRequired,
|
|
45
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
46
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
47
|
+
aboveFold: PropTypes.bool,
|
|
48
|
+
loading: PropTypes.oneOf(['lazy', 'eager']),
|
|
49
|
+
preload: PropTypes.bool,
|
|
50
|
+
decoding: PropTypes.oneOf(['async', 'auto', 'sync']),
|
|
51
|
+
fetchPriority: PropTypes.oneOf(['high', 'low', 'auto']),
|
|
52
|
+
sizes: PropTypes.string,
|
|
53
|
+
srcSet: PropTypes.string,
|
|
54
|
+
className: PropTypes.string,
|
|
55
|
+
style: PropTypes.object,
|
|
56
|
+
id: PropTypes.string,
|
|
57
|
+
name: PropTypes.string,
|
|
58
|
+
title: PropTypes.string,
|
|
59
|
+
quality: PropTypes.number,
|
|
60
|
+
placeholder: PropTypes.oneOf(['blur', 'empty']),
|
|
61
|
+
blurDataURL: PropTypes.string,
|
|
62
|
+
};
|
|
63
|
+
SmartImage.propTypes = SMARTIMAGE_PROP_TYPES;
|
|
64
|
+
export function SmartImage(props) {
|
|
65
|
+
const { src, alt, id, name, title, cloudinaryEnv, cloudinaryDomain = CLOUDINARY_DOMAIN, cloudinaryTransforms = CLOUDINARY_TRANSFORMS, quality = 75, width = 500, height = 500, aboveFold = false, fetchPriority = 'auto', loading = 'lazy', decoding = 'async', preload = false, ...imgProps } = props;
|
|
66
|
+
const newProps = { ...props };
|
|
67
|
+
const config = usePixelatedConfig();
|
|
68
|
+
const cloudCfg = config?.cloudinary;
|
|
69
|
+
newProps.cloudinaryEnv = safeString(cloudinaryEnv ?? cloudCfg?.product_env);
|
|
70
|
+
newProps.cloudinaryDomain = safeString(cloudCfg?.baseUrl ?? cloudinaryDomain);
|
|
71
|
+
newProps.cloudinaryTransforms = safeString(cloudinaryTransforms ?? cloudCfg?.transforms);
|
|
72
|
+
newProps.fetchPriority = aboveFold ? 'high' : fetchPriority;
|
|
73
|
+
newProps.loading = aboveFold ? 'eager' : loading;
|
|
74
|
+
newProps.decoding = aboveFold ? 'sync' : decoding;
|
|
75
|
+
newProps.preload = aboveFold ? true : preload;
|
|
76
|
+
newProps.src = safeString(src) ?? src ?? undefined;
|
|
77
|
+
newProps.id = safeString(id);
|
|
78
|
+
newProps.name = safeString(name);
|
|
79
|
+
newProps.title = safeString(title);
|
|
80
|
+
newProps.alt = safeString(alt) ?? '';
|
|
81
|
+
newProps.width = parseNumber(width) || 500;
|
|
82
|
+
newProps.height = parseNumber(height) || 500;
|
|
83
|
+
const filename = (newProps.src).split('/').pop()?.split('?')[0] || '';
|
|
84
|
+
const imageName = filename.replace(/\.[^.]+$/, '');
|
|
85
|
+
newProps.id = newProps.id || newProps.name || sanitizeString(newProps.title) || sanitizeString(newProps.alt) || sanitizeString(imageName);
|
|
86
|
+
newProps.name = newProps.name || newProps.id || sanitizeString(newProps.title) || sanitizeString(newProps.alt) || sanitizeString(imageName);
|
|
87
|
+
newProps.title = newProps.title || newProps.alt || sanitizeString(imageName);
|
|
88
|
+
// if(Array.isArray(src))
|
|
89
|
+
const finalSrc = newProps.cloudinaryEnv
|
|
90
|
+
? buildCloudinaryUrl({
|
|
91
|
+
src: src,
|
|
92
|
+
productEnv: newProps.cloudinaryEnv,
|
|
93
|
+
cloudinaryDomain: newProps.cloudinaryDomain,
|
|
94
|
+
quality,
|
|
95
|
+
width: newProps.width ?? undefined,
|
|
96
|
+
transforms: newProps.cloudinaryTransforms ?? undefined
|
|
97
|
+
})
|
|
98
|
+
: String(src);
|
|
99
|
+
let responsiveSrcSet;
|
|
100
|
+
let responsiveSizes;
|
|
101
|
+
if (newProps.cloudinaryEnv) {
|
|
102
|
+
if (newProps.width) {
|
|
103
|
+
const widths = [Math.ceil(newProps.width * 0.5), newProps.width, Math.ceil(newProps.width * 1.5), Math.ceil(newProps.width * 2)];
|
|
104
|
+
responsiveSrcSet = generateSrcSet(String(src), newProps.cloudinaryEnv, widths, {
|
|
105
|
+
quality,
|
|
106
|
+
transforms: newProps.cloudinaryTransforms ?? undefined,
|
|
107
|
+
cloudinaryDomain: newProps.cloudinaryDomain
|
|
108
|
+
});
|
|
109
|
+
responsiveSizes = `${newProps.width}px`;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
const breakpoints = [320, 640, 768, 1024, 1280, 1536];
|
|
113
|
+
responsiveSrcSet = generateSrcSet(String(src), newProps.cloudinaryEnv, breakpoints, {
|
|
114
|
+
quality,
|
|
115
|
+
transforms: newProps.cloudinaryTransforms ?? undefined,
|
|
116
|
+
cloudinaryDomain: newProps.cloudinaryDomain
|
|
117
|
+
});
|
|
118
|
+
responsiveSizes = '(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const isDecorative = newProps.alt === '';
|
|
122
|
+
const decorativeProps = isDecorative ? { 'aria-hidden': true, role: 'presentation' } : {};
|
|
123
|
+
try {
|
|
124
|
+
return (_jsx(Image, { ...imgProps, ...decorativeProps, src: finalSrc, alt: newProps.alt, id: newProps.id, name: newProps.name, title: newProps.title, width: newProps.width, height: newProps.height, sizes: imgProps.sizes || responsiveSizes, quality: quality, fetchPriority: newProps.fetchPriority, loading: newProps.loading, decoding: newProps.decoding, preload: newProps.preload }));
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
if (typeof console !== 'undefined')
|
|
128
|
+
console.warn('next/image unavailable, falling back to <img>', e);
|
|
129
|
+
}
|
|
130
|
+
const imgRef = React.useRef(null);
|
|
131
|
+
return (_jsx("img", { ...imgProps, ...decorativeProps, ref: imgRef, src: finalSrc, alt: newProps.alt, id: newProps.id, name: newProps.name, title: newProps.title, width: newProps.width, height: newProps.height, srcSet: responsiveSrcSet || imgProps.srcSet, sizes: imgProps.sizes || responsiveSizes, fetchPriority: newProps.fetchPriority, loading: newProps.loading, decoding: newProps.decoding }));
|
|
132
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
/*
|
|
3
|
+
https://cloudinary.com/blog/transparent_webp_format_cdn_delivery_based_on_visitors_browsers
|
|
4
|
+
https://cloudinary.com/blog/delivering_all_your_websites_images_through_a_cdn
|
|
5
|
+
*/
|
|
6
|
+
const cloudinary_domain = "https://res.cloudinary.com";
|
|
7
|
+
// const cloudinary_product_env = "dlbon7tpq";
|
|
8
|
+
// const cloudinary_props = "/image/fetch/f_auto,c_limit,q_auto,dpr_auto";
|
|
9
|
+
const cloudinary_props = "/image/fetch/f_auto,c_limit,dpr_auto";
|
|
10
|
+
function joinWithSlash(a, b) {
|
|
11
|
+
return `${a.replace(/\/+$/, '')}/${b.replace(/^\/+/, '')}`;
|
|
12
|
+
}
|
|
13
|
+
export function buildCloudinaryUrl(params) {
|
|
14
|
+
const { src, productEnv, cloudinaryDomain = cloudinary_domain, quality = 75, width, transforms } = params;
|
|
15
|
+
if (typeof window === 'undefined')
|
|
16
|
+
return src; // SSR - leave as-is
|
|
17
|
+
const origin = window.location.origin;
|
|
18
|
+
// Don't fetch from cloudinary during local dev
|
|
19
|
+
if (origin.includes("localhost") || origin.includes("127.0.0.1") || origin.includes("192.168"))
|
|
20
|
+
return src;
|
|
21
|
+
// Must have cloudinary product env to build URL
|
|
22
|
+
if (!productEnv)
|
|
23
|
+
return src;
|
|
24
|
+
// Resolve non-absolute src to absolute URL in client runtime. Leave alone during SSR.
|
|
25
|
+
let url = src;
|
|
26
|
+
if (!/^https?:\/\//i.test(src)) {
|
|
27
|
+
url = src.startsWith('/') ? `${origin}${src}` : `${origin}/${src}`;
|
|
28
|
+
}
|
|
29
|
+
// Don't fetch from cloudinary during local dev
|
|
30
|
+
// if (url.includes('localhost') || url.includes('127.0.0.1') || url.includes('192.168')) return src;
|
|
31
|
+
const q = typeof quality === 'number' ? quality : 75;
|
|
32
|
+
const parts = ['f_auto', 'c_limit', `q_${q}`, 'dpr_auto'];
|
|
33
|
+
if (typeof width === 'number' && Number.isFinite(width))
|
|
34
|
+
parts.push(`w_${width}`);
|
|
35
|
+
// split transforms by comma and clean empty and whitespace
|
|
36
|
+
const transformArray = transforms ? transforms.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
37
|
+
for (const transform of transformArray) {
|
|
38
|
+
if (!transform)
|
|
39
|
+
continue;
|
|
40
|
+
// If the exact transform already exists, nothing to do.
|
|
41
|
+
if (parts.includes(transform))
|
|
42
|
+
continue;
|
|
43
|
+
// Check for a prefix match (anything before and including the first underscore).
|
|
44
|
+
const underscoreIndex = transform.indexOf('_');
|
|
45
|
+
if (underscoreIndex !== -1) {
|
|
46
|
+
const prefix = transform.slice(0, underscoreIndex + 1); // e.g. 'q_' or 'w_'
|
|
47
|
+
const prefixIdx = parts.findIndex(p => p.startsWith(prefix));
|
|
48
|
+
if (prefixIdx !== -1) {
|
|
49
|
+
// Replace the existing part that shares the same prefix.
|
|
50
|
+
parts[prefixIdx] = transform;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// No exact or prefix match found — append.
|
|
55
|
+
parts.push(transform);
|
|
56
|
+
}
|
|
57
|
+
const t = parts.length ? parts.join(',') : '';
|
|
58
|
+
const domainAndCloud = productEnv ? joinWithSlash(cloudinaryDomain, productEnv) : cloudinaryDomain;
|
|
59
|
+
const encodedUrl = url.includes("?") ? encodeURIComponent(url) : url;
|
|
60
|
+
return `${domainAndCloud}/image/fetch/${t}/${encodedUrl}`;
|
|
61
|
+
}
|
|
62
|
+
getCloudinaryRemoteFetchURL.propTypes = {
|
|
63
|
+
url: PropTypes.string.isRequired,
|
|
64
|
+
product_env: PropTypes.string.isRequired
|
|
65
|
+
};
|
|
66
|
+
export function getCloudinaryRemoteFetchURL(props) {
|
|
67
|
+
const domainAndCloud = joinWithSlash(cloudinary_domain, props.product_env);
|
|
68
|
+
const cloudinary_prefix = domainAndCloud + cloudinary_props;
|
|
69
|
+
const result = cloudinary_prefix + '/' + props.url;
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
export function userIsMobile() {
|
|
73
|
+
let match = false;
|
|
74
|
+
if (typeof window !== 'undefined') {
|
|
75
|
+
const mediaQuery = window.matchMedia('(max-width: 768px)'); // Example breakpoint
|
|
76
|
+
match = mediaQuery.matches;
|
|
77
|
+
}
|
|
78
|
+
return match;
|
|
79
|
+
}
|
|
80
|
+
loadAllImagesFromCloudinary.propTypes = {
|
|
81
|
+
origin: PropTypes.string,
|
|
82
|
+
product_env: PropTypes.string.isRequired
|
|
83
|
+
};
|
|
84
|
+
export function loadAllImagesFromCloudinary(props) {
|
|
85
|
+
const origin = document.location.origin;
|
|
86
|
+
if (origin && origin.includes("localhost")) {
|
|
87
|
+
return;
|
|
88
|
+
} // do nothing in local dev
|
|
89
|
+
const images = document.querySelectorAll('img');
|
|
90
|
+
images.forEach(img => {
|
|
91
|
+
const currentSrc = img.getAttribute('src') || '';
|
|
92
|
+
if (!currentSrc)
|
|
93
|
+
return;
|
|
94
|
+
// Use the shared builder so all Cloudinary URLs are consistent.
|
|
95
|
+
const built = buildCloudinaryUrl({
|
|
96
|
+
src: currentSrc,
|
|
97
|
+
productEnv: props.product_env,
|
|
98
|
+
cloudinaryDomain: cloudinary_domain,
|
|
99
|
+
// keep other options default (quality/width/transforms) for now
|
|
100
|
+
});
|
|
101
|
+
// If builder returned a new URL, update the image src.
|
|
102
|
+
if (built && built !== currentSrc) {
|
|
103
|
+
img.setAttribute('src', built);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
const debug = false;
|
|
3
|
+
const ctfQSParams = "?fm=webp&q=50";
|
|
4
|
+
/* ========== CALL CONTENTFUL DELIVERY API ========== */
|
|
5
|
+
callContentfulDeliveryAPI.propTypes = {
|
|
6
|
+
full_url: PropTypes.string.isRequired,
|
|
7
|
+
};
|
|
8
|
+
export async function callContentfulDeliveryAPI(props) {
|
|
9
|
+
if (debug)
|
|
10
|
+
console.log("Calling Contentful Delivery API:", props.full_url);
|
|
11
|
+
try {
|
|
12
|
+
const response = await fetch(props.full_url);
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new Error(`Response status: ${response.status}`);
|
|
15
|
+
}
|
|
16
|
+
const json = await response.json();
|
|
17
|
+
return json;
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof Error) {
|
|
21
|
+
console.error(error.message);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.error(error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
/* ========== GET CONTENTFUL CARDS ========== */
|
|
30
|
+
getContentfulEntries.propTypes = {
|
|
31
|
+
apiProps: PropTypes.shape({
|
|
32
|
+
proxyURL: PropTypes.string,
|
|
33
|
+
base_url: PropTypes.string.isRequired,
|
|
34
|
+
space_id: PropTypes.string.isRequired,
|
|
35
|
+
environment: PropTypes.string.isRequired,
|
|
36
|
+
delivery_access_token: PropTypes.string.isRequired,
|
|
37
|
+
}).isRequired,
|
|
38
|
+
};
|
|
39
|
+
export async function getContentfulEntries(props) {
|
|
40
|
+
const { base_url, space_id, environment, delivery_access_token } = props.apiProps;
|
|
41
|
+
// const full_url = base_url + "/spaces/" + space_id + "/environments/" + environment + "/content_types/" + contentType + "?access_token=" + access_token ;
|
|
42
|
+
const full_url = base_url +
|
|
43
|
+
"/spaces/" + space_id +
|
|
44
|
+
"/environments/" + environment +
|
|
45
|
+
"/entries?access_token=" + delivery_access_token;
|
|
46
|
+
return await callContentfulDeliveryAPI({ full_url });
|
|
47
|
+
}
|
|
48
|
+
/*
|
|
49
|
+
https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection/get-all-entries-of-a-space/console/js-plain
|
|
50
|
+
*/
|
|
51
|
+
/* ========== GET CONTENTFUL CARDS BY TYPE ========== */
|
|
52
|
+
getContentfulEntriesByType.propTypes = {
|
|
53
|
+
apiProps: PropTypes.shape({
|
|
54
|
+
proxyURL: PropTypes.string,
|
|
55
|
+
base_url: PropTypes.string.isRequired,
|
|
56
|
+
space_id: PropTypes.string.isRequired,
|
|
57
|
+
environment: PropTypes.string.isRequired,
|
|
58
|
+
delivery_access_token: PropTypes.string.isRequired,
|
|
59
|
+
}).isRequired,
|
|
60
|
+
contentType: PropTypes.string.isRequired,
|
|
61
|
+
};
|
|
62
|
+
export async function getContentfulEntriesByType(props) {
|
|
63
|
+
const allEntries = await getContentfulEntries({ apiProps: props.apiProps });
|
|
64
|
+
const typeEntries = [];
|
|
65
|
+
for (const item of allEntries.items) {
|
|
66
|
+
if (item.sys.contentType.sys.id == props.contentType) {
|
|
67
|
+
typeEntries.push(item);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
allEntries.items = typeEntries;
|
|
71
|
+
return allEntries;
|
|
72
|
+
}
|
|
73
|
+
/* ========== GET CONTENTFUL CARDS BY TYPE ========== */
|
|
74
|
+
getContentfulContentType.propTypes = {
|
|
75
|
+
apiProps: PropTypes.shape({
|
|
76
|
+
proxyURL: PropTypes.string,
|
|
77
|
+
base_url: PropTypes.string.isRequired,
|
|
78
|
+
space_id: PropTypes.string.isRequired,
|
|
79
|
+
environment: PropTypes.string.isRequired,
|
|
80
|
+
access_token: PropTypes.string.isRequired,
|
|
81
|
+
}).isRequired,
|
|
82
|
+
contentType: PropTypes.string.isRequired,
|
|
83
|
+
};
|
|
84
|
+
export async function getContentfulContentType(props) {
|
|
85
|
+
const { base_url, space_id, environment, access_token } = props.apiProps;
|
|
86
|
+
const full_url = base_url +
|
|
87
|
+
"/spaces/" + space_id +
|
|
88
|
+
"/environments/" + environment +
|
|
89
|
+
"/content_types/" + props.contentType +
|
|
90
|
+
"?access_token=" + access_token;
|
|
91
|
+
return await callContentfulDeliveryAPI({ full_url });
|
|
92
|
+
}
|
|
93
|
+
/* ========== GET CONTENTFUL ENTRY BY ENTRY ID ========== */
|
|
94
|
+
getContentfulEntryByEntryID.propTypes = {
|
|
95
|
+
apiProps: PropTypes.shape({
|
|
96
|
+
proxyURL: PropTypes.string,
|
|
97
|
+
base_url: PropTypes.string.isRequired,
|
|
98
|
+
space_id: PropTypes.string.isRequired,
|
|
99
|
+
environment: PropTypes.string.isRequired,
|
|
100
|
+
delivery_access_token: PropTypes.string.isRequired,
|
|
101
|
+
}).isRequired,
|
|
102
|
+
entry_id: PropTypes.string.isRequired,
|
|
103
|
+
};
|
|
104
|
+
export async function getContentfulEntryByEntryID(props) {
|
|
105
|
+
const { base_url, space_id, environment, delivery_access_token } = props.apiProps;
|
|
106
|
+
const full_url = base_url +
|
|
107
|
+
"/spaces/" + space_id +
|
|
108
|
+
"/environments/" + environment +
|
|
109
|
+
"/entries/" + props.entry_id +
|
|
110
|
+
"?access_token=" + delivery_access_token;
|
|
111
|
+
return await callContentfulDeliveryAPI({ full_url });
|
|
112
|
+
}
|
|
113
|
+
/* ========== GET CONTENTFUL CARD BY FIELD ========== */
|
|
114
|
+
export async function getContentfulEntryByField(params) {
|
|
115
|
+
// const cards: any = await getContentfulEntriesData();
|
|
116
|
+
const searchVal = decodeURIComponent(params.searchVal);
|
|
117
|
+
for (const item of params.cards.items) {
|
|
118
|
+
if (item?.fields[params.searchField]?.toLowerCase() == searchVal.toLowerCase()) {
|
|
119
|
+
return item;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
/* ========== GET CONTENTFUL CARD TITLES ========== */
|
|
125
|
+
getContentfulFieldValues.propTypes = {
|
|
126
|
+
apiProps: PropTypes.shape({
|
|
127
|
+
proxyURL: PropTypes.string,
|
|
128
|
+
base_url: PropTypes.string.isRequired,
|
|
129
|
+
space_id: PropTypes.string.isRequired,
|
|
130
|
+
environment: PropTypes.string.isRequired,
|
|
131
|
+
delivery_access_token: PropTypes.string.isRequired,
|
|
132
|
+
}).isRequired,
|
|
133
|
+
contentType: PropTypes.string.isRequired,
|
|
134
|
+
field: PropTypes.string.isRequired,
|
|
135
|
+
};
|
|
136
|
+
export async function getContentfulFieldValues(props) {
|
|
137
|
+
const cards = await getContentfulEntriesByType({
|
|
138
|
+
apiProps: props.apiProps,
|
|
139
|
+
contentType: props.contentType,
|
|
140
|
+
});
|
|
141
|
+
const fieldVals = cards.items.map(function (card) {
|
|
142
|
+
return card.fields[props.field];
|
|
143
|
+
});
|
|
144
|
+
return fieldVals;
|
|
145
|
+
}
|
|
146
|
+
/* ========== GET CONTENTFUL IMAGES FROM CARDS ========== */
|
|
147
|
+
getContentfulImagesFromEntries.propTypes = {
|
|
148
|
+
images: PropTypes.any.isRequired,
|
|
149
|
+
assets: PropTypes.any.isRequired,
|
|
150
|
+
};
|
|
151
|
+
export async function getContentfulImagesFromEntries(props) {
|
|
152
|
+
const imageURLs = [];
|
|
153
|
+
for (const image of props.images) {
|
|
154
|
+
for (const asset of props.assets) {
|
|
155
|
+
if (image.sys.id == asset.sys.id) {
|
|
156
|
+
imageURLs.push({
|
|
157
|
+
image: asset.fields.file.url + ctfQSParams,
|
|
158
|
+
imageAlt: asset.fields.description,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return imageURLs;
|
|
164
|
+
}
|
|
165
|
+
/* ========== GET CONTENTFUL ASSETS ========== */
|
|
166
|
+
getContentfulAssets.propTypes = {
|
|
167
|
+
apiProps: PropTypes.shape({
|
|
168
|
+
proxyURL: PropTypes.string,
|
|
169
|
+
base_url: PropTypes.string.isRequired,
|
|
170
|
+
space_id: PropTypes.string.isRequired,
|
|
171
|
+
environment: PropTypes.string.isRequired,
|
|
172
|
+
access_token: PropTypes.string.isRequired,
|
|
173
|
+
}).isRequired,
|
|
174
|
+
};
|
|
175
|
+
export async function getContentfulAssets(props) {
|
|
176
|
+
const { base_url, space_id, environment, access_token } = props.apiProps;
|
|
177
|
+
const full_url = base_url +
|
|
178
|
+
"/spaces/" + space_id +
|
|
179
|
+
"/environments/" + environment +
|
|
180
|
+
"/assets?access_token=" + access_token;
|
|
181
|
+
return await callContentfulDeliveryAPI({ full_url });
|
|
182
|
+
}
|
|
183
|
+
/* ========== GET CONTENTFUL ASSET URLS ========== */
|
|
184
|
+
getContentfulAssetURLs.propTypes = {
|
|
185
|
+
apiProps: PropTypes.shape({
|
|
186
|
+
proxyURL: PropTypes.string,
|
|
187
|
+
base_url: PropTypes.string.isRequired,
|
|
188
|
+
space_id: PropTypes.string.isRequired,
|
|
189
|
+
environment: PropTypes.string.isRequired,
|
|
190
|
+
access_token: PropTypes.string.isRequired,
|
|
191
|
+
}).isRequired,
|
|
192
|
+
};
|
|
193
|
+
export async function getContentfulAssetURLs(props) {
|
|
194
|
+
const assetURLs = [];
|
|
195
|
+
const assets = await getContentfulAssets(props);
|
|
196
|
+
for (const asset of assets.items) {
|
|
197
|
+
assetURLs.push({
|
|
198
|
+
image: asset.fields.file.url + ctfQSParams,
|
|
199
|
+
imageAlt: asset.fields.description,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
if (debug)
|
|
203
|
+
console.log("Asset URLs: ", assetURLs);
|
|
204
|
+
return assetURLs;
|
|
205
|
+
}
|
|
206
|
+
/* ========== GET CONTENTFUL DISCOUNT CODES ========== */
|
|
207
|
+
getContentfulDiscountCodes.propTypes = {
|
|
208
|
+
apiProps: PropTypes.shape({
|
|
209
|
+
proxyURL: PropTypes.string,
|
|
210
|
+
base_url: PropTypes.string.isRequired,
|
|
211
|
+
space_id: PropTypes.string.isRequired,
|
|
212
|
+
environment: PropTypes.string.isRequired,
|
|
213
|
+
delivery_access_token: PropTypes.string.isRequired,
|
|
214
|
+
}).isRequired,
|
|
215
|
+
contentType: PropTypes.string.isRequired,
|
|
216
|
+
};
|
|
217
|
+
export async function getContentfulDiscountCodes(props) {
|
|
218
|
+
const contentType = "discountCodes";
|
|
219
|
+
try {
|
|
220
|
+
if (debug)
|
|
221
|
+
console.log("Fetching Discount Codes");
|
|
222
|
+
const response = await getContentfulEntriesByType({
|
|
223
|
+
apiProps: props.apiProps,
|
|
224
|
+
contentType: props.contentType
|
|
225
|
+
});
|
|
226
|
+
if (!response || !response.items) {
|
|
227
|
+
console.error(`HTTP error! status: ${response.status}`);
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
const filteredItems = response.items.filter((item) => {
|
|
231
|
+
return item.sys.contentType.sys.id === contentType;
|
|
232
|
+
});
|
|
233
|
+
const discountCodes = filteredItems.map((item) => ({
|
|
234
|
+
codeName: item.fields.codeName,
|
|
235
|
+
codeDescription: item.fields.codeDescription,
|
|
236
|
+
codeType: item.fields.codeType,
|
|
237
|
+
codeStart: item.fields.codeStart,
|
|
238
|
+
codeEnd: item.fields.codeEnd,
|
|
239
|
+
codeValue: item.fields.codeValue,
|
|
240
|
+
}));
|
|
241
|
+
return discountCodes;
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
console.error('Error fetching token:', error);
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|