@onepercentio/one-ui 0.1.2
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/WebpackConfigs/__snapshots__/email-templates.test.js.snap +9 -0
- package/WebpackConfigs/email-templates.js +251 -0
- package/WebpackConfigs/email-templates.test.js +53 -0
- package/WebpackConfigs/loaders/css-var-removal.js +44 -0
- package/WebpackConfigs/loaders/css-var-removal.test.ts +17 -0
- package/WebpackConfigs/loaders/static-loader.js +26 -0
- package/WebpackConfigs/loaders/svg-to-png.js +170 -0
- package/WebpackConfigs/scripts/css-inliner.ts +24 -0
- package/dist/__test__/utils.d.ts +1 -0
- package/dist/__test__/utils.js +14 -0
- package/dist/__test__/utils.js.map +1 -0
- package/dist/assets/img/svg/checkbox.svg +3 -0
- package/dist/assets/styles/index.scss +2 -0
- package/dist/assets/styles/mixins.scss +12 -0
- package/dist/assets/styles/variables.scss +49 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.d.ts +9 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +86 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js.map +1 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.module.scss +137 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.d.ts +19 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js +90 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js.map +1 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.d.ts +1 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js +15 -0
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js.map +1 -0
- package/dist/components/AdaptiveDialog/index.d.ts +1 -0
- package/dist/components/AdaptiveDialog/index.js +9 -0
- package/dist/components/AdaptiveDialog/index.js.map +1 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.d.ts +7 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +59 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +1 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +48 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.d.ts +15 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js +21 -0
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js.map +1 -0
- package/dist/components/AdaptiveSidebar/index.d.ts +1 -0
- package/dist/components/AdaptiveSidebar/index.js +9 -0
- package/dist/components/AdaptiveSidebar/index.js.map +1 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.d.ts +12 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js +162 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.js.map +1 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.module.scss +61 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.d.ts +16 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js +82 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js.map +1 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.d.ts +1 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js +20 -0
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js.map +1 -0
- package/dist/components/AnchoredTooltip/index.d.ts +1 -0
- package/dist/components/AnchoredTooltip/index.js +9 -0
- package/dist/components/AnchoredTooltip/index.js.map +1 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.d.ts +10 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.js +25 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.js.map +1 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.d.ts +18 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.js +34 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.js.map +1 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.test.d.ts +1 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.test.js +19 -0
- package/dist/components/AsyncWrapper/AsyncWrapper.test.js.map +1 -0
- package/dist/components/AsyncWrapper/index.d.ts +1 -0
- package/dist/components/AsyncWrapper/index.js +9 -0
- package/dist/components/AsyncWrapper/index.js.map +1 -0
- package/dist/components/Avatar/Avatar.d.ts +8 -0
- package/dist/components/Avatar/Avatar.js +41 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/Avatar.module.scss +19 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +14 -0
- package/dist/components/Avatar/Avatar.stories.js +19 -0
- package/dist/components/Avatar/Avatar.stories.js.map +1 -0
- package/dist/components/Avatar/Avatar.test.d.ts +1 -0
- package/dist/components/Avatar/Avatar.test.js +36 -0
- package/dist/components/Avatar/Avatar.test.js.map +1 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +9 -0
- package/dist/components/Avatar/index.js.map +1 -0
- package/dist/components/Button/Button.d.ts +7 -0
- package/dist/components/Button/Button.js +27 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.module.scss +42 -0
- package/dist/components/Button/Button.stories.d.ts +9 -0
- package/dist/components/Button/Button.stories.js +34 -0
- package/dist/components/Button/Button.stories.js.map +1 -0
- package/dist/components/Button/Button.test.d.ts +1 -0
- package/dist/components/Button/Button.test.js +15 -0
- package/dist/components/Button/Button.test.js.map +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +9 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Card/Card.d.ts +7 -0
- package/dist/components/Card/Card.js +15 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.module.scss +12 -0
- package/dist/components/Card/Card.stories.d.ts +15 -0
- package/dist/components/Card/Card.stories.js +16 -0
- package/dist/components/Card/Card.stories.js.map +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +9 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/CheckBox/CheckBox.d.ts +11 -0
- package/dist/components/CheckBox/CheckBox.js +32 -0
- package/dist/components/CheckBox/CheckBox.js.map +1 -0
- package/dist/components/CheckBox/CheckBox.module.scss +25 -0
- package/dist/components/CheckBox/CheckBox.stories.d.ts +20 -0
- package/dist/components/CheckBox/CheckBox.stories.js +30 -0
- package/dist/components/CheckBox/CheckBox.stories.js.map +1 -0
- package/dist/components/CheckBox/index.d.ts +1 -0
- package/dist/components/CheckBox/index.js +9 -0
- package/dist/components/CheckBox/index.js.map +1 -0
- package/dist/components/Collapsable/Collapsable.d.ts +33 -0
- package/dist/components/Collapsable/Collapsable.js +120 -0
- package/dist/components/Collapsable/Collapsable.js.map +1 -0
- package/dist/components/Collapsable/Collapsable.module.scss +33 -0
- package/dist/components/Collapsable/Collapsable.stories.d.ts +39 -0
- package/dist/components/Collapsable/Collapsable.stories.js +28 -0
- package/dist/components/Collapsable/Collapsable.stories.js.map +1 -0
- package/dist/components/Collapsable/index.d.ts +1 -0
- package/dist/components/Collapsable/index.js +9 -0
- package/dist/components/Collapsable/index.js.map +1 -0
- package/dist/components/Countdown/Countdown.d.ts +13 -0
- package/dist/components/Countdown/Countdown.js +76 -0
- package/dist/components/Countdown/Countdown.js.map +1 -0
- package/dist/components/Countdown/Countdown.stories.d.ts +14 -0
- package/dist/components/Countdown/Countdown.stories.js +32 -0
- package/dist/components/Countdown/Countdown.stories.js.map +1 -0
- package/dist/components/Countdown/index.d.ts +1 -0
- package/dist/components/Countdown/index.js +9 -0
- package/dist/components/Countdown/index.js.map +1 -0
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/Divider/Divider.js +16 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/Divider/Divider.module.scss +7 -0
- package/dist/components/Divider/Divider.stories.d.ts +7 -0
- package/dist/components/Divider/Divider.stories.js +15 -0
- package/dist/components/Divider/Divider.stories.js.map +1 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Divider/index.js +9 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmailInput/EmailInput.d.ts +20 -0
- package/dist/components/EmailInput/EmailInput.js +46 -0
- package/dist/components/EmailInput/EmailInput.js.map +1 -0
- package/dist/components/EmailInput/EmailInput.module.scss +0 -0
- package/dist/components/EmailInput/EmailInput.stories.d.ts +24 -0
- package/dist/components/EmailInput/EmailInput.stories.js +15 -0
- package/dist/components/EmailInput/EmailInput.stories.js.map +1 -0
- package/dist/components/EmailInput/EmailInput.test.d.ts +1 -0
- package/dist/components/EmailInput/EmailInput.test.js +73 -0
- package/dist/components/EmailInput/EmailInput.test.js.map +1 -0
- package/dist/components/EmailInput/index.d.ts +1 -0
- package/dist/components/EmailInput/index.js +9 -0
- package/dist/components/EmailInput/index.js.map +1 -0
- package/dist/components/FadeIn/FadeIn.d.ts +10 -0
- package/dist/components/FadeIn/FadeIn.js +60 -0
- package/dist/components/FadeIn/FadeIn.js.map +1 -0
- package/dist/components/FadeIn/FadeIn.module.scss +18 -0
- package/dist/components/FadeIn/FadeIn.stories.d.ts +24 -0
- package/dist/components/FadeIn/FadeIn.stories.js +16 -0
- package/dist/components/FadeIn/FadeIn.stories.js.map +1 -0
- package/dist/components/FadeIn/FadeIn.test.d.ts +1 -0
- package/dist/components/FadeIn/FadeIn.test.js +22 -0
- package/dist/components/FadeIn/FadeIn.test.js.map +1 -0
- package/dist/components/FadeIn/index.d.ts +1 -0
- package/dist/components/FadeIn/index.js +9 -0
- package/dist/components/FadeIn/index.js.map +1 -0
- package/dist/components/FileInput/FileInput.d.ts +13 -0
- package/dist/components/FileInput/FileInput.js +71 -0
- package/dist/components/FileInput/FileInput.js.map +1 -0
- package/dist/components/FileInput/FileInput.module.scss +27 -0
- package/dist/components/FileInput/FileInput.stories.d.ts +19 -0
- package/dist/components/FileInput/FileInput.stories.js +55 -0
- package/dist/components/FileInput/FileInput.stories.js.map +1 -0
- package/dist/components/FileInput/index.d.ts +1 -0
- package/dist/components/FileInput/index.js +9 -0
- package/dist/components/FileInput/index.js.map +1 -0
- package/dist/components/FlowController/FlowController.d.ts +23 -0
- package/dist/components/FlowController/FlowController.js +34 -0
- package/dist/components/FlowController/FlowController.js.map +1 -0
- package/dist/components/FlowController/FlowController.module.scss +47 -0
- package/dist/components/FlowController/FlowController.stories.d.ts +43 -0
- package/dist/components/FlowController/FlowController.stories.js +97 -0
- package/dist/components/FlowController/FlowController.stories.js.map +1 -0
- package/dist/components/FlowController/FlowController.test.d.ts +1 -0
- package/dist/components/FlowController/FlowController.test.js +166 -0
- package/dist/components/FlowController/FlowController.test.js.map +1 -0
- package/dist/components/FlowController/index.d.ts +1 -0
- package/dist/components/FlowController/index.js +9 -0
- package/dist/components/FlowController/index.js.map +1 -0
- package/dist/components/Freeze/Freeze.d.ts +5 -0
- package/dist/components/Freeze/Freeze.js +13 -0
- package/dist/components/Freeze/Freeze.js.map +1 -0
- package/dist/components/Freeze/Freeze.stories.d.ts +7 -0
- package/dist/components/Freeze/Freeze.stories.js +52 -0
- package/dist/components/Freeze/Freeze.stories.js.map +1 -0
- package/dist/components/Freeze/Freeze.test.d.ts +1 -0
- package/dist/components/Freeze/Freeze.test.js +15 -0
- package/dist/components/Freeze/Freeze.test.js.map +1 -0
- package/dist/components/Freeze/index.d.ts +1 -0
- package/dist/components/Freeze/index.js +9 -0
- package/dist/components/Freeze/index.js.map +1 -0
- package/dist/components/HSForms/HSForms.d.ts +5 -0
- package/dist/components/HSForms/HSForms.js +47 -0
- package/dist/components/HSForms/HSForms.js.map +1 -0
- package/dist/components/HSForms/index.d.ts +1 -0
- package/dist/components/HSForms/index.js +9 -0
- package/dist/components/HSForms/index.js.map +1 -0
- package/dist/components/Header/Header.d.ts +24 -0
- package/dist/components/Header/Header.js +71 -0
- package/dist/components/Header/Header.js.map +1 -0
- package/dist/components/Header/Header.module.scss +109 -0
- package/dist/components/Header/Header.stories.d.ts +27 -0
- package/dist/components/Header/Header.stories.js +41 -0
- package/dist/components/Header/Header.stories.js.map +1 -0
- package/dist/components/Header/Header.test.d.ts +1 -0
- package/dist/components/Header/Header.test.js +96 -0
- package/dist/components/Header/Header.test.js.map +1 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Header/index.js +9 -0
- package/dist/components/Header/index.js.map +1 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.d.ts +8 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js +17 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.js.map +1 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.module.scss +44 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.d.ts +14 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js +16 -0
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js.map +1 -0
- package/dist/components/HeaderCloseBtn/index.d.ts +1 -0
- package/dist/components/HeaderCloseBtn/index.js +9 -0
- package/dist/components/HeaderCloseBtn/index.js.map +1 -0
- package/dist/components/InfinityScroll/InfinityScroll.d.ts +11 -0
- package/dist/components/InfinityScroll/InfinityScroll.js +108 -0
- package/dist/components/InfinityScroll/InfinityScroll.js.map +1 -0
- package/dist/components/InfinityScroll/InfinityScroll.module.scss +30 -0
- package/dist/components/InfinityScroll/InfinityScroll.stories.d.ts +23 -0
- package/dist/components/InfinityScroll/InfinityScroll.stories.js +50 -0
- package/dist/components/InfinityScroll/InfinityScroll.stories.js.map +1 -0
- package/dist/components/InfinityScroll/InfinityScroll.test.d.ts +1 -0
- package/dist/components/InfinityScroll/InfinityScroll.test.js +185 -0
- package/dist/components/InfinityScroll/InfinityScroll.test.js.map +1 -0
- package/dist/components/InfinityScroll/index.d.ts +1 -0
- package/dist/components/InfinityScroll/index.js +9 -0
- package/dist/components/InfinityScroll/index.js.map +1 -0
- package/dist/components/Input/Input.d.ts +26 -0
- package/dist/components/Input/Input.js +82 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/Input.module.scss +68 -0
- package/dist/components/Input/Input.stories.d.ts +20 -0
- package/dist/components/Input/Input.stories.js +21 -0
- package/dist/components/Input/Input.stories.js.map +1 -0
- package/dist/components/Input/Input.test.d.ts +1 -0
- package/dist/components/Input/Input.test.js +54 -0
- package/dist/components/Input/Input.test.js.map +1 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.js +9 -0
- package/dist/components/Input/index.js.map +1 -0
- package/dist/components/Loader/Loader.d.ts +6 -0
- package/dist/components/Loader/Loader.js +18 -0
- package/dist/components/Loader/Loader.js.map +1 -0
- package/dist/components/Loader/Loader.module.scss +40 -0
- package/dist/components/Loader/Loader.stories.d.ts +12 -0
- package/dist/components/Loader/Loader.stories.js +16 -0
- package/dist/components/Loader/Loader.stories.js.map +1 -0
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/Loader/index.js +9 -0
- package/dist/components/Loader/index.js.map +1 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.d.ts +6 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js +38 -0
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.js.map +1 -0
- package/dist/components/LoaderDotsIndicator/index.d.ts +1 -0
- package/dist/components/LoaderDotsIndicator/index.js +9 -0
- package/dist/components/LoaderDotsIndicator/index.js.map +1 -0
- package/dist/components/MainGrid/MainGrid.d.ts +9 -0
- package/dist/components/MainGrid/MainGrid.js +52 -0
- package/dist/components/MainGrid/MainGrid.js.map +1 -0
- package/dist/components/MainGrid/MainGrid.module.scss +28 -0
- package/dist/components/MainGrid/MainGrid.stories.d.ts +13 -0
- package/dist/components/MainGrid/MainGrid.stories.js +66 -0
- package/dist/components/MainGrid/MainGrid.stories.js.map +1 -0
- package/dist/components/MainGrid/MainGrid.test.d.ts +1 -0
- package/dist/components/MainGrid/MainGrid.test.js +18 -0
- package/dist/components/MainGrid/MainGrid.test.js.map +1 -0
- package/dist/components/MainGrid/index.d.ts +1 -0
- package/dist/components/MainGrid/index.js +9 -0
- package/dist/components/MainGrid/index.js.map +1 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.d.ts +7 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js +18 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.js.map +1 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +82 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.d.ts +13 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js +16 -0
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js.map +1 -0
- package/dist/components/MutableHamburgerButton/index.d.ts +1 -0
- package/dist/components/MutableHamburgerButton/index.js +9 -0
- package/dist/components/MutableHamburgerButton/index.js.map +1 -0
- package/dist/components/Notification/Notification.d.ts +7 -0
- package/dist/components/Notification/Notification.js +16 -0
- package/dist/components/Notification/Notification.js.map +1 -0
- package/dist/components/Notification/Notification.module.scss +25 -0
- package/dist/components/Notification/Notification.stories.d.ts +15 -0
- package/dist/components/Notification/Notification.stories.js +19 -0
- package/dist/components/Notification/Notification.stories.js.map +1 -0
- package/dist/components/Notification/index.d.ts +1 -0
- package/dist/components/Notification/index.js +9 -0
- package/dist/components/Notification/index.js.map +1 -0
- package/dist/components/Parallax/Parallax.d.ts +15 -0
- package/dist/components/Parallax/Parallax.js +171 -0
- package/dist/components/Parallax/Parallax.js.map +1 -0
- package/dist/components/Parallax/Parallax.module.scss +28 -0
- package/dist/components/Parallax/Parallax.stories.d.ts +32 -0
- package/dist/components/Parallax/Parallax.stories.js +23 -0
- package/dist/components/Parallax/Parallax.stories.js.map +1 -0
- package/dist/components/Parallax/Parallax.test.d.ts +1 -0
- package/dist/components/Parallax/Parallax.test.js +22 -0
- package/dist/components/Parallax/Parallax.test.js.map +1 -0
- package/dist/components/Parallax/index.d.ts +1 -0
- package/dist/components/Parallax/index.js +9 -0
- package/dist/components/Parallax/index.js.map +1 -0
- package/dist/components/Parallax/math/helpers.d.ts +58 -0
- package/dist/components/Parallax/math/helpers.js +230 -0
- package/dist/components/Parallax/math/helpers.js.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +38 -0
- package/dist/components/PasswordInput/PasswordInput.js +102 -0
- package/dist/components/PasswordInput/PasswordInput.js.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.module.scss +11 -0
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.test.js +153 -0
- package/dist/components/PasswordInput/PasswordInput.test.js.map +1 -0
- package/dist/components/PasswordInput/index.d.ts +1 -0
- package/dist/components/PasswordInput/index.js +9 -0
- package/dist/components/PasswordInput/index.js.map +1 -0
- package/dist/components/PixelatedScan/PixelatedScan.d.ts +8 -0
- package/dist/components/PixelatedScan/PixelatedScan.js +101 -0
- package/dist/components/PixelatedScan/PixelatedScan.js.map +1 -0
- package/dist/components/PixelatedScan/PixelatedScan.module.scss +86 -0
- package/dist/components/PixelatedScan/PixelatedScan.stories.d.ts +15 -0
- package/dist/components/PixelatedScan/PixelatedScan.stories.js +40 -0
- package/dist/components/PixelatedScan/PixelatedScan.stories.js.map +1 -0
- package/dist/components/PixelatedScan/index.d.ts +1 -0
- package/dist/components/PixelatedScan/index.js +9 -0
- package/dist/components/PixelatedScan/index.js.map +1 -0
- package/dist/components/ProgressTexts/ProgressTexts.d.ts +22 -0
- package/dist/components/ProgressTexts/ProgressTexts.js +38 -0
- package/dist/components/ProgressTexts/ProgressTexts.js.map +1 -0
- package/dist/components/ProgressTexts/ProgressTexts.module.scss +37 -0
- package/dist/components/ProgressTexts/ProgressTexts.stories.d.ts +24 -0
- package/dist/components/ProgressTexts/ProgressTexts.stories.js +86 -0
- package/dist/components/ProgressTexts/ProgressTexts.stories.js.map +1 -0
- package/dist/components/ProgressTexts/ProgressTexts.test.d.ts +1 -0
- package/dist/components/ProgressTexts/ProgressTexts.test.js +52 -0
- package/dist/components/ProgressTexts/ProgressTexts.test.js.map +1 -0
- package/dist/components/ProgressTexts/index.d.ts +1 -0
- package/dist/components/ProgressTexts/index.js +9 -0
- package/dist/components/ProgressTexts/index.js.map +1 -0
- package/dist/components/Select/Select.d.ts +22 -0
- package/dist/components/Select/Select.js +72 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/Select.module.scss +47 -0
- package/dist/components/Select/Select.stories.d.ts +48 -0
- package/dist/components/Select/Select.stories.js +34 -0
- package/dist/components/Select/Select.stories.js.map +1 -0
- package/dist/components/Select/Select.test.d.ts +1 -0
- package/dist/components/Select/Select.test.js +12 -0
- package/dist/components/Select/Select.test.js.map +1 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +9 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Spacing/Spacing.d.ts +6 -0
- package/dist/components/Spacing/Spacing.js +15 -0
- package/dist/components/Spacing/Spacing.js.map +1 -0
- package/dist/components/Spacing/Spacing.module.scss +13 -0
- package/dist/components/Spacing/Spacing.stories.d.ts +7 -0
- package/dist/components/Spacing/Spacing.stories.js +35 -0
- package/dist/components/Spacing/Spacing.stories.js.map +1 -0
- package/dist/components/Spacing/index.d.ts +1 -0
- package/dist/components/Spacing/index.js +9 -0
- package/dist/components/Spacing/index.js.map +1 -0
- package/dist/components/Table/Table.d.ts +19 -0
- package/dist/components/Table/Table.js +84 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Table/Table.module.scss +76 -0
- package/dist/components/Table/Table.stories.d.ts +15 -0
- package/dist/components/Table/Table.stories.js +84 -0
- package/dist/components/Table/Table.stories.js.map +1 -0
- package/dist/components/Table/Table.test.d.ts +1 -0
- package/dist/components/Table/Table.test.js +35 -0
- package/dist/components/Table/Table.test.js.map +1 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +9 -0
- package/dist/components/Table/index.js.map +1 -0
- package/dist/components/Tabs/Tabs.d.ts +11 -0
- package/dist/components/Tabs/Tabs.js +45 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/Tabs.module.scss +22 -0
- package/dist/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/components/Tabs/Tabs.test.js +39 -0
- package/dist/components/Tabs/Tabs.test.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +9 -0
- package/dist/components/Tabs/index.js.map +1 -0
- package/dist/components/Text/Text.d.ts +8 -0
- package/dist/components/Text/Text.js +27 -0
- package/dist/components/Text/Text.js.map +1 -0
- package/dist/components/Text/Text.module.scss +77 -0
- package/dist/components/Text/Text.stories.d.ts +7 -0
- package/dist/components/Text/Text.stories.js +20 -0
- package/dist/components/Text/Text.stories.js.map +1 -0
- package/dist/components/Text/Text.test.d.ts +1 -0
- package/dist/components/Text/Text.test.js +12 -0
- package/dist/components/Text/Text.test.js.map +1 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/index.js +9 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Transition/Transition.d.ts +47 -0
- package/dist/components/Transition/Transition.js +223 -0
- package/dist/components/Transition/Transition.js.map +1 -0
- package/dist/components/Transition/Transition.module.scss +135 -0
- package/dist/components/Transition/Transition.stories.d.ts +10 -0
- package/dist/components/Transition/Transition.stories.js +29 -0
- package/dist/components/Transition/Transition.stories.js.map +1 -0
- package/dist/components/Transition/Transition.test.d.ts +1 -0
- package/dist/components/Transition/Transition.test.js +55 -0
- package/dist/components/Transition/Transition.test.js.map +1 -0
- package/dist/components/Transition/index.d.ts +1 -0
- package/dist/components/Transition/index.js +10 -0
- package/dist/components/Transition/index.js.map +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.d.ts +11 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js +95 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.js.map +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +28 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js +180 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js.map +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.module.scss +62 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.d.ts +1 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js +131 -0
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js.map +1 -0
- package/dist/components/UncontrolledTransition/index.d.ts +1 -0
- package/dist/components/UncontrolledTransition/index.js +9 -0
- package/dist/components/UncontrolledTransition/index.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.d.ts +35 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js +86 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.d.ts +47 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js +56 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.d.ts +1 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js +133 -0
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js.map +1 -0
- package/dist/components/WalletConnectionWrapper/index.d.ts +1 -0
- package/dist/components/WalletConnectionWrapper/index.js +9 -0
- package/dist/components/WalletConnectionWrapper/index.js.map +1 -0
- package/dist/context/OneUIProvider.d.ts +54 -0
- package/dist/context/OneUIProvider.js +60 -0
- package/dist/context/OneUIProvider.js.map +1 -0
- package/dist/context/OneUIProvider.test.d.ts +1 -0
- package/dist/context/OneUIProvider.test.js +46 -0
- package/dist/context/OneUIProvider.test.js.map +1 -0
- package/dist/context/__mocks__/OneUIProvider.d.ts +45 -0
- package/dist/context/__mocks__/OneUIProvider.js +13 -0
- package/dist/context/__mocks__/OneUIProvider.js.map +1 -0
- package/dist/hooks/useAsyncControl.d.ts +9 -0
- package/dist/hooks/useAsyncControl.js +40 -0
- package/dist/hooks/useAsyncControl.js.map +1 -0
- package/dist/hooks/usePagination.d.ts +19 -0
- package/dist/hooks/usePagination.js +65 -0
- package/dist/hooks/usePagination.js.map +1 -0
- package/dist/hooks/usePooledOperation.d.ts +15 -0
- package/dist/hooks/usePooledOperation.js +64 -0
- package/dist/hooks/usePooledOperation.js.map +1 -0
- package/dist/hooks/usePooling.d.ts +16 -0
- package/dist/hooks/usePooling.js +47 -0
- package/dist/hooks/usePooling.js.map +1 -0
- package/dist/hooks/usePooling.test.d.ts +1 -0
- package/dist/hooks/usePooling.test.js +104 -0
- package/dist/hooks/usePooling.test.js.map +1 -0
- package/dist/hooks/useShortIntl.d.ts +14 -0
- package/dist/hooks/useShortIntl.js +35 -0
- package/dist/hooks/useShortIntl.js.map +1 -0
- package/dist/models/GenericContract.d.ts +66 -0
- package/dist/models/GenericContract.js +14 -0
- package/dist/models/GenericContract.js.map +1 -0
- package/dist/storybookUtils/index.d.ts +5 -0
- package/dist/storybookUtils/index.js +27 -0
- package/dist/storybookUtils/index.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Should warn the user when there are no templates mapped 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Array [
|
|
6
|
+
"[32mNo templates were found. If you want to create a static template, please create a file with name [37m{htmlName}.static.tsx[39m[32m (ex: some-template.static.tsx)[39m",
|
|
7
|
+
],
|
|
8
|
+
]
|
|
9
|
+
`;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
process.env.NODE_ENV =
|
|
2
|
+
process.env.NODE_ENV ||
|
|
3
|
+
(process.env.npm_lifecycle_event.includes("start")
|
|
4
|
+
? "development"
|
|
5
|
+
: "production");
|
|
6
|
+
const Module = require("module").Module;
|
|
7
|
+
function resolveFromMainContext(module) {
|
|
8
|
+
return Module._resolveFilename(module, require.main);
|
|
9
|
+
}
|
|
10
|
+
const { join, relative, resolve } = require("path");
|
|
11
|
+
const HTMLPlugin = require.main.require("html-webpack-plugin");
|
|
12
|
+
const { writeFileSync } = require("fs");
|
|
13
|
+
const lodash = require("lodash");
|
|
14
|
+
const { findPathDeep } = require("deepdash")(lodash);
|
|
15
|
+
const chalk = require("chalk");
|
|
16
|
+
|
|
17
|
+
function findAllStaticGeneration() {
|
|
18
|
+
const glob = require("glob");
|
|
19
|
+
const results = glob.sync("**/*.static.tsx", {
|
|
20
|
+
cwd: join(resolve("."), "src"),
|
|
21
|
+
absolute: true,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return results;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseResultsrToEntries(results) {
|
|
28
|
+
return results.reduce((entries, filePath) => {
|
|
29
|
+
const [_, fileName] = /[\\/]([^\\/]+).static.tsx/.exec(filePath);
|
|
30
|
+
entries[fileName] = filePath;
|
|
31
|
+
return entries;
|
|
32
|
+
}, {});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let configGenerator;
|
|
36
|
+
async function loadGenerator() {
|
|
37
|
+
try {
|
|
38
|
+
configGenerator = require(resolve("./webpack-email-config-factory"));
|
|
39
|
+
return configGenerator(resolve("."), process.env.NODE_ENV);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
switch (e.code) {
|
|
42
|
+
case "MODULE_NOT_FOUND":
|
|
43
|
+
const ans = await require("inquirer").prompt([
|
|
44
|
+
{
|
|
45
|
+
type: "confirm",
|
|
46
|
+
message:
|
|
47
|
+
"The email webpack config factory was not found. Would you like to create the file?",
|
|
48
|
+
name: "createFactory",
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
if (ans.createFactory) {
|
|
53
|
+
writeFileSync(
|
|
54
|
+
"./webpack-email-config-factory.js",
|
|
55
|
+
`module.exports = function webpackConfigFactory(pathToRoot, environment) {
|
|
56
|
+
const config = /** Here you place the function that will create the base webpack config */;
|
|
57
|
+
const baseHtml = /** Here you place the path to the base html file */
|
|
58
|
+
return {
|
|
59
|
+
config,
|
|
60
|
+
baseHtml
|
|
61
|
+
}
|
|
62
|
+
}`
|
|
63
|
+
);
|
|
64
|
+
console.log(require("chalk").green("File created"));
|
|
65
|
+
} else {
|
|
66
|
+
console.log(
|
|
67
|
+
require("chalk").yellow(
|
|
68
|
+
"This command will only work when there is a valid configuration"
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
process.exit(0);
|
|
73
|
+
default:
|
|
74
|
+
console.warn("An unexpected error has ocurred:", e);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function findFirstBabelLoaderConfigPath(config) {
|
|
81
|
+
const path = findPathDeep(config.module.rules, (v, k, par) => {
|
|
82
|
+
if (k === "loader" && typeof v === "string" && v.includes("babel-loader"))
|
|
83
|
+
return par;
|
|
84
|
+
});
|
|
85
|
+
return path.replace(".loader", "");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function prerenderRequire() {
|
|
89
|
+
try {
|
|
90
|
+
return resolveFromMainContext(
|
|
91
|
+
"@nettoolkit/prerender-loader" // This supports webpack 5
|
|
92
|
+
);
|
|
93
|
+
} catch (e) {
|
|
94
|
+
return resolveFromMainContext(
|
|
95
|
+
"prerender-loader" // This doesn't
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function createConfig(
|
|
101
|
+
baseConfig,
|
|
102
|
+
mainHtml,
|
|
103
|
+
features = {
|
|
104
|
+
inlineCSS: true,
|
|
105
|
+
},
|
|
106
|
+
outputDir = join(resolve("."), "templates")
|
|
107
|
+
) {
|
|
108
|
+
const results = findAllStaticGeneration();
|
|
109
|
+
const entries = parseResultsrToEntries(results);
|
|
110
|
+
|
|
111
|
+
baseConfig.entry = entries;
|
|
112
|
+
let resourcesPath = join(resolve("."), "build", "templates");
|
|
113
|
+
if (process.env.NODE_ENV === "production") {
|
|
114
|
+
baseConfig.output.path = resourcesPath;
|
|
115
|
+
baseConfig.output.publicPath =
|
|
116
|
+
(process.env.EMAIL_TEMPLATES_BASE_DOMAIN || "") + "/templates/";
|
|
117
|
+
} else {
|
|
118
|
+
baseConfig.output.publicPath = "/";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
baseConfig.output.libraryTarget = "umd";
|
|
122
|
+
baseConfig.plugins = baseConfig.plugins.filter(
|
|
123
|
+
(a) =>
|
|
124
|
+
!["ManifestPlugin", "MiniCss"].find((pattern) =>
|
|
125
|
+
a.constructor.name.includes(pattern)
|
|
126
|
+
)
|
|
127
|
+
);
|
|
128
|
+
const babelLoaderPath = findFirstBabelLoaderConfigPath(baseConfig);
|
|
129
|
+
const babelLoader = lodash.get(baseConfig.module.rules, babelLoaderPath);
|
|
130
|
+
const indexOfOneOf = babelLoaderPath.indexOf("oneOf");
|
|
131
|
+
const whereToPlaceTheNewLoaderPath =
|
|
132
|
+
indexOfOneOf === -1
|
|
133
|
+
? baseConfig.module.rules
|
|
134
|
+
: lodash.get(
|
|
135
|
+
baseConfig.module.rules,
|
|
136
|
+
babelLoaderPath.slice(0, indexOfOneOf + 5)
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
whereToPlaceTheNewLoaderPath.splice(1, 0, {
|
|
140
|
+
test: /\.static\.tsx/,
|
|
141
|
+
use: [
|
|
142
|
+
{
|
|
143
|
+
loader: babelLoader.loader,
|
|
144
|
+
options: babelLoader.options,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
loader: join(__dirname, "loaders", "static-loader"),
|
|
148
|
+
options: {
|
|
149
|
+
features,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
const entryKeys = Object.keys(baseConfig.entry);
|
|
155
|
+
baseConfig.module.rules.unshift({
|
|
156
|
+
test: /\.svg$/,
|
|
157
|
+
use: [
|
|
158
|
+
{
|
|
159
|
+
loader: require.resolve(join(__dirname, "loaders", "svg-to-png.js")),
|
|
160
|
+
options: {
|
|
161
|
+
name: "static/media/[name].png",
|
|
162
|
+
resizeFactor: 10,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
entryKeys.map((i) => {
|
|
168
|
+
baseConfig.plugins.push(
|
|
169
|
+
new HTMLPlugin({
|
|
170
|
+
minify: false,
|
|
171
|
+
template:
|
|
172
|
+
process.env.NODE_ENV === "development"
|
|
173
|
+
? mainHtml
|
|
174
|
+
: `!!${prerenderRequire()}?${JSON.stringify({
|
|
175
|
+
string: true,
|
|
176
|
+
documentUrl: `http://localhost/${i}.html`,
|
|
177
|
+
entry: relative(resolve("."), baseConfig.entry[i]),
|
|
178
|
+
})}!${mainHtml}`,
|
|
179
|
+
inject: process.env.NODE_ENV === "development",
|
|
180
|
+
filename:
|
|
181
|
+
process.env.NODE_ENV === "development"
|
|
182
|
+
? `${i}.html`
|
|
183
|
+
: `${relative(resourcesPath, outputDir)}/${i}.html`,
|
|
184
|
+
excludeChunks: entryKeys
|
|
185
|
+
.filter((a) => a !== i)
|
|
186
|
+
.map((a) => {
|
|
187
|
+
return `${a}`;
|
|
188
|
+
}),
|
|
189
|
+
version: 5,
|
|
190
|
+
})
|
|
191
|
+
);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
if (process.env.NODE_ENV === "production") {
|
|
195
|
+
const allLoadersThatContainMiniCSS = baseConfig.module.rules.filter((a) => {
|
|
196
|
+
return (
|
|
197
|
+
Array.isArray(a.use) &&
|
|
198
|
+
a.use.find((a) => (a.loader || a).includes("mini-css"))
|
|
199
|
+
);
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
allLoadersThatContainMiniCSS.forEach((l) => {
|
|
203
|
+
l.use[0] = require.resolve("style-loader");
|
|
204
|
+
l.use.splice(1, 0, join(__dirname, "loaders", "css-var-removal.js"));
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (!baseConfig.resolve.alias) baseConfig.resolve.alias = {};
|
|
209
|
+
baseConfig.resolve.alias.CSSInliner = require.resolve(
|
|
210
|
+
join(__dirname, "scripts", "css-inliner.ts")
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
baseConfig.output.filename = `[name].js`;
|
|
214
|
+
|
|
215
|
+
if (!baseConfig.optimization) baseConfig.optimization = {};
|
|
216
|
+
baseConfig.optimization.runtimeChunk = false;
|
|
217
|
+
|
|
218
|
+
baseConfig.plugins = baseConfig.plugins.filter(
|
|
219
|
+
(a) => a.constructor.name !== "ModuleFederationPlugin"
|
|
220
|
+
);
|
|
221
|
+
baseConfig.plugins.splice(0, 1);
|
|
222
|
+
|
|
223
|
+
return baseConfig;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function checkTemplatesCount(webpackEntry) {
|
|
227
|
+
if (Object.keys(webpackEntry).length === 0) {
|
|
228
|
+
console.log(
|
|
229
|
+
chalk.green(
|
|
230
|
+
`No templates were found. If you want to create a static template, please create a file with name ${chalk.white(
|
|
231
|
+
"{htmlName}.static.tsx"
|
|
232
|
+
)} (ex: some-template.static.tsx)`
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
process.exit(0);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
module.exports = async function initEmailWebpack() {
|
|
240
|
+
const {
|
|
241
|
+
config: baseConfig,
|
|
242
|
+
mainHtml,
|
|
243
|
+
features,
|
|
244
|
+
outputDir,
|
|
245
|
+
} = await loadGenerator();
|
|
246
|
+
const config = createConfig(baseConfig, mainHtml, features, outputDir);
|
|
247
|
+
checkTemplatesCount(config.entry);
|
|
248
|
+
return config;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
module.exports.checkTemplatesCount = checkTemplatesCount;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
jest.mock(
|
|
2
|
+
require("path").resolve("./webpack-email-config-factory"),
|
|
3
|
+
() => jest.fn(),
|
|
4
|
+
{ virtual: true }
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
let logSpy;
|
|
8
|
+
let processSpy;
|
|
9
|
+
let promptSpy;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
jest.resetModules();
|
|
12
|
+
jest.clearAllMocks();
|
|
13
|
+
processSpy = jest.spyOn(process, "exit").mockImplementation(() => {});
|
|
14
|
+
promptSpy = jest
|
|
15
|
+
.spyOn(require("inquirer"), "prompt")
|
|
16
|
+
.mockImplementation(() => Promise.resolve());
|
|
17
|
+
logSpy = jest.spyOn(console, "log").mockImplementation(() => {});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("Should generate the file correctly when using proprietary webpack config", async () => {
|
|
21
|
+
require(require("path").resolve(
|
|
22
|
+
"./webpack-email-config-factory"
|
|
23
|
+
)).mockImplementation((...args) => ({
|
|
24
|
+
config:
|
|
25
|
+
require("@muritavo/webpack-microfrontend-scripts/bin/react/scripts/_webpackConfiguration").createBaseConfiguration(
|
|
26
|
+
...args
|
|
27
|
+
),
|
|
28
|
+
baseHtml: "mock",
|
|
29
|
+
}));
|
|
30
|
+
await require("./email-templates")();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it.each(["development", "production"])(
|
|
34
|
+
"Should work when using a react-scripts config",
|
|
35
|
+
async (environment) => {
|
|
36
|
+
require(require("path").resolve(
|
|
37
|
+
"./webpack-email-config-factory"
|
|
38
|
+
)).mockImplementation(() => ({
|
|
39
|
+
config: require("react-scripts/config/webpack.config")(environment),
|
|
40
|
+
}));
|
|
41
|
+
await require("./email-templates")();
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
it("Should warn the user when there are no templates mapped", async () => {
|
|
46
|
+
require(require("path").resolve(
|
|
47
|
+
"./webpack-email-config-factory"
|
|
48
|
+
)).mockImplementation(() => ({
|
|
49
|
+
config: require("react-scripts/config/webpack.config")("development"),
|
|
50
|
+
}));
|
|
51
|
+
await require("./email-templates")();
|
|
52
|
+
expect(logSpy.mock.calls).toMatchSnapshot();
|
|
53
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This loader works by removing the var calls by it's default value so they can be used on the email generation templates
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
var allVarsContent = {};
|
|
6
|
+
|
|
7
|
+
const extractVars = (cssContent) => {
|
|
8
|
+
let postProcessVars = {};
|
|
9
|
+
const cssVarDefRegex = /--([-a-zA-Z]+):([^;]+);/g;
|
|
10
|
+
let value = null;
|
|
11
|
+
do {
|
|
12
|
+
value = cssVarDefRegex.exec(cssContent);
|
|
13
|
+
if (value) {
|
|
14
|
+
const [_, varName, _varValue] = value;
|
|
15
|
+
const varValue = _varValue.trim();
|
|
16
|
+
|
|
17
|
+
if (varValue.startsWith("var(")) {
|
|
18
|
+
const [_, varNameDep] = /var\(([-a-zA-Z]+)/.exec(varValue);
|
|
19
|
+
postProcessVars[`--${varName}`] = varNameDep;
|
|
20
|
+
} else {
|
|
21
|
+
allVarsContent[`--${varName}`] = varValue.trim();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} while (value !== null);
|
|
25
|
+
|
|
26
|
+
Object.entries(postProcessVars).forEach(([varName, varNameDep]) => {
|
|
27
|
+
if (allVarsContent[varNameDep])
|
|
28
|
+
allVarsContent[varName] = allVarsContent[varNameDep];
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return allVarsContent;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
module.exports = (cssContent) => {
|
|
35
|
+
extractVars(cssContent);
|
|
36
|
+
return cssContent.replace(
|
|
37
|
+
/var\(([-a-zA-Z]+), ([^\)]+)\)/g,
|
|
38
|
+
(_, varName, defaultValue) => {
|
|
39
|
+
return allVarsContent[varName] || defaultValue;
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
module.exports.extractVars = extractVars;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { extractVars } = require("./css-var-removal");
|
|
2
|
+
|
|
3
|
+
beforeEach(() => {
|
|
4
|
+
jest.resetModules();
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
it("Should extract correct vars and values", () => {
|
|
8
|
+
const vars = extractVars(`--digital-blue: #6c4acc;--abc: var(--var-nao-definida);--var-nao-definida: red;`);
|
|
9
|
+
|
|
10
|
+
expect(vars).toEqual(
|
|
11
|
+
expect.objectContaining({
|
|
12
|
+
"--digital-blue": "#6c4acc",
|
|
13
|
+
"--var-nao-definida": "red",
|
|
14
|
+
"--abc": "red"
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const { getOptions } = require("loader-utils");
|
|
2
|
+
|
|
3
|
+
module.exports = function (content) {
|
|
4
|
+
const {
|
|
5
|
+
features: { inlineCSS },
|
|
6
|
+
} = getOptions(this);
|
|
7
|
+
content = content.replace("export default ", "");
|
|
8
|
+
const [_, functionName] = /function ([a-zA-Z]+)\(/.exec(content);
|
|
9
|
+
content = `import { render } from 'react-dom';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import InlineCSS from "CSSInliner";
|
|
12
|
+
window.PRERENDER = window.PRERENDER || true
|
|
13
|
+
|
|
14
|
+
${content}
|
|
15
|
+
export default function Load() {
|
|
16
|
+
return new Promise((r) => {
|
|
17
|
+
render(<${functionName}/>, document.body);
|
|
18
|
+
${inlineCSS ? `InlineCSS();` : ""}
|
|
19
|
+
r();
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${process.env.NODE_ENV === "development" ? "Load()" : ""}`;
|
|
24
|
+
|
|
25
|
+
return content;
|
|
26
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = _default;
|
|
5
|
+
|
|
6
|
+
var loaderUtils = _interopRequireWildcard(require("loader-utils"));
|
|
7
|
+
|
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
|
9
|
+
|
|
10
|
+
var _sharp = _interopRequireDefault(require("sharp"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) {
|
|
13
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache() {
|
|
17
|
+
if (typeof WeakMap !== "function") return null;
|
|
18
|
+
var cache = new WeakMap();
|
|
19
|
+
_getRequireWildcardCache = function () {
|
|
20
|
+
return cache;
|
|
21
|
+
};
|
|
22
|
+
return cache;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _interopRequireWildcard(obj) {
|
|
26
|
+
if (obj && obj.__esModule) {
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
|
|
30
|
+
return { default: obj };
|
|
31
|
+
}
|
|
32
|
+
var cache = _getRequireWildcardCache();
|
|
33
|
+
if (cache && cache.has(obj)) {
|
|
34
|
+
return cache.get(obj);
|
|
35
|
+
}
|
|
36
|
+
var newObj = {};
|
|
37
|
+
var hasPropertyDescriptor =
|
|
38
|
+
Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
+
for (var key in obj) {
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
+
var desc = hasPropertyDescriptor
|
|
42
|
+
? Object.getOwnPropertyDescriptor(obj, key)
|
|
43
|
+
: null;
|
|
44
|
+
if (desc && (desc.get || desc.set)) {
|
|
45
|
+
Object.defineProperty(newObj, key, desc);
|
|
46
|
+
} else {
|
|
47
|
+
newObj[key] = obj[key];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
newObj.default = obj;
|
|
52
|
+
if (cache) {
|
|
53
|
+
cache.set(obj, newObj);
|
|
54
|
+
}
|
|
55
|
+
return newObj;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const prepareSizes = (options) => {
|
|
59
|
+
const result = [
|
|
60
|
+
options.height
|
|
61
|
+
? [
|
|
62
|
+
{
|
|
63
|
+
height: options.height,
|
|
64
|
+
width: options.width || options.height,
|
|
65
|
+
},
|
|
66
|
+
]
|
|
67
|
+
: (options.sizes || [])
|
|
68
|
+
.map((val) => val.trim())
|
|
69
|
+
.map((val) => [val, /([0-9]+)([x,])?([0-9]+)?/.exec(val)])
|
|
70
|
+
.map((val) => val[1])
|
|
71
|
+
.map((val) => ({
|
|
72
|
+
height: val[1],
|
|
73
|
+
width: val[3] || val[1],
|
|
74
|
+
})),
|
|
75
|
+
][0];
|
|
76
|
+
|
|
77
|
+
if (result.length === 0) {
|
|
78
|
+
return [
|
|
79
|
+
{
|
|
80
|
+
width: -1,
|
|
81
|
+
height: -1,
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return result.map((size) => ({
|
|
87
|
+
width: parseInt(`${size.width || 1}`),
|
|
88
|
+
height: parseInt(`${size.height || 1}`),
|
|
89
|
+
}));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
function _default(content) {
|
|
93
|
+
const options = Object.assign(
|
|
94
|
+
{},
|
|
95
|
+
loaderUtils.getOptions(this),
|
|
96
|
+
loaderUtils.parseQuery(this.resourceQuery || "?")
|
|
97
|
+
);
|
|
98
|
+
const context = options.context || this.rootContext;
|
|
99
|
+
const callback = this.async();
|
|
100
|
+
options.resizeFactor = options.resizeFactor || 1;
|
|
101
|
+
options.name = options.name || "[contenthash].png";
|
|
102
|
+
options.name = options.name.replace(
|
|
103
|
+
"[name]",
|
|
104
|
+
_path.default.basename(this.resourcePath).replace(/\..*$/, "")
|
|
105
|
+
);
|
|
106
|
+
let outputPathBase = loaderUtils.interpolateName(this, options.name, {
|
|
107
|
+
context,
|
|
108
|
+
content,
|
|
109
|
+
regExp: options.regExp,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (options.outputPath) {
|
|
113
|
+
outputPathBase = _path.default.join(options.outputPath, outputPathBase);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
Promise.all(
|
|
117
|
+
prepareSizes(options).map((size) => {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
let sharpInst = (0, _sharp.default)(this.resourcePath); // Do conversion
|
|
120
|
+
|
|
121
|
+
if (size.width > -1 && size.height > -1) {
|
|
122
|
+
sharpInst = sharpInst.resize(
|
|
123
|
+
size.width * options.resizeFactor,
|
|
124
|
+
size.height * options.resizeFactor
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
sharpInst
|
|
129
|
+
.sharpen()
|
|
130
|
+
.png({
|
|
131
|
+
compressionLevel: 0,
|
|
132
|
+
dither: 0,
|
|
133
|
+
progressive: true,
|
|
134
|
+
})
|
|
135
|
+
.toBuffer((err, data, info) => {
|
|
136
|
+
if (err) {
|
|
137
|
+
reject(err);
|
|
138
|
+
} else {
|
|
139
|
+
const finalSize = {
|
|
140
|
+
height: info.height,
|
|
141
|
+
width: info.width,
|
|
142
|
+
}; // Determine webpack output path
|
|
143
|
+
|
|
144
|
+
const outputPath = outputPathBase.replace(
|
|
145
|
+
/\[([^\]]+)]/g,
|
|
146
|
+
(match) => {
|
|
147
|
+
match = match.replace(/^\[|]$/g, "");
|
|
148
|
+
return finalSize[match] || finalSize[match] === 0
|
|
149
|
+
? finalSize[match]
|
|
150
|
+
: match;
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
this.emitFile(outputPath, data);
|
|
154
|
+
resolve({
|
|
155
|
+
size: finalSize,
|
|
156
|
+
outputPath,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
})
|
|
162
|
+
)
|
|
163
|
+
.then((results) => {
|
|
164
|
+
let output = `module.exports = __webpack_public_path__ + "${results[0].outputPath}";`;
|
|
165
|
+
callback(null, output);
|
|
166
|
+
})
|
|
167
|
+
.catch((error) => {
|
|
168
|
+
callback(error);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default function inlineCSS() {
|
|
2
|
+
if (process.env.NODE_ENV === "development") return;
|
|
3
|
+
const allEls = Array.from(document.querySelectorAll("*")) as HTMLElement[];
|
|
4
|
+
const elstyles: [HTMLElement, string][] = [];
|
|
5
|
+
|
|
6
|
+
// First read the styles of each element
|
|
7
|
+
allEls.forEach((el) => {
|
|
8
|
+
const styles = window.getComputedStyle(el);
|
|
9
|
+
|
|
10
|
+
const inlined = Array.from(styles)
|
|
11
|
+
.map((k) => `${k}: ${styles.getPropertyValue(k)}`)
|
|
12
|
+
.join("; ")
|
|
13
|
+
.concat(";");
|
|
14
|
+
if (inlined !== ";") elstyles.push([el, inlined]);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// Then write it to the styles, so the update of previous elements does not affect the generation
|
|
18
|
+
elstyles.forEach(([el, s]) => {
|
|
19
|
+
el.setAttribute("style", s);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (process.env.NODE_ENV !== "test")
|
|
23
|
+
document.querySelectorAll("style").forEach((e) => e.remove());
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function WaitTimeout(ml?: number): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WaitTimeout = void 0;
|
|
4
|
+
function WaitTimeout(ml = 200) {
|
|
5
|
+
return new Promise((r) => {
|
|
6
|
+
setTimeout(() => {
|
|
7
|
+
r();
|
|
8
|
+
}, ml);
|
|
9
|
+
if (jest.isMockFunction(setTimeout))
|
|
10
|
+
jest.advanceTimersByTime(ml);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.WaitTimeout = WaitTimeout;
|
|
14
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/__test__/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,EAAE,GAAG,GAAG;IAClC,OAAO,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE;QAC7B,UAAU,CAAC,GAAG,EAAE;YACd,CAAC,EAAE,CAAC;QACN,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;YAAE,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,kCAOC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
$digitalBlue: var(--digital-blue, #558eff);
|
|
2
|
+
$mediumGray: var(--medium-gray, #bababa);
|
|
3
|
+
$lightGray: var(--light-gray, #d6d6d6);
|
|
4
|
+
$spaceBlue: var(--space-blue, #0f113a);
|
|
5
|
+
$warningRed: var(--warning-red, #e84b4b);
|
|
6
|
+
$sunsetPink: var(--sunset-pink, #ff3e7d);
|
|
7
|
+
$darkestGray: var(--darkest-gray, #727272);
|
|
8
|
+
$gray: var(--gray, #0f113a);
|
|
9
|
+
$success: var(--success, lightgreen);
|
|
10
|
+
$mainBackgroundColor: var(--bg-color, white);
|
|
11
|
+
|
|
12
|
+
//FONTS
|
|
13
|
+
$mainFontFamily: var(--main-font, Roboto);
|
|
14
|
+
$secondaryFontFamily: var(--second-font, Manrope);
|
|
15
|
+
|
|
16
|
+
// Component specific variables on the format --<component>-<element>-<category>
|
|
17
|
+
$headerFillBackgroundColor: var(--header-background-color, $digitalBlue);
|
|
18
|
+
$headerBackgroundColor: var(--header-divider-bg-color, #467eea);
|
|
19
|
+
$headerTextColor: var(--header-text-color, #94b8ff);
|
|
20
|
+
$headerBrightColor: var(--header-bright-color, white);
|
|
21
|
+
|
|
22
|
+
$tableRowBgColor: var(--table-row-bg-color, white);
|
|
23
|
+
$tableRowBorderColor: var(--table-row-border-color, #bec1ca);
|
|
24
|
+
|
|
25
|
+
$buttonMinHeight: var(--button-min-height, 62px);
|
|
26
|
+
$buttonMinWidth: var(--button-min-width, 150px);
|
|
27
|
+
|
|
28
|
+
$tooltipBackgroudColor: var(--tooltip-background-color, $digitalBlue);
|
|
29
|
+
|
|
30
|
+
$checkboxBaseColor: var(--checkbox-base-color, $digitalBlue);
|
|
31
|
+
|
|
32
|
+
$textDefaultColor: var(--text-default-color, $digitalBlue);
|
|
33
|
+
|
|
34
|
+
$buttonPrimaryBackgroundColor: var(--button-primary-bg-color, #1e22aa);
|
|
35
|
+
|
|
36
|
+
$fileInputBackgroundColor: var(--file-input-bg-color, #f2f6f7);
|
|
37
|
+
$fileInputBorderColor: var(--file-input-border-color, #dce1e8);
|
|
38
|
+
|
|
39
|
+
$avatarBackgroundColor: var(--avatar-bg-color, $lightGray);
|
|
40
|
+
|
|
41
|
+
$pixelatedGuideBackground: var(--pixelated-scan-bg, var(--digital-blue));
|
|
42
|
+
|
|
43
|
+
// Animation speed variables
|
|
44
|
+
$almostInstant: var(--animation--speed-almostInstant, 50ms);
|
|
45
|
+
$veryFast: var(--animation--speed-veryfast, 125ms);
|
|
46
|
+
$fast: var(--animation--speed-fast, 250ms);
|
|
47
|
+
$normal: var(--animation--speed-normal, 500ms);
|
|
48
|
+
$slow: var(--animation--speed-slow, 1s);
|
|
49
|
+
$verySlow: var(--animation--speed-veryslow, 2s);
|