newspack-components 4.2.0 → 4.4.0-epic-editor-refactor.1
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/CHANGELOG.md +11 -0
- package/DEVELOPMENT.md +868 -0
- package/copy-styles.js +3 -2
- package/dist/cjs/accordion/index.js +17 -12
- package/dist/cjs/action-card/index.js +186 -140
- package/dist/cjs/action-card/style.scss +25 -2
- package/dist/cjs/autocomplete-tokenfield/index.js +254 -234
- package/dist/cjs/autocomplete-with-latest-posts/index.js +351 -0
- package/dist/cjs/autocomplete-with-latest-posts/style.scss +150 -0
- package/dist/cjs/autocomplete-with-suggestions/index.js +229 -126
- package/dist/cjs/badge/index.js +32 -0
- package/dist/cjs/badge/style.scss +36 -0
- package/dist/cjs/box-contrast/index.js +19 -15
- package/dist/cjs/button/index.js +41 -24
- package/dist/cjs/button-props/button-props.js +5 -5
- package/dist/cjs/button-props/index.js +2 -2
- package/dist/cjs/card/core-card.js +199 -0
- package/dist/cjs/card/index.js +75 -35
- package/dist/cjs/card/style-core.scss +295 -0
- package/dist/cjs/card/style.scss +4 -4
- package/dist/cjs/card-feature/index.js +141 -0
- package/dist/cjs/card-feature/style.scss +75 -0
- package/dist/cjs/card-form/index.js +144 -0
- package/dist/cjs/card-form/style.scss +20 -0
- package/dist/cjs/card-settings-group/index.js +69 -0
- package/dist/cjs/card-settings-group/style.scss +33 -0
- package/dist/cjs/card-sortable-list/index.js +426 -0
- package/dist/cjs/card-sortable-list/style.scss +48 -0
- package/dist/cjs/category-autocomplete/index.js +175 -155
- package/dist/cjs/color-picker/index.js +41 -23
- package/dist/cjs/color-picker/index.test.js +82 -0
- package/dist/cjs/color-picker/style.scss +11 -13
- package/dist/cjs/confirm-dialog/index.js +123 -0
- package/dist/cjs/consts.js +1 -1
- package/dist/cjs/custom-select-control/index.js +39 -28
- package/dist/cjs/dataviews/index.js +38 -0
- package/dist/cjs/dataviews/style.scss +9 -0
- package/dist/cjs/divider/index.js +47 -0
- package/dist/cjs/divider/style.scss +51 -0
- package/dist/cjs/footer/index.js +36 -30
- package/dist/cjs/form-token-field/index.js +51 -40
- package/dist/cjs/form-token-field/style.scss +0 -5
- package/dist/cjs/global-notices/index.js +5 -5
- package/dist/cjs/grid/index.js +25 -18
- package/dist/cjs/grid/style.scss +67 -8
- package/dist/cjs/handoff/index.js +204 -156
- package/dist/cjs/handoff-message/index.js +12 -7
- package/dist/cjs/hooks/index.js +10 -8
- package/dist/cjs/hooks/use-confirm-dialog.js +79 -0
- package/dist/cjs/hooks/use-unsaved-changes-dialog.js +144 -0
- package/dist/cjs/hooks/useObjectState.js +21 -12
- package/dist/cjs/hooks/useObjectState.test.js +55 -33
- package/dist/cjs/hooks/useOnClickOutside.js +6 -6
- package/dist/cjs/hooks/usePrompt.js +10 -13
- package/dist/cjs/image-upload/index.js +114 -123
- package/dist/cjs/image-upload/index.test.js +11 -13
- package/dist/cjs/image-upload/style.scss +12 -40
- package/dist/cjs/index.js +166 -92
- package/dist/cjs/info-button/index.js +43 -32
- package/dist/cjs/integration-icons/active-campaign.js +22 -0
- package/dist/cjs/integration-icons/constant-contact.js +28 -0
- package/dist/cjs/integration-icons/fundraise-up.js +25 -0
- package/dist/cjs/integration-icons/index.js +48 -0
- package/dist/cjs/integration-icons/mailchimp.js +19 -0
- package/dist/cjs/integration-icons/salesforce.js +17 -0
- package/dist/cjs/integration-icons/wisepops.js +20 -0
- package/dist/cjs/modal/index.js +29 -19
- package/dist/cjs/modal/style.scss +47 -13
- package/dist/cjs/newspack-icon/index.js +45 -38
- package/dist/cjs/newspack-icon/style.scss +5 -3
- package/dist/cjs/notice/index.js +64 -55
- package/dist/cjs/plugin-installer/index.js +259 -253
- package/dist/cjs/plugin-settings/SettingsSection.js +66 -60
- package/dist/cjs/plugin-settings/index.js +217 -200
- package/dist/cjs/plugin-toggle/index.js +192 -199
- package/dist/cjs/popover/index.js +41 -28
- package/dist/cjs/position-control/index.js +24 -23
- package/dist/cjs/progress-bar/index.js +71 -59
- package/dist/cjs/progress-bar/index.test.js +62 -68
- package/dist/cjs/proxied-imports/router.js +3 -3
- package/dist/cjs/radio-control/index.js +40 -27
- package/dist/cjs/section-header/index.js +143 -39
- package/dist/cjs/section-header/style.scss +129 -4
- package/dist/cjs/select-control/ButtonGroupControl.js +26 -21
- package/dist/cjs/select-control/GroupedSelectControl.js +41 -35
- package/dist/cjs/select-control/index.js +52 -40
- package/dist/cjs/settings/MinMaxSetting.js +30 -20
- package/dist/cjs/settings/SettingsCard.js +20 -17
- package/dist/cjs/settings/SettingsSection.js +22 -21
- package/dist/cjs/settings/index.js +5 -5
- package/dist/cjs/sortable-newsletter-list-control/index.js +78 -57
- package/dist/cjs/steps-list/index.js +44 -34
- package/dist/cjs/steps-list-item/index.js +47 -39
- package/dist/cjs/style-card/index.js +70 -63
- package/dist/cjs/style.scss +2 -0
- package/dist/cjs/tabbed-navigation/index.js +38 -36
- package/dist/cjs/text-control/index.js +27 -25
- package/dist/cjs/utils/color.js +4 -4
- package/dist/cjs/utils/editor-toolbar-back-button.js +61 -0
- package/dist/cjs/utils/index.js +31 -19
- package/dist/cjs/utils/style.scss +8 -0
- package/dist/cjs/waiting/index.js +48 -35
- package/dist/cjs/waiting/style.scss +4 -0
- package/dist/cjs/web-preview/index.js +219 -154
- package/dist/cjs/web-preview/style.scss +20 -53
- package/dist/cjs/with-wizard/index.js +362 -364
- package/dist/cjs/with-wizard/style.scss +28 -60
- package/dist/cjs/with-wizard-screen/index.js +54 -58
- package/dist/cjs/with-wizard-screen/style.scss +77 -10
- package/dist/cjs/wizard/components/WizardError.js +20 -18
- package/dist/cjs/wizard/components/WizardSnackbar.js +73 -0
- package/dist/cjs/wizard/components/style.scss +48 -0
- package/dist/cjs/wizard/index.js +207 -64
- package/dist/cjs/wizard/store/index.js +191 -97
- package/dist/cjs/wizard/store/utils.js +13 -8
- package/dist/esm/accordion/index.js +14 -9
- package/dist/esm/action-card/index.js +178 -124
- package/dist/esm/action-card/style.scss +25 -2
- package/dist/esm/autocomplete-tokenfield/index.js +248 -222
- package/dist/esm/autocomplete-with-latest-posts/index.js +347 -0
- package/dist/esm/autocomplete-with-latest-posts/style.scss +150 -0
- package/dist/esm/autocomplete-with-suggestions/index.js +226 -119
- package/dist/esm/badge/index.js +24 -0
- package/dist/esm/badge/style.scss +36 -0
- package/dist/esm/box-contrast/index.js +15 -11
- package/dist/esm/button/index.js +39 -19
- package/dist/esm/button-props/button-props.js +1 -1
- package/dist/esm/card/core-card.js +195 -0
- package/dist/esm/card/index.js +70 -22
- package/dist/esm/card/style-core.scss +295 -0
- package/dist/esm/card/style.scss +4 -4
- package/dist/esm/card-feature/index.js +131 -0
- package/dist/esm/card-feature/style.scss +75 -0
- package/dist/esm/card-form/index.js +134 -0
- package/dist/esm/card-form/style.scss +20 -0
- package/dist/esm/card-settings-group/index.js +61 -0
- package/dist/esm/card-settings-group/style.scss +33 -0
- package/dist/esm/card-sortable-list/index.js +425 -0
- package/dist/esm/card-sortable-list/style.scss +48 -0
- package/dist/esm/category-autocomplete/index.js +168 -140
- package/dist/esm/color-picker/index.js +39 -21
- package/dist/esm/color-picker/index.test.js +78 -0
- package/dist/esm/color-picker/style.scss +11 -13
- package/dist/esm/confirm-dialog/index.js +116 -0
- package/dist/esm/consts.js +1 -1
- package/dist/esm/custom-select-control/index.js +34 -15
- package/dist/esm/dataviews/index.js +34 -0
- package/dist/esm/dataviews/style.scss +9 -0
- package/dist/esm/divider/index.js +42 -0
- package/dist/esm/divider/style.scss +51 -0
- package/dist/esm/footer/index.js +34 -28
- package/dist/esm/form-token-field/index.js +46 -27
- package/dist/esm/form-token-field/style.scss +0 -5
- package/dist/esm/global-notices/index.js +3 -3
- package/dist/esm/grid/index.js +23 -13
- package/dist/esm/grid/style.scss +67 -8
- package/dist/esm/handoff/index.js +199 -143
- package/dist/esm/handoff-message/index.js +10 -6
- package/dist/esm/hooks/index.js +8 -6
- package/dist/esm/hooks/use-confirm-dialog.js +73 -0
- package/dist/esm/hooks/use-unsaved-changes-dialog.js +136 -0
- package/dist/esm/hooks/useObjectState.js +19 -9
- package/dist/esm/hooks/useObjectState.test.js +54 -32
- package/dist/esm/hooks/useOnClickOutside.js +4 -4
- package/dist/esm/hooks/usePrompt.js +9 -11
- package/dist/esm/image-upload/index.js +110 -111
- package/dist/esm/image-upload/index.test.js +11 -13
- package/dist/esm/image-upload/style.scss +12 -40
- package/dist/esm/index.js +13 -1
- package/dist/esm/info-button/index.js +38 -19
- package/dist/esm/integration-icons/active-campaign.js +16 -0
- package/dist/esm/integration-icons/constant-contact.js +22 -0
- package/dist/esm/integration-icons/fundraise-up.js +19 -0
- package/dist/esm/integration-icons/index.js +6 -0
- package/dist/esm/integration-icons/mailchimp.js +13 -0
- package/dist/esm/integration-icons/salesforce.js +11 -0
- package/dist/esm/integration-icons/wisepops.js +14 -0
- package/dist/esm/modal/index.js +27 -13
- package/dist/esm/modal/style.scss +47 -13
- package/dist/esm/newspack-icon/index.js +40 -25
- package/dist/esm/newspack-icon/style.scss +5 -3
- package/dist/esm/notice/index.js +59 -42
- package/dist/esm/plugin-installer/index.js +255 -243
- package/dist/esm/plugin-settings/SettingsSection.js +61 -50
- package/dist/esm/plugin-settings/index.js +212 -189
- package/dist/esm/plugin-toggle/index.js +187 -190
- package/dist/esm/popover/index.js +35 -16
- package/dist/esm/position-control/index.js +22 -18
- package/dist/esm/progress-bar/index.js +66 -49
- package/dist/esm/progress-bar/index.test.js +61 -67
- package/dist/esm/radio-control/index.js +34 -15
- package/dist/esm/section-header/index.js +140 -38
- package/dist/esm/section-header/style.scss +129 -4
- package/dist/esm/select-control/ButtonGroupControl.js +23 -18
- package/dist/esm/select-control/GroupedSelectControl.js +38 -30
- package/dist/esm/select-control/index.js +47 -27
- package/dist/esm/settings/MinMaxSetting.js +27 -16
- package/dist/esm/settings/SettingsCard.js +18 -13
- package/dist/esm/settings/SettingsSection.js +20 -19
- package/dist/esm/settings/index.js +3 -3
- package/dist/esm/sortable-newsletter-list-control/index.js +74 -53
- package/dist/esm/steps-list/index.js +39 -21
- package/dist/esm/steps-list-item/index.js +42 -26
- package/dist/esm/style-card/index.js +65 -50
- package/dist/esm/style.scss +2 -0
- package/dist/esm/tabbed-navigation/index.js +35 -33
- package/dist/esm/text-control/index.js +25 -19
- package/dist/esm/utils/color.js +4 -4
- package/dist/esm/utils/editor-toolbar-back-button.js +53 -0
- package/dist/esm/utils/index.js +29 -16
- package/dist/esm/utils/style.scss +8 -0
- package/dist/esm/waiting/index.js +43 -22
- package/dist/esm/waiting/style.scss +4 -0
- package/dist/esm/web-preview/index.js +218 -147
- package/dist/esm/web-preview/style.scss +20 -53
- package/dist/esm/with-wizard/index.js +360 -358
- package/dist/esm/with-wizard/style.scss +28 -60
- package/dist/esm/with-wizard-screen/index.js +48 -46
- package/dist/esm/with-wizard-screen/style.scss +77 -10
- package/dist/esm/wizard/components/WizardError.js +18 -16
- package/dist/esm/wizard/components/WizardSnackbar.js +70 -0
- package/dist/esm/wizard/components/style.scss +48 -0
- package/dist/esm/wizard/index.js +207 -58
- package/dist/esm/wizard/store/index.js +189 -90
- package/dist/esm/wizard/store/utils.js +13 -6
- package/package.json +30 -17
- package/release.config.js +1 -0
- package/shared/author-context.js +26 -0
- package/shared/hooks/use-coauthors.js +388 -0
- package/shared/hooks/use-coauthors.test.js +850 -0
- package/shared/hooks/use-custom-byline.js +47 -0
- package/shared/hooks/use-custom-byline.test.js +133 -0
- package/shared/scss/_mixins.scss +54 -0
- package/src/accordion/index.js +8 -7
- package/src/action-card/action-card.d.ts +7 -3
- package/src/action-card/index.js +39 -12
- package/src/action-card/style.scss +25 -2
- package/src/autocomplete-tokenfield/index.js +2 -2
- package/src/autocomplete-with-latest-posts/index.js +290 -0
- package/src/autocomplete-with-latest-posts/style.scss +150 -0
- package/src/badge/index.tsx +26 -0
- package/src/badge/style.scss +36 -0
- package/src/button/index.tsx +3 -2
- package/src/card/core-card.js +224 -0
- package/src/card/index.js +40 -1
- package/src/card/style-core.scss +295 -0
- package/src/card/style.scss +4 -4
- package/src/card-feature/README.md +188 -0
- package/src/card-feature/index.tsx +186 -0
- package/src/card-feature/style.scss +75 -0
- package/src/card-form/README.md +113 -0
- package/src/card-form/index.tsx +128 -0
- package/src/card-form/style.scss +20 -0
- package/src/card-settings-group/README.md +43 -0
- package/src/card-settings-group/index.tsx +78 -0
- package/src/card-settings-group/style.scss +33 -0
- package/src/card-sortable-list/README.md +51 -0
- package/src/card-sortable-list/index.tsx +435 -0
- package/src/card-sortable-list/style.scss +48 -0
- package/src/color-picker/index.js +15 -8
- package/src/color-picker/index.test.js +52 -0
- package/src/color-picker/style.scss +11 -13
- package/src/confirm-dialog/README.md +128 -0
- package/src/confirm-dialog/index.tsx +132 -0
- package/src/dataviews/index.tsx +34 -0
- package/src/dataviews/style.scss +9 -0
- package/src/divider/README.md +25 -0
- package/src/divider/index.js +31 -0
- package/src/divider/style.scss +51 -0
- package/src/form-token-field/style.scss +0 -5
- package/src/grid/index.tsx +2 -1
- package/src/grid/style.scss +67 -8
- package/src/handoff/README.md +93 -0
- package/src/handoff/index.js +46 -8
- package/src/hooks/index.ts +2 -1
- package/src/hooks/use-confirm-dialog.tsx +80 -0
- package/src/hooks/use-unsaved-changes-dialog.tsx +140 -0
- package/src/image-upload/index.js +10 -15
- package/src/image-upload/style.scss +12 -40
- package/src/index.js +13 -1
- package/src/integration-icons/active-campaign.js +14 -0
- package/src/integration-icons/constant-contact.js +22 -0
- package/src/integration-icons/fundraise-up.js +18 -0
- package/src/integration-icons/index.js +6 -0
- package/src/integration-icons/mailchimp.js +10 -0
- package/src/integration-icons/salesforce.js +10 -0
- package/src/integration-icons/wisepops.js +14 -0
- package/src/modal/index.js +12 -3
- package/src/modal/style.scss +47 -13
- package/src/newspack-icon/style.scss +5 -3
- package/src/plugin-installer/index.js +30 -19
- package/src/section-header/index.js +105 -14
- package/src/section-header/style.scss +129 -4
- package/src/select-control/index.js +4 -0
- package/src/style.scss +2 -0
- package/src/utils/editor-toolbar-back-button.tsx +48 -0
- package/src/utils/index.js +6 -0
- package/src/utils/style.scss +8 -0
- package/src/waiting/index.js +2 -1
- package/src/waiting/style.scss +4 -0
- package/src/web-preview/index.js +90 -35
- package/src/web-preview/style.scss +20 -53
- package/src/with-wizard/index.js +1 -1
- package/src/with-wizard/style.scss +28 -60
- package/src/with-wizard-screen/style.scss +77 -10
- package/src/wizard/components/WizardSnackbar.js +58 -0
- package/src/wizard/components/style.scss +48 -0
- package/src/wizard/index.js +152 -21
- package/src/wizard/store/index.js +28 -2
- package/dist/cjs/button-card/index.js +0 -72
- package/dist/cjs/button-card/style.scss +0 -180
- package/dist/esm/button-card/index.js +0 -64
- package/dist/esm/button-card/style.scss +0 -180
- package/src/button-card/index.js +0 -52
- package/src/button-card/style.scss +0 -180
|
@@ -3,21 +3,66 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
6
|
+
@use "~@wordpress/base-styles/variables" as wp-vars;
|
|
7
|
+
@use "../../../colors/colors.module" as colors;
|
|
6
8
|
|
|
7
9
|
.newspack-section-header {
|
|
10
|
+
flex: 1;
|
|
8
11
|
margin: 64px 0 32px;
|
|
9
12
|
|
|
10
|
-
&__container
|
|
11
|
-
|
|
13
|
+
&__container {
|
|
14
|
+
position: relative;
|
|
15
|
+
&:not(:first-child) {
|
|
16
|
+
margin-top: 48px;
|
|
17
|
+
}
|
|
18
|
+
&:has(> .newspack-section-header--no-margin) {
|
|
19
|
+
margin-top: 0;
|
|
20
|
+
}
|
|
21
|
+
&.newspack-section-header--has-primary-action {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
gap: 32px;
|
|
25
|
+
@media (min-width: 782px) {
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
flex-direction: row;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&.newspack-section-header--has-back-nav {
|
|
31
|
+
@media (min-width: 782px) {
|
|
32
|
+
.newspack-section-header__title-container,
|
|
33
|
+
p {
|
|
34
|
+
max-width: calc(50% - 16px);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__back-nav {
|
|
41
|
+
@media (min-width: 1280px) {
|
|
42
|
+
left: 0;
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 50%;
|
|
45
|
+
transform: translate(calc(-100% - 8px), -50%);
|
|
46
|
+
}
|
|
47
|
+
a,
|
|
48
|
+
button {
|
|
49
|
+
color: inherit !important;
|
|
50
|
+
}
|
|
12
51
|
}
|
|
13
52
|
|
|
14
|
-
&--no-margin,
|
|
15
53
|
h1,
|
|
16
54
|
h2,
|
|
17
55
|
h3,
|
|
18
56
|
h4,
|
|
19
57
|
h5,
|
|
20
58
|
h6 {
|
|
59
|
+
align-items: center;
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
margin: 0 !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&--no-margin {
|
|
21
66
|
margin: 0 !important;
|
|
22
67
|
}
|
|
23
68
|
|
|
@@ -25,7 +70,7 @@
|
|
|
25
70
|
text-align: center;
|
|
26
71
|
}
|
|
27
72
|
|
|
28
|
-
&:not( #{&}--no-margin ) + *:not( #{&} ) {
|
|
73
|
+
&:not( #{&}--no-margin ) + *:not( #{&} ):not(.newspack-wizard__section-header):not(.newspack-section-header__primary-action) {
|
|
29
74
|
margin-top: -16px !important;
|
|
30
75
|
}
|
|
31
76
|
|
|
@@ -39,7 +84,87 @@
|
|
|
39
84
|
color: wp-colors.$gray-700;
|
|
40
85
|
}
|
|
41
86
|
|
|
87
|
+
&__title-container {
|
|
88
|
+
align-items: center;
|
|
89
|
+
display: flex;
|
|
90
|
+
gap: 8px;
|
|
91
|
+
|
|
92
|
+
h2 {
|
|
93
|
+
font-size: wp-vars.$font-size-x-large;
|
|
94
|
+
font-weight: wp-vars.$font-weight-medium;
|
|
95
|
+
line-height: wp-vars.$font-line-height-x-large;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.newspack-section-header__menu,
|
|
99
|
+
.newspack-section-header__secondary-action,
|
|
100
|
+
.newspack-badge {
|
|
101
|
+
margin-top: 8px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__menu {
|
|
106
|
+
align-self: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&__primary-action {
|
|
110
|
+
@media (min-width: 782px) {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex: 1;
|
|
113
|
+
justify-content: flex-end;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__secondary-action {
|
|
118
|
+
display: flex;
|
|
119
|
+
margin-left: 8px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&__children {
|
|
123
|
+
margin-top: 32px;
|
|
124
|
+
width: 100%;
|
|
125
|
+
.newspack-button-card:not(.grouped) {
|
|
126
|
+
margin-bottom: 0;
|
|
127
|
+
& + .newspack-button-card:not(.grouped) {
|
|
128
|
+
margin-top: 16px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
42
133
|
.newspack-wizard__content &:first-child {
|
|
43
134
|
margin-top: 32px;
|
|
44
135
|
}
|
|
136
|
+
&.newspack-section-header--page-header {
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: center;
|
|
141
|
+
margin-left: auto;
|
|
142
|
+
margin-right: auto;
|
|
143
|
+
> h1,
|
|
144
|
+
> h2,
|
|
145
|
+
> h3,
|
|
146
|
+
> h4,
|
|
147
|
+
> h5,
|
|
148
|
+
> h6,
|
|
149
|
+
> p {
|
|
150
|
+
text-align: center;
|
|
151
|
+
}
|
|
152
|
+
.newspack-section-header__icon {
|
|
153
|
+
background-color: var(--wp-admin-theme-color-lighter-10);
|
|
154
|
+
border-radius: 100%;
|
|
155
|
+
display: grid;
|
|
156
|
+
height: 80px;
|
|
157
|
+
margin-bottom: 8px !important;
|
|
158
|
+
width: 80px;
|
|
159
|
+
place-items: center;
|
|
160
|
+
svg {
|
|
161
|
+
fill: var(--wp-admin-theme-color);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
h1 {
|
|
165
|
+
font-size: wp-vars.$font-size-x-large;
|
|
166
|
+
font-weight: wp-vars.$font-weight-medium;
|
|
167
|
+
line-height: wp-vars.$font-line-height-x-large;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
45
170
|
}
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _icons = require("@wordpress/icons");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
@@ -22,37 +22,42 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
22
22
|
* Internal dependencies
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
buttonOptions,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const id = _.hooks.useUniqueId('button-group');
|
|
25
|
+
var ButtonGroupControl = function ButtonGroupControl(_ref) {
|
|
26
|
+
var buttonOptions = _ref.buttonOptions,
|
|
27
|
+
buttonSmall = _ref.buttonSmall,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
help = _ref.help,
|
|
30
|
+
hideLabelFromVision = _ref.hideLabelFromVision,
|
|
31
|
+
label = _ref.label,
|
|
32
|
+
onChange = _ref.onChange,
|
|
33
|
+
value = _ref.value;
|
|
34
|
+
var id = _.hooks.useUniqueId('button-group');
|
|
36
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
37
36
|
label: label,
|
|
38
37
|
help: help,
|
|
39
38
|
hideLabelFromVision: hideLabelFromVision,
|
|
40
39
|
id: id.current,
|
|
41
|
-
className: (0, _classnames
|
|
40
|
+
className: (0, _classnames["default"])(className, 'components-select-control'),
|
|
42
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ButtonGroup, {
|
|
43
|
-
children: buttonOptions.map(option
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
children: buttonOptions.map(function (option) {
|
|
43
|
+
var isSelected = value === option.value;
|
|
44
|
+
var Label = function Label() {
|
|
45
|
+
return option.label;
|
|
46
|
+
};
|
|
46
47
|
if (option.icon) {
|
|
47
48
|
// eslint-disable-next-line react/display-name
|
|
48
|
-
Label =
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Label = function Label() {
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
51
|
+
icon: option.icon
|
|
52
|
+
});
|
|
53
|
+
};
|
|
51
54
|
}
|
|
52
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
53
56
|
variant: isSelected ? 'primary' : null,
|
|
54
57
|
isPressed: isSelected,
|
|
55
|
-
onClick: ()
|
|
58
|
+
onClick: function onClick() {
|
|
59
|
+
return onChange(option.value);
|
|
60
|
+
},
|
|
56
61
|
isSmall: buttonSmall,
|
|
57
62
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, {})
|
|
58
63
|
}, option.value);
|
|
@@ -60,4 +65,4 @@ const ButtonGroupControl = ({
|
|
|
60
65
|
})
|
|
61
66
|
});
|
|
62
67
|
};
|
|
63
|
-
var _default = exports
|
|
68
|
+
var _default = exports["default"] = ButtonGroupControl;
|
|
@@ -4,7 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = GroupedSelectControl;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
10
|
var _components = require("@wordpress/components");
|
|
9
11
|
var _i18n = require("@wordpress/i18n");
|
|
10
12
|
var _icons = require("@wordpress/icons");
|
|
@@ -13,66 +15,70 @@ var _find = _interopRequireDefault(require("lodash/find"));
|
|
|
13
15
|
var _some = _interopRequireDefault(require("lodash/some"));
|
|
14
16
|
var _ = require("..");
|
|
15
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
var _excluded = ["help", "label", "onChange", "optgroups", "className", "hideLabelFromVision"];
|
|
16
19
|
/**
|
|
17
20
|
* WordPress dependencies
|
|
18
21
|
*/
|
|
19
|
-
|
|
20
22
|
/**
|
|
21
23
|
* External dependencies
|
|
22
24
|
*/
|
|
23
|
-
|
|
24
25
|
/**
|
|
25
26
|
* Internal dependencies
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
28
|
/**
|
|
29
29
|
* SelectControl with optgroup support
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
*/
|
|
31
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
|
+
function GroupedSelectControl(_ref) {
|
|
34
|
+
var help = _ref.help,
|
|
35
|
+
label = _ref.label,
|
|
36
|
+
onChange = _ref.onChange,
|
|
37
|
+
_ref$optgroups = _ref.optgroups,
|
|
38
|
+
optgroups = _ref$optgroups === void 0 ? [] : _ref$optgroups,
|
|
39
|
+
className = _ref.className,
|
|
40
|
+
hideLabelFromVision = _ref.hideLabelFromVision,
|
|
41
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
42
|
+
var onChangeValue = function onChangeValue(event) {
|
|
43
|
+
var value = event.target.value;
|
|
44
|
+
var optgroup = (0, _find["default"])(optgroups, function (group) {
|
|
45
|
+
return (0, _some["default"])(group.options, ['value', value]);
|
|
46
|
+
});
|
|
44
47
|
onChange(value, optgroup);
|
|
45
48
|
};
|
|
46
|
-
|
|
49
|
+
var id = _.hooks.useUniqueId('group-select');
|
|
47
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.BaseControl, {
|
|
48
51
|
label: label,
|
|
49
52
|
hideLabelFromVision: hideLabelFromVision,
|
|
50
53
|
id: id,
|
|
51
54
|
help: help,
|
|
52
|
-
className: (0, _classnames
|
|
55
|
+
className: (0, _classnames["default"])(className, 'components-select-control'),
|
|
53
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
54
57
|
className: "relative",
|
|
55
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", {
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("select", _objectSpread(_objectSpread({
|
|
56
59
|
id: id,
|
|
57
60
|
className: "components-select-control__input",
|
|
58
61
|
onChange: onChangeValue,
|
|
59
|
-
"aria-describedby": !!help ?
|
|
60
|
-
|
|
62
|
+
"aria-describedby": !!help ? "".concat(id, "__help") : undefined
|
|
63
|
+
}, props), {}, {
|
|
61
64
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
62
65
|
value: "",
|
|
63
66
|
children: (0, _i18n.__)('-- Select --', 'newspack-plugin')
|
|
64
|
-
}), optgroups.map(({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
}), optgroups.map(function (_ref2, optgroupIndex) {
|
|
68
|
+
var optgroupLabel = _ref2.label,
|
|
69
|
+
options = _ref2.options;
|
|
70
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("optgroup", {
|
|
71
|
+
label: optgroupLabel,
|
|
72
|
+
children: options.map(function (option, optionIndex) {
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
74
|
+
value: option.value,
|
|
75
|
+
disabled: option.disabled,
|
|
76
|
+
children: option.label
|
|
77
|
+
}, "".concat(option.label, "-").concat(option.value, "-").concat(optionIndex));
|
|
78
|
+
})
|
|
79
|
+
}, optgroupIndex);
|
|
80
|
+
})]
|
|
81
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
76
82
|
className: "components-select-control__arrow-wrapper",
|
|
77
83
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
78
84
|
icon: _icons.chevronDown,
|
|
@@ -4,7 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
8
15
|
var _components = require("@wordpress/components");
|
|
9
16
|
var _element = require("@wordpress/element");
|
|
10
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -12,48 +19,53 @@ require("./style.scss");
|
|
|
12
19
|
var _GroupedSelectControl = _interopRequireDefault(require("./GroupedSelectControl"));
|
|
13
20
|
var _ButtonGroupControl = _interopRequireDefault(require("./ButtonGroupControl"));
|
|
14
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
22
|
+
var _excluded = ["className", "optgroups", "buttonOptions", "buttonSmall"];
|
|
23
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
26
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
|
|
16
27
|
* Select Control
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
28
|
+
*
|
|
29
|
+
* @deprecated For new features, use the core `SelectControl` (and `__experimentalToggleGroupControl` for
|
|
30
|
+
* grouped/button-style selections) from `@wordpress/components` instead of this wrapper. This component
|
|
31
|
+
* is kept only for existing usages and should not be used in new code.
|
|
32
|
+
*/ /**
|
|
20
33
|
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
34
|
+
*/ /**
|
|
24
35
|
* External dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
/**
|
|
36
|
+
*/ /**
|
|
28
37
|
* Internal dependencies
|
|
29
38
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
render() {
|
|
36
|
-
const {
|
|
37
|
-
className,
|
|
38
|
-
optgroups,
|
|
39
|
-
buttonOptions,
|
|
40
|
-
buttonSmall,
|
|
41
|
-
...otherProps
|
|
42
|
-
} = this.props;
|
|
43
|
-
const classes = (0, _classnames.default)('newspack-select-control', optgroups && 'newspack-grouped-select-control', buttonOptions && 'newspack-buttons-select-control', className);
|
|
44
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
|
-
className: classes,
|
|
46
|
-
children: optgroups ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedSelectControl.default, {
|
|
47
|
-
optgroups: optgroups,
|
|
48
|
-
...otherProps
|
|
49
|
-
}) : buttonOptions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroupControl.default, {
|
|
50
|
-
buttonOptions: buttonOptions,
|
|
51
|
-
buttonSmall: buttonSmall,
|
|
52
|
-
...otherProps
|
|
53
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
54
|
-
...otherProps
|
|
55
|
-
})
|
|
56
|
-
});
|
|
39
|
+
var SelectControl = /*#__PURE__*/function (_Component) {
|
|
40
|
+
function SelectControl() {
|
|
41
|
+
(0, _classCallCheck2["default"])(this, SelectControl);
|
|
42
|
+
return _callSuper(this, SelectControl, arguments);
|
|
57
43
|
}
|
|
58
|
-
|
|
59
|
-
|
|
44
|
+
(0, _inherits2["default"])(SelectControl, _Component);
|
|
45
|
+
return (0, _createClass2["default"])(SelectControl, [{
|
|
46
|
+
key: "render",
|
|
47
|
+
value:
|
|
48
|
+
/**
|
|
49
|
+
* Render.
|
|
50
|
+
*/
|
|
51
|
+
function render() {
|
|
52
|
+
var _this$props = this.props,
|
|
53
|
+
className = _this$props.className,
|
|
54
|
+
optgroups = _this$props.optgroups,
|
|
55
|
+
buttonOptions = _this$props.buttonOptions,
|
|
56
|
+
buttonSmall = _this$props.buttonSmall,
|
|
57
|
+
otherProps = (0, _objectWithoutProperties2["default"])(_this$props, _excluded);
|
|
58
|
+
var classes = (0, _classnames["default"])('newspack-select-control', optgroups && 'newspack-grouped-select-control', buttonOptions && 'newspack-buttons-select-control', className);
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
+
className: classes,
|
|
61
|
+
children: optgroups ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedSelectControl["default"], _objectSpread({
|
|
62
|
+
optgroups: optgroups
|
|
63
|
+
}, otherProps)) : buttonOptions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonGroupControl["default"], _objectSpread({
|
|
64
|
+
buttonOptions: buttonOptions,
|
|
65
|
+
buttonSmall: buttonSmall
|
|
66
|
+
}, otherProps)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, _objectSpread({}, otherProps))
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
}(_element.Component);
|
|
71
|
+
var _default = exports["default"] = SelectControl;
|
|
@@ -1,60 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
7
10
|
var _i18n = require("@wordpress/i18n");
|
|
8
11
|
var _components = require("@wordpress/components");
|
|
9
12
|
var _ = require("../");
|
|
10
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
var _excluded = ["min", "max", "onChangeMin", "onChangeMax", "minPlaceholder", "maxPlaceholder"];
|
|
11
15
|
/**
|
|
12
16
|
* WordPress dependencies.
|
|
13
17
|
*/
|
|
14
|
-
|
|
15
18
|
/**
|
|
16
19
|
* Internal dependencies.
|
|
17
20
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
29
|
-
...props,
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
var MinMaxSetting = function MinMaxSetting(_ref) {
|
|
24
|
+
var min = _ref.min,
|
|
25
|
+
max = _ref.max,
|
|
26
|
+
onChangeMin = _ref.onChangeMin,
|
|
27
|
+
onChangeMax = _ref.onChangeMax,
|
|
28
|
+
minPlaceholder = _ref.minPlaceholder,
|
|
29
|
+
maxPlaceholder = _ref.maxPlaceholder,
|
|
30
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, props), {}, {
|
|
30
32
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
31
33
|
className: "newspack-settings__min-max",
|
|
32
34
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
33
35
|
checked: min > 0,
|
|
34
|
-
onChange:
|
|
36
|
+
onChange: function onChange(value) {
|
|
37
|
+
return onChangeMin(value ? 1 : 0);
|
|
38
|
+
},
|
|
35
39
|
label: (0, _i18n.__)('Min', 'newspack-plugin')
|
|
36
40
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TextControl, {
|
|
37
41
|
"data-testid": "min",
|
|
38
42
|
type: "number",
|
|
39
43
|
value: min,
|
|
40
44
|
placeholder: minPlaceholder,
|
|
41
|
-
onChange:
|
|
45
|
+
onChange: function onChange(value) {
|
|
46
|
+
return onChangeMin(value > 0 ? value : 0);
|
|
47
|
+
}
|
|
42
48
|
})]
|
|
43
49
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
50
|
className: "newspack-settings__min-max",
|
|
45
51
|
"data-testid": "max",
|
|
46
52
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
47
53
|
checked: max > 0,
|
|
48
|
-
onChange:
|
|
54
|
+
onChange: function onChange(value) {
|
|
55
|
+
return onChangeMax(value ? min || 1 : 0);
|
|
56
|
+
},
|
|
49
57
|
label: (0, _i18n.__)('Max', 'newspack-plugin')
|
|
50
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.TextControl, {
|
|
51
59
|
"data-testid": "max",
|
|
52
60
|
type: "number",
|
|
53
61
|
value: max,
|
|
54
62
|
placeholder: maxPlaceholder,
|
|
55
|
-
onChange:
|
|
63
|
+
onChange: function onChange(value) {
|
|
64
|
+
return onChangeMax(value > 0 ? value : 0);
|
|
65
|
+
}
|
|
56
66
|
})]
|
|
57
67
|
})]
|
|
58
|
-
});
|
|
68
|
+
}));
|
|
59
69
|
};
|
|
60
|
-
var _default = exports
|
|
70
|
+
var _default = exports["default"] = MinMaxSetting;
|
|
@@ -4,30 +4,33 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
11
|
var _ = require("../");
|
|
10
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
var _excluded = ["children", "className", "columns", "gutter", "noBorder", "rowGap"];
|
|
11
14
|
/**
|
|
12
15
|
* External dependencies.
|
|
13
16
|
*/
|
|
14
|
-
|
|
15
17
|
/**
|
|
16
18
|
* Internal dependencies.
|
|
17
19
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
var SettingsCard = function SettingsCard(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
_ref$columns = _ref.columns,
|
|
26
|
+
columns = _ref$columns === void 0 ? 3 : _ref$columns,
|
|
27
|
+
_ref$gutter = _ref.gutter,
|
|
28
|
+
gutter = _ref$gutter === void 0 ? 32 : _ref$gutter,
|
|
29
|
+
noBorder = _ref.noBorder,
|
|
30
|
+
rowGap = _ref.rowGap,
|
|
31
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
32
|
+
var classes = (0, _classnames["default"])('newspack-settings__card', noBorder && 'newspack-settings__no-border', className);
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionCard, _objectSpread(_objectSpread({}, props), {}, {
|
|
31
34
|
className: classes,
|
|
32
35
|
notificationLevel: "info",
|
|
33
36
|
noBorder: noBorder,
|
|
@@ -37,6 +40,6 @@ const SettingsCard = ({
|
|
|
37
40
|
rowGap: rowGap,
|
|
38
41
|
children: children
|
|
39
42
|
})
|
|
40
|
-
});
|
|
43
|
+
}));
|
|
41
44
|
};
|
|
42
|
-
var _default = exports
|
|
45
|
+
var _default = exports["default"] = SettingsCard;
|