vue-instantsearch 4.9.0 → 4.10.0

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.
@@ -1,2 +1,2 @@
1
- var r="4.9.0";export{r as version};
1
+ var r="4.10.0";export{r as version};
2
2
  //# sourceMappingURL=package.json.js.map
@@ -1,2 +1,2 @@
1
- import{createSuitMixin as n}from"../mixins/suit.js";import{_objectSpread as t}from"./polyfills.js";import{version as e}from"vue";import"./vue-compat/index-vue3.js";import{warn as a}from"./warn.js";import{version as i}from"../../package.json.js";var s=function(s){var r;return t(((r={mixins:[n({name:"InstantSearch"})],provide:function(){return{$_ais_instantSearchInstance:this.instantSearchInstance}},watch:{searchClient:function(n){a(!1),this.instantSearchInstance.helper.setClient(n).search()},indexName:function(n){this.instantSearchInstance.helper.setIndex(n).search()},stalledSearchDelay:function(n){this.instantSearchInstance._stalledSearchDelay=n},routing:function(){throw new Error("routing configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},onStateChange:function(){throw new Error("onStateChange configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},searchFunction:function(n){this.instantSearchInstance._searchFunction=n},middlewares:{immediate:!0,handler:function(n,t){var e=this;(t||[]).filter(function(t){return-1===(n||[]).indexOf(t)}).forEach(function(n){e.instantSearchInstance.unuse(n)}),(n||[]).filter(function(n){return-1===(t||[]).indexOf(n)}).forEach(function(n){e.instantSearchInstance.use(n)})}}},created:function(){var n=this.instantSearchInstance.client;"function"==typeof n.addAlgoliaAgent&&(n.addAlgoliaAgent("Vue ("+e+")"),n.addAlgoliaAgent("Vue InstantSearch ("+i+")"))},mounted:function(){var n=this;this.$nextTick(function(){n.instantSearchInstance.started||n.instantSearchInstance.start()})}}).beforeUnmount=function(){this.instantSearchInstance.started&&this.instantSearchInstance.dispose(),this.instantSearchInstance.__initialSearchResults=void 0},r),s)};export{s as createInstantSearchComponent};
1
+ import{createSuitMixin as n}from"../mixins/suit.js";import{_objectSpread as t}from"./polyfills.js";import{version as e}from"vue";import"./vue-compat/index-vue3.js";import{warn as a}from"./warn.js";import{version as i}from"../../package.json.js";var s=function(s){var r;return t(((r={mixins:[n({name:"InstantSearch"})],provide:function(){return{$_ais_instantSearchInstance:this.instantSearchInstance}},watch:{searchClient:function(n){a(!1),this.instantSearchInstance.helper.setClient(n).search()},indexName:function(n){this.instantSearchInstance.helper.setIndex(n||"").search()},stalledSearchDelay:function(n){this.instantSearchInstance._stalledSearchDelay=n},routing:function(){throw new Error("routing configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},onStateChange:function(){throw new Error("onStateChange configuration can not be changed dynamically at this point.\n\nPlease open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props")},searchFunction:function(n){this.instantSearchInstance._searchFunction=n},middlewares:{immediate:!0,handler:function(n,t){var e=this;(t||[]).filter(function(t){return-1===(n||[]).indexOf(t)}).forEach(function(n){e.instantSearchInstance.unuse(n)}),(n||[]).filter(function(n){return-1===(t||[]).indexOf(n)}).forEach(function(n){e.instantSearchInstance.use(n)})}}},created:function(){var n=this.instantSearchInstance.client;"function"==typeof n.addAlgoliaAgent&&(n.addAlgoliaAgent("Vue ("+e+")"),n.addAlgoliaAgent("Vue InstantSearch ("+i+")"))},mounted:function(){var n=this;this.$nextTick(function(){n.instantSearchInstance.started||n.instantSearchInstance.start()})}}).beforeUnmount=function(){this.instantSearchInstance.started&&this.instantSearchInstance.dispose(),this.instantSearchInstance.__initialSearchResults=void 0},r),s)};export{s as createInstantSearchComponent};
2
2
  //# sourceMappingURL=createInstantSearchComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createInstantSearchComponent.js","sources":["../../../../src/util/createInstantSearchComponent.js"],"sourcesContent":["import { createSuitMixin } from '../mixins/suit';\nimport { version } from '../../package.json'; // rollup does pick only what needed from json\nimport { _objectSpread } from './polyfills';\nimport { isVue3, version as vueVersion } from './vue-compat';\nimport { warn } from './warn';\n\nexport const createInstantSearchComponent = (component) =>\n _objectSpread(\n {\n mixins: [createSuitMixin({ name: 'InstantSearch' })],\n provide() {\n return {\n $_ais_instantSearchInstance: this.instantSearchInstance,\n };\n },\n watch: {\n searchClient(searchClient) {\n warn(\n false,\n 'The `search-client` prop of `<ais-instant-search>` changed between renders, which may cause more search requests than necessary. If this is an unwanted behavior, please provide a stable reference: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client'\n );\n\n this.instantSearchInstance.helper.setClient(searchClient).search();\n },\n indexName(indexName) {\n this.instantSearchInstance.helper.setIndex(indexName).search();\n },\n stalledSearchDelay(stalledSearchDelay) {\n // private InstantSearch.js API:\n this.instantSearchInstance._stalledSearchDelay = stalledSearchDelay;\n },\n routing() {\n throw new Error(\n 'routing configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n onStateChange() {\n throw new Error(\n 'onStateChange configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n searchFunction(searchFunction) {\n // private InstantSearch.js API:\n this.instantSearchInstance._searchFunction = searchFunction;\n },\n middlewares: {\n immediate: true,\n handler(next, prev) {\n (prev || [])\n .filter((middleware) => (next || []).indexOf(middleware) === -1)\n .forEach((middlewareToRemove) => {\n this.instantSearchInstance.unuse(middlewareToRemove);\n });\n\n (next || [])\n .filter((middleware) => (prev || []).indexOf(middleware) === -1)\n .forEach((middlewareToAdd) => {\n this.instantSearchInstance.use(middlewareToAdd);\n });\n },\n },\n },\n created() {\n const searchClient = this.instantSearchInstance.client;\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(`Vue (${vueVersion})`);\n searchClient.addAlgoliaAgent(`Vue InstantSearch (${version})`);\n }\n },\n mounted() {\n // from the documentation: https://vuejs.org/v2/api/#mounted\n // \"Note that mounted does not guarantee that all child components have also been mounted. If you want to\n // wait until the entire view has been rendered, you can use vm.$nextTick inside of mounted\"\n this.$nextTick(() => {\n if (!this.instantSearchInstance.started) {\n this.instantSearchInstance.start();\n }\n });\n },\n [isVue3 ? 'beforeUnmount' : 'beforeDestroy']() {\n if (this.instantSearchInstance.started) {\n this.instantSearchInstance.dispose();\n }\n\n // a hydrated instance will no longer be hydrated once disposed, and starts from scratch\n this.instantSearchInstance.__initialSearchResults = undefined;\n },\n },\n component\n );\n"],"names":["createInstantSearchComponent","component","_objectSpread","mixins","createSuitMixin","name","provide","$_ais_instantSearchInstance","this","instantSearchInstance","watch","searchClient","warn","helper","setClient","search","indexName","setIndex","stalledSearchDelay","_stalledSearchDelay","routing","Error","onStateChange","searchFunction","_searchFunction","middlewares","immediate","handler","next","prev","filter","middleware","indexOf","forEach","middlewareToRemove","unuse","middlewareToAdd","use","created","const","client","addAlgoliaAgent","vueVersion","version","mounted","$nextTick","started","start","dispose","__initialSearchResults","undefined"],"mappings":"yPAMaA,WAAgCC,gBAC3CC,MACE,CACEC,OAAQ,CAACC,EAAgB,CAAEC,KAAM,mBACjCC,mBACE,MAAO,CACLC,4BAA6BC,KAAKC,wBAGtCC,MAAO,CACLC,sBAAaA,GACXC,GACE,GAIFJ,KAAKC,sBAAsBI,OAAOC,UAAUH,GAAcI,UAE5DC,mBAAUA,GACRR,KAAKC,sBAAsBI,OAAOI,SAASD,GAAWD,UAExDG,4BAAmBA,GAEjBV,KAAKC,sBAAsBU,oBAAsBD,GAEnDE,mBACE,MAAM,IAAIC,MACR,yQAKJC,yBACE,MAAM,IAAID,MACR,+QAKJE,wBAAeA,GAEbf,KAAKC,sBAAsBe,gBAAkBD,GAE/CE,YAAa,CACXC,WAAW,EACXC,iBAAQC,EAAMC,eACXA,GAAQ,IACNC,gBAAQC,UAAqD,KAArCH,GAAQ,IAAII,QAAQD,KAC5CE,iBAASC,GACR1B,EAAKC,sBAAsB0B,MAAMD,MAGpCN,GAAQ,IACNE,gBAAQC,UAAqD,KAArCF,GAAQ,IAAIG,QAAQD,KAC5CE,iBAASG,GACR5B,EAAKC,sBAAsB4B,IAAID,QAKzCE,mBACEC,IAAM5B,EAAeH,KAAKC,sBAAsB+B,OACJ,mBAAjC7B,EAAa8B,kBACtB9B,EAAa8B,wBAAwBC,OACrC/B,EAAa8B,sCAAsCE,SAGvDC,8BAIEpC,KAAKqC,qBACErC,EAAKC,sBAAsBqC,SAC9BtC,EAAKC,sBAAsBsC,aAIU,yBACrCvC,KAAKC,sBAAsBqC,SAC7BtC,KAAKC,sBAAsBuC,UAI7BxC,KAAKC,sBAAsBwC,4BAAyBC,MAGxDjD"}
1
+ {"version":3,"file":"createInstantSearchComponent.js","sources":["../../../../src/util/createInstantSearchComponent.js"],"sourcesContent":["import { createSuitMixin } from '../mixins/suit';\nimport { version } from '../../package.json'; // rollup does pick only what needed from json\nimport { _objectSpread } from './polyfills';\nimport { isVue3, version as vueVersion } from './vue-compat';\nimport { warn } from './warn';\n\nexport const createInstantSearchComponent = (component) =>\n _objectSpread(\n {\n mixins: [createSuitMixin({ name: 'InstantSearch' })],\n provide() {\n return {\n $_ais_instantSearchInstance: this.instantSearchInstance,\n };\n },\n watch: {\n searchClient(searchClient) {\n warn(\n false,\n 'The `search-client` prop of `<ais-instant-search>` changed between renders, which may cause more search requests than necessary. If this is an unwanted behavior, please provide a stable reference: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client'\n );\n\n this.instantSearchInstance.helper.setClient(searchClient).search();\n },\n indexName(indexName) {\n this.instantSearchInstance.helper.setIndex(indexName || '').search();\n },\n stalledSearchDelay(stalledSearchDelay) {\n // private InstantSearch.js API:\n this.instantSearchInstance._stalledSearchDelay = stalledSearchDelay;\n },\n routing() {\n throw new Error(\n 'routing configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n onStateChange() {\n throw new Error(\n 'onStateChange configuration can not be changed dynamically at this point.' +\n '\\n\\n' +\n 'Please open a new issue: https://github.com/algolia/instantsearch.js/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props'\n );\n },\n searchFunction(searchFunction) {\n // private InstantSearch.js API:\n this.instantSearchInstance._searchFunction = searchFunction;\n },\n middlewares: {\n immediate: true,\n handler(next, prev) {\n (prev || [])\n .filter((middleware) => (next || []).indexOf(middleware) === -1)\n .forEach((middlewareToRemove) => {\n this.instantSearchInstance.unuse(middlewareToRemove);\n });\n\n (next || [])\n .filter((middleware) => (prev || []).indexOf(middleware) === -1)\n .forEach((middlewareToAdd) => {\n this.instantSearchInstance.use(middlewareToAdd);\n });\n },\n },\n },\n created() {\n const searchClient = this.instantSearchInstance.client;\n if (typeof searchClient.addAlgoliaAgent === 'function') {\n searchClient.addAlgoliaAgent(`Vue (${vueVersion})`);\n searchClient.addAlgoliaAgent(`Vue InstantSearch (${version})`);\n }\n },\n mounted() {\n // from the documentation: https://vuejs.org/v2/api/#mounted\n // \"Note that mounted does not guarantee that all child components have also been mounted. If you want to\n // wait until the entire view has been rendered, you can use vm.$nextTick inside of mounted\"\n this.$nextTick(() => {\n if (!this.instantSearchInstance.started) {\n this.instantSearchInstance.start();\n }\n });\n },\n [isVue3 ? 'beforeUnmount' : 'beforeDestroy']() {\n if (this.instantSearchInstance.started) {\n this.instantSearchInstance.dispose();\n }\n\n // a hydrated instance will no longer be hydrated once disposed, and starts from scratch\n this.instantSearchInstance.__initialSearchResults = undefined;\n },\n },\n component\n );\n"],"names":["createInstantSearchComponent","component","_objectSpread","mixins","createSuitMixin","name","provide","$_ais_instantSearchInstance","this","instantSearchInstance","watch","searchClient","warn","helper","setClient","search","indexName","setIndex","stalledSearchDelay","_stalledSearchDelay","routing","Error","onStateChange","searchFunction","_searchFunction","middlewares","immediate","handler","next","prev","filter","middleware","indexOf","forEach","middlewareToRemove","unuse","middlewareToAdd","use","created","const","client","addAlgoliaAgent","vueVersion","version","mounted","$nextTick","started","start","dispose","__initialSearchResults","undefined"],"mappings":"yPAMaA,WAAgCC,gBAC3CC,MACE,CACEC,OAAQ,CAACC,EAAgB,CAAEC,KAAM,mBACjCC,mBACE,MAAO,CACLC,4BAA6BC,KAAKC,wBAGtCC,MAAO,CACLC,sBAAaA,GACXC,GACE,GAIFJ,KAAKC,sBAAsBI,OAAOC,UAAUH,GAAcI,UAE5DC,mBAAUA,GACRR,KAAKC,sBAAsBI,OAAOI,SAASD,GAAa,IAAID,UAE9DG,4BAAmBA,GAEjBV,KAAKC,sBAAsBU,oBAAsBD,GAEnDE,mBACE,MAAM,IAAIC,MACR,yQAKJC,yBACE,MAAM,IAAID,MACR,+QAKJE,wBAAeA,GAEbf,KAAKC,sBAAsBe,gBAAkBD,GAE/CE,YAAa,CACXC,WAAW,EACXC,iBAAQC,EAAMC,eACXA,GAAQ,IACNC,gBAAQC,UAAqD,KAArCH,GAAQ,IAAII,QAAQD,KAC5CE,iBAASC,GACR1B,EAAKC,sBAAsB0B,MAAMD,MAGpCN,GAAQ,IACNE,gBAAQC,UAAqD,KAArCF,GAAQ,IAAIG,QAAQD,KAC5CE,iBAASG,GACR5B,EAAKC,sBAAsB4B,IAAID,QAKzCE,mBACEC,IAAM5B,EAAeH,KAAKC,sBAAsB+B,OACJ,mBAAjC7B,EAAa8B,kBACtB9B,EAAa8B,wBAAwBC,OACrC/B,EAAa8B,sCAAsCE,SAGvDC,8BAIEpC,KAAKqC,qBACErC,EAAKC,sBAAsBqC,SAC9BtC,EAAKC,sBAAsBsC,aAIU,yBACrCvC,KAAKC,sBAAsBqC,SAC7BtC,KAAKC,sBAAsBuC,UAI7BxC,KAAKC,sBAAsBwC,4BAAyBC,MAGxDjD"}