@dropins/tools 0.21.2-alpha2 → 0.21.2-alpha389
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/event-bus.js +1 -49
- package/fetch-graphql.js +1 -62
- package/initializer.js +1 -61
- package/package.json +1 -1
- package/preact-compat.js +1 -93
- package/preact-hooks.js +1 -40
- package/preact-jsx-runtime.js +1 -35
- package/preact.js +1 -21
- package/runtime.js +1 -69
- package/components/Accordion/Accordion.d.ts +0 -25
- package/components/Accordion/Accordion.d.ts.map +0 -1
- package/components/Accordion/Accordion.jsx +0 -59
- package/components/Accordion/Accordion.stories.d.ts +0 -22
- package/components/Accordion/Accordion.stories.d.ts.map +0 -1
- package/components/Accordion/Accordion.stories.jsx +0 -320
- package/components/Accordion/Accordion.test.d.ts +0 -3
- package/components/Accordion/Accordion.test.d.ts.map +0 -1
- package/components/Accordion/Accordion.test.jsx +0 -79
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.d.ts.map +0 -1
- package/components/Accordion/index.js +0 -2
- package/components/ActionButton/ActionButton.d.ts +0 -11
- package/components/ActionButton/ActionButton.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.jsx +0 -14
- package/components/ActionButton/ActionButton.stories.d.ts +0 -16
- package/components/ActionButton/ActionButton.stories.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.stories.jsx +0 -119
- package/components/ActionButton/ActionButton.test.d.ts +0 -3
- package/components/ActionButton/ActionButton.test.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.test.jsx +0 -47
- package/components/ActionButton/index.d.ts +0 -2
- package/components/ActionButton/index.d.ts.map +0 -1
- package/components/ActionButton/index.js +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts +0 -20
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.jsx +0 -39
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts +0 -16
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.stories.jsx +0 -72
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts +0 -3
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.test.jsx +0 -78
- package/components/ActionButtonGroup/index.d.ts +0 -2
- package/components/ActionButtonGroup/index.d.ts.map +0 -1
- package/components/ActionButtonGroup/index.js +0 -1
- package/components/AlertBanner/AlertBanner.d.ts +0 -15
- package/components/AlertBanner/AlertBanner.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.jsx +0 -30
- package/components/AlertBanner/AlertBanner.stories.d.ts +0 -17
- package/components/AlertBanner/AlertBanner.stories.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.stories.jsx +0 -128
- package/components/AlertBanner/AlertBanner.test.d.ts +0 -3
- package/components/AlertBanner/AlertBanner.test.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.test.jsx +0 -40
- package/components/AlertBanner/index.d.ts +0 -3
- package/components/AlertBanner/index.d.ts.map +0 -1
- package/components/AlertBanner/index.js +0 -2
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -9
- package/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -26
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -15
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.stories.jsx +0 -110
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts +0 -3
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.test.jsx +0 -67
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.d.ts.map +0 -1
- package/components/Breadcrumbs/index.js +0 -2
- package/components/Button/Button.d.ts +0 -15
- package/components/Button/Button.d.ts.map +0 -1
- package/components/Button/Button.jsx +0 -59
- package/components/Button/Button.stories.d.ts +0 -135
- package/components/Button/Button.stories.d.ts.map +0 -1
- package/components/Button/Button.stories.jsx +0 -354
- package/components/Button/Button.test.d.ts +0 -2
- package/components/Button/Button.test.d.ts.map +0 -1
- package/components/Button/Button.test.jsx +0 -134
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.d.ts.map +0 -1
- package/components/Button/index.js +0 -2
- package/components/Card/Card.d.ts +0 -9
- package/components/Card/Card.d.ts.map +0 -1
- package/components/Card/Card.jsx +0 -7
- package/components/Card/Card.stories.d.ts +0 -16
- package/components/Card/Card.stories.d.ts.map +0 -1
- package/components/Card/Card.stories.jsx +0 -47
- package/components/Card/Card.test.d.ts +0 -3
- package/components/Card/Card.test.d.ts.map +0 -1
- package/components/Card/Card.test.jsx +0 -26
- package/components/Card/index.d.ts +0 -2
- package/components/Card/index.d.ts.map +0 -1
- package/components/Card/index.js +0 -1
- package/components/CartItem/CartItem.d.ts +0 -25
- package/components/CartItem/CartItem.d.ts.map +0 -1
- package/components/CartItem/CartItem.jsx +0 -124
- package/components/CartItem/CartItem.stories.d.ts +0 -54
- package/components/CartItem/CartItem.stories.d.ts.map +0 -1
- package/components/CartItem/CartItem.stories.jsx +0 -309
- package/components/CartItem/CartItem.test.d.ts +0 -3
- package/components/CartItem/CartItem.test.d.ts.map +0 -1
- package/components/CartItem/CartItem.test.jsx +0 -71
- package/components/CartItem/CartItemSkeleton.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.jsx +0 -25
- package/components/CartItem/CartItemSkeleton.test.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.test.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.test.jsx +0 -11
- package/components/CartItem/index.d.ts +0 -4
- package/components/CartItem/index.d.ts.map +0 -1
- package/components/CartItem/index.js +0 -3
- package/components/CartList/CartList.d.ts +0 -7
- package/components/CartList/CartList.d.ts.map +0 -1
- package/components/CartList/CartList.jsx +0 -14
- package/components/CartList/CartList.stories.d.ts +0 -17
- package/components/CartList/CartList.stories.d.ts.map +0 -1
- package/components/CartList/CartList.stories.jsx +0 -54
- package/components/CartList/CartList.test.d.ts +0 -3
- package/components/CartList/CartList.test.d.ts.map +0 -1
- package/components/CartList/CartList.test.jsx +0 -12
- package/components/CartList/index.d.ts +0 -3
- package/components/CartList/index.d.ts.map +0 -1
- package/components/CartList/index.js +0 -2
- package/components/Checkbox/Checkbox.d.ts +0 -13
- package/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.jsx +0 -51
- package/components/Checkbox/Checkbox.stories.d.ts +0 -22
- package/components/Checkbox/Checkbox.stories.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.stories.jsx +0 -157
- package/components/Checkbox/Checkbox.test.d.ts +0 -3
- package/components/Checkbox/Checkbox.test.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.test.jsx +0 -136
- package/components/Checkbox/index.d.ts +0 -2
- package/components/Checkbox/index.d.ts.map +0 -1
- package/components/Checkbox/index.js +0 -1
- package/components/ColorSwatch/ColorSwatch.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.jsx +0 -57
- package/components/ColorSwatch/ColorSwatch.stories.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.stories.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.stories.jsx +0 -206
- package/components/ColorSwatch/ColorSwatch.test.d.ts +0 -3
- package/components/ColorSwatch/ColorSwatch.test.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.test.jsx +0 -87
- package/components/ColorSwatch/index.d.ts +0 -3
- package/components/ColorSwatch/index.d.ts.map +0 -1
- package/components/ColorSwatch/index.js +0 -2
- package/components/Divider/Divider.d.ts +0 -8
- package/components/Divider/Divider.d.ts.map +0 -1
- package/components/Divider/Divider.jsx +0 -9
- package/components/Divider/Divider.stories.d.ts +0 -11
- package/components/Divider/Divider.stories.d.ts.map +0 -1
- package/components/Divider/Divider.stories.jsx +0 -43
- package/components/Divider/Divider.test.d.ts +0 -2
- package/components/Divider/Divider.test.d.ts.map +0 -1
- package/components/Divider/Divider.test.jsx +0 -19
- package/components/Divider/index.d.ts +0 -3
- package/components/Divider/index.d.ts.map +0 -1
- package/components/Divider/index.js +0 -2
- package/components/Field/Field.d.ts +0 -14
- package/components/Field/Field.d.ts.map +0 -1
- package/components/Field/Field.jsx +0 -29
- package/components/Field/Field.stories.d.ts +0 -37
- package/components/Field/Field.stories.d.ts.map +0 -1
- package/components/Field/Field.stories.jsx +0 -174
- package/components/Field/Field.test.d.ts +0 -3
- package/components/Field/Field.test.d.ts.map +0 -1
- package/components/Field/Field.test.jsx +0 -91
- package/components/Field/index.d.ts +0 -2
- package/components/Field/index.d.ts.map +0 -1
- package/components/Field/index.js +0 -1
- package/components/Icon/Icon.d.ts +0 -11
- package/components/Icon/Icon.d.ts.map +0 -1
- package/components/Icon/Icon.jsx +0 -57
- package/components/Icon/Icon.stories.d.ts +0 -16
- package/components/Icon/Icon.stories.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.d.ts +0 -4
- package/components/Icon/Icon.stories.helpers.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.jsx +0 -7
- package/components/Icon/Icon.stories.jsx +0 -48
- package/components/Icon/Icon.test.d.ts +0 -3
- package/components/Icon/Icon.test.d.ts.map +0 -1
- package/components/Icon/Icon.test.jsx +0 -67
- package/components/Icon/index.d.ts +0 -2
- package/components/Icon/index.d.ts.map +0 -1
- package/components/Icon/index.js +0 -1
- package/components/IllustratedMessage/IllustratedMessage.d.ts +0 -13
- package/components/IllustratedMessage/IllustratedMessage.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.jsx +0 -21
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts +0 -10
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.stories.jsx +0 -90
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts +0 -3
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.test.jsx +0 -42
- package/components/IllustratedMessage/index.d.ts +0 -3
- package/components/IllustratedMessage/index.d.ts.map +0 -1
- package/components/IllustratedMessage/index.js +0 -2
- package/components/Image/Image.d.ts +0 -11
- package/components/Image/Image.d.ts.map +0 -1
- package/components/Image/Image.jsx +0 -26
- package/components/Image/Image.stories.d.ts +0 -11
- package/components/Image/Image.stories.d.ts.map +0 -1
- package/components/Image/Image.stories.jsx +0 -66
- package/components/Image/Image.test.d.ts +0 -3
- package/components/Image/Image.test.d.ts.map +0 -1
- package/components/Image/Image.test.jsx +0 -82
- package/components/Image/index.d.ts +0 -2
- package/components/Image/index.d.ts.map +0 -1
- package/components/Image/index.js +0 -1
- package/components/ImageSwatch/ImageSwatch.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.jsx +0 -49
- package/components/ImageSwatch/ImageSwatch.stories.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.stories.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.stories.jsx +0 -206
- package/components/ImageSwatch/ImageSwatch.test.d.ts +0 -3
- package/components/ImageSwatch/ImageSwatch.test.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.test.jsx +0 -64
- package/components/ImageSwatch/index.d.ts +0 -3
- package/components/ImageSwatch/index.d.ts.map +0 -1
- package/components/ImageSwatch/index.js +0 -2
- package/components/InLineAlert/InLineAlert.d.ts +0 -16
- package/components/InLineAlert/InLineAlert.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.jsx +0 -38
- package/components/InLineAlert/InLineAlert.stories.d.ts +0 -86
- package/components/InLineAlert/InLineAlert.stories.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.stories.jsx +0 -193
- package/components/InLineAlert/InLineAlert.test.d.ts +0 -3
- package/components/InLineAlert/InLineAlert.test.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.test.jsx +0 -77
- package/components/InLineAlert/index.d.ts +0 -3
- package/components/InLineAlert/index.d.ts.map +0 -1
- package/components/InLineAlert/index.js +0 -2
- package/components/Incrementer/Incrementer.d.ts +0 -17
- package/components/Incrementer/Incrementer.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.jsx +0 -87
- package/components/Incrementer/Incrementer.stories.d.ts +0 -10
- package/components/Incrementer/Incrementer.stories.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.stories.jsx +0 -68
- package/components/Incrementer/Incrementer.test.d.ts +0 -3
- package/components/Incrementer/Incrementer.test.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.test.jsx +0 -112
- package/components/Incrementer/index.d.ts +0 -2
- package/components/Incrementer/index.d.ts.map +0 -1
- package/components/Incrementer/index.js +0 -1
- package/components/Input/Input.d.ts +0 -19
- package/components/Input/Input.d.ts.map +0 -1
- package/components/Input/Input.jsx +0 -73
- package/components/Input/Input.stories.d.ts +0 -11
- package/components/Input/Input.stories.d.ts.map +0 -1
- package/components/Input/Input.stories.jsx +0 -115
- package/components/Input/Input.test.d.ts +0 -3
- package/components/Input/Input.test.d.ts.map +0 -1
- package/components/Input/Input.test.jsx +0 -111
- package/components/Input/index.d.ts +0 -3
- package/components/Input/index.d.ts.map +0 -1
- package/components/Input/index.js +0 -2
- package/components/Modal/Modal.d.ts +0 -15
- package/components/Modal/Modal.d.ts.map +0 -1
- package/components/Modal/Modal.jsx +0 -93
- package/components/Modal/Modal.stories.d.ts +0 -56
- package/components/Modal/Modal.stories.d.ts.map +0 -1
- package/components/Modal/Modal.stories.jsx +0 -189
- package/components/Modal/Modal.test.d.ts +0 -3
- package/components/Modal/Modal.test.d.ts.map +0 -1
- package/components/Modal/Modal.test.jsx +0 -85
- package/components/Modal/index.d.ts +0 -2
- package/components/Modal/index.d.ts.map +0 -1
- package/components/Modal/index.js +0 -14
- package/components/Picker/Picker.d.ts +0 -26
- package/components/Picker/Picker.d.ts.map +0 -1
- package/components/Picker/Picker.jsx +0 -81
- package/components/Picker/Picker.stories.d.ts +0 -22
- package/components/Picker/Picker.stories.d.ts.map +0 -1
- package/components/Picker/Picker.stories.jsx +0 -236
- package/components/Picker/Picker.test.d.ts +0 -2
- package/components/Picker/Picker.test.d.ts.map +0 -1
- package/components/Picker/Picker.test.jsx +0 -190
- package/components/Picker/index.d.ts +0 -2
- package/components/Picker/index.d.ts.map +0 -1
- package/components/Picker/index.js +0 -1
- package/components/Price/Price.d.ts +0 -17
- package/components/Price/Price.d.ts.map +0 -1
- package/components/Price/Price.jsx +0 -24
- package/components/Price/Price.stories.d.ts +0 -17
- package/components/Price/Price.stories.d.ts.map +0 -1
- package/components/Price/Price.stories.jsx +0 -78
- package/components/Price/Price.test.d.ts +0 -3
- package/components/Price/Price.test.d.ts.map +0 -1
- package/components/Price/Price.test.jsx +0 -68
- package/components/Price/index.d.ts +0 -2
- package/components/Price/index.d.ts.map +0 -1
- package/components/Price/index.js +0 -1
- package/components/PriceRange/PriceRange.d.ts +0 -17
- package/components/PriceRange/PriceRange.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.jsx +0 -75
- package/components/PriceRange/PriceRange.stories.d.ts +0 -107
- package/components/PriceRange/PriceRange.stories.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.stories.jsx +0 -210
- package/components/PriceRange/PriceRange.test.d.ts +0 -3
- package/components/PriceRange/PriceRange.test.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.test.jsx +0 -188
- package/components/PriceRange/index.d.ts +0 -3
- package/components/PriceRange/index.d.ts.map +0 -1
- package/components/PriceRange/index.js +0 -2
- package/components/PriceSummary/PriceSummary.d.ts +0 -43
- package/components/PriceSummary/PriceSummary.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.jsx +0 -228
- package/components/PriceSummary/PriceSummary.stories.d.ts +0 -127
- package/components/PriceSummary/PriceSummary.stories.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.stories.jsx +0 -456
- package/components/PriceSummary/PriceSummary.test.d.ts +0 -3
- package/components/PriceSummary/PriceSummary.test.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.test.jsx +0 -275
- package/components/PriceSummary/index.d.ts +0 -3
- package/components/PriceSummary/index.d.ts.map +0 -1
- package/components/PriceSummary/index.js +0 -2
- package/components/ProgressSpinner/ProgressSpinner.d.ts +0 -14
- package/components/ProgressSpinner/ProgressSpinner.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.jsx +0 -31
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts +0 -19
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.stories.jsx +0 -195
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts +0 -3
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.test.jsx +0 -40
- package/components/ProgressSpinner/index.d.ts +0 -3
- package/components/ProgressSpinner/index.d.ts.map +0 -1
- package/components/ProgressSpinner/index.js +0 -2
- package/components/RadioButton/RadioButton.d.ts +0 -15
- package/components/RadioButton/RadioButton.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.jsx +0 -31
- package/components/RadioButton/RadioButton.stories.d.ts +0 -15
- package/components/RadioButton/RadioButton.stories.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.stories.jsx +0 -92
- package/components/RadioButton/RadioButton.test.d.ts +0 -3
- package/components/RadioButton/RadioButton.test.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.test.jsx +0 -62
- package/components/RadioButton/index.d.ts +0 -3
- package/components/RadioButton/index.d.ts.map +0 -1
- package/components/RadioButton/index.js +0 -2
- package/components/Skeleton/Skeleton.d.ts +0 -17
- package/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.jsx +0 -52
- package/components/Skeleton/Skeleton.stories.d.ts +0 -67
- package/components/Skeleton/Skeleton.stories.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.stories.jsx +0 -184
- package/components/Skeleton/Skeleton.test.d.ts +0 -3
- package/components/Skeleton/Skeleton.test.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.test.jsx +0 -62
- package/components/Skeleton/index.d.ts +0 -2
- package/components/Skeleton/index.d.ts.map +0 -1
- package/components/Skeleton/index.js +0 -1
- package/components/TextSwatch/TextSwatch.d.ts +0 -18
- package/components/TextSwatch/TextSwatch.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.jsx +0 -56
- package/components/TextSwatch/TextSwatch.stories.d.ts +0 -21
- package/components/TextSwatch/TextSwatch.stories.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.stories.jsx +0 -211
- package/components/TextSwatch/TextSwatch.test.d.ts +0 -3
- package/components/TextSwatch/TextSwatch.test.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.test.jsx +0 -85
- package/components/TextSwatch/index.d.ts +0 -3
- package/components/TextSwatch/index.d.ts.map +0 -1
- package/components/TextSwatch/index.js +0 -2
- package/components/UIProvider/UIProvider.d.ts +0 -18
- package/components/UIProvider/UIProvider.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.jsx +0 -26
- package/components/UIProvider/UIProvider.test.d.ts +0 -2
- package/components/UIProvider/UIProvider.test.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.test.jsx +0 -9
- package/components/UIProvider/index.d.ts +0 -2
- package/components/UIProvider/index.d.ts.map +0 -1
- package/components/UIProvider/index.js +0 -1
- package/components/index.d.ts +0 -34
- package/components/index.d.ts.map +0 -1
- package/components/index.js +0 -33
- package/docs/Design/designBlocks.d.ts +0 -21
- package/docs/Design/designBlocks.d.ts.map +0 -1
- package/docs/Design/designBlocks.jsx +0 -59
- package/docs/Design/getTokenData.d.ts +0 -7
- package/docs/Design/getTokenData.d.ts.map +0 -1
- package/docs/Design/getTokenData.js +0 -18
- package/docs/Design/getTokenData.test.d.ts +0 -2
- package/docs/Design/getTokenData.test.d.ts.map +0 -1
- package/docs/Design/getTokenData.test.js +0 -92
- package/i18n/en_US.json +0 -112
- package/i18n/index.d.ts +0 -341
- package/i18n/index.d.ts.map +0 -1
- package/i18n/index.js +0 -12
- package/i18n/index.test.d.ts +0 -2
- package/i18n/index.test.d.ts.map +0 -1
- package/i18n/index.test.js +0 -11
- package/icons/index.d.ts +0 -35
- package/icons/index.d.ts.map +0 -1
- package/icons/index.js +0 -34
- package/lib/classes.d.ts +0 -5
- package/lib/classes.d.ts.map +0 -1
- package/lib/classes.js +0 -16
- package/lib/classes.test.d.ts +0 -2
- package/lib/classes.test.d.ts.map +0 -1
- package/lib/classes.test.js +0 -18
- package/lib/config.d.ts +0 -7
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -12
- package/lib/config.test.d.ts +0 -2
- package/lib/config.test.d.ts.map +0 -1
- package/lib/config.test.js +0 -12
- package/lib/debounce.d.ts +0 -2
- package/lib/debounce.d.ts.map +0 -1
- package/lib/debounce.js +0 -7
- package/lib/debounce.test.d.ts +0 -2
- package/lib/debounce.test.d.ts.map +0 -1
- package/lib/debounce.test.js +0 -40
- package/lib/deepmerge.d.ts +0 -2
- package/lib/deepmerge.d.ts.map +0 -1
- package/lib/deepmerge.js +0 -1
- package/lib/form-values.d.ts +0 -5
- package/lib/form-values.d.ts.map +0 -1
- package/lib/form-values.js +0 -17
- package/lib/form-values.test.d.ts +0 -2
- package/lib/form-values.test.d.ts.map +0 -1
- package/lib/form-values.test.jsx +0 -29
- package/lib/i18n.d.ts +0 -8
- package/lib/i18n.d.ts.map +0 -1
- package/lib/i18n.js +0 -9
- package/lib/i18n.test.d.ts +0 -2
- package/lib/i18n.test.d.ts.map +0 -1
- package/lib/i18n.test.jsx +0 -8
- package/lib/image-params-keymap.d.ts +0 -4
- package/lib/image-params-keymap.d.ts.map +0 -1
- package/lib/image-params-keymap.js +0 -19
- package/lib/image-params-keymap.test.d.ts +0 -2
- package/lib/image-params-keymap.test.d.ts.map +0 -1
- package/lib/image-params-keymap.test.js +0 -7
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/initializer.d.ts +0 -78
- package/lib/initializer.d.ts.map +0 -1
- package/lib/initializer.js +0 -93
- package/lib/initializer.test.d.ts +0 -2
- package/lib/initializer.test.d.ts.map +0 -1
- package/lib/initializer.test.js +0 -64
- package/lib/render.d.ts +0 -10
- package/lib/render.d.ts.map +0 -1
- package/lib/render.jsx +0 -34
- package/lib/render.test.d.ts +0 -2
- package/lib/render.test.d.ts.map +0 -1
- package/lib/render.test.jsx +0 -70
- package/lib/resolve-image.d.ts +0 -10
- package/lib/resolve-image.d.ts.map +0 -1
- package/lib/resolve-image.js +0 -57
- package/lib/resolve-image.test.d.ts +0 -2
- package/lib/resolve-image.test.d.ts.map +0 -1
- package/lib/resolve-image.test.jsx +0 -146
- package/lib/slot.d.ts +0 -43
- package/lib/slot.d.ts.map +0 -1
- package/lib/slot.jsx +0 -184
- package/lib/slot.test.d.ts +0 -2
- package/lib/slot.test.d.ts.map +0 -1
- package/lib/slot.test.jsx +0 -325
- package/lib/tests.d.ts +0 -4
- package/lib/tests.d.ts.map +0 -1
- package/lib/tests.jsx +0 -19
- package/lib/tests.test.d.ts +0 -2
- package/lib/tests.test.d.ts.map +0 -1
- package/lib/tests.test.jsx +0 -13
- package/lib/types.d.ts +0 -9
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -1
- package/lib/vcomponent.d.ts +0 -8
- package/lib/vcomponent.d.ts.map +0 -1
- package/lib/vcomponent.jsx +0 -27
- package/lib/vcomponent.test.d.ts +0 -2
- package/lib/vcomponent.test.d.ts.map +0 -1
- package/lib/vcomponent.test.jsx +0 -51
package/lib/slot.test.jsx
DELETED
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
import { useState } from 'preact/hooks';
|
|
2
|
-
import { Render, Slot } from '.';
|
|
3
|
-
import { render, waitFor } from '@adobe/elsie/lib/tests';
|
|
4
|
-
describe('Slot', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
jest.restoreAllMocks();
|
|
7
|
-
});
|
|
8
|
-
afterAll(() => {
|
|
9
|
-
jest.clearAllMocks();
|
|
10
|
-
jest.resetAllMocks();
|
|
11
|
-
});
|
|
12
|
-
test('should render', () => {
|
|
13
|
-
const { container } = render(<Slot name="Test">
|
|
14
|
-
<div>Default</div>
|
|
15
|
-
</Slot>);
|
|
16
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`"<div class=\\"dropin-design\\"><div data-slot=\\"Test\\"><div>Default</div></div></div>"`);
|
|
17
|
-
});
|
|
18
|
-
test('should render using "render"', () => {
|
|
19
|
-
const { container } = render(<Slot name="Test" render={() => <div>Default Render</div>}/>);
|
|
20
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`"<div class=\\"dropin-design\\"><div data-slot=\\"Test\\"><div>Default Render</div></div></div>"`);
|
|
21
|
-
});
|
|
22
|
-
test('should validate Slot has a "name"', () => {
|
|
23
|
-
const warnLog = jest.spyOn(console, 'warn').mockImplementation(() => { });
|
|
24
|
-
render(
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
<Slot>
|
|
27
|
-
<div>Default</div>
|
|
28
|
-
</Slot>);
|
|
29
|
-
expect(warnLog).toHaveBeenCalledTimes(1);
|
|
30
|
-
});
|
|
31
|
-
test('should bound Slot errors during render', async () => {
|
|
32
|
-
const errorLog = jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
33
|
-
const { container, findByText } = render(<div>
|
|
34
|
-
<Slot name="Test1" slot={function Test1() {
|
|
35
|
-
throw new Error('Error');
|
|
36
|
-
}}>
|
|
37
|
-
<div>Slot "Test1"</div>
|
|
38
|
-
</Slot>
|
|
39
|
-
<Slot name="Test2" slot={function Test2(next) {
|
|
40
|
-
const elem = document.createElement('div');
|
|
41
|
-
elem.innerHTML = 'Slot "Test2 Appended"';
|
|
42
|
-
next.appendChild(elem);
|
|
43
|
-
}}>
|
|
44
|
-
<div>Slot "Test2"</div>
|
|
45
|
-
</Slot>
|
|
46
|
-
</div>);
|
|
47
|
-
// await for Slot2 to be appended
|
|
48
|
-
await findByText('Slot "Test2 Appended"');
|
|
49
|
-
expect(errorLog).toHaveBeenCalledTimes(1);
|
|
50
|
-
expect(errorLog.mock.calls[0][0]).toMatchInlineSnapshot(`"Error in \\"Test1\\" Slot callback"`);
|
|
51
|
-
// expect elem to be appended to Slot2
|
|
52
|
-
expect(container.firstElementChild?.innerHTML).toMatchInlineSnapshot(`"<div><div data-slot=\\"Test1\\"><div>Slot \\"Test1\\"</div></div><div data-slot=\\"Test2\\"><div>Slot \\"Test2\\"</div><div data-slot-html-element=\\"div\\"><div>Slot \\"Test2 Appended\\"</div></div></div></div>"`);
|
|
53
|
-
});
|
|
54
|
-
test('should include context', async () => {
|
|
55
|
-
const provider = new Render(<div />);
|
|
56
|
-
const customMethod1 = jest.fn();
|
|
57
|
-
const customMethod2 = jest.fn();
|
|
58
|
-
const MyContainer = (props) => (<Slot name="Test" slot={props.slots.Test} context={{
|
|
59
|
-
foo: 'bar',
|
|
60
|
-
customMethod1,
|
|
61
|
-
customMethod2,
|
|
62
|
-
}}/>);
|
|
63
|
-
await provider.render(MyContainer, {
|
|
64
|
-
slots: {
|
|
65
|
-
Test: (ctx) => {
|
|
66
|
-
ctx.customMethod1(ctx);
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
})(document.body);
|
|
70
|
-
await waitFor(() => {
|
|
71
|
-
expect(customMethod1).toHaveBeenCalledTimes(1);
|
|
72
|
-
expect(customMethod2).toHaveBeenCalledTimes(0);
|
|
73
|
-
});
|
|
74
|
-
expect(document.body.innerHTML).toMatchInlineSnapshot(`"<div><div data-slot=\\"Test\\"></div></div>"`);
|
|
75
|
-
});
|
|
76
|
-
test('should re-render on Slot Method state change', async () => {
|
|
77
|
-
const mockValueFn = jest.fn();
|
|
78
|
-
render(<Slot name="Test" slot={(ctx) => {
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
ctx.doSomething((_, state) => {
|
|
81
|
-
state.set('loading', true);
|
|
82
|
-
return state.get('loading') ? 'loading' : 'default';
|
|
83
|
-
});
|
|
84
|
-
}} context={{
|
|
85
|
-
doSomething(callback) {
|
|
86
|
-
this._registerMethod((...attrs) => {
|
|
87
|
-
mockValueFn(callback(...attrs));
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
}}/>);
|
|
91
|
-
await waitFor(() => {
|
|
92
|
-
expect(mockValueFn).toBeCalledTimes(2);
|
|
93
|
-
expect(mockValueFn.mock.calls).toMatchInlineSnapshot(`
|
|
94
|
-
Array [
|
|
95
|
-
Array [
|
|
96
|
-
"default",
|
|
97
|
-
],
|
|
98
|
-
Array [
|
|
99
|
-
"loading",
|
|
100
|
-
],
|
|
101
|
-
]
|
|
102
|
-
`);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
test('should include API', async () => {
|
|
106
|
-
render(<Slot name="Test" slot={(ctx) => {
|
|
107
|
-
expect(Object.keys(ctx)).toEqual([
|
|
108
|
-
'dictionary',
|
|
109
|
-
'_setProps',
|
|
110
|
-
'_registerMethod',
|
|
111
|
-
'_htmlElementToVNode',
|
|
112
|
-
'getSlotElement',
|
|
113
|
-
'onChange',
|
|
114
|
-
'replaceWith',
|
|
115
|
-
'appendChild',
|
|
116
|
-
'prependChild',
|
|
117
|
-
'appendSibling',
|
|
118
|
-
'prependSibling',
|
|
119
|
-
]);
|
|
120
|
-
}}/>);
|
|
121
|
-
});
|
|
122
|
-
test('_registerMethod should validate callback is a function', async () => {
|
|
123
|
-
const warnLog = jest.spyOn(console, 'warn').mockImplementation(() => { });
|
|
124
|
-
render(<Slot name="Test" slot={(ctx) => {
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
ctx.doSomething();
|
|
127
|
-
}} context={{
|
|
128
|
-
doSomething() {
|
|
129
|
-
this._registerMethod('fail');
|
|
130
|
-
},
|
|
131
|
-
}}/>);
|
|
132
|
-
expect(warnLog).toBeCalledTimes(1);
|
|
133
|
-
});
|
|
134
|
-
test('_htmlElementToVNode should append an HTML Element in the Virtual Tree', async () => {
|
|
135
|
-
const elem = document.createElement('button');
|
|
136
|
-
elem.textContent = 'Button';
|
|
137
|
-
const { container, findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
138
|
-
// @ts-ignore
|
|
139
|
-
ctx.doSomething(() => { });
|
|
140
|
-
}} context={{
|
|
141
|
-
doSomething(callback) {
|
|
142
|
-
this._registerMethod((...attrs) => {
|
|
143
|
-
callback(...attrs);
|
|
144
|
-
const children = this._htmlElementToVNode(elem);
|
|
145
|
-
this._setProps({ children });
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
}}/>);
|
|
149
|
-
// await for element to be appended to the Slot
|
|
150
|
-
await findByText('Button');
|
|
151
|
-
const slot = container.querySelector('[data-slot]');
|
|
152
|
-
expect(slot?.outerHTML).toMatchInlineSnapshot(`"<div data-slot=\\"Test\\"><div data-slot-html-element=\\"button\\"><button>Button</button></div></div>"`);
|
|
153
|
-
});
|
|
154
|
-
test('getSlotElement should validate element', async () => {
|
|
155
|
-
const { container } = render(<Slot name="Test" slot={(ctx) => {
|
|
156
|
-
ctx.getSlotElement('invalid');
|
|
157
|
-
}}/>);
|
|
158
|
-
const slot = container.querySelector('[data-slot-key]');
|
|
159
|
-
expect(slot?.outerHTML).toMatchInlineSnapshot(`undefined`);
|
|
160
|
-
});
|
|
161
|
-
test('getSlotElement should append child', async () => {
|
|
162
|
-
const { container } = render(<Slot name="Test" slot={(ctx) => {
|
|
163
|
-
const foo = ctx.getSlotElement('foo');
|
|
164
|
-
const elem1 = document.createElement('span');
|
|
165
|
-
elem1.innerHTML = 'Foo';
|
|
166
|
-
foo.appendChild(elem1);
|
|
167
|
-
}}>
|
|
168
|
-
<div data-slot-key="foo">
|
|
169
|
-
<span>foo-original</span>
|
|
170
|
-
</div>
|
|
171
|
-
</Slot>);
|
|
172
|
-
const slot = container.querySelector('[data-slot-key]');
|
|
173
|
-
expect(slot?.outerHTML).toMatchInlineSnapshot(`"<div data-slot-key=\\"foo\\"><span>foo-original</span><span>Foo</span></div>"`);
|
|
174
|
-
});
|
|
175
|
-
test('getSlotElement should prepend child', async () => {
|
|
176
|
-
const { container } = render(<Slot name="Test" slot={(ctx) => {
|
|
177
|
-
const foo = ctx.getSlotElement('foo');
|
|
178
|
-
const elem1 = document.createElement('span');
|
|
179
|
-
elem1.innerHTML = 'Foo';
|
|
180
|
-
foo.prependChild(elem1);
|
|
181
|
-
}}>
|
|
182
|
-
<div data-slot-key="foo">
|
|
183
|
-
<span>foo-original</span>
|
|
184
|
-
</div>
|
|
185
|
-
</Slot>);
|
|
186
|
-
const slot = container.querySelector('[data-slot-key]');
|
|
187
|
-
expect(slot?.outerHTML).toMatchInlineSnapshot(`"<div data-slot-key=\\"foo\\"><span>Foo</span><span>foo-original</span></div>"`);
|
|
188
|
-
});
|
|
189
|
-
test('getSlotElement should append sibbling', async () => {
|
|
190
|
-
const { container } = render(<Slot name="Test" slot={(ctx) => {
|
|
191
|
-
const foo = ctx.getSlotElement('foo');
|
|
192
|
-
const elem1 = document.createElement('span');
|
|
193
|
-
elem1.innerHTML = 'Foo';
|
|
194
|
-
foo.appendSibling(elem1);
|
|
195
|
-
}}>
|
|
196
|
-
<div data-slot-key="foo">
|
|
197
|
-
<span>foo-original</span>
|
|
198
|
-
</div>
|
|
199
|
-
</Slot>);
|
|
200
|
-
const slot = container.querySelector('[data-slot-key]');
|
|
201
|
-
expect(slot?.parentElement?.outerHTML).toMatchInlineSnapshot(`"<div data-slot=\\"Test\\"><div data-slot-key=\\"foo\\"><span>foo-original</span></div><span>Foo</span></div>"`);
|
|
202
|
-
});
|
|
203
|
-
test('getSlotElement should prepend sibbling', async () => {
|
|
204
|
-
const { container } = render(<Slot name="Test" slot={(ctx) => {
|
|
205
|
-
const foo = ctx.getSlotElement('foo');
|
|
206
|
-
const elem1 = document.createElement('span');
|
|
207
|
-
elem1.innerHTML = 'Foo';
|
|
208
|
-
foo.prependSibling(elem1);
|
|
209
|
-
}}>
|
|
210
|
-
<div data-slot-key="foo">
|
|
211
|
-
<span>foo-original</span>
|
|
212
|
-
</div>
|
|
213
|
-
</Slot>);
|
|
214
|
-
const slot = container.querySelector('[data-slot-key]');
|
|
215
|
-
expect(slot?.parentElement?.outerHTML).toMatchInlineSnapshot(`"<div data-slot=\\"Test\\"><span>Foo</span><div data-slot-key=\\"foo\\"><span>foo-original</span></div></div>"`);
|
|
216
|
-
});
|
|
217
|
-
test('should listen to render changes', async () => {
|
|
218
|
-
const Component = () => {
|
|
219
|
-
const [data, setData] = useState('Initial');
|
|
220
|
-
return (<Slot name="Test" slot={(ctx) => {
|
|
221
|
-
const elem = document.createElement('span');
|
|
222
|
-
elem.innerHTML = ctx.data;
|
|
223
|
-
ctx.appendChild(elem);
|
|
224
|
-
ctx.onChange((next) => {
|
|
225
|
-
elem.innerHTML = next.data;
|
|
226
|
-
});
|
|
227
|
-
setData('Updated');
|
|
228
|
-
}} context={{ data }}/>);
|
|
229
|
-
};
|
|
230
|
-
const { findByText } = render(<Component />);
|
|
231
|
-
const slot = await findByText('Updated');
|
|
232
|
-
expect(slot).toBeTruthy();
|
|
233
|
-
});
|
|
234
|
-
test('should replaceWith', async () => {
|
|
235
|
-
const { findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
236
|
-
const elem = document.createElement('span');
|
|
237
|
-
elem.innerHTML = 'Foo';
|
|
238
|
-
ctx.replaceWith(elem);
|
|
239
|
-
}}>
|
|
240
|
-
<div>Original</div>
|
|
241
|
-
</Slot>);
|
|
242
|
-
const slot = await findByText('Foo');
|
|
243
|
-
expect(slot?.parentElement?.parentElement?.innerHTML).toMatchInlineSnapshot(`"<div data-slot-html-element=\\"span\\"><span>Foo</span></div>"`);
|
|
244
|
-
});
|
|
245
|
-
test('should appendChild', async () => {
|
|
246
|
-
const { findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
247
|
-
const elem = document.createElement('span');
|
|
248
|
-
elem.innerHTML = 'Foo';
|
|
249
|
-
ctx.appendChild(elem);
|
|
250
|
-
}}>
|
|
251
|
-
<div>Original</div>
|
|
252
|
-
</Slot>);
|
|
253
|
-
const slot = await findByText('Foo');
|
|
254
|
-
expect(slot?.parentElement?.parentElement?.innerHTML).toMatchInlineSnapshot(`"<div>Original</div><div data-slot-html-element=\\"span\\"><span>Foo</span></div>"`);
|
|
255
|
-
});
|
|
256
|
-
test('should prependChild', async () => {
|
|
257
|
-
const { findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
258
|
-
const elem = document.createElement('span');
|
|
259
|
-
elem.innerHTML = 'Foo';
|
|
260
|
-
ctx.prependChild(elem);
|
|
261
|
-
}}>
|
|
262
|
-
<div>Original</div>
|
|
263
|
-
</Slot>);
|
|
264
|
-
const slot = await findByText('Foo');
|
|
265
|
-
expect(slot?.parentElement?.parentElement?.innerHTML).toMatchInlineSnapshot(`"<div data-slot-html-element=\\"span\\"><span>Foo</span></div><div>Original</div>"`);
|
|
266
|
-
});
|
|
267
|
-
test('should appendSibling', async () => {
|
|
268
|
-
const { findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
269
|
-
const elem = document.createElement('span');
|
|
270
|
-
elem.innerHTML = 'Foo';
|
|
271
|
-
ctx.appendSibling(elem);
|
|
272
|
-
}}>
|
|
273
|
-
<div>Original</div>
|
|
274
|
-
</Slot>);
|
|
275
|
-
const slot = await findByText('Foo');
|
|
276
|
-
expect(slot?.parentElement?.innerHTML).toMatchInlineSnapshot(`"<div data-slot=\\"Test\\"><div>Original</div></div><span>Foo</span>"`);
|
|
277
|
-
});
|
|
278
|
-
test('should prependSibling', async () => {
|
|
279
|
-
const { findByText } = render(<Slot name="Test" slot={(ctx) => {
|
|
280
|
-
const elem = document.createElement('span');
|
|
281
|
-
elem.innerHTML = 'Foo';
|
|
282
|
-
ctx.prependSibling(elem);
|
|
283
|
-
}}>
|
|
284
|
-
<div>Original</div>
|
|
285
|
-
</Slot>);
|
|
286
|
-
const slot = await findByText('Foo');
|
|
287
|
-
expect(slot?.parentElement?.innerHTML).toMatchInlineSnapshot(`"<span>Foo</span><div data-slot=\\"Test\\"><div>Original</div></div>"`);
|
|
288
|
-
});
|
|
289
|
-
test('should toggle debugging tools', async () => {
|
|
290
|
-
// @ts-ignore
|
|
291
|
-
window.DROPINS.showSlots(true);
|
|
292
|
-
expect(sessionStorage.getItem('dropin-debugger--show-slots')).toEqual('true');
|
|
293
|
-
expect(document.body.classList.contains('dropin-debugger--show-slots')).toBe(true);
|
|
294
|
-
// @ts-ignore
|
|
295
|
-
window.DROPINS.showSlots(false);
|
|
296
|
-
expect(sessionStorage.getItem('dropin-debugger--show-slots')).toEqual('false');
|
|
297
|
-
expect(document.body.classList.contains('dropin-debugger--show-slots')).toBe(false);
|
|
298
|
-
});
|
|
299
|
-
test('should persist debugging tools', async () => {
|
|
300
|
-
// @ts-ignore
|
|
301
|
-
const mockShowSlots = jest.spyOn(window.DROPINS, 'showSlots');
|
|
302
|
-
expect(mockShowSlots).toHaveBeenCalledTimes(0);
|
|
303
|
-
});
|
|
304
|
-
test('should re-render when context changes', async () => {
|
|
305
|
-
const mockFn = jest.fn();
|
|
306
|
-
const Component = () => {
|
|
307
|
-
const [data, setData] = useState(false);
|
|
308
|
-
return (<Slot name="Test" context={{ data }} slot={(ctx) => {
|
|
309
|
-
expect(ctx.data).toEqual(false);
|
|
310
|
-
ctx.onChange((next) => {
|
|
311
|
-
mockFn(next.data);
|
|
312
|
-
});
|
|
313
|
-
setData(true);
|
|
314
|
-
}}>
|
|
315
|
-
<div>Original</div>
|
|
316
|
-
</Slot>);
|
|
317
|
-
};
|
|
318
|
-
render(<Component />);
|
|
319
|
-
await waitFor(() => {
|
|
320
|
-
expect(mockFn).toHaveBeenCalledTimes(2);
|
|
321
|
-
expect(mockFn.mock.calls[0][0]).toEqual(false);
|
|
322
|
-
expect(mockFn.mock.calls[1][0]).toEqual(true);
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
});
|
package/lib/tests.d.ts
DELETED
package/lib/tests.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../src/lib/tests.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,YAAY,EACb,MAAM,yBAAyB,CAAC;AAMjC,cAAc,yBAAyB,CAAC;AAexC,eAAO,MAAM,MAAM,OACb,GAAG,YACG,KAAK,aAAa,EAAE,SAAS,CAAC,KACvC,YAOF,CAAC"}
|
package/lib/tests.jsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { render as originalRender, } from '@testing-library/preact';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { UIProvider } from '@adobe/elsie/components';
|
|
5
|
-
export * from '@testing-library/preact';
|
|
6
|
-
const directoryPath = path.relative(process.cwd(), 'src/i18n/'); // path to the JSON files (relative to this file
|
|
7
|
-
const files = fs.readdirSync(directoryPath); // get a list of all files in the directory
|
|
8
|
-
const jsonFiles = files.filter((file) => path.extname(file) === '.json'); // filter out only the JSON files
|
|
9
|
-
const langDefinitions = jsonFiles.reduce((acc, file) => {
|
|
10
|
-
const filePath = path.join(directoryPath, file); // get the full path to the file
|
|
11
|
-
const rawData = fs.readFileSync(filePath); // read the file synchronously
|
|
12
|
-
const parsedData = JSON.parse(rawData); // parse the JSON data and return it
|
|
13
|
-
return { ...acc, [file.replace('.json', '')]: parsedData };
|
|
14
|
-
}, {});
|
|
15
|
-
export const render = (ui, options) => {
|
|
16
|
-
return originalRender(<UIProvider lang={'en_US'} langDefinitions={langDefinitions}>
|
|
17
|
-
{ui}
|
|
18
|
-
</UIProvider>, options);
|
|
19
|
-
};
|
package/lib/tests.test.d.ts
DELETED
package/lib/tests.test.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.test.d.ts","sourceRoot":"","sources":["../../src/lib/tests.test.tsx"],"names":[],"mappings":""}
|
package/lib/tests.test.jsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
2
|
-
import { UIProvider } from '@adobe/elsie/components';
|
|
3
|
-
describe('src/lib/tests', () => {
|
|
4
|
-
test('renders the UIProvider with langDefinitions', () => {
|
|
5
|
-
const { container } = render(<UIProvider lang={'en_US'} langDefinitions={{
|
|
6
|
-
en_US: {
|
|
7
|
-
test: 'test',
|
|
8
|
-
},
|
|
9
|
-
}}/>);
|
|
10
|
-
const elem = container.querySelector('.dropin-design');
|
|
11
|
-
expect(!!elem).toEqual(true);
|
|
12
|
-
});
|
|
13
|
-
});
|
package/lib/types.d.ts
DELETED
package/lib/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,IAAI,iBAAiB,CACtE,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,CAAC,CAAA;CAAE,CACxB,GAAG;IACF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC"}
|
package/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/vcomponent.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { VNode, ComponentChildren } from 'preact';
|
|
2
|
-
export type VComponentProps = {
|
|
3
|
-
node: VNode | VNode[];
|
|
4
|
-
children?: ComponentChildren;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
export declare function VComponent({ node, ...props }: VComponentProps): import("preact").JSX.Element | null;
|
|
8
|
-
//# sourceMappingURL=vcomponent.d.ts.map
|
package/lib/vcomponent.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vcomponent.d.ts","sourceRoot":"","sources":["../../src/lib/vcomponent.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGlD,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,uCAuB7D"}
|
package/lib/vcomponent.jsx
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
ADOBE CONFIDENTIAL
|
|
3
|
-
Copyright 2023 Adobe
|
|
4
|
-
All Rights Reserved.
|
|
5
|
-
NOTICE: All information contained herein is, and remains
|
|
6
|
-
the property of Adobe and its suppliers, if any. The intellectual
|
|
7
|
-
and technical concepts contained herein are proprietary to Adobe
|
|
8
|
-
and its suppliers and are protected by all applicable intellectual
|
|
9
|
-
property laws, including trade secret and copyright laws.
|
|
10
|
-
Dissemination of this information or reproduction of this material
|
|
11
|
-
is strictly forbidden unless prior written permission is obtained
|
|
12
|
-
from Adobe.
|
|
13
|
-
*/
|
|
14
|
-
import { classes } from '.';
|
|
15
|
-
export function VComponent({ node, ...props }) {
|
|
16
|
-
if (!node)
|
|
17
|
-
return null;
|
|
18
|
-
if (Array.isArray(node)) {
|
|
19
|
-
return (<>
|
|
20
|
-
{node.map((n, key) => (<VComponent key={key} node={n} className={props.className} {...props}/>))}
|
|
21
|
-
</>);
|
|
22
|
-
}
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
props.className = classes([node.props.className, props.className]);
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
return <node.type ref={node.ref} key={node.key} {...node.props} {...props}/>;
|
|
27
|
-
}
|
package/lib/vcomponent.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vcomponent.test.d.ts","sourceRoot":"","sources":["../../src/lib/vcomponent.test.tsx"],"names":[],"mappings":""}
|
package/lib/vcomponent.test.jsx
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
2
|
-
import { VComponent } from '.';
|
|
3
|
-
describe('VComponent', () => {
|
|
4
|
-
test('renders empty div if node is empty', () => {
|
|
5
|
-
const { container } = render(
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
<VComponent node={null}/>);
|
|
8
|
-
expect(container).toMatchInlineSnapshot(`
|
|
9
|
-
<div>
|
|
10
|
-
<div
|
|
11
|
-
class="dropin-design"
|
|
12
|
-
/>
|
|
13
|
-
</div>
|
|
14
|
-
`);
|
|
15
|
-
});
|
|
16
|
-
test('render with type string component', () => {
|
|
17
|
-
const { container } = render(<VComponent node={<div className="vcomp-string"/>} className="vcomp-component">
|
|
18
|
-
<div className="vcomp-string-child"/>
|
|
19
|
-
</VComponent>);
|
|
20
|
-
const elem = container.querySelector('.vcomp-string.vcomp-component');
|
|
21
|
-
const child = container.querySelector('.vcomp-string-child');
|
|
22
|
-
expect(!!elem && !!child).toEqual(true);
|
|
23
|
-
});
|
|
24
|
-
test('render function component', () => {
|
|
25
|
-
const TestComponent = ({ children, }) => <span className="vcomp-function">{children}</span>;
|
|
26
|
-
const { container } = render(<VComponent node={<TestComponent />}>
|
|
27
|
-
<div className="vcomp-function-child"/>
|
|
28
|
-
</VComponent>);
|
|
29
|
-
const elem = container.querySelector('.vcomp-function');
|
|
30
|
-
const child = container.querySelector('.vcomp-function-child');
|
|
31
|
-
expect(!!elem && !!child).toEqual(true);
|
|
32
|
-
});
|
|
33
|
-
test('render array of elements', () => {
|
|
34
|
-
const TestComponent = ({ children, }) => <span className="vcomp-function-array">{children}</span>;
|
|
35
|
-
const elements = [
|
|
36
|
-
<TestComponent key={1}/>,
|
|
37
|
-
<div className="vcomp-string-array" key={2}/>,
|
|
38
|
-
];
|
|
39
|
-
const { container } = render(<VComponent node={elements}/>);
|
|
40
|
-
const elem1 = container.querySelector('.vcomp-function-array');
|
|
41
|
-
const elem2 = container.querySelector('.vcomp-string-array');
|
|
42
|
-
expect(!!elem1 && !!elem2).toEqual(true);
|
|
43
|
-
});
|
|
44
|
-
test('render children from prop', () => {
|
|
45
|
-
const TestComponent = ({ children, }) => <span className="vcomp-parent">{children}</span>;
|
|
46
|
-
const { container } = render(<VComponent node={<TestComponent children={<div className="vcomp-child"/>}/>}/>);
|
|
47
|
-
const parent = container.querySelector('.vcomp-parent');
|
|
48
|
-
const child = container.querySelector('.vcomp-child');
|
|
49
|
-
expect(!!parent && !!child).toEqual(true);
|
|
50
|
-
});
|
|
51
|
-
});
|