newspack-components 2.2.0 → 3.0.0-alpha.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/dist/cjs/action-card/index.js +3 -4
- package/dist/cjs/autocomplete-tokenfield/index.js +52 -15
- package/dist/cjs/autocomplete-tokenfield/style.scss +11 -5
- package/dist/cjs/autocomplete-with-suggestions/index.js +45 -57
- package/dist/cjs/autocomplete-with-suggestions/style.scss +1 -9
- package/dist/cjs/button/index.js +8 -9
- package/dist/cjs/button-card/index.js +1 -2
- package/dist/cjs/card/index.js +1 -2
- package/dist/cjs/category-autocomplete/index.js +4 -8
- package/dist/cjs/color-picker/index.js +7 -9
- package/dist/cjs/consts.js +2 -7
- package/dist/cjs/custom-select-control/index.js +1 -2
- package/dist/cjs/footer/index.js +24 -29
- package/dist/cjs/form-token-field/index.js +1 -2
- package/dist/cjs/global-notices/index.js +1 -2
- package/dist/cjs/grid/index.js +14 -31
- package/dist/cjs/handoff/index.js +7 -8
- package/dist/cjs/hooks/index.js +2 -3
- package/dist/cjs/hooks/useObjectState.js +1 -2
- package/dist/cjs/hooks/useOnClickOutside.js +1 -2
- package/dist/cjs/hooks/usePrompt.js +1 -4
- package/dist/cjs/image-upload/index.js +5 -6
- package/dist/cjs/index.js +0 -14
- package/dist/cjs/info-button/index.js +1 -2
- package/dist/cjs/modal/index.js +1 -2
- package/dist/cjs/newspack-icon/index.js +1 -2
- package/dist/cjs/newspack-logo/index.js +1 -2
- package/dist/cjs/notice/index.js +2 -3
- package/dist/cjs/patrons-logo/index.js +4 -5
- package/dist/cjs/plugin-installer/index.js +9 -13
- package/dist/cjs/plugin-settings/SettingsSection.js +2 -4
- package/dist/cjs/plugin-settings/index.js +2 -3
- package/dist/cjs/plugin-toggle/index.js +16 -20
- package/dist/cjs/popover/index.js +1 -2
- package/dist/cjs/position-control/index.js +22 -23
- package/dist/cjs/progress-bar/index.js +1 -2
- package/dist/cjs/progress-bar/index.test.js +4 -5
- package/dist/cjs/proxied-imports/router.js +1 -2
- package/dist/cjs/radio-control/index.js +1 -2
- package/dist/cjs/section-header/index.js +13 -14
- package/dist/cjs/section-header/style.scss +4 -0
- package/dist/cjs/select-control/ButtonGroupControl.js +10 -12
- package/dist/cjs/select-control/GroupedSelectControl.js +21 -25
- package/dist/cjs/select-control/index.js +1 -2
- package/dist/cjs/settings/MinMaxSetting.js +17 -15
- package/dist/cjs/settings/SettingsCard.js +10 -12
- package/dist/cjs/settings/SettingsSection.js +20 -24
- package/dist/cjs/settings/index.js +2 -3
- package/dist/cjs/settings/style.scss +14 -1
- package/dist/cjs/sortable-newsletter-list-control/index.js +134 -0
- package/dist/cjs/sortable-newsletter-list-control/style.scss +45 -0
- package/dist/cjs/steps-list/index.js +1 -2
- package/dist/cjs/steps-list-item/index.js +1 -2
- package/dist/cjs/style-card/index.js +6 -7
- package/dist/cjs/style.scss +13 -1
- package/dist/cjs/tabbed-navigation/index.js +11 -14
- package/dist/cjs/text-control/index.js +32 -42
- package/dist/cjs/utils/index.js +15 -19
- package/dist/cjs/waiting/index.js +1 -2
- package/dist/cjs/web-preview/index.js +7 -8
- package/dist/cjs/with-wizard/index.js +6 -7
- package/dist/cjs/with-wizard-screen/index.js +20 -24
- package/dist/cjs/wizard/components/WizardError.js +7 -9
- package/dist/cjs/wizard/index.js +16 -21
- package/dist/cjs/wizard/store/index.js +36 -37
- package/dist/cjs/wizard/store/utils.js +1 -4
- package/dist/esm/action-card/index.js +3 -4
- package/dist/esm/autocomplete-tokenfield/index.js +52 -15
- package/dist/esm/autocomplete-tokenfield/style.scss +11 -5
- package/dist/esm/autocomplete-with-suggestions/index.js +46 -59
- package/dist/esm/autocomplete-with-suggestions/style.scss +1 -9
- package/dist/esm/button/index.js +7 -7
- package/dist/esm/button-card/index.js +1 -2
- package/dist/esm/category-autocomplete/index.js +4 -8
- package/dist/esm/color-picker/index.js +7 -9
- package/dist/esm/consts.js +0 -2
- package/dist/esm/footer/index.js +24 -29
- package/dist/esm/form-token-field/index.js +1 -2
- package/dist/esm/grid/index.js +13 -29
- package/dist/esm/handoff/index.js +7 -8
- package/dist/esm/hooks/useObjectState.js +1 -2
- package/dist/esm/hooks/useObjectState.test.js +1 -2
- package/dist/esm/hooks/usePrompt.js +1 -4
- package/dist/esm/image-upload/index.js +5 -7
- package/dist/esm/index.js +0 -2
- package/dist/esm/notice/index.js +2 -3
- package/dist/esm/patrons-logo/index.js +4 -5
- package/dist/esm/plugin-installer/index.js +9 -14
- package/dist/esm/plugin-settings/SettingsSection.js +2 -4
- package/dist/esm/plugin-settings/index.js +2 -3
- package/dist/esm/plugin-toggle/index.js +16 -20
- package/dist/esm/position-control/index.js +23 -25
- package/dist/esm/progress-bar/index.js +1 -2
- package/dist/esm/progress-bar/index.test.js +4 -5
- package/dist/esm/section-header/index.js +13 -14
- package/dist/esm/section-header/style.scss +4 -0
- package/dist/esm/select-control/ButtonGroupControl.js +9 -10
- package/dist/esm/select-control/GroupedSelectControl.js +22 -27
- package/dist/esm/settings/MinMaxSetting.js +17 -16
- package/dist/esm/settings/SettingsCard.js +9 -10
- package/dist/esm/settings/SettingsSection.js +20 -24
- package/dist/esm/settings/style.scss +14 -1
- package/dist/esm/sortable-newsletter-list-control/index.js +128 -0
- package/dist/esm/sortable-newsletter-list-control/style.scss +45 -0
- package/dist/esm/steps-list-item/index.js +1 -2
- package/dist/esm/style-card/index.js +6 -7
- package/dist/esm/style.scss +13 -1
- package/dist/esm/tabbed-navigation/index.js +11 -14
- package/dist/esm/text-control/index.js +32 -41
- package/dist/esm/utils/index.js +13 -16
- package/dist/esm/web-preview/index.js +7 -8
- package/dist/esm/with-wizard/index.js +7 -9
- package/dist/esm/with-wizard-screen/index.js +21 -27
- package/dist/esm/wizard/components/WizardError.js +7 -9
- package/dist/esm/wizard/index.js +16 -22
- package/dist/esm/wizard/store/index.js +35 -35
- package/dist/esm/wizard/store/utils.js +1 -4
- package/package.json +7 -8
- package/shared/js/button-props.js +3 -1
- package/shared/scss/_colors.scss +15 -0
- package/shared/scss/_mixins.scss +12 -0
- package/src/autocomplete-tokenfield/index.js +48 -15
- package/src/autocomplete-tokenfield/style.scss +11 -5
- package/src/autocomplete-with-suggestions/index.js +17 -22
- package/src/autocomplete-with-suggestions/style.scss +1 -9
- package/src/button/{index.js → index.tsx} +12 -5
- package/src/consts.js +0 -2
- package/src/footer/index.js +7 -7
- package/src/grid/index.tsx +34 -0
- package/src/handoff/index.js +7 -6
- package/src/hooks/{index.js → index.ts} +1 -1
- package/src/hooks/{usePrompt.js → usePrompt.ts} +4 -8
- package/src/image-upload/index.js +4 -4
- package/src/index.js +0 -2
- package/src/notice/index.js +1 -1
- package/src/patrons-logo/index.js +4 -1
- package/src/plugin-installer/index.js +7 -7
- package/src/plugin-settings/index.js +1 -1
- package/src/plugin-toggle/index.js +7 -5
- package/src/position-control/index.js +13 -13
- package/src/section-header/index.js +3 -3
- package/src/section-header/style.scss +4 -0
- package/src/select-control/GroupedSelectControl.js +1 -1
- package/src/settings/MinMaxSetting.js +8 -6
- package/src/settings/style.scss +14 -1
- package/src/sortable-newsletter-list-control/index.js +137 -0
- package/src/sortable-newsletter-list-control/style.scss +45 -0
- package/src/style-card/index.js +11 -5
- package/src/style.scss +13 -1
- package/src/tabbed-navigation/index.js +1 -1
- package/src/text-control/index.tsx +65 -0
- package/src/web-preview/index.js +6 -6
- package/src/with-wizard/index.js +4 -4
- package/src/with-wizard-screen/index.js +1 -1
- package/src/wizard/components/WizardError.js +1 -1
- package/src/wizard/index.js +3 -3
- package/src/wizard/store/index.js +9 -2
- package/dist/cjs/accordion/index.js +0 -46
- package/dist/cjs/accordion/style.scss +0 -27
- package/dist/cjs/button-group/index.js +0 -57
- package/dist/cjs/button-group/style.scss +0 -73
- package/dist/cjs/checkbox-control/index.js +0 -63
- package/dist/cjs/checkbox-control/style.scss +0 -78
- package/dist/cjs/date-range-picker/index.js +0 -41
- package/dist/cjs/date-range-picker/style.scss +0 -148
- package/dist/cjs/preview-box/index.js +0 -36
- package/dist/cjs/preview-box/style.scss +0 -18
- package/dist/cjs/textarea-control/index.js +0 -54
- package/dist/cjs/textarea-control/style.scss +0 -76
- package/dist/cjs/toggle-control/index.js +0 -58
- package/dist/cjs/toggle-control/style.scss +0 -74
- package/dist/cjs/toggle-group/index.js +0 -71
- package/dist/cjs/toggle-group/style.scss +0 -28
- package/dist/cjs/wizard/style.scss +0 -148
- package/dist/esm/accordion/index.js +0 -38
- package/dist/esm/accordion/style.scss +0 -27
- package/dist/esm/button-group/index.js +0 -43
- package/dist/esm/button-group/style.scss +0 -73
- package/dist/esm/checkbox-control/index.js +0 -49
- package/dist/esm/checkbox-control/style.scss +0 -78
- package/dist/esm/date-range-picker/index.js +0 -32
- package/dist/esm/date-range-picker/style.scss +0 -148
- package/dist/esm/preview-box/index.js +0 -30
- package/dist/esm/preview-box/style.scss +0 -18
- package/dist/esm/textarea-control/index.js +0 -40
- package/dist/esm/textarea-control/style.scss +0 -76
- package/dist/esm/toggle-control/index.js +0 -44
- package/dist/esm/toggle-control/style.scss +0 -74
- package/dist/esm/toggle-group/index.js +0 -58
- package/dist/esm/toggle-group/style.scss +0 -28
- package/dist/esm/wizard/style.scss +0 -148
- package/src/accordion/index.js +0 -32
- package/src/accordion/style.scss +0 -27
- package/src/date-range-picker/index.js +0 -31
- package/src/date-range-picker/style.scss +0 -148
- package/src/grid/index.js +0 -44
- package/src/text-control/index.js +0 -56
package/dist/cjs/grid/index.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
8
|
require("./style.scss");
|
|
10
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
10
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -13,10 +12,6 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
13
12
|
* Grid
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
15
|
/**
|
|
21
16
|
* Internal dependencies
|
|
22
17
|
*/
|
|
@@ -25,30 +20,18 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
25
20
|
* External dependencies
|
|
26
21
|
*/
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const classes = (0, _classnames.default)('newspack-grid', noMargin && 'newspack-grid--no-margin', columns && 'newspack-grid__columns-' + columns, gutter && 'newspack-grid__gutter-' + gutter, rowGap && 'newspack-grid__row-gap-' + rowGap, className);
|
|
42
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
43
|
-
className: classes,
|
|
44
|
-
...otherProps
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
Grid.defaultProps = {
|
|
49
|
-
columns: 2,
|
|
50
|
-
gutter: 32,
|
|
51
|
-
rowGap: null
|
|
23
|
+
const Grid = ({
|
|
24
|
+
className = '',
|
|
25
|
+
columns = 2,
|
|
26
|
+
gutter = 32,
|
|
27
|
+
noMargin = false,
|
|
28
|
+
rowGap = 0,
|
|
29
|
+
...otherProps
|
|
30
|
+
}) => {
|
|
31
|
+
const classes = (0, _classnames.default)('newspack-grid', noMargin && 'newspack-grid--no-margin', columns && 'newspack-grid__columns-' + columns, gutter && 'newspack-grid__gutter-' + gutter, rowGap && 'newspack-grid__row-gap-' + rowGap, className);
|
|
32
|
+
return (0, _jsxRuntime.jsx)("div", {
|
|
33
|
+
className: classes,
|
|
34
|
+
...otherProps
|
|
35
|
+
});
|
|
52
36
|
};
|
|
53
|
-
var _default = Grid;
|
|
54
|
-
exports.default = _default;
|
|
37
|
+
var _default = exports.default = Grid;
|
|
@@ -57,10 +57,10 @@ class Handoff extends _element.Component {
|
|
|
57
57
|
(0, _defineProperty2.default)(this, "textForPlugin", pluginInfo => {
|
|
58
58
|
const defaults = {
|
|
59
59
|
modalBody: null,
|
|
60
|
-
modalTitle: pluginInfo.Name && `${__('Manage', 'newspack')} ${pluginInfo.Name}`,
|
|
61
|
-
primaryButton: pluginInfo.Name && `${__('Manage', 'newspack')} ${pluginInfo.Name}`,
|
|
62
|
-
primaryModalButton: __('Manage', 'newspack'),
|
|
63
|
-
dismissModalButton: __('Dismiss', 'newspack')
|
|
60
|
+
modalTitle: pluginInfo.Name && `${__('Manage', 'newspack-plugin')} ${pluginInfo.Name}`,
|
|
61
|
+
primaryButton: pluginInfo.Name && `${__('Manage', 'newspack-plugin')} ${pluginInfo.Name}`,
|
|
62
|
+
primaryModalButton: __('Manage', 'newspack-plugin'),
|
|
63
|
+
dismissModalButton: __('Dismiss', 'newspack-plugin')
|
|
64
64
|
};
|
|
65
65
|
return (0, _assign.default)(defaults, this.props);
|
|
66
66
|
});
|
|
@@ -137,7 +137,7 @@ class Handoff extends _element.Component {
|
|
|
137
137
|
variant: "secondary",
|
|
138
138
|
disabled: true,
|
|
139
139
|
...otherProps,
|
|
140
|
-
children: Name + __(' not installed', 'newspack')
|
|
140
|
+
children: Name + __(' not installed', 'newspack-plugin')
|
|
141
141
|
}), !Name && (0, _jsxRuntime.jsx)(_.Button, {
|
|
142
142
|
className: classes,
|
|
143
143
|
isSecondary: !otherProps.isPrimary && !otherProps.isTertiary && !otherProps.isLink,
|
|
@@ -145,7 +145,7 @@ class Handoff extends _element.Component {
|
|
|
145
145
|
children: (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
146
146
|
children: [!compact && (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
147
147
|
isLeft: true
|
|
148
|
-
}), __('Retrieving Plugin Info', 'newspack')]
|
|
148
|
+
}), __('Retrieving Plugin Info', 'newspack-plugin')]
|
|
149
149
|
})
|
|
150
150
|
}), showModal && (0, _jsxRuntime.jsxs)(_.Modal, {
|
|
151
151
|
title: modalTitle,
|
|
@@ -177,5 +177,4 @@ class Handoff extends _element.Component {
|
|
|
177
177
|
Handoff.defaultProps = {
|
|
178
178
|
onReady: () => {}
|
|
179
179
|
};
|
|
180
|
-
var _default = Handoff;
|
|
181
|
-
exports.default = _default;
|
|
180
|
+
var _default = exports.default = Handoff;
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -17,10 +17,9 @@ const useUniqueId = prefix => {
|
|
|
17
17
|
const id = (0, _element.useRef)(`${prefix}-${Math.round(Math.random() * 99999)}`);
|
|
18
18
|
return id.current;
|
|
19
19
|
};
|
|
20
|
-
var _default = {
|
|
20
|
+
var _default = exports.default = {
|
|
21
21
|
usePrompt: _usePrompt.default,
|
|
22
22
|
useObjectState: _useObjectState.default,
|
|
23
23
|
useOnClickOutside: _useOnClickOutside.default,
|
|
24
24
|
useUniqueId
|
|
25
|
-
};
|
|
26
|
-
exports.default = _default;
|
|
25
|
+
};
|
|
@@ -23,8 +23,7 @@ const mergeCustomizer = (objValue, srcValue) => {
|
|
|
23
23
|
* A useState for an object.
|
|
24
24
|
* Nested objects will be nested, but arrays replaced.
|
|
25
25
|
*/
|
|
26
|
-
var _default =
|
|
27
|
-
let initial = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
|
+
var _default = (initial = {}) => {
|
|
28
27
|
const [stateObject, setStateObject] = (0, _element.useState)(initial);
|
|
29
28
|
const runUpdate = update => setStateObject(_stateObject => (0, _mergeWith.default)({}, _stateObject, update, mergeCustomizer));
|
|
30
29
|
const updateStateObject = keyOrUpdate => {
|
|
@@ -30,9 +30,6 @@ var _default = (when, message) => {
|
|
|
30
30
|
if (typeof event === 'undefined') {
|
|
31
31
|
event = window.event;
|
|
32
32
|
}
|
|
33
|
-
if (event) {
|
|
34
|
-
event.returnValue = message;
|
|
35
|
-
}
|
|
36
33
|
return message;
|
|
37
34
|
};
|
|
38
35
|
(0, _element.useEffect)(() => {
|
|
@@ -47,6 +44,6 @@ var _default = (when, message) => {
|
|
|
47
44
|
window.removeEventListener('beforeunload', onWindowOrTabClose);
|
|
48
45
|
};
|
|
49
46
|
}, [message, when]);
|
|
50
|
-
return self.current;
|
|
47
|
+
return self.current || (() => {});
|
|
51
48
|
};
|
|
52
49
|
exports.default = _default;
|
|
@@ -105,14 +105,14 @@ class ImageUpload extends _element.Component {
|
|
|
105
105
|
children: [(0, _jsxRuntime.jsx)("img", {
|
|
106
106
|
"data-testid": "image-upload",
|
|
107
107
|
src: image.url,
|
|
108
|
-
alt: __('Image preview', 'newspack')
|
|
108
|
+
alt: __('Image preview', 'newspack-plugin')
|
|
109
109
|
}), (0, _jsxRuntime.jsxs)("div", {
|
|
110
110
|
className: "newspack-image-upload__controls",
|
|
111
111
|
children: [(0, _jsxRuntime.jsx)(_.Button, {
|
|
112
112
|
disabled: disabled,
|
|
113
113
|
onClick: this.openModal,
|
|
114
114
|
isLink: true,
|
|
115
|
-
children: __('Replace', 'newspack')
|
|
115
|
+
children: __('Replace', 'newspack-plugin')
|
|
116
116
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
117
117
|
className: "sep"
|
|
118
118
|
}), (0, _jsxRuntime.jsx)(_.Button, {
|
|
@@ -120,14 +120,14 @@ class ImageUpload extends _element.Component {
|
|
|
120
120
|
onClick: () => onChange(null),
|
|
121
121
|
isLink: true,
|
|
122
122
|
isDestructive: true,
|
|
123
|
-
children: __('Remove', 'newspack')
|
|
123
|
+
children: __('Remove', 'newspack-plugin')
|
|
124
124
|
})]
|
|
125
125
|
})]
|
|
126
126
|
}) : (0, _jsxRuntime.jsx)(_.Button, {
|
|
127
127
|
disabled: disabled,
|
|
128
128
|
onClick: this.openModal,
|
|
129
129
|
isLink: true,
|
|
130
|
-
children: buttonLabel ? buttonLabel : __('Upload', 'newspack')
|
|
130
|
+
children: buttonLabel ? buttonLabel : __('Upload', 'newspack-plugin')
|
|
131
131
|
})
|
|
132
132
|
}), help && (0, _jsxRuntime.jsx)("p", {
|
|
133
133
|
className: "newspack-image-upload__help",
|
|
@@ -140,5 +140,4 @@ class ImageUpload extends _element.Component {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
var _default = ImageUpload;
|
|
144
|
-
exports.default = _default;
|
|
143
|
+
var _default = exports.default = ImageUpload;
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,12 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
Object.defineProperty(exports, "Accordion", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return _accordion.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
7
|
Object.defineProperty(exports, "ActionCard", {
|
|
14
8
|
enumerable: true,
|
|
15
9
|
get: function () {
|
|
@@ -64,12 +58,6 @@ Object.defineProperty(exports, "CustomSelectControl", {
|
|
|
64
58
|
return _customSelectControl.default;
|
|
65
59
|
}
|
|
66
60
|
});
|
|
67
|
-
Object.defineProperty(exports, "DateRangePicker", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () {
|
|
70
|
-
return _dateRangePicker.default;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
61
|
Object.defineProperty(exports, "Footer", {
|
|
74
62
|
enumerable: true,
|
|
75
63
|
get: function () {
|
|
@@ -280,7 +268,6 @@ Object.defineProperty(exports, "withWizardScreen", {
|
|
|
280
268
|
return _withWizardScreen.default;
|
|
281
269
|
}
|
|
282
270
|
});
|
|
283
|
-
var _accordion = _interopRequireDefault(require("./accordion"));
|
|
284
271
|
var _actionCard = _interopRequireDefault(require("./action-card"));
|
|
285
272
|
var _autocompleteTokenfield = _interopRequireDefault(require("./autocomplete-tokenfield"));
|
|
286
273
|
var _autocompleteWithSuggestions = _interopRequireDefault(require("./autocomplete-with-suggestions"));
|
|
@@ -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
package/dist/cjs/notice/index.js
CHANGED
|
@@ -62,10 +62,9 @@ class Notice extends _element.Component {
|
|
|
62
62
|
className: "newspack-notice__content",
|
|
63
63
|
children: [rawHTML ? (0, _jsxRuntime.jsx)(_element.RawHTML, {
|
|
64
64
|
children: noticeText
|
|
65
|
-
}) : noticeText, debugMode && __('Debug Mode', 'newspack'), children || null]
|
|
65
|
+
}) : noticeText, debugMode && __('Debug Mode', 'newspack-plugin'), children || null]
|
|
66
66
|
})]
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var _default = Notice;
|
|
71
|
-
exports.default = _default;
|
|
70
|
+
var _default = exports.default = Notice;
|
|
@@ -18,8 +18,8 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
18
18
|
*/
|
|
19
19
|
const __ = _i18n.__;
|
|
20
20
|
class PatronsLogo extends _element.Component {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...
|
|
21
|
+
constructor(...args) {
|
|
22
|
+
super(...args);
|
|
23
23
|
/**
|
|
24
24
|
* Render.
|
|
25
25
|
*/
|
|
@@ -30,7 +30,7 @@ class PatronsLogo extends _element.Component {
|
|
|
30
30
|
height: "16",
|
|
31
31
|
viewBox: "0 0 438 32",
|
|
32
32
|
className: "patrons-logo",
|
|
33
|
-
"aria-label": __('A project of WordPress.com and the Google News Initiative', 'newspack'),
|
|
33
|
+
"aria-label": __('A project of WordPress.com and the Google News Initiative', 'newspack-plugin'),
|
|
34
34
|
children: [(0, _jsxRuntime.jsx)(_components.Path, {
|
|
35
35
|
fillRule: "evenodd",
|
|
36
36
|
clipRule: "evenodd",
|
|
@@ -78,5 +78,4 @@ class PatronsLogo extends _element.Component {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
var _default = PatronsLogo;
|
|
82
|
-
exports.default = _default;
|
|
81
|
+
var _default = exports.default = PatronsLogo;
|
|
@@ -38,9 +38,7 @@ const PLUGIN_STATE_ERROR = 3;
|
|
|
38
38
|
*/
|
|
39
39
|
class PluginInstaller extends _element.Component {
|
|
40
40
|
constructor() {
|
|
41
|
-
var _this;
|
|
42
41
|
super(...arguments);
|
|
43
|
-
_this = this;
|
|
44
42
|
(0, _defineProperty2.default)(this, "componentDidMount", () => {
|
|
45
43
|
const {
|
|
46
44
|
plugins
|
|
@@ -129,12 +127,11 @@ class PluginInstaller extends _element.Component {
|
|
|
129
127
|
}
|
|
130
128
|
});
|
|
131
129
|
});
|
|
132
|
-
(0, _defineProperty2.default)(this, "setInstallationStatus",
|
|
133
|
-
let notification = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
130
|
+
(0, _defineProperty2.default)(this, "setInstallationStatus", (slug, installationStatus, notification = null) => {
|
|
134
131
|
const {
|
|
135
132
|
pluginInfo
|
|
136
|
-
} =
|
|
137
|
-
|
|
133
|
+
} = this.state;
|
|
134
|
+
this.updatePluginInfo({
|
|
138
135
|
...pluginInfo,
|
|
139
136
|
[slug]: {
|
|
140
137
|
...pluginInfo[slug],
|
|
@@ -205,7 +202,7 @@ class PluginInstaller extends _element.Component {
|
|
|
205
202
|
|
|
206
203
|
// Make sure plugin status falls in either one of these, to handle button text.
|
|
207
204
|
const pluginInstalled = currentStatus => currentStatus === 'active' || currentStatus === 'inactive';
|
|
208
|
-
const buttonText = currentPluginStatuses.every(pluginInstalled) ? __('Activate', 'newspack') : __('Install', 'newspack');
|
|
205
|
+
const buttonText = currentPluginStatuses.every(pluginInstalled) ? __('Activate', 'newspack-plugin') : __('Install', 'newspack-plugin');
|
|
209
206
|
const needsInstall = slugs.some(slug => {
|
|
210
207
|
const plugin = pluginInfo[slug];
|
|
211
208
|
return plugin.Status !== 'active' && plugin.installationStatus === PLUGIN_STATE_NONE;
|
|
@@ -215,7 +212,7 @@ class PluginInstaller extends _element.Component {
|
|
|
215
212
|
className: "newspack-plugin-installer_is-waiting",
|
|
216
213
|
children: [(0, _jsxRuntime.jsx)(_.Waiting, {
|
|
217
214
|
isLeft: true
|
|
218
|
-
}), __('Retrieving plugin information…')]
|
|
215
|
+
}), __('Retrieving plugin information…', 'newspack-plugin')]
|
|
219
216
|
}), pluginInfo && slugs.length > 0 && slugs.map(slug => {
|
|
220
217
|
const plugin = pluginInfo[slug];
|
|
221
218
|
const {
|
|
@@ -235,7 +232,7 @@ class PluginInstaller extends _element.Component {
|
|
|
235
232
|
} else if (!installable) {
|
|
236
233
|
actionText = (0, _jsxRuntime.jsxs)("span", {
|
|
237
234
|
className: "newspack-plugin-installer__status",
|
|
238
|
-
children: [isAtomic ? __('Contact Newspack support to install', 'newspack') : __('Plugin must be installed manually', 'newspack'), (0, _jsxRuntime.jsx)("span", {
|
|
235
|
+
children: [isAtomic ? __('Contact Newspack support to install', 'newspack-plugin') : __('Plugin must be installed manually', 'newspack-plugin'), (0, _jsxRuntime.jsx)("span", {
|
|
239
236
|
className: "newspack-checkbox-icon"
|
|
240
237
|
})]
|
|
241
238
|
});
|
|
@@ -249,14 +246,14 @@ class PluginInstaller extends _element.Component {
|
|
|
249
246
|
} else if (Status === 'inactive') {
|
|
250
247
|
actionText = (0, _jsxRuntime.jsxs)("span", {
|
|
251
248
|
className: "newspack-plugin-installer__status",
|
|
252
|
-
children: [__('Activate', 'newspack'), (0, _jsxRuntime.jsx)("span", {
|
|
249
|
+
children: [__('Activate', 'newspack-plugin'), (0, _jsxRuntime.jsx)("span", {
|
|
253
250
|
className: "newspack-checkbox-icon"
|
|
254
251
|
})]
|
|
255
252
|
});
|
|
256
253
|
} else if (Status === 'active') {
|
|
257
254
|
actionText = (0, _jsxRuntime.jsxs)("span", {
|
|
258
255
|
className: "newspack-plugin-installer__status",
|
|
259
|
-
children: [__('Installed', 'newspack'), (0, _jsxRuntime.jsx)("span", {
|
|
256
|
+
children: [__('Installed', 'newspack-plugin'), (0, _jsxRuntime.jsx)("span", {
|
|
260
257
|
className: "newspack-checkbox-icon newspack-checkbox-icon--checked",
|
|
261
258
|
children: (0, _jsxRuntime.jsx)(_icons.Icon, {
|
|
262
259
|
icon: _icons.check
|
|
@@ -295,5 +292,4 @@ PluginInstaller.defaultProps = {
|
|
|
295
292
|
onStatus: () => {},
|
|
296
293
|
onInstalled: () => {}
|
|
297
294
|
};
|
|
298
|
-
var _default = PluginInstaller;
|
|
299
|
-
exports.default = _default;
|
|
295
|
+
var _default = exports.default = PluginInstaller;
|
|
@@ -86,8 +86,7 @@ const SettingsSection = props => {
|
|
|
86
86
|
setSaveDisabled(false);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
const createFilter =
|
|
90
|
-
let defaultComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
89
|
+
const createFilter = (name, defaultComponent = null) => {
|
|
91
90
|
return (0, _hooks.applyFilters)(`newspack.settingSection.${sectionKey}.${name}`, defaultComponent, props);
|
|
92
91
|
};
|
|
93
92
|
let columns = 2;
|
|
@@ -136,5 +135,4 @@ const SettingsSection = props => {
|
|
|
136
135
|
})
|
|
137
136
|
});
|
|
138
137
|
};
|
|
139
|
-
var _default = SettingsSection;
|
|
140
|
-
exports.default = _default;
|
|
138
|
+
var _default = exports.default = SettingsSection;
|
|
@@ -215,8 +215,7 @@ class PluginSettings extends _element.Component {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
PluginSettings.defaultProps = {
|
|
218
|
-
title: __('General Settings', 'newspack')
|
|
218
|
+
title: __('General Settings', 'newspack-plugin')
|
|
219
219
|
};
|
|
220
220
|
PluginSettings.Section = _SettingsSection.default;
|
|
221
|
-
var _default = PluginSettings;
|
|
222
|
-
exports.default = _default;
|
|
221
|
+
var _default = exports.default = PluginSettings;
|
|
@@ -23,8 +23,8 @@ const __ = _i18n.__;
|
|
|
23
23
|
* Plugin toggle group component.
|
|
24
24
|
*/
|
|
25
25
|
class PluginToggle extends _element.Component {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...
|
|
26
|
+
constructor(...args) {
|
|
27
|
+
super(...args);
|
|
28
28
|
(0, _defineProperty2.default)(this, "state", {
|
|
29
29
|
pluginInfo: {}
|
|
30
30
|
});
|
|
@@ -71,24 +71,21 @@ class PluginToggle extends _element.Component {
|
|
|
71
71
|
const {
|
|
72
72
|
shouldRefreshAfterUpdate
|
|
73
73
|
} = plugins[plugin];
|
|
74
|
-
this.setState(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}, () => shouldRefreshAfterUpdate && location.reload());
|
|
74
|
+
this.setState(({
|
|
75
|
+
pluginInfo: currentPluginInfo
|
|
76
|
+
}) => ({
|
|
77
|
+
pluginInfo: {
|
|
78
|
+
...currentPluginInfo,
|
|
79
|
+
[plugin]: response
|
|
80
|
+
}
|
|
81
|
+
}), () => shouldRefreshAfterUpdate && location.reload());
|
|
85
82
|
}).catch(e => {
|
|
86
83
|
this.setState({
|
|
87
84
|
pluginInfo: {
|
|
88
85
|
...pluginInfo,
|
|
89
86
|
[plugin]: {
|
|
90
87
|
...pluginInfo[plugin],
|
|
91
|
-
error: e.message || __('There was an error managing this plugin.', 'newspack')
|
|
88
|
+
error: e.message || __('There was an error managing this plugin.', 'newspack-plugin')
|
|
92
89
|
}
|
|
93
90
|
}
|
|
94
91
|
});
|
|
@@ -131,21 +128,21 @@ class PluginToggle extends _element.Component {
|
|
|
131
128
|
// Show spinner when plugin data is unavailable, or when an API call is in flight.
|
|
132
129
|
if ('configure' === inFlight) {
|
|
133
130
|
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
134
|
-
children: [__('Installing…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
131
|
+
children: [__('Installing…', 'newspack-plugin'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
135
132
|
isRight: true
|
|
136
133
|
})]
|
|
137
134
|
});
|
|
138
135
|
}
|
|
139
136
|
if ('deactivate' === inFlight) {
|
|
140
137
|
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
141
|
-
children: [__('Deactivating…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
138
|
+
children: [__('Deactivating…', 'newspack-plugin'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
142
139
|
isRight: true
|
|
143
140
|
})]
|
|
144
141
|
});
|
|
145
142
|
}
|
|
146
143
|
if (!name) {
|
|
147
144
|
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
148
|
-
children: [__('Loading…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
145
|
+
children: [__('Loading…', 'newspack-plugin'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
149
146
|
isRight: true
|
|
150
147
|
})]
|
|
151
148
|
});
|
|
@@ -155,7 +152,7 @@ class PluginToggle extends _element.Component {
|
|
|
155
152
|
return null;
|
|
156
153
|
}
|
|
157
154
|
if (href || editPath) {
|
|
158
|
-
return actionText ? actionText : __('Configure', 'newspack');
|
|
155
|
+
return actionText ? actionText : __('Configure', 'newspack-plugin');
|
|
159
156
|
}
|
|
160
157
|
});
|
|
161
158
|
/**
|
|
@@ -218,5 +215,4 @@ class PluginToggle extends _element.Component {
|
|
|
218
215
|
});
|
|
219
216
|
}
|
|
220
217
|
}
|
|
221
|
-
var _default = PluginToggle;
|
|
222
|
-
exports.default = _default;
|
|
218
|
+
var _default = exports.default = PluginToggle;
|
|
@@ -20,67 +20,66 @@ const __ = _i18n.__;
|
|
|
20
20
|
/**
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
|
-
function PositionControl(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
23
|
+
function PositionControl({
|
|
24
|
+
allowedPositions,
|
|
25
|
+
value,
|
|
26
|
+
label,
|
|
27
|
+
help,
|
|
28
|
+
onChange,
|
|
29
|
+
size,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
33
32
|
/**
|
|
34
33
|
* Set layout options
|
|
35
34
|
*/
|
|
36
35
|
const options = size === 'full-width' ? [{
|
|
37
36
|
value: 'top',
|
|
38
37
|
/* translators: Overlay Position */
|
|
39
|
-
label: __('Top', 'newspack')
|
|
38
|
+
label: __('Top', 'newspack-plugin')
|
|
40
39
|
}, {
|
|
41
40
|
value: 'center',
|
|
42
41
|
/* translators: Overlay Position */
|
|
43
|
-
label: __('Center', 'newspack')
|
|
42
|
+
label: __('Center', 'newspack-plugin')
|
|
44
43
|
}, {
|
|
45
44
|
value: 'bottom',
|
|
46
45
|
/* translators: Overlay Position */
|
|
47
|
-
label: __('Bottom', 'newspack')
|
|
46
|
+
label: __('Bottom', 'newspack-plugin')
|
|
48
47
|
}] : [{
|
|
49
48
|
value: 'top_left',
|
|
50
49
|
/* translators: Overlay Position */
|
|
51
|
-
label: __('Top Left', 'newspack')
|
|
50
|
+
label: __('Top Left', 'newspack-plugin')
|
|
52
51
|
}, {
|
|
53
52
|
value: 'top',
|
|
54
53
|
/* translators: Overlay Position */
|
|
55
|
-
label: __('Top Center', 'newspack')
|
|
54
|
+
label: __('Top Center', 'newspack-plugin')
|
|
56
55
|
}, {
|
|
57
56
|
value: 'top_right',
|
|
58
57
|
/* translators: Overlay Position */
|
|
59
|
-
label: __('Top Right', 'newspack')
|
|
58
|
+
label: __('Top Right', 'newspack-plugin')
|
|
60
59
|
}, {
|
|
61
60
|
value: 'center_left',
|
|
62
61
|
/* translators: Overlay Position */
|
|
63
|
-
label: __('Center Left', 'newspack')
|
|
62
|
+
label: __('Center Left', 'newspack-plugin')
|
|
64
63
|
}, {
|
|
65
64
|
value: 'center',
|
|
66
65
|
/* translators: Overlay Position */
|
|
67
|
-
label: __('Center', 'newspack')
|
|
66
|
+
label: __('Center', 'newspack-plugin')
|
|
68
67
|
}, {
|
|
69
68
|
value: 'center_right',
|
|
70
69
|
/* translators: Overlay Position */
|
|
71
|
-
label: __('Center Right', 'newspack')
|
|
70
|
+
label: __('Center Right', 'newspack-plugin')
|
|
72
71
|
}, {
|
|
73
72
|
value: 'bottom_left',
|
|
74
73
|
/* translators: Overlay Position */
|
|
75
|
-
label: __('Bottom Left', 'newspack')
|
|
74
|
+
label: __('Bottom Left', 'newspack-plugin')
|
|
76
75
|
}, {
|
|
77
76
|
value: 'bottom',
|
|
78
77
|
/* translators: Overlay Position */
|
|
79
|
-
label: __('Bottom Center', 'newspack')
|
|
78
|
+
label: __('Bottom Center', 'newspack-plugin')
|
|
80
79
|
}, {
|
|
81
80
|
value: 'bottom_right',
|
|
82
81
|
/* translators: Overlay Position */
|
|
83
|
-
label: __('Bottom Right', 'newspack')
|
|
82
|
+
label: __('Bottom Right', 'newspack-plugin')
|
|
84
83
|
}];
|
|
85
84
|
return (0, _jsxRuntime.jsxs)("div", {
|
|
86
85
|
className: (0, _classnames.default)('newspack-position-placement-control', 'size-' + size),
|
|
@@ -88,7 +87,7 @@ function PositionControl(_ref) {
|
|
|
88
87
|
className: "components-base-control__label",
|
|
89
88
|
children: label
|
|
90
89
|
}), (0, _jsxRuntime.jsx)(_components.ButtonGroup, {
|
|
91
|
-
"aria-label": __('Select Position', 'newspack'),
|
|
90
|
+
"aria-label": __('Select Position', 'newspack-plugin'),
|
|
92
91
|
...props,
|
|
93
92
|
children: options.map((option, index) => {
|
|
94
93
|
return (0, _jsxRuntime.jsx)("div", {
|
|
@@ -70,11 +70,10 @@ describe('ProgressBar', () => {
|
|
|
70
70
|
total: 3
|
|
71
71
|
},
|
|
72
72
|
expectedWidth: 100
|
|
73
|
-
}].forEach(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} = _ref;
|
|
73
|
+
}].forEach(({
|
|
74
|
+
props,
|
|
75
|
+
expectedWidth
|
|
76
|
+
}) => {
|
|
78
77
|
it(`with expected progress of ${expectedWidth}`, () => {
|
|
79
78
|
const {
|
|
80
79
|
getByTestId
|
|
@@ -11,5 +11,4 @@ var ReactRouterDOM = _interopRequireWildcard(require("react-router-dom"));
|
|
|
11
11
|
* Ensures that both components and the plugin use the same instance of
|
|
12
12
|
* React Router, even if there are node_modules in components.
|
|
13
13
|
*/
|
|
14
|
-
var _default = ReactRouterDOM;
|
|
15
|
-
exports.default = _default;
|
|
14
|
+
var _default = exports.default = ReactRouterDOM;
|