@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,101 @@
|
|
|
1
|
+
/* ========================================
|
|
2
|
+
=============== FORMS ===============
|
|
3
|
+
======================================== */
|
|
4
|
+
|
|
5
|
+
label,
|
|
6
|
+
input,
|
|
7
|
+
textarea,
|
|
8
|
+
select,
|
|
9
|
+
form button {
|
|
10
|
+
font-size: 1.1em;
|
|
11
|
+
font-family: Verdana, Geneva, sans-serif;
|
|
12
|
+
padding: 2px 5px;
|
|
13
|
+
margin: 5px !important;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
outline: none;
|
|
16
|
+
border: 1px solid #CCC;
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.displayVertical,
|
|
21
|
+
span.displayVertical:last-child,
|
|
22
|
+
span.displayVertical:last-of-type {
|
|
23
|
+
display:block;
|
|
24
|
+
margin: 1px 5px 20px 20px !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
span.displayVertical {
|
|
28
|
+
display:block;
|
|
29
|
+
margin: 1px 5px 1px 20px !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
label {
|
|
33
|
+
border: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:focus,
|
|
37
|
+
textarea:focus,
|
|
38
|
+
select:focus,
|
|
39
|
+
form button:hover {
|
|
40
|
+
outline: none;
|
|
41
|
+
border: 1px solid #0C0;
|
|
42
|
+
-webkit-box-shadow: 0 0 5px 2px #CCC;
|
|
43
|
+
-moz-box-shadow: 0 0 5px 2px #CCC;
|
|
44
|
+
box-shadow: 0 0 5px 2px #CCC;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
form button,
|
|
48
|
+
form input[type = button],
|
|
49
|
+
form input[type = submit],
|
|
50
|
+
form input[type = reset] {
|
|
51
|
+
padding: 5px 20px;
|
|
52
|
+
-webkit-box-shadow: 0 0 5px 2px #CCC;
|
|
53
|
+
-moz-box-shadow: 0 0 5px 2px #CCC;
|
|
54
|
+
box-shadow: 0 0 5px 2px #CCC;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
form span {
|
|
58
|
+
font-size: 1.1em;
|
|
59
|
+
vertical-align: middle;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.tooltip {
|
|
63
|
+
display: inline;
|
|
64
|
+
margin-right: 10px;
|
|
65
|
+
position: relative;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.tooltipIcon {
|
|
69
|
+
/* display: inline;
|
|
70
|
+
color: white !important;
|
|
71
|
+
background-color: #369;
|
|
72
|
+
border-radius: 20px;
|
|
73
|
+
padding: 0 3px; */
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.tooltipIcon img {
|
|
78
|
+
width: 20px;
|
|
79
|
+
margin: 5px 0 0 -10px;
|
|
80
|
+
background-color: #DDD;
|
|
81
|
+
border-radius: 5px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.tooltipText {
|
|
85
|
+
display: none;
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: -25px;
|
|
88
|
+
left: 25px;
|
|
89
|
+
width: 200px;
|
|
90
|
+
padding: 3px 8px;
|
|
91
|
+
color: #fff;
|
|
92
|
+
text-align: center;
|
|
93
|
+
background-color: #666;
|
|
94
|
+
border: 1px solid white;
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
box-shadow: -3px 0 10px #369, 0 3px 10px #369, 3px 0 10px #369, 0 -3px 10px #369;
|
|
97
|
+
}
|
|
98
|
+
.tooltip a {
|
|
99
|
+
/* pointer-events: none; */
|
|
100
|
+
text-decoration: none;
|
|
101
|
+
}
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import * as FC from './formcomponents';
|
|
5
|
+
import * as FV from './formvalidations';
|
|
6
|
+
import { generateKey, capitalize, attributeMap } from '../../utilities/functions';
|
|
7
|
+
import './form.css';
|
|
8
|
+
const debug = false;
|
|
9
|
+
/* ===== FORM ENGINE =====
|
|
10
|
+
Generate all the elements to display a form */
|
|
11
|
+
FormEngine.propTypes = {
|
|
12
|
+
name: PropTypes.string,
|
|
13
|
+
id: PropTypes.string,
|
|
14
|
+
method: PropTypes.string,
|
|
15
|
+
onSubmitHandler: PropTypes.func,
|
|
16
|
+
formData: PropTypes.object.isRequired
|
|
17
|
+
};
|
|
18
|
+
export function FormEngine(props) {
|
|
19
|
+
function generateFormProps(props) {
|
|
20
|
+
// GENERATE PROPS TO RENDER THE FORM CONTAINER, INTERNAL FUNCTION
|
|
21
|
+
if (debug)
|
|
22
|
+
console.log("Generating Form Props");
|
|
23
|
+
const formProps = JSON.parse(JSON.stringify(props));
|
|
24
|
+
['formData', 'onSubmitHandler'].forEach(e => delete formProps[e]);
|
|
25
|
+
return formProps;
|
|
26
|
+
}
|
|
27
|
+
generateNewFields.propTypes = {
|
|
28
|
+
formData: PropTypes.any.isRequired,
|
|
29
|
+
};
|
|
30
|
+
function generateNewFields(props) {
|
|
31
|
+
// CORE OF THE FORM ENGINE - CONVERT JSON TO COMPONENTS - INTERNAL
|
|
32
|
+
if (debug)
|
|
33
|
+
console.log("Generating Form Fields");
|
|
34
|
+
const newFields = [];
|
|
35
|
+
const formFields = props.formData.fields;
|
|
36
|
+
if (props.formData && formFields) {
|
|
37
|
+
// const thisFields = formFields;
|
|
38
|
+
for (let field = 0; field < formFields.length; field++) {
|
|
39
|
+
const thisField = formFields[field];
|
|
40
|
+
const newProps = JSON.parse(JSON.stringify(thisField.props));
|
|
41
|
+
newProps.key = generateKey();
|
|
42
|
+
// Convert string numeric props to numbers where needed
|
|
43
|
+
const numericProps = ['maxLength', 'minLength', 'rows', 'cols', 'size', 'step'];
|
|
44
|
+
numericProps.forEach(prop => {
|
|
45
|
+
if (newProps[prop] !== undefined &&
|
|
46
|
+
newProps[prop] !== null &&
|
|
47
|
+
newProps[prop] !== '') {
|
|
48
|
+
// Only convert if the value is not already a number
|
|
49
|
+
if (typeof newProps[prop] === 'string') {
|
|
50
|
+
const num = Number(newProps[prop]);
|
|
51
|
+
if (!isNaN(num)) {
|
|
52
|
+
newProps[prop] = num;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const componentName = thisField.component;
|
|
58
|
+
const newElementType = FC[componentName];
|
|
59
|
+
const newElement = React.createElement(newElementType, newProps);
|
|
60
|
+
newFields.push(newElement);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return newFields;
|
|
64
|
+
}
|
|
65
|
+
function handleSubmit(event) {
|
|
66
|
+
// HANDLES THE FORM ACTION / FORM SUBMIT - EXPOSED EXTERNAL
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
if (props.onSubmitHandler)
|
|
69
|
+
props.onSubmitHandler(event);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
return (_jsx("form", { ...generateFormProps(props), onSubmit: (event) => { handleSubmit(event); }, suppressHydrationWarning: true, children: generateNewFields(props) }));
|
|
73
|
+
}
|
|
74
|
+
/* ===== FORM BUILDER =====
|
|
75
|
+
Display all the components for a Form Builder -
|
|
76
|
+
Element Buttons, Element Details, and the Form */
|
|
77
|
+
function mapTypeToComponent(myType) {
|
|
78
|
+
if (debug)
|
|
79
|
+
console.log("Mapping Type Field to Component");
|
|
80
|
+
let myComponent = (["button"].includes(myType)) ? 'FormButton' :
|
|
81
|
+
(["checkbox"].includes(myType)) ? 'FormCheckbox' :
|
|
82
|
+
(["datalist"].includes(myType)) ? 'FormDataList' :
|
|
83
|
+
(["radio"].includes(myType)) ? 'FormRadio' :
|
|
84
|
+
(["select"].includes(myType)) ? 'FormSelect' :
|
|
85
|
+
(["textarea"].includes(myType)) ? 'FormTextarea' :
|
|
86
|
+
"FormInput";
|
|
87
|
+
return myComponent;
|
|
88
|
+
}
|
|
89
|
+
export function FormBuilder() {
|
|
90
|
+
const [formData, setFormData] = useState({});
|
|
91
|
+
const [fieldFormData, setFieldFormData] = useState({});
|
|
92
|
+
function appendFormData(event) {
|
|
93
|
+
// APPEND JSON FOR NEW FIELD TO EXISTING JSON CONFIG OBJECT - EXPOSED EXTERNAL
|
|
94
|
+
if (debug)
|
|
95
|
+
console.log("Appending form Data...");
|
|
96
|
+
const props = {};
|
|
97
|
+
const target = event.target;
|
|
98
|
+
for (const prop in target) {
|
|
99
|
+
const thisProp = target[prop];
|
|
100
|
+
if (thisProp && thisProp.value && (thisProp.value !== Object(thisProp.value))) {
|
|
101
|
+
props[thisProp.name] = thisProp.value;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const field = {};
|
|
105
|
+
field.props = props;
|
|
106
|
+
field.component = mapTypeToComponent(field.props.type);
|
|
107
|
+
let fields = [];
|
|
108
|
+
if (Object.keys(formData).length > 0) {
|
|
109
|
+
fields = JSON.parse(JSON.stringify(formData.fields));
|
|
110
|
+
}
|
|
111
|
+
fields[fields.length] = field;
|
|
112
|
+
setFormData({ fields: fields });
|
|
113
|
+
setFieldFormData({});
|
|
114
|
+
return (field);
|
|
115
|
+
}
|
|
116
|
+
/* function getCircularReplacer() {
|
|
117
|
+
const seen = new WeakSet();
|
|
118
|
+
return (key, value) => {
|
|
119
|
+
if (typeof value === 'object' && value !== null) {
|
|
120
|
+
if (seen.has(value)) {
|
|
121
|
+
return ; // return undefined ;
|
|
122
|
+
}
|
|
123
|
+
seen.add(value);
|
|
124
|
+
}
|
|
125
|
+
return value;
|
|
126
|
+
};
|
|
127
|
+
} */
|
|
128
|
+
return (_jsxs("div", { className: "section-container", children: [_jsxs("div", { style: { display: 'inline-block', verticalAlign: 'top' }, children: [_jsx(FormBuild, { setFormData: setFieldFormData }), _jsx("div", {}), _jsx(FormEngine, { name: "field_props", id: "field_props", onSubmitHandler: appendFormData, formData: fieldFormData })] }), _jsx("div", { style: { display: 'inline-block', verticalAlign: 'top' }, children: _jsx("pre", { style: { width: '100%' }, children: JSON.stringify(formData, null, 2) }) }), _jsxs("div", { children: [_jsx("br", {}), _jsx("br", {}), _jsx("hr", {}), _jsx("br", {}), _jsx("br", {})] }), _jsx("div", { style: { display: 'block', verticalAlign: 'top' }, children: _jsx(FormEngine, { formData: formData || {} }) })] }));
|
|
129
|
+
}
|
|
130
|
+
/*
|
|
131
|
+
===== FORM BUILD =====
|
|
132
|
+
Dynamically generate, component by component, and prop by prop,
|
|
133
|
+
the JSON to create a form via FormEngine
|
|
134
|
+
*/
|
|
135
|
+
FormBuild.propTypes = {
|
|
136
|
+
setFormData: PropTypes.func.isRequired,
|
|
137
|
+
};
|
|
138
|
+
export function FormBuild(props) {
|
|
139
|
+
function generateFieldJSON(component, type) {
|
|
140
|
+
// GENERATE THE JSON TO DISPLAY A FORM TO ADD A FIELD - INTERNAL
|
|
141
|
+
if (debug)
|
|
142
|
+
console.log("Generating Form JSON for ", component, " Type : ", type);
|
|
143
|
+
const form = { fields: [] };
|
|
144
|
+
let i = 0;
|
|
145
|
+
for (const prop in FC[component].propTypes) {
|
|
146
|
+
const field = {};
|
|
147
|
+
field.component = 'FormInput';
|
|
148
|
+
const props = {};
|
|
149
|
+
props.label = prop;
|
|
150
|
+
props.name = prop;
|
|
151
|
+
props.id = prop;
|
|
152
|
+
props.type = 'text';
|
|
153
|
+
if (prop === 'type') {
|
|
154
|
+
props.disabled = true;
|
|
155
|
+
props.value = type;
|
|
156
|
+
props.list = 'inputTypes';
|
|
157
|
+
}
|
|
158
|
+
field.props = props;
|
|
159
|
+
form.fields[i] = field;
|
|
160
|
+
i++;
|
|
161
|
+
}
|
|
162
|
+
const addButton = {
|
|
163
|
+
component: 'FormButton',
|
|
164
|
+
props: {
|
|
165
|
+
label: 'Add ' + component,
|
|
166
|
+
type: 'submit',
|
|
167
|
+
id: 'Add ' + component,
|
|
168
|
+
text: 'Add ' + component
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
form.fields[i] = addButton;
|
|
172
|
+
return (form);
|
|
173
|
+
}
|
|
174
|
+
function handlePhaseOneSubmit(event) {
|
|
175
|
+
// GENERATE THE JSON TO DISPLAY A FORM TO ADD A FIELD - EXTERNAL
|
|
176
|
+
const target = event.target;
|
|
177
|
+
const myType = target.type.value;
|
|
178
|
+
const myComponent = mapTypeToComponent(myType);
|
|
179
|
+
const fieldJSON = generateFieldJSON(myComponent, myType);
|
|
180
|
+
props.setFormData(fieldJSON);
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
function generateTypeField() {
|
|
184
|
+
const form = {};
|
|
185
|
+
const typeField = {
|
|
186
|
+
component: 'FormInput',
|
|
187
|
+
props: {
|
|
188
|
+
label: 'Type : ',
|
|
189
|
+
name: 'type',
|
|
190
|
+
id: 'type',
|
|
191
|
+
type: 'text',
|
|
192
|
+
list: 'inputTypes'
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
const addButton = {
|
|
196
|
+
component: 'FormButton',
|
|
197
|
+
props: {
|
|
198
|
+
label: 'Build',
|
|
199
|
+
type: 'submit',
|
|
200
|
+
id: 'build',
|
|
201
|
+
text: '=== Build ==='
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
form.fields = [typeField, addButton];
|
|
205
|
+
return (form);
|
|
206
|
+
}
|
|
207
|
+
return (_jsx(_Fragment, { children: _jsx(FormEngine, { formData: generateTypeField(), onSubmitHandler: event => { handlePhaseOneSubmit(event); }, name: "build", id: "build", method: "post" }) }));
|
|
208
|
+
}
|
|
209
|
+
/*
|
|
210
|
+
===== FORM EXTRACT =====
|
|
211
|
+
Submit a page URL of a form to extract all form elements and
|
|
212
|
+
convert them to JSON to create a form via FormEngine
|
|
213
|
+
*/
|
|
214
|
+
FormExtractor.propTypes = {
|
|
215
|
+
url: PropTypes.string
|
|
216
|
+
};
|
|
217
|
+
export function FormExtractor(props) {
|
|
218
|
+
const [url, setURL] = useState(props.url || "");
|
|
219
|
+
const [htmlPaste, setHtmlPaste] = useState();
|
|
220
|
+
const [formData, setFormData] = useState({});
|
|
221
|
+
setParentState.propTypes = {
|
|
222
|
+
url: PropTypes.string.isRequired,
|
|
223
|
+
htmlPaste: PropTypes.string.isRequired,
|
|
224
|
+
};
|
|
225
|
+
function setParentState(childState) {
|
|
226
|
+
// SET STATE FROM PARENT VALUES - EXPOSED EXTERNAL
|
|
227
|
+
if (debug)
|
|
228
|
+
console.log("Setting Parent State...");
|
|
229
|
+
setURL(childState.url);
|
|
230
|
+
setHtmlPaste(childState.htmlPaste);
|
|
231
|
+
}
|
|
232
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "section-container", children: _jsx(FormExtractUI, { setParentState: setParentState }) }), _jsxs("div", { className: "section-container", children: [_jsx("br", {}), _jsx("br", {}), _jsx("hr", {}), _jsx("br", {}), _jsx("br", {})] }), _jsx("div", { className: "section-container", children: _jsx(FormExtractEngine, { url: url, htmlPaste: htmlPaste, setFormData: setFormData }) }), _jsxs("div", { className: "section-container", children: [_jsx("br", {}), _jsx("br", {}), _jsx("hr", {}), _jsx("br", {}), _jsx("br", {})] }), _jsx("div", { className: "section-container", children: _jsx(FormEngine, { formData: formData }) })] }));
|
|
233
|
+
}
|
|
234
|
+
FormExtractUI.propTypes = {
|
|
235
|
+
setParentState: PropTypes.func.isRequired
|
|
236
|
+
};
|
|
237
|
+
export function FormExtractUI(props) {
|
|
238
|
+
const [url, setURL] = useState();
|
|
239
|
+
const [htmlPaste, setHtmlPaste] = useState();
|
|
240
|
+
function onChange(event) {
|
|
241
|
+
// UPDATE URL OR HTML_PASTE ON CHANGE - EXTERNAL
|
|
242
|
+
if (debug)
|
|
243
|
+
console.log("Element Changed...");
|
|
244
|
+
const target = event.target;
|
|
245
|
+
if (target.name == "url") {
|
|
246
|
+
setURL(target.value);
|
|
247
|
+
}
|
|
248
|
+
else if (target.name == "htmlPaste") {
|
|
249
|
+
setHtmlPaste(target.value);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function onSubmit() {
|
|
253
|
+
// SET PARENT STATE WITH URL OR HTML PASTE - EXTERNAL
|
|
254
|
+
if (debug)
|
|
255
|
+
console.log("Form Submitted...");
|
|
256
|
+
props.setParentState({ url: url, htmlPaste: htmlPaste });
|
|
257
|
+
}
|
|
258
|
+
return (_jsxs("form", { onSubmit: e => { e.preventDefault(); }, method: "post", name: "extract", children: [_jsx("label", { htmlFor: "url", children: "URL : " }), _jsx("input", { type: "text", list: "form_urls", id: "url", name: "url", size: 100, onChange: onChange }), _jsx(FC.FormDataList, { id: 'form_urls', items: FV.formURLs }), _jsx("div", { style: { width: '100%', textAlign: 'center' }, children: "OR" }), _jsx("label", { htmlFor: "htmlPaste", children: "HTML : " }), _jsx("textarea", { id: "htmlPaste", name: "htmlPaste", rows: 10, cols: 80, onChange: onChange }), _jsx("br", {}), _jsxs("div", { style: { width: '100%', textAlign: 'center' }, children: [_jsx("button", { type: "button", onClick: onSubmit, children: "Extract" }), _jsx("input", { type: "reset" })] })] }));
|
|
259
|
+
}
|
|
260
|
+
FormExtractEngine.propTypes = {
|
|
261
|
+
url: PropTypes.string,
|
|
262
|
+
htmlPaste: PropTypes.string,
|
|
263
|
+
setFormData: PropTypes.func.isRequired
|
|
264
|
+
};
|
|
265
|
+
export function FormExtractEngine(props) {
|
|
266
|
+
const proxy = 'https://proxy.pixelated.tech/prod/proxy?url=';
|
|
267
|
+
// const proxy = "https://x3cf4kv0nk.execute-api.us-east-2.amazonaws.com/prod/proxy?url=";
|
|
268
|
+
// const proxy = "https://thingproxy.freeboard.io/fetch/";
|
|
269
|
+
const [url, setURL] = useState(props.url);
|
|
270
|
+
const [htmlPaste, setHtmlPaste] = useState(props.htmlPaste);
|
|
271
|
+
const [formJson, setFormJson] = useState();
|
|
272
|
+
function extractOptions(thisElement) {
|
|
273
|
+
// GENERATE OPTIONS FOR SELECT FIELD - INTERNAL
|
|
274
|
+
if (debug)
|
|
275
|
+
console.log("Extracting Options...");
|
|
276
|
+
if (thisElement.tagName.toLowerCase() === 'select' && thisElement.options && thisElement.options.length) {
|
|
277
|
+
const options = [];
|
|
278
|
+
for (let option = 0; option < thisElement.options.length; option++) {
|
|
279
|
+
const thisOption = thisElement.options[option];
|
|
280
|
+
const attribs = {};
|
|
281
|
+
for (let attrib = 0; attrib < thisOption.attributes.length; attrib++) {
|
|
282
|
+
const thisAttrib = thisOption.attributes[attrib];
|
|
283
|
+
attribs[attributeMap(thisAttrib.name)] = thisAttrib.value;
|
|
284
|
+
}
|
|
285
|
+
if (thisOption.innerText)
|
|
286
|
+
attribs.text = thisOption.innerText;
|
|
287
|
+
if (Object.keys(attribs).length > 0)
|
|
288
|
+
options.push(attribs); // not empty then add
|
|
289
|
+
}
|
|
290
|
+
if (options.length > 0)
|
|
291
|
+
return options;
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
function extractSelectedOptions(thisOptions) {
|
|
296
|
+
if (debug)
|
|
297
|
+
console.log("Extracting Selected Options...");
|
|
298
|
+
// GENERATE LIST OF SELECTED OPTIONS FOR SELECT FIELD - INTERNAL
|
|
299
|
+
if (thisOptions && thisOptions.length) {
|
|
300
|
+
const selected = [];
|
|
301
|
+
for (let option = 0; option < thisOptions.length; option++) {
|
|
302
|
+
const thisOption = thisOptions[option];
|
|
303
|
+
if (Object.prototype.hasOwnProperty.call(thisOption, 'selected')) {
|
|
304
|
+
selected.push(thisOption.value);
|
|
305
|
+
delete thisOptions[option].selected;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// MULTIPLE - Return array
|
|
309
|
+
if (selected.length > 1)
|
|
310
|
+
return selected;
|
|
311
|
+
// Not Multiple = return string
|
|
312
|
+
if (selected.length === 1)
|
|
313
|
+
return selected.toString();
|
|
314
|
+
}
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
function extractAttribs(thisElement) {
|
|
318
|
+
if (debug)
|
|
319
|
+
console.log("Extracting Attributes...");
|
|
320
|
+
// EXTRACT ALL ATTRIBUTES FOR A FORM ELEMENT - INTERNAL
|
|
321
|
+
// LOOK AT THAT - JAVASCRIPT REFLECTION!
|
|
322
|
+
if (thisElement && thisElement.attributes && thisElement.attributes.length) {
|
|
323
|
+
const props = {};
|
|
324
|
+
for (let attrib = 0; attrib < thisElement.attributes.length; attrib++) {
|
|
325
|
+
const thisAttrib = thisElement.attributes[attrib];
|
|
326
|
+
if (thisAttrib.name === 'style') {
|
|
327
|
+
// Do not gather styles
|
|
328
|
+
}
|
|
329
|
+
else if (['disabled', 'multiple', 'readonly', 'required', 'selected'].indexOf(thisAttrib.name.toLowerCase()) > -1) {
|
|
330
|
+
// Flag type Attributes
|
|
331
|
+
props[attributeMap(thisAttrib.name)] = attributeMap(thisAttrib.name);
|
|
332
|
+
}
|
|
333
|
+
else if (thisAttrib && thisAttrib.name && thisAttrib.value) {
|
|
334
|
+
// use attributeMap to map html props to React props
|
|
335
|
+
props[attributeMap(thisAttrib.name)] = thisAttrib.value;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (Object.keys(props).length > 0)
|
|
339
|
+
return props;
|
|
340
|
+
}
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
function extractLabel(html, thisElement) {
|
|
344
|
+
// IDENTIFY AND EXTRACT LABEL PROPERTIES FOR A SPECIFIC FIELD - INTERNAL
|
|
345
|
+
if (debug)
|
|
346
|
+
console.log("Extracting Label...");
|
|
347
|
+
const myElement = thisElement.attributes.getNamedItem('id');
|
|
348
|
+
if (myElement && myElement.value) {
|
|
349
|
+
const thisID = myElement.value;
|
|
350
|
+
const thisLabel = html.querySelector("label[for='" + thisID + "']");
|
|
351
|
+
if (thisLabel)
|
|
352
|
+
return thisLabel;
|
|
353
|
+
}
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
function formToJSON(html) {
|
|
357
|
+
// CONVERT HTML TO CONFIG JSON - INTERNAL
|
|
358
|
+
if (debug)
|
|
359
|
+
console.log("Converting Form to JSON...");
|
|
360
|
+
const json = {};
|
|
361
|
+
json.fields = [];
|
|
362
|
+
const forms = html.getElementsByTagName('form');
|
|
363
|
+
// ----- FORMS
|
|
364
|
+
for (let form = 0; form < forms.length; form++) {
|
|
365
|
+
const thisForm = forms[form];
|
|
366
|
+
if (Object.keys(thisForm).length > 0) {
|
|
367
|
+
// ----- ELEMENTS
|
|
368
|
+
for (let element = 0; element < thisForm.elements.length; element++) {
|
|
369
|
+
const thisElement = thisForm[element];
|
|
370
|
+
const elem = {};
|
|
371
|
+
if (thisElement && thisElement.attributes && thisElement.tagName) {
|
|
372
|
+
// ----- COMPONENT
|
|
373
|
+
elem.component = 'Form' + capitalize(thisElement.tagName);
|
|
374
|
+
let props = {};
|
|
375
|
+
// ----- ELEMENT ATTRIBUTES
|
|
376
|
+
const thisProps = extractAttribs(thisElement);
|
|
377
|
+
if (thisProps)
|
|
378
|
+
props = thisProps;
|
|
379
|
+
// ----- ELEMENT OPTIONS
|
|
380
|
+
const thisOptions = extractOptions(thisElement);
|
|
381
|
+
if (thisOptions) {
|
|
382
|
+
// only true for SELECT elements
|
|
383
|
+
const thisSelected = extractSelectedOptions(thisOptions);
|
|
384
|
+
if (thisSelected)
|
|
385
|
+
props.defaultValue = thisSelected;
|
|
386
|
+
props.options = thisOptions;
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
// get innerText on all but SELECT elements
|
|
390
|
+
if (thisElement.innerText)
|
|
391
|
+
props.text = thisElement.innerText;
|
|
392
|
+
}
|
|
393
|
+
elem.props = props;
|
|
394
|
+
// ----- LABEL
|
|
395
|
+
const thisLabel = extractLabel(html, thisElement);
|
|
396
|
+
if (thisLabel) {
|
|
397
|
+
elem.props.label = (thisLabel.innerText || thisLabel.textContent);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (Object.keys(elem).length > 0)
|
|
401
|
+
json.fields.push(elem);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return json;
|
|
406
|
+
}
|
|
407
|
+
function getHTML(url, callback) {
|
|
408
|
+
// GET SERVER SIDE HTML THROUGH XMLHTTPREQUEST - INTERNAL
|
|
409
|
+
if (debug)
|
|
410
|
+
console.log("Getting HTML From URL...");
|
|
411
|
+
const xhr = new XMLHttpRequest();
|
|
412
|
+
// xhr.onreadystatechange = (e) => {
|
|
413
|
+
xhr.onreadystatechange = () => {
|
|
414
|
+
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
415
|
+
const json = callback(xhr.responseXML);
|
|
416
|
+
setFormJson(json);
|
|
417
|
+
props.setFormData(json);
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
xhr.open('GET', url);
|
|
421
|
+
xhr.responseType = 'document';
|
|
422
|
+
xhr.send(null);
|
|
423
|
+
}
|
|
424
|
+
useEffect(() => {
|
|
425
|
+
if (debug)
|
|
426
|
+
console.log("Component Is Mounted...");
|
|
427
|
+
if (props.url) {
|
|
428
|
+
const newURL = proxy + props.url;
|
|
429
|
+
if (!url || (props.url !== url)) {
|
|
430
|
+
setURL(props.url);
|
|
431
|
+
getHTML(newURL, formToJSON);
|
|
432
|
+
}
|
|
433
|
+
else if (url && !formJson) {
|
|
434
|
+
getHTML(newURL, formToJSON);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
else if (props.htmlPaste) {
|
|
438
|
+
let json = {};
|
|
439
|
+
if (!htmlPaste || (props.htmlPaste !== htmlPaste)) {
|
|
440
|
+
setHtmlPaste(props.htmlPaste);
|
|
441
|
+
const thisHTML = new DOMParser().parseFromString(props.htmlPaste, 'text/html');
|
|
442
|
+
json = formToJSON(thisHTML);
|
|
443
|
+
setFormJson(json);
|
|
444
|
+
props.setFormData(json);
|
|
445
|
+
}
|
|
446
|
+
else if (htmlPaste && !formJson) {
|
|
447
|
+
const thisHTML = new DOMParser().parseFromString(htmlPaste, 'text/html');
|
|
448
|
+
json = formToJSON(thisHTML);
|
|
449
|
+
setFormJson(json);
|
|
450
|
+
props.setFormData(json);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}); // no dependencies = run on every render
|
|
454
|
+
return (_jsx("div", { children: _jsx("pre", { id: 'formJson', children: JSON.stringify(formJson, null, 2) }) }));
|
|
455
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
event.target.id = form id
|
|
3
|
+
event.body : {
|
|
4
|
+
to: "",
|
|
5
|
+
from: "",
|
|
6
|
+
subject: ""
|
|
7
|
+
}
|
|
8
|
+
*/
|
|
9
|
+
export async function emailFormData(e, callback) {
|
|
10
|
+
// const sendmail_api = "https://nlbqdrixmj.execute-api.us-east-2.amazonaws.com/default/sendmail";
|
|
11
|
+
const sendmail_api = "https://sendmail.pixelated.tech/default/sendmail";
|
|
12
|
+
const target = e.target;
|
|
13
|
+
const myform = document.getElementById(target.id);
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
const myFormData = {};
|
|
16
|
+
const formData = new FormData(myform);
|
|
17
|
+
for (const [key, value] of formData.entries()) {
|
|
18
|
+
myFormData[key] = value;
|
|
19
|
+
}
|
|
20
|
+
myFormData.Date = new Date().toLocaleDateString();
|
|
21
|
+
myFormData.Status = "Submitted";
|
|
22
|
+
await fetch(sendmail_api, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
mode: 'cors',
|
|
25
|
+
headers: {
|
|
26
|
+
Accept: 'application/json',
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify(myFormData),
|
|
30
|
+
})
|
|
31
|
+
.then((response) => {
|
|
32
|
+
if (response.status !== 200) {
|
|
33
|
+
throw new Error(response.statusText);
|
|
34
|
+
}
|
|
35
|
+
return response.json();
|
|
36
|
+
});
|
|
37
|
+
callback(e);
|
|
38
|
+
}
|
|
39
|
+
export async function emailJSON(jsonData, callback) {
|
|
40
|
+
// const sendmail_api = "https://nlbqdrixmj.execute-api.us-east-2.amazonaws.com/default/sendmail";
|
|
41
|
+
const sendmail_api = "https://sendmail.pixelated.tech/default/sendmail";
|
|
42
|
+
const myJsonData = {};
|
|
43
|
+
for (const [key, value] of Object.entries(jsonData)) {
|
|
44
|
+
myJsonData[key] = value;
|
|
45
|
+
}
|
|
46
|
+
myJsonData.Date = new Date().toLocaleDateString();
|
|
47
|
+
myJsonData.Status = "Submitted";
|
|
48
|
+
await fetch(sendmail_api, {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
mode: 'cors',
|
|
51
|
+
headers: {
|
|
52
|
+
Accept: 'application/json',
|
|
53
|
+
'Content-Type': 'application/json',
|
|
54
|
+
},
|
|
55
|
+
body: JSON.stringify(myJsonData),
|
|
56
|
+
})
|
|
57
|
+
.then(async (response) => {
|
|
58
|
+
if (response.status !== 200) {
|
|
59
|
+
throw new Error(response.statusText);
|
|
60
|
+
}
|
|
61
|
+
return await response.json();
|
|
62
|
+
});
|
|
63
|
+
if (callback)
|
|
64
|
+
callback();
|
|
65
|
+
}
|