@pixelated-tech/components 3.11.9 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/admin/componentusage/componentAnalysis.js +2 -0
- package/dist/components/admin/deploy/deployment.integration.js +8 -0
- package/dist/components/admin/site-health/site-health-accessibility.js +6 -0
- package/dist/components/admin/site-health/site-health-axe-core.js +6 -0
- package/dist/components/admin/site-health/site-health-cloudwatch.js +10 -0
- package/dist/components/admin/site-health/site-health-dependency-vulnerabilities.js +6 -0
- package/dist/components/admin/site-health/site-health-github.js +10 -0
- package/dist/components/admin/site-health/site-health-google-analytics.js +10 -0
- package/dist/components/admin/site-health/site-health-google-search-console.js +10 -0
- package/dist/components/admin/site-health/site-health-mock-context.js +8 -0
- package/dist/components/admin/site-health/site-health-on-site-seo.js +6 -0
- package/dist/components/admin/site-health/site-health-overview.js +6 -0
- package/dist/components/admin/site-health/site-health-performance.js +6 -0
- package/dist/components/admin/site-health/site-health-security.js +6 -0
- package/dist/components/admin/site-health/site-health-seo.js +6 -0
- package/dist/components/admin/site-health/site-health-template.js +28 -0
- package/dist/components/admin/site-health/site-health-uptime.js +6 -0
- package/dist/components/config/config.js +41 -2
- package/dist/components/config/config.server.js +8 -0
- package/dist/components/general/404.js +6 -0
- package/dist/components/general/accordion.js +11 -0
- package/dist/components/general/buzzwordbingo.js +18 -0
- package/dist/components/general/callout.js +65 -2
- package/dist/components/general/carousel.drag.js +12 -0
- package/dist/components/general/carousel.js +50 -0
- package/dist/components/general/faq-accordion.js +15 -0
- package/dist/components/general/global-error.js +12 -0
- package/dist/components/general/hero.js +13 -0
- package/dist/components/general/loading.js +10 -1
- package/dist/components/general/markdown.js +6 -0
- package/dist/components/general/menu-accordion.js +30 -1
- package/dist/components/general/menu-expando.js +24 -1
- package/dist/components/general/menu-simple.js +21 -0
- package/dist/components/general/metadata.components.js +10 -0
- package/dist/components/general/metadata.functions.js +1 -1
- package/dist/components/general/microinteractions.js +22 -0
- package/dist/components/general/modal.js +12 -0
- package/dist/components/general/nerdjoke.js +11 -1
- package/dist/components/general/proxy-handler.js +7 -7
- package/dist/components/general/recipe.js +46 -1
- package/dist/components/general/resume.js +82 -0
- package/dist/components/general/schema-blogposting.js +6 -0
- package/dist/components/general/schema-localbusiness.js +36 -0
- package/dist/components/general/schema-recipe.js +20 -0
- package/dist/components/general/semantic.js +178 -0
- package/dist/components/general/sidepanel.js +26 -0
- package/dist/components/general/sitemap.js +50 -0
- package/dist/components/general/skeleton-loading.js +10 -1
- package/dist/components/general/skeleton.js +15 -0
- package/dist/components/general/smartimage.js +48 -2
- package/dist/components/general/splitscroll.js +21 -10
- package/dist/components/general/styleguide.js +6 -0
- package/dist/components/general/tab.js +12 -0
- package/dist/components/general/table.js +12 -0
- package/dist/components/general/tiles.js +32 -1
- package/dist/components/general/timeline.js +22 -0
- package/dist/components/general/well-known.js +137 -0
- package/dist/components/integrations/calendly.js +10 -0
- package/dist/components/integrations/cloudinary.js +16 -0
- package/dist/components/integrations/contentful.delivery.js +84 -0
- package/dist/components/integrations/contentful.items.components.js +46 -0
- package/dist/components/integrations/contentful.management.js +25 -25
- package/dist/components/integrations/flickr.js +34 -0
- package/dist/components/integrations/google.reviews.components.js +14 -0
- package/dist/components/integrations/googleanalytics.js +14 -0
- package/dist/components/integrations/googlemap.js +20 -0
- package/dist/components/integrations/googlesearch.js +6 -0
- package/dist/components/integrations/gravatar.components.js +59 -0
- package/dist/components/integrations/hubspot.components.js +30 -0
- package/dist/components/integrations/instagram.components.js +18 -0
- package/dist/components/integrations/lipsum.js +45 -0
- package/dist/components/integrations/loremipsum.js +12 -0
- package/dist/components/integrations/socialcard.js +20 -1
- package/dist/components/integrations/wordpress.components.js +40 -0
- package/dist/components/integrations/wordpress.functions.js +24 -0
- package/dist/components/integrations/yelp.js +8 -0
- package/dist/components/shoppingcart/ebay.components.js +70 -0
- package/dist/components/shoppingcart/ebay.functions.js +52 -0
- package/dist/components/shoppingcart/shoppingcart.components.js +89 -0
- package/dist/components/sitebuilder/config/CompoundFontSelector.js +32 -0
- package/dist/components/sitebuilder/config/ConfigBuilder.js +8 -0
- package/dist/components/sitebuilder/config/FontSelector.js +40 -0
- package/dist/components/sitebuilder/form/formbuilder.js +10 -1
- package/dist/components/sitebuilder/form/formcomponents.js +325 -6
- package/dist/components/sitebuilder/form/formengine.js +35 -1
- package/dist/components/sitebuilder/form/formextractor.js +33 -1
- package/dist/components/sitebuilder/form/formutils.js +0 -4
- package/dist/components/sitebuilder/form/formvalidator.js +6 -0
- package/dist/components/sitebuilder/page/components/ComponentPropertiesForm.js +8 -0
- package/dist/components/sitebuilder/page/components/ComponentSelector.js +10 -0
- package/dist/components/sitebuilder/page/components/ComponentTree.js +20 -0
- package/dist/components/sitebuilder/page/components/PageBuilderUI.js +6 -0
- package/dist/components/sitebuilder/page/components/PageEngine.js +20 -0
- package/dist/components/sitebuilder/page/components/SaveLoadSection.js +10 -0
- package/dist/components/sitebuilder/page/lib/pageStorageContentful.js +4 -4
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/index.js +1 -1
- package/dist/index.server.js +4 -4
- package/dist/scripts/pixelated-eslint-plugin.js +105 -1
- package/dist/scripts/release.sh +12 -21
- package/dist/types/components/admin/componentusage/componentAnalysis.d.ts +2 -5
- package/dist/types/components/admin/componentusage/componentAnalysis.d.ts.map +1 -1
- package/dist/types/components/admin/deploy/deployment.integration.d.ts +1 -5
- package/dist/types/components/admin/deploy/deployment.integration.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-accessibility.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-accessibility.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-axe-core.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-axe-core.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-cloudwatch.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-cloudwatch.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-dependency-vulnerabilities.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-dependency-vulnerabilities.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-github.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-github.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-github.integration.d.ts +1 -11
- package/dist/types/components/admin/site-health/site-health-github.integration.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-google-analytics.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-google-analytics.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-google-search-console.d.ts +3 -0
- package/dist/types/components/admin/site-health/site-health-google-search-console.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-mock-context.d.ts +8 -0
- package/dist/types/components/admin/site-health/site-health-mock-context.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-on-site-seo.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-on-site-seo.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-overview.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-overview.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-performance.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-performance.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-security.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-security.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-seo.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-seo.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-template.d.ts +12 -0
- package/dist/types/components/admin/site-health/site-health-template.d.ts.map +1 -1
- package/dist/types/components/admin/site-health/site-health-uptime.d.ts +1 -0
- package/dist/types/components/admin/site-health/site-health-uptime.d.ts.map +1 -1
- package/dist/types/components/admin/sites/sites.integration.d.ts +7 -1
- package/dist/types/components/admin/sites/sites.integration.d.ts.map +1 -1
- package/dist/types/components/config/config.d.ts.map +1 -1
- package/dist/types/components/config/config.server.d.ts +2 -0
- package/dist/types/components/config/config.server.d.ts.map +1 -1
- package/dist/types/components/config/config.types.d.ts +2 -2
- package/dist/types/components/config/config.types.d.ts.map +1 -1
- package/dist/types/components/general/404.d.ts +1 -0
- package/dist/types/components/general/404.d.ts.map +1 -1
- package/dist/types/components/general/accordion.d.ts +2 -0
- package/dist/types/components/general/accordion.d.ts.map +1 -1
- package/dist/types/components/general/buzzwordbingo.d.ts +3 -0
- package/dist/types/components/general/buzzwordbingo.d.ts.map +1 -1
- package/dist/types/components/general/callout.d.ts +24 -0
- package/dist/types/components/general/callout.d.ts.map +1 -1
- package/dist/types/components/general/carousel.d.ts +13 -0
- package/dist/types/components/general/carousel.d.ts.map +1 -1
- package/dist/types/components/general/carousel.drag.d.ts +4 -0
- package/dist/types/components/general/carousel.drag.d.ts.map +1 -1
- package/dist/types/components/general/faq-accordion.d.ts +5 -0
- package/dist/types/components/general/faq-accordion.d.ts.map +1 -1
- package/dist/types/components/general/global-error.d.ts +4 -0
- package/dist/types/components/general/global-error.d.ts.map +1 -1
- package/dist/types/components/general/hero.d.ts +4 -0
- package/dist/types/components/general/hero.d.ts.map +1 -1
- package/dist/types/components/general/loading.d.ts +1 -0
- package/dist/types/components/general/loading.d.ts.map +1 -1
- package/dist/types/components/general/markdown.d.ts +1 -0
- package/dist/types/components/general/markdown.d.ts.map +1 -1
- package/dist/types/components/general/menu-accordion.d.ts +7 -0
- package/dist/types/components/general/menu-accordion.d.ts.map +1 -1
- package/dist/types/components/general/menu-expando.d.ts +6 -0
- package/dist/types/components/general/menu-expando.d.ts.map +1 -1
- package/dist/types/components/general/menu-simple.d.ts +6 -0
- package/dist/types/components/general/menu-simple.d.ts.map +1 -1
- package/dist/types/components/general/metadata.components.d.ts +3 -0
- package/dist/types/components/general/metadata.components.d.ts.map +1 -1
- package/dist/types/components/general/microinteractions.d.ts +9 -0
- package/dist/types/components/general/microinteractions.d.ts.map +1 -1
- package/dist/types/components/general/modal.d.ts +4 -0
- package/dist/types/components/general/modal.d.ts.map +1 -1
- package/dist/types/components/general/nerdjoke.d.ts +2 -0
- package/dist/types/components/general/nerdjoke.d.ts.map +1 -1
- package/dist/types/components/general/proxy-handler.d.ts +7 -7
- package/dist/types/components/general/proxy-handler.d.ts.map +1 -1
- package/dist/types/components/general/recipe.d.ts +13 -0
- package/dist/types/components/general/recipe.d.ts.map +1 -1
- package/dist/types/components/general/resume.d.ts +21 -0
- package/dist/types/components/general/resume.d.ts.map +1 -1
- package/dist/types/components/general/schema-blogposting.d.ts +1 -0
- package/dist/types/components/general/schema-blogposting.d.ts.map +1 -1
- package/dist/types/components/general/schema-localbusiness.d.ts +16 -0
- package/dist/types/components/general/schema-localbusiness.d.ts.map +1 -1
- package/dist/types/components/general/schema-recipe.d.ts +1 -0
- package/dist/types/components/general/schema-recipe.d.ts.map +1 -1
- package/dist/types/components/general/semantic.d.ts +67 -0
- package/dist/types/components/general/semantic.d.ts.map +1 -1
- package/dist/types/components/general/sidepanel.d.ts +11 -0
- package/dist/types/components/general/sidepanel.d.ts.map +1 -1
- package/dist/types/components/general/sitemap.d.ts +19 -0
- package/dist/types/components/general/sitemap.d.ts.map +1 -1
- package/dist/types/components/general/skeleton-loading.d.ts +3 -6
- package/dist/types/components/general/skeleton-loading.d.ts.map +1 -1
- package/dist/types/components/general/skeleton.d.ts +5 -0
- package/dist/types/components/general/skeleton.d.ts.map +1 -1
- package/dist/types/components/general/smartimage.d.ts +22 -0
- package/dist/types/components/general/smartimage.d.ts.map +1 -1
- package/dist/types/components/general/splitscroll.d.ts +18 -40
- package/dist/types/components/general/splitscroll.d.ts.map +1 -1
- package/dist/types/components/general/styleguide.d.ts +1 -0
- package/dist/types/components/general/styleguide.d.ts.map +1 -1
- package/dist/types/components/general/tab.d.ts +4 -0
- package/dist/types/components/general/tab.d.ts.map +1 -1
- package/dist/types/components/general/table.d.ts +4 -0
- package/dist/types/components/general/table.d.ts.map +1 -1
- package/dist/types/components/general/tiles.d.ts +12 -1
- package/dist/types/components/general/tiles.d.ts.map +1 -1
- package/dist/types/components/general/timeline.d.ts +5 -0
- package/dist/types/components/general/timeline.d.ts.map +1 -1
- package/dist/types/components/general/well-known.d.ts +56 -0
- package/dist/types/components/general/well-known.d.ts.map +1 -0
- package/dist/types/components/integrations/calendly.d.ts +3 -0
- package/dist/types/components/integrations/calendly.d.ts.map +1 -1
- package/dist/types/components/integrations/cloudinary.d.ts +4 -0
- package/dist/types/components/integrations/cloudinary.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.delivery.d.ts +22 -0
- package/dist/types/components/integrations/contentful.delivery.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.items.components.d.ts +10 -0
- package/dist/types/components/integrations/contentful.items.components.d.ts.map +1 -1
- package/dist/types/components/integrations/contentful.management.d.ts +1 -5
- package/dist/types/components/integrations/contentful.management.d.ts.map +1 -1
- package/dist/types/components/integrations/flickr.d.ts +11 -0
- package/dist/types/components/integrations/flickr.d.ts.map +1 -1
- package/dist/types/components/integrations/google.reviews.components.d.ts +5 -0
- package/dist/types/components/integrations/google.reviews.components.d.ts.map +1 -1
- package/dist/types/components/integrations/googleanalytics.d.ts +3 -0
- package/dist/types/components/integrations/googleanalytics.d.ts.map +1 -1
- package/dist/types/components/integrations/googlemap.d.ts +8 -0
- package/dist/types/components/integrations/googlemap.d.ts.map +1 -1
- package/dist/types/components/integrations/googlesearch.d.ts +1 -0
- package/dist/types/components/integrations/googlesearch.d.ts.map +1 -1
- package/dist/types/components/integrations/gravatar.components.d.ts +35 -0
- package/dist/types/components/integrations/gravatar.components.d.ts.map +1 -1
- package/dist/types/components/integrations/hubspot.components.d.ts +9 -0
- package/dist/types/components/integrations/hubspot.components.d.ts.map +1 -1
- package/dist/types/components/integrations/instagram.components.d.ts +7 -0
- package/dist/types/components/integrations/instagram.components.d.ts.map +1 -1
- package/dist/types/components/integrations/lipsum.d.ts +14 -0
- package/dist/types/components/integrations/lipsum.d.ts.map +1 -0
- package/dist/types/components/integrations/loremipsum.d.ts +4 -0
- package/dist/types/components/integrations/loremipsum.d.ts.map +1 -1
- package/dist/types/components/integrations/socialcard.d.ts +4 -0
- package/dist/types/components/integrations/socialcard.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.components.d.ts +14 -0
- package/dist/types/components/integrations/wordpress.components.d.ts.map +1 -1
- package/dist/types/components/integrations/wordpress.functions.d.ts +6 -0
- package/dist/types/components/integrations/wordpress.functions.d.ts.map +1 -1
- package/dist/types/components/integrations/yelp.d.ts +2 -0
- package/dist/types/components/integrations/yelp.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.components.d.ts +15 -0
- package/dist/types/components/shoppingcart/ebay.components.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/ebay.functions.d.ts +14 -2
- package/dist/types/components/shoppingcart/ebay.functions.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/paypal.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts +30 -0
- package/dist/types/components/shoppingcart/shoppingcart.components.d.ts.map +1 -1
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts +20 -12
- package/dist/types/components/shoppingcart/shoppingcart.functions.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/CompoundFontSelector.d.ts +12 -0
- package/dist/types/components/sitebuilder/config/CompoundFontSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/ConfigBuilder.d.ts +2 -0
- package/dist/types/components/sitebuilder/config/ConfigBuilder.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/config/FontSelector.d.ts +16 -0
- package/dist/types/components/sitebuilder/config/FontSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formbuilder.d.ts +5 -1
- package/dist/types/components/sitebuilder/form/formbuilder.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formcomponents.d.ts +129 -0
- package/dist/types/components/sitebuilder/form/formcomponents.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formengine.d.ts +5 -0
- package/dist/types/components/sitebuilder/form/formengine.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formextractor.d.ts +6 -0
- package/dist/types/components/sitebuilder/form/formextractor.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formutils.d.ts +0 -2
- package/dist/types/components/sitebuilder/form/formutils.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/form/formvalidator.d.ts +1 -0
- package/dist/types/components/sitebuilder/form/formvalidator.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentPropertiesForm.d.ts +2 -0
- package/dist/types/components/sitebuilder/page/components/ComponentPropertiesForm.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentSelector.d.ts +3 -0
- package/dist/types/components/sitebuilder/page/components/ComponentSelector.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/ComponentTree.d.ts +8 -0
- package/dist/types/components/sitebuilder/page/components/ComponentTree.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/PageBuilderUI.d.ts +1 -0
- package/dist/types/components/sitebuilder/page/components/PageBuilderUI.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/PageEngine.d.ts +8 -0
- package/dist/types/components/sitebuilder/page/components/PageEngine.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/components/SaveLoadSection.d.ts +3 -0
- package/dist/types/components/sitebuilder/page/components/SaveLoadSection.d.ts.map +1 -1
- package/dist/types/components/sitebuilder/page/lib/pageStorageContentful.d.ts +1 -1
- package/dist/types/components/sitebuilder/page/lib/pageStorageContentful.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.server.d.ts +4 -4
- package/dist/types/scripts/pixelated-eslint-plugin.d.ts +36 -0
- package/dist/types/stories/general/skeleton-loading.stories.d.ts +1 -1
- package/dist/types/stories/general/skeleton-loading.stories.d.ts.map +1 -1
- package/dist/types/stories/integrations/lipsum.stories.d.ts +38 -0
- package/dist/types/stories/integrations/lipsum.stories.d.ts.map +1 -0
- package/dist/types/stories/shoppingcart/shoppingcart.stories.d.ts +3 -1
- package/dist/types/stories/shoppingcart/shoppingcart.stories.d.ts.map +1 -1
- package/dist/types/tests/args.test.d.ts +2 -0
- package/dist/types/tests/args.test.d.ts.map +1 -0
- package/dist/types/tests/lipsum.test.d.ts +2 -0
- package/dist/types/tests/lipsum.test.d.ts.map +1 -0
- package/dist/types/tests/securitytxt.test.d.ts +2 -0
- package/dist/types/tests/securitytxt.test.d.ts.map +1 -0
- package/dist/types/tests/storybook-docgen.test.d.ts +2 -0
- package/dist/types/tests/storybook-docgen.test.d.ts.map +1 -0
- package/package.json +17 -14
- package/dist/components/config/config.utils.js +0 -52
- package/dist/components/general/humanstxt.js +0 -81
- package/dist/types/components/config/config.utils.d.ts +0 -6
- package/dist/types/components/config/config.utils.d.ts.map +0 -1
- package/dist/types/components/general/humanstxt.d.ts +0 -37
- package/dist/types/components/general/humanstxt.d.ts.map +0 -1
|
@@ -2,7 +2,13 @@ import PropTypes from "prop-types";
|
|
|
2
2
|
const debug = false;
|
|
3
3
|
const ctfQSParams = "?fm=webp&q=50";
|
|
4
4
|
/* ========== CALL CONTENTFUL DELIVERY API ========== */
|
|
5
|
+
/**
|
|
6
|
+
* callContentfulDeliveryAPI — Perform an HTTP GET against a fully-formed Contentful Delivery API URL and return parsed JSON.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} [props.full_url] - Full request URL to the Contentful Delivery API (include access token / query params).
|
|
9
|
+
*/
|
|
5
10
|
callContentfulDeliveryAPI.propTypes = {
|
|
11
|
+
/** Full request URL to the Contentful Delivery API */
|
|
6
12
|
full_url: PropTypes.string.isRequired,
|
|
7
13
|
};
|
|
8
14
|
export async function callContentfulDeliveryAPI(props) {
|
|
@@ -27,12 +33,28 @@ export async function callContentfulDeliveryAPI(props) {
|
|
|
27
33
|
return null;
|
|
28
34
|
}
|
|
29
35
|
/* ========== GET CONTENTFUL CARDS ========== */
|
|
36
|
+
/**
|
|
37
|
+
* getContentfulEntries — Fetch entries from Contentful using the supplied API configuration.
|
|
38
|
+
*
|
|
39
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
40
|
+
* @param {string} [props.proxyURL] - Optional proxy base URL to route requests through.
|
|
41
|
+
* @param {string} [props.base_url] - Contentful CDN base URL (e.g., https://cdn.contentful.com).
|
|
42
|
+
* @param {string} [props.space_id] - Contentful space ID.
|
|
43
|
+
* @param {string} [props.environment] - Contentful environment name (e.g., 'master').
|
|
44
|
+
* @param {string} [props.delivery_access_token] - Delivery API access token for read requests.
|
|
45
|
+
*/
|
|
30
46
|
getContentfulEntries.propTypes = {
|
|
47
|
+
/** Contentful API configuration */
|
|
31
48
|
apiProps: PropTypes.shape({
|
|
49
|
+
/** Optional proxy base URL */
|
|
32
50
|
proxyURL: PropTypes.string,
|
|
51
|
+
/** Contentful CDN base URL */
|
|
33
52
|
base_url: PropTypes.string.isRequired,
|
|
53
|
+
/** Contentful space ID */
|
|
34
54
|
space_id: PropTypes.string.isRequired,
|
|
55
|
+
/** Contentful environment */
|
|
35
56
|
environment: PropTypes.string.isRequired,
|
|
57
|
+
/** Delivery API access token */
|
|
36
58
|
delivery_access_token: PropTypes.string.isRequired,
|
|
37
59
|
}).isRequired,
|
|
38
60
|
};
|
|
@@ -49,7 +71,14 @@ export async function getContentfulEntries(props) {
|
|
|
49
71
|
https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection/get-all-entries-of-a-space/console/js-plain
|
|
50
72
|
*/
|
|
51
73
|
/* ========== GET CONTENTFUL CARDS BY TYPE ========== */
|
|
74
|
+
/**
|
|
75
|
+
* getContentfulEntriesByType — Filter entries by Contentful content type using provided API configuration.
|
|
76
|
+
*
|
|
77
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
78
|
+
* @param {string} [props.contentType] - Target content type ID to filter entries by.
|
|
79
|
+
*/
|
|
52
80
|
getContentfulEntriesByType.propTypes = {
|
|
81
|
+
/** Contentful API configuration */
|
|
53
82
|
apiProps: PropTypes.shape({
|
|
54
83
|
proxyURL: PropTypes.string,
|
|
55
84
|
base_url: PropTypes.string.isRequired,
|
|
@@ -57,6 +86,7 @@ getContentfulEntriesByType.propTypes = {
|
|
|
57
86
|
environment: PropTypes.string.isRequired,
|
|
58
87
|
delivery_access_token: PropTypes.string.isRequired,
|
|
59
88
|
}).isRequired,
|
|
89
|
+
/** Content type ID to filter by */
|
|
60
90
|
contentType: PropTypes.string.isRequired,
|
|
61
91
|
};
|
|
62
92
|
export async function getContentfulEntriesByType(props) {
|
|
@@ -74,7 +104,14 @@ export async function getContentfulEntriesByType(props) {
|
|
|
74
104
|
return allEntries;
|
|
75
105
|
}
|
|
76
106
|
/* ========== GET CONTENTFUL CARDS BY TYPE ========== */
|
|
107
|
+
/**
|
|
108
|
+
* getContentfulContentType — Retrieve metadata for a Contentful content type.
|
|
109
|
+
*
|
|
110
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
111
|
+
* @param {string} [props.contentType] - Contentful content type ID to retrieve.
|
|
112
|
+
*/
|
|
77
113
|
getContentfulContentType.propTypes = {
|
|
114
|
+
/** Contentful API configuration */
|
|
78
115
|
apiProps: PropTypes.shape({
|
|
79
116
|
proxyURL: PropTypes.string,
|
|
80
117
|
base_url: PropTypes.string.isRequired,
|
|
@@ -82,6 +119,7 @@ getContentfulContentType.propTypes = {
|
|
|
82
119
|
environment: PropTypes.string.isRequired,
|
|
83
120
|
access_token: PropTypes.string.isRequired,
|
|
84
121
|
}).isRequired,
|
|
122
|
+
/** Content type ID to retrieve */
|
|
85
123
|
contentType: PropTypes.string.isRequired,
|
|
86
124
|
};
|
|
87
125
|
export async function getContentfulContentType(props) {
|
|
@@ -94,7 +132,14 @@ export async function getContentfulContentType(props) {
|
|
|
94
132
|
return await callContentfulDeliveryAPI({ full_url });
|
|
95
133
|
}
|
|
96
134
|
/* ========== GET CONTENTFUL ENTRY BY ENTRY ID ========== */
|
|
135
|
+
/**
|
|
136
|
+
* getContentfulEntryByEntryID — Fetch a single Contentful entry by its entry ID.
|
|
137
|
+
*
|
|
138
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
139
|
+
* @param {string} [props.entry_id] - Contentful entry ID to fetch.
|
|
140
|
+
*/
|
|
97
141
|
getContentfulEntryByEntryID.propTypes = {
|
|
142
|
+
/** Contentful API configuration */
|
|
98
143
|
apiProps: PropTypes.shape({
|
|
99
144
|
proxyURL: PropTypes.string,
|
|
100
145
|
base_url: PropTypes.string.isRequired,
|
|
@@ -102,6 +147,7 @@ getContentfulEntryByEntryID.propTypes = {
|
|
|
102
147
|
environment: PropTypes.string.isRequired,
|
|
103
148
|
delivery_access_token: PropTypes.string.isRequired,
|
|
104
149
|
}).isRequired,
|
|
150
|
+
/** Target entry ID */
|
|
105
151
|
entry_id: PropTypes.string.isRequired,
|
|
106
152
|
};
|
|
107
153
|
export async function getContentfulEntryByEntryID(props) {
|
|
@@ -125,7 +171,15 @@ export async function getContentfulEntryByField(params) {
|
|
|
125
171
|
return null;
|
|
126
172
|
}
|
|
127
173
|
/* ========== GET CONTENTFUL CARD TITLES ========== */
|
|
174
|
+
/**
|
|
175
|
+
* getContentfulFieldValues — Return unique values for a field from entries of a given content type.
|
|
176
|
+
*
|
|
177
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
178
|
+
* @param {string} [props.contentType] - Contentful content type ID to inspect.
|
|
179
|
+
* @param {string} [props.field] - Field name to extract values from.
|
|
180
|
+
*/
|
|
128
181
|
getContentfulFieldValues.propTypes = {
|
|
182
|
+
/** Contentful API configuration */
|
|
129
183
|
apiProps: PropTypes.shape({
|
|
130
184
|
proxyURL: PropTypes.string,
|
|
131
185
|
base_url: PropTypes.string.isRequired,
|
|
@@ -133,7 +187,9 @@ getContentfulFieldValues.propTypes = {
|
|
|
133
187
|
environment: PropTypes.string.isRequired,
|
|
134
188
|
delivery_access_token: PropTypes.string.isRequired,
|
|
135
189
|
}).isRequired,
|
|
190
|
+
/** Content type ID to query */
|
|
136
191
|
contentType: PropTypes.string.isRequired,
|
|
192
|
+
/** Field name to extract values from */
|
|
137
193
|
field: PropTypes.string.isRequired,
|
|
138
194
|
};
|
|
139
195
|
export async function getContentfulFieldValues(props) {
|
|
@@ -147,8 +203,16 @@ export async function getContentfulFieldValues(props) {
|
|
|
147
203
|
return fieldVals;
|
|
148
204
|
}
|
|
149
205
|
/* ========== GET CONTENTFUL IMAGES FROM CARDS ========== */
|
|
206
|
+
/**
|
|
207
|
+
* getContentfulImagesFromEntries — Resolve image asset URLs and alt text for entry image references.
|
|
208
|
+
*
|
|
209
|
+
* @param {any} [props.images] - Entry image references (items with sys.id that map to assets).
|
|
210
|
+
* @param {any} [props.assets] - Array of Contentful asset objects to resolve URLs from.
|
|
211
|
+
*/
|
|
150
212
|
getContentfulImagesFromEntries.propTypes = {
|
|
213
|
+
/** Entry image references to resolve */
|
|
151
214
|
images: PropTypes.any.isRequired,
|
|
215
|
+
/** Contentful asset objects containing file URLs and descriptions */
|
|
152
216
|
assets: PropTypes.any.isRequired,
|
|
153
217
|
};
|
|
154
218
|
export async function getContentfulImagesFromEntries(props) {
|
|
@@ -166,7 +230,13 @@ export async function getContentfulImagesFromEntries(props) {
|
|
|
166
230
|
return imageURLs;
|
|
167
231
|
}
|
|
168
232
|
/* ========== GET CONTENTFUL ASSETS ========== */
|
|
233
|
+
/**
|
|
234
|
+
* getContentfulAssets — Fetch asset records from Contentful for the configured space/environment.
|
|
235
|
+
*
|
|
236
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
237
|
+
*/
|
|
169
238
|
getContentfulAssets.propTypes = {
|
|
239
|
+
/** Contentful API configuration */
|
|
170
240
|
apiProps: PropTypes.shape({
|
|
171
241
|
proxyURL: PropTypes.string,
|
|
172
242
|
base_url: PropTypes.string.isRequired,
|
|
@@ -184,7 +254,13 @@ export async function getContentfulAssets(props) {
|
|
|
184
254
|
return await callContentfulDeliveryAPI({ full_url });
|
|
185
255
|
}
|
|
186
256
|
/* ========== GET CONTENTFUL ASSET URLS ========== */
|
|
257
|
+
/**
|
|
258
|
+
* getContentfulAssetURLs — Return resolved asset URLs and metadata using provided API configuration.
|
|
259
|
+
*
|
|
260
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object.
|
|
261
|
+
*/
|
|
187
262
|
getContentfulAssetURLs.propTypes = {
|
|
263
|
+
/** Contentful API configuration */
|
|
188
264
|
apiProps: PropTypes.shape({
|
|
189
265
|
proxyURL: PropTypes.string,
|
|
190
266
|
base_url: PropTypes.string.isRequired,
|
|
@@ -207,7 +283,14 @@ export async function getContentfulAssetURLs(props) {
|
|
|
207
283
|
return assetURLs;
|
|
208
284
|
}
|
|
209
285
|
/* ========== GET CONTENTFUL DISCOUNT CODES ========== */
|
|
286
|
+
/**
|
|
287
|
+
* getContentfulDiscountCodes — Retrieve discount code entries from Contentful using the supplied API configuration.
|
|
288
|
+
*
|
|
289
|
+
* @param {shape} [props.apiProps] - Contentful API configuration object (base_url, space_id, environment, access tokens).
|
|
290
|
+
* @param {string} [props.contentType] - Contentful content type ID for discount codes (default: 'discountCodes').
|
|
291
|
+
*/
|
|
210
292
|
getContentfulDiscountCodes.propTypes = {
|
|
293
|
+
/** Contentful API configuration */
|
|
211
294
|
apiProps: PropTypes.shape({
|
|
212
295
|
proxyURL: PropTypes.string,
|
|
213
296
|
base_url: PropTypes.string.isRequired,
|
|
@@ -215,6 +298,7 @@ getContentfulDiscountCodes.propTypes = {
|
|
|
215
298
|
environment: PropTypes.string.isRequired,
|
|
216
299
|
delivery_access_token: PropTypes.string.isRequired,
|
|
217
300
|
}).isRequired,
|
|
301
|
+
/** Contentful content type ID to fetch */
|
|
218
302
|
contentType: PropTypes.string.isRequired,
|
|
219
303
|
};
|
|
220
304
|
export async function getContentfulDiscountCodes(props) {
|
|
@@ -24,8 +24,16 @@ let ContentfulApiProps = {
|
|
|
24
24
|
};
|
|
25
25
|
const contentfulContentType = "item";
|
|
26
26
|
/* ========== CONTENTFUL ITEMS PAGE ========== */
|
|
27
|
+
/**
|
|
28
|
+
* ContentfulItems — Fetch and render a list of Contentful items (carousel or list) using provided API configuration.
|
|
29
|
+
*
|
|
30
|
+
* @param {object} [props.apiProps] - Contentful API configuration (base_url, space_id, delivery_access_token, etc.).
|
|
31
|
+
* @param {string} [props.cloudinaryProductEnv] - Optional Cloudinary cloud name used to build remote fetch URLs for images.
|
|
32
|
+
*/
|
|
27
33
|
ContentfulItems.propTypes = {
|
|
34
|
+
/** Contentful API configuration object */
|
|
28
35
|
apiProps: PropTypes.object.isRequired,
|
|
36
|
+
/** Optional Cloudinary product environment (cloud name) for image transforms */
|
|
29
37
|
cloudinaryProductEnv: PropTypes.string,
|
|
30
38
|
};
|
|
31
39
|
export function ContentfulItems(props) {
|
|
@@ -44,9 +52,19 @@ export function ContentfulItems(props) {
|
|
|
44
52
|
const providerContentfulApiProps = usePixelatedConfig()?.contentful;
|
|
45
53
|
const mergedApiProps = { ...ContentfulApiProps, ...providerContentfulApiProps, ...props.apiProps, };
|
|
46
54
|
const [apiProps] = useState(mergedApiProps);
|
|
55
|
+
/**
|
|
56
|
+
* paintItems — Convert Contentful API items and assets into rendered list nodes.
|
|
57
|
+
*
|
|
58
|
+
* @param {array} [props.items] - Array of Contentful item entries.
|
|
59
|
+
* @param {array} [props.assets] - Array of Contentful asset objects used for resolving images.
|
|
60
|
+
* @param {string} [props.cloudinaryProductEnv] - Optional Cloudinary cloud name used to transform image URLs.
|
|
61
|
+
*/
|
|
47
62
|
paintItems.propTypes = {
|
|
63
|
+
/** Array of Contentful items */
|
|
48
64
|
items: PropTypes.array.isRequired,
|
|
65
|
+
/** Array of Contentful assets */
|
|
49
66
|
assets: PropTypes.array.isRequired,
|
|
67
|
+
/** Optional Cloudinary product environment */
|
|
50
68
|
cloudinaryProductEnv: PropTypes.string,
|
|
51
69
|
};
|
|
52
70
|
function paintItems(props) {
|
|
@@ -107,8 +125,16 @@ export function ContentfulItems(props) {
|
|
|
107
125
|
}
|
|
108
126
|
}
|
|
109
127
|
/* ========== CONTENTFUL LIST ITEM ========== */
|
|
128
|
+
/**
|
|
129
|
+
* ContentfulListItem — Render a single Contentful item with image, title and add-to-cart actions.
|
|
130
|
+
*
|
|
131
|
+
* @param {any} [props.item] - Single Contentful item entry to render.
|
|
132
|
+
* @param {string} [props.cloudinaryProductEnv] - Optional Cloudinary cloud name used to build image URLs.
|
|
133
|
+
*/
|
|
110
134
|
ContentfulListItem.propTypes = {
|
|
135
|
+
/** Contentful item entry object */
|
|
111
136
|
item: PropTypes.any.isRequired,
|
|
137
|
+
/** Optional Cloudinary product environment */
|
|
112
138
|
cloudinaryProductEnv: PropTypes.string,
|
|
113
139
|
};
|
|
114
140
|
export function ContentfulListItem(props) {
|
|
@@ -137,9 +163,19 @@ export function ContentfulListItem(props) {
|
|
|
137
163
|
: "$" + thisItem.fields.price + " USD" }), _jsx("br", {}), _jsxs("div", { className: "contentful-item-addtocart", children: [_jsx(ViewItemDetails, { href: "/store", itemID: thisItem.sys.id }), _jsx(AddToCartButton, { handler: addToShoppingCart, item: shoppingCartItem, itemID: thisItem.sys.id })] })] })] }));
|
|
138
164
|
}
|
|
139
165
|
/* ========== CONTENTFUL ITEM HEADER ========== */
|
|
166
|
+
/**
|
|
167
|
+
* ContentfulItemHeader — Render a title for a Contentful item and optionally wrap it in a link.
|
|
168
|
+
*
|
|
169
|
+
* @param {string} [props.title] - Item title text.
|
|
170
|
+
* @param {string} [props.url] - Optional URL to link the title to.
|
|
171
|
+
* @param {string} [props.target] - Optional link target attribute (e.g., '_blank').
|
|
172
|
+
*/
|
|
140
173
|
ContentfulItemHeader.propTypes = {
|
|
174
|
+
/** Item title text */
|
|
141
175
|
title: PropTypes.string.isRequired,
|
|
176
|
+
/** Optional link URL for the title */
|
|
142
177
|
url: PropTypes.string,
|
|
178
|
+
/** Link target attribute (e.g., '_blank') */
|
|
143
179
|
target: PropTypes.string,
|
|
144
180
|
};
|
|
145
181
|
export function ContentfulItemHeader(props) {
|
|
@@ -148,9 +184,19 @@ export function ContentfulItemHeader(props) {
|
|
|
148
184
|
: _jsx("h2", { className: "", children: props.title }) }));
|
|
149
185
|
}
|
|
150
186
|
/* ========== CONTENTFUL ITEM DETAIL PAGE ========== */
|
|
187
|
+
/**
|
|
188
|
+
* ContentfulItemDetail — Fetch and render a single Contentful item by entry ID.
|
|
189
|
+
*
|
|
190
|
+
* @param {object} [props.apiProps] - Contentful API configuration (base_url, space_id, delivery_access_token, etc.).
|
|
191
|
+
* @param {string} [props.entry_id] - Entry ID of the specific Contentful item to fetch.
|
|
192
|
+
* @param {string} [props.cloudinaryProductEnv] - Optional Cloudinary cloud name used to build image URLs.
|
|
193
|
+
*/
|
|
151
194
|
ContentfulItemDetail.propTypes = {
|
|
195
|
+
/** Contentful API configuration object */
|
|
152
196
|
apiProps: PropTypes.object.isRequired,
|
|
197
|
+
/** Entry ID of the item to fetch */
|
|
153
198
|
entry_id: PropTypes.string.isRequired,
|
|
199
|
+
/** Optional Cloudinary product env (cloud name) for image transforms */
|
|
154
200
|
cloudinaryProductEnv: PropTypes.string,
|
|
155
201
|
};
|
|
156
202
|
export function ContentfulItemDetail(props) {
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
* List all entries of a specific content type
|
|
8
8
|
*/
|
|
9
9
|
export async function listEntries(contentType, config) {
|
|
10
|
-
const {
|
|
10
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
11
11
|
try {
|
|
12
|
-
const response = await fetch(`https://api.contentful.com/spaces/${
|
|
12
|
+
const response = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries?content_type=${contentType}`, {
|
|
13
13
|
headers: {
|
|
14
|
-
'Authorization': `Bearer ${
|
|
14
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
15
15
|
'Content-Type': 'application/json',
|
|
16
16
|
},
|
|
17
17
|
});
|
|
@@ -37,11 +37,11 @@ export async function listEntries(contentType, config) {
|
|
|
37
37
|
* Get a single entry by ID
|
|
38
38
|
*/
|
|
39
39
|
export async function getEntryById(entryId, config) {
|
|
40
|
-
const {
|
|
40
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
41
41
|
try {
|
|
42
|
-
const response = await fetch(`https://api.contentful.com/spaces/${
|
|
42
|
+
const response = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${entryId}`, {
|
|
43
43
|
headers: {
|
|
44
|
-
'Authorization': `Bearer ${
|
|
44
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
45
45
|
'Content-Type': 'application/json',
|
|
46
46
|
},
|
|
47
47
|
});
|
|
@@ -71,11 +71,11 @@ export async function getEntryById(entryId, config) {
|
|
|
71
71
|
* Search for entries by field value
|
|
72
72
|
*/
|
|
73
73
|
export async function searchEntriesByField(contentType, fieldName, fieldValue, config) {
|
|
74
|
-
const {
|
|
74
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
75
75
|
try {
|
|
76
|
-
const response = await fetch(`https://api.contentful.com/spaces/${
|
|
76
|
+
const response = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries?content_type=${contentType}&fields.${fieldName}=${encodeURIComponent(fieldValue)}`, {
|
|
77
77
|
headers: {
|
|
78
|
-
'Authorization': `Bearer ${
|
|
78
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
79
79
|
'Content-Type': 'application/json',
|
|
80
80
|
},
|
|
81
81
|
});
|
|
@@ -101,17 +101,17 @@ export async function searchEntriesByField(contentType, fieldName, fieldValue, c
|
|
|
101
101
|
* Create a new entry
|
|
102
102
|
*/
|
|
103
103
|
export async function createEntry(contentType, fields, config, autoPublish = true) {
|
|
104
|
-
const {
|
|
104
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
105
105
|
try {
|
|
106
106
|
// Convert fields to Contentful format (with 'en-US' locale)
|
|
107
107
|
const contentfulFields = {};
|
|
108
108
|
for (const [key, value] of Object.entries(fields)) {
|
|
109
109
|
contentfulFields[key] = { 'en-US': value };
|
|
110
110
|
}
|
|
111
|
-
const createResponse = await fetch(`https://api.contentful.com/spaces/${
|
|
111
|
+
const createResponse = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries`, {
|
|
112
112
|
method: 'POST',
|
|
113
113
|
headers: {
|
|
114
|
-
'Authorization': `Bearer ${
|
|
114
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
115
115
|
'Content-Type': 'application/vnd.contentful.management.v1+json',
|
|
116
116
|
'X-Contentful-Content-Type': contentType,
|
|
117
117
|
},
|
|
@@ -126,10 +126,10 @@ export async function createEntry(contentType, fields, config, autoPublish = tru
|
|
|
126
126
|
const newEntry = await createResponse.json();
|
|
127
127
|
// Publish if requested
|
|
128
128
|
if (autoPublish) {
|
|
129
|
-
await fetch(`https://api.contentful.com/spaces/${
|
|
129
|
+
await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${newEntry.sys.id}/published`, {
|
|
130
130
|
method: 'PUT',
|
|
131
131
|
headers: {
|
|
132
|
-
'Authorization': `Bearer ${
|
|
132
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
133
133
|
'X-Contentful-Version': newEntry.sys.version.toString(),
|
|
134
134
|
},
|
|
135
135
|
});
|
|
@@ -151,7 +151,7 @@ export async function createEntry(contentType, fields, config, autoPublish = tru
|
|
|
151
151
|
* Update an existing entry
|
|
152
152
|
*/
|
|
153
153
|
export async function updateEntry(entryId, fields, config, autoPublish = true) {
|
|
154
|
-
const {
|
|
154
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
155
155
|
try {
|
|
156
156
|
// Get current entry to get version
|
|
157
157
|
const getResponse = await getEntryById(entryId, config);
|
|
@@ -167,10 +167,10 @@ export async function updateEntry(entryId, fields, config, autoPublish = true) {
|
|
|
167
167
|
for (const [key, value] of Object.entries(fields)) {
|
|
168
168
|
contentfulFields[key] = { 'en-US': value };
|
|
169
169
|
}
|
|
170
|
-
const updateResponse = await fetch(`https://api.contentful.com/spaces/${
|
|
170
|
+
const updateResponse = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${entryId}`, {
|
|
171
171
|
method: 'PUT',
|
|
172
172
|
headers: {
|
|
173
|
-
'Authorization': `Bearer ${
|
|
173
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
174
174
|
'Content-Type': 'application/vnd.contentful.management.v1+json',
|
|
175
175
|
'X-Contentful-Version': currentEntry.sys.version.toString(),
|
|
176
176
|
},
|
|
@@ -185,10 +185,10 @@ export async function updateEntry(entryId, fields, config, autoPublish = true) {
|
|
|
185
185
|
const updatedEntry = await updateResponse.json();
|
|
186
186
|
// Publish if requested
|
|
187
187
|
if (autoPublish) {
|
|
188
|
-
await fetch(`https://api.contentful.com/spaces/${
|
|
188
|
+
await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${entryId}/published`, {
|
|
189
189
|
method: 'PUT',
|
|
190
190
|
headers: {
|
|
191
|
-
'Authorization': `Bearer ${
|
|
191
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
192
192
|
'X-Contentful-Version': updatedEntry.sys.version.toString(),
|
|
193
193
|
},
|
|
194
194
|
});
|
|
@@ -210,7 +210,7 @@ export async function updateEntry(entryId, fields, config, autoPublish = true) {
|
|
|
210
210
|
* Delete an entry (unpublish first, then delete)
|
|
211
211
|
*/
|
|
212
212
|
export async function deleteEntry(entryId, config) {
|
|
213
|
-
const {
|
|
213
|
+
const { space_id, delivery_access_token, environment = 'master' } = config;
|
|
214
214
|
try {
|
|
215
215
|
// Get current entry to get version
|
|
216
216
|
const getResponse = await getEntryById(entryId, config);
|
|
@@ -222,18 +222,18 @@ export async function deleteEntry(entryId, config) {
|
|
|
222
222
|
}
|
|
223
223
|
const entry = getResponse.entry;
|
|
224
224
|
// Unpublish first
|
|
225
|
-
await fetch(`https://api.contentful.com/spaces/${
|
|
226
|
-
method: '
|
|
225
|
+
await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${entry.sys.id}/published`, {
|
|
226
|
+
method: 'PUT',
|
|
227
227
|
headers: {
|
|
228
|
-
'Authorization': `Bearer ${
|
|
228
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
229
229
|
'X-Contentful-Version': entry.sys.version.toString(),
|
|
230
230
|
},
|
|
231
231
|
});
|
|
232
232
|
// Delete the entry
|
|
233
|
-
const deleteResponse = await fetch(`https://api.contentful.com/spaces/${
|
|
233
|
+
const deleteResponse = await fetch(`https://api.contentful.com/spaces/${space_id}/environments/${environment}/entries/${entryId}`, {
|
|
234
234
|
method: 'DELETE',
|
|
235
235
|
headers: {
|
|
236
|
-
'Authorization': `Bearer ${
|
|
236
|
+
'Authorization': `Bearer ${delivery_access_token}`,
|
|
237
237
|
'X-Contentful-Version': (entry.sys.version + 1).toString(),
|
|
238
238
|
},
|
|
239
239
|
});
|
|
@@ -41,8 +41,16 @@ function getFlickrSize(size) {
|
|
|
41
41
|
default: return '';
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* GetFlickrData — Fetch image data from Flickr API using provided configuration.
|
|
46
|
+
*
|
|
47
|
+
* @param {object} [props.flickr] - Flickr-specific query overrides (method, tags, user_id, etc.).
|
|
48
|
+
* @param {object} [props.config] - Optional provider config to merge with defaults.
|
|
49
|
+
*/
|
|
44
50
|
GetFlickrData.propTypes = {
|
|
51
|
+
/** Flickr-specific query overrides */
|
|
45
52
|
flickr: PropTypes.object,
|
|
53
|
+
/** Optional provider configuration for Flickr requests */
|
|
46
54
|
config: PropTypes.object,
|
|
47
55
|
};
|
|
48
56
|
export function GetFlickrData(props) {
|
|
@@ -103,8 +111,16 @@ export function GetFlickrData(props) {
|
|
|
103
111
|
};
|
|
104
112
|
return fetchFlickrData();
|
|
105
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* GenerateFlickrCards — Convert raw Flickr image objects into card-friendly data structures.
|
|
116
|
+
*
|
|
117
|
+
* @param {array} [props.flickrImages] - Array of Flickr image objects returned by the API.
|
|
118
|
+
* @param {string} [props.photoSize] - Desired photo size label (e.g., 'Medium', 'Large').
|
|
119
|
+
*/
|
|
106
120
|
GenerateFlickrCards.propTypes = {
|
|
121
|
+
/** Flickr image array */
|
|
107
122
|
flickrImages: PropTypes.array.isRequired,
|
|
123
|
+
/** Desired photo size label */
|
|
108
124
|
photoSize: PropTypes.string.isRequired,
|
|
109
125
|
};
|
|
110
126
|
export function GenerateFlickrCards(props) {
|
|
@@ -121,13 +137,31 @@ export function GenerateFlickrCards(props) {
|
|
|
121
137
|
return flickrCards;
|
|
122
138
|
}
|
|
123
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* FlickrWrapper — Wrapper component that exposes Flickr query controls and renders fetched results.
|
|
142
|
+
*
|
|
143
|
+
* @param {string} [props.method] - Flickr API method to call (e.g., 'flickr.photos.search').
|
|
144
|
+
* @param {string} [props.api_key] - Flickr API key used for authentication.
|
|
145
|
+
* @param {string} [props.user_id] - Flickr user id to scope queries.
|
|
146
|
+
* @param {string} [props.tags] - Comma-separated tags to filter photos.
|
|
147
|
+
* @param {string} [props.photoset_id] - Photoset/album id to fetch specific album contents.
|
|
148
|
+
* @param {string} [props.photoSize] - Desired photo size label used by `getFlickrSize`.
|
|
149
|
+
* @param {function} [props.callback] - Optional callback function invoked after data fetch.
|
|
150
|
+
*/
|
|
124
151
|
FlickrWrapper.propTypes = {
|
|
152
|
+
/** Flickr API method */
|
|
125
153
|
method: PropTypes.string,
|
|
154
|
+
/** Flickr API key */
|
|
126
155
|
api_key: PropTypes.string.isRequired,
|
|
156
|
+
/** Flickr user id */
|
|
127
157
|
user_id: PropTypes.string.isRequired,
|
|
158
|
+
/** Tag filter string */
|
|
128
159
|
tags: PropTypes.string,
|
|
160
|
+
/** Photoset/album id */
|
|
129
161
|
photoset_id: PropTypes.string,
|
|
162
|
+
/** Desired photo size label (e.g., 'Medium', 'Large') */
|
|
130
163
|
photoSize: PropTypes.string,
|
|
164
|
+
/** Callback invoked with an array of Carousel cards after data is fetched */
|
|
131
165
|
callback: PropTypes.func.isRequired,
|
|
132
166
|
/* callback: (arg0: CarouselCardType[]) => void; */
|
|
133
167
|
};
|
|
@@ -6,11 +6,25 @@ import { SmartImage } from '../general/smartimage';
|
|
|
6
6
|
import { getGoogleReviewsByPlaceId } from './google.reviews.functions';
|
|
7
7
|
import { usePixelatedConfig } from '../config/config.client';
|
|
8
8
|
import './google.reviews.css';
|
|
9
|
+
/**
|
|
10
|
+
* GoogleReviewsCard — Fetch and display Google Place reviews for a specific Place ID.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} [props.placeId] - Google Place ID to fetch reviews for (required).
|
|
13
|
+
* @param {string} [props.language] - Optional language code to localize review text.
|
|
14
|
+
* @param {number} [props.maxReviews] - Maximum number of reviews to display.
|
|
15
|
+
* @param {string} [props.proxyBase] - Optional proxy base URL to avoid CORS restrictions.
|
|
16
|
+
* @param {string} [props.apiKey] - Optional Google API key to use when fetching reviews.
|
|
17
|
+
*/
|
|
9
18
|
GoogleReviewsCard.propTypes = {
|
|
19
|
+
/** Google Place ID (required) */
|
|
10
20
|
placeId: PropTypes.string.isRequired,
|
|
21
|
+
/** Language code for localization (optional) */
|
|
11
22
|
language: PropTypes.string,
|
|
23
|
+
/** Max number of reviews to display */
|
|
12
24
|
maxReviews: PropTypes.number,
|
|
25
|
+
/** Optional proxy base URL to avoid CORS issues */
|
|
13
26
|
proxyBase: PropTypes.string,
|
|
27
|
+
/** Optional Google API key */
|
|
14
28
|
apiKey: PropTypes.string,
|
|
15
29
|
};
|
|
16
30
|
export function GoogleReviewsCard(props) {
|
|
@@ -11,7 +11,13 @@ function isGA() {
|
|
|
11
11
|
const hasGAInitScriptID = !!(document.querySelector('script#ga-init'));
|
|
12
12
|
return (hasGtag || hasDataLayer || hasGAScript || hasGAScriptID || hasGAInitScriptID);
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* GoogleAnalytics — Inject Google Analytics gtag script and initialize with the given measurement id.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} [props.id] - Google Analytics measurement ID (e.g., 'G-XXXX') or omitted to use provider config.
|
|
18
|
+
*/
|
|
14
19
|
GoogleAnalytics.propTypes = {
|
|
20
|
+
/** Google Analytics measurement ID */
|
|
15
21
|
id: PropTypes.string,
|
|
16
22
|
};
|
|
17
23
|
export function GoogleAnalytics(props) {
|
|
@@ -55,8 +61,16 @@ ${adId ? `window.gtag('config', '${adId}');` : ''}
|
|
|
55
61
|
// }, []);
|
|
56
62
|
return (_jsx("div", { className: "ga", suppressHydrationWarning: true }));
|
|
57
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* GoogleAnalyticsEvent — Trigger a one-off Google Analytics event using gtag.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} [props.event_name] - Event name to send to GA (required).
|
|
68
|
+
* @param {object} [props.event_parameters] - Parameters associated with the event (required).
|
|
69
|
+
*/
|
|
58
70
|
GoogleAnalyticsEvent.propTypes = {
|
|
71
|
+
/** Event name for gtag */
|
|
59
72
|
event_name: PropTypes.string.isRequired,
|
|
73
|
+
/** Event parameter object */
|
|
60
74
|
event_parameters: PropTypes.object.isRequired,
|
|
61
75
|
};
|
|
62
76
|
export function GoogleAnalyticsEvent(props) {
|
|
@@ -2,14 +2,34 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { usePixelatedConfig } from "../config/config.client";
|
|
4
4
|
// https://developers.google.com/maps/documentation/embed/embedding-map
|
|
5
|
+
/**
|
|
6
|
+
* GoogleMaps — Embed a Google Maps iframe using the Maps Embed API.
|
|
7
|
+
*
|
|
8
|
+
* @param {string} [props.title] - Accessible iframe title.
|
|
9
|
+
* @param {string} [props.width] - Width of the iframe (e.g., '600' or '100%').
|
|
10
|
+
* @param {string} [props.height] - Height of the iframe (e.g., '400').
|
|
11
|
+
* @param {string} [props.frameBorder] - iframe frameBorder attribute.
|
|
12
|
+
* @param {object} [props.style] - Inline CSS styles applied to the iframe.
|
|
13
|
+
* @param {string} [props.map_mode] - Embed mode (e.g., 'place', 'search', 'directions').
|
|
14
|
+
* @param {string} [props.api_key] - Google Maps API key (falls back to config if omitted).
|
|
15
|
+
* @param {string} [props.parameters] - Additional query parameters for the embed URL (e.g., q=, center=, zoom=).
|
|
16
|
+
*/
|
|
5
17
|
GoogleMaps.propTypes = {
|
|
18
|
+
/** Accessible iframe title */
|
|
6
19
|
title: PropTypes.string,
|
|
20
|
+
/** iframe width (pixels or %) */
|
|
7
21
|
width: PropTypes.string,
|
|
22
|
+
/** iframe height (pixels) */
|
|
8
23
|
height: PropTypes.string,
|
|
24
|
+
/** iframe frameBorder attribute */
|
|
9
25
|
frameBorder: PropTypes.string,
|
|
26
|
+
/** Inline style object for the iframe */
|
|
10
27
|
style: PropTypes.object,
|
|
28
|
+
/** Maps embed mode (required) */
|
|
11
29
|
map_mode: PropTypes.string.isRequired,
|
|
30
|
+
/** Google Maps API key */
|
|
12
31
|
api_key: PropTypes.string,
|
|
32
|
+
/** Additional query parameters for the embed URL */
|
|
13
33
|
parameters: PropTypes.string,
|
|
14
34
|
};
|
|
15
35
|
export function GoogleMaps(props) {
|
|
@@ -18,7 +18,13 @@ https://stackoverflow.com/questions/15779036/auto-adding-gsc-tab-0-after-the-url
|
|
|
18
18
|
https://www.reddit.com/r/nextjs/comments/1gabiqn/hydration_error_when_installing_nextjs_15/?rdt=34262
|
|
19
19
|
https://nextjs.org/docs/messages/react-hydration-error
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* GoogleSearch — Embed a Google Programmable Search Engine (CSE) widget by id.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} [props.id] - The CSE 'cx' id to initialize the Programmable Search Engine (required).
|
|
25
|
+
*/
|
|
21
26
|
GoogleSearch.propTypes = {
|
|
27
|
+
/** CSE 'cx' id for the Google Programmable Search Engine */
|
|
22
28
|
id: PropTypes.string.isRequired,
|
|
23
29
|
};
|
|
24
30
|
export function GoogleSearch(props) {
|