newspack-components 3.1.0 → 4.0.0
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/colors/colors.module.scss +277 -0
- package/copy-styles.js +8 -1
- package/dist/cjs/action-card/action-card.d.js +5 -0
- package/dist/cjs/action-card/index.js +282 -187
- package/dist/cjs/action-card/style.scss +142 -44
- package/dist/cjs/autocomplete-tokenfield/index.js +6 -2
- package/dist/cjs/box-contrast/index.js +49 -0
- package/dist/cjs/button/index.js +1 -1
- package/dist/cjs/button-props/button-props.js +41 -0
- package/dist/cjs/button-props/index.js +13 -0
- package/dist/cjs/color-picker/index.js +11 -0
- package/dist/cjs/custom-select-control/style.scss +7 -12
- package/dist/cjs/footer/index.js +17 -24
- package/dist/cjs/footer/style.scss +0 -36
- package/dist/cjs/handoff-message/index.js +0 -3
- package/dist/cjs/hooks/useObjectState.js +9 -0
- package/dist/cjs/hooks/useObjectState.test.js +5 -5
- package/dist/cjs/index.js +7 -21
- package/dist/cjs/modal/index.js +4 -1
- package/dist/cjs/modal/style.scss +18 -7
- package/dist/cjs/newspack-icon/index.js +2 -2
- package/dist/cjs/newspack-icon/style.scss +3 -5
- package/dist/cjs/notice/index.js +1 -2
- package/dist/cjs/notice/style.scss +11 -9
- package/dist/cjs/plugin-installer/index.js +3 -3
- package/dist/cjs/plugin-settings/SettingsSection.js +2 -0
- package/dist/cjs/plugin-settings/index.js +4 -1
- package/dist/cjs/plugin-toggle/index.js +2 -0
- package/dist/cjs/popover/style.scss +5 -6
- package/dist/cjs/progress-bar/index.test.js +1 -2
- package/dist/cjs/progress-bar/style.scss +1 -2
- package/dist/cjs/proxied-imports/router.js +1 -2
- package/dist/cjs/radio-control/style.scss +4 -10
- package/dist/cjs/section-header/index.js +21 -1
- package/dist/cjs/select-control/ButtonGroupControl.js +2 -0
- package/dist/cjs/settings/SettingsCard.js +2 -6
- package/dist/cjs/sortable-newsletter-list-control/index.js +7 -5
- package/dist/cjs/sortable-newsletter-list-control/style.scss +11 -1
- package/dist/cjs/steps-list/style.scss +0 -3
- package/dist/cjs/steps-list-item/style.scss +1 -2
- package/dist/cjs/style-card/index.js +1 -0
- package/dist/cjs/style-card/style.scss +4 -5
- package/dist/cjs/style.scss +15 -0
- package/dist/cjs/tabbed-navigation/index.js +17 -7
- package/dist/cjs/tabbed-navigation/style.scss +2 -6
- package/dist/cjs/utils/color.js +35 -0
- package/dist/cjs/web-preview/style.scss +11 -11
- package/dist/cjs/with-wizard/index.js +80 -3
- package/dist/cjs/with-wizard/style.scss +34 -13
- package/dist/cjs/with-wizard-screen/index.js +3 -3
- package/dist/cjs/with-wizard-screen/style.scss +9 -9
- package/dist/cjs/wizard/index.js +38 -13
- package/dist/cjs/wizard/store/index.js +13 -5
- package/dist/cjs/wizard/store/utils.js +3 -1
- package/dist/esm/action-card/action-card.d.js +1 -0
- package/dist/esm/action-card/index.js +286 -189
- package/dist/esm/action-card/style.scss +142 -44
- package/dist/esm/autocomplete-tokenfield/index.js +6 -2
- package/dist/esm/box-contrast/index.js +44 -0
- package/dist/esm/button/index.js +1 -1
- package/dist/esm/button-props/button-props.js +34 -0
- package/dist/esm/button-props/index.js +1 -0
- package/dist/esm/color-picker/index.js +11 -0
- package/dist/esm/custom-select-control/style.scss +7 -12
- package/dist/esm/footer/index.js +18 -25
- package/dist/esm/footer/style.scss +0 -36
- package/dist/esm/handoff-message/index.js +0 -3
- package/dist/esm/hooks/useObjectState.js +10 -0
- package/dist/esm/hooks/useObjectState.test.js +6 -6
- package/dist/esm/index.js +1 -3
- package/dist/esm/modal/index.js +4 -1
- package/dist/esm/modal/style.scss +18 -7
- package/dist/esm/newspack-icon/index.js +2 -2
- package/dist/esm/newspack-icon/style.scss +3 -5
- package/dist/esm/notice/index.js +1 -2
- package/dist/esm/notice/style.scss +11 -9
- package/dist/esm/plugin-installer/index.js +3 -3
- package/dist/esm/plugin-settings/SettingsSection.js +2 -0
- package/dist/esm/plugin-settings/index.js +4 -1
- package/dist/esm/plugin-toggle/index.js +2 -0
- package/dist/esm/popover/style.scss +5 -6
- package/dist/esm/progress-bar/style.scss +1 -2
- package/dist/esm/radio-control/style.scss +4 -10
- package/dist/esm/section-header/index.js +22 -0
- package/dist/esm/select-control/ButtonGroupControl.js +2 -0
- package/dist/esm/settings/SettingsCard.js +2 -6
- package/dist/esm/sortable-newsletter-list-control/index.js +8 -6
- package/dist/esm/sortable-newsletter-list-control/style.scss +11 -1
- package/dist/esm/steps-list/style.scss +0 -3
- package/dist/esm/steps-list-item/style.scss +1 -2
- package/dist/esm/style-card/index.js +1 -0
- package/dist/esm/style-card/style.scss +4 -5
- package/dist/esm/style.scss +15 -0
- package/dist/esm/tabbed-navigation/index.js +17 -7
- package/dist/esm/tabbed-navigation/style.scss +2 -6
- package/dist/esm/utils/color.js +29 -0
- package/dist/esm/web-preview/style.scss +11 -11
- package/dist/esm/with-wizard/index.js +81 -4
- package/dist/esm/with-wizard/style.scss +34 -13
- package/dist/esm/with-wizard-screen/index.js +1 -1
- package/dist/esm/with-wizard-screen/style.scss +9 -9
- package/dist/esm/wizard/index.js +39 -13
- package/dist/esm/wizard/store/index.js +13 -5
- package/dist/esm/wizard/store/utils.js +3 -1
- package/package.json +1 -1
- package/src/accordion/index.js +1 -3
- package/src/action-card/action-card.d.ts +40 -0
- package/src/action-card/index.js +284 -202
- package/src/action-card/style.scss +142 -44
- package/src/autocomplete-tokenfield/index.js +3 -2
- package/src/autocomplete-with-suggestions/index.js +52 -63
- package/src/box-contrast/index.tsx +44 -0
- package/src/button/index.tsx +1 -1
- package/src/button-card/index.js +1 -12
- package/src/card/index.js +1 -11
- package/src/category-autocomplete/index.js +4 -19
- package/src/color-picker/index.js +11 -7
- package/src/custom-select-control/style.scss +7 -12
- package/src/footer/index.js +6 -18
- package/src/footer/style.scss +0 -36
- package/src/form-token-field/index.js +1 -2
- package/src/grid/index.tsx +1 -8
- package/src/handoff/index.js +4 -11
- package/src/handoff-message/index.js +0 -3
- package/src/hooks/useObjectState.js +10 -2
- package/src/hooks/useObjectState.test.js +14 -14
- package/src/image-upload/index.js +3 -23
- package/src/index.js +1 -3
- package/src/modal/index.js +2 -2
- package/src/modal/style.scss +18 -7
- package/src/newspack-icon/index.js +3 -14
- package/src/newspack-icon/style.scss +3 -5
- package/src/notice/index.js +0 -2
- package/src/notice/style.scss +11 -9
- package/src/plugin-installer/index.js +8 -17
- package/src/plugin-settings/SettingsSection.js +3 -7
- package/src/plugin-settings/index.js +7 -14
- package/src/plugin-toggle/README.md +3 -3
- package/src/plugin-toggle/index.js +10 -13
- package/src/popover/index.js +1 -5
- package/src/popover/style.scss +5 -6
- package/src/position-control/index.js +65 -75
- package/src/progress-bar/index.js +2 -9
- package/src/progress-bar/index.test.js +4 -13
- package/src/progress-bar/style.scss +1 -2
- package/src/radio-control/style.scss +4 -10
- package/src/section-header/index.js +20 -0
- package/src/select-control/ButtonGroupControl.js +2 -9
- package/src/select-control/GroupedSelectControl.js +1 -9
- package/src/select-control/index.js +1 -5
- package/src/settings/MinMaxSetting.js +2 -14
- package/src/settings/SettingsCard.js +2 -11
- package/src/sortable-newsletter-list-control/index.js +10 -26
- package/src/sortable-newsletter-list-control/style.scss +11 -1
- package/src/steps-list/style.scss +0 -3
- package/src/steps-list-item/index.js +1 -4
- package/src/steps-list-item/style.scss +1 -2
- package/src/style-card/index.js +6 -21
- package/src/style-card/style.scss +4 -5
- package/src/style.scss +15 -0
- package/src/tabbed-navigation/index.js +19 -7
- package/src/tabbed-navigation/style.scss +2 -6
- package/src/text-control/index.tsx +2 -12
- package/src/utils/color.ts +32 -0
- package/src/web-preview/style.scss +11 -11
- package/src/with-wizard/index.js +67 -16
- package/src/with-wizard/style.scss +34 -13
- package/src/with-wizard-screen/index.js +1 -1
- package/src/with-wizard-screen/style.scss +9 -9
- package/src/wizard/components/WizardError.js +2 -7
- package/src/wizard/index.js +64 -62
- package/src/wizard/store/index.js +8 -10
- package/src/wizard/store/utils.js +3 -4
- package/dist/cjs/date-range-picker/index.js +0 -39
- package/dist/cjs/date-range-picker/style.scss +0 -148
- package/dist/cjs/newspack-logo/index.js +0 -54
- package/dist/cjs/newspack-logo/style.scss +0 -30
- package/dist/cjs/patrons-logo/index.js +0 -77
- package/dist/esm/date-range-picker/index.js +0 -31
- package/dist/esm/date-range-picker/style.scss +0 -148
- package/dist/esm/newspack-logo/index.js +0 -46
- package/dist/esm/newspack-logo/style.scss +0 -30
- package/dist/esm/patrons-logo/index.js +0 -70
- package/shared/scss/_colors.scss +0 -27
- package/src/date-range-picker/index.js +0 -31
- package/src/date-range-picker/style.scss +0 -148
- package/src/newspack-logo/index.js +0 -45
- package/src/newspack-logo/style.scss +0 -30
- package/src/patrons-logo/index.js +0 -76
- /package/{shared/js → src/button-props}/button-props.js +0 -0
- /package/{shared/js → src/button-props}/index.js +0 -0
package/dist/esm/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as AutocompleteTokenField } from './autocomplete-tokenfield';
|
|
|
4
4
|
export { default as AutocompleteWithSuggestions } from './autocomplete-with-suggestions';
|
|
5
5
|
export { default as Button } from './button';
|
|
6
6
|
export { default as ButtonCard } from './button-card';
|
|
7
|
+
export { default as BoxContrast } from './box-contrast';
|
|
7
8
|
export { default as Card } from './card';
|
|
8
9
|
export { default as CategoryAutocomplete } from './category-autocomplete';
|
|
9
10
|
export { default as ColorPicker } from './color-picker';
|
|
@@ -18,9 +19,7 @@ export { default as GlobalNotices } from './global-notices';
|
|
|
18
19
|
export { default as Grid } from './grid';
|
|
19
20
|
export { default as Modal } from './modal';
|
|
20
21
|
export { default as NewspackIcon } from './newspack-icon';
|
|
21
|
-
export { default as NewspackLogo } from './newspack-logo';
|
|
22
22
|
export { default as Notice } from './notice';
|
|
23
|
-
export { default as PatronsLogo } from './patrons-logo';
|
|
24
23
|
export { default as PluginInstaller } from './plugin-installer';
|
|
25
24
|
export { default as PluginSettings } from './plugin-settings';
|
|
26
25
|
export { default as PluginToggle } from './plugin-toggle';
|
|
@@ -29,7 +28,6 @@ export { default as ProgressBar } from './progress-bar';
|
|
|
29
28
|
export { default as RadioControl } from './radio-control';
|
|
30
29
|
export { default as SectionHeader } from './section-header';
|
|
31
30
|
export { default as SelectControl } from './select-control';
|
|
32
|
-
export { default as DateRangePicker } from './date-range-picker';
|
|
33
31
|
export { default as Settings } from './settings';
|
|
34
32
|
export { default as StepsList } from './steps-list';
|
|
35
33
|
export { default as StepsListItem } from './steps-list-item';
|
package/dist/esm/modal/index.js
CHANGED
|
@@ -22,9 +22,12 @@ function Modal({
|
|
|
22
22
|
className,
|
|
23
23
|
isWide,
|
|
24
24
|
isNarrow,
|
|
25
|
+
hideTitle,
|
|
25
26
|
...otherProps
|
|
26
27
|
}, ref) {
|
|
27
|
-
const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow',
|
|
28
|
+
const classes = classnames('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', hideTitle && 'newspack-modal--hide-title',
|
|
29
|
+
// Note: also hides the X close button.
|
|
30
|
+
className);
|
|
28
31
|
return /*#__PURE__*/_jsx(BaseComponent, {
|
|
29
32
|
className: classes,
|
|
30
33
|
...otherProps,
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Modal
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../
|
|
5
|
+
@use "../../../colors/colors.module" as colors;
|
|
6
6
|
|
|
7
7
|
.newspack-modal {
|
|
8
8
|
// Color
|
|
9
|
-
--wp-admin-theme-color: #{colors.$primary-
|
|
10
|
-
--wp-admin-theme-color--rgb: #{colors.$primary-
|
|
11
|
-
--wp-admin-theme-color-darker-10: #{colors.$primary-
|
|
12
|
-
--wp-admin-theme-color-darker-10--rgb: #{colors.$primary-
|
|
13
|
-
--wp-admin-theme-color-darker-20: #{colors.$primary-
|
|
14
|
-
--wp-admin-theme-color-darker-20--rgb: #{colors.$primary-
|
|
9
|
+
--wp-admin-theme-color: #{colors.$primary-600};
|
|
10
|
+
--wp-admin-theme-color--rgb: #{colors.$primary-600--rgb};
|
|
11
|
+
--wp-admin-theme-color-darker-10: #{colors.$primary-700};
|
|
12
|
+
--wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
|
|
13
|
+
--wp-admin-theme-color-darker-20: #{colors.$primary-800};
|
|
14
|
+
--wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
|
|
15
15
|
|
|
16
16
|
@media screen and ( min-width: 744px ) {
|
|
17
17
|
max-width: 680px;
|
|
@@ -28,6 +28,17 @@
|
|
|
28
28
|
width: 360px;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
&--hide-title {
|
|
32
|
+
.components-modal__header {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.components-modal__content {
|
|
37
|
+
margin-top: 0;
|
|
38
|
+
padding-top: 32px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
@media screen and ( min-width: 960px ) {
|
|
32
43
|
max-height: calc(100% - 128px);
|
|
33
44
|
}
|
|
@@ -34,12 +34,12 @@ class NewspackIcon extends Component {
|
|
|
34
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
35
35
|
height: size,
|
|
36
36
|
width: size,
|
|
37
|
-
viewBox: "0 0
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
38
|
className: classes,
|
|
39
39
|
children: /*#__PURE__*/_jsx(Path, {
|
|
40
40
|
fillRule: "evenodd",
|
|
41
41
|
clipRule: "evenodd",
|
|
42
|
-
d: "
|
|
42
|
+
d: "M24 12C24 18.6271 18.6271 24 12 24C5.37213 24 0 18.6271 0 12C0 5.3729 5.3729 0 12 0C18.6271 0 24 5.3729 24 12ZM17.4545 17.4546L6.54545 6.54545V17.4545H8.72727V11.8182L14.3636 17.4546H17.4545ZM11.2727 8.18182H17.4545V6.54545H9.63636L11.2727 8.18182ZM17.4545 11.2727H14.3636L12.7273 9.63636H17.4545V11.2727ZM17.4545 12.7273V14.3636L15.8182 12.7273H17.4545Z"
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
* Newspack Icon
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../shared/scss/colors";
|
|
6
|
-
|
|
7
5
|
.newspack-icon {
|
|
8
|
-
background:
|
|
6
|
+
background: var(--wp-admin-theme-color);
|
|
9
7
|
fill: white;
|
|
10
8
|
padding: 12px;
|
|
11
9
|
|
|
12
10
|
&--white {
|
|
13
11
|
background: white;
|
|
14
|
-
fill:
|
|
12
|
+
fill: var(--wp-admin-theme-color);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
&--simple {
|
|
18
16
|
background: none;
|
|
19
|
-
fill:
|
|
17
|
+
fill: var(--wp-admin-theme-color);
|
|
20
18
|
padding: 0;
|
|
21
19
|
}
|
|
22
20
|
|
package/dist/esm/notice/index.js
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Component, RawHTML } from '@wordpress/element';
|
|
9
9
|
import { Icon, bug, check, help, info } from '@wordpress/icons';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Internal dependencies.
|
|
@@ -57,7 +56,7 @@ class Notice extends Component {
|
|
|
57
56
|
className: "newspack-notice__content",
|
|
58
57
|
children: [rawHTML ? /*#__PURE__*/_jsx(RawHTML, {
|
|
59
58
|
children: noticeText
|
|
60
|
-
}) : noticeText,
|
|
59
|
+
}) : noticeText, children || null]
|
|
61
60
|
})]
|
|
62
61
|
});
|
|
63
62
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
@use "sass:color";
|
|
6
6
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
|
-
@use "../../../
|
|
7
|
+
@use "../../../colors/colors.module" as colors;
|
|
8
8
|
|
|
9
9
|
.newspack-notice {
|
|
10
10
|
align-items: center;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
justify-content: flex-start;
|
|
15
15
|
margin: 32px 0;
|
|
16
|
-
padding:
|
|
16
|
+
padding: 8px 12px;
|
|
17
17
|
|
|
18
18
|
> svg {
|
|
19
19
|
display: block;
|
|
@@ -23,24 +23,26 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
&__is-debug {
|
|
26
|
-
background: colors.$primary-
|
|
27
|
-
border-radius:
|
|
26
|
+
background: colors.$primary-600;
|
|
27
|
+
border-radius: 50%;
|
|
28
28
|
bottom: 16px;
|
|
29
29
|
box-shadow: 0 0 8px 4px rgba(black, 0.08);
|
|
30
30
|
color: white;
|
|
31
31
|
font-weight: bold;
|
|
32
32
|
margin: 0 16px;
|
|
33
|
+
padding: 6px;
|
|
33
34
|
position: fixed;
|
|
34
35
|
text-transform: uppercase;
|
|
35
36
|
z-index: 9997;
|
|
36
37
|
|
|
37
38
|
> svg {
|
|
38
39
|
fill: white;
|
|
40
|
+
margin: 0;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
&__is-error {
|
|
43
|
-
background: color.adjust(wp-colors.$alert-red, $lightness:
|
|
45
|
+
background: color.adjust(wp-colors.$alert-red, $lightness: 35%);
|
|
44
46
|
|
|
45
47
|
> svg {
|
|
46
48
|
fill: wp-colors.$alert-red;
|
|
@@ -49,7 +51,7 @@
|
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
&__is-handoff {
|
|
52
|
-
background: color.adjust(wp-colors.$alert-yellow, $lightness:
|
|
54
|
+
background: color.adjust(wp-colors.$alert-yellow, $lightness: 35%);
|
|
53
55
|
margin-top: 0;
|
|
54
56
|
position: sticky;
|
|
55
57
|
top: 46px;
|
|
@@ -64,12 +66,12 @@
|
|
|
64
66
|
background: colors.$primary-050;
|
|
65
67
|
|
|
66
68
|
> svg {
|
|
67
|
-
fill:
|
|
69
|
+
fill: var(--wp-admin-theme-color);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
&__is-success {
|
|
72
|
-
background: color.adjust(wp-colors.$alert-green, $lightness:
|
|
74
|
+
background: color.adjust(wp-colors.$alert-green, $lightness: 45%);
|
|
73
75
|
|
|
74
76
|
> svg {
|
|
75
77
|
fill: wp-colors.$alert-green;
|
|
@@ -77,7 +79,7 @@
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
&__is-warning {
|
|
80
|
-
background: color.adjust(wp-colors.$alert-yellow, $lightness:
|
|
82
|
+
background: color.adjust(wp-colors.$alert-yellow, $lightness: 35%);
|
|
81
83
|
|
|
82
84
|
> svg {
|
|
83
85
|
fill: wp-colors.$alert-yellow;
|
|
@@ -183,8 +183,8 @@ class PluginInstaller extends Component {
|
|
|
183
183
|
pluginInfo
|
|
184
184
|
} = this.state;
|
|
185
185
|
const {
|
|
186
|
-
|
|
187
|
-
} = window;
|
|
186
|
+
is_managed: isManaged
|
|
187
|
+
} = window.newspack_aux_data || {};
|
|
188
188
|
const slugs = Object.keys(pluginInfo);
|
|
189
189
|
|
|
190
190
|
// Store all plugin status info for installer button text value based on current status.
|
|
@@ -226,7 +226,7 @@ class PluginInstaller extends Component {
|
|
|
226
226
|
} else if (!installable) {
|
|
227
227
|
actionText = /*#__PURE__*/_jsxs("span", {
|
|
228
228
|
className: "newspack-plugin-installer__status",
|
|
229
|
-
children: [
|
|
229
|
+
children: [isManaged ? __('Contact Newspack support to install', 'newspack-plugin') : __('Plugin must be installed manually', 'newspack-plugin'), /*#__PURE__*/_jsx("span", {
|
|
230
230
|
className: "newspack-checkbox-icon"
|
|
231
231
|
})]
|
|
232
232
|
});
|
|
@@ -51,6 +51,7 @@ const getControlType = setting => {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
const SettingsSection = props => {
|
|
54
|
+
var _props$id;
|
|
54
55
|
const [saveDisabled, setSaveDisabled] = useState(true);
|
|
55
56
|
const {
|
|
56
57
|
error,
|
|
@@ -91,6 +92,7 @@ const SettingsSection = props => {
|
|
|
91
92
|
columns = 1;
|
|
92
93
|
}
|
|
93
94
|
return /*#__PURE__*/_jsx(ActionCard, {
|
|
95
|
+
id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : null,
|
|
94
96
|
isMedium: true,
|
|
95
97
|
disabled: disabled,
|
|
96
98
|
title: title,
|
|
@@ -180,7 +180,8 @@ class PluginSettings extends Component {
|
|
|
180
180
|
title,
|
|
181
181
|
description,
|
|
182
182
|
hasGreyHeader,
|
|
183
|
-
children
|
|
183
|
+
children,
|
|
184
|
+
titleLevel = 1
|
|
184
185
|
} = this.props;
|
|
185
186
|
const {
|
|
186
187
|
settings,
|
|
@@ -190,6 +191,7 @@ class PluginSettings extends Component {
|
|
|
190
191
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
191
192
|
children: [title && /*#__PURE__*/_jsx(SectionHeader, {
|
|
192
193
|
title: title,
|
|
194
|
+
heading: titleLevel,
|
|
193
195
|
description: description
|
|
194
196
|
}), error && /*#__PURE__*/_jsx(Notice, {
|
|
195
197
|
isError: true,
|
|
@@ -200,6 +202,7 @@ class PluginSettings extends Component {
|
|
|
200
202
|
}),
|
|
201
203
|
children: [Object.keys(settings).map(sectionKey => /*#__PURE__*/_jsx(SettingsSection, {
|
|
202
204
|
disabled: inFlight,
|
|
205
|
+
id: `plugin-settings-${sectionKey}`,
|
|
203
206
|
sectionKey: sectionKey,
|
|
204
207
|
title: this.getSectionTitle(sectionKey),
|
|
205
208
|
description: this.getSectionDescription(sectionKey),
|
|
@@ -97,6 +97,7 @@ class PluginToggle extends Component {
|
|
|
97
97
|
pluginInfo
|
|
98
98
|
} = this.state;
|
|
99
99
|
return this.prepareDataForRender(plugins, pluginInfo).map((plugin, index) => {
|
|
100
|
+
var _plugin$onClick;
|
|
100
101
|
const {
|
|
101
102
|
name,
|
|
102
103
|
description,
|
|
@@ -113,6 +114,7 @@ class PluginToggle extends Component {
|
|
|
113
114
|
description: description,
|
|
114
115
|
actionText: this.actionTextForPlugin(plugin),
|
|
115
116
|
handoff: handoff,
|
|
117
|
+
onClick: (_plugin$onClick = plugin.onClick) !== null && _plugin$onClick !== void 0 ? _plugin$onClick : null,
|
|
116
118
|
href: href,
|
|
117
119
|
toggle: true,
|
|
118
120
|
toggleChecked: this.isPluginInstalledAndActive(plugin),
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Popover
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../shared/scss/colors";
|
|
6
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
6
|
|
|
8
7
|
.newspack-popover {
|
|
@@ -16,7 +15,7 @@
|
|
|
16
15
|
padding: 6px 8px;
|
|
17
16
|
|
|
18
17
|
&:hover {
|
|
19
|
-
color:
|
|
18
|
+
color: var(--wp-admin-theme-color);
|
|
20
19
|
|
|
21
20
|
.components-menu-items__item-icon {
|
|
22
21
|
fill: currentcolor;
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
&:focus:not(:disabled) {
|
|
27
|
-
box-shadow: inset 0 0 0 2px
|
|
26
|
+
box-shadow: inset 0 0 0 2px var(--wp-admin-theme-color);
|
|
28
27
|
position: relative;
|
|
29
28
|
z-index: 1;
|
|
30
29
|
}
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
&:focus,
|
|
43
42
|
&:focus:enabled &:hover,
|
|
44
43
|
&:not(:disabled, [aria-disabled="true"], .is-default):hover {
|
|
45
|
-
color:
|
|
44
|
+
color: var(--wp-admin-theme-color);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
@@ -89,8 +88,8 @@
|
|
|
89
88
|
min-height: 36px;
|
|
90
89
|
|
|
91
90
|
&:focus ~ div.components-input-control__backdrop {
|
|
92
|
-
border-color:
|
|
93
|
-
box-shadow: inset 0 0 0 1px
|
|
91
|
+
border-color: var(--wp-admin-theme-color);
|
|
92
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Progress Bar
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../shared/scss/colors";
|
|
6
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
6
|
|
|
8
7
|
.newspack-progress-bar {
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
&__bar {
|
|
38
|
-
background-color:
|
|
37
|
+
background-color: var(--wp-admin-theme-color);
|
|
39
38
|
height: 8px;
|
|
40
39
|
transition: width 125ms ease-in-out;
|
|
41
40
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Radio Control
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../shared/scss/colors";
|
|
6
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
6
|
|
|
8
7
|
.newspack-radio-control {
|
|
@@ -24,7 +23,6 @@
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
// Options
|
|
27
|
-
|
|
28
26
|
.components-radio-control__option {
|
|
29
27
|
align-items: center;
|
|
30
28
|
display: flex;
|
|
@@ -40,7 +38,6 @@
|
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
// Radio
|
|
43
|
-
|
|
44
41
|
input[type="radio"] {
|
|
45
42
|
height: 24px;
|
|
46
43
|
width: 24px;
|
|
@@ -55,8 +52,8 @@
|
|
|
55
52
|
}
|
|
56
53
|
|
|
57
54
|
&:checked {
|
|
58
|
-
background-color:
|
|
59
|
-
border-color:
|
|
55
|
+
background-color: var(--wp-admin-theme-color);
|
|
56
|
+
border-color: var(--wp-admin-theme-color);
|
|
60
57
|
|
|
61
58
|
&::before {
|
|
62
59
|
border: none;
|
|
@@ -64,20 +61,18 @@
|
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
&:focus {
|
|
67
|
-
border-color:
|
|
68
|
-
box-shadow: 0 0 0 2px white, 0 0 0 3.5px
|
|
64
|
+
border-color: var(--wp-admin-theme-color);
|
|
65
|
+
box-shadow: 0 0 0 2px white, 0 0 0 3.5px var(--wp-admin-theme-color);
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
// Multiple Radio Controls
|
|
73
|
-
|
|
74
70
|
& + & {
|
|
75
71
|
margin-bottom: 32px;
|
|
76
72
|
margin-top: -16px;
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
// Multiple Controls
|
|
80
|
-
|
|
81
76
|
+ .newspack-select-control,
|
|
82
77
|
+ .newspack-text-control {
|
|
83
78
|
margin-bottom: 32px;
|
|
@@ -85,7 +80,6 @@
|
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
// Reset
|
|
88
|
-
|
|
89
83
|
.components-base-control__field,
|
|
90
84
|
.components-base-control__label,
|
|
91
85
|
.components-base-control__help {
|
|
@@ -17,6 +17,26 @@ import './style.scss';
|
|
|
17
17
|
* External dependencies
|
|
18
18
|
*/
|
|
19
19
|
import classnames from 'classnames';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Represents a section header component.
|
|
23
|
+
*
|
|
24
|
+
* @typedef {Object} SectionHeaderProps
|
|
25
|
+
* @property {boolean} [centered=false] - Indicates if the header is centered.
|
|
26
|
+
* @property {?string} [className=null] - Additional CSS class name.
|
|
27
|
+
* @property {string|Function|*} [description] - Description of the section.
|
|
28
|
+
* @property {number} [heading=2] - HTML heading level, e.g., 1 for h1, 2 for h2, etc.
|
|
29
|
+
* @property {boolean} [isWhite=false] - Indicates if the header should use a white theme.
|
|
30
|
+
* @property {boolean} [noMargin=false] - Indicates if the header should have no margin.
|
|
31
|
+
* @property {string} title - The title of the section.
|
|
32
|
+
* @property {?string} [id=null] - Optional ID for the header element.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Creates a section header.
|
|
37
|
+
*
|
|
38
|
+
* @param {SectionHeaderProps} props - The properties for the section header.
|
|
39
|
+
*/
|
|
20
40
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
41
|
const SectionHeader = ({
|
|
22
42
|
centered = false,
|
|
@@ -60,6 +80,8 @@ const SectionHeader = ({
|
|
|
60
80
|
children: description
|
|
61
81
|
}), typeof description === 'function' && /*#__PURE__*/_jsx("p", {
|
|
62
82
|
children: description()
|
|
83
|
+
}), description && typeof description !== 'string' && typeof description !== 'function' && /*#__PURE__*/_jsx("p", {
|
|
84
|
+
children: description
|
|
63
85
|
})]
|
|
64
86
|
})
|
|
65
87
|
});
|
|
@@ -18,6 +18,7 @@ const ButtonGroupControl = ({
|
|
|
18
18
|
buttonOptions,
|
|
19
19
|
buttonSmall,
|
|
20
20
|
className,
|
|
21
|
+
help,
|
|
21
22
|
hideLabelFromVision,
|
|
22
23
|
label,
|
|
23
24
|
onChange,
|
|
@@ -26,6 +27,7 @@ const ButtonGroupControl = ({
|
|
|
26
27
|
const id = hooks.useUniqueId('button-group');
|
|
27
28
|
return /*#__PURE__*/_jsx(BaseControl, {
|
|
28
29
|
label: label,
|
|
30
|
+
help: help,
|
|
29
31
|
hideLabelFromVision: hideLabelFromVision,
|
|
30
32
|
id: id.current,
|
|
31
33
|
className: classnames(className, 'components-select-control'),
|
|
@@ -11,8 +11,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
const SettingsCard = ({
|
|
12
12
|
children,
|
|
13
13
|
className,
|
|
14
|
-
columns,
|
|
15
|
-
gutter,
|
|
14
|
+
columns = 3,
|
|
15
|
+
gutter = 32,
|
|
16
16
|
noBorder,
|
|
17
17
|
rowGap,
|
|
18
18
|
...props
|
|
@@ -31,8 +31,4 @@ const SettingsCard = ({
|
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
SettingsCard.defaultProps = {
|
|
35
|
-
columns: 3,
|
|
36
|
-
gutter: 32
|
|
37
|
-
};
|
|
38
34
|
export default SettingsCard;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Icon, chevronUp, chevronDown, trash } from '@wordpress/icons';
|
|
5
|
-
import { Notice } from '@wordpress/components';
|
|
5
|
+
import { CheckboxControl, Notice } from '@wordpress/components';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -41,9 +41,9 @@ export default function SortableNewsletterListControl({
|
|
|
41
41
|
}
|
|
42
42
|
return /*#__PURE__*/_jsx(ActionCard, {
|
|
43
43
|
title: list.name,
|
|
44
|
-
description: () => /*#__PURE__*/
|
|
45
|
-
children:
|
|
46
|
-
|
|
44
|
+
description: () => /*#__PURE__*/_jsx(_Fragment, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(CheckboxControl, {
|
|
46
|
+
label: __('Checked by default', 'newspack-plugin'),
|
|
47
47
|
checked: selectedList.checked,
|
|
48
48
|
onChange: () => {
|
|
49
49
|
const index = selected.findIndex(({
|
|
@@ -53,16 +53,18 @@ export default function SortableNewsletterListControl({
|
|
|
53
53
|
newSelected[index].checked = !newSelected[index].checked;
|
|
54
54
|
onChange(newSelected);
|
|
55
55
|
}
|
|
56
|
-
})
|
|
56
|
+
})
|
|
57
57
|
}),
|
|
58
58
|
isSmall: true,
|
|
59
|
+
hasWhiteHeader: true,
|
|
59
60
|
actionText: /*#__PURE__*/_jsx(_Fragment, {
|
|
60
61
|
children: /*#__PURE__*/_jsx(Button, {
|
|
61
62
|
onClick: () => onChange(selected.filter(({
|
|
62
63
|
id
|
|
63
64
|
}) => id !== selectedList.id)),
|
|
64
65
|
label: __('Remove', 'newspack-plugin'),
|
|
65
|
-
icon: trash
|
|
66
|
+
icon: trash,
|
|
67
|
+
isDestructive: true
|
|
66
68
|
})
|
|
67
69
|
}),
|
|
68
70
|
children: selected.length > 1 && /*#__PURE__*/_jsxs("span", {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
.newspack__newsletter-list-control {
|
|
2
|
+
grid-column: span 3;
|
|
3
|
+
|
|
2
4
|
&__selected {
|
|
3
5
|
.newspack-card {
|
|
4
6
|
display: flex;
|
|
5
7
|
justify-content: center;
|
|
6
8
|
min-height: 40px;
|
|
7
9
|
flex-direction: row;
|
|
10
|
+
&:first-of-type {
|
|
11
|
+
margin-top: 0 !important;
|
|
12
|
+
}
|
|
8
13
|
.newspack-action-card__region {
|
|
9
14
|
align-items: center;
|
|
10
15
|
display: flex;
|
|
@@ -14,11 +19,16 @@
|
|
|
14
19
|
.newspack-action-card__region-top {
|
|
15
20
|
flex: 1;
|
|
16
21
|
order: 2;
|
|
22
|
+
|
|
23
|
+
.newspack-grid {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
.newspack-action-card__region-children {
|
|
19
|
-
padding: 12px;
|
|
28
|
+
padding: 12px !important;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
31
|
+
|
|
22
32
|
}
|
|
23
33
|
&__sort-handle {
|
|
24
34
|
display: flex;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@use "../../../shared/scss/colors";
|
|
2
1
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
3
2
|
|
|
4
3
|
.steps-list-item {
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
background: #fff;
|
|
36
35
|
border: 1px solid currentcolor;
|
|
37
36
|
border-radius: 100%;
|
|
38
|
-
color:
|
|
37
|
+
color: var(--wp-admin-theme-color);
|
|
39
38
|
display: flex;
|
|
40
39
|
height: 28px;
|
|
41
40
|
justify-content: center;
|
|
@@ -43,6 +43,7 @@ class StyleCard extends Component {
|
|
|
43
43
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
44
44
|
className: "newspack-style-card__image",
|
|
45
45
|
children: [imageType === 'html' ? /*#__PURE__*/_jsx("div", {
|
|
46
|
+
className: "newspack-style-card__image-html",
|
|
46
47
|
dangerouslySetInnerHTML: image
|
|
47
48
|
}) : /*#__PURE__*/_jsx("img", {
|
|
48
49
|
src: image,
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Style Card
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
@use "../../../shared/scss/colors";
|
|
6
5
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
7
6
|
|
|
8
7
|
.newspack-style-card {
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
text-align: center;
|
|
16
15
|
|
|
17
16
|
.newspack-style-card__is-active & {
|
|
18
|
-
color:
|
|
17
|
+
color: var(--wp-admin-theme-color);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -48,8 +47,8 @@
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
.newspack-style-card__is-active & {
|
|
51
|
-
border-color:
|
|
52
|
-
box-shadow: inset 0 0 0 1px
|
|
50
|
+
border-color: var(--wp-admin-theme-color);
|
|
51
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
|
|
53
52
|
|
|
54
53
|
img {
|
|
55
54
|
position: relative;
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
.newspack-style-card__is-active & {
|
|
91
|
-
box-shadow: inset 0 0 0 1px
|
|
90
|
+
box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color);
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
}
|
package/dist/esm/style.scss
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
@use "~@wordpress/base-styles/colors" as wp-colors;
|
|
2
|
+
@use "../../colors/colors.module" as colors;
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
// WP Admin
|
|
6
|
+
--wp-admin-theme-color: #{colors.$primary-600};
|
|
7
|
+
--wp-admin-theme-color--rgb: #{colors.$primary-600--rgb};
|
|
8
|
+
--wp-admin-theme-color-darker-10: #{colors.$primary-700};
|
|
9
|
+
--wp-admin-theme-color-darker-10--rgb: #{colors.$primary-700--rgb};
|
|
10
|
+
--wp-admin-theme-color-darker-20: #{colors.$primary-800};
|
|
11
|
+
--wp-admin-theme-color-darker-20--rgb: #{colors.$primary-800--rgb};
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
// Buttons Card
|
|
4
15
|
|
|
@@ -13,6 +24,10 @@
|
|
|
13
24
|
&:empty {
|
|
14
25
|
display: none;
|
|
15
26
|
}
|
|
27
|
+
|
|
28
|
+
+ .newspack-card {
|
|
29
|
+
margin-top: 64px;
|
|
30
|
+
}
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
// Checkboxes
|