@blaze-cms/plugin-search-ui 0.125.0-admin-updates.1 → 0.125.0-alpha.18
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/CHANGELOG.md +2 -16
- package/lib/application/query/index.js +0 -8
- package/lib/application/query/index.js.map +1 -1
- package/lib/components/SearchAdmin/RecentSearches/RecentSearches.js +2 -11
- package/lib/components/SearchAdmin/RecentSearches/RecentSearches.js.map +1 -1
- package/lib/components/SearchAdmin/RecentSearches/index.js +0 -4
- package/lib/components/SearchAdmin/RecentSearches/index.js.map +1 -1
- package/lib/components/SearchAdmin/SearchAdmin.js +25 -125
- package/lib/components/SearchAdmin/SearchAdmin.js.map +1 -1
- package/lib/components/SearchAdmin/SearchBar/SearchBar.js +7 -15
- package/lib/components/SearchAdmin/SearchBar/SearchBar.js.map +1 -1
- package/lib/components/SearchAdmin/SearchBar/index.js +0 -4
- package/lib/components/SearchAdmin/SearchBar/index.js.map +1 -1
- package/lib/components/SearchAdmin/SearchResults/SearchResults.js +25 -77
- package/lib/components/SearchAdmin/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchAdmin/SearchResults/index.js +0 -4
- package/lib/components/SearchAdmin/SearchResults/index.js.map +1 -1
- package/lib/components/SearchAdmin/TriggerModal/TriggerModal.js +0 -6
- package/lib/components/SearchAdmin/TriggerModal/TriggerModal.js.map +1 -1
- package/lib/components/SearchAdmin/TriggerModal/index.js +0 -4
- package/lib/components/SearchAdmin/TriggerModal/index.js.map +1 -1
- package/lib/components/SearchAdmin/index.js +0 -4
- package/lib/components/SearchAdmin/index.js.map +1 -1
- package/lib/components/SearchPublishedContent/SearchPublishedContent.js +36 -67
- package/lib/components/SearchPublishedContent/SearchPublishedContent.js.map +1 -1
- package/lib/components/SearchPublishedContent/index.js +0 -4
- package/lib/components/SearchPublishedContent/index.js.map +1 -1
- package/lib/components/useLocalStorage/index.js +0 -4
- package/lib/components/useLocalStorage/index.js.map +1 -1
- package/lib/components/useLocalStorage/useLocalStorage.js +6 -14
- package/lib/components/useLocalStorage/useLocalStorage.js.map +1 -1
- package/lib/components/useSearch/index.js +0 -4
- package/lib/components/useSearch/index.js.map +1 -1
- package/lib/components/useSearch/useSearch.js +35 -72
- package/lib/components/useSearch/useSearch.js.map +1 -1
- package/lib/components/useSearchResults/index.js +0 -4
- package/lib/components/useSearchResults/index.js.map +1 -1
- package/lib/components/useSearchResults/useSearchResults.js +35 -39
- package/lib/components/useSearchResults/useSearchResults.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/hooks/index.js +0 -4
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useDebounceSearch.js +19 -33
- package/lib/hooks/useDebounceSearch.js.map +1 -1
- package/lib/index.js +0 -6
- package/lib/index.js.map +1 -1
- package/lib-es/application/query/index.js +0 -3
- package/lib-es/application/query/index.js.map +1 -1
- package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js +0 -2
- package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js.map +1 -1
- package/lib-es/components/SearchAdmin/RecentSearches/index.js.map +1 -1
- package/lib-es/components/SearchAdmin/SearchAdmin.js +3 -45
- package/lib-es/components/SearchAdmin/SearchAdmin.js.map +1 -1
- package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js +0 -2
- package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js.map +1 -1
- package/lib-es/components/SearchAdmin/SearchBar/index.js.map +1 -1
- package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js +6 -27
- package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js.map +1 -1
- package/lib-es/components/SearchAdmin/SearchResults/index.js.map +1 -1
- package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js +0 -2
- package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js.map +1 -1
- package/lib-es/components/SearchAdmin/TriggerModal/index.js.map +1 -1
- package/lib-es/components/SearchAdmin/index.js.map +1 -1
- package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js +4 -10
- package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js.map +1 -1
- package/lib-es/components/SearchPublishedContent/index.js.map +1 -1
- package/lib-es/components/useLocalStorage/index.js.map +1 -1
- package/lib-es/components/useLocalStorage/useLocalStorage.js +0 -4
- package/lib-es/components/useLocalStorage/useLocalStorage.js.map +1 -1
- package/lib-es/components/useSearch/index.js.map +1 -1
- package/lib-es/components/useSearch/useSearch.js +4 -13
- package/lib-es/components/useSearch/useSearch.js.map +1 -1
- package/lib-es/components/useSearchResults/index.js.map +1 -1
- package/lib-es/components/useSearchResults/useSearchResults.js +11 -9
- package/lib-es/components/useSearchResults/useSearchResults.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/hooks/index.js.map +1 -1
- package/lib-es/hooks/useDebounceSearch.js +0 -2
- package/lib-es/hooks/useDebounceSearch.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/SearchAdmin/SearchAdmin.js +40 -70
- package/src/components/SearchAdmin/SearchResults/SearchResults.js +6 -42
- package/src/components/useSearch/useSearch.js +2 -8
- package/src/components/useSearchResults/useSearchResults.js +15 -1
- package/lib/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +0 -143
- package/lib/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js.map +0 -1
- package/lib/components/SearchAdmin/SearchAdminSideBar/index.js +0 -16
- package/lib/components/SearchAdmin/SearchAdminSideBar/index.js.map +0 -1
- package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +0 -79
- package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js.map +0 -1
- package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js +0 -3
- package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js.map +0 -1
- package/src/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +0 -88
- package/src/components/SearchAdmin/SearchAdminSideBar/index.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TriggerModal.js","names":["React","PropTypes","TriggerModal","toggleSearchModal","propTypes","func","isRequired"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/TriggerModal.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst TriggerModal = ({ toggleSearchModal }) => (\n <span\n role=\"button\"\n className=\"material-icons searchModal-search-icon\"\n onClick={toggleSearchModal}>\n search\n </span>\n);\n\nTriggerModal.propTypes = {\n toggleSearchModal: PropTypes.func.isRequired\n};\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"TriggerModal.js","names":["React","PropTypes","TriggerModal","toggleSearchModal","propTypes","func","isRequired"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/TriggerModal.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst TriggerModal = ({ toggleSearchModal }) => (\n <span\n role=\"button\"\n className=\"material-icons searchModal-search-icon\"\n onClick={toggleSearchModal}>\n search\n </span>\n);\n\nTriggerModal.propTypes = {\n toggleSearchModal: PropTypes.func.isRequired\n};\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,YAAY,GAAG,CAAC;EAAEC;AAAkB,CAAC,kBACzC;EACE,IAAI,EAAC,QAAQ;EACb,SAAS,EAAC,wCAAwC;EAClD,OAAO,EAAEA;AAAkB,YAG9B;AAEDD,YAAY,CAACE,SAAS,GAAG;EACvBD,iBAAiB,EAAEF,SAAS,CAACI,IAAI,CAACC;AACpC,CAAC;AAED,eAAeJ,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["TriggerModal"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/index.js"],"sourcesContent":["import TriggerModal from './TriggerModal';\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["TriggerModal"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/index.js"],"sourcesContent":["import TriggerModal from './TriggerModal';\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,eAAeA,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchAdmin"],"sources":["../../../src/components/SearchAdmin/index.js"],"sourcesContent":["import SearchAdmin from './SearchAdmin';\n\nexport default SearchAdmin;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchAdmin"],"sources":["../../../src/components/SearchAdmin/index.js"],"sourcesContent":["import SearchAdmin from './SearchAdmin';\n\nexport default SearchAdmin;\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAEvC,eAAeA,WAAW"}
|
|
@@ -5,7 +5,6 @@ import { MdClose, MdSearch } from 'react-icons/md';
|
|
|
5
5
|
import { useDebounce } from '@blaze-react/utils/lib/customHooks';
|
|
6
6
|
import useSearchResults from '../useSearchResults';
|
|
7
7
|
import { SEARCH_PUBLISHED, DEFAULT_RESULTS_KEYS, SEARCH_BUTTON } from '../../constants';
|
|
8
|
-
|
|
9
8
|
const SearchPublishedContent = ({
|
|
10
9
|
entities,
|
|
11
10
|
children,
|
|
@@ -38,13 +37,15 @@ const SearchPublishedContent = ({
|
|
|
38
37
|
if (isSearchBarOpen !== displaySearchBar) {
|
|
39
38
|
setDisplaySearchBar(isSearchBarOpen);
|
|
40
39
|
}
|
|
41
|
-
},
|
|
40
|
+
},
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
42
|
[isSearchBarOpen]);
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
if (inputRef && inputRef.current && displaySearchBar) {
|
|
45
45
|
inputRef.current.focus();
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
},
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
49
|
[displaySearchBar]);
|
|
49
50
|
useEffect(() => {
|
|
50
51
|
if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {
|
|
@@ -54,7 +55,6 @@ const SearchPublishedContent = ({
|
|
|
54
55
|
setPreviousSearchTerm(debouncedSearchTerm);
|
|
55
56
|
}
|
|
56
57
|
}, [debouncedSearchTerm, previousSearchTerm, setQueryParams]);
|
|
57
|
-
|
|
58
58
|
const handleOnChange = ({
|
|
59
59
|
target: {
|
|
60
60
|
value = ''
|
|
@@ -63,26 +63,21 @@ const SearchPublishedContent = ({
|
|
|
63
63
|
onChange(value);
|
|
64
64
|
setSearchTerm(value);
|
|
65
65
|
};
|
|
66
|
-
|
|
67
66
|
const handleKeyPress = event => {
|
|
68
67
|
const onEnter = event.key === 'Enter';
|
|
69
68
|
onEnter && onEnterPress();
|
|
70
69
|
};
|
|
71
|
-
|
|
72
70
|
const handleSearchBar = () => {
|
|
73
71
|
const voidSearchTerm = '';
|
|
74
72
|
displaySearchBar && setSearchTerm(voidSearchTerm);
|
|
75
73
|
handleOnChange({
|
|
76
74
|
value: voidSearchTerm
|
|
77
75
|
});
|
|
78
|
-
|
|
79
76
|
if (isSearchBarOpen !== null) {
|
|
80
77
|
getIsOpenSearchBar(!displaySearchBar);
|
|
81
78
|
}
|
|
82
|
-
|
|
83
79
|
setDisplaySearchBar(!displaySearchBar);
|
|
84
80
|
};
|
|
85
|
-
|
|
86
81
|
const searchWrapperClassname = classnames('search__wrapper', {
|
|
87
82
|
'search__wrapper--toggle-display': displaySearchBar,
|
|
88
83
|
'search__wrapper--toggle': !displaySearchBar
|
|
@@ -120,7 +115,6 @@ const SearchPublishedContent = ({
|
|
|
120
115
|
loading
|
|
121
116
|
})));
|
|
122
117
|
};
|
|
123
|
-
|
|
124
118
|
SearchPublishedContent.propTypes = {
|
|
125
119
|
entities: PropTypes.array,
|
|
126
120
|
children: PropTypes.func.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPublishedContent.js","names":["React","useState","useEffect","classnames","PropTypes","MdClose","MdSearch","useDebounce","useSearchResults","SEARCH_PUBLISHED","DEFAULT_RESULTS_KEYS","SEARCH_BUTTON","SearchPublishedContent","entities","children","resultKeys","getIsOpenSearchBar","SearchIcon","CloseIcon","className","onChange","placeholder","onEnterPress","inputRef","isSearchBarOpen","fields","displaySearchBar","setDisplaySearchBar","searchTerm","setSearchTerm","previousSearchTerm","setPreviousSearchTerm","debouncedSearchTerm","loading","results","setQueryParams","queryKey","current","focus","value","handleOnChange","target","handleKeyPress","event","onEnter","key","handleSearchBar","voidSearchTerm","searchWrapperClassname","triggerClassname","open","length","propTypes","array","func","isRequired","string","object","bool","defaultProps","state"],"sources":["../../../src/components/SearchPublishedContent/SearchPublishedContent.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { MdClose, MdSearch } from 'react-icons/md';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useSearchResults from '../useSearchResults';\nimport { SEARCH_PUBLISHED, DEFAULT_RESULTS_KEYS, SEARCH_BUTTON } from '../../constants';\n\nconst SearchPublishedContent = ({\n entities,\n children,\n resultKeys,\n getIsOpenSearchBar,\n SearchIcon,\n CloseIcon,\n className,\n onChange,\n placeholder,\n onEnterPress,\n inputRef,\n isSearchBarOpen,\n fields\n}) => {\n const [displaySearchBar, setDisplaySearchBar] = useState(isSearchBarOpen);\n const [searchTerm, setSearchTerm] = useState('');\n const [previousSearchTerm, setPreviousSearchTerm] = useState(null);\n const debouncedSearchTerm = useDebounce(searchTerm, 500);\n\n const [{ loading, results }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_PUBLISHED,\n resultKeys,\n entities,\n fields\n });\n\n useEffect(\n () => {\n if (isSearchBarOpen !== displaySearchBar) {\n setDisplaySearchBar(isSearchBarOpen);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isSearchBarOpen]\n );\n\n useEffect(\n () => {\n if (inputRef && inputRef.current && displaySearchBar) {\n inputRef.current.focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [displaySearchBar]\n );\n\n useEffect(\n () => {\n if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {\n setQueryParams({ value: `${debouncedSearchTerm}*` });\n setPreviousSearchTerm(debouncedSearchTerm);\n }\n },\n [debouncedSearchTerm, previousSearchTerm, setQueryParams]\n );\n\n const handleOnChange = ({ target: { value = '' } = {} }) => {\n onChange(value);\n setSearchTerm(value);\n };\n\n const handleKeyPress = event => {\n const onEnter = event.key === 'Enter';\n onEnter && onEnterPress();\n };\n\n const handleSearchBar = () => {\n const voidSearchTerm = '';\n displaySearchBar && setSearchTerm(voidSearchTerm);\n handleOnChange({ value: voidSearchTerm });\n if (isSearchBarOpen !== null) {\n getIsOpenSearchBar(!displaySearchBar);\n }\n setDisplaySearchBar(!displaySearchBar);\n };\n\n const searchWrapperClassname = classnames('search__wrapper', {\n 'search__wrapper--toggle-display': displaySearchBar,\n 'search__wrapper--toggle': !displaySearchBar\n });\n\n const triggerClassname = classnames('search__icon', {\n open: displaySearchBar\n });\n\n return (\n <div className={`search-wrapper ${className}`}>\n <div className=\"search search--header search--toggle\">\n <div className={searchWrapperClassname}>\n <input\n data-testid=\"search-input\"\n onKeyPress={handleKeyPress}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleOnChange}\n value={searchTerm}\n ref={inputRef}\n />\n <button type=\"button\" className=\"icon-button icon-button--search icon-button--toggle\">\n <SearchIcon />\n </button>\n </div>\n <div\n role=\"button\"\n className={triggerClassname}\n onClick={handleSearchBar}\n id={SEARCH_BUTTON}\n title={SEARCH_BUTTON}>\n {!displaySearchBar ? <SearchIcon /> : <CloseIcon />}\n </div>\n </div>\n <div className=\"search-modal\">\n {children({ results: results.length && searchTerm ? results : [], loading })}\n </div>\n </div>\n );\n};\n\nSearchPublishedContent.propTypes = {\n entities: PropTypes.array,\n children: PropTypes.func.isRequired,\n resultKeys: PropTypes.string,\n getIsOpenSearchBar: PropTypes.func,\n SearchIcon: PropTypes.func,\n CloseIcon: PropTypes.func,\n onChange: PropTypes.func,\n onEnterPress: PropTypes.func,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n inputRef: PropTypes.object,\n isSearchBarOpen: PropTypes.bool,\n fields: PropTypes.array\n};\n\nSearchPublishedContent.defaultProps = {\n entities: ['published_page'],\n placeholder: '',\n resultKeys: DEFAULT_RESULTS_KEYS,\n onChange: () => {},\n onEnterPress: () => {},\n getIsOpenSearchBar: state => state,\n SearchIcon: () => (\n <i>\n <MdSearch />\n </i>\n ),\n CloseIcon: () => (\n <i>\n <MdClose />\n </i>\n ),\n className: '',\n inputRef: null,\n isSearchBarOpen: null,\n fields: []\n};\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"SearchPublishedContent.js","names":["React","useState","useEffect","classnames","PropTypes","MdClose","MdSearch","useDebounce","useSearchResults","SEARCH_PUBLISHED","DEFAULT_RESULTS_KEYS","SEARCH_BUTTON","SearchPublishedContent","entities","children","resultKeys","getIsOpenSearchBar","SearchIcon","CloseIcon","className","onChange","placeholder","onEnterPress","inputRef","isSearchBarOpen","fields","displaySearchBar","setDisplaySearchBar","searchTerm","setSearchTerm","previousSearchTerm","setPreviousSearchTerm","debouncedSearchTerm","loading","results","setQueryParams","queryKey","current","focus","value","handleOnChange","target","handleKeyPress","event","onEnter","key","handleSearchBar","voidSearchTerm","searchWrapperClassname","triggerClassname","open","length","propTypes","array","func","isRequired","string","object","bool","defaultProps","state"],"sources":["../../../src/components/SearchPublishedContent/SearchPublishedContent.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { MdClose, MdSearch } from 'react-icons/md';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useSearchResults from '../useSearchResults';\nimport { SEARCH_PUBLISHED, DEFAULT_RESULTS_KEYS, SEARCH_BUTTON } from '../../constants';\n\nconst SearchPublishedContent = ({\n entities,\n children,\n resultKeys,\n getIsOpenSearchBar,\n SearchIcon,\n CloseIcon,\n className,\n onChange,\n placeholder,\n onEnterPress,\n inputRef,\n isSearchBarOpen,\n fields\n}) => {\n const [displaySearchBar, setDisplaySearchBar] = useState(isSearchBarOpen);\n const [searchTerm, setSearchTerm] = useState('');\n const [previousSearchTerm, setPreviousSearchTerm] = useState(null);\n const debouncedSearchTerm = useDebounce(searchTerm, 500);\n\n const [{ loading, results }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_PUBLISHED,\n resultKeys,\n entities,\n fields\n });\n\n useEffect(\n () => {\n if (isSearchBarOpen !== displaySearchBar) {\n setDisplaySearchBar(isSearchBarOpen);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isSearchBarOpen]\n );\n\n useEffect(\n () => {\n if (inputRef && inputRef.current && displaySearchBar) {\n inputRef.current.focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [displaySearchBar]\n );\n\n useEffect(\n () => {\n if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {\n setQueryParams({ value: `${debouncedSearchTerm}*` });\n setPreviousSearchTerm(debouncedSearchTerm);\n }\n },\n [debouncedSearchTerm, previousSearchTerm, setQueryParams]\n );\n\n const handleOnChange = ({ target: { value = '' } = {} }) => {\n onChange(value);\n setSearchTerm(value);\n };\n\n const handleKeyPress = event => {\n const onEnter = event.key === 'Enter';\n onEnter && onEnterPress();\n };\n\n const handleSearchBar = () => {\n const voidSearchTerm = '';\n displaySearchBar && setSearchTerm(voidSearchTerm);\n handleOnChange({ value: voidSearchTerm });\n if (isSearchBarOpen !== null) {\n getIsOpenSearchBar(!displaySearchBar);\n }\n setDisplaySearchBar(!displaySearchBar);\n };\n\n const searchWrapperClassname = classnames('search__wrapper', {\n 'search__wrapper--toggle-display': displaySearchBar,\n 'search__wrapper--toggle': !displaySearchBar\n });\n\n const triggerClassname = classnames('search__icon', {\n open: displaySearchBar\n });\n\n return (\n <div className={`search-wrapper ${className}`}>\n <div className=\"search search--header search--toggle\">\n <div className={searchWrapperClassname}>\n <input\n data-testid=\"search-input\"\n onKeyPress={handleKeyPress}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleOnChange}\n value={searchTerm}\n ref={inputRef}\n />\n <button type=\"button\" className=\"icon-button icon-button--search icon-button--toggle\">\n <SearchIcon />\n </button>\n </div>\n <div\n role=\"button\"\n className={triggerClassname}\n onClick={handleSearchBar}\n id={SEARCH_BUTTON}\n title={SEARCH_BUTTON}>\n {!displaySearchBar ? <SearchIcon /> : <CloseIcon />}\n </div>\n </div>\n <div className=\"search-modal\">\n {children({ results: results.length && searchTerm ? results : [], loading })}\n </div>\n </div>\n );\n};\n\nSearchPublishedContent.propTypes = {\n entities: PropTypes.array,\n children: PropTypes.func.isRequired,\n resultKeys: PropTypes.string,\n getIsOpenSearchBar: PropTypes.func,\n SearchIcon: PropTypes.func,\n CloseIcon: PropTypes.func,\n onChange: PropTypes.func,\n onEnterPress: PropTypes.func,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n inputRef: PropTypes.object,\n isSearchBarOpen: PropTypes.bool,\n fields: PropTypes.array\n};\n\nSearchPublishedContent.defaultProps = {\n entities: ['published_page'],\n placeholder: '',\n resultKeys: DEFAULT_RESULTS_KEYS,\n onChange: () => {},\n onEnterPress: () => {},\n getIsOpenSearchBar: state => state,\n SearchIcon: () => (\n <i>\n <MdSearch />\n </i>\n ),\n CloseIcon: () => (\n <i>\n <MdClose />\n </i>\n ),\n className: '',\n inputRef: null,\n isSearchBarOpen: null,\n fields: []\n};\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,UAAU,MAAM,YAAY;AAC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nB,SAAS,CAACqD,MAAM;EAC1BjC,eAAe,EAAEpB,SAAS,CAACsD,IAAI;EAC/BjC,MAAM,EAAErB,SAAS,CAACiD;AACpB,CAAC;AAEDzC,sBAAsB,CAAC+C,YAAY,GAAG;EACpC9C,QAAQ,EAAE,CAAC,gBAAgB,CAAC;EAC5BQ,WAAW,EAAE,EAAE;EACfN,UAAU,EAAEL,oBAAoB;EAChCU,QAAQ,EAAE,MAAM,CAAC,CAAC;EAClBE,YAAY,EAAE,MAAM,CAAC,CAAC;EACtBN,kBAAkB,EAAE4C,KAAK,IAAIA,KAAK;EAClC3C,UAAU,EAAE,mBACV,4CACE,oBAAC,QAAQ,OAAG,CAEf;EACDC,SAAS,EAAE,mBACT,4CACE,oBAAC,OAAO,OAAG,CAEd;EACDC,SAAS,EAAE,EAAE;EACbI,QAAQ,EAAE,IAAI;EACdC,eAAe,EAAE,IAAI;EACrBC,MAAM,EAAE;AACV,CAAC;AAED,eAAeb,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchPublishedContent"],"sources":["../../../src/components/SearchPublishedContent/index.js"],"sourcesContent":["import SearchPublishedContent from './SearchPublishedContent';\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchPublishedContent"],"sources":["../../../src/components/SearchPublishedContent/index.js"],"sourcesContent":["import SearchPublishedContent from './SearchPublishedContent';\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,eAAeA,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLocalStorage"],"sources":["../../../src/components/useLocalStorage/index.js"],"sourcesContent":["import useLocalStorage from './useLocalStorage';\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLocalStorage"],"sources":["../../../src/components/useLocalStorage/index.js"],"sourcesContent":["import useLocalStorage from './useLocalStorage';\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,mBAAmB;AAE/C,eAAeA,eAAe"}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
|
|
3
2
|
function useLocalStorage(key, initialValue) {
|
|
4
3
|
const [storedValue, setStoredValue] = useState(() => {
|
|
5
4
|
const item = window.localStorage.getItem(key);
|
|
6
5
|
return item ? JSON.parse(item) : initialValue;
|
|
7
6
|
});
|
|
8
|
-
|
|
9
7
|
const setValue = value => {
|
|
10
8
|
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
11
9
|
setStoredValue(valueToStore);
|
|
12
10
|
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return [storedValue, setValue];
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
export default useLocalStorage;
|
|
19
15
|
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","names":["useState","useLocalStorage","key","initialValue","storedValue","setStoredValue","item","window","localStorage","getItem","JSON","parse","setValue","value","valueToStore","Function","setItem","stringify"],"sources":["../../../src/components/useLocalStorage/useLocalStorage.js"],"sourcesContent":["import { useState } from 'react';\n\nfunction useLocalStorage(key, initialValue) {\n const [storedValue, setStoredValue] = useState(() => {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n });\n\n const setValue = value => {\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n setStoredValue(valueToStore);\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n };\n\n return [storedValue, setValue];\n}\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"useLocalStorage.js","names":["useState","useLocalStorage","key","initialValue","storedValue","setStoredValue","item","window","localStorage","getItem","JSON","parse","setValue","value","valueToStore","Function","setItem","stringify"],"sources":["../../../src/components/useLocalStorage/useLocalStorage.js"],"sourcesContent":["import { useState } from 'react';\n\nfunction useLocalStorage(key, initialValue) {\n const [storedValue, setStoredValue] = useState(() => {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n });\n\n const setValue = value => {\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n setStoredValue(valueToStore);\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n };\n\n return [storedValue, setValue];\n}\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;AAEhC,SAASC,eAAe,CAACC,GAAG,EAAEC,YAAY,EAAE;EAC1C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAAC,MAAM;IACnD,MAAMM,IAAI,GAAGC,MAAM,CAACC,YAAY,CAACC,OAAO,CAACP,GAAG,CAAC;IAC7C,OAAOI,IAAI,GAAGI,IAAI,CAACC,KAAK,CAACL,IAAI,CAAC,GAAGH,YAAY;EAC/C,CAAC,CAAC;EAEF,MAAMS,QAAQ,GAAGC,KAAK,IAAI;IACxB,MAAMC,YAAY,GAAGD,KAAK,YAAYE,QAAQ,GAAGF,KAAK,CAACT,WAAW,CAAC,GAAGS,KAAK;IAC3ER,cAAc,CAACS,YAAY,CAAC;IAC5BP,MAAM,CAACC,YAAY,CAACQ,OAAO,CAACd,GAAG,EAAEQ,IAAI,CAACO,SAAS,CAACH,YAAY,CAAC,CAAC;EAChE,CAAC;EAED,OAAO,CAACV,WAAW,EAAEQ,QAAQ,CAAC;AAChC;AAEA,eAAeX,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useSearch"],"sources":["../../../src/components/useSearch/index.js"],"sourcesContent":["import useSearch from './useSearch';\n\nexport default useSearch;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["useSearch"],"sources":["../../../src/components/useSearch/index.js"],"sourcesContent":["import useSearch from './useSearch';\n\nexport default useSearch;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AAEnC,eAAeA,SAAS"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { useState, useEffect } from 'react';
|
|
8
5
|
import { useLazyQuery } from '@apollo/client';
|
|
9
6
|
import searchQueries from '../../application/query';
|
|
10
|
-
|
|
11
7
|
function useSearch({
|
|
12
8
|
queryKey,
|
|
13
9
|
resultKeys,
|
|
@@ -20,7 +16,6 @@ function useSearch({
|
|
|
20
16
|
value: ''
|
|
21
17
|
});
|
|
22
18
|
const [searchedValue, setSearchedValue] = useState(null);
|
|
23
|
-
const [en, setEn] = useState([]);
|
|
24
19
|
const [previousOffset, setPreviousOffset] = useState(null);
|
|
25
20
|
const buildSearchQuery = searchQueries[queryKey];
|
|
26
21
|
const [getSearchResults, {
|
|
@@ -41,13 +36,13 @@ function useSearch({
|
|
|
41
36
|
resultKeys
|
|
42
37
|
}), {
|
|
43
38
|
ssr: false
|
|
44
|
-
});
|
|
39
|
+
});
|
|
40
|
+
// todo: remove ssr: false once this bug is resolved https://github.com/apollographql/apollo-client/issues/9108
|
|
45
41
|
// without ssr: false clients can hang in ssr.
|
|
46
42
|
|
|
47
43
|
const handleQueryParams = newQueryParams => {
|
|
48
44
|
setParams(_objectSpread(_objectSpread({}, queryParams), newQueryParams));
|
|
49
45
|
};
|
|
50
|
-
|
|
51
46
|
useEffect(() => {
|
|
52
47
|
const {
|
|
53
48
|
limit,
|
|
@@ -56,14 +51,12 @@ function useSearch({
|
|
|
56
51
|
} = queryParams;
|
|
57
52
|
const isNewValueSet = value && value !== searchedValue;
|
|
58
53
|
const isNewOffsetSet = previousOffset !== null && offset !== previousOffset;
|
|
59
|
-
const notSameLength = en.length !== entities.length;
|
|
60
54
|
const parsedEntities = entities.length ? entities.map(entity => ({
|
|
61
55
|
match: {
|
|
62
56
|
docType: entity
|
|
63
57
|
}
|
|
64
58
|
})) : [];
|
|
65
|
-
|
|
66
|
-
if (isNewValueSet || isNewOffsetSet || notSameLength) {
|
|
59
|
+
if (isNewValueSet || isNewOffsetSet) {
|
|
67
60
|
getSearchResults({
|
|
68
61
|
variables: {
|
|
69
62
|
limit,
|
|
@@ -90,9 +83,8 @@ function useSearch({
|
|
|
90
83
|
});
|
|
91
84
|
setSearchedValue(value);
|
|
92
85
|
setPreviousOffset(offset);
|
|
93
|
-
setEn(entities);
|
|
94
86
|
}
|
|
95
|
-
}, [queryParams, queryParams.limit, queryParams.value, queryParams.offset, searchedValue, previousOffset, getSearchResults, entities, fields
|
|
87
|
+
}, [queryParams, queryParams.limit, queryParams.value, queryParams.offset, searchedValue, previousOffset, getSearchResults, entities, fields]);
|
|
96
88
|
return [{
|
|
97
89
|
searchedValue: queryParams.value,
|
|
98
90
|
loading,
|
|
@@ -102,6 +94,5 @@ function useSearch({
|
|
|
102
94
|
}
|
|
103
95
|
}, handleQueryParams];
|
|
104
96
|
}
|
|
105
|
-
|
|
106
97
|
export default useSearch;
|
|
107
98
|
//# sourceMappingURL=useSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","names":["useState","useEffect","useLazyQuery","searchQueries","useSearch","queryKey","resultKeys","entities","fields","queryParams","setParams","limit","offset","value","searchedValue","setSearchedValue","
|
|
1
|
+
{"version":3,"file":"useSearch.js","names":["useState","useEffect","useLazyQuery","searchQueries","useSearch","queryKey","resultKeys","entities","fields","queryParams","setParams","limit","offset","value","searchedValue","setSearchedValue","previousOffset","setPreviousOffset","buildSearchQuery","getSearchResults","loading","data","search","results","jsonResults","total","ssr","handleQueryParams","newQueryParams","isNewValueSet","isNewOffsetSet","parsedEntities","length","map","entity","match","docType","variables","rawQuery","query","bool","must","query_string","type","default_operator","should"],"sources":["../../../src/components/useSearch/useSearch.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { useLazyQuery } from '@apollo/client';\nimport searchQueries from '../../application/query';\n\nfunction useSearch({ queryKey, resultKeys, entities = [], fields }) {\n const [queryParams, setParams] = useState({ limit: 20, offset: 0, value: '' });\n const [searchedValue, setSearchedValue] = useState(null);\n const [previousOffset, setPreviousOffset] = useState(null);\n const buildSearchQuery = searchQueries[queryKey];\n const [\n getSearchResults,\n {\n loading,\n data: { search: { results, jsonResults, total } } = {\n search: { results: [], total: 0 }\n }\n }\n ] = useLazyQuery(buildSearchQuery({ resultKeys }), { ssr: false });\n // todo: remove ssr: false once this bug is resolved https://github.com/apollographql/apollo-client/issues/9108\n // without ssr: false clients can hang in ssr.\n\n const handleQueryParams = newQueryParams => {\n setParams({ ...queryParams, ...newQueryParams });\n };\n\n useEffect(\n () => {\n const { limit, offset, value } = queryParams;\n const isNewValueSet = value && value !== searchedValue;\n const isNewOffsetSet = previousOffset !== null && offset !== previousOffset;\n const parsedEntities = entities.length\n ? entities.map(entity => ({\n match: { docType: entity }\n }))\n : [];\n\n if (isNewValueSet || isNewOffsetSet) {\n getSearchResults({\n variables: {\n limit,\n offset,\n rawQuery: {\n query: {\n bool: {\n must: [\n {\n query_string: {\n query: value,\n fields,\n type: 'most_fields',\n default_operator: 'AND'\n }\n },\n {\n bool: {\n should: parsedEntities\n }\n }\n ]\n }\n }\n }\n }\n });\n setSearchedValue(value);\n setPreviousOffset(offset);\n }\n },\n [\n queryParams,\n queryParams.limit,\n queryParams.value,\n queryParams.offset,\n searchedValue,\n previousOffset,\n getSearchResults,\n entities,\n fields\n ]\n );\n\n return [\n { searchedValue: queryParams.value, loading, data: { results: results || jsonResults, total } },\n handleQueryParams\n ];\n}\n\nexport default useSearch;\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,OAAOC,aAAa,MAAM,yBAAyB;AAEnD,SAASC,SAAS,CAAC;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,QAAQ,GAAG,EAAE;EAAEC;AAAO,CAAC,EAAE;EAClE,MAAM,CAACC,WAAW,EAAEC,SAAS,CAAC,GAAGV,QAAQ,CAAC;IAAEW,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE,CAAC;IAAEC,KAAK,EAAE;EAAG,CAAC,CAAC;EAC9E,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGf,QAAQ,CAAC,IAAI,CAAC;EACxD,MAAM,CAACgB,cAAc,EAAEC,iBAAiB,CAAC,GAAGjB,QAAQ,CAAC,IAAI,CAAC;EAC1D,MAAMkB,gBAAgB,GAAGf,aAAa,CAACE,QAAQ,CAAC;EAChD,MAAM,CACJc,gBAAgB,EAChB;IACEC,OAAO;IACPC,IAAI,EAAE;MAAEC,MAAM,EAAE;QAAEC,OAAO;QAAEC,WAAW;QAAEC;MAAM;IAAE,CAAC,GAAG;MAClDH,MAAM,EAAE;QAAEC,OAAO,EAAE,EAAE;QAAEE,KAAK,EAAE;MAAE;IAClC;EACF,CAAC,CACF,GAAGvB,YAAY,CAACgB,gBAAgB,CAAC;IAAEZ;EAAW,CAAC,CAAC,EAAE;IAAEoB,GAAG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O,CACL;IAAEM,aAAa,EAAEL,WAAW,CAACI,KAAK;IAAEO,OAAO;IAAEC,IAAI,EAAE;MAAEE,OAAO,EAAEA,OAAO,IAAIC,WAAW;MAAEC;IAAM;EAAE,CAAC,EAC/FE,iBAAiB,CAClB;AACH;AAEA,eAAevB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useSearchResults"],"sources":["../../../src/components/useSearchResults/index.js"],"sourcesContent":["import useSearchResults from './useSearchResults';\n\nexport default useSearchResults;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["useSearchResults"],"sources":["../../../src/components/useSearchResults/index.js"],"sourcesContent":["import useSearchResults from './useSearchResults';\n\nexport default useSearchResults;\n"],"mappings":"AAAA,OAAOA,gBAAgB,MAAM,oBAAoB;AAEjD,eAAeA,gBAAgB"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
4
|
+
import { useState, useEffect } from 'react';
|
|
7
5
|
import useSearch from '../useSearch';
|
|
8
|
-
|
|
9
6
|
function useSearchResults({
|
|
10
7
|
queryKey,
|
|
11
8
|
resultKeys,
|
|
@@ -25,23 +22,28 @@ function useSearchResults({
|
|
|
25
22
|
entities,
|
|
26
23
|
fields
|
|
27
24
|
});
|
|
28
|
-
|
|
25
|
+
const [currentResults, setCurrentResults] = useState([]);
|
|
26
|
+
const [allResults, setAllResults] = useState([]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (currentResults.length !== results.length) {
|
|
29
|
+
setAllResults([...allResults, ...results]);
|
|
30
|
+
setCurrentResults(results);
|
|
31
|
+
}
|
|
32
|
+
}, [allResults, currentResults, currentResults.length, results]);
|
|
29
33
|
const clearList = params => {
|
|
34
|
+
setAllResults([]);
|
|
30
35
|
setParams(_objectSpread(_objectSpread({}, params), {}, {
|
|
31
36
|
offset: 0
|
|
32
37
|
}));
|
|
33
38
|
};
|
|
34
|
-
|
|
35
39
|
const setQueryParams = params => {
|
|
36
40
|
params.value !== searchedValue ? clearList(params) : setParams(params);
|
|
37
41
|
};
|
|
38
|
-
|
|
39
42
|
return [{
|
|
40
43
|
loading,
|
|
41
|
-
results,
|
|
44
|
+
results: allResults,
|
|
42
45
|
total
|
|
43
46
|
}, setQueryParams];
|
|
44
47
|
}
|
|
45
|
-
|
|
46
48
|
export default useSearchResults;
|
|
47
49
|
//# sourceMappingURL=useSearchResults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearchResults.js","names":["useSearch","useSearchResults","queryKey","resultKeys","entities","fields","searchedValue","loading","data","results","total","setParams","clearList","params","offset","setQueryParams","value"],"sources":["../../../src/components/useSearchResults/useSearchResults.js"],"sourcesContent":["import useSearch from '../useSearch';\n\nfunction useSearchResults({ queryKey, resultKeys, entities, fields }) {\n const [\n {\n searchedValue,\n loading,\n data: { results, total }\n },\n setParams\n ] = useSearch({ queryKey, resultKeys, entities, fields });\n\n const clearList = params => {\n setParams({ ...params, offset: 0 });\n };\n\n const setQueryParams = params => {\n params.value !== searchedValue ? clearList(params) : setParams(params);\n };\n\n return [{ loading, results, total }, setQueryParams];\n}\n\nexport default useSearchResults;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSearchResults.js","names":["useState","useEffect","useSearch","useSearchResults","queryKey","resultKeys","entities","fields","searchedValue","loading","data","results","total","setParams","currentResults","setCurrentResults","allResults","setAllResults","length","clearList","params","offset","setQueryParams","value"],"sources":["../../../src/components/useSearchResults/useSearchResults.js"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport useSearch from '../useSearch';\n\nfunction useSearchResults({ queryKey, resultKeys, entities, fields }) {\n const [\n {\n searchedValue,\n loading,\n data: { results, total }\n },\n setParams\n ] = useSearch({ queryKey, resultKeys, entities, fields });\n const [currentResults, setCurrentResults] = useState([]);\n const [allResults, setAllResults] = useState([]);\n\n useEffect(\n () => {\n if (currentResults.length !== results.length) {\n setAllResults([...allResults, ...results]);\n setCurrentResults(results);\n }\n },\n [allResults, currentResults, currentResults.length, results]\n );\n\n const clearList = params => {\n setAllResults([]);\n setParams({ ...params, offset: 0 });\n };\n\n const setQueryParams = params => {\n params.value !== searchedValue ? clearList(params) : setParams(params);\n };\n\n return [{ loading, results: allResults, total }, setQueryParams];\n}\n\nexport default useSearchResults;\n"],"mappings":";;;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,OAAOC,SAAS,MAAM,cAAc;AAEpC,SAASC,gBAAgB,CAAC;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAE;EACpE,MAAM,CACJ;IACEC,aAAa;IACbC,OAAO;IACPC,IAAI,EAAE;MAAEC,OAAO;MAAEC;IAAM;EACzB,CAAC,EACDC,SAAS,CACV,GAAGX,SAAS,CAAC;IAAEE,QAAQ;IAAEC,UAAU;IAAEC,QAAQ;IAAEC;EAAO,CAAC,CAAC;EACzD,MAAM,CAACO,cAAc,EAAEC,iBAAiB,CAAC,GAAGf,QAAQ,CAAC,EAAE,CAAC;EACxD,MAAM,CAACgB,UAAU,EAAEC,aAAa,CAAC,GAAGjB,QAAQ,CAAC,EAAE,CAAC;EAEhDC,SAAS,CACP,MAAM;IACJ,IAAIa,cAAc,CAACI,MAAM,KAAKP,OAAO,CAACO,MAAM,EAAE;MAC5CD,aAAa,CAAC,CAAC,GAAGD,UAAU,EAAE,GAAGL,OAAO,CAAC,CAAC;MAC1CI,iBAAiB,CAACJ,OAAO,CAAC;IAC5B;EACF,CAAC,EACD,CAACK,UAAU,EAAEF,cAAc,EAAEA,cAAc,CAACI,MAAM,EAAEP,OAAO,CAAC,CAC7D;EAED,MAAMQ,SAAS,GAAGC,MAAM,IAAI;IAC1BH,aAAa,CAAC,EAAE,CAAC;IACjBJ,SAAS,iCAAMO,MAAM;MAAEC,MAAM,EAAE;IAAC,GAAG;EACrC,CAAC;EAED,MAAMC,cAAc,GAAGF,MAAM,IAAI;IAC/BA,MAAM,CAACG,KAAK,KAAKf,aAAa,GAAGW,SAAS,CAACC,MAAM,CAAC,GAAGP,SAAS,CAACO,MAAM,CAAC;EACxE,CAAC;EAED,OAAO,CAAC;IAAEX,OAAO;IAAEE,OAAO,EAAEK,UAAU;IAAEJ;EAAM,CAAC,EAAEU,cAAc,CAAC;AAClE;AAEA,eAAenB,gBAAgB"}
|
package/lib-es/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["SEARCH_ADMIN","SEARCH_PUBLISHED","SEARCH_RESULTS_OVER_SCAN_BUFFER","SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST","SEARCH_RESULTS_ITEM_SIZE","DEFAULT_RESULTS_KEYS","SEARCH_BUTTON","FILE"],"sources":["../src/constants.js"],"sourcesContent":["const SEARCH_ADMIN = 'SEARCH_ADMIN';\nconst SEARCH_PUBLISHED = 'SEARCH_PUBLISHED';\nconst SEARCH_RESULTS_OVER_SCAN_BUFFER = 0;\nconst SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST = 186;\nconst SEARCH_RESULTS_ITEM_SIZE = 105;\nconst DEFAULT_RESULTS_KEYS = 'name, url';\nconst SEARCH_BUTTON = 'search-button';\nconst FILE = 'file';\n\nexport {\n SEARCH_ADMIN,\n SEARCH_PUBLISHED,\n SEARCH_RESULTS_OVER_SCAN_BUFFER,\n SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST,\n SEARCH_RESULTS_ITEM_SIZE,\n DEFAULT_RESULTS_KEYS,\n SEARCH_BUTTON,\n FILE\n};\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"constants.js","names":["SEARCH_ADMIN","SEARCH_PUBLISHED","SEARCH_RESULTS_OVER_SCAN_BUFFER","SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST","SEARCH_RESULTS_ITEM_SIZE","DEFAULT_RESULTS_KEYS","SEARCH_BUTTON","FILE"],"sources":["../src/constants.js"],"sourcesContent":["const SEARCH_ADMIN = 'SEARCH_ADMIN';\nconst SEARCH_PUBLISHED = 'SEARCH_PUBLISHED';\nconst SEARCH_RESULTS_OVER_SCAN_BUFFER = 0;\nconst SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST = 186;\nconst SEARCH_RESULTS_ITEM_SIZE = 105;\nconst DEFAULT_RESULTS_KEYS = 'name, url';\nconst SEARCH_BUTTON = 'search-button';\nconst FILE = 'file';\n\nexport {\n SEARCH_ADMIN,\n SEARCH_PUBLISHED,\n SEARCH_RESULTS_OVER_SCAN_BUFFER,\n SEARCH_RESULTS_ELEMETS_HEIGHT_ABOVE_LIST,\n SEARCH_RESULTS_ITEM_SIZE,\n DEFAULT_RESULTS_KEYS,\n SEARCH_BUTTON,\n FILE\n};\n"],"mappings":"AAAA,MAAMA,YAAY,GAAG,cAAc;AACnC,MAAMC,gBAAgB,GAAG,kBAAkB;AAC3C,MAAMC,+BAA+B,GAAG,CAAC;AACzC,MAAMC,wCAAwC,GAAG,GAAG;AACpD,MAAMC,wBAAwB,GAAG,GAAG;AACpC,MAAMC,oBAAoB,GAAG,WAAW;AACxC,MAAMC,aAAa,GAAG,eAAe;AACrC,MAAMC,IAAI,GAAG,MAAM;AAEnB,SACEP,YAAY,EACZC,gBAAgB,EAChBC,+BAA+B,EAC/BC,wCAAwC,EACxCC,wBAAwB,EACxBC,oBAAoB,EACpBC,aAAa,EACbC,IAAI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useDebounceSearch"],"sources":["../../src/hooks/index.js"],"sourcesContent":["import useDebounceSearch from './useDebounceSearch';\n\nexport default useDebounceSearch;\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["useDebounceSearch"],"sources":["../../src/hooks/index.js"],"sourcesContent":["import useDebounceSearch from './useDebounceSearch';\n\nexport default useDebounceSearch;\n"],"mappings":"AAAA,OAAOA,iBAAiB,MAAM,qBAAqB;AAEnD,eAAeA,iBAAiB"}
|
|
@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useDebounce } from '@blaze-react/utils/lib/customHooks';
|
|
3
3
|
import useSearchResults from '../components/useSearchResults';
|
|
4
4
|
import { SEARCH_PUBLISHED } from '../constants';
|
|
5
|
-
|
|
6
5
|
const useDebounceSearch = ({
|
|
7
6
|
entities,
|
|
8
7
|
resultKeys,
|
|
@@ -39,6 +38,5 @@ const useDebounceSearch = ({
|
|
|
39
38
|
previousSearchTerm
|
|
40
39
|
};
|
|
41
40
|
};
|
|
42
|
-
|
|
43
41
|
export default useDebounceSearch;
|
|
44
42
|
//# sourceMappingURL=useDebounceSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounceSearch.js","names":["useEffect","useState","useDebounce","useSearchResults","SEARCH_PUBLISHED","useDebounceSearch","entities","resultKeys","fields","initialSearchTerm","searchTerm","setSearchTerm","previousSearchTerm","setPreviousSearchTerm","debouncedSearchTerm","loading","results","setQueryParams","queryKey","value"],"sources":["../../src/hooks/useDebounceSearch.js"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useSearchResults from '../components/useSearchResults';\nimport { SEARCH_PUBLISHED } from '../constants';\n\nconst useDebounceSearch = ({ entities, resultKeys, fields, initialSearchTerm }) => {\n const [searchTerm, setSearchTerm] = useState(initialSearchTerm ?? '');\n const [previousSearchTerm, setPreviousSearchTerm] = useState(null);\n const debouncedSearchTerm = useDebounce(searchTerm, 500);\n\n const [{ loading, results }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_PUBLISHED,\n resultKeys,\n entities,\n fields\n });\n\n useEffect(\n () => {\n if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {\n setQueryParams({ value: debouncedSearchTerm });\n setPreviousSearchTerm(debouncedSearchTerm);\n }\n },\n [debouncedSearchTerm, previousSearchTerm, setQueryParams]\n );\n\n return {\n loading,\n results,\n searchTerm,\n setSearchTerm,\n setPreviousSearchTerm,\n debouncedSearchTerm,\n previousSearchTerm\n };\n};\n\nexport default useDebounceSearch;\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"file":"useDebounceSearch.js","names":["useEffect","useState","useDebounce","useSearchResults","SEARCH_PUBLISHED","useDebounceSearch","entities","resultKeys","fields","initialSearchTerm","searchTerm","setSearchTerm","previousSearchTerm","setPreviousSearchTerm","debouncedSearchTerm","loading","results","setQueryParams","queryKey","value"],"sources":["../../src/hooks/useDebounceSearch.js"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useSearchResults from '../components/useSearchResults';\nimport { SEARCH_PUBLISHED } from '../constants';\n\nconst useDebounceSearch = ({ entities, resultKeys, fields, initialSearchTerm }) => {\n const [searchTerm, setSearchTerm] = useState(initialSearchTerm ?? '');\n const [previousSearchTerm, setPreviousSearchTerm] = useState(null);\n const debouncedSearchTerm = useDebounce(searchTerm, 500);\n\n const [{ loading, results }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_PUBLISHED,\n resultKeys,\n entities,\n fields\n });\n\n useEffect(\n () => {\n if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {\n setQueryParams({ value: debouncedSearchTerm });\n setPreviousSearchTerm(debouncedSearchTerm);\n }\n },\n [debouncedSearchTerm, previousSearchTerm, setQueryParams]\n );\n\n return {\n loading,\n results,\n searchTerm,\n setSearchTerm,\n setPreviousSearchTerm,\n debouncedSearchTerm,\n previousSearchTerm\n };\n};\n\nexport default useDebounceSearch;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,SAASC,WAAW,QAAQ,oCAAoC;AAChE,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,SAASC,gBAAgB,QAAQ,cAAc;AAE/C,MAAMC,iBAAiB,GAAG,CAAC;EAAEC,QAAQ;EAAEC,UAAU;EAAEC,MAAM;EAAEC;AAAkB,CAAC,KAAK;EACjF,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGV,QAAQ,CAACQ,iBAAiB,aAAjBA,iBAAiB,cAAjBA,iBAAiB,GAAI,EAAE,CAAC;EACrE,MAAM,CAACG,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGZ,QAAQ,CAAC,IAAI,CAAC;EAClE,MAAMa,mBAAmB,GAAGZ,WAAW,CAACQ,UAAU,EAAE,GAAG,CAAC;EAExD,MAAM,CAAC;IAAEK,OAAO;IAAEC;EAAQ,CAAC,EAAEC,cAAc,CAAC,GAAGd,gBAAgB,CAAC;IAC9De,QAAQ,EAAEd,gBAAgB;IAC1BG,UAAU;IACVD,QAAQ;IACRE;EACF,CAAC,CAAC;EAEFR,SAAS,CACP,MAAM;IACJ,IAAIc,mBAAmB,IAAIA,mBAAmB,KAAKF,kBAAkB,EAAE;MACrEK,cAAc,CAAC;QAAEE,KAAK,EAAEL;MAAoB,CAAC,CAAC;MAC9CD,qBAAqB,CAACC,mBAAmB,CAAC;IAC5C;EACF,CAAC,EACD,CAACA,mBAAmB,EAAEF,kBAAkB,EAAEK,cAAc,CAAC,CAC1D;EAED,OAAO;IACLF,OAAO;IACPC,OAAO;IACPN,UAAU;IACVC,aAAa;IACbE,qBAAqB;IACrBC,mBAAmB;IACnBF;EACF,CAAC;AACH,CAAC;AAED,eAAeP,iBAAiB"}
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SearchAdmin","SearchPublishedContent","SearchBar","useDebounceSearch"],"sources":["../src/index.js"],"sourcesContent":["import SearchAdmin from './components/SearchAdmin';\nimport SearchPublishedContent from './components/SearchPublishedContent';\nimport SearchBar from './components/SearchAdmin/SearchBar';\nimport useDebounceSearch from './hooks/useDebounceSearch';\n\nexport { SearchAdmin, SearchPublishedContent, SearchBar, useDebounceSearch };\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["SearchAdmin","SearchPublishedContent","SearchBar","useDebounceSearch"],"sources":["../src/index.js"],"sourcesContent":["import SearchAdmin from './components/SearchAdmin';\nimport SearchPublishedContent from './components/SearchPublishedContent';\nimport SearchBar from './components/SearchAdmin/SearchBar';\nimport useDebounceSearch from './hooks/useDebounceSearch';\n\nexport { SearchAdmin, SearchPublishedContent, SearchBar, useDebounceSearch };\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,0BAA0B;AAClD,OAAOC,sBAAsB,MAAM,qCAAqC;AACxE,OAAOC,SAAS,MAAM,oCAAoC;AAC1D,OAAOC,iBAAiB,MAAM,2BAA2B;AAEzD,SAASH,WAAW,EAAEC,sBAAsB,EAAEC,SAAS,EAAEC,iBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-search-ui",
|
|
3
|
-
"version": "0.125.0-
|
|
3
|
+
"version": "0.125.0-alpha.18",
|
|
4
4
|
"description": "Blaze plugin search ui",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/admin-ui-utils": "0.125.0-
|
|
30
|
+
"@blaze-cms/admin-ui-utils": "0.125.0-alpha.18",
|
|
31
31
|
"@blaze-cms/core-errors": "^0.118.0",
|
|
32
32
|
"@blaze-cms/setup-ui": "^0.92.0",
|
|
33
33
|
"@blaze-react/button": "0.5.19",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-tiny-virtual-list": "2.2.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@blaze-cms/core-ui": "
|
|
43
|
+
"@blaze-cms/core-ui": "0.125.0-alpha.18"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@apollo/client": "3.x",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"lib/*",
|
|
53
53
|
"lib-es/*"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d4abd2ef08b28ceb9eeae50da54fb091c628e363"
|
|
56
56
|
}
|