@prezly/theme-kit-nextjs 7.6.0 → 7.7.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.
- package/build/newsroom-context/hooks/useSearchClient.js +3 -8
- package/build/newsroom-context/hooks/useSearchClient.js.map +1 -1
- package/build/newsroom-context/index.d.ts +1 -0
- package/build/newsroom-context/index.js +1 -0
- package/build/newsroom-context/index.js.map +1 -1
- package/build/newsroom-context/utils/getSearchClient.d.ts +2 -0
- package/build/newsroom-context/utils/getSearchClient.js +15 -0
- package/build/newsroom-context/utils/getSearchClient.js.map +1 -0
- package/build/newsroom-context/utils/index.d.ts +1 -0
- package/build/newsroom-context/utils/index.js +6 -0
- package/build/newsroom-context/utils/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -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
|
|
8
|
-
const
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
9
6
|
function useSearchClient(settings) {
|
|
10
|
-
return
|
|
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":"
|
|
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"}
|
|
@@ -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,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.
|
|
3
|
+
"version": "7.7.0",
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@playwright/test": "1.x",
|
|
63
|
-
"@prezly/sdk": "21.
|
|
63
|
+
"@prezly/sdk": "21.12.0",
|
|
64
64
|
"next": "^12.x || ^13.x || ^14.x",
|
|
65
65
|
"react": "^17.x || ^18.x",
|
|
66
66
|
"react-dom": "^17.x || ^18.x"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@meilisearch/instant-meilisearch": "^0.19.0",
|
|
75
|
-
"@prezly/theme-kit-core": "^7.
|
|
75
|
+
"@prezly/theme-kit-core": "^7.7.0",
|
|
76
76
|
"@technically/omit-undefined": "^1.0.2",
|
|
77
77
|
"algoliasearch": "^4.24.0",
|
|
78
78
|
"next-seo": "^5.4.0"
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
86
|
"sideEffects": false,
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "fb14a0f5781687589692182a9815ceca2c85e048"
|
|
88
88
|
}
|