@algolia/autocomplete-plugin-recent-searches
Advanced tools
Comparing version 1.13.0 to 1.14.0
@@ -1,2 +0,2 @@ | ||
/*! @algolia/autocomplete-plugin-recent-searches 1.13.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ | ||
/*! @algolia/autocomplete-plugin-recent-searches 1.14.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : |
@@ -1,3 +0,3 @@ | ||
/*! @algolia/autocomplete-plugin-recent-searches 1.13.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ | ||
/*! @algolia/autocomplete-plugin-recent-searches 1.14.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/autocomplete-plugin-recent-searches"]={})}(this,(function(e){"use strict";function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?t(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){var t=e.item,n=e.query;return r(r({},t),{},{_highlightResult:{label:{value:n?t.label.replace(new RegExp(n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"gi"),(function(e){return"__aa-highlight__".concat(e,"__/aa-highlight__")})):t.label}}})}var c="AUTOCOMPLETE_RECENT_SEARCHES",u="__AUTOCOMPLETE_RECENT_SEARCHES_PLUGIN_TEST_KEY__";function l(e){var t=e.key;return function(){try{return localStorage.setItem(u,""),localStorage.removeItem(u),!0}catch(e){return!1}}()?{setItem:function(e){return window.localStorage.setItem(t,JSON.stringify(e))},getItem:function(){var e=window.localStorage.getItem(t);return e?JSON.parse(e):[]}}:{setItem:function(){},getItem:function(){return[]}}}function s(e){var t=e.onRemove,r=e.onTapAhead;return{item:function(e){var n=e.item,o=e.createElement,a=e.components;return o("div",{className:"aa-ItemWrapper"},o("div",{className:"aa-ItemContent"},o("div",{className:"aa-ItemIcon aa-ItemIcon--noBorder"},o("svg",{viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M12.516 6.984v5.25l4.5 2.672-0.75 1.266-5.25-3.188v-6h1.5zM12 20.016q3.281 0 5.648-2.367t2.367-5.648-2.367-5.648-5.648-2.367-5.648 2.367-2.367 5.648 2.367 5.648 5.648 2.367zM12 2.016q4.125 0 7.055 2.93t2.93 7.055-2.93 7.055-7.055 2.93-7.055-2.93-2.93-7.055 2.93-7.055 7.055-2.93z"}))),o("div",{className:"aa-ItemContentBody"},o("div",{className:"aa-ItemContentTitle"},o(a.ReverseHighlight,{hit:n,attribute:"label"}),n.category&&o("span",{className:"aa-ItemContentSubtitle aa-ItemContentSubtitle--inline"},o("span",{className:"aa-ItemContentSubtitleIcon"})," in"," ",o("span",{className:"aa-ItemContentSubtitleCategory"},n.category))))),o("div",{className:"aa-ItemActions"},o("button",{className:"aa-ItemActionButton",title:"Remove this search",onClick:function(e){e.preventDefault(),e.stopPropagation(),t(n.id)}},o("svg",{viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M18 7v13c0 0.276-0.111 0.525-0.293 0.707s-0.431 0.293-0.707 0.293h-10c-0.276 0-0.525-0.111-0.707-0.293s-0.293-0.431-0.293-0.707v-13zM17 5v-1c0-0.828-0.337-1.58-0.879-2.121s-1.293-0.879-2.121-0.879h-4c-0.828 0-1.58 0.337-2.121 0.879s-0.879 1.293-0.879 2.121v1h-4c-0.552 0-1 0.448-1 1s0.448 1 1 1h1v13c0 0.828 0.337 1.58 0.879 2.121s1.293 0.879 2.121 0.879h10c0.828 0 1.58-0.337 2.121-0.879s0.879-1.293 0.879-2.121v-13h1c0.552 0 1-0.448 1-1s-0.448-1-1-1zM9 5v-1c0-0.276 0.111-0.525 0.293-0.707s0.431-0.293 0.707-0.293h4c0.276 0 0.525 0.111 0.707 0.293s0.293 0.431 0.293 0.707v1zM9 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1zM13 11v6c0 0.552 0.448 1 1 1s1-0.448 1-1v-6c0-0.552-0.448-1-1-1s-1 0.448-1 1z"}))),o("button",{className:"aa-ItemActionButton",title:'Fill query with "'.concat(n.label,'"'),onClick:function(e){e.preventDefault(),e.stopPropagation(),r(n)}},o("svg",{viewBox:"0 0 24 24",fill:"currentColor"},o("path",{d:"M8 17v-7.586l8.293 8.293c0.391 0.391 1.024 0.391 1.414 0s0.391-1.024 0-1.414l-8.293-8.293h7.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-10c-0.552 0-1 0.448-1 1v10c0 0.552 0.448 1 1 1s1-0.448 1-1z"})))))}}}function f(e){return function(t){(0,t.onSelect)((function(t){var r=t.item,n=t.state,o=t.source,a=o.getItemInputValue({item:r,state:n});if("querySuggestionsPlugin"===o.sourceId&&a){var i={id:a,label:a,category:r.__autocomplete_qsCategory};e.addItem(i)}}))}}function m(e){var t=function(e){return r({transformSource:function(e){return e.source}},e)}(e),n=t.storage,a=t.transformSource,i=t.subscribe,c=function(e){return{addItem:function(t){e.onRemove(t.id),e.onAdd(t)},removeItem:function(t){e.onRemove(t)},getAll:function(t){return e.getAll(t)}}}(n),u={current:[]};return{name:"aa.recentSearchesPlugin",subscribe:null!=i?i:f(c),onSubmit:function(e){var t=e.state.query;if(t){var r={id:t,label:t};c.addItem(r)}},getSources:function(e){var t=e.query,r=e.setQuery,n=e.refresh,o=e.state;function i(e){c.removeItem(e),n()}function l(e){r(e.label),n()}return u.current=c.getAll(t),Promise.resolve(u.current).then((function(e){return 0===e.length?[]:[a({source:{sourceId:"recentSearchesPlugin",getItemInputValue:function(e){return e.item.label},getItems:function(){return e},templates:s({onRemove:i,onTapAhead:l})},onRemove:i,onTapAhead:l,state:o})]}))},data:r(r({},c),{},{getAlgoliaSearchParams:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(u.current)?r(r({},n),{},{facetFilters:[].concat(o(null!==(e=n.facetFilters)&&void 0!==e?e:[]),o(u.current.map((function(e){return["objectID:-".concat(e.label)]})))),hitsPerPage:Math.max(1,(null!==(t=n.hitsPerPage)&&void 0!==t?t:10)-u.current.length)}):n}}),__autocomplete_pluginOptions:e}}function g(e){var t=e.query,r=e.items,n=e.limit;return t?r.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())})).slice(0,n).map((function(e){return i({item:e,query:t})})):r.slice(0,n).map((function(e){return i({item:e,query:t})}))}function v(e){return r({limit:5,search:g,transformSource:function(e){return e.source}},e)}e.addHighlightedAttribute=i,e.createLocalStorageRecentSearchesPlugin=function(e){var t=v(e),n=t.key,a=t.limit,i=t.transformSource,u=t.search,s=t.subscribe,f=function(e){var t=e.key,r=e.limit,n=e.search,a=l({key:t});return{onAdd:function(e){a.setItem([e].concat(o(a.getItem())))},onRemove:function(e){a.setItem(a.getItem().filter((function(t){return t.id!==e})))},getAll:function(){return n({query:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",items:a.getItem(),limit:r}).slice(0,r)}}}({key:[c,n].join(":"),limit:a,search:u});return r(r({},m({transformSource:i,storage:f,subscribe:s})),{},{name:"aa.localStorageRecentSearchesPlugin",__autocomplete_pluginOptions:e})},e.createRecentSearchesPlugin=m,e.getTemplates=s,e.search=g,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@algolia/autocomplete-plugin-recent-searches", | ||
"description": "A plugin to add recent searches to Algolia Autocomplete.", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"license": "MIT", | ||
@@ -34,6 +34,6 @@ "homepage": "https://github.com/algolia/autocomplete", | ||
"dependencies": { | ||
"@algolia/autocomplete-core": "1.13.0", | ||
"@algolia/autocomplete-js": "1.13.0", | ||
"@algolia/autocomplete-preset-algolia": "1.13.0", | ||
"@algolia/autocomplete-shared": "1.13.0" | ||
"@algolia/autocomplete-core": "1.14.0", | ||
"@algolia/autocomplete-js": "1.14.0", | ||
"@algolia/autocomplete-preset-algolia": "1.14.0", | ||
"@algolia/autocomplete-shared": "1.14.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
+ Added@algolia/autocomplete-core@1.14.0(transitive)
+ Added@algolia/autocomplete-js@1.14.0(transitive)
+ Added@algolia/autocomplete-plugin-algolia-insights@1.14.0(transitive)
+ Added@algolia/autocomplete-preset-algolia@1.14.0(transitive)
+ Added@algolia/autocomplete-shared@1.14.0(transitive)
- Removed@algolia/autocomplete-core@1.13.0(transitive)
- Removed@algolia/autocomplete-js@1.13.0(transitive)
- Removed@algolia/autocomplete-plugin-algolia-insights@1.13.0(transitive)
- Removed@algolia/autocomplete-preset-algolia@1.13.0(transitive)
- Removed@algolia/autocomplete-shared@1.13.0(transitive)