newspack-components 3.0.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 -186
- 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 +6 -6
- package/dist/cjs/image-upload/index.test.js +2 -2
- package/dist/cjs/index.js +7 -21
- package/dist/cjs/modal/index.js +16 -18
- 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 +8 -9
- 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 +8 -11
- 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/index.js +1 -1
- 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 -188
- 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 +12 -2
- package/dist/esm/hooks/useObjectState.test.js +7 -7
- package/dist/esm/hooks/usePrompt.js +2 -2
- package/dist/esm/image-upload/index.test.js +2 -2
- package/dist/esm/index.js +1 -3
- package/dist/esm/modal/index.js +17 -19
- 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/index.test.js +7 -7
- package/dist/esm/progress-bar/style.scss +1 -2
- package/dist/esm/radio-control/style.scss +8 -11
- 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/index.js +1 -1
- 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 +14 -6
- package/dist/esm/wizard/store/utils.js +3 -1
- package/package.json +2 -2
- package/src/accordion/index.js +1 -3
- package/src/action-card/action-card.d.ts +40 -0
- package/src/action-card/index.js +284 -201
- 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 +11 -17
- 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 +8 -11
- 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
|
@@ -50,31 +50,31 @@ const TestComponent = () => {
|
|
|
50
50
|
describe('useObjectState', () => {
|
|
51
51
|
const getState = () => JSON.parse(_react2.screen.getByPlaceholderText('state').getAttribute('value'));
|
|
52
52
|
beforeEach(() => {
|
|
53
|
-
(0, _react2.render)(
|
|
53
|
+
(0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(TestComponent, {}));
|
|
54
54
|
});
|
|
55
55
|
it('updates arrays', () => {
|
|
56
56
|
expect(getState()).toStrictEqual(INIT_STATE);
|
|
57
|
-
_react2.screen.getByText('Remove widgets').click();
|
|
57
|
+
(0, _react2.act)(() => _react2.screen.getByText('Remove widgets').click());
|
|
58
58
|
expect(getState()).toMatchObject({
|
|
59
59
|
widgets: []
|
|
60
60
|
});
|
|
61
|
-
_react2.screen.getByText('Add widget').click();
|
|
61
|
+
(0, _react2.act)(() => _react2.screen.getByText('Add widget').click());
|
|
62
62
|
expect(getState()).toMatchObject({
|
|
63
63
|
widgets: [1]
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
it('updates a simple value', () => {
|
|
67
|
-
_react2.fireEvent.change(_react2.screen.getByPlaceholderText('name'), {
|
|
67
|
+
(0, _react2.act)(() => _react2.fireEvent.change(_react2.screen.getByPlaceholderText('name'), {
|
|
68
68
|
target: {
|
|
69
69
|
value: 'Ramon'
|
|
70
70
|
}
|
|
71
|
-
});
|
|
71
|
+
}));
|
|
72
72
|
expect(getState()).toMatchObject({
|
|
73
73
|
name: 'Ramon'
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
it('updates a nested object', () => {
|
|
77
|
-
_react2.screen.getByText('Nested update').click();
|
|
77
|
+
(0, _react2.act)(() => _react2.screen.getByText('Nested update').click());
|
|
78
78
|
expect(getState()).toMatchObject({
|
|
79
79
|
attributes: {
|
|
80
80
|
bar: 2,
|
|
@@ -16,7 +16,7 @@ describe('ImageUpload', () => {
|
|
|
16
16
|
it('should render an add image button', () => {
|
|
17
17
|
const {
|
|
18
18
|
getByText
|
|
19
|
-
} = (0, _react.render)(
|
|
19
|
+
} = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {}));
|
|
20
20
|
expect(getByText('Upload')).toBeInTheDocument();
|
|
21
21
|
});
|
|
22
22
|
it('should render replace and remove buttons if there is an image provided', () => {
|
|
@@ -27,7 +27,7 @@ describe('ImageUpload', () => {
|
|
|
27
27
|
const {
|
|
28
28
|
getByText,
|
|
29
29
|
getByTestId
|
|
30
|
-
} = (0, _react.render)(
|
|
30
|
+
} = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
31
31
|
image: image
|
|
32
32
|
}));
|
|
33
33
|
expect(getByText('Remove')).toBeInTheDocument();
|
package/dist/cjs/index.js
CHANGED
|
@@ -28,6 +28,12 @@ Object.defineProperty(exports, "AutocompleteWithSuggestions", {
|
|
|
28
28
|
return _autocompleteWithSuggestions.default;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
Object.defineProperty(exports, "BoxContrast", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _boxContrast.default;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
31
37
|
Object.defineProperty(exports, "Button", {
|
|
32
38
|
enumerable: true,
|
|
33
39
|
get: function () {
|
|
@@ -64,12 +70,6 @@ Object.defineProperty(exports, "CustomSelectControl", {
|
|
|
64
70
|
return _customSelectControl.default;
|
|
65
71
|
}
|
|
66
72
|
});
|
|
67
|
-
Object.defineProperty(exports, "DateRangePicker", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () {
|
|
70
|
-
return _dateRangePicker.default;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
73
|
Object.defineProperty(exports, "Footer", {
|
|
74
74
|
enumerable: true,
|
|
75
75
|
get: function () {
|
|
@@ -130,24 +130,12 @@ Object.defineProperty(exports, "NewspackIcon", {
|
|
|
130
130
|
return _newspackIcon.default;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
Object.defineProperty(exports, "NewspackLogo", {
|
|
134
|
-
enumerable: true,
|
|
135
|
-
get: function () {
|
|
136
|
-
return _newspackLogo.default;
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
133
|
Object.defineProperty(exports, "Notice", {
|
|
140
134
|
enumerable: true,
|
|
141
135
|
get: function () {
|
|
142
136
|
return _notice.default;
|
|
143
137
|
}
|
|
144
138
|
});
|
|
145
|
-
Object.defineProperty(exports, "PatronsLogo", {
|
|
146
|
-
enumerable: true,
|
|
147
|
-
get: function () {
|
|
148
|
-
return _patronsLogo.default;
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
139
|
Object.defineProperty(exports, "PluginInstaller", {
|
|
152
140
|
enumerable: true,
|
|
153
141
|
get: function () {
|
|
@@ -286,6 +274,7 @@ var _autocompleteTokenfield = _interopRequireDefault(require("./autocomplete-tok
|
|
|
286
274
|
var _autocompleteWithSuggestions = _interopRequireDefault(require("./autocomplete-with-suggestions"));
|
|
287
275
|
var _button = _interopRequireDefault(require("./button"));
|
|
288
276
|
var _buttonCard = _interopRequireDefault(require("./button-card"));
|
|
277
|
+
var _boxContrast = _interopRequireDefault(require("./box-contrast"));
|
|
289
278
|
var _card = _interopRequireDefault(require("./card"));
|
|
290
279
|
var _categoryAutocomplete = _interopRequireDefault(require("./category-autocomplete"));
|
|
291
280
|
var _colorPicker = _interopRequireDefault(require("./color-picker"));
|
|
@@ -300,9 +289,7 @@ var _globalNotices = _interopRequireDefault(require("./global-notices"));
|
|
|
300
289
|
var _grid = _interopRequireDefault(require("./grid"));
|
|
301
290
|
var _modal = _interopRequireDefault(require("./modal"));
|
|
302
291
|
var _newspackIcon = _interopRequireDefault(require("./newspack-icon"));
|
|
303
|
-
var _newspackLogo = _interopRequireDefault(require("./newspack-logo"));
|
|
304
292
|
var _notice = _interopRequireDefault(require("./notice"));
|
|
305
|
-
var _patronsLogo = _interopRequireDefault(require("./patrons-logo"));
|
|
306
293
|
var _pluginInstaller = _interopRequireDefault(require("./plugin-installer"));
|
|
307
294
|
var _pluginSettings = _interopRequireDefault(require("./plugin-settings"));
|
|
308
295
|
var _pluginToggle = _interopRequireDefault(require("./plugin-toggle"));
|
|
@@ -311,7 +298,6 @@ var _progressBar = _interopRequireDefault(require("./progress-bar"));
|
|
|
311
298
|
var _radioControl = _interopRequireDefault(require("./radio-control"));
|
|
312
299
|
var _sectionHeader = _interopRequireDefault(require("./section-header"));
|
|
313
300
|
var _selectControl = _interopRequireDefault(require("./select-control"));
|
|
314
|
-
var _dateRangePicker = _interopRequireDefault(require("./date-range-picker"));
|
|
315
301
|
var _settings = _interopRequireDefault(require("./settings"));
|
|
316
302
|
var _stepsList = _interopRequireDefault(require("./steps-list"));
|
|
317
303
|
var _stepsListItem = _interopRequireDefault(require("./steps-list-item"));
|
package/dist/cjs/modal/index.js
CHANGED
|
@@ -26,22 +26,20 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
26
26
|
* External dependencies.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
}
|
|
29
|
+
function Modal({
|
|
30
|
+
className,
|
|
31
|
+
isWide,
|
|
32
|
+
isNarrow,
|
|
33
|
+
hideTitle,
|
|
34
|
+
...otherProps
|
|
35
|
+
}, ref) {
|
|
36
|
+
const classes = (0, _classnames.default)('newspack-modal', isWide && 'newspack-modal--wide', isNarrow && 'newspack-modal--narrow', hideTitle && 'newspack-modal--hide-title',
|
|
37
|
+
// Note: also hides the X close button.
|
|
38
|
+
className);
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, {
|
|
40
|
+
className: classes,
|
|
41
|
+
...otherProps,
|
|
42
|
+
ref: ref
|
|
43
|
+
});
|
|
46
44
|
}
|
|
47
|
-
var _default = exports.default = Modal;
|
|
45
|
+
var _default = exports.default = (0, _element.forwardRef)(Modal);
|
|
@@ -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
|
}
|
|
@@ -42,12 +42,12 @@ class NewspackIcon extends _element.Component {
|
|
|
42
42
|
xmlns: "http://www.w3.org/2000/svg",
|
|
43
43
|
height: size,
|
|
44
44
|
width: size,
|
|
45
|
-
viewBox: "0 0
|
|
45
|
+
viewBox: "0 0 24 24",
|
|
46
46
|
className: classes,
|
|
47
47
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Path, {
|
|
48
48
|
fillRule: "evenodd",
|
|
49
49
|
clipRule: "evenodd",
|
|
50
|
-
d: "
|
|
50
|
+
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"
|
|
51
51
|
})
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -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/cjs/notice/index.js
CHANGED
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _element = require("@wordpress/element");
|
|
9
9
|
var _icons = require("@wordpress/icons");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
10
|
require("./style.scss");
|
|
12
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -65,7 +64,7 @@ class Notice extends _element.Component {
|
|
|
65
64
|
className: "newspack-notice__content",
|
|
66
65
|
children: [rawHTML ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.RawHTML, {
|
|
67
66
|
children: noticeText
|
|
68
|
-
}) : noticeText,
|
|
67
|
+
}) : noticeText, children || null]
|
|
69
68
|
})]
|
|
70
69
|
});
|
|
71
70
|
}
|
|
@@ -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;
|
|
@@ -191,8 +191,8 @@ class PluginInstaller extends _element.Component {
|
|
|
191
191
|
pluginInfo
|
|
192
192
|
} = this.state;
|
|
193
193
|
const {
|
|
194
|
-
|
|
195
|
-
} = window;
|
|
194
|
+
is_managed: isManaged
|
|
195
|
+
} = window.newspack_aux_data || {};
|
|
196
196
|
const slugs = Object.keys(pluginInfo);
|
|
197
197
|
|
|
198
198
|
// Store all plugin status info for installer button text value based on current status.
|
|
@@ -234,7 +234,7 @@ class PluginInstaller extends _element.Component {
|
|
|
234
234
|
} else if (!installable) {
|
|
235
235
|
actionText = /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
236
236
|
className: "newspack-plugin-installer__status",
|
|
237
|
-
children: [
|
|
237
|
+
children: [isManaged ? (0, _i18n.__)('Contact Newspack support to install', 'newspack-plugin') : (0, _i18n.__)('Plugin must be installed manually', 'newspack-plugin'), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
238
238
|
className: "newspack-checkbox-icon"
|
|
239
239
|
})]
|
|
240
240
|
});
|
|
@@ -58,6 +58,7 @@ const getControlType = setting => {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
const SettingsSection = props => {
|
|
61
|
+
var _props$id;
|
|
61
62
|
const [saveDisabled, setSaveDisabled] = (0, _element.useState)(true);
|
|
62
63
|
const {
|
|
63
64
|
error,
|
|
@@ -98,6 +99,7 @@ const SettingsSection = props => {
|
|
|
98
99
|
columns = 1;
|
|
99
100
|
}
|
|
100
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionCard, {
|
|
102
|
+
id: (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : null,
|
|
101
103
|
isMedium: true,
|
|
102
104
|
disabled: disabled,
|
|
103
105
|
title: title,
|
|
@@ -188,7 +188,8 @@ class PluginSettings extends _element.Component {
|
|
|
188
188
|
title,
|
|
189
189
|
description,
|
|
190
190
|
hasGreyHeader,
|
|
191
|
-
children
|
|
191
|
+
children,
|
|
192
|
+
titleLevel = 1
|
|
192
193
|
} = this.props;
|
|
193
194
|
const {
|
|
194
195
|
settings,
|
|
@@ -198,6 +199,7 @@ class PluginSettings extends _element.Component {
|
|
|
198
199
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
199
200
|
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.SectionHeader, {
|
|
200
201
|
title: title,
|
|
202
|
+
heading: titleLevel,
|
|
201
203
|
description: description
|
|
202
204
|
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Notice, {
|
|
203
205
|
isError: true,
|
|
@@ -208,6 +210,7 @@ class PluginSettings extends _element.Component {
|
|
|
208
210
|
}),
|
|
209
211
|
children: [Object.keys(settings).map(sectionKey => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SettingsSection.default, {
|
|
210
212
|
disabled: inFlight,
|
|
213
|
+
id: `plugin-settings-${sectionKey}`,
|
|
211
214
|
sectionKey: sectionKey,
|
|
212
215
|
title: this.getSectionTitle(sectionKey),
|
|
213
216
|
description: this.getSectionDescription(sectionKey),
|
|
@@ -103,6 +103,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
103
103
|
pluginInfo
|
|
104
104
|
} = this.state;
|
|
105
105
|
return this.prepareDataForRender(plugins, pluginInfo).map((plugin, index) => {
|
|
106
|
+
var _plugin$onClick;
|
|
106
107
|
const {
|
|
107
108
|
name,
|
|
108
109
|
description,
|
|
@@ -119,6 +120,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
119
120
|
description: description,
|
|
120
121
|
actionText: this.actionTextForPlugin(plugin),
|
|
121
122
|
handoff: handoff,
|
|
123
|
+
onClick: (_plugin$onClick = plugin.onClick) !== null && _plugin$onClick !== void 0 ? _plugin$onClick : null,
|
|
122
124
|
href: href,
|
|
123
125
|
toggle: true,
|
|
124
126
|
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
|
|
|
@@ -5,13 +5,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
5
5
|
var _react2 = require("@testing-library/react");
|
|
6
6
|
var _ = _interopRequireDefault(require("./"));
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
function
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
9
|
describe('ProgressBar', () => {
|
|
11
10
|
it('should render a progress indicator', () => {
|
|
12
11
|
const {
|
|
13
12
|
getByTestId
|
|
14
|
-
} = (0, _react2.render)(
|
|
13
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
15
14
|
completed: "1",
|
|
16
15
|
total: "2"
|
|
17
16
|
}));
|
|
@@ -22,7 +21,7 @@ describe('ProgressBar', () => {
|
|
|
22
21
|
const label = 'test label';
|
|
23
22
|
const {
|
|
24
23
|
getByText
|
|
25
|
-
} = (0, _react2.render)(
|
|
24
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
26
25
|
completed: "1",
|
|
27
26
|
total: "2",
|
|
28
27
|
label: label
|
|
@@ -32,7 +31,7 @@ describe('ProgressBar', () => {
|
|
|
32
31
|
it('should render progress as a fraction', () => {
|
|
33
32
|
const {
|
|
34
33
|
getByText
|
|
35
|
-
} = (0, _react2.render)(
|
|
34
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
36
35
|
completed: "1",
|
|
37
36
|
total: "2",
|
|
38
37
|
displayFraction: true
|
|
@@ -43,7 +42,7 @@ describe('ProgressBar', () => {
|
|
|
43
42
|
const label = 'test label';
|
|
44
43
|
const {
|
|
45
44
|
getByText
|
|
46
|
-
} = (0, _react2.render)(
|
|
45
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
47
46
|
completed: "1",
|
|
48
47
|
total: "2",
|
|
49
48
|
label: label,
|
|
@@ -78,7 +77,7 @@ describe('ProgressBar', () => {
|
|
|
78
77
|
it(`with expected progress of ${expectedWidth}`, () => {
|
|
79
78
|
const {
|
|
80
79
|
getByTestId
|
|
81
|
-
} = (0, _react2.render)(
|
|
80
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _react.createElement)(_.default, {
|
|
82
81
|
...props,
|
|
83
82
|
key: expectedWidth
|
|
84
83
|
}));
|
|
@@ -90,7 +89,7 @@ describe('ProgressBar', () => {
|
|
|
90
89
|
const {
|
|
91
90
|
getByText,
|
|
92
91
|
getByTestId
|
|
93
|
-
} = (0, _react2.render)(
|
|
92
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
94
93
|
completed: "cats",
|
|
95
94
|
total: "dogs",
|
|
96
95
|
displayFraction: true
|
|
@@ -102,7 +101,7 @@ describe('ProgressBar', () => {
|
|
|
102
101
|
const {
|
|
103
102
|
getByText,
|
|
104
103
|
getByTestId
|
|
105
|
-
} = (0, _react2.render)(
|
|
104
|
+
} = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
106
105
|
completed: "3",
|
|
107
106
|
total: "-1",
|
|
108
107
|
displayFraction: true
|
|
@@ -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
|
}
|
|
@@ -5,8 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var ReactRouterDOM = _interopRequireWildcard(require("react-router-dom"));
|
|
8
|
-
function
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
10
9
|
/**
|
|
11
10
|
* A proxy for react-router-dom.
|
|
12
11
|
* Ensures that both components and the plugin use the same instance of
|
|
@@ -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,20 +38,22 @@
|
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
// Radio
|
|
43
|
-
|
|
44
41
|
input[type="radio"] {
|
|
45
42
|
height: 24px;
|
|
46
|
-
margin-right: 8px;
|
|
47
43
|
width: 24px;
|
|
44
|
+
max-height: 24px;
|
|
45
|
+
max-width: 24px;
|
|
48
46
|
|
|
49
47
|
@media screen and ( min-width: 782px ) {
|
|
50
48
|
height: 20px;
|
|
51
49
|
width: 20px;
|
|
50
|
+
max-height: 20px;
|
|
51
|
+
max-width: 20px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
&:checked {
|
|
55
|
-
background-color:
|
|
56
|
-
border-color:
|
|
55
|
+
background-color: var(--wp-admin-theme-color);
|
|
56
|
+
border-color: var(--wp-admin-theme-color);
|
|
57
57
|
|
|
58
58
|
&::before {
|
|
59
59
|
border: none;
|
|
@@ -61,20 +61,18 @@
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
&:focus {
|
|
64
|
-
border-color:
|
|
65
|
-
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);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Multiple Radio Controls
|
|
70
|
-
|
|
71
70
|
& + & {
|
|
72
71
|
margin-bottom: 32px;
|
|
73
72
|
margin-top: -16px;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
75
|
// Multiple Controls
|
|
77
|
-
|
|
78
76
|
+ .newspack-select-control,
|
|
79
77
|
+ .newspack-text-control {
|
|
80
78
|
margin-bottom: 32px;
|
|
@@ -82,7 +80,6 @@
|
|
|
82
80
|
}
|
|
83
81
|
|
|
84
82
|
// Reset
|
|
85
|
-
|
|
86
83
|
.components-base-control__field,
|
|
87
84
|
.components-base-control__label,
|
|
88
85
|
.components-base-control__help {
|