@prezly/theme-kit-nextjs 7.6.0 → 7.6.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.
@@ -1,15 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.useSearchClient = void 0;
7
- const instant_meilisearch_1 = require("@meilisearch/instant-meilisearch");
8
- const lite_1 = __importDefault(require("algoliasearch/lite"));
4
+ const react_1 = require("react");
5
+ const utils_1 = require("../utils");
9
6
  function useSearchClient(settings) {
10
- return settings.searchBackend === 'algolia'
11
- ? (0, lite_1.default)(settings.appId, settings.apiKey)
12
- : (0, instant_meilisearch_1.instantMeiliSearch)(settings.host, settings.apiKey).searchClient;
7
+ return (0, react_1.useMemo)(() => (0, utils_1.getSearchClient)(settings), [settings]);
13
8
  }
14
9
  exports.useSearchClient = useSearchClient;
15
10
  //# sourceMappingURL=useSearchClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchClient.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useSearchClient.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAsE;AAEtE,8DAA+C;AAE/C,SAAgB,eAAe,CAAC,QAAwB;IACpD,OAAO,QAAQ,CAAC,aAAa,KAAK,SAAS;QACvC,CAAC,CAAC,IAAA,cAAa,EAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC;QAChD,CAAC,CAAC,IAAA,wCAAkB,EAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;AAC1E,CAAC;AAJD,0CAIC"}
1
+ {"version":3,"file":"useSearchClient.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useSearchClient.ts"],"names":[],"mappings":";;;AACA,iCAAgC;AAEhC,oCAA2C;AAE3C,SAAgB,eAAe,CAAC,QAAwB;IACpD,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,uBAAe,EAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,0CAEC"}
@@ -1,2 +1,3 @@
1
1
  export { NewsroomContext, NewsroomContextProvider, type NewsroomContextProps } from './context';
2
2
  export * from './hooks';
3
+ export * from './utils';
@@ -19,4 +19,5 @@ var context_1 = require("./context");
19
19
  Object.defineProperty(exports, "NewsroomContext", { enumerable: true, get: function () { return context_1.NewsroomContext; } });
20
20
  Object.defineProperty(exports, "NewsroomContextProvider", { enumerable: true, get: function () { return context_1.NewsroomContextProvider; } });
21
21
  __exportStar(require("./hooks"), exports);
22
+ __exportStar(require("./utils"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAgG;AAAvF,0GAAA,eAAe,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AACjD,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAgG;AAAvF,0GAAA,eAAe,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AACjD,0CAAwB;AACxB,0CAAwB"}
@@ -0,0 +1,2 @@
1
+ import type { SearchSettings } from '@prezly/theme-kit-core/server';
2
+ export declare function getSearchClient(settings: SearchSettings): any;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSearchClient = void 0;
7
+ const instant_meilisearch_1 = require("@meilisearch/instant-meilisearch");
8
+ const lite_1 = __importDefault(require("algoliasearch/lite"));
9
+ function getSearchClient(settings) {
10
+ return settings.searchBackend === 'algolia'
11
+ ? (0, lite_1.default)(settings.appId, settings.apiKey)
12
+ : (0, instant_meilisearch_1.instantMeiliSearch)(settings.host, settings.apiKey).searchClient;
13
+ }
14
+ exports.getSearchClient = getSearchClient;
15
+ //# sourceMappingURL=getSearchClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getSearchClient.js","sourceRoot":"","sources":["../../../src/newsroom-context/utils/getSearchClient.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAsE;AAEtE,8DAA+C;AAE/C,SAAgB,eAAe,CAAC,QAAwB;IACpD,OAAO,QAAQ,CAAC,aAAa,KAAK,SAAS;QACvC,CAAC,CAAC,IAAA,cAAa,EAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC;QAChD,CAAC,CAAC,IAAA,wCAAkB,EAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC;AAC1E,CAAC;AAJD,0CAIC"}
@@ -0,0 +1 @@
1
+ export { getSearchClient } from './getSearchClient';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSearchClient = void 0;
4
+ var getSearchClient_1 = require("./getSearchClient");
5
+ Object.defineProperty(exports, "getSearchClient", { enumerable: true, get: function () { return getSearchClient_1.getSearchClient; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/utils/index.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-nextjs",
3
- "version": "7.6.0",
3
+ "version": "7.6.1",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -84,5 +84,5 @@
84
84
  "access": "public"
85
85
  },
86
86
  "sideEffects": false,
87
- "gitHead": "d8ae2e0584be4554f182555e0fc0670912f210f3"
87
+ "gitHead": "1e466ea61597e34dc60cb9bf2675ba9f70cb30ef"
88
88
  }