@onepercentio/one-ui 0.8.4 → 0.8.5-beta.10
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/email-templates.js +35 -3
- package/cypress/support/commands.ts +12 -1
- package/cypress/support/component-index.html +8 -2
- package/dist/assets/styles/variables.scss +1 -0
- package/dist/components/AdaptiveContainer/AdaptiveContainer.d.ts +8 -1
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js +36 -15
- package/dist/components/AdaptiveContainer/AdaptiveContainer.js.map +1 -1
- package/dist/components/AdaptiveContainer/AdaptiveContainer.module.scss +1 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.d.ts +13 -10
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js +5 -2
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.js.map +1 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.d.ts +1 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js +25 -10
- package/dist/components/AnimatedEntrance/AnimatedEntrance.js.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Collapsable/Collapsable.d.ts +11 -1
- package/dist/components/Collapsable/Collapsable.js +13 -3
- package/dist/components/Collapsable/Collapsable.js.map +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +2 -2
- package/dist/components/FadeIn/FadeIn.d.ts +1 -0
- package/dist/components/FadeIn/FadeIn.js +14 -2
- package/dist/components/FadeIn/FadeIn.js.map +1 -1
- package/dist/components/InfinityScroll/InfinityScroll.d.ts +7 -0
- package/dist/components/InfinityScroll/InfinityScroll.js +39 -22
- package/dist/components/InfinityScroll/InfinityScroll.js.map +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Loader/Loader.d.ts +3 -2
- package/dist/components/Loader/Loader.js +14 -2
- package/dist/components/Loader/Loader.js.map +1 -1
- package/dist/components/OrderableList/OrderableList.d.ts +21 -0
- package/dist/components/OrderableList/OrderableList.js +253 -0
- package/dist/components/OrderableList/OrderableList.js.map +1 -0
- package/dist/components/OrderableList/OrderableList.module.scss +42 -0
- package/dist/components/OrderableList/index.d.ts +1 -0
- package/dist/components/OrderableList/index.js +9 -0
- package/dist/components/OrderableList/index.js.map +1 -0
- package/dist/components/PaginationIndicator/PaginationIndicator.d.ts +26 -0
- package/dist/components/PaginationIndicator/PaginationIndicator.js +131 -0
- package/dist/components/PaginationIndicator/PaginationIndicator.js.map +1 -0
- package/dist/components/PaginationIndicator/PaginationIndicator.module.scss +48 -0
- package/dist/components/PaginationIndicator/index.d.ts +1 -0
- package/dist/components/PaginationIndicator/index.js +9 -0
- package/dist/components/PaginationIndicator/index.js.map +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +3 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +2 -1
- package/dist/components/Tabs/Tabs.js +16 -8
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/Tabs.module.scss +0 -1
- package/dist/components/Text/Text.d.ts +2 -2
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.js.map +1 -1
- package/dist/context/AsyncProcessQueue.d.ts +71 -0
- package/dist/context/AsyncProcessQueue.development.d.ts +8 -0
- package/dist/context/AsyncProcessQueue.development.js +42 -0
- package/dist/context/AsyncProcessQueue.development.js.map +1 -0
- package/dist/context/AsyncProcessQueue.js +186 -0
- package/dist/context/AsyncProcessQueue.js.map +1 -0
- package/dist/context/OneUIProvider.d.ts +10 -1
- package/dist/context/OneUIProvider.js +1 -1
- package/dist/context/OneUIProvider.js.map +1 -1
- package/dist/hooks/ui/usePaginationControls.d.ts +14 -0
- package/dist/hooks/ui/usePaginationControls.js +92 -0
- package/dist/hooks/ui/usePaginationControls.js.map +1 -0
- package/dist/hooks/ui/usePaginationControls.module.scss +16 -0
- package/dist/hooks/useAsyncControl.d.ts +4 -1
- package/dist/hooks/useAsyncControl.js +3 -1
- package/dist/hooks/useAsyncControl.js.map +1 -1
- package/dist/hooks/useContainedRepositioning.d.ts +3 -1
- package/dist/hooks/useContainedRepositioning.js +13 -10
- package/dist/hooks/useContainedRepositioning.js.map +1 -1
- package/dist/hooks/useElementFit.d.ts +2 -2
- package/dist/hooks/useElementFit.js.map +1 -1
- package/dist/hooks/useFreeze.d.ts +1 -1
- package/dist/hooks/useHero.d.ts +13 -0
- package/dist/hooks/useHero.js +97 -0
- package/dist/hooks/useHero.js.map +1 -0
- package/dist/hooks/useMergeRefs.d.ts +5 -0
- package/dist/hooks/useMergeRefs.js +15 -0
- package/dist/hooks/useMergeRefs.js.map +1 -0
- package/dist/hooks/usePagination.d.ts +5 -4
- package/dist/hooks/usePagination.js +22 -16
- package/dist/hooks/usePagination.js.map +1 -1
- package/dist/hooks/usePaginationControls.d.ts +5 -0
- package/dist/hooks/usePaginationControls.js +8 -0
- package/dist/hooks/usePaginationControls.js.map +1 -0
- package/dist/hooks/useShortIntl.js.map +1 -1
- package/dist/models/GenericContract.d.ts +1 -1
- package/dist/types.d.ts +72 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +8 -16
- package/src/{types.d.ts → types.ts} +7 -7
- package/tsconfig.json +108 -0
- package/WebpackConfigs/__snapshots__/email-templates.test.js.snap +0 -9
- package/WebpackConfigs/email-templates.test.js +0 -53
- package/WebpackConfigs/loaders/css-var-removal.test.ts +0 -17
- package/dist/__test__/analytics.d.ts +0 -3
- package/dist/__test__/analytics.js +0 -20
- package/dist/__test__/analytics.js.map +0 -1
- package/dist/__test__/firestore.d.ts +0 -2
- package/dist/__test__/firestore.js +0 -26
- package/dist/__test__/firestore.js.map +0 -1
- package/dist/__test__/utils.d.ts +0 -16
- package/dist/__test__/utils.js +0 -164
- package/dist/__test__/utils.js.map +0 -1
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.d.ts +0 -18
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.js +0 -82
- package/dist/components/AdaptiveButton/AdaptiveButton.stories.js.map +0 -1
- package/dist/components/AdaptiveContainer/AdaptiveContainer.stories.d.ts +0 -17
- package/dist/components/AdaptiveContainer/AdaptiveContainer.stories.js +0 -82
- package/dist/components/AdaptiveContainer/AdaptiveContainer.stories.js.map +0 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.d.ts +0 -20
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js +0 -94
- package/dist/components/AdaptiveDialog/AdaptiveDialog.stories.js.map +0 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.d.ts +0 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js +0 -15
- package/dist/components/AdaptiveDialog/AdaptiveDialog.test.js.map +0 -1
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.d.ts +0 -19
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js +0 -21
- package/dist/components/AdaptiveSidebar/AdaptiveSidebar.stories.js.map +0 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.d.ts +0 -16
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js +0 -86
- package/dist/components/AnchoredTooltip/AnchoredTooltip.stories.js.map +0 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.d.ts +0 -1
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js +0 -20
- package/dist/components/AnchoredTooltip/AnchoredTooltip.test.js.map +0 -1
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.d.ts +0 -14
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.js +0 -67
- package/dist/components/AnimatedEntrance/AnimatedEntrance.stories.js.map +0 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.d.ts +0 -18
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.js +0 -34
- package/dist/components/AsyncWrapper/AsyncWrapper.stories.js.map +0 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.test.d.ts +0 -1
- package/dist/components/AsyncWrapper/AsyncWrapper.test.js +0 -19
- package/dist/components/AsyncWrapper/AsyncWrapper.test.js.map +0 -1
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -14
- package/dist/components/Avatar/Avatar.stories.js +0 -19
- package/dist/components/Avatar/Avatar.stories.js.map +0 -1
- package/dist/components/Avatar/Avatar.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.test.js +0 -36
- package/dist/components/Avatar/Avatar.test.js.map +0 -1
- package/dist/components/BucketFill/BucketFill.stories.d.ts +0 -17
- package/dist/components/BucketFill/BucketFill.stories.js +0 -141
- package/dist/components/BucketFill/BucketFill.stories.js.map +0 -1
- package/dist/components/BucketFill/BucketFill.stories.module.scss +0 -3
- package/dist/components/Button/Button.stories.d.ts +0 -9
- package/dist/components/Button/Button.stories.js +0 -58
- package/dist/components/Button/Button.stories.js.map +0 -1
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/Button.test.js +0 -15
- package/dist/components/Button/Button.test.js.map +0 -1
- package/dist/components/Card/Card.stories.d.ts +0 -15
- package/dist/components/Card/Card.stories.js +0 -16
- package/dist/components/Card/Card.stories.js.map +0 -1
- package/dist/components/CheckBox/CheckBox.stories.d.ts +0 -20
- package/dist/components/CheckBox/CheckBox.stories.js +0 -53
- package/dist/components/CheckBox/CheckBox.stories.js.map +0 -1
- package/dist/components/Collapsable/Collapsable.stories.d.ts +0 -39
- package/dist/components/Collapsable/Collapsable.stories.js +0 -28
- package/dist/components/Collapsable/Collapsable.stories.js.map +0 -1
- package/dist/components/Countdown/Countdown.stories.d.ts +0 -14
- package/dist/components/Countdown/Countdown.stories.js +0 -55
- package/dist/components/Countdown/Countdown.stories.js.map +0 -1
- package/dist/components/Divider/Divider.stories.d.ts +0 -7
- package/dist/components/Divider/Divider.stories.js +0 -15
- package/dist/components/Divider/Divider.stories.js.map +0 -1
- package/dist/components/EmailInput/EmailInput.stories.d.ts +0 -28
- package/dist/components/EmailInput/EmailInput.stories.js +0 -15
- package/dist/components/EmailInput/EmailInput.stories.js.map +0 -1
- package/dist/components/EmailInput/EmailInput.test.d.ts +0 -1
- package/dist/components/EmailInput/EmailInput.test.js +0 -77
- package/dist/components/EmailInput/EmailInput.test.js.map +0 -1
- package/dist/components/FadeIn/FadeIn.stories.d.ts +0 -24
- package/dist/components/FadeIn/FadeIn.stories.js +0 -16
- package/dist/components/FadeIn/FadeIn.stories.js.map +0 -1
- package/dist/components/FadeIn/FadeIn.test.d.ts +0 -1
- package/dist/components/FadeIn/FadeIn.test.js +0 -22
- package/dist/components/FadeIn/FadeIn.test.js.map +0 -1
- package/dist/components/FileInput/FileInput.stories.d.ts +0 -19
- package/dist/components/FileInput/FileInput.stories.js +0 -59
- package/dist/components/FileInput/FileInput.stories.js.map +0 -1
- package/dist/components/FlowController/FlowController.stories.d.ts +0 -43
- package/dist/components/FlowController/FlowController.stories.js +0 -101
- package/dist/components/FlowController/FlowController.stories.js.map +0 -1
- package/dist/components/FlowController/FlowController.test.d.ts +0 -1
- package/dist/components/FlowController/FlowController.test.js +0 -166
- package/dist/components/FlowController/FlowController.test.js.map +0 -1
- package/dist/components/Form/Form.stories.d.ts +0 -13
- package/dist/components/Form/Form.stories.js +0 -36
- package/dist/components/Form/Form.stories.js.map +0 -1
- package/dist/components/Freeze/Freeze.stories.d.ts +0 -7
- package/dist/components/Freeze/Freeze.stories.js +0 -56
- package/dist/components/Freeze/Freeze.stories.js.map +0 -1
- package/dist/components/Freeze/Freeze.test.d.ts +0 -1
- package/dist/components/Freeze/Freeze.test.js +0 -15
- package/dist/components/Freeze/Freeze.test.js.map +0 -1
- package/dist/components/Header/Header.stories.d.ts +0 -28
- package/dist/components/Header/Header.stories.js +0 -41
- package/dist/components/Header/Header.stories.js.map +0 -1
- package/dist/components/Header/Header.test.d.ts +0 -1
- package/dist/components/Header/Header.test.js +0 -100
- package/dist/components/Header/Header.test.js.map +0 -1
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.d.ts +0 -14
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js +0 -16
- package/dist/components/HeaderCloseBtn/HeaderCloseBtn.stories.js.map +0 -1
- package/dist/components/InfinityScroll/InfinityScroll.stories.d.ts +0 -23
- package/dist/components/InfinityScroll/InfinityScroll.stories.js +0 -54
- package/dist/components/InfinityScroll/InfinityScroll.stories.js.map +0 -1
- package/dist/components/InfinityScroll/InfinityScroll.test.d.ts +0 -1
- package/dist/components/InfinityScroll/InfinityScroll.test.js +0 -189
- package/dist/components/InfinityScroll/InfinityScroll.test.js.map +0 -1
- package/dist/components/Input/Input.stories.d.ts +0 -24
- package/dist/components/Input/Input.stories.js +0 -21
- package/dist/components/Input/Input.stories.js.map +0 -1
- package/dist/components/Input/Input.test.d.ts +0 -1
- package/dist/components/Input/Input.test.js +0 -58
- package/dist/components/Input/Input.test.js.map +0 -1
- package/dist/components/InstantCounter/InstantCounter.stories.d.ts +0 -41
- package/dist/components/InstantCounter/InstantCounter.stories.js +0 -61
- package/dist/components/InstantCounter/InstantCounter.stories.js.map +0 -1
- package/dist/components/InstantCounter/InstantCounter.test.d.ts +0 -1
- package/dist/components/InstantCounter/InstantCounter.test.js +0 -50
- package/dist/components/InstantCounter/InstantCounter.test.js.map +0 -1
- package/dist/components/LinkToId/LinkToId.stories.d.ts +0 -7
- package/dist/components/LinkToId/LinkToId.stories.js +0 -15
- package/dist/components/LinkToId/LinkToId.stories.js.map +0 -1
- package/dist/components/LinkToId/LinkToId.test.d.ts +0 -1
- package/dist/components/LinkToId/LinkToId.test.js +0 -12
- package/dist/components/LinkToId/LinkToId.test.js.map +0 -1
- package/dist/components/Loader/Loader.stories.d.ts +0 -12
- package/dist/components/Loader/Loader.stories.js +0 -16
- package/dist/components/Loader/Loader.stories.js.map +0 -1
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.d.ts +0 -7
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.js +0 -15
- package/dist/components/LoaderDotsIndicator/LoaderDotsIndicator.stories.js.map +0 -1
- package/dist/components/MainGrid/MainGrid.stories.d.ts +0 -14
- package/dist/components/MainGrid/MainGrid.stories.js +0 -70
- package/dist/components/MainGrid/MainGrid.stories.js.map +0 -1
- package/dist/components/MainGrid/MainGrid.test.d.ts +0 -1
- package/dist/components/MainGrid/MainGrid.test.js +0 -18
- package/dist/components/MainGrid/MainGrid.test.js.map +0 -1
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.d.ts +0 -21
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js +0 -74
- package/dist/components/MutableHamburgerButton/MutableHamburgerButton.stories.js.map +0 -1
- package/dist/components/Notification/Notification.stories.d.ts +0 -15
- package/dist/components/Notification/Notification.stories.js +0 -19
- package/dist/components/Notification/Notification.stories.js.map +0 -1
- package/dist/components/Parallax/Parallax.stories.d.ts +0 -32
- package/dist/components/Parallax/Parallax.stories.js +0 -23
- package/dist/components/Parallax/Parallax.stories.js.map +0 -1
- package/dist/components/Parallax/Parallax.test.d.ts +0 -1
- package/dist/components/Parallax/Parallax.test.js +0 -22
- package/dist/components/Parallax/Parallax.test.js.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +0 -45
- package/dist/components/PasswordInput/PasswordInput.stories.js +0 -22
- package/dist/components/PasswordInput/PasswordInput.stories.js.map +0 -1
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +0 -1
- package/dist/components/PasswordInput/PasswordInput.test.js +0 -157
- package/dist/components/PasswordInput/PasswordInput.test.js.map +0 -1
- package/dist/components/PixelatedScan/PixelatedScan.stories.d.ts +0 -15
- package/dist/components/PixelatedScan/PixelatedScan.stories.js +0 -40
- package/dist/components/PixelatedScan/PixelatedScan.stories.js.map +0 -1
- package/dist/components/Portal/Portal.stories.d.ts +0 -7
- package/dist/components/Portal/Portal.stories.js +0 -15
- package/dist/components/Portal/Portal.stories.js.map +0 -1
- package/dist/components/ProgressBar/ProgressBar.stories.d.ts +0 -14
- package/dist/components/ProgressBar/ProgressBar.stories.js +0 -52
- package/dist/components/ProgressBar/ProgressBar.stories.js.map +0 -1
- package/dist/components/ProgressTexts/ProgressTexts.stories.d.ts +0 -24
- package/dist/components/ProgressTexts/ProgressTexts.stories.js +0 -90
- package/dist/components/ProgressTexts/ProgressTexts.stories.js.map +0 -1
- package/dist/components/ProgressTexts/ProgressTexts.test.d.ts +0 -1
- package/dist/components/ProgressTexts/ProgressTexts.test.js +0 -52
- package/dist/components/ProgressTexts/ProgressTexts.test.js.map +0 -1
- package/dist/components/SectionContainer/SectionContainer.stories.d.ts +0 -14
- package/dist/components/SectionContainer/SectionContainer.stories.js +0 -15
- package/dist/components/SectionContainer/SectionContainer.stories.js.map +0 -1
- package/dist/components/Select/Select.stories.d.ts +0 -56
- package/dist/components/Select/Select.stories.js +0 -34
- package/dist/components/Select/Select.stories.js.map +0 -1
- package/dist/components/Select/Select.test.d.ts +0 -1
- package/dist/components/Select/Select.test.js +0 -12
- package/dist/components/Select/Select.test.js.map +0 -1
- package/dist/components/Spacing/Spacing.stories.d.ts +0 -7
- package/dist/components/Spacing/Spacing.stories.js +0 -35
- package/dist/components/Spacing/Spacing.stories.js.map +0 -1
- package/dist/components/Table/Table.stories.d.ts +0 -15
- package/dist/components/Table/Table.stories.js +0 -88
- package/dist/components/Table/Table.stories.js.map +0 -1
- package/dist/components/Table/Table.test.d.ts +0 -1
- package/dist/components/Table/Table.test.js +0 -35
- package/dist/components/Table/Table.test.js.map +0 -1
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -17
- package/dist/components/Tabs/Tabs.stories.js +0 -57
- package/dist/components/Tabs/Tabs.stories.js.map +0 -1
- package/dist/components/Tabs/Tabs.test.d.ts +0 -1
- package/dist/components/Tabs/Tabs.test.js +0 -39
- package/dist/components/Tabs/Tabs.test.js.map +0 -1
- package/dist/components/Text/Text.stories.d.ts +0 -7
- package/dist/components/Text/Text.stories.js +0 -43
- package/dist/components/Text/Text.stories.js.map +0 -1
- package/dist/components/Text/Text.test.d.ts +0 -1
- package/dist/components/Text/Text.test.js +0 -12
- package/dist/components/Text/Text.test.js.map +0 -1
- package/dist/components/Transition/Transition.stories.d.ts +0 -10
- package/dist/components/Transition/Transition.stories.js +0 -29
- package/dist/components/Transition/Transition.stories.js.map +0 -1
- package/dist/components/Transition/Transition.test.d.ts +0 -1
- package/dist/components/Transition/Transition.test.js +0 -55
- package/dist/components/Transition/Transition.test.js.map +0 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.d.ts +0 -33
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js +0 -225
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.js.map +0 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.stories.module.scss +0 -66
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.d.ts +0 -1
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js +0 -135
- package/dist/components/UncontrolledTransition/UncontrolledTransition.test.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.d.ts +0 -70
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js +0 -65
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.stories.js.map +0 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.d.ts +0 -1
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js +0 -137
- package/dist/components/WalletConnectionWrapper/WalletConnectionWrapper.test.js.map +0 -1
- package/dist/context/__mocks__/OneUIProvider.d.ts +0 -74
- package/dist/context/__mocks__/OneUIProvider.js +0 -13
- package/dist/context/__mocks__/OneUIProvider.js.map +0 -1
- package/dist/hooks/usePooling.test.d.ts +0 -1
- package/dist/hooks/usePooling.test.js +0 -104
- package/dist/hooks/usePooling.test.js.map +0 -1
- package/scripts/start-emulator.js +0 -48
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const ID = (id) => `${id}-hero`;
|
|
5
|
+
/**
|
|
6
|
+
* This hook implements the logic for a hero animation between 2 elements
|
|
7
|
+
*/
|
|
8
|
+
function useHero(id, propsToTransition = [], events = {}) {
|
|
9
|
+
const heroRef = (0, react_1.useRef)(null);
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
heroRef.current.setAttribute("data-hero", id);
|
|
12
|
+
}, [id]);
|
|
13
|
+
const getHerosOnScreen = (0, react_1.useCallback)(() => {
|
|
14
|
+
const otherElements = Array.from(document.querySelectorAll(`[data-hero="${id}"]`));
|
|
15
|
+
return otherElements;
|
|
16
|
+
}, [id]);
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
18
|
+
const allPropsToTransition = [
|
|
19
|
+
"width",
|
|
20
|
+
"height",
|
|
21
|
+
"top",
|
|
22
|
+
"left",
|
|
23
|
+
...propsToTransition,
|
|
24
|
+
];
|
|
25
|
+
const otherElements = getHerosOnScreen().filter(events.onHeroDetect || (() => true));
|
|
26
|
+
if (process.env.NODE_ENV === "development" && otherElements.length > 2)
|
|
27
|
+
console.warn("There are too many elements to transition to, I will transition to the first I find", otherElements);
|
|
28
|
+
const otherElement = otherElements.find((el) => el !== heroRef.current);
|
|
29
|
+
if (otherElement) {
|
|
30
|
+
const oldClone = document.querySelector(`[data-hero-clone="${ID(id)}"]`);
|
|
31
|
+
const clone = (oldClone ||
|
|
32
|
+
otherElement.cloneNode(true));
|
|
33
|
+
// Clean up thos properties that can cause confusion since it's a clone
|
|
34
|
+
clone.style.visibility = "";
|
|
35
|
+
clone.removeAttribute("data-hero");
|
|
36
|
+
clone.setAttribute("data-hero-clone", ID(id));
|
|
37
|
+
// Since a transition is now triggering from the old element, he cannot be considered for other transitions
|
|
38
|
+
otherElement.removeAttribute("data-hero");
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param el
|
|
42
|
+
* @returns Returns if it will move
|
|
43
|
+
*/
|
|
44
|
+
function setCloneToCoordinates(el) {
|
|
45
|
+
const coordinates = el.getBoundingClientRect();
|
|
46
|
+
const currentCoordinates = clone.getBoundingClientRect();
|
|
47
|
+
const willNotMove = coordinates.top === currentCoordinates.top &&
|
|
48
|
+
coordinates.left === currentCoordinates.left &&
|
|
49
|
+
coordinates.width === currentCoordinates.width &&
|
|
50
|
+
coordinates.height === currentCoordinates.height;
|
|
51
|
+
clone.style.position = "fixed";
|
|
52
|
+
clone.style.top = `${coordinates.top}px`;
|
|
53
|
+
clone.style.left = `${coordinates.left}px`;
|
|
54
|
+
clone.style.width = `${coordinates.width}px`;
|
|
55
|
+
clone.style.height = `${coordinates.height}px`;
|
|
56
|
+
return !willNotMove;
|
|
57
|
+
}
|
|
58
|
+
if (!oldClone) {
|
|
59
|
+
setCloneToCoordinates(otherElement);
|
|
60
|
+
document.body.appendChild(clone);
|
|
61
|
+
}
|
|
62
|
+
heroRef.current.style.visibility = "hidden";
|
|
63
|
+
otherElement.style.visibility = "hidden";
|
|
64
|
+
clone.style.transition = `${allPropsToTransition
|
|
65
|
+
.map((prop) => `${prop} var(--animation--speed-fast, 250ms) ease-out`)
|
|
66
|
+
.join(", ")}`;
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
const cleanup = () => {
|
|
69
|
+
if (events.onHeroEnd)
|
|
70
|
+
events.onHeroEnd();
|
|
71
|
+
clone.remove();
|
|
72
|
+
el.style.visibility = "";
|
|
73
|
+
};
|
|
74
|
+
if (events.onHeroStart)
|
|
75
|
+
events.onHeroStart(clone);
|
|
76
|
+
if (!heroRef.current)
|
|
77
|
+
return;
|
|
78
|
+
const el = heroRef.current;
|
|
79
|
+
const willMove = setCloneToCoordinates(el);
|
|
80
|
+
if (!willMove)
|
|
81
|
+
cleanup();
|
|
82
|
+
else {
|
|
83
|
+
for (let propToTransition of propsToTransition)
|
|
84
|
+
clone.style[propToTransition] =
|
|
85
|
+
el.style[propToTransition];
|
|
86
|
+
clone.addEventListener("transitionend", ({ target, currentTarget }) => {
|
|
87
|
+
if (target === currentTarget)
|
|
88
|
+
cleanup();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}, 0);
|
|
92
|
+
}
|
|
93
|
+
}, []);
|
|
94
|
+
return { heroRef, getHerosOnScreen };
|
|
95
|
+
}
|
|
96
|
+
exports.default = useHero;
|
|
97
|
+
//# sourceMappingURL=useHero.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHero.js","sourceRoot":"","sources":["../../src/hooks/useHero.ts"],"names":[],"mappings":";;AAAA,iCAAsE;AAEtE,MAAM,EAAE,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC;AAExC;;GAEG;AACH,SAAwB,OAAO,CAC7B,EAAU,EACV,oBAGM,EAAE,EACR,SAKI,EAAE;IAEN,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAE7C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAC9B,QAAQ,CAAC,gBAAgB,CAAC,eAAe,EAAE,IAAI,CAAC,CAC7B,CAAC;QACtB,OAAO,aAAa,CAAC;IACvB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,oBAAoB,GAAG;YAC3B,OAAO;YACP,QAAQ;YACR,KAAK;YACL,MAAM;YACN,GAAG,iBAAiB;SACrB,CAAC;QACF,MAAM,aAAa,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ClD,IAAI,CAAC,OAAO,CAAC,OAAO;oBAAE,OAAO;gBAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;gBAC3B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAAC;gBAC3C,IAAI,CAAC,QAAQ;oBAAE,OAAO,EAAE,CAAC;qBACpB;oBACH,KAAK,IAAI,gBAAgB,IAAI,iBAAiB;wBAC5C,KAAK,CAAC,KAAK,CAAC,gBAAuB,CAAC;4BAClC,EAAE,CAAC,KAAK,CAAC,gBAAuB,CAAC,CAAC;oBACtC,KAAK,CAAC,gBAAgB,CACpB,eAAe,EACf,CAAC,EAAE,MAAM,EAAE,aAAa,EAAmB,EAAE,EAAE;wBAC7C,IAAI,MAAM,KAAK,aAAa;4BAAE,OAAO,EAAE,CAAC;oBAC1C,CAAC,CACF,CAAC;iBACH;YACH,CAAC,EAAE,CAAC,CAAC,CAAC;SACP;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACvC,CAAC;AAzHD,0BAyHC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
/**
|
|
5
|
+
* This function exists so we can work with multiple refs as a single one
|
|
6
|
+
*/
|
|
7
|
+
function useMergeRefs(mainRef, ...otherRefs) {
|
|
8
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
9
|
+
for (let ref of otherRefs)
|
|
10
|
+
ref.current = mainRef.current;
|
|
11
|
+
}, []);
|
|
12
|
+
return mainRef;
|
|
13
|
+
}
|
|
14
|
+
exports.default = useMergeRefs;
|
|
15
|
+
//# sourceMappingURL=useMergeRefs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMergeRefs.js","sourceRoot":"","sources":["../../src/hooks/useMergeRefs.ts"],"names":[],"mappings":";;AAAA,iCAA2D;AAE3D;;GAEG;AACH,SAAwB,YAAY,CAClC,OAAU,EACV,GAAG,SAAc;IAEjB,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,KAAK,IAAI,GAAG,IAAI,SAAS;YAAE,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC3D,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,OAAO,CAAC;AACjB,CAAC;AARD,+BAQC"}
|
|
@@ -19,11 +19,12 @@ export declare type Paginable<I extends any, A extends any[] = [], E extends any
|
|
|
19
19
|
/**
|
|
20
20
|
* This returns a ref to be bound to an elements so it can be able to detect when a pagination whould occur
|
|
21
21
|
*/
|
|
22
|
-
export declare function useContainerPagination(cb: () => void): {
|
|
22
|
+
export declare function useContainerPagination(cb: () => void, direction?: "h" | "v"): {
|
|
23
23
|
scrollableRef: import("react").RefObject<HTMLDivElement>;
|
|
24
|
-
customOptionsRef: import("react").MutableRefObject<(() =>
|
|
25
|
-
offsetBottom
|
|
26
|
-
|
|
24
|
+
customOptionsRef: import("react").MutableRefObject<(() => {
|
|
25
|
+
offsetBottom?: number;
|
|
26
|
+
offsetLeft?: number;
|
|
27
|
+
}) | undefined>;
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* This function receives an amount of local instances and paginates it
|
|
@@ -33,15 +33,12 @@ function usePagination(request, paginationId = () => "default") {
|
|
|
33
33
|
const [items, setItems] = (0, react_1.useState)();
|
|
34
34
|
const _a = (0, useAsyncControl_1.default)(), { process } = _a, control = __rest(_a, ["process"]);
|
|
35
35
|
function updateItems(cb) {
|
|
36
|
-
setItems(prev => [prev[0], cb(), prev[2]]);
|
|
36
|
+
setItems((prev) => [prev[0], cb(), prev[2]]);
|
|
37
37
|
}
|
|
38
38
|
const _requestPage = (0, react_1.useCallback)(function (page, ...args) {
|
|
39
|
-
var _a;
|
|
40
39
|
const id = paginationId(...args);
|
|
41
|
-
if ((_a = paginationData[id]) === null || _a === void 0 ? void 0 : _a.finished)
|
|
42
|
-
return;
|
|
43
40
|
process(() => __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const result = yield request(page, (items === null || items === void 0 ? void 0 : items[0]) === id ? items === null || items === void 0 ? void 0 : items[1] : undefined, ...args);
|
|
41
|
+
const result = yield request(page, (items === null || items === void 0 ? void 0 : items[0]) === id && page !== 0 ? items === null || items === void 0 ? void 0 : items[1] : undefined, ...args);
|
|
45
42
|
paginationData[id] = {
|
|
46
43
|
finished: result.finished,
|
|
47
44
|
totalItems: result.totalItems,
|
|
@@ -57,20 +54,22 @@ function usePagination(request, paginationId = () => "default") {
|
|
|
57
54
|
}, [items, request]);
|
|
58
55
|
return {
|
|
59
56
|
updateItems,
|
|
60
|
-
getNextPage: (...args) =>
|
|
57
|
+
getNextPage: (...args) => {
|
|
58
|
+
_requestPage(((items === null || items === void 0 ? void 0 : items[2]) || 0) + 1, ...args);
|
|
59
|
+
},
|
|
61
60
|
getPage: _requestPage,
|
|
62
61
|
totalItems: (...args) => { var _a; return (_a = paginationData[paginationId(...args)]) === null || _a === void 0 ? void 0 : _a.totalItems; },
|
|
63
62
|
loading: control.loading,
|
|
64
63
|
error: control.error,
|
|
65
64
|
items: items === null || items === void 0 ? void 0 : items[1],
|
|
66
|
-
setError: control.setError
|
|
65
|
+
setError: control.setError,
|
|
67
66
|
};
|
|
68
67
|
}
|
|
69
68
|
exports.default = usePagination;
|
|
70
69
|
/**
|
|
71
70
|
* This returns a ref to be bound to an elements so it can be able to detect when a pagination whould occur
|
|
72
71
|
*/
|
|
73
|
-
function useContainerPagination(cb) {
|
|
72
|
+
function useContainerPagination(cb, direction = "v") {
|
|
74
73
|
const scrollableRef = (0, react_1.useRef)(null);
|
|
75
74
|
const customOptionsRef = (0, react_1.useRef)();
|
|
76
75
|
(0, react_1.useEffect)(() => {
|
|
@@ -78,22 +77,30 @@ function useContainerPagination(cb) {
|
|
|
78
77
|
const scrollElement = el.scrollingElement || el;
|
|
79
78
|
const calculateIfReachedLimit = (0, throttle_1.default)(() => {
|
|
80
79
|
var _a;
|
|
81
|
-
const
|
|
82
|
-
const offsetLimit =
|
|
83
|
-
|
|
80
|
+
const { offsetBottom = 0, offsetLeft = 0 } = ((_a = customOptionsRef.current) === null || _a === void 0 ? void 0 : _a.call(customOptionsRef)) || {};
|
|
81
|
+
const offsetLimit = direction === "v"
|
|
82
|
+
? scrollElement.scrollHeight -
|
|
83
|
+
offsetBottom -
|
|
84
|
+
scrollElement.clientHeight * 0.6
|
|
85
|
+
: scrollElement.scrollWidth -
|
|
86
|
+
offsetLeft -
|
|
87
|
+
scrollElement.clientWidth * 0.6;
|
|
88
|
+
const offset = direction === "v"
|
|
89
|
+
? scrollElement.clientHeight + scrollElement.scrollTop
|
|
90
|
+
: scrollElement.clientWidth + scrollElement.scrollLeft;
|
|
84
91
|
if (offset >= offsetLimit) {
|
|
85
92
|
cb();
|
|
86
93
|
}
|
|
87
94
|
}, 250, {
|
|
88
95
|
leading: false,
|
|
89
|
-
trailing: true
|
|
96
|
+
trailing: true,
|
|
90
97
|
});
|
|
91
98
|
el.addEventListener("scroll", calculateIfReachedLimit);
|
|
92
|
-
return () => el.removeEventListener(
|
|
99
|
+
return () => el.removeEventListener("scroll", calculateIfReachedLimit);
|
|
93
100
|
}, [cb]);
|
|
94
101
|
return {
|
|
95
102
|
scrollableRef,
|
|
96
|
-
customOptionsRef
|
|
103
|
+
customOptionsRef,
|
|
97
104
|
};
|
|
98
105
|
}
|
|
99
106
|
exports.useContainerPagination = useContainerPagination;
|
|
@@ -105,11 +112,10 @@ function useLocalPagination(items, pageSize) {
|
|
|
105
112
|
const cb = (0, react_1.useCallback)((page, currItems = []) => {
|
|
106
113
|
const from = pageSize * page;
|
|
107
114
|
const newArray = [...currItems, ...items.slice(from, from + pageSize)];
|
|
108
|
-
console.log(`For page ${page}, resolving ${newArray.length} from the ${items.length} items of ${instanceID}`);
|
|
109
115
|
return Promise.resolve({
|
|
110
116
|
finished: newArray.length === items.length,
|
|
111
117
|
totalItems: items.length,
|
|
112
|
-
items: newArray
|
|
118
|
+
items: newArray,
|
|
113
119
|
});
|
|
114
120
|
}, [pageSize, items]);
|
|
115
121
|
const pagination = usePagination(cb, () => `${instanceID}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../src/hooks/usePagination.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"usePagination.js","sourceRoot":"","sources":["../../src/hooks/usePagination.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAOe;AACf,wEAAgD;AAChD,+DAAuC;AAQvC,SAAwB,aAAa,CACnC,OAA6E,EAC7E,eAAuC,GAAG,EAAE,CAAC,SAAS;IAEtD,MAAM,iBAAiB,GAAG,IAAA,cAAM,EAO7B,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,iBAAiB,CAAC;IAEtD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GACrB,IAAA,gBAAQ,GAAyD,CAAC;IACpE,MAAM,KAA0B,IAAA,yBAAe,GAAE,EAA3C,EAAE,OAAO,OAAkC,EAA7B,OAAO,cAArB,WAAuB,CAAoB,CAAC;IAElD,SAAS,WAAW,CAAC,EAA8C;QACjE,QAAQ,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,IAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,mBAAW,EAC9B,UAAU,IAAY,EAAE,GAAG,IAAO;QAChC,MAAM,EAAE,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC;QACjC,OAAO,CAAC,GAAS,EAAE;YACjB,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,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AAgB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QACvD,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,mBAAmB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;IACzE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAET,OAAO;QACL,aAAa;QACb,gBAAgB;KACjB,CAAC;AACJ,CAAC;AA/CD,wDA+CC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAI,KAAU,EAAE,QAAgB;IAChE,MAAM,UAAU,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,IAAA,mBAAW,EACpB,CAAC,IAAY,EAAE,YAAiB,EAAE,EAAE,EAAE;QACpC,MAAM,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC;QAC7B,MAAM,QAAQ,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC;QAEvE,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,QAAQ,EAAE,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAC1C,UAAU,EAAE,KAAK,CAAC,MAAM;YACxB,KAAK,EAAE,QAAQ;SAChB,CAAC,CAAC;IACL,CAAC,EACD,CAAC,QAAQ,EAAE,KAAK,CAAC,CAClB,CAAC;IACF,MAAM,UAAU,GAAG,aAAa,CAAU,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;IAErE,OAAO,UAAU,CAAC;AACpB,CAAC;AAlBD,gDAkBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* This hook handles the display of pagination controls for the user to move to another page
|
|
5
|
+
*/
|
|
6
|
+
function usePaginationControls(containerRef) { }
|
|
7
|
+
exports.default = usePaginationControls;
|
|
8
|
+
//# sourceMappingURL=usePaginationControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePaginationControls.js","sourceRoot":"","sources":["../../src/hooks/usePaginationControls.ts"],"names":[],"mappings":";;AAEA;;GAEG;AACH,SAAwB,qBAAqB,CAC3C,YAAuC,IACtC,CAAC;AAFJ,wCAEI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShortIntl.js","sourceRoot":"","sources":["../../src/hooks/useShortIntl.ts"],"names":[],"mappings":";;;AAAA,2CAAgE;AAGhE,SAAwB,YAAY;IAWlC,MAAM,IAAI,GAAG,IAAA,oBAAO,GAAE,CAAC;IACvB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC7C,uCACK,IAAI,KACP,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE;YAClB,OAAO,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC,EACD,qBAAqB,CAAC,GAAW,EAAE,OAAO,GAAG,EAAE;YAC7C,OAAO,YAAY,CAAC,GAAG,kBACrB,qBAAqB,EAAE,CAAC,EACxB,qBAAqB,EAAE,CAAC,IACrB,OAAO,EACV,CAAA;QACJ,CAAC;QACD,eAAe,CAAC,SAAS,EAAE,OAAO;YAChC,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI;iBAC9B,mBAAmB,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBACf,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS;oBAAE,uCAAY,CAAC,KAAE,gBAAgB,EAAE,CAAC,CAAC,KAAK,IAAG;gBACrE,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;oBAAE,uCAAY,CAAC,KAAE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E,CAAC,CAAC,KAAK,IAAG;gBACrE,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO;oBAAE,uCAAY,CAAC,KAAE,iBAAiB,EAAE,CAAC,CAAC,KAAK,IAAG;gBACpE,OAAO,CAAC,CAAC;YACX,CAAC,EAAE,EAA6D,CAAC,CAAC;YAEpE,MAAM,WAAW,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;YACnE,MAAM,QAAQ,GAAG,SAAS;iBACvB,KAAK,CAAC,WAAW,CAAC;iBAClB,aAAa,CACZ,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,KAAI,SAAS,CAAC,aAAa,EAAG,EAC5D,CAAC,CACF;iBACA,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACrB,OAAO,GAAG,OAAO,GAAG,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,EACxE,EAAE,CAAC;QACP,CAAC,IACD;AACJ,CAAC;AAhDD,+BAgDC;AAUD,SAAgB,eAAe,CAC7B,OAAU,EACV,OAAU;IAEV,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,iCACV,CAAC,KACJ,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IACtB,EACF,EAA4C,CAC7C,CAAC;AACJ,CAAC;AAXD,0CAWC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Contract, ContractOptions, EventData, PastEventOptions } from "web3-eth-contract";
|
|
2
|
-
export declare type AllABIs =
|
|
2
|
+
export declare type AllABIs = readonly any[];
|
|
3
3
|
declare type ExtractMethods<A extends AllABIs[number]> = A extends {
|
|
4
4
|
type: "function";
|
|
5
5
|
} ? A["name"] : never;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
declare type PrependNextNum<A extends Array<unknown>> = A['length'] extends infer T ? ((t: T, ...a: A) => void) extends ((...x: infer X) => void) ? X : never : never;
|
|
2
|
+
declare type EnumerateInternal<A extends Array<unknown>, N extends number> = {
|
|
3
|
+
0: A;
|
|
4
|
+
1: EnumerateInternal<PrependNextNum<A>, N>;
|
|
5
|
+
}[N extends A['length'] ? 0 : 1];
|
|
6
|
+
export declare type Enumerate<N extends number> = EnumerateInternal<[], N> extends (infer E)[] ? E : never;
|
|
7
|
+
export declare type Range<FROM extends number, TO extends number> = Exclude<Enumerate<TO>, Enumerate<FROM>>;
|
|
8
|
+
export declare type CommonErrorCodes = "UNEXPECTED_ERROR";
|
|
9
|
+
export declare type BasicContext<T extends object> = {
|
|
10
|
+
set: <P extends keyof T>(p: P, value: T[typeof p]) => void;
|
|
11
|
+
} & T;
|
|
12
|
+
/**
|
|
13
|
+
* This is usefull for omitting props from union
|
|
14
|
+
* Check whz contestation model to see an example
|
|
15
|
+
*
|
|
16
|
+
* If different models with different properties use the native Omit<O>
|
|
17
|
+
* Their differences are also omitted generating a single model
|
|
18
|
+
*
|
|
19
|
+
* This typing solves that
|
|
20
|
+
*/
|
|
21
|
+
export declare type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
|
|
22
|
+
declare global {
|
|
23
|
+
interface Window {
|
|
24
|
+
ethereum: import("@metamask/providers").MetaMaskInpageProvider | undefined;
|
|
25
|
+
PRERENDER: boolean;
|
|
26
|
+
Cypress: any;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
declare type NestedValue = unknown;
|
|
30
|
+
declare type FieldValues = unknown;
|
|
31
|
+
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
32
|
+
export declare type EmptyObject = {
|
|
33
|
+
[K in string | number]: never;
|
|
34
|
+
};
|
|
35
|
+
export declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
36
|
+
export declare type LiteralUnion<T extends U, U extends Primitive> = T | (U & {
|
|
37
|
+
_?: never;
|
|
38
|
+
});
|
|
39
|
+
export declare type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
40
|
+
[key in keyof T]: T[key];
|
|
41
|
+
} ? {
|
|
42
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
43
|
+
} : T;
|
|
44
|
+
export declare type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
45
|
+
export declare type DeepMap<T, TValue> = {
|
|
46
|
+
[K in keyof T]?: IsAny<T[K]> extends true ? any : NonNullable<T[K]> extends NestedValue | Date | FileList | File ? TValue : NonUndefined<T[K]> extends object | null ? DeepMap<T[K], TValue> : NonUndefined<T[K]> extends Array<infer U> ? IsAny<U> extends true ? Array<any> : U extends NestedValue | Date | FileList ? Array<TValue> : U extends object ? Array<DeepMap<U, TValue>> : Array<TValue> : TValue;
|
|
47
|
+
};
|
|
48
|
+
export declare type IsFlatObject<T extends object> = Extract<Exclude<T[keyof T], NestedValue | Date | FileList>, any[] | object> extends never ? true : false;
|
|
49
|
+
declare type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
|
|
50
|
+
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
51
|
+
declare type ArrayKey = number;
|
|
52
|
+
declare type PathImpl<K extends string | number, V> = V extends Primitive ? `${K}` : `${K}.${Path<V>}`;
|
|
53
|
+
export declare type Path<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
54
|
+
[K in TupleKey<T>]-?: PathImpl<K & string, T[K]>;
|
|
55
|
+
}[TupleKey<T>] : PathImpl<ArrayKey, V> : {
|
|
56
|
+
[K in keyof T]-?: PathImpl<K & string, T[K]>;
|
|
57
|
+
}[keyof T];
|
|
58
|
+
export declare type FieldPath<TFieldValues extends FieldValues> = Path<TFieldValues>;
|
|
59
|
+
declare type ArrayPathImpl<K extends string | number, V> = V extends Primitive ? never : V extends ReadonlyArray<infer U> ? U extends Primitive ? never : `${K}` | `${K}.${ArrayPath<V>}` : `${K}.${ArrayPath<V>}`;
|
|
60
|
+
export declare type ArrayPath<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
61
|
+
[K in TupleKey<T>]-?: ArrayPathImpl<K & string, T[K]>;
|
|
62
|
+
}[TupleKey<T>] : ArrayPathImpl<ArrayKey, V> : {
|
|
63
|
+
[K in keyof T]-?: ArrayPathImpl<K & string, T[K]>;
|
|
64
|
+
}[keyof T];
|
|
65
|
+
export declare type FieldArrayPath<TFieldValues extends FieldValues> = ArrayPath<TFieldValues>;
|
|
66
|
+
export declare type PathValue<T, P extends Path<T> | ArrayPath<T>> = P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path<T[K]> ? PathValue<T[K], R> : never : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValue<V, R & Path<V>> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : never : never;
|
|
67
|
+
export declare type FieldPathValue<TFieldValues extends FieldValues, TFieldPath extends FieldPath<TFieldValues>> = PathValue<TFieldValues, TFieldPath>;
|
|
68
|
+
export declare type FieldArrayPathValue<TFieldValues extends FieldValues, TFieldArrayPath extends FieldArrayPath<TFieldValues>> = PathValue<TFieldValues, TFieldArrayPath>;
|
|
69
|
+
export declare type FieldPathValues<TFieldValues extends FieldValues, TPath extends FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]> = {} & {
|
|
70
|
+
[K in keyof TPath]: FieldPathValue<TFieldValues, TPath[K] & FieldPath<TFieldValues>>;
|
|
71
|
+
};
|
|
72
|
+
export {};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5-beta.10",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
|
-
"files": [
|
|
6
|
-
"dist",
|
|
7
|
-
"WebpackConfigs",
|
|
8
|
-
"cypress/support",
|
|
9
|
-
"src/types.d.ts"
|
|
10
|
-
],
|
|
11
|
-
"bin": {
|
|
12
|
-
"start-emulator": "scripts/start-emulator.js"
|
|
13
|
-
},
|
|
14
5
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
15
6
|
"author": "Murilo Oliveira de Araujo <muritavo@outlook.com>",
|
|
16
7
|
"license": "MIT",
|
|
17
|
-
"types": "src/types.
|
|
8
|
+
"types": "src/types.ts",
|
|
18
9
|
"devDependencies": {
|
|
19
10
|
"@babel/core": "^7.16.0",
|
|
20
11
|
"@cypress/react": "^5.12.5",
|
|
21
12
|
"@firebase/rules-unit-testing": "^2.0.2",
|
|
22
|
-
"@
|
|
23
|
-
"@muritavo/
|
|
13
|
+
"@metamask/providers": "^9.1.0",
|
|
14
|
+
"@muritavo/cypress-toolkit": "^0.8.0",
|
|
15
|
+
"@muritavo/webpack-microfrontend-scripts": "^0.0.24",
|
|
24
16
|
"@storybook/addon-actions": "^6.4.18",
|
|
25
17
|
"@storybook/addon-essentials": "^6.4.18",
|
|
26
18
|
"@storybook/addon-links": "^6.4.18",
|
|
@@ -42,7 +34,7 @@
|
|
|
42
34
|
"cpy-cli": "^3.1.1",
|
|
43
35
|
"crypto-browserify": "^3.12.0",
|
|
44
36
|
"css-loader": "^5",
|
|
45
|
-
"cypress": "^10.
|
|
37
|
+
"cypress": "^10.9.0",
|
|
46
38
|
"firebase": "^9.8.1",
|
|
47
39
|
"firebase-admin": "^10.2.0",
|
|
48
40
|
"https-browserify": "^1.0.0",
|
|
@@ -97,9 +89,9 @@
|
|
|
97
89
|
"dev": "tsc --watch",
|
|
98
90
|
"test:watch": "jest --watchAll --coverage",
|
|
99
91
|
"deploy:storybook": "yarn build-storybook && firebase deploy --only hosting",
|
|
100
|
-
"test:e2e:watch": "cypress open --component --port 6005 --browser
|
|
92
|
+
"test:e2e:watch": "cypress open --component --port 6005 --browser chrome",
|
|
101
93
|
"test:e2e": "cypress run --component --port 6015 --browser chrome",
|
|
102
|
-
"
|
|
94
|
+
"prepack": "yarn build"
|
|
103
95
|
},
|
|
104
96
|
"browserslist": {
|
|
105
97
|
"production": [
|
|
@@ -29,7 +29,7 @@ export type DistributiveOmit<T, K extends keyof any> = T extends any
|
|
|
29
29
|
|
|
30
30
|
declare global {
|
|
31
31
|
interface Window {
|
|
32
|
-
ethereum:
|
|
32
|
+
ethereum: import("@metamask/providers").MetaMaskInpageProvider | undefined;
|
|
33
33
|
PRERENDER: boolean;
|
|
34
34
|
Cypress: any;
|
|
35
35
|
}
|
|
@@ -59,14 +59,14 @@ declare type IsTuple<T extends ReadonlyArray<any>> = number extends T['length']
|
|
|
59
59
|
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
60
60
|
declare type ArrayKey = number;
|
|
61
61
|
declare type PathImpl<K extends string | number, V> = V extends Primitive ? `${K}` : `${K}.${Path<V>}`;
|
|
62
|
-
export declare type Path<T> = T extends ReadonlyArray<infer V>
|
|
63
|
-
?
|
|
64
|
-
IsTuple<T> extends true
|
|
62
|
+
export declare type Path<T> = T extends ReadonlyArray<infer V>
|
|
63
|
+
?
|
|
64
|
+
IsTuple<T> extends true
|
|
65
65
|
? {
|
|
66
66
|
[K in TupleKey<T>]-?: PathImpl<K & string, T[K]>;
|
|
67
|
-
}[TupleKey<T>]
|
|
68
|
-
: PathImpl<ArrayKey, V>
|
|
69
|
-
: {
|
|
67
|
+
}[TupleKey<T>]
|
|
68
|
+
: PathImpl<ArrayKey, V>
|
|
69
|
+
: {
|
|
70
70
|
[K in keyof T]-?: PathImpl<K & string, T[K]>;
|
|
71
71
|
}[keyof T];
|
|
72
72
|
export declare type FieldPath<TFieldValues extends FieldValues> = Path<TFieldValues>;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "ES2015" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
15
|
+
"lib": [
|
|
16
|
+
"DOM",
|
|
17
|
+
"ES2015"
|
|
18
|
+
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
|
|
19
|
+
"jsx": "react" /* Specify what JSX code is generated. */,
|
|
20
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
21
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
22
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
23
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
24
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
25
|
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
26
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
27
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
28
|
+
|
|
29
|
+
/* Modules */
|
|
30
|
+
"module": "CommonJS" /* Specify what module code is generated. */,
|
|
31
|
+
"moduleResolution": "Node",
|
|
32
|
+
"skipDefaultLibCheck": true,
|
|
33
|
+
"rootDir": "./src" /* Specify the root folder within your source files. */,
|
|
34
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
35
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
36
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
37
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
38
|
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
39
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
40
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
41
|
+
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
42
|
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
43
|
+
|
|
44
|
+
/* JavaScript Support */
|
|
45
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
46
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
47
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
48
|
+
|
|
49
|
+
/* Emit */
|
|
50
|
+
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
51
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
52
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
53
|
+
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
|
54
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
55
|
+
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
|
56
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
57
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
58
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
59
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
60
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
61
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
62
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
63
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
64
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
65
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
66
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
67
|
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
68
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
69
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
70
|
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
71
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
72
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
73
|
+
|
|
74
|
+
/* Interop Constraints */
|
|
75
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
77
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */,
|
|
78
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
79
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
80
|
+
|
|
81
|
+
/* Type Checking */
|
|
82
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
83
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
|
84
|
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
85
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
86
|
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
87
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
88
|
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
89
|
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
90
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
91
|
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
92
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
93
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
94
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
95
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
96
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
97
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
98
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
99
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
100
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
101
|
+
|
|
102
|
+
/* Completeness */
|
|
103
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
104
|
+
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
105
|
+
},
|
|
106
|
+
"exclude": ["cypress", "dist", "node_modules"],
|
|
107
|
+
"include": ["src", "cypress"]
|
|
108
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
`;
|