Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@algolia/autocomplete-plugin-recent-searches

Package Overview
Dependencies
Maintainers
66
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/autocomplete-plugin-recent-searches - npm Package Compare versions

Comparing version 1.6.2 to 1.6.3

2

dist/umd/index.development.js

@@ -1,2 +0,2 @@

/*! @algolia/autocomplete-plugin-recent-searches 1.6.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
/*! @algolia/autocomplete-plugin-recent-searches 1.6.3 | 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.6.2 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
/*! @algolia/autocomplete-plugin-recent-searches 1.6.3 | 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 n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){r(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 r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))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 n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){var t=e.item,r=e.query;return n(n({},t),{},{_highlightResult:{label:{value:r?t.label.replace(new RegExp(r.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,n=e.onTapAhead;return{item:function(e){var r=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:r,attribute:"label"}),r.category&&o("span",{className:"aa-ItemContentSubtitle aa-ItemContentSubtitle--inline"},o("span",{className:"aa-ItemContentSubtitleIcon"})," in"," ",o("span",{className:"aa-ItemContentSubtitleCategory"},r.category))))),o("div",{className:"aa-ItemActions"},o("button",{className:"aa-ItemActionButton",title:"Remove this search",onClick:function(e){e.preventDefault(),e.stopPropagation(),t(r.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(r.label,'"'),onClick:function(e){e.preventDefault(),e.stopPropagation(),n(r)}},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 m(e){return function(t){(0,t.onSelect)((function(t){var n=t.item,r=t.state,o=t.source,a=o.getItemInputValue({item:n,state:r});if("querySuggestionsPlugin"===o.sourceId&&a){var i={id:a,label:a,category:n.__autocomplete_qsCategory};e.addItem(i)}}))}}function f(e){var t=function(e){return n({transformSource:function(e){return e.source}},e)}(e),r=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)}}}(r),u={current:[]};return{name:"aa.recentSearchesPlugin",subscribe:null!=i?i:m(c),onSubmit:function(e){var t=e.state.query;if(t){var n={id:t,label:t};c.addItem(n)}},getSources:function(e){var t=e.query,n=e.setQuery,r=e.refresh,o=e.state;function i(e){c.removeItem(e),r()}function l(e){n(e.label),r()}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:n(n({},c),{},{getAlgoliaSearchParams:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(u.current)?n(n({},r),{},{facetFilters:[].concat(o(null!==(e=r.facetFilters)&&void 0!==e?e:[]),o(u.current.map((function(e){return["objectID:-".concat(e.label)]})))),hitsPerPage:Math.max(1,(null!==(t=r.hitsPerPage)&&void 0!==t?t:10)-u.current.length)}):r}}),__autocomplete_pluginOptions:e}}function g(e){var t=e.query,n=e.items,r=e.limit;return t?n.filter((function(e){return e.label.toLowerCase().includes(t.toLowerCase())})).slice(0,r).map((function(e){return i({item:e,query:t})})):n.slice(0,r).map((function(e){return i({item:e,query:t})}))}function v(e){return n({limit:5,search:g,transformSource:function(e){return e.source}},e)}e.addHighlightedAttribute=i,e.createLocalStorageRecentSearchesPlugin=function(e){var t=v(e),r=t.key,a=t.limit,i=t.transformSource,u=t.search,s=t.subscribe,m=function(e){var t=e.key,n=e.limit,r=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 r({query:arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",items:a.getItem(),limit:n}).slice(0,n)}}}({key:[c,r].join(":"),limit:a,search:u});return n(n({},f({transformSource:i,storage:m,subscribe:s})),{},{name:"aa.localStorageRecentSearchesPlugin",__autocomplete_pluginOptions:e})},e.createRecentSearchesPlugin=f,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.6.2",
"version": "1.6.3",
"license": "MIT",

@@ -34,6 +34,6 @@ "homepage": "https://github.com/algolia/autocomplete",

"dependencies": {
"@algolia/autocomplete-core": "1.6.2",
"@algolia/autocomplete-js": "1.6.2",
"@algolia/autocomplete-preset-algolia": "1.6.2",
"@algolia/autocomplete-shared": "1.6.2"
"@algolia/autocomplete-core": "1.6.3",
"@algolia/autocomplete-js": "1.6.3",
"@algolia/autocomplete-preset-algolia": "1.6.3",
"@algolia/autocomplete-shared": "1.6.3"
},

@@ -40,0 +40,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc