@manuscripts/article-editor 1.9.27 → 1.9.28
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/README.md +0 -3
- package/dist/cjs/EditorApp.js +3 -5
- package/dist/cjs/EditorApp.js.map +1 -1
- package/dist/cjs/Main.js +0 -2
- package/dist/cjs/Main.js.map +1 -1
- package/dist/cjs/config.js +0 -1
- package/dist/cjs/config.js.map +1 -1
- package/dist/es/EditorApp.js +3 -5
- package/dist/es/EditorApp.js.map +1 -1
- package/dist/es/Main.js +0 -2
- package/dist/es/Main.js.map +1 -1
- package/dist/es/config.js +0 -1
- package/dist/es/config.js.map +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/Panel.d.ts +1 -1
- package/dist/types/components/nav/Dropdown.d.ts +1 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/hooks/use-track-attrs-popper.d.ts +1 -1
- package/package.json +2 -4
- package/dist/cjs/components/NotificationMessage.js +0 -61
- package/dist/cjs/components/NotificationMessage.js.map +0 -1
- package/dist/cjs/components/NotificationProvider.js +0 -88
- package/dist/cjs/components/NotificationProvider.js.map +0 -1
- package/dist/cjs/components/Notifications.js +0 -96
- package/dist/cjs/components/Notifications.js.map +0 -1
- package/dist/cjs/components/ServiceWorker.js +0 -79
- package/dist/cjs/components/ServiceWorker.js.map +0 -1
- package/dist/es/components/NotificationMessage.js +0 -33
- package/dist/es/components/NotificationMessage.js.map +0 -1
- package/dist/es/components/NotificationProvider.js +0 -58
- package/dist/es/components/NotificationProvider.js.map +0 -1
- package/dist/es/components/Notifications.js +0 -89
- package/dist/es/components/Notifications.js.map +0 -1
- package/dist/es/components/ServiceWorker.js +0 -48
- package/dist/es/components/ServiceWorker.js.map +0 -1
- package/dist/types/components/NotificationMessage.d.ts +0 -21
- package/dist/types/components/NotificationProvider.d.ts +0 -28
- package/dist/types/components/Notifications.d.ts +0 -28
- package/dist/types/components/ServiceWorker.d.ts +0 -20
package/README.md
CHANGED
|
@@ -247,9 +247,6 @@ The service is configured using environment variables, `.env.example` file place
|
|
|
247
247
|
<dt>PUBLISH_TEMPLATES</dt>
|
|
248
248
|
<dd>If set to '1', enables the ability to publish template.</dd>
|
|
249
249
|
|
|
250
|
-
<dt>SERVICEWORKER_ENABLED</dt>
|
|
251
|
-
<dd>When set to '1', application is built with its [service worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) enabled. Essential for offline support.</dd>
|
|
252
|
-
|
|
253
250
|
<dt>SHACKLES_ENABLED</dt>
|
|
254
251
|
<dd>If set to '1', enables the ability to show history (snapshots).</dd>
|
|
255
252
|
|
package/dist/cjs/EditorApp.js
CHANGED
|
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
30
|
const react_router_dom_1 = require("react-router-dom");
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
-
const NotificationProvider_1 = require("./components/NotificationProvider");
|
|
33
32
|
const Page_1 = require("./components/Page");
|
|
34
33
|
const Placeholders_1 = require("./components/Placeholders");
|
|
35
34
|
const ManuscriptPageContainer_1 = __importDefault(require("./components/projects/ManuscriptPageContainer"));
|
|
@@ -71,10 +70,9 @@ const EditorApp = ({ parentObserver, manuscriptID, projectID, permittedActions,
|
|
|
71
70
|
}, [manuscriptID, projectID]);
|
|
72
71
|
return store ? (react_1.default.createElement(store_1.GenericStoreProvider, { store: store },
|
|
73
72
|
react_1.default.createElement(react_router_dom_1.BrowserRouter, null,
|
|
74
|
-
react_1.default.createElement(
|
|
75
|
-
react_1.default.createElement(
|
|
76
|
-
react_1.default.createElement(
|
|
77
|
-
react_1.default.createElement(ManuscriptPageContainer_1.default, null))))))) : (react_1.default.createElement(Placeholders_1.ProjectPlaceholder, null));
|
|
73
|
+
react_1.default.createElement(Page_1.Page, null,
|
|
74
|
+
react_1.default.createElement(Wrapper, null,
|
|
75
|
+
react_1.default.createElement(ManuscriptPageContainer_1.default, null)))))) : (react_1.default.createElement(Placeholders_1.ProjectPlaceholder, null));
|
|
78
76
|
};
|
|
79
77
|
exports.default = EditorApp;
|
|
80
78
|
//# sourceMappingURL=EditorApp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,+CAAkD;AAClD,uDAA0D;AAC1D,0EAAsC;AAEtC,
|
|
1
|
+
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,+CAAkD;AAClD,uDAA0D;AAC1D,0EAAsC;AAEtC,4CAAwC;AACxC,4DAA8D;AAC9D,4GAAmF;AACnF,qCAA6C;AAC7C,wEAA+C;AAC/C,gGAAuE;AACvE,yDAAqD;AACrD,mCAKgB;AAahB,MAAM,OAAO,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;CAQzB,CAAA;AAED,MAAM,SAAS,GAAoB,CAAC,EAClC,cAAc,EACd,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,SAAS,GACV,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,IAAA,uBAAgB,GAAE,CAAA;IAEjC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAgB,CAAA;IAElD,MAAM,OAAO,GAAG,IAAA,uBAAU,EAAC,SAAS,CAAC,CAAA;IACrC,MAAM,iBAAiB,GAAG,IAAI,+BAAqB,CAAC,OAAO,CAAC,CAAA;IAE5D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,8DAA8D;QAC9D,MAAM,WAAW,GAAG,IAAI,mBAAW,CACjC,cAAc,EACd,SAAS,EACT,YAAY,EACZ,KAAK,EACL,gBAAgB,EAChB,MAAM,IAAI,EAAE,EACZ,SAAS,IAAI,EAAE,CAChB,CAAA;QACD,MAAM,UAAU,GAAG,IAAI,kBAAQ,CAAC,KAAK,CAAC,CAAA;QACtC,IAAA,mBAAW,EACT,CAAC,WAAW,EAAE,UAAU,EAAE,iBAAiB,CAAC,EAC5C,SAAS,EACT,SAAS,EACT,cAAc,CACf;aACE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;YACd,QAAQ,CAAC,KAAK,CAAC,CAAA;QACjB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;QACJ,OAAO,GAAG,EAAE;YACV,cAAc,EAAE,MAAM,EAAE,CAAA;YACxB,KAAK,EAAE,OAAO,EAAE,CAAA;QAClB,CAAC,CAAA;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAA;IAE7B,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,8BAAC,4BAAoB,IAAC,KAAK,EAAE,KAAK;QAChC,8BAAC,gCAAM;YACL,8BAAC,WAAI;gBACH,8BAAC,OAAO;oBACN,8BAAC,iCAAuB,OAAG,CACnB,CACL,CACA,CACY,CACxB,CAAC,CAAC,CAAC,CACF,8BAAC,iCAAkB,OAAG,CACvB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
|
package/dist/cjs/Main.js
CHANGED
|
@@ -17,14 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const react_dnd_1 = require("react-dnd");
|
|
19
19
|
const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
|
20
|
-
const ServiceWorker_1 = require("./components/ServiceWorker");
|
|
21
20
|
const EditorApp_1 = __importDefault(require("./EditorApp"));
|
|
22
21
|
const theme_1 = require("./theme/theme");
|
|
23
22
|
// projectID="MPProject:E1895468-4DFE-4F17-9B06-5212ECD29555"
|
|
24
23
|
// manuscriptID="MPManuscript:5F6D807F-CECF-45D0-B94C-5CF1361BDF05"
|
|
25
24
|
const Main = ({ fileManagement, files, parentObserver, manuscriptID, projectID, authToken, permittedActions, }) => (react_1.default.createElement(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.HTML5Backend },
|
|
26
25
|
react_1.default.createElement(theme_1.GlobalStyle, null),
|
|
27
|
-
react_1.default.createElement(ServiceWorker_1.ServiceWorker, null),
|
|
28
26
|
react_1.default.createElement(EditorApp_1.default, { fileManagement: fileManagement, files: files, parentObserver: parentObserver, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, authToken: authToken })));
|
|
29
27
|
exports.default = Main;
|
|
30
28
|
//# sourceMappingURL=Main.js.map
|
package/dist/cjs/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAGH,kDAAyB;AACzB,yCAAuC;AACvC,qEAAsD;AAEtD,
|
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;AAGH,kDAAyB;AACzB,yCAAuC;AACvC,qEAAsD;AAEtD,4DAAmC;AAEnC,yCAA2C;AAY3C,6DAA6D;AAC7D,mEAAmE;AAEnE,MAAM,IAAI,GAAoB,CAAC,EAC7B,cAAc,EACd,KAAK,EACL,cAAc,EACd,YAAY,EACZ,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,EAAE,EAAE,CAAC,CACJ,8BAAC,uBAAW,IAAC,OAAO,EAAE,sCAAY;IAChC,8BAAC,mBAAW,OAAG;IACf,8BAAC,mBAAS,IACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,GACpB,CACU,CACf,CAAA;AAED,kBAAe,IAAI,CAAA"}
|
package/dist/cjs/config.js
CHANGED
package/dist/cjs/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,MAAM,MAAM,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC3C,OAAO,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,MAAM,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC/C,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;AACtC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;AAEH,MAAM,MAAM,GAAG,CAAC,KAAyB,EAAE,EAAE;IAC3C,OAAO,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,MAAM,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,GAAuB,EAAE,EAAE;IAC/C,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;AACtC,CAAC,CAAA;AA+BD,MAAM,MAAM,GAAG;IACb,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IACjC,SAAS,EAAE;QACT,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB;KACpC;IACD,GAAG,EAAE;QACH,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAClD,OAAO,EAAE,EAAE;KACZ;IACD,QAAQ,EAAE;QACR,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;QAC7D,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAChD,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;QAC3D,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAChD,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;QACpC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACvD,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACvD,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;KACpD;IACD,OAAO,EAAE;QACP,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,4BAA4B;KACjE;IACD,WAAW,EAAE;QACX,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAChD,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;KACrD;IACD,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;CACpE,CAAA;AAED,kBAAe,MAAgB,CAAA"}
|
package/dist/es/EditorApp.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { BrowserRouter as Router } from 'react-router-dom';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { NotificationProvider } from './components/NotificationProvider';
|
|
5
4
|
import { Page } from './components/Page';
|
|
6
5
|
import { ProjectPlaceholder } from './components/Placeholders';
|
|
7
6
|
import ManuscriptPageContainer from './components/projects/ManuscriptPageContainer';
|
|
@@ -43,10 +42,9 @@ const EditorApp = ({ parentObserver, manuscriptID, projectID, permittedActions,
|
|
|
43
42
|
}, [manuscriptID, projectID]);
|
|
44
43
|
return store ? (React.createElement(GenericStoreProvider, { store: store },
|
|
45
44
|
React.createElement(Router, null,
|
|
46
|
-
React.createElement(
|
|
47
|
-
React.createElement(
|
|
48
|
-
React.createElement(
|
|
49
|
-
React.createElement(ManuscriptPageContainer, null))))))) : (React.createElement(ProjectPlaceholder, null));
|
|
45
|
+
React.createElement(Page, null,
|
|
46
|
+
React.createElement(Wrapper, null,
|
|
47
|
+
React.createElement(ManuscriptPageContainer, null)))))) : (React.createElement(ProjectPlaceholder, null));
|
|
50
48
|
};
|
|
51
49
|
export default EditorApp;
|
|
52
50
|
//# sourceMappingURL=EditorApp.js.map
|
package/dist/es/EditorApp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"EditorApp.js","sourceRoot":"","sources":["../../src/EditorApp.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,uBAAuB,MAAM,+CAA+C,CA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AAA;QAClB,CAAC,CAAC,CAAA;QACJ,OAAO,GAAG,EAAE;YACV,cAAc,EAAE,MAAM,EAAE,CAAA;YACxB,KAAK,EAAE,OAAO,EAAE,CAAA;QAClB,CAAC,CAAA;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAA;IAE7B,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,oBAAC,oBAAoB,IAAC,KAAK,EAAE,KAAK;QAChC,oBAAC,MAAM;YACL,oBAAC,IAAI;gBACH,oBAAC,OAAO;oBACN,oBAAC,uBAAuB,OAAG,CACnB,CACL,CACA,CACY,CACxB,CAAC,CAAC,CAAC,CACF,oBAAC,kBAAkB,OAAG,CACvB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
package/dist/es/Main.js
CHANGED
|
@@ -12,14 +12,12 @@
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { DndProvider } from 'react-dnd';
|
|
14
14
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
15
|
-
import { ServiceWorker } from './components/ServiceWorker';
|
|
16
15
|
import EditorApp from './EditorApp';
|
|
17
16
|
import { GlobalStyle } from './theme/theme';
|
|
18
17
|
// projectID="MPProject:E1895468-4DFE-4F17-9B06-5212ECD29555"
|
|
19
18
|
// manuscriptID="MPManuscript:5F6D807F-CECF-45D0-B94C-5CF1361BDF05"
|
|
20
19
|
const Main = ({ fileManagement, files, parentObserver, manuscriptID, projectID, authToken, permittedActions, }) => (React.createElement(DndProvider, { backend: HTML5Backend },
|
|
21
20
|
React.createElement(GlobalStyle, null),
|
|
22
|
-
React.createElement(ServiceWorker, null),
|
|
23
21
|
React.createElement(EditorApp, { fileManagement: fileManagement, files: files, parentObserver: parentObserver, manuscriptID: manuscriptID, projectID: projectID, permittedActions: permittedActions, authToken: authToken })));
|
|
24
22
|
export default Main;
|
|
25
23
|
//# sourceMappingURL=Main.js.map
|
package/dist/es/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,
|
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAY3C,6DAA6D;AAC7D,mEAAmE;AAEnE,MAAM,IAAI,GAAoB,CAAC,EAC7B,cAAc,EACd,KAAK,EACL,cAAc,EACd,YAAY,EACZ,SAAS,EACT,SAAS,EACT,gBAAgB,GACjB,EAAE,EAAE,CAAC,CACJ,oBAAC,WAAW,IAAC,OAAO,EAAE,YAAY;IAChC,oBAAC,WAAW,OAAG;IACf,oBAAC,SAAS,IACR,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,GACpB,CACU,CACf,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/dist/es/config.js
CHANGED
package/dist/es/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MA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,GAAG,CAAC,WAAW,CAAC;QACpC,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACvD,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;QACvD,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;KACpD;IACD,OAAO,EAAE;QACP,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,4BAA4B;KACjE;IACD,WAAW,EAAE;QACX,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;QAChD,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE;KACrD;IACD,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC;CACpE,CAAA;AAED,eAAe,MAAgB,CAAA"}
|
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
export declare const Subheading: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
14
14
|
export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
15
|
export declare const ExpanderButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
16
|
-
type: "button" | "
|
|
16
|
+
type: "button" | "reset" | "submit";
|
|
17
17
|
} & {
|
|
18
18
|
danger?: boolean | undefined;
|
|
19
19
|
disabled?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ export interface ResizerButtonInnerProps {
|
|
|
16
16
|
isVisible: boolean;
|
|
17
17
|
}
|
|
18
18
|
export declare const ResizerButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
19
|
-
type: "button" | "
|
|
19
|
+
type: "button" | "reset" | "submit";
|
|
20
20
|
} & {
|
|
21
21
|
danger?: boolean | undefined;
|
|
22
22
|
disabled?: boolean | undefined;
|
|
@@ -21,7 +21,7 @@ interface DropdownProps {
|
|
|
21
21
|
}
|
|
22
22
|
export declare const DropdownToggle: import("styled-components").StyledComponent<import("react").SFC<import("react").SVGAttributes<SVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
23
23
|
export declare const DropdownButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
24
|
-
type: "button" | "
|
|
24
|
+
type: "button" | "reset" | "submit";
|
|
25
25
|
} & {
|
|
26
26
|
danger?: boolean | undefined;
|
|
27
27
|
disabled?: boolean | undefined;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const TrackAttrsPopperContent: React.FC<{
|
|
|
17
17
|
updateState: (cmd: Command) => void;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const TrackChangesButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
20
|
-
type: "button" | "
|
|
20
|
+
type: "button" | "reset" | "submit";
|
|
21
21
|
} & {
|
|
22
22
|
danger?: boolean | undefined;
|
|
23
23
|
disabled?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/article-editor",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.28",
|
|
4
4
|
"license": "CPAL-1.0",
|
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
|
@@ -61,11 +61,9 @@
|
|
|
61
61
|
"react-router": "^5.3.4",
|
|
62
62
|
"react-router-dom": "^5.3.4",
|
|
63
63
|
"react-select": "^5.7.3",
|
|
64
|
-
"react-spring": "^8.0.25",
|
|
65
64
|
"styled-components": "^5.2.0",
|
|
66
65
|
"type-fest": "^4.6.0",
|
|
67
|
-
"uuid": "^9.0.0"
|
|
68
|
-
"workbox-window": "^6.5.4"
|
|
66
|
+
"uuid": "^9.0.0"
|
|
69
67
|
},
|
|
70
68
|
"devDependencies": {
|
|
71
69
|
"@babel/core": "^7.20.5",
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.Notification = exports.createNotification = void 0;
|
|
38
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
|
39
|
-
const react_1 = __importStar(require("react"));
|
|
40
|
-
const NotificationProvider_1 = require("./NotificationProvider");
|
|
41
|
-
const Notifications_1 = require("./Notifications");
|
|
42
|
-
const createNotification = ({ id, message }) => (props) => (react_1.default.createElement(Notifications_1.NotificationPrompt, null,
|
|
43
|
-
react_1.default.createElement(Notifications_1.NotificationHead, null,
|
|
44
|
-
react_1.default.createElement(Notifications_1.NotificationIcon, null),
|
|
45
|
-
react_1.default.createElement(Notifications_1.NotificationMessage, null,
|
|
46
|
-
react_1.default.createElement(Notifications_1.NotificationTitle, null, message))),
|
|
47
|
-
react_1.default.createElement(Notifications_1.NotificationActions, null,
|
|
48
|
-
react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: props.removeNotification }, "Dismiss"))));
|
|
49
|
-
exports.createNotification = createNotification;
|
|
50
|
-
const Notification = ({ children, message, id }) => {
|
|
51
|
-
const { removeNotification, showNotification } = (0, react_1.useContext)(NotificationProvider_1.NotificationContext);
|
|
52
|
-
(0, react_1.useEffect)(() => {
|
|
53
|
-
showNotification(id, (0, exports.createNotification)({ id, message }));
|
|
54
|
-
return () => {
|
|
55
|
-
removeNotification(id);
|
|
56
|
-
};
|
|
57
|
-
}, [id, message, removeNotification, showNotification]);
|
|
58
|
-
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
59
|
-
};
|
|
60
|
-
exports.Notification = Notification;
|
|
61
|
-
//# sourceMappingURL=NotificationMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationMessage.js","sourceRoot":"","sources":["../../../src/components/NotificationMessage.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAA0D;AAC1D,+CAAoD;AAEpD,iEAG+B;AAC/B,mDAOwB;AAEjB,MAAM,kBAAkB,GAC7B,CAAC,EAAE,EAAE,EAAE,OAAO,EAAmC,EAAyB,EAAE,CAC5E,CAAC,KAAK,EAAE,EAAE,CACR,CACE,8BAAC,kCAAkB;IACjB,8BAAC,gCAAgB;QACf,8BAAC,gCAAgB,OAAG;QACpB,8BAAC,mCAAmB;YAClB,8BAAC,iCAAiB,QAAE,OAAO,CAAqB,CAC5B,CACL;IACnB,8BAAC,mCAAmB;QAClB,8BAAC,6BAAe,IAAC,OAAO,EAAE,KAAK,CAAC,kBAAkB,cAEhC,CACE,CACH,CACtB,CAAA;AAjBQ,QAAA,kBAAkB,sBAiB1B;AAEE,MAAM,YAAY,GAGpB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE;IACjC,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,GAC5C,IAAA,kBAAU,EAAC,0CAAmB,CAAC,CAAA;IAEjC,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,EAAE,EAAE,IAAA,0BAAkB,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QAEzD,OAAO,GAAG,EAAE;YACV,kBAAkB,CAAC,EAAE,CAAC,CAAA;QACxB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAA;IAEvD,OAAO,8DAAG,QAAQ,CAAI,CAAA;AACxB,CAAC,CAAA;AAhBY,QAAA,YAAY,gBAgBxB"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.NotificationProvider = exports.NotificationContext = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
|
-
const react_dom_1 = __importDefault(require("react-dom"));
|
|
43
|
-
const Notifications_1 = require("./Notifications");
|
|
44
|
-
exports.NotificationContext = react_1.default.createContext({
|
|
45
|
-
showNotification: () => null,
|
|
46
|
-
removeNotification: () => null,
|
|
47
|
-
});
|
|
48
|
-
const NotificationProvider = ({ children }) => {
|
|
49
|
-
const [state, setState] = (0, react_1.useState)({
|
|
50
|
-
notifications: [],
|
|
51
|
-
});
|
|
52
|
-
const showNotification = (id, notification) => {
|
|
53
|
-
setState((state) => {
|
|
54
|
-
const item = { id, notification };
|
|
55
|
-
return {
|
|
56
|
-
...state,
|
|
57
|
-
notifications: [
|
|
58
|
-
item,
|
|
59
|
-
...state.notifications.filter((item) => item.id !== id),
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
const removeNotification = (id) => {
|
|
65
|
-
setState((state) => ({
|
|
66
|
-
...state,
|
|
67
|
-
notifications: state.notifications.filter((notification) => notification.id !== id),
|
|
68
|
-
}));
|
|
69
|
-
};
|
|
70
|
-
const value = {
|
|
71
|
-
removeNotification,
|
|
72
|
-
showNotification,
|
|
73
|
-
};
|
|
74
|
-
// const history = useHistory()
|
|
75
|
-
// const location = useLocation()
|
|
76
|
-
const renderNotifications = () => {
|
|
77
|
-
const notifications = state.notifications;
|
|
78
|
-
if (!notifications.length) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
return react_dom_1.default.createPortal(react_1.default.createElement(Notifications_1.Notifications, { items: notifications, removeNotification: removeNotification }), document.getElementById('notifications'));
|
|
82
|
-
};
|
|
83
|
-
return (react_1.default.createElement(exports.NotificationContext.Provider, { value: value },
|
|
84
|
-
children,
|
|
85
|
-
renderNotifications()));
|
|
86
|
-
};
|
|
87
|
-
exports.NotificationProvider = NotificationProvider;
|
|
88
|
-
//# sourceMappingURL=NotificationProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationProvider.js","sourceRoot":"","sources":["../../../src/components/NotificationProvider.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAuC;AACvC,0DAAgC;AAEhC,mDAA+C;AA0BlC,QAAA,mBAAmB,GAAG,eAAK,CAAC,aAAa,CAAoB;IACxE,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI;IAC5B,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI;CAC/B,CAAC,CAAA;AAMK,MAAM,oBAAoB,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAQ;QACxC,aAAa,EAAE,EAAE;KAClB,CAAC,CAAA;IAEF,MAAM,gBAAgB,GAAqB,CAAC,EAAE,EAAE,YAAY,EAAE,EAAE;QAC9D,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,MAAM,IAAI,GAAqB,EAAE,EAAE,EAAE,YAAY,EAAE,CAAA;YAEnD,OAAO;gBACL,GAAG,KAAK;gBACR,aAAa,EAAE;oBACb,IAAI;oBACJ,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;iBACxD;aACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,MAAM,kBAAkB,GAAG,CAAC,EAAU,EAAE,EAAE;QACxC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACnB,GAAG,KAAK;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,CACvC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CACzC;SACF,CAAC,CAAC,CAAA;IACL,CAAC,CAAA;IAED,MAAM,KAAK,GAAsB;QAC/B,kBAAkB;QAClB,gBAAgB;KACjB,CAAA;IAED,+BAA+B;IAC/B,iCAAiC;IAEjC,MAAM,mBAAmB,GAAG,GAAG,EAAE;QAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAA;QAEzC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YACzB,OAAO,IAAI,CAAA;SACZ;QAED,OAAO,mBAAQ,CAAC,YAAY,CAC1B,8BAAC,6BAAa,IACZ,KAAK,EAAE,aAAa,EACpB,kBAAkB,EAAE,kBAAkB,GACtC,EACF,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAE,CAC1C,CAAA;IACH,CAAC,CAAA;IAED,OAAO,CACL,8BAAC,2BAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;QACvC,QAAQ;QACR,mBAAmB,EAAE,CACO,CAChC,CAAA;AACH,CAAC,CAAA;AA1DY,QAAA,oBAAoB,wBA0DhC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NotificationMessage = exports.NotificationLink = exports.NotificationTitle = exports.NotificationIcon = exports.NotificationActions = exports.NotificationHead = exports.NotificationPrompt = exports.Notifications = void 0;
|
|
18
|
-
const AttentionBlue_1 = __importDefault(require("@manuscripts/assets/react/AttentionBlue"));
|
|
19
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
|
20
|
-
const react_1 = __importDefault(require("react"));
|
|
21
|
-
const renderprops_cjs_1 = require("react-spring/renderprops.cjs");
|
|
22
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
23
|
-
const Notifications = ({ items, removeNotification, ...rest }) => (react_1.default.createElement(Container, null,
|
|
24
|
-
react_1.default.createElement(renderprops_cjs_1.Transition, { items: items, keys: (item) => item.id, from: {
|
|
25
|
-
transform: 'translate3d(0, 100%, 0)',
|
|
26
|
-
opacity: 0,
|
|
27
|
-
marginBottom: 0,
|
|
28
|
-
}, enter: {
|
|
29
|
-
transform: 'translate3d(0, 0, 0)',
|
|
30
|
-
opacity: 1,
|
|
31
|
-
marginBottom: 8,
|
|
32
|
-
display: 'flex',
|
|
33
|
-
width: window.innerWidth < 800 ? window.innerWidth - 16 : 800,
|
|
34
|
-
maxWidth: '90%',
|
|
35
|
-
}, leave: {
|
|
36
|
-
opacity: 0,
|
|
37
|
-
marginBottom: 0,
|
|
38
|
-
} }, ({ id, notification: Notification, }) => (props) => (react_1.default.createElement("div", { style: props },
|
|
39
|
-
react_1.default.createElement(Notification, { key: id, removeNotification: () => removeNotification(id), ...rest }))))));
|
|
40
|
-
exports.Notifications = Notifications;
|
|
41
|
-
const Container = styled_components_1.default.div `
|
|
42
|
-
position: fixed;
|
|
43
|
-
bottom: 0px;
|
|
44
|
-
left: 50%;
|
|
45
|
-
transform: translateX(-50%);
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
align-items: center;
|
|
49
|
-
z-index: 100;
|
|
50
|
-
`;
|
|
51
|
-
exports.NotificationPrompt = styled_components_1.default.div `
|
|
52
|
-
border: 1px solid ${(props) => props.theme.colors.text.muted};
|
|
53
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
54
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
55
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
56
|
-
${(props) => props.theme.grid.unit * 2}px
|
|
57
|
-
${(props) => props.theme.grid.unit * 2}px
|
|
58
|
-
${(props) => props.theme.grid.unit * 4}px;
|
|
59
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
60
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: space-between;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
width: 100%;
|
|
65
|
-
`;
|
|
66
|
-
exports.NotificationHead = styled_components_1.default.div `
|
|
67
|
-
display: flex;
|
|
68
|
-
align-items: center;
|
|
69
|
-
`;
|
|
70
|
-
exports.NotificationActions = (0, styled_components_1.default)(style_guide_1.ButtonGroup) `
|
|
71
|
-
flex: 0;
|
|
72
|
-
|
|
73
|
-
@media (max-width: ${(props) => props.theme.grid.tablet - 1}px) {
|
|
74
|
-
flex-wrap: wrap;
|
|
75
|
-
|
|
76
|
-
button:not(:first-child) {
|
|
77
|
-
margin: ${(props) => props.theme.grid.unit}px 0 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
`;
|
|
81
|
-
exports.NotificationIcon = (0, styled_components_1.default)(AttentionBlue_1.default) `
|
|
82
|
-
flex-shrink: 0;
|
|
83
|
-
`;
|
|
84
|
-
exports.NotificationTitle = styled_components_1.default.div `
|
|
85
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
|
86
|
-
`;
|
|
87
|
-
exports.NotificationLink = styled_components_1.default.a.attrs({ target: '_blank' }) `
|
|
88
|
-
color: inherit;
|
|
89
|
-
font-size: ${(props) => props.theme.font.size.small};
|
|
90
|
-
`;
|
|
91
|
-
exports.NotificationMessage = styled_components_1.default.div `
|
|
92
|
-
margin: 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
93
|
-
display: flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
`;
|
|
96
|
-
//# sourceMappingURL=Notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../src/components/Notifications.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;AAEH,4FAAmE;AACnE,0DAAsD;AACtD,kDAAyB;AACzB,kEAAyD;AACzD,0EAAsC;AAS/B,MAAM,aAAa,GAAoB,CAAC,EAC7C,KAAK,EACL,kBAAkB,EAClB,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,8BAAC,SAAS;IACR,8BAAC,4BAAU,IACT,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACvB,IAAI,EAAE;YACJ,SAAS,EAAE,yBAAyB;YACpC,OAAO,EAAE,CAAC;YACV,YAAY,EAA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,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;CAGjD,CAAA"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
4
|
-
*
|
|
5
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
6
|
-
*
|
|
7
|
-
* The Original Code is manuscripts-frontend.
|
|
8
|
-
*
|
|
9
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
10
|
-
*
|
|
11
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
12
|
-
*/
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.createUpdateReadyNotification = exports.ServiceWorker = void 0;
|
|
41
|
-
const style_guide_1 = require("@manuscripts/style-guide");
|
|
42
|
-
const react_1 = __importStar(require("react"));
|
|
43
|
-
const workbox_window_1 = require("workbox-window");
|
|
44
|
-
const config_1 = __importDefault(require("../config"));
|
|
45
|
-
const NotificationProvider_1 = require("./NotificationProvider");
|
|
46
|
-
const Notifications_1 = require("./Notifications");
|
|
47
|
-
const ServiceWorker = ({ children }) => {
|
|
48
|
-
if (config_1.default.serviceworker && 'serviceWorker' in navigator) {
|
|
49
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
50
|
-
const { showNotification } = (0, react_1.useContext)(NotificationProvider_1.NotificationContext);
|
|
51
|
-
const wb = new workbox_window_1.Workbox('/service-worker.js');
|
|
52
|
-
// Show a notification when a new version is waiting to take control
|
|
53
|
-
wb.addEventListener('waiting', () => {
|
|
54
|
-
const id = 'sw-active';
|
|
55
|
-
showNotification(id, (0, exports.createUpdateReadyNotification)({
|
|
56
|
-
id,
|
|
57
|
-
handleAccept: () => {
|
|
58
|
-
wb.addEventListener('controlling', () => {
|
|
59
|
-
window.location.reload();
|
|
60
|
-
});
|
|
61
|
-
wb.messageSW({ type: 'SKIP_WAITING' });
|
|
62
|
-
},
|
|
63
|
-
}));
|
|
64
|
-
});
|
|
65
|
-
wb.register();
|
|
66
|
-
}
|
|
67
|
-
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
68
|
-
};
|
|
69
|
-
exports.ServiceWorker = ServiceWorker;
|
|
70
|
-
const createUpdateReadyNotification = ({ handleAccept, id, }) => (props) => (react_1.default.createElement(Notifications_1.NotificationPrompt, null,
|
|
71
|
-
react_1.default.createElement(Notifications_1.NotificationHead, null,
|
|
72
|
-
react_1.default.createElement(Notifications_1.NotificationIcon, null),
|
|
73
|
-
react_1.default.createElement(Notifications_1.NotificationMessage, null,
|
|
74
|
-
react_1.default.createElement(Notifications_1.NotificationTitle, null, "A new version of the app is available on refreshing."))),
|
|
75
|
-
react_1.default.createElement(Notifications_1.NotificationActions, null,
|
|
76
|
-
react_1.default.createElement(style_guide_1.SecondaryButton, { onClick: props.removeNotification }, "Dismiss"),
|
|
77
|
-
react_1.default.createElement(style_guide_1.PrimaryButton, { onClick: handleAccept }, "Refresh"))));
|
|
78
|
-
exports.createUpdateReadyNotification = createUpdateReadyNotification;
|
|
79
|
-
//# sourceMappingURL=ServiceWorker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceWorker.js","sourceRoot":"","sources":["../../../src/components/ServiceWorker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,0DAAyE;AACzE,+CAA4D;AAC5D,mDAAwC;AAExC,uDAA8B;AAC9B,iEAG+B;AAC/B,mDAOwB;AAEjB,MAAM,aAAa,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtD,IAAI,gBAAM,CAAC,aAAa,IAAI,eAAe,IAAI,SAAS,EAAE;QACxD,sDAAsD;QACtD,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAA,kBAAU,EAAC,0CAAmB,CAAC,CAAA;QAE5D,MAAM,EAAE,GAAG,IAAI,wBAAO,CAAC,oBAAoB,CAAC,CAAA;QAE5C,oEAAoE;QACpE,EAAE,CAAC,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE;YAClC,MAAM,EAAE,GAAG,WAAW,CAAA;YAEtB,gBAAgB,CACd,EAAE,EACF,IAAA,qCAA6B,EAAC;gBAC5B,EAAE;gBACF,YAAY,EAAE,GAAG,EAAE;oBACjB,EAAE,CAAC,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE;wBACtC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;oBAC1B,CAAC,CAAC,CAAA;oBAEF,EAAE,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAA;gBACxC,CAAC;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,QAAQ,EAAE,CAAA;KACd;IAED,OAAO,8DAAG,QAAQ,CAAI,CAAA;AACxB,CAAC,CAAA;AA9BY,QAAA,aAAa,iBA8BzB;AAOM,MAAM,6BAA6B,GACxC,CAAC,EACC,YAAY,EACZ,EAAE,GACiC,EAAyB,EAAE,CAChE,CAAC,KAAK,EAAE,EAAE,CACR,CACE,8BAAC,kCAAkB;IACjB,8BAAC,gCAAgB;QACf,8BAAC,gCAAgB,OAAG;QACpB,8BAAC,mCAAmB;YAClB,8BAAC,iCAAiB,+DAEE,CACA,CACL;IACnB,8BAAC,mCAAmB;QAClB,8BAAC,6BAAe,IAAC,OAAO,EAAE,KAAK,CAAC,kBAAkB,cAEhC;QAClB,8BAAC,2BAAa,IAAC,OAAO,EAAE,YAAY,cAAyB,CACzC,CACH,CACtB,CAAA;AAvBQ,QAAA,6BAA6B,iCAuBrC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { SecondaryButton } from '@manuscripts/style-guide';
|
|
13
|
-
import React, { useContext, useEffect } from 'react';
|
|
14
|
-
import { NotificationContext, } from './NotificationProvider';
|
|
15
|
-
import { NotificationActions, NotificationHead, NotificationIcon, NotificationMessage, NotificationPrompt, NotificationTitle, } from './Notifications';
|
|
16
|
-
export const createNotification = ({ id, message }) => (props) => (React.createElement(NotificationPrompt, null,
|
|
17
|
-
React.createElement(NotificationHead, null,
|
|
18
|
-
React.createElement(NotificationIcon, null),
|
|
19
|
-
React.createElement(NotificationMessage, null,
|
|
20
|
-
React.createElement(NotificationTitle, null, message))),
|
|
21
|
-
React.createElement(NotificationActions, null,
|
|
22
|
-
React.createElement(SecondaryButton, { onClick: props.removeNotification }, "Dismiss"))));
|
|
23
|
-
export const Notification = ({ children, message, id }) => {
|
|
24
|
-
const { removeNotification, showNotification } = useContext(NotificationContext);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
showNotification(id, createNotification({ id, message }));
|
|
27
|
-
return () => {
|
|
28
|
-
removeNotification(id);
|
|
29
|
-
};
|
|
30
|
-
}, [id, message, removeNotification, showNotification]);
|
|
31
|
-
return React.createElement(React.Fragment, null, children);
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=NotificationMessage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationMessage.js","sourceRoot":"","sources":["../../../src/components/NotificationMessage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,EAEL,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AAExB,MAAM,CAAC,MAAM,kBAAkB,GAC7B,CAAC,EAAE,EAAE,EAAE,OAAO,EAAmC,EAAyB,EAAE,CAC5E,CAAC,KAAK,EAAE,EAAE,CACR,CACE,oBAAC,kBAAkB;IACjB,oBAAC,gBAAgB;QACf,oBAAC,gBAAgB,OAAG;QACpB,oBAAC,mBAAmB;YAClB,oBAAC,iBAAiB,QAAE,OAAO,CAAqB,CAC5B,CACL;IACnB,oBAAC,mBAAmB;QAClB,oBAAC,eAAe,IAAC,OAAO,EAAE,KAAK,CAAC,kBAAkB,cAEhC,CACE,CACH,CACtB,CAAA;AAEL,MAAM,CAAC,MAAM,YAAY,GAGpB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE;IACjC,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,GAC5C,UAAU,CAAC,mBAAmB,CAAC,CAAA;IAEjC,SAAS,CAAC,GAAG,EAAE;QACb,gBAAgB,CAAC,EAAE,EAAE,kBAAkB,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAA;QAEzD,OAAO,GAAG,EAAE;YACV,kBAAkB,CAAC,EAAE,CAAC,CAAA;QACxB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAA;IAEvD,OAAO,0CAAG,QAAQ,CAAI,CAAA;AACxB,CAAC,CAAA"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React, { useState } from 'react';
|
|
13
|
-
import ReactDOM from 'react-dom';
|
|
14
|
-
import { Notifications } from './Notifications';
|
|
15
|
-
export const NotificationContext = React.createContext({
|
|
16
|
-
showNotification: () => null,
|
|
17
|
-
removeNotification: () => null,
|
|
18
|
-
});
|
|
19
|
-
export const NotificationProvider = ({ children }) => {
|
|
20
|
-
const [state, setState] = useState({
|
|
21
|
-
notifications: [],
|
|
22
|
-
});
|
|
23
|
-
const showNotification = (id, notification) => {
|
|
24
|
-
setState((state) => {
|
|
25
|
-
const item = { id, notification };
|
|
26
|
-
return {
|
|
27
|
-
...state,
|
|
28
|
-
notifications: [
|
|
29
|
-
item,
|
|
30
|
-
...state.notifications.filter((item) => item.id !== id),
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const removeNotification = (id) => {
|
|
36
|
-
setState((state) => ({
|
|
37
|
-
...state,
|
|
38
|
-
notifications: state.notifications.filter((notification) => notification.id !== id),
|
|
39
|
-
}));
|
|
40
|
-
};
|
|
41
|
-
const value = {
|
|
42
|
-
removeNotification,
|
|
43
|
-
showNotification,
|
|
44
|
-
};
|
|
45
|
-
// const history = useHistory()
|
|
46
|
-
// const location = useLocation()
|
|
47
|
-
const renderNotifications = () => {
|
|
48
|
-
const notifications = state.notifications;
|
|
49
|
-
if (!notifications.length) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return ReactDOM.createPortal(React.createElement(Notifications, { items: notifications, removeNotification: removeNotification }), document.getElementById('notifications'));
|
|
53
|
-
};
|
|
54
|
-
return (React.createElement(NotificationContext.Provider, { value: value },
|
|
55
|
-
children,
|
|
56
|
-
renderNotifications()));
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=NotificationProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationProvider.js","sourceRoot":"","sources":["../../../src/components/NotificationProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AA0B/C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CAAoB;IACxE,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI;IAC5B,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI;CAC/B,CAAC,CAAA;AAMF,MAAM,CAAC,MAAM,oBAAoB,GAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAQ;QACxC,aA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C,QAAQ;QACR,mBAAmB,EAAE,CACO,CAChC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import AttentionBlue from '@manuscripts/assets/react/AttentionBlue';
|
|
13
|
-
import { ButtonGroup } from '@manuscripts/style-guide';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import { Transition } from 'react-spring/renderprops.cjs';
|
|
16
|
-
import styled from 'styled-components';
|
|
17
|
-
export const Notifications = ({ items, removeNotification, ...rest }) => (React.createElement(Container, null,
|
|
18
|
-
React.createElement(Transition, { items: items, keys: (item) => item.id, from: {
|
|
19
|
-
transform: 'translate3d(0, 100%, 0)',
|
|
20
|
-
opacity: 0,
|
|
21
|
-
marginBottom: 0,
|
|
22
|
-
}, enter: {
|
|
23
|
-
transform: 'translate3d(0, 0, 0)',
|
|
24
|
-
opacity: 1,
|
|
25
|
-
marginBottom: 8,
|
|
26
|
-
display: 'flex',
|
|
27
|
-
width: window.innerWidth < 800 ? window.innerWidth - 16 : 800,
|
|
28
|
-
maxWidth: '90%',
|
|
29
|
-
}, leave: {
|
|
30
|
-
opacity: 0,
|
|
31
|
-
marginBottom: 0,
|
|
32
|
-
} }, ({ id, notification: Notification, }) => (props) => (React.createElement("div", { style: props },
|
|
33
|
-
React.createElement(Notification, { key: id, removeNotification: () => removeNotification(id), ...rest }))))));
|
|
34
|
-
const Container = styled.div `
|
|
35
|
-
position: fixed;
|
|
36
|
-
bottom: 0px;
|
|
37
|
-
left: 50%;
|
|
38
|
-
transform: translateX(-50%);
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
align-items: center;
|
|
42
|
-
z-index: 100;
|
|
43
|
-
`;
|
|
44
|
-
export const NotificationPrompt = styled.div `
|
|
45
|
-
border: 1px solid ${(props) => props.theme.colors.text.muted};
|
|
46
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
47
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
48
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
49
|
-
${(props) => props.theme.grid.unit * 2}px
|
|
50
|
-
${(props) => props.theme.grid.unit * 2}px
|
|
51
|
-
${(props) => props.theme.grid.unit * 4}px;
|
|
52
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
53
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
54
|
-
display: flex;
|
|
55
|
-
justify-content: space-between;
|
|
56
|
-
box-sizing: border-box;
|
|
57
|
-
width: 100%;
|
|
58
|
-
`;
|
|
59
|
-
export const NotificationHead = styled.div `
|
|
60
|
-
display: flex;
|
|
61
|
-
align-items: center;
|
|
62
|
-
`;
|
|
63
|
-
export const NotificationActions = styled(ButtonGroup) `
|
|
64
|
-
flex: 0;
|
|
65
|
-
|
|
66
|
-
@media (max-width: ${(props) => props.theme.grid.tablet - 1}px) {
|
|
67
|
-
flex-wrap: wrap;
|
|
68
|
-
|
|
69
|
-
button:not(:first-child) {
|
|
70
|
-
margin: ${(props) => props.theme.grid.unit}px 0 0;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
export const NotificationIcon = styled(AttentionBlue) `
|
|
75
|
-
flex-shrink: 0;
|
|
76
|
-
`;
|
|
77
|
-
export const NotificationTitle = styled.div `
|
|
78
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
|
79
|
-
`;
|
|
80
|
-
export const NotificationLink = styled.a.attrs({ target: '_blank' }) `
|
|
81
|
-
color: inherit;
|
|
82
|
-
font-size: ${(props) => props.theme.font.size.small};
|
|
83
|
-
`;
|
|
84
|
-
export const NotificationMessage = styled.div `
|
|
85
|
-
margin: 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
86
|
-
display: flex;
|
|
87
|
-
flex-direction: column;
|
|
88
|
-
`;
|
|
89
|
-
//# sourceMappingURL=Notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sourceRoot":"","sources":["../../../src/components/Notifications.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,aAAa,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAStC,MAAM,CAAC,MAAM,aAAa,GAAoB,CAAC,EAC7C,KAAK,EACL,kBAAkB,EAClB,GAAG,IAAI,EACR,EAAE,EAAE,CAAC,CACJ,oBAAC,SAAS;IACR,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,EACvB,IAAI,EAAE;YACJ,SAAS,EAAE,yBAAyB;YACpC,OAAO,EAAE,CAAC;YACV,YAAY,EAAE,CAAC;SAChB,EACD,KAAK,EAAE;YACL,SAAS,EAAE,sBAAsB;YAC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AAC,IAAI,GAAG,CAAC;;;CAGjD,CAAA"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { PrimaryButton, SecondaryButton } from '@manuscripts/style-guide';
|
|
13
|
-
import React, { useContext } from 'react';
|
|
14
|
-
import { Workbox } from 'workbox-window';
|
|
15
|
-
import config from '../config';
|
|
16
|
-
import { NotificationContext, } from './NotificationProvider';
|
|
17
|
-
import { NotificationActions, NotificationHead, NotificationIcon, NotificationMessage, NotificationPrompt, NotificationTitle, } from './Notifications';
|
|
18
|
-
export const ServiceWorker = ({ children }) => {
|
|
19
|
-
if (config.serviceworker && 'serviceWorker' in navigator) {
|
|
20
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
21
|
-
const { showNotification } = useContext(NotificationContext);
|
|
22
|
-
const wb = new Workbox('/service-worker.js');
|
|
23
|
-
// Show a notification when a new version is waiting to take control
|
|
24
|
-
wb.addEventListener('waiting', () => {
|
|
25
|
-
const id = 'sw-active';
|
|
26
|
-
showNotification(id, createUpdateReadyNotification({
|
|
27
|
-
id,
|
|
28
|
-
handleAccept: () => {
|
|
29
|
-
wb.addEventListener('controlling', () => {
|
|
30
|
-
window.location.reload();
|
|
31
|
-
});
|
|
32
|
-
wb.messageSW({ type: 'SKIP_WAITING' });
|
|
33
|
-
},
|
|
34
|
-
}));
|
|
35
|
-
});
|
|
36
|
-
wb.register();
|
|
37
|
-
}
|
|
38
|
-
return React.createElement(React.Fragment, null, children);
|
|
39
|
-
};
|
|
40
|
-
export const createUpdateReadyNotification = ({ handleAccept, id, }) => (props) => (React.createElement(NotificationPrompt, null,
|
|
41
|
-
React.createElement(NotificationHead, null,
|
|
42
|
-
React.createElement(NotificationIcon, null),
|
|
43
|
-
React.createElement(NotificationMessage, null,
|
|
44
|
-
React.createElement(NotificationTitle, null, "A new version of the app is available on refreshing."))),
|
|
45
|
-
React.createElement(NotificationActions, null,
|
|
46
|
-
React.createElement(SecondaryButton, { onClick: props.removeNotification }, "Dismiss"),
|
|
47
|
-
React.createElement(PrimaryButton, { onClick: handleAccept }, "Refresh"))));
|
|
48
|
-
//# sourceMappingURL=ServiceWorker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceWorker.js","sourceRoot":"","sources":["../../../src/components/ServiceWorker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,KAAK,EAAE,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAExC,OAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,OAAO,EAEL,mBAAmB,GACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AAExB,MAAM,CAAC,MA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A"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { NotificationComponent } from './NotificationProvider';
|
|
14
|
-
export declare const createNotification: ({ id, message }: {
|
|
15
|
-
id: string;
|
|
16
|
-
message: string;
|
|
17
|
-
}) => NotificationComponent;
|
|
18
|
-
export declare const Notification: React.FC<{
|
|
19
|
-
message: string;
|
|
20
|
-
id: string;
|
|
21
|
-
}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
export type NotificationComponent<P = Record<string, unknown>> = React.ComponentType<NotificationProps & P>;
|
|
14
|
-
export type ShowNotification = (id: string, component: NotificationComponent) => void;
|
|
15
|
-
export type RemoveNotification = (id: string) => void;
|
|
16
|
-
export interface NotificationProps {
|
|
17
|
-
removeNotification: () => void;
|
|
18
|
-
}
|
|
19
|
-
export interface NotificationValue {
|
|
20
|
-
removeNotification: RemoveNotification;
|
|
21
|
-
showNotification: ShowNotification;
|
|
22
|
-
}
|
|
23
|
-
export interface NotificationItem {
|
|
24
|
-
id: string;
|
|
25
|
-
notification: NotificationComponent;
|
|
26
|
-
}
|
|
27
|
-
export declare const NotificationContext: React.Context<NotificationValue>;
|
|
28
|
-
export declare const NotificationProvider: React.FC;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { NotificationItem } from './NotificationProvider';
|
|
14
|
-
interface Props {
|
|
15
|
-
items: NotificationItem[];
|
|
16
|
-
removeNotification: (id: string) => void;
|
|
17
|
-
}
|
|
18
|
-
export declare const Notifications: React.FC<Props>;
|
|
19
|
-
export declare const NotificationPrompt: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const NotificationHead: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
21
|
-
export declare const NotificationActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
22
|
-
export declare const NotificationIcon: import("styled-components").StyledComponent<React.SFC<React.SVGAttributes<SVGElement>>, import("styled-components").DefaultTheme, {}, never>;
|
|
23
|
-
export declare const NotificationTitle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
24
|
-
export declare const NotificationLink: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, {
|
|
25
|
-
target: "_blank";
|
|
26
|
-
}, "target">;
|
|
27
|
-
export declare const NotificationMessage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
28
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React, { MouseEventHandler } from 'react';
|
|
13
|
-
import { NotificationComponent } from './NotificationProvider';
|
|
14
|
-
export declare const ServiceWorker: React.FC;
|
|
15
|
-
interface CreateUpdateReadyNotificationProps {
|
|
16
|
-
handleAccept: MouseEventHandler;
|
|
17
|
-
id: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const createUpdateReadyNotification: ({ handleAccept, id, }: CreateUpdateReadyNotificationProps) => NotificationComponent;
|
|
20
|
-
export {};
|