newspack-components 2.2.1 → 3.0.0-alpha.2
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/babel.config.js +25 -0
- package/copy-styles.js +2 -10
- package/dist/{cjs/accordion → accordion}/index.js +17 -13
- package/dist/{cjs/accordion → accordion}/style.scss +7 -3
- package/dist/{cjs/action-card → action-card}/index.js +39 -43
- package/dist/{esm/action-card → action-card}/style.scss +9 -9
- package/dist/{cjs/autocomplete-tokenfield → autocomplete-tokenfield}/index.js +67 -29
- package/dist/{esm/autocomplete-tokenfield → autocomplete-tokenfield}/style.scss +14 -8
- package/dist/{cjs/autocomplete-with-suggestions → autocomplete-with-suggestions}/index.js +61 -73
- package/dist/{esm/autocomplete-with-suggestions → autocomplete-with-suggestions}/style.scss +9 -17
- package/dist/button/index.js +51 -0
- package/{src/button/index.js → dist/button/index.tsx} +12 -5
- package/dist/{cjs/button → button}/style.scss +1 -1
- package/dist/{cjs/button-card → button-card}/index.js +9 -10
- package/dist/{cjs/button-card → button-card}/style.scss +19 -13
- package/dist/{cjs/card → card}/index.js +4 -5
- package/dist/{esm/card → card}/style.scss +1 -1
- package/dist/{cjs/category-autocomplete → category-autocomplete}/index.js +51 -53
- package/dist/{esm/category-autocomplete → category-autocomplete}/style.scss +2 -2
- package/dist/{cjs/color-picker → color-picker}/index.js +14 -16
- package/dist/{cjs/color-picker → color-picker}/style.scss +3 -3
- package/dist/consts.js +7 -0
- package/dist/{cjs/custom-select-control → custom-select-control}/index.js +4 -5
- package/dist/{cjs/custom-select-control → custom-select-control}/style.scss +11 -10
- package/dist/{cjs/date-range-picker → date-range-picker}/index.js +9 -11
- package/dist/{cjs/date-range-picker → date-range-picker}/style.scss +6 -6
- package/dist/{cjs/footer → footer}/index.js +33 -36
- package/dist/{cjs/footer → footer}/style.scss +1 -1
- package/dist/{cjs/form-token-field → form-token-field}/index.js +6 -7
- package/dist/{esm/form-token-field → form-token-field}/style.scss +1 -1
- package/dist/{cjs/global-notices → global-notices}/index.js +4 -5
- package/dist/grid/index.js +44 -0
- package/dist/grid/index.tsx +34 -0
- package/dist/{cjs/grid → grid}/style.scss +9 -9
- package/dist/{cjs/handoff → handoff}/index.js +73 -71
- package/dist/{cjs/handoff-message → handoff-message}/index.js +5 -3
- package/dist/hooks/index.js +29 -0
- package/{src/hooks/index.js → dist/hooks/index.ts} +1 -1
- package/dist/{cjs/hooks → hooks}/useObjectState.js +2 -3
- package/dist/{cjs/hooks → hooks}/useObjectState.test.js +9 -9
- package/dist/{cjs/hooks → hooks}/useOnClickOutside.js +1 -2
- package/dist/hooks/usePrompt.js +47 -0
- package/{src/hooks/usePrompt.js → dist/hooks/usePrompt.ts} +4 -8
- package/dist/image-upload/index.js +148 -0
- package/dist/{cjs/image-upload → image-upload}/index.test.js +13 -6
- package/dist/{esm/image-upload → image-upload}/style.scss +5 -5
- package/dist/{cjs/index.js → index.js} +1 -1
- package/dist/{cjs/info-button → info-button}/index.js +6 -7
- package/dist/{cjs/modal → modal}/index.js +4 -5
- package/dist/{esm/modal → modal}/style.scss +5 -5
- package/dist/{cjs/newspack-icon → newspack-icon}/index.js +5 -6
- package/dist/{cjs/newspack-icon → newspack-icon}/style.scss +1 -1
- package/dist/{cjs/newspack-logo → newspack-logo}/index.js +5 -6
- package/dist/{cjs/newspack-logo → newspack-logo}/style.scss +1 -1
- package/dist/{cjs/notice → notice}/index.js +12 -10
- package/dist/{cjs/notice → notice}/style.scss +11 -11
- package/dist/patrons-logo/index.js +77 -0
- package/dist/plugin-installer/index.js +297 -0
- package/dist/{cjs/plugin-installer → plugin-installer}/style.scss +1 -1
- package/dist/{cjs/plugin-settings → plugin-settings}/SettingsSection.js +13 -13
- package/dist/plugin-settings/index.js +228 -0
- package/dist/{cjs/plugin-settings → plugin-settings}/style.scss +1 -1
- package/dist/plugin-toggle/README.md +53 -0
- package/dist/plugin-toggle/index.js +222 -0
- package/dist/{esm/plugin-toggle → plugin-toggle}/style.scss +1 -1
- package/dist/{cjs/popover → popover}/index.js +4 -5
- package/dist/{cjs/popover → popover}/style.scss +7 -7
- package/dist/{cjs/position-control → position-control}/index.js +33 -32
- package/dist/{cjs/position-control → position-control}/style.scss +8 -8
- package/dist/{cjs/progress-bar → progress-bar}/index.js +9 -10
- package/dist/{cjs/progress-bar → progress-bar}/index.test.js +16 -16
- package/dist/{cjs/progress-bar → progress-bar}/style.scss +2 -2
- package/dist/proxied-imports/router.js +15 -0
- package/dist/{cjs/radio-control → radio-control}/index.js +4 -5
- package/dist/{cjs/radio-control → radio-control}/style.scss +3 -3
- package/dist/{cjs/section-header → section-header}/index.js +20 -21
- package/dist/{esm/section-header → section-header}/style.scss +5 -1
- package/dist/{cjs/select-control → select-control}/ButtonGroupControl.js +17 -19
- package/dist/{cjs/select-control → select-control}/GroupedSelectControl.js +32 -35
- package/dist/{cjs/select-control → select-control}/index.js +7 -8
- package/dist/{cjs/select-control → select-control}/style.scss +4 -4
- package/dist/settings/MinMaxSetting.js +60 -0
- package/dist/{cjs/settings → settings}/SettingsCard.js +14 -16
- package/dist/settings/SettingsSection.js +33 -0
- package/dist/{cjs/settings → settings}/index.js +3 -4
- package/dist/{cjs/settings → settings}/style.scss +15 -2
- package/dist/sortable-newsletter-list-control/index.js +135 -0
- package/dist/sortable-newsletter-list-control/style.scss +45 -0
- package/dist/{cjs/steps-list → steps-list}/index.js +5 -6
- package/dist/{esm/steps-list → steps-list}/style.scss +2 -2
- package/dist/{cjs/steps-list-item → steps-list-item}/index.js +6 -7
- package/dist/{cjs/steps-list-item → steps-list-item}/style.scss +5 -5
- package/dist/{cjs/style-card → style-card}/index.js +21 -19
- package/dist/{esm/style-card → style-card}/style.scss +4 -4
- package/dist/{esm/style.scss → style.scss} +14 -2
- package/dist/{cjs/tabbed-navigation → tabbed-navigation}/index.js +16 -19
- package/dist/{cjs/tabbed-navigation → tabbed-navigation}/style.scss +4 -4
- package/dist/text-control/index.js +76 -0
- package/dist/text-control/index.tsx +71 -0
- package/dist/utils/index.js +36 -0
- package/dist/{cjs/waiting → waiting}/index.js +4 -5
- package/dist/web-preview/index.js +191 -0
- package/dist/{cjs/web-preview → web-preview}/style.scss +5 -5
- package/dist/with-wizard/index.js +328 -0
- package/dist/{esm/with-wizard → with-wizard}/style.scss +44 -22
- package/dist/{cjs/with-wizard-screen → with-wizard-screen}/index.js +40 -43
- package/dist/{esm/with-wizard-screen → with-wizard-screen}/style.scss +7 -7
- package/dist/{cjs/wizard → wizard}/components/WizardError.js +16 -17
- package/dist/{cjs/wizard → wizard}/index.js +44 -46
- package/dist/{cjs/wizard → wizard}/store/index.js +37 -38
- package/dist/{cjs/wizard → wizard}/store/utils.js +1 -4
- package/package.json +16 -14
- package/shared/scss/_mixins.scss +2 -2
- package/src/accordion/index.js +4 -1
- package/src/accordion/style.scss +7 -3
- package/src/action-card/style.scss +9 -9
- package/src/autocomplete-tokenfield/index.js +48 -15
- package/src/autocomplete-tokenfield/style.scss +14 -8
- package/src/autocomplete-with-suggestions/index.js +59 -62
- package/src/autocomplete-with-suggestions/style.scss +9 -17
- package/src/button/index.tsx +48 -0
- package/src/button/style.scss +1 -1
- package/src/button-card/style.scss +19 -13
- package/src/card/style.scss +1 -1
- package/src/category-autocomplete/style.scss +2 -2
- package/src/color-picker/style.scss +3 -3
- package/src/consts.js +0 -2
- package/src/custom-select-control/style.scss +11 -10
- package/src/date-range-picker/style.scss +6 -6
- package/src/footer/index.js +7 -7
- package/src/footer/style.scss +1 -1
- package/src/form-token-field/style.scss +1 -1
- package/src/grid/index.tsx +34 -0
- package/src/grid/style.scss +9 -9
- package/src/handoff/index.js +7 -6
- package/src/handoff-message/index.js +3 -1
- package/src/hooks/index.ts +15 -0
- package/src/hooks/usePrompt.ts +46 -0
- package/src/image-upload/index.js +5 -5
- package/src/image-upload/index.test.js +6 -1
- package/src/image-upload/style.scss +5 -5
- package/src/modal/style.scss +5 -5
- package/src/newspack-icon/style.scss +1 -1
- package/src/newspack-logo/style.scss +1 -1
- package/src/notice/index.js +1 -1
- package/src/notice/style.scss +11 -11
- package/src/patrons-logo/index.js +4 -1
- package/src/plugin-installer/index.js +7 -7
- package/src/plugin-installer/style.scss +1 -1
- package/src/plugin-settings/index.js +1 -1
- package/src/plugin-settings/style.scss +1 -1
- package/src/plugin-toggle/index.js +13 -12
- package/src/plugin-toggle/style.scss +1 -1
- package/src/popover/style.scss +7 -7
- package/src/position-control/index.js +63 -64
- package/src/position-control/style.scss +8 -8
- package/src/progress-bar/style.scss +2 -2
- package/src/radio-control/style.scss +3 -3
- package/src/section-header/index.js +3 -3
- package/src/section-header/style.scss +5 -1
- package/src/select-control/GroupedSelectControl.js +1 -1
- package/src/select-control/style.scss +4 -4
- package/src/settings/MinMaxSetting.js +8 -6
- package/src/settings/style.scss +15 -2
- package/src/sortable-newsletter-list-control/index.js +137 -0
- package/src/sortable-newsletter-list-control/style.scss +45 -0
- package/src/steps-list/style.scss +2 -2
- package/src/steps-list-item/style.scss +5 -5
- package/src/style-card/index.js +11 -5
- package/src/style-card/style.scss +4 -4
- package/src/style.scss +14 -2
- package/src/tabbed-navigation/style.scss +4 -4
- package/src/text-control/index.tsx +65 -0
- package/src/web-preview/index.js +6 -6
- package/src/web-preview/style.scss +5 -5
- package/src/with-wizard/index.js +4 -4
- package/src/with-wizard/style.scss +44 -22
- package/src/with-wizard-screen/index.js +1 -1
- package/src/with-wizard-screen/style.scss +7 -7
- 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/action-card/style.scss +0 -483
- package/dist/cjs/autocomplete-tokenfield/style.scss +0 -43
- package/dist/cjs/autocomplete-with-suggestions/style.scss +0 -171
- package/dist/cjs/button/index.js +0 -57
- package/dist/cjs/card/style.scss +0 -168
- package/dist/cjs/category-autocomplete/style.scss +0 -34
- package/dist/cjs/consts.js +0 -12
- package/dist/cjs/form-token-field/style.scss +0 -37
- package/dist/cjs/grid/index.js +0 -54
- package/dist/cjs/hooks/index.js +0 -26
- package/dist/cjs/hooks/usePrompt.js +0 -52
- package/dist/cjs/image-upload/index.js +0 -144
- package/dist/cjs/image-upload/style.scss +0 -103
- package/dist/cjs/modal/style.scss +0 -56
- package/dist/cjs/patrons-logo/index.js +0 -82
- package/dist/cjs/plugin-installer/index.js +0 -299
- package/dist/cjs/plugin-settings/index.js +0 -222
- package/dist/cjs/plugin-toggle/index.js +0 -222
- package/dist/cjs/plugin-toggle/style.scss +0 -20
- package/dist/cjs/proxied-imports/router.js +0 -15
- package/dist/cjs/section-header/style.scss +0 -41
- package/dist/cjs/settings/MinMaxSetting.js +0 -57
- package/dist/cjs/settings/SettingsSection.js +0 -37
- package/dist/cjs/steps-list/style.scss +0 -11
- package/dist/cjs/style-card/style.scss +0 -94
- package/dist/cjs/style.scss +0 -43
- package/dist/cjs/text-control/index.js +0 -71
- package/dist/cjs/utils/index.js +0 -40
- package/dist/cjs/web-preview/index.js +0 -189
- package/dist/cjs/with-wizard/index.js +0 -318
- package/dist/cjs/with-wizard/style.scss +0 -260
- package/dist/cjs/with-wizard-screen/style.scss +0 -160
- package/dist/esm/accordion/index.js +0 -38
- package/dist/esm/accordion/style.scss +0 -27
- package/dist/esm/action-card/index.js +0 -222
- package/dist/esm/autocomplete-tokenfield/index.js +0 -223
- package/dist/esm/autocomplete-with-suggestions/index.js +0 -289
- package/dist/esm/button/index.js +0 -48
- package/dist/esm/button/style.scss +0 -11
- package/dist/esm/button-card/index.js +0 -65
- package/dist/esm/button-card/style.scss +0 -174
- package/dist/esm/card/index.js +0 -43
- package/dist/esm/category-autocomplete/index.js +0 -185
- package/dist/esm/color-picker/index.js +0 -61
- package/dist/esm/color-picker/style.scss +0 -37
- package/dist/esm/consts.js +0 -3
- package/dist/esm/custom-select-control/index.js +0 -37
- package/dist/esm/custom-select-control/style.scss +0 -92
- package/dist/esm/date-range-picker/index.js +0 -32
- package/dist/esm/date-range-picker/style.scss +0 -148
- package/dist/esm/footer/index.js +0 -105
- package/dist/esm/footer/style.scss +0 -82
- package/dist/esm/form-token-field/index.js +0 -50
- package/dist/esm/global-notices/index.js +0 -30
- package/dist/esm/grid/index.js +0 -45
- package/dist/esm/grid/style.scss +0 -166
- package/dist/esm/handoff/index.js +0 -177
- package/dist/esm/handoff-message/index.js +0 -45
- package/dist/esm/hooks/index.js +0 -17
- package/dist/esm/hooks/useObjectState.js +0 -31
- package/dist/esm/hooks/useObjectState.test.js +0 -83
- package/dist/esm/hooks/useOnClickOutside.js +0 -31
- package/dist/esm/hooks/usePrompt.js +0 -43
- package/dist/esm/image-upload/index.js +0 -141
- package/dist/esm/image-upload/index.test.js +0 -28
- package/dist/esm/index.js +0 -47
- package/dist/esm/info-button/index.js +0 -42
- package/dist/esm/info-button/style.scss +0 -18
- package/dist/esm/modal/index.js +0 -39
- package/dist/esm/newspack-icon/index.js +0 -50
- package/dist/esm/newspack-icon/style.scss +0 -26
- package/dist/esm/newspack-logo/index.js +0 -46
- package/dist/esm/newspack-logo/style.scss +0 -30
- package/dist/esm/notice/index.js +0 -67
- package/dist/esm/notice/style.scss +0 -111
- package/dist/esm/patrons-logo/index.js +0 -76
- package/dist/esm/plugin-installer/index.js +0 -295
- package/dist/esm/plugin-installer/style.scss +0 -72
- package/dist/esm/plugin-settings/SettingsSection.js +0 -136
- package/dist/esm/plugin-settings/index.js +0 -217
- package/dist/esm/plugin-settings/style.scss +0 -7
- package/dist/esm/plugin-toggle/index.js +0 -217
- package/dist/esm/popover/index.js +0 -41
- package/dist/esm/popover/style.scss +0 -161
- package/dist/esm/position-control/index.js +0 -109
- package/dist/esm/position-control/style.scss +0 -66
- package/dist/esm/progress-bar/index.js +0 -69
- package/dist/esm/progress-bar/index.test.js +0 -110
- package/dist/esm/progress-bar/style.scss +0 -42
- package/dist/esm/proxied-imports/router.js +0 -8
- package/dist/esm/radio-control/index.js +0 -37
- package/dist/esm/radio-control/style.scss +0 -92
- package/dist/esm/section-header/index.js +0 -68
- package/dist/esm/select-control/ButtonGroupControl.js +0 -54
- package/dist/esm/select-control/GroupedSelectControl.js +0 -84
- package/dist/esm/select-control/index.js +0 -51
- package/dist/esm/select-control/style.scss +0 -108
- package/dist/esm/settings/MinMaxSetting.js +0 -53
- package/dist/esm/settings/SettingsCard.js +0 -39
- package/dist/esm/settings/SettingsSection.js +0 -30
- package/dist/esm/settings/index.js +0 -9
- package/dist/esm/settings/style.scss +0 -106
- package/dist/esm/steps-list/index.js +0 -43
- package/dist/esm/steps-list-item/index.js +0 -48
- package/dist/esm/steps-list-item/style.scss +0 -47
- package/dist/esm/style-card/index.js +0 -76
- package/dist/esm/tabbed-navigation/index.js +0 -56
- package/dist/esm/tabbed-navigation/style.scss +0 -86
- package/dist/esm/text-control/index.js +0 -66
- package/dist/esm/text-control/style.scss +0 -32
- package/dist/esm/utils/index.js +0 -32
- package/dist/esm/waiting/index.js +0 -44
- package/dist/esm/waiting/style.scss +0 -27
- package/dist/esm/web-preview/index.js +0 -184
- package/dist/esm/web-preview/style.scss +0 -155
- package/dist/esm/with-wizard/index.js +0 -313
- package/dist/esm/with-wizard-screen/index.js +0 -116
- package/dist/esm/wizard/components/WizardError.js +0 -69
- package/dist/esm/wizard/index.js +0 -126
- package/dist/esm/wizard/store/index.js +0 -155
- package/dist/esm/wizard/store/utils.js +0 -17
- package/src/grid/index.js +0 -44
- package/src/text-control/index.js +0 -56
- /package/dist/{cjs/info-button → info-button}/style.scss +0 -0
- /package/dist/{cjs/text-control → text-control}/style.scss +0 -0
- /package/dist/{cjs/waiting → waiting}/style.scss +0 -0
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _apiFetch = _interopRequireDefault(require("@wordpress/api-fetch"));
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _ = require("../");
|
|
13
|
-
require("./style.scss");
|
|
14
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies.
|
|
20
|
-
*/
|
|
21
|
-
const __ = _i18n.__;
|
|
22
|
-
/**
|
|
23
|
-
* Plugin toggle group component.
|
|
24
|
-
*/
|
|
25
|
-
class PluginToggle extends _element.Component {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
(0, _defineProperty2.default)(this, "state", {
|
|
29
|
-
pluginInfo: {}
|
|
30
|
-
});
|
|
31
|
-
(0, _defineProperty2.default)(this, "componentDidMount", () => {
|
|
32
|
-
this.retrievePluginInfo();
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* Retrieve complete data about Newspack plugins.
|
|
36
|
-
*/
|
|
37
|
-
(0, _defineProperty2.default)(this, "retrievePluginInfo", () => {
|
|
38
|
-
return new Promise(() => {
|
|
39
|
-
(0, _apiFetch.default)({
|
|
40
|
-
path: '/newspack/v1/plugins/'
|
|
41
|
-
}).then(pluginInfo => this.setState({
|
|
42
|
-
pluginInfo
|
|
43
|
-
}));
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
/**
|
|
47
|
-
* Install/activate or remove a plugin.
|
|
48
|
-
*/
|
|
49
|
-
(0, _defineProperty2.default)(this, "managePlugin", (plugin, value) => {
|
|
50
|
-
const {
|
|
51
|
-
plugins
|
|
52
|
-
} = this.props;
|
|
53
|
-
const {
|
|
54
|
-
pluginInfo
|
|
55
|
-
} = this.state;
|
|
56
|
-
const action = value ? 'configure' : 'deactivate';
|
|
57
|
-
const params = {
|
|
58
|
-
path: `/newspack/v1/plugins/${plugin}/${action}/`,
|
|
59
|
-
method: 'post'
|
|
60
|
-
};
|
|
61
|
-
this.setState({
|
|
62
|
-
pluginInfo: {
|
|
63
|
-
...pluginInfo,
|
|
64
|
-
[plugin]: {
|
|
65
|
-
...pluginInfo[plugin],
|
|
66
|
-
inFlight: action
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, () => {
|
|
70
|
-
(0, _apiFetch.default)(params).then(response => {
|
|
71
|
-
const {
|
|
72
|
-
shouldRefreshAfterUpdate
|
|
73
|
-
} = plugins[plugin];
|
|
74
|
-
this.setState(_ref => {
|
|
75
|
-
let {
|
|
76
|
-
pluginInfo: currentPluginInfo
|
|
77
|
-
} = _ref;
|
|
78
|
-
return {
|
|
79
|
-
pluginInfo: {
|
|
80
|
-
...currentPluginInfo,
|
|
81
|
-
[plugin]: response
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}, () => shouldRefreshAfterUpdate && location.reload());
|
|
85
|
-
}).catch(e => {
|
|
86
|
-
this.setState({
|
|
87
|
-
pluginInfo: {
|
|
88
|
-
...pluginInfo,
|
|
89
|
-
[plugin]: {
|
|
90
|
-
...pluginInfo[plugin],
|
|
91
|
-
error: e.message || __('There was an error managing this plugin.', 'newspack')
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
/**
|
|
99
|
-
* Prepare plugins data for render. Change all keys to camelCase, merge API-fetched data with prop.
|
|
100
|
-
*/
|
|
101
|
-
(0, _defineProperty2.default)(this, "prepareDataForRender", (pluginsFromProps, pluginsFromAPI) => Object.keys(pluginsFromProps).map(pluginSlug => pluginsFromAPI[pluginSlug] ? Object.keys(pluginsFromAPI[pluginSlug]).reduce((accumulator, key) => ({
|
|
102
|
-
...accumulator,
|
|
103
|
-
[key.charAt(0).toLowerCase() + key.slice(1)]: pluginsFromAPI[pluginSlug][key]
|
|
104
|
-
}), {}) : {}).map(plugin => Object.assign(plugin, pluginsFromProps[plugin.slug])));
|
|
105
|
-
/**
|
|
106
|
-
* Generate a classname for the ActionCard based on plugin state. Applies 'in-flight' class if an API is underway and 'loading' if the plugin data is not yet available.
|
|
107
|
-
*/
|
|
108
|
-
(0, _defineProperty2.default)(this, "classNameForPlugin", plugin => {
|
|
109
|
-
const {
|
|
110
|
-
status,
|
|
111
|
-
inFlight
|
|
112
|
-
} = plugin;
|
|
113
|
-
if (inFlight) {
|
|
114
|
-
return 'in-flight';
|
|
115
|
-
}
|
|
116
|
-
if (!status) {
|
|
117
|
-
return 'loading';
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
/**
|
|
121
|
-
* Generate the ActionCard action text for a plugin.
|
|
122
|
-
*/
|
|
123
|
-
(0, _defineProperty2.default)(this, "actionTextForPlugin", plugin => {
|
|
124
|
-
const {
|
|
125
|
-
actionText,
|
|
126
|
-
editPath,
|
|
127
|
-
href,
|
|
128
|
-
inFlight,
|
|
129
|
-
name
|
|
130
|
-
} = plugin;
|
|
131
|
-
// Show spinner when plugin data is unavailable, or when an API call is in flight.
|
|
132
|
-
if ('configure' === inFlight) {
|
|
133
|
-
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
134
|
-
children: [__('Installing…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
135
|
-
isRight: true
|
|
136
|
-
})]
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
if ('deactivate' === inFlight) {
|
|
140
|
-
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
141
|
-
children: [__('Deactivating…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
142
|
-
isRight: true
|
|
143
|
-
})]
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
if (!name) {
|
|
147
|
-
return (0, _jsxRuntime.jsxs)(_element.Fragment, {
|
|
148
|
-
children: [__('Loading…', 'newspack'), " ", (0, _jsxRuntime.jsx)(_.Waiting, {
|
|
149
|
-
isRight: true
|
|
150
|
-
})]
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
// No action button at all if the plugin isn't installed and active.
|
|
154
|
-
if (!this.isPluginInstalledAndActive(plugin)) {
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
157
|
-
if (href || editPath) {
|
|
158
|
-
return actionText ? actionText : __('Configure', 'newspack');
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
/**
|
|
162
|
-
* Get error message for this plugin.
|
|
163
|
-
*/
|
|
164
|
-
(0, _defineProperty2.default)(this, "errorForPlugin", plugin => {
|
|
165
|
-
const {
|
|
166
|
-
slug
|
|
167
|
-
} = plugin;
|
|
168
|
-
const {
|
|
169
|
-
pluginInfo
|
|
170
|
-
} = this.state;
|
|
171
|
-
return pluginInfo[slug]?.error || null;
|
|
172
|
-
});
|
|
173
|
-
/**
|
|
174
|
-
* Get installation/activation status for a plugin.
|
|
175
|
-
*/
|
|
176
|
-
(0, _defineProperty2.default)(this, "isPluginInstalledAndActive", plugin => {
|
|
177
|
-
const {
|
|
178
|
-
status
|
|
179
|
-
} = plugin;
|
|
180
|
-
return status === 'active';
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Render.
|
|
185
|
-
*/
|
|
186
|
-
render() {
|
|
187
|
-
const {
|
|
188
|
-
plugins
|
|
189
|
-
} = this.props;
|
|
190
|
-
const {
|
|
191
|
-
pluginInfo
|
|
192
|
-
} = this.state;
|
|
193
|
-
return this.prepareDataForRender(plugins, pluginInfo).map((plugin, index) => {
|
|
194
|
-
const {
|
|
195
|
-
name,
|
|
196
|
-
description,
|
|
197
|
-
href,
|
|
198
|
-
slug,
|
|
199
|
-
editPath
|
|
200
|
-
} = plugin;
|
|
201
|
-
const pluginStatus = this.isPluginInstalledAndActive(plugin);
|
|
202
|
-
const handoff = !href && pluginStatus && editPath ? slug : null;
|
|
203
|
-
const error = this.errorForPlugin(plugin);
|
|
204
|
-
return (0, _jsxRuntime.jsx)(_.ActionCard, {
|
|
205
|
-
className: this.classNameForPlugin(plugin),
|
|
206
|
-
title: name,
|
|
207
|
-
description: description,
|
|
208
|
-
actionText: this.actionTextForPlugin(plugin),
|
|
209
|
-
handoff: handoff,
|
|
210
|
-
href: href,
|
|
211
|
-
toggle: true,
|
|
212
|
-
toggleChecked: this.isPluginInstalledAndActive(plugin),
|
|
213
|
-
toggleOnChange: value => this.managePlugin(slug, value),
|
|
214
|
-
notification: error,
|
|
215
|
-
notificationHTML: error,
|
|
216
|
-
notificationLevel: "error"
|
|
217
|
-
}, index);
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
var _default = PluginToggle;
|
|
222
|
-
exports.default = _default;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Toggle
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
|
-
|
|
7
|
-
.newspack-action-card {
|
|
8
|
-
&.in-flight,
|
|
9
|
-
&.loading {
|
|
10
|
-
opacity: 0.5;
|
|
11
|
-
|
|
12
|
-
.newspack-action-card__region-right {
|
|
13
|
-
.newspack-button {
|
|
14
|
-
color: wp-colors.$gray-700;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var ReactRouterDOM = _interopRequireWildcard(require("react-router-dom"));
|
|
9
|
-
/**
|
|
10
|
-
* A proxy for react-router-dom.
|
|
11
|
-
* Ensures that both components and the plugin use the same instance of
|
|
12
|
-
* React Router, even if there are node_modules in components.
|
|
13
|
-
*/
|
|
14
|
-
var _default = ReactRouterDOM;
|
|
15
|
-
exports.default = _default;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Section Header
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
6
|
-
|
|
7
|
-
.newspack-section-header {
|
|
8
|
-
margin: 64px 0 32px;
|
|
9
|
-
|
|
10
|
-
&--no-margin,
|
|
11
|
-
h1,
|
|
12
|
-
h2,
|
|
13
|
-
h3,
|
|
14
|
-
h4,
|
|
15
|
-
h5,
|
|
16
|
-
h6 {
|
|
17
|
-
margin: 0 !important;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&--is-centered {
|
|
21
|
-
text-align: center;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:not( #{&}--no-margin ) + *:not( #{&} ) {
|
|
25
|
-
margin-top: -16px !important;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&#{&}--is-white {
|
|
29
|
-
> * {
|
|
30
|
-
color: white;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
p {
|
|
35
|
-
color: wp-colors.$gray-700;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.newspack-wizard__content &:first-child {
|
|
39
|
-
margin-top: 32px;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _i18n = require("@wordpress/i18n");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _ = require("../");
|
|
10
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies.
|
|
13
|
-
*/
|
|
14
|
-
const __ = _i18n.__;
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies.
|
|
17
|
-
*/
|
|
18
|
-
const MinMaxSetting = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
min,
|
|
21
|
-
max,
|
|
22
|
-
onChangeMin,
|
|
23
|
-
onChangeMax,
|
|
24
|
-
minPlaceholder,
|
|
25
|
-
maxPlaceholder
|
|
26
|
-
} = _ref;
|
|
27
|
-
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
28
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
29
|
-
className: "newspack-settings__min-max",
|
|
30
|
-
children: [(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
31
|
-
checked: min > 0,
|
|
32
|
-
onChange: value => onChangeMin(value ? 1 : 0),
|
|
33
|
-
label: __('Min', 'newspack')
|
|
34
|
-
}), (0, _jsxRuntime.jsx)(_.TextControl, {
|
|
35
|
-
"data-testid": "min-articles-input",
|
|
36
|
-
type: "number",
|
|
37
|
-
value: min,
|
|
38
|
-
placeholder: minPlaceholder,
|
|
39
|
-
onChange: value => onChangeMin(value > 0 ? value : 0)
|
|
40
|
-
})]
|
|
41
|
-
}), (0, _jsxRuntime.jsxs)("div", {
|
|
42
|
-
className: "newspack-settings__min-max",
|
|
43
|
-
children: [(0, _jsxRuntime.jsx)(_components.CheckboxControl, {
|
|
44
|
-
checked: max > 0,
|
|
45
|
-
onChange: value => onChangeMax(value ? min || 1 : 0),
|
|
46
|
-
label: __('Max', 'newspack')
|
|
47
|
-
}), (0, _jsxRuntime.jsx)(_.TextControl, {
|
|
48
|
-
type: "number",
|
|
49
|
-
value: max,
|
|
50
|
-
placeholder: maxPlaceholder,
|
|
51
|
-
onChange: value => onChangeMax(value > 0 ? value : 0)
|
|
52
|
-
})]
|
|
53
|
-
})]
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
var _default = MinMaxSetting;
|
|
57
|
-
exports.default = _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _ = require("../");
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const SettingSection = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
title,
|
|
16
|
-
description,
|
|
17
|
-
children
|
|
18
|
-
} = _ref;
|
|
19
|
-
return (0, _jsxRuntime.jsxs)(_.Grid, {
|
|
20
|
-
columns: 1,
|
|
21
|
-
gutter: 8,
|
|
22
|
-
className: "newspack-settings__section",
|
|
23
|
-
children: [(0, _jsxRuntime.jsxs)("div", {
|
|
24
|
-
className: "newspack-settings__section__title",
|
|
25
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
|
26
|
-
children: title
|
|
27
|
-
}), description && (0, _jsxRuntime.jsx)(_.InfoButton, {
|
|
28
|
-
text: description
|
|
29
|
-
})]
|
|
30
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
|
31
|
-
className: "newspack-settings__section__content",
|
|
32
|
-
children: children
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var _default = SettingSection;
|
|
37
|
-
exports.default = _default;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Style Card
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
@use '../../../shared/scss/colors';
|
|
6
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
7
|
-
|
|
8
|
-
.newspack-style-card {
|
|
9
|
-
margin: 32px 0;
|
|
10
|
-
width: 100%;
|
|
11
|
-
|
|
12
|
-
// Title
|
|
13
|
-
&__title {
|
|
14
|
-
margin: 1em 0 0;
|
|
15
|
-
text-align: center;
|
|
16
|
-
|
|
17
|
-
.newspack-style-card__is-active & {
|
|
18
|
-
color: colors.$primary-500;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Image
|
|
23
|
-
&__image {
|
|
24
|
-
border: 1px solid wp-colors.$gray-300;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
position: relative;
|
|
28
|
-
|
|
29
|
-
&:hover,
|
|
30
|
-
&:focus,
|
|
31
|
-
&:focus-within {
|
|
32
|
-
.newspack-style-card__actions,
|
|
33
|
-
.newspack-style-card__actions > * {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
img,
|
|
39
|
-
svg {
|
|
40
|
-
display: block;
|
|
41
|
-
height: auto;
|
|
42
|
-
max-width: 100%;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
svg {
|
|
46
|
-
fill: wp-colors.$gray-600;
|
|
47
|
-
margin: 8px;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.newspack-style-card__is-active & {
|
|
51
|
-
border-color: colors.$primary-500;
|
|
52
|
-
box-shadow: inset 0 0 0 1px colors.$primary-500;
|
|
53
|
-
|
|
54
|
-
img {
|
|
55
|
-
position: relative;
|
|
56
|
-
z-index: -1;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Actions
|
|
62
|
-
&__actions {
|
|
63
|
-
align-items: center;
|
|
64
|
-
background: rgba( white, 0.9 );
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
justify-content: center;
|
|
68
|
-
inset: 0;
|
|
69
|
-
opacity: 0;
|
|
70
|
-
padding: 16px;
|
|
71
|
-
position: absolute;
|
|
72
|
-
transition: opacity 125ms ease-in-out;
|
|
73
|
-
|
|
74
|
-
&:empty {
|
|
75
|
-
display: none;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&__badge,
|
|
79
|
-
.components-button {
|
|
80
|
-
margin: 4px;
|
|
81
|
-
opacity: 0;
|
|
82
|
-
transition: opacity 125ms ease-in-out;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
&__badge {
|
|
86
|
-
color: var( --wp-admin-theme-color );
|
|
87
|
-
font-weight: bold;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.newspack-style-card__is-active & {
|
|
91
|
-
box-shadow: inset 0 0 0 1px colors.$primary-500;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
package/dist/cjs/style.scss
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
@use '~@wordpress/base-styles/colors' as wp-colors;
|
|
2
|
-
|
|
3
|
-
// Buttons Card
|
|
4
|
-
|
|
5
|
-
.newspack-buttons-card {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: row-reverse;
|
|
8
|
-
gap: 16px;
|
|
9
|
-
justify-content: flex-start;
|
|
10
|
-
align-items: center;
|
|
11
|
-
margin: 64px 0 32px;
|
|
12
|
-
|
|
13
|
-
&:empty {
|
|
14
|
-
display: none;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Checkbox Icon
|
|
19
|
-
|
|
20
|
-
.newspack-checkbox-icon {
|
|
21
|
-
background: white;
|
|
22
|
-
border-radius: 50%;
|
|
23
|
-
box-shadow: inset 0 0 0 1px wp-colors.$gray-300;
|
|
24
|
-
display: block;
|
|
25
|
-
height: 24px;
|
|
26
|
-
width: 24px;
|
|
27
|
-
|
|
28
|
-
svg {
|
|
29
|
-
fill: wp-colors.$gray-700;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&--checked {
|
|
33
|
-
background: wp-colors.$alert-green;
|
|
34
|
-
box-shadow: none;
|
|
35
|
-
|
|
36
|
-
svg {
|
|
37
|
-
fill: white;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
&--pending {
|
|
41
|
-
background: wp-colors.$alert-yellow;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _element = require("@wordpress/element");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
require("./style.scss");
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
14
|
-
/**
|
|
15
|
-
* Text Control
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* WordPress dependencies
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
const __ = _i18n.__;
|
|
24
|
-
/**
|
|
25
|
-
* External dependencies
|
|
26
|
-
*/
|
|
27
|
-
class TextControl extends _element.Component {
|
|
28
|
-
constructor(props) {
|
|
29
|
-
super(props);
|
|
30
|
-
this.wrapperRef = (0, _element.createRef)();
|
|
31
|
-
}
|
|
32
|
-
componentDidMount() {
|
|
33
|
-
if (this.wrapperRef.current) {
|
|
34
|
-
const labelEl = this.wrapperRef.current.querySelector('label');
|
|
35
|
-
if (labelEl) {
|
|
36
|
-
labelEl.setAttribute('data-required-text', __('(required)', 'newspack'));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Render.
|
|
42
|
-
*/
|
|
43
|
-
render() {
|
|
44
|
-
const {
|
|
45
|
-
className,
|
|
46
|
-
required,
|
|
47
|
-
isWide,
|
|
48
|
-
withMargin = true,
|
|
49
|
-
...otherProps
|
|
50
|
-
} = this.props;
|
|
51
|
-
const classes = (0, _classnames.default)('newspack-text-control', {
|
|
52
|
-
'newspack-text-control--wide': isWide
|
|
53
|
-
}, {
|
|
54
|
-
'newspack-text-control--with-margin': withMargin
|
|
55
|
-
}, className);
|
|
56
|
-
return required ? (0, _jsxRuntime.jsx)("div", {
|
|
57
|
-
ref: this.wrapperRef,
|
|
58
|
-
className: "newspack-text-control--required",
|
|
59
|
-
children: (0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
60
|
-
className: classes,
|
|
61
|
-
required: required,
|
|
62
|
-
...otherProps
|
|
63
|
-
})
|
|
64
|
-
}) : (0, _jsxRuntime.jsx)(_components.TextControl, {
|
|
65
|
-
className: classes,
|
|
66
|
-
...otherProps
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
var _default = TextControl;
|
|
71
|
-
exports.default = _default;
|
package/dist/cjs/utils/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const InteractiveDiv = _ref => {
|
|
14
|
-
let {
|
|
15
|
-
style = {},
|
|
16
|
-
...props
|
|
17
|
-
} = _ref;
|
|
18
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
19
|
-
tabIndex: "0",
|
|
20
|
-
role: "button",
|
|
21
|
-
onKeyDown: event => _keycodes.ENTER === event.keyCode && props.onClick(),
|
|
22
|
-
style: {
|
|
23
|
-
cursor: 'pointer',
|
|
24
|
-
...style
|
|
25
|
-
},
|
|
26
|
-
...props
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const confirmAction = message => {
|
|
30
|
-
// eslint-disable-next-line no-alert
|
|
31
|
-
if (confirm(message)) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
};
|
|
36
|
-
var _default = {
|
|
37
|
-
InteractiveDiv,
|
|
38
|
-
confirmAction
|
|
39
|
-
};
|
|
40
|
-
exports.default = _default;
|