@collectionspace/cspace-public-browser 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +71 -0
- package/README.md +38 -0
- package/dist/cspacePublicBrowser.js +4680 -0
- package/dist/cspacePublicBrowser.min.js +2 -0
- package/dist/cspacePublicBrowser.min.js.LICENSE.txt +56 -0
- package/images/check.svg +3 -0
- package/images/close.svg +3 -0
- package/images/collapse.svg +3 -0
- package/images/collapseActive.svg +3 -0
- package/images/expand.svg +3 -0
- package/images/expandActive.svg +3 -0
- package/images/filter.svg +4 -0
- package/images/hideLeft.svg +4 -0
- package/images/linkBack.svg +4 -0
- package/images/linkDown.svg +4 -0
- package/images/linkNext.svg +4 -0
- package/images/linkPrev.svg +4 -0
- package/images/openNew.svg +4 -0
- package/images/search.svg +4 -0
- package/images/select.svg +4 -0
- package/images/top.svg +1 -0
- package/lib/actions/detailActions.js +177 -0
- package/lib/actions/filterActions.js +16 -0
- package/lib/actions/mediaActions.js +63 -0
- package/lib/actions/prefsActions.js +84 -0
- package/lib/actions/searchActions.js +140 -0
- package/lib/actions/searchEntryFormActions.js +19 -0
- package/lib/components/App.js +24 -0
- package/lib/components/detail/DetailNavBar.js +98 -0
- package/lib/components/detail/DetailPanel.js +171 -0
- package/lib/components/detail/DetailPanelContainer.js +22 -0
- package/lib/components/detail/ExhibitionSection.js +54 -0
- package/lib/components/detail/FieldList.js +95 -0
- package/lib/components/detail/FieldValueList.js +30 -0
- package/lib/components/detail/ImageGallery.js +137 -0
- package/lib/components/detail/ImageGalleryContainer.js +19 -0
- package/lib/components/detail/InstitutionHoldingList.js +155 -0
- package/lib/components/detail/InstitutionHoldingListContainer.js +22 -0
- package/lib/components/detail/InstitutionIndex.js +53 -0
- package/lib/components/detail/InstitutionIndexContainer.js +15 -0
- package/lib/components/detail/InstitutionSection.js +44 -0
- package/lib/components/detail/InstitutionSectionContainer.js +15 -0
- package/lib/components/layout/Fixed.js +26 -0
- package/lib/components/layout/IconButton.js +41 -0
- package/lib/components/layout/Panel.js +56 -0
- package/lib/components/layout/PanelContainer.js +19 -0
- package/lib/components/layout/PanelTitle.js +38 -0
- package/lib/components/layout/ScrollTopButton.js +70 -0
- package/lib/components/layout/ToggleFilterPanelButton.js +42 -0
- package/lib/components/pages/DetailPage.js +93 -0
- package/lib/components/pages/DetailPageContainer.js +20 -0
- package/lib/components/pages/RootPage.js +41 -0
- package/lib/components/pages/SearchPage.js +130 -0
- package/lib/components/pages/SearchPageContainer.js +23 -0
- package/lib/components/search/entry/SearchEntryForm.js +74 -0
- package/lib/components/search/entry/SearchEntryFormContainer.js +20 -0
- package/lib/components/search/entry/SearchEntryPanel.js +30 -0
- package/lib/components/search/entry/SearchQueryInput.js +89 -0
- package/lib/components/search/entry/SearchSubmitButton.js +22 -0
- package/lib/components/search/entry/SortSelect.js +89 -0
- package/lib/components/search/entry/SortSelectContainer.js +15 -0
- package/lib/components/search/result/ClearSearchParamsLink.js +42 -0
- package/lib/components/search/result/Filter.js +186 -0
- package/lib/components/search/result/FilterContainer.js +22 -0
- package/lib/components/search/result/FilterGroup.js +72 -0
- package/lib/components/search/result/FilterList.js +48 -0
- package/lib/components/search/result/FilterPanel.js +115 -0
- package/lib/components/search/result/FilterPanelContainer.js +16 -0
- package/lib/components/search/result/FilterSearchInput.js +63 -0
- package/lib/components/search/result/RemoveSearchParamLink.js +66 -0
- package/lib/components/search/result/SearchError.js +29 -0
- package/lib/components/search/result/SearchLoadMore.js +36 -0
- package/lib/components/search/result/SearchParamList.js +41 -0
- package/lib/components/search/result/SearchPending.js +21 -0
- package/lib/components/search/result/SearchResultImage.js +227 -0
- package/lib/components/search/result/SearchResultList.js +119 -0
- package/lib/components/search/result/SearchResultPanel.js +139 -0
- package/lib/components/search/result/SearchResultPanelContainer.js +23 -0
- package/lib/components/search/result/SearchResultStats.js +39 -0
- package/lib/components/search/result/SearchResultTile.js +61 -0
- package/lib/config/anthro.js +123 -0
- package/lib/config/bonsai.js +50 -0
- package/lib/config/botgarden.js +10 -0
- package/lib/config/default.js +530 -0
- package/lib/config/fcart.js +36 -0
- package/lib/config/herbarium.js +10 -0
- package/lib/config/index.js +53 -0
- package/lib/config/lhmc.js +10 -0
- package/lib/config/materials.js +982 -0
- package/lib/config/publicart.js +10 -0
- package/lib/constants/actionCodes.js +46 -0
- package/lib/constants/ids.js +12 -0
- package/lib/helpers/bodyClassName.js +11 -0
- package/lib/helpers/esQueryHelpers.js +206 -0
- package/lib/helpers/formatHelpers.js +293 -0
- package/lib/helpers/searchDimensions.js +28 -0
- package/lib/helpers/urlHelpers.js +43 -0
- package/lib/index.js +53 -0
- package/lib/intl/index.js +16 -0
- package/lib/reducers/detailReducer.js +145 -0
- package/lib/reducers/filterReducer.js +22 -0
- package/lib/reducers/index.js +66 -0
- package/lib/reducers/mediaReducer.js +43 -0
- package/lib/reducers/prefsReducer.js +27 -0
- package/lib/reducers/searchEntryFormReducer.js +24 -0
- package/lib/reducers/searchReducer.js +88 -0
- package/package.json +118 -0
- package/src/actions/detailActions.js +231 -0
- package/src/actions/filterActions.js +10 -0
- package/src/actions/mediaActions.js +65 -0
- package/src/actions/prefsActions.js +95 -0
- package/src/actions/searchActions.js +188 -0
- package/src/actions/searchEntryFormActions.js +15 -0
- package/src/components/App.jsx +18 -0
- package/src/components/detail/DetailNavBar.jsx +132 -0
- package/src/components/detail/DetailPanel.jsx +215 -0
- package/src/components/detail/DetailPanelContainer.js +29 -0
- package/src/components/detail/ExhibitionSection.jsx +71 -0
- package/src/components/detail/FieldList.jsx +122 -0
- package/src/components/detail/FieldValueList.jsx +31 -0
- package/src/components/detail/ImageGallery.jsx +153 -0
- package/src/components/detail/ImageGalleryContainer.js +17 -0
- package/src/components/detail/InstitutionHoldingList.jsx +188 -0
- package/src/components/detail/InstitutionHoldingListContainer.js +29 -0
- package/src/components/detail/InstitutionIndex.jsx +57 -0
- package/src/components/detail/InstitutionIndexContainer.js +11 -0
- package/src/components/detail/InstitutionSection.jsx +48 -0
- package/src/components/detail/InstitutionSectionContainer.js +11 -0
- package/src/components/layout/Fixed.jsx +29 -0
- package/src/components/layout/IconButton.jsx +41 -0
- package/src/components/layout/Panel.jsx +60 -0
- package/src/components/layout/PanelContainer.js +20 -0
- package/src/components/layout/PanelTitle.jsx +43 -0
- package/src/components/layout/ScrollTopButton.jsx +76 -0
- package/src/components/layout/ToggleFilterPanelButton.jsx +43 -0
- package/src/components/pages/DetailPage.jsx +101 -0
- package/src/components/pages/DetailPageContainer.js +18 -0
- package/src/components/pages/RootPage.jsx +37 -0
- package/src/components/pages/SearchPage.jsx +160 -0
- package/src/components/pages/SearchPageContainer.js +21 -0
- package/src/components/search/entry/SearchEntryForm.jsx +82 -0
- package/src/components/search/entry/SearchEntryFormContainer.js +22 -0
- package/src/components/search/entry/SearchEntryPanel.jsx +28 -0
- package/src/components/search/entry/SearchQueryInput.jsx +95 -0
- package/src/components/search/entry/SearchSubmitButton.jsx +22 -0
- package/src/components/search/entry/SortSelect.jsx +104 -0
- package/src/components/search/entry/SortSelectContainer.js +12 -0
- package/src/components/search/result/ClearSearchParamsLink.jsx +43 -0
- package/src/components/search/result/Filter.jsx +226 -0
- package/src/components/search/result/FilterContainer.js +20 -0
- package/src/components/search/result/FilterGroup.jsx +83 -0
- package/src/components/search/result/FilterList.jsx +51 -0
- package/src/components/search/result/FilterPanel.jsx +143 -0
- package/src/components/search/result/FilterPanelContainer.js +16 -0
- package/src/components/search/result/FilterSearchInput.jsx +68 -0
- package/src/components/search/result/RemoveSearchParamLink.jsx +79 -0
- package/src/components/search/result/SearchError.jsx +30 -0
- package/src/components/search/result/SearchLoadMore.jsx +37 -0
- package/src/components/search/result/SearchParamList.jsx +47 -0
- package/src/components/search/result/SearchPending.jsx +19 -0
- package/src/components/search/result/SearchResultImage.jsx +275 -0
- package/src/components/search/result/SearchResultList.jsx +144 -0
- package/src/components/search/result/SearchResultPanel.jsx +169 -0
- package/src/components/search/result/SearchResultPanelContainer.js +31 -0
- package/src/components/search/result/SearchResultStats.jsx +38 -0
- package/src/components/search/result/SearchResultTile.jsx +70 -0
- package/src/config/anthro.js +153 -0
- package/src/config/bonsai.js +50 -0
- package/src/config/botgarden.js +3 -0
- package/src/config/default.js +604 -0
- package/src/config/fcart.js +38 -0
- package/src/config/herbarium.js +3 -0
- package/src/config/index.js +51 -0
- package/src/config/lhmc.js +3 -0
- package/src/config/materials.js +1173 -0
- package/src/config/publicart.js +3 -0
- package/src/constants/actionCodes.js +26 -0
- package/src/constants/ids.js +3 -0
- package/src/helpers/bodyClassName.js +5 -0
- package/src/helpers/esQueryHelpers.js +224 -0
- package/src/helpers/formatHelpers.jsx +361 -0
- package/src/helpers/searchDimensions.js +21 -0
- package/src/helpers/urlHelpers.js +49 -0
- package/src/index.jsx +59 -0
- package/src/intl/index.js +16 -0
- package/src/reducers/detailReducer.js +201 -0
- package/src/reducers/filterReducer.js +16 -0
- package/src/reducers/index.js +56 -0
- package/src/reducers/mediaReducer.js +44 -0
- package/src/reducers/prefsReducer.js +24 -0
- package/src/reducers/searchEntryFormReducer.js +19 -0
- package/src/reducers/searchReducer.js +118 -0
- package/styles/colors.css +7 -0
- package/styles/cspace/DetailNavBar.css +17 -0
- package/styles/cspace/DetailPage.css +3 -0
- package/styles/cspace/DetailPanel.css +69 -0
- package/styles/cspace/ExhibitionSection.css +9 -0
- package/styles/cspace/FieldList.css +15 -0
- package/styles/cspace/FieldListField.css +7 -0
- package/styles/cspace/FieldListGroup.css +27 -0
- package/styles/cspace/FieldValueList.css +19 -0
- package/styles/cspace/Filter.css +64 -0
- package/styles/cspace/FilterGroup.css +21 -0
- package/styles/cspace/FilterPanel.css +45 -0
- package/styles/cspace/FilterSearchInput.css +13 -0
- package/styles/cspace/Fixed.css +8 -0
- package/styles/cspace/IconButton.css +11 -0
- package/styles/cspace/ImageGallery.css +43 -0
- package/styles/cspace/InstitutionHoldingList.css +109 -0
- package/styles/cspace/InstitutionIndex.css +13 -0
- package/styles/cspace/InstitutionSection.css +4 -0
- package/styles/cspace/Link.css +39 -0
- package/styles/cspace/Panel.css +53 -0
- package/styles/cspace/PanelTitle.css +48 -0
- package/styles/cspace/RemoveSearchParamLink.css +15 -0
- package/styles/cspace/RootPage.css +60 -0
- package/styles/cspace/ScrollTopButton.css +32 -0
- package/styles/cspace/SearchEntryForm.css +4 -0
- package/styles/cspace/SearchEntryPanel.css +11 -0
- package/styles/cspace/SearchPage.css +2 -0
- package/styles/cspace/SearchParamLink.css +21 -0
- package/styles/cspace/SearchParamList.css +6 -0
- package/styles/cspace/SearchQueryInput.css +30 -0
- package/styles/cspace/SearchResultImage.css +29 -0
- package/styles/cspace/SearchResultList.css +10 -0
- package/styles/cspace/SearchResultPanel.css +31 -0
- package/styles/cspace/SearchResultStats.css +4 -0
- package/styles/cspace/SearchResultTile.css +67 -0
- package/styles/cspace/SearchStatus.css +12 -0
- package/styles/cspace/SearchSubmitButton.css +3 -0
- package/styles/cspace/SortSelect.css +19 -0
- package/styles/cspace/ToggleFilterPanelButton.css +44 -0
- package/styles/dimensions.css +9 -0
package/lib/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactDom = require("react-dom");
|
|
9
|
+
var _reactIntl = require("react-intl");
|
|
10
|
+
var _redux = require("redux");
|
|
11
|
+
var _reactRedux = require("react-redux");
|
|
12
|
+
var _reduxThunk = _interopRequireDefault(require("redux-thunk"));
|
|
13
|
+
var _warning = _interopRequireDefault(require("warning"));
|
|
14
|
+
var _prefsActions = require("./actions/prefsActions");
|
|
15
|
+
var _config = _interopRequireDefault(require("./config"));
|
|
16
|
+
var _App = _interopRequireDefault(require("./components/App"));
|
|
17
|
+
var _intl = require("./intl");
|
|
18
|
+
var _reducers = _interopRequireDefault(require("./reducers"));
|
|
19
|
+
var formatters = _interopRequireWildcard(require("./helpers/formatHelpers"));
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
/* global document, window */
|
|
24
|
+
|
|
25
|
+
const cspacePublicBrowser = function () {
|
|
26
|
+
_config.default.merge(...arguments);
|
|
27
|
+
const container = _config.default.get('container');
|
|
28
|
+
const mountNode = document.querySelector(container);
|
|
29
|
+
process.env.NODE_ENV !== "production" ? (0, _warning.default)(mountNode, `No container element was found using the selector '${container}'. The CollectionSpace collection browser will not be rendered.`) : void 0;
|
|
30
|
+
if (!mountNode) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
35
|
+
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || _redux.compose;
|
|
36
|
+
const store = (0, _redux.createStore)(_reducers.default, composeEnhancers((0, _redux.applyMiddleware)(_reduxThunk.default)));
|
|
37
|
+
store.dispatch((0, _prefsActions.loadPrefs)());
|
|
38
|
+
const locale = _config.default.get('locale');
|
|
39
|
+
const messages = _config.default.get('messages');
|
|
40
|
+
const intl = (0, _intl.createIntl)({
|
|
41
|
+
locale,
|
|
42
|
+
messages,
|
|
43
|
+
defaultLocale: 'en-US'
|
|
44
|
+
});
|
|
45
|
+
(0, _reactDom.render)( /*#__PURE__*/_react.default.createElement(_reactIntl.RawIntlProvider, {
|
|
46
|
+
value: intl
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
|
|
48
|
+
store: store
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_App.default, null))), mountNode);
|
|
50
|
+
};
|
|
51
|
+
cspacePublicBrowser.formatters = formatters;
|
|
52
|
+
var _default = cspacePublicBrowser;
|
|
53
|
+
exports.default = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getIntl = exports.createIntl = void 0;
|
|
7
|
+
var _reactIntl = require("react-intl");
|
|
8
|
+
const intlCache = (0, _reactIntl.createIntlCache)();
|
|
9
|
+
let intl;
|
|
10
|
+
const createIntl = config => {
|
|
11
|
+
intl = (0, _reactIntl.createIntl)(config, intlCache);
|
|
12
|
+
return intl;
|
|
13
|
+
};
|
|
14
|
+
exports.createIntl = createIntl;
|
|
15
|
+
const getIntl = () => intl;
|
|
16
|
+
exports.getIntl = getIntl;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isPending = exports.isInstSearchPending = exports.getParams = exports.getInstitutionHits = exports.getHoldingInstitutions = exports.getError = exports.getData = exports.getAdjacents = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
9
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const findAdjacents = (csid, hits) => {
|
|
12
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
13
|
+
const csidIndex = hits ? hits.findIndex(hit => hit._source['ecm:name'] === csid) : -1;
|
|
14
|
+
if (csidIndex < 0) {
|
|
15
|
+
return {
|
|
16
|
+
prev: undefined,
|
|
17
|
+
next: undefined
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
22
|
+
prev: csidIndex > 0 ? hits[csidIndex - 1]._source : undefined,
|
|
23
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
24
|
+
next: csidIndex < hits.length - 1 ? hits[csidIndex + 1]._source : undefined
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const handleDetailReadStarted = (state, action) => {
|
|
28
|
+
const {
|
|
29
|
+
params: readParams
|
|
30
|
+
} = action.meta;
|
|
31
|
+
const currentParams = state.get('params');
|
|
32
|
+
if (readParams !== currentParams) {
|
|
33
|
+
return state;
|
|
34
|
+
}
|
|
35
|
+
return state.set('pending', true).delete('error');
|
|
36
|
+
};
|
|
37
|
+
const handleDetailReadFulfilled = (state, action) => {
|
|
38
|
+
const {
|
|
39
|
+
params: readParams
|
|
40
|
+
} = action.meta;
|
|
41
|
+
const currentParams = state.get('params');
|
|
42
|
+
if (readParams !== currentParams) {
|
|
43
|
+
return state;
|
|
44
|
+
}
|
|
45
|
+
const response = action.payload;
|
|
46
|
+
const data = (0, _get.default)(response, ['responses', 0, 'hits', 'hits', 0, '_source']);
|
|
47
|
+
const adjacents = findAdjacents(readParams.get('csid'), (0, _get.default)(response, ['responses', 1, 'hits', 'hits']));
|
|
48
|
+
return state.set('adjacents', adjacents).delete('pending').set('data', data).delete('error');
|
|
49
|
+
};
|
|
50
|
+
const handleDetailReadRejected = (state, action) => {
|
|
51
|
+
const {
|
|
52
|
+
params: readParams
|
|
53
|
+
} = action.meta;
|
|
54
|
+
const currentParams = state.get('params');
|
|
55
|
+
if (readParams !== currentParams) {
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
return state.delete('pending').set('error', action.payload);
|
|
59
|
+
};
|
|
60
|
+
const handleInstSearchStarted = (state, action) => {
|
|
61
|
+
const {
|
|
62
|
+
institutionId,
|
|
63
|
+
params: readParams
|
|
64
|
+
} = action.meta;
|
|
65
|
+
const currentParams = state.get('params');
|
|
66
|
+
if (readParams !== currentParams) {
|
|
67
|
+
return state;
|
|
68
|
+
}
|
|
69
|
+
return state.setIn(['inst', institutionId, 'pending'], true).deleteIn(['inst', institutionId, 'error']);
|
|
70
|
+
};
|
|
71
|
+
const handleInstSearchFulfilled = (state, action) => {
|
|
72
|
+
const {
|
|
73
|
+
institutionId,
|
|
74
|
+
params: readParams
|
|
75
|
+
} = action.meta;
|
|
76
|
+
const currentParams = state.get('params');
|
|
77
|
+
if (readParams !== currentParams) {
|
|
78
|
+
return state;
|
|
79
|
+
}
|
|
80
|
+
const response = action.payload;
|
|
81
|
+
const hits = (0, _get.default)(response, ['hits', 'hits']);
|
|
82
|
+
return state.deleteIn(['inst', institutionId, 'pending']).setIn(['inst', institutionId, 'hits'], hits).deleteIn(['inst', institutionId, 'error']);
|
|
83
|
+
};
|
|
84
|
+
const handleInstSearchRejected = (state, action) => {
|
|
85
|
+
const {
|
|
86
|
+
institutionId,
|
|
87
|
+
params: readParams
|
|
88
|
+
} = action.meta;
|
|
89
|
+
const currentParams = state.get('params');
|
|
90
|
+
if (readParams !== currentParams) {
|
|
91
|
+
return state;
|
|
92
|
+
}
|
|
93
|
+
return state.deleteIn(['inst', institutionId, 'pending']).setIn(['inst', institutionId, 'error'], action.payload);
|
|
94
|
+
};
|
|
95
|
+
var _default = function _default() {
|
|
96
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
97
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
98
|
+
switch (action.type) {
|
|
99
|
+
case _actionCodes.CLEAR_DETAIL:
|
|
100
|
+
return state.clear();
|
|
101
|
+
case _actionCodes.DETAIL_READ_STARTED:
|
|
102
|
+
return handleDetailReadStarted(state, action);
|
|
103
|
+
case _actionCodes.DETAIL_READ_FULFILLED:
|
|
104
|
+
return handleDetailReadFulfilled(state, action);
|
|
105
|
+
case _actionCodes.DETAIL_READ_REJECTED:
|
|
106
|
+
return handleDetailReadRejected(state, action);
|
|
107
|
+
case _actionCodes.INST_SEARCH_STARTED:
|
|
108
|
+
return handleInstSearchStarted(state, action);
|
|
109
|
+
case _actionCodes.INST_SEARCH_FULFILLED:
|
|
110
|
+
return handleInstSearchFulfilled(state, action);
|
|
111
|
+
case _actionCodes.INST_SEARCH_REJECTED:
|
|
112
|
+
return handleInstSearchRejected(state, action);
|
|
113
|
+
case _actionCodes.SET_DETAIL_PARAMS:
|
|
114
|
+
return state.set('params', action.payload);
|
|
115
|
+
default:
|
|
116
|
+
return state;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.default = _default;
|
|
120
|
+
const getAdjacents = state => state.get('adjacents');
|
|
121
|
+
exports.getAdjacents = getAdjacents;
|
|
122
|
+
const getError = state => state.get('error');
|
|
123
|
+
exports.getError = getError;
|
|
124
|
+
const getParams = state => state.get('params');
|
|
125
|
+
exports.getParams = getParams;
|
|
126
|
+
const getData = state => state.get('data');
|
|
127
|
+
exports.getData = getData;
|
|
128
|
+
const isPending = state => !!state.get('pending');
|
|
129
|
+
exports.isPending = isPending;
|
|
130
|
+
const getHoldingInstitutions = state => {
|
|
131
|
+
const inst = state.get('inst');
|
|
132
|
+
if (!inst) {
|
|
133
|
+
return _immutable.default.Set();
|
|
134
|
+
}
|
|
135
|
+
const institutionIds = inst.keySeq().filter(institutionId => {
|
|
136
|
+
const hits = inst.getIn([institutionId, 'hits']);
|
|
137
|
+
return hits && hits.length > 0;
|
|
138
|
+
});
|
|
139
|
+
return _immutable.default.Set(institutionIds);
|
|
140
|
+
};
|
|
141
|
+
exports.getHoldingInstitutions = getHoldingInstitutions;
|
|
142
|
+
const getInstitutionHits = (state, institutionId) => state.getIn(['inst', institutionId, 'hits']);
|
|
143
|
+
exports.getInstitutionHits = getInstitutionHits;
|
|
144
|
+
const isInstSearchPending = (state, institutionId) => state.getIn(['inst', institutionId, 'pending']);
|
|
145
|
+
exports.isInstSearchPending = isInstSearchPending;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSearchValue = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _default = function _default() {
|
|
11
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
12
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
13
|
+
switch (action.type) {
|
|
14
|
+
case _actionCodes.SET_FILTER_SEARCH_VALUE:
|
|
15
|
+
return state.setIn([action.meta.id, 'searchValue'], action.payload);
|
|
16
|
+
default:
|
|
17
|
+
return state;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
const getSearchValue = (state, id) => state.getIn([id, 'searchValue']);
|
|
22
|
+
exports.getSearchValue = getSearchValue;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.searchHasMore = exports.isSearchPending = exports.isPanelExpanded = exports.isDetailPending = exports.isDetailInstSearchPending = exports.getSearchResult = exports.getSearchParams = exports.getSearchPageSize = exports.getSearchOffset = exports.getSearchNextOffset = exports.getSearchError = exports.getSearchEntryFormParams = exports.getPrefs = exports.getMedia = exports.getFilterSearchValue = exports.getDetailParams = exports.getDetailInstitutionHits = exports.getDetailHoldingInstitutions = exports.getDetailError = exports.getDetailData = exports.getDetailAdjacents = exports.default = void 0;
|
|
7
|
+
var _redux = require("redux");
|
|
8
|
+
var fromDetail = _interopRequireWildcard(require("./detailReducer"));
|
|
9
|
+
var fromFilter = _interopRequireWildcard(require("./filterReducer"));
|
|
10
|
+
var fromMedia = _interopRequireWildcard(require("./mediaReducer"));
|
|
11
|
+
var fromPrefs = _interopRequireWildcard(require("./prefsReducer"));
|
|
12
|
+
var fromSearch = _interopRequireWildcard(require("./searchReducer"));
|
|
13
|
+
var fromSearchEntryForm = _interopRequireWildcard(require("./searchEntryFormReducer"));
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
var _default = (0, _redux.combineReducers)({
|
|
17
|
+
detail: fromDetail.default,
|
|
18
|
+
filter: fromFilter.default,
|
|
19
|
+
media: fromMedia.default,
|
|
20
|
+
prefs: fromPrefs.default,
|
|
21
|
+
search: fromSearch.default,
|
|
22
|
+
searchEntryForm: fromSearchEntryForm.default
|
|
23
|
+
});
|
|
24
|
+
exports.default = _default;
|
|
25
|
+
const getDetailAdjacents = state => fromDetail.getAdjacents(state.detail);
|
|
26
|
+
exports.getDetailAdjacents = getDetailAdjacents;
|
|
27
|
+
const getDetailError = state => fromDetail.getError(state.detail);
|
|
28
|
+
exports.getDetailError = getDetailError;
|
|
29
|
+
const getDetailParams = state => fromDetail.getParams(state.detail);
|
|
30
|
+
exports.getDetailParams = getDetailParams;
|
|
31
|
+
const getDetailData = state => fromDetail.getData(state.detail);
|
|
32
|
+
exports.getDetailData = getDetailData;
|
|
33
|
+
const isDetailPending = state => fromDetail.isPending(state.detail);
|
|
34
|
+
exports.isDetailPending = isDetailPending;
|
|
35
|
+
const getDetailHoldingInstitutions = state => fromDetail.getHoldingInstitutions(state.detail);
|
|
36
|
+
exports.getDetailHoldingInstitutions = getDetailHoldingInstitutions;
|
|
37
|
+
const getDetailInstitutionHits = (state, institutionId) => fromDetail.getInstitutionHits(state.detail, institutionId);
|
|
38
|
+
exports.getDetailInstitutionHits = getDetailInstitutionHits;
|
|
39
|
+
const isDetailInstSearchPending = (state, institutionId) => fromDetail.isInstSearchPending(state.detail, institutionId);
|
|
40
|
+
exports.isDetailInstSearchPending = isDetailInstSearchPending;
|
|
41
|
+
const getFilterSearchValue = (state, id) => fromFilter.getSearchValue(state.filter, id);
|
|
42
|
+
exports.getFilterSearchValue = getFilterSearchValue;
|
|
43
|
+
const getMedia = (state, referenceValue, institutionId) => fromMedia.get(state.media, referenceValue, institutionId);
|
|
44
|
+
exports.getMedia = getMedia;
|
|
45
|
+
const getPrefs = state => state.prefs;
|
|
46
|
+
exports.getPrefs = getPrefs;
|
|
47
|
+
const isPanelExpanded = (state, id) => fromPrefs.isPanelExpanded(state.prefs, id);
|
|
48
|
+
exports.isPanelExpanded = isPanelExpanded;
|
|
49
|
+
const getSearchError = state => fromSearch.getError(state.search);
|
|
50
|
+
exports.getSearchError = getSearchError;
|
|
51
|
+
const getSearchOffset = state => fromSearch.getOffset(state.search);
|
|
52
|
+
exports.getSearchOffset = getSearchOffset;
|
|
53
|
+
const getSearchNextOffset = state => fromSearch.getNextOffset(state.search);
|
|
54
|
+
exports.getSearchNextOffset = getSearchNextOffset;
|
|
55
|
+
const getSearchPageSize = state => fromSearch.getPageSize(state.search);
|
|
56
|
+
exports.getSearchPageSize = getSearchPageSize;
|
|
57
|
+
const getSearchParams = state => fromSearch.getParams(state.search);
|
|
58
|
+
exports.getSearchParams = getSearchParams;
|
|
59
|
+
const getSearchResult = state => fromSearch.getResult(state.search);
|
|
60
|
+
exports.getSearchResult = getSearchResult;
|
|
61
|
+
const isSearchPending = state => fromSearch.isPending(state.search);
|
|
62
|
+
exports.isSearchPending = isSearchPending;
|
|
63
|
+
const searchHasMore = state => fromSearch.hasMore(state.search);
|
|
64
|
+
exports.searchHasMore = searchHasMore;
|
|
65
|
+
const getSearchEntryFormParams = state => fromSearchEntryForm.getParams(state.searchEntryForm);
|
|
66
|
+
exports.getSearchEntryFormParams = getSearchEntryFormParams;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.get = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const setMedia = (state, action) => {
|
|
11
|
+
const {
|
|
12
|
+
csids,
|
|
13
|
+
altTexts,
|
|
14
|
+
title
|
|
15
|
+
} = action.payload;
|
|
16
|
+
const {
|
|
17
|
+
institutionId,
|
|
18
|
+
referenceValue
|
|
19
|
+
} = action.meta;
|
|
20
|
+
return state.setIn([referenceValue, 'media', institutionId], _immutable.default.fromJS({
|
|
21
|
+
csids,
|
|
22
|
+
altTexts,
|
|
23
|
+
title
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
var _default = function _default() {
|
|
27
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
28
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
29
|
+
switch (action.type) {
|
|
30
|
+
case _actionCodes.SET_MEDIA:
|
|
31
|
+
return setMedia(state, action);
|
|
32
|
+
default:
|
|
33
|
+
return state;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.default = _default;
|
|
37
|
+
const get = (state, referenceValue, institutionId) => {
|
|
38
|
+
if (typeof institutionId === 'undefined') {
|
|
39
|
+
return state.getIn([referenceValue, 'media']);
|
|
40
|
+
}
|
|
41
|
+
return state.getIn([referenceValue, 'media', institutionId]);
|
|
42
|
+
};
|
|
43
|
+
exports.get = get;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isPanelExpanded = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const setPanelExpanded = (state, id, expanded) => state.setIn(['panels', id, 'expand'], expanded);
|
|
11
|
+
const isPanelExpanded = (state, id) => state.getIn(['panels', id, 'expand']);
|
|
12
|
+
exports.isPanelExpanded = isPanelExpanded;
|
|
13
|
+
var _default = function _default() {
|
|
14
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
15
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
16
|
+
switch (action.type) {
|
|
17
|
+
case _actionCodes.PREFS_LOADED:
|
|
18
|
+
return action.payload ? _immutable.default.fromJS(action.payload) : _immutable.default.Map();
|
|
19
|
+
case _actionCodes.EXPAND_PANEL:
|
|
20
|
+
return setPanelExpanded(state, action.meta.id, action.payload);
|
|
21
|
+
case _actionCodes.TOGGLE_PANEL:
|
|
22
|
+
return setPanelExpanded(state, action.meta.id, !isPanelExpanded(state, action.meta.id));
|
|
23
|
+
default:
|
|
24
|
+
return state;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getParams = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var _default = function _default() {
|
|
11
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
12
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
13
|
+
switch (action.type) {
|
|
14
|
+
case _actionCodes.SET_SEARCH_PARAMS:
|
|
15
|
+
return state.set('params', action.payload);
|
|
16
|
+
case _actionCodes.SET_SEARCH_ENTRY_FORM_PARAM:
|
|
17
|
+
return state.setIn(['params', action.meta.id], action.payload);
|
|
18
|
+
default:
|
|
19
|
+
return state;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.default = _default;
|
|
23
|
+
const getParams = state => state.get('params');
|
|
24
|
+
exports.getParams = getParams;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isPending = exports.hasMore = exports.getResult = exports.getParams = exports.getPageSize = exports.getOffset = exports.getNextOffset = exports.getError = exports.default = void 0;
|
|
7
|
+
var _immutable = _interopRequireDefault(require("immutable"));
|
|
8
|
+
var _actionCodes = require("../constants/actionCodes");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const handleSearchFulfilled = (state, action) => {
|
|
11
|
+
const {
|
|
12
|
+
offset,
|
|
13
|
+
pageSize,
|
|
14
|
+
params: searchParams
|
|
15
|
+
} = action.meta;
|
|
16
|
+
const currentParams = state.get('params');
|
|
17
|
+
if (searchParams !== currentParams) {
|
|
18
|
+
return state;
|
|
19
|
+
}
|
|
20
|
+
const {
|
|
21
|
+
responses
|
|
22
|
+
} = action.payload;
|
|
23
|
+
const [resultResponse, ...filterResponses] = responses;
|
|
24
|
+
const {
|
|
25
|
+
aggregations,
|
|
26
|
+
hits
|
|
27
|
+
} = resultResponse;
|
|
28
|
+
const currentResult = state.get('result') || _immutable.default.Map();
|
|
29
|
+
const currentHits = currentResult.get('hits') || _immutable.default.List();
|
|
30
|
+
const nextHits = currentHits.setSize(offset).concat(_immutable.default.fromJS(hits.hits));
|
|
31
|
+
let nextResult = currentResult.set('params', searchParams).set('total', hits.total).set('hits', nextHits);
|
|
32
|
+
if (offset === 0) {
|
|
33
|
+
let nextAggregations = _immutable.default.fromJS(aggregations);
|
|
34
|
+
filterResponses.forEach(filterResponse => {
|
|
35
|
+
nextAggregations = nextAggregations.merge(_immutable.default.fromJS(filterResponse.aggregations));
|
|
36
|
+
});
|
|
37
|
+
nextResult = nextResult.set('aggregations', nextAggregations);
|
|
38
|
+
}
|
|
39
|
+
return state.set('offset', offset).set('nextOffset', offset + pageSize).delete('pending').set('result', nextResult).delete('error');
|
|
40
|
+
};
|
|
41
|
+
var _default = function _default() {
|
|
42
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _immutable.default.Map();
|
|
43
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
44
|
+
switch (action.type) {
|
|
45
|
+
case _actionCodes.SEARCH_STARTED:
|
|
46
|
+
return state.set('pending', true).delete('error');
|
|
47
|
+
case _actionCodes.SEARCH_FULFILLED:
|
|
48
|
+
return handleSearchFulfilled(state, action);
|
|
49
|
+
case _actionCodes.SEARCH_REJECTED:
|
|
50
|
+
return state.delete('pending').set('error', action.payload);
|
|
51
|
+
case _actionCodes.SET_SEARCH_PAGE_SIZE:
|
|
52
|
+
return state.set('pageSize', action.payload);
|
|
53
|
+
case _actionCodes.SET_SEARCH_PARAMS:
|
|
54
|
+
return state.delete('error').delete('nextOffset').set('params', action.payload).delete('pending');
|
|
55
|
+
default:
|
|
56
|
+
return state;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.default = _default;
|
|
60
|
+
const getError = state => state.get('error');
|
|
61
|
+
exports.getError = getError;
|
|
62
|
+
const getOffset = state => state.get('offset') || 0;
|
|
63
|
+
exports.getOffset = getOffset;
|
|
64
|
+
const getNextOffset = state => state.get('nextOffset') || 0;
|
|
65
|
+
exports.getNextOffset = getNextOffset;
|
|
66
|
+
const getPageSize = state => state.get('pageSize');
|
|
67
|
+
exports.getPageSize = getPageSize;
|
|
68
|
+
const getParams = state => state.get('params');
|
|
69
|
+
exports.getParams = getParams;
|
|
70
|
+
const getResult = state => state.get('result');
|
|
71
|
+
exports.getResult = getResult;
|
|
72
|
+
const hasMore = state => {
|
|
73
|
+
const result = getResult(state);
|
|
74
|
+
if (!result) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
const currentParams = getParams(state);
|
|
78
|
+
const resultParams = result.get('params');
|
|
79
|
+
if (currentParams !== resultParams) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
const total = result.get('total');
|
|
83
|
+
const nextOffset = getNextOffset(state);
|
|
84
|
+
return nextOffset < total;
|
|
85
|
+
};
|
|
86
|
+
exports.hasMore = hasMore;
|
|
87
|
+
const isPending = state => !!state.get('pending');
|
|
88
|
+
exports.isPending = isPending;
|
package/package.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@collectionspace/cspace-public-browser",
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "CollectionSpace public browser",
|
|
5
|
+
"author": "Ray Lee <ray.lee@lyrasis.org>",
|
|
6
|
+
"license": "ECL-2.0",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"collectionspace",
|
|
9
|
+
"cspace"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/collectionspace/cspace-public-browser.js.git"
|
|
14
|
+
},
|
|
15
|
+
"main": "src/index.jsx",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"lib",
|
|
19
|
+
"src",
|
|
20
|
+
"styles",
|
|
21
|
+
"images"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "npm run build-cjs && npm run build-umd",
|
|
25
|
+
"build-cjs": "cross-env BABEL_ENV=cjs babel ./src -d lib",
|
|
26
|
+
"build-umd": "npm run build-umd-dev && npm run build-umd-prod",
|
|
27
|
+
"build-umd-dev": "webpack",
|
|
28
|
+
"build-umd-prod": "cross-env NODE_ENV=production webpack",
|
|
29
|
+
"check": "npm run lint && npm run test && npm run coverage",
|
|
30
|
+
"clean": "rimraf build lib dist coverage errorShots",
|
|
31
|
+
"coverage": "nyc report --temp-dir coverage --reporter text && nyc report --temp-dir coverage --reporter lcov",
|
|
32
|
+
"devserver": "webpack-dev-server",
|
|
33
|
+
"doc": "npx babel-node generateDocs.js",
|
|
34
|
+
"lint": "eslint --ext .jsx,.js *.js src test",
|
|
35
|
+
"prepare": "npm run clean && npm run build",
|
|
36
|
+
"start": "cross-env NODE_ENV=test karma start",
|
|
37
|
+
"test": "cross-env NODE_ENV=test karma start --singleRun=true"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"classnames": "^2.2.6",
|
|
41
|
+
"cspace-refname": "^1.0.2",
|
|
42
|
+
"history": "^4.10.1",
|
|
43
|
+
"immutable": "^4.0.0-rc.12",
|
|
44
|
+
"lodash": "^4.17.5",
|
|
45
|
+
"memoize-one": "^5.1.1",
|
|
46
|
+
"prop-types": "^15.7.2",
|
|
47
|
+
"qs": "^6.7.0",
|
|
48
|
+
"react": "^16.8.6",
|
|
49
|
+
"react-dom": "^16.8.6",
|
|
50
|
+
"react-helmet": "^5.2.0",
|
|
51
|
+
"react-image-gallery": "^1.0.6",
|
|
52
|
+
"react-intl": "^3.12.0",
|
|
53
|
+
"react-redux": "^7.1.3",
|
|
54
|
+
"react-router": "5.1.2",
|
|
55
|
+
"react-router-dom": "5.1.2",
|
|
56
|
+
"redux": "^4.0.5",
|
|
57
|
+
"redux-thunk": "^2.1.0",
|
|
58
|
+
"warning": "^4.0.3"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/cli": "^7.4.4",
|
|
62
|
+
"@babel/core": "^7.4.5",
|
|
63
|
+
"@babel/node": "^7.8.4",
|
|
64
|
+
"@babel/preset-env": "^7.4.5",
|
|
65
|
+
"@babel/preset-react": "^7.0.0",
|
|
66
|
+
"@babel/register": "^7.4.0",
|
|
67
|
+
"babel-loader": "^9.1.2",
|
|
68
|
+
"babel-plugin-dev-expression": "^0.2.1",
|
|
69
|
+
"babel-plugin-istanbul": "^6.0.0",
|
|
70
|
+
"babel-plugin-react-intl": "^5.1.18",
|
|
71
|
+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
72
|
+
"chai": "^4.1.2",
|
|
73
|
+
"chai-as-promised": "^7.1.1",
|
|
74
|
+
"cross-env": "^7.0.0",
|
|
75
|
+
"css-loader": "^6.7.3",
|
|
76
|
+
"eslint": "^6.8.0",
|
|
77
|
+
"eslint-config-airbnb": "^18.0.1",
|
|
78
|
+
"eslint-plugin-import": "^2.20.0",
|
|
79
|
+
"eslint-plugin-jsx-a11y": "^6.2.3",
|
|
80
|
+
"eslint-plugin-react": "^7.18.0",
|
|
81
|
+
"eslint-plugin-react-hooks": "^2.3.0",
|
|
82
|
+
"file-loader": "^6.2.0",
|
|
83
|
+
"glob": "^7.1.2",
|
|
84
|
+
"jsonfile": "^5.0.0",
|
|
85
|
+
"karma": "^6.4.1",
|
|
86
|
+
"karma-chai": "^0.1.0",
|
|
87
|
+
"karma-chrome-launcher": "^3.1.1",
|
|
88
|
+
"karma-coverage": "^2.2.0",
|
|
89
|
+
"karma-firefox-launcher": "^2.1.2",
|
|
90
|
+
"karma-mocha": "^2.0.1",
|
|
91
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
92
|
+
"karma-sourcemap-loader": "^0.4.0",
|
|
93
|
+
"karma-webpack": "^5.0.0",
|
|
94
|
+
"loglevel": "^1.6.1",
|
|
95
|
+
"mocha": "^10.2.0",
|
|
96
|
+
"nyc": "^14.1.1",
|
|
97
|
+
"react-shallow-testutils": "^3.0.1",
|
|
98
|
+
"react-test-renderer": "^16.8.6",
|
|
99
|
+
"redux-mock-store": "^1.5.1",
|
|
100
|
+
"rimraf": "^3.0.2",
|
|
101
|
+
"style-loader": "^3.3.1",
|
|
102
|
+
"webpack": "^5.75.0",
|
|
103
|
+
"webpack-cli": "^5.0.1",
|
|
104
|
+
"webpack-dev-server": "^4.11.1"
|
|
105
|
+
},
|
|
106
|
+
"nyc": {
|
|
107
|
+
"include": [
|
|
108
|
+
"src/**/*.js"
|
|
109
|
+
],
|
|
110
|
+
"reporter": [
|
|
111
|
+
"json"
|
|
112
|
+
],
|
|
113
|
+
"report-dir": "./coverage/Node.js",
|
|
114
|
+
"sourceMap": false,
|
|
115
|
+
"instrument": false,
|
|
116
|
+
"cache": true
|
|
117
|
+
}
|
|
118
|
+
}
|