@newskit-render/standalone-components 0.5.1 → 0.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.
Files changed (38) hide show
  1. package/README.md +23 -0
  2. package/dist/cjs/help-hub/index.d.ts +2 -0
  3. package/dist/cjs/help-hub/index.js +15 -0
  4. package/dist/cjs/help-hub/index.js.map +1 -0
  5. package/dist/cjs/help-hub/results-page/ResultsPage.d.ts +3 -0
  6. package/dist/cjs/help-hub/results-page/ResultsPage.js +12 -0
  7. package/dist/cjs/help-hub/results-page/ResultsPage.js.map +1 -0
  8. package/dist/cjs/help-hub/results-page/index.d.ts +1 -0
  9. package/dist/cjs/help-hub/results-page/index.js +14 -0
  10. package/dist/cjs/help-hub/results-page/index.js.map +1 -0
  11. package/dist/cjs/help-hub/search-page/SearchPage.d.ts +3 -0
  12. package/dist/cjs/help-hub/search-page/SearchPage.js +12 -0
  13. package/dist/cjs/help-hub/search-page/SearchPage.js.map +1 -0
  14. package/dist/cjs/help-hub/search-page/index.d.ts +1 -0
  15. package/dist/cjs/help-hub/search-page/index.js +14 -0
  16. package/dist/cjs/help-hub/search-page/index.js.map +1 -0
  17. package/dist/cjs/index.d.ts +1 -0
  18. package/dist/cjs/index.js +1 -0
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/help-hub/index.d.ts +2 -0
  21. package/dist/help-hub/index.js +15 -0
  22. package/dist/help-hub/index.js.map +1 -0
  23. package/dist/help-hub/results-page/ResultsPage.d.ts +3 -0
  24. package/dist/help-hub/results-page/ResultsPage.js +12 -0
  25. package/dist/help-hub/results-page/ResultsPage.js.map +1 -0
  26. package/dist/help-hub/results-page/index.d.ts +1 -0
  27. package/dist/help-hub/results-page/index.js +14 -0
  28. package/dist/help-hub/results-page/index.js.map +1 -0
  29. package/dist/help-hub/search-page/SearchPage.d.ts +3 -0
  30. package/dist/help-hub/search-page/SearchPage.js +12 -0
  31. package/dist/help-hub/search-page/SearchPage.js.map +1 -0
  32. package/dist/help-hub/search-page/index.d.ts +1 -0
  33. package/dist/help-hub/search-page/index.js +14 -0
  34. package/dist/help-hub/search-page/index.js.map +1 -0
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/package.json +2 -2
package/README.md CHANGED
@@ -27,8 +27,14 @@ For npm:
27
27
  - text: string // optional
28
28
  - `size` can be `large` or `small`.
29
29
 
30
+ 2. Help-hub pages: the package provides 2 pages:
31
+ - Search page: where the user is able to search their queries and see the most common questions.
32
+ - Result page: displaying the relevant results based on the user query. To facilitate the search we are using Algolia.
33
+
34
+ The Help-hub pages will work independent of other components and customized using the context.
30
35
  # How to use
31
36
 
37
+ 1. Article recommendations:
32
38
  First, you need to fetch some article recommendations with the recommendationsProvider function, then iterate over the returned array and use the ArticleRecommendation component to display them.
33
39
 
34
40
  Example of use:
@@ -79,5 +85,22 @@ export async function getServerSideProps(context) {
79
85
  }
80
86
  ```
81
87
 
88
+ 2. Help-hub pages:
89
+
90
+ Example of use:
91
+
92
+ ```typescript
93
+ import React from 'react'
94
+ import { SearchPage } from '@newskit-render/standalone-components'
95
+ import Layout from '../../components/layout'
96
+
97
+ const HelpHub = () => (
98
+ <Layout>
99
+ <SearchPage />
100
+ </Layout>
101
+ )
102
+
103
+ export default HelpHub
104
+ ```
82
105
  .
83
106
  .
@@ -0,0 +1,2 @@
1
+ export * from './results-page';
2
+ export * from './search-page';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./results-page"), exports);
14
+ __exportStar(require("./search-page"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/help-hub/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8B;AAC9B,gDAA6B"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const ResultsPage: React.FC;
3
+ export default ResultsPage;
@@ -0,0 +1,12 @@
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.ResultsPage = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var ResultsPage = function () { return (react_1.default.createElement("div", null,
9
+ react_1.default.createElement("h2", null, "Results page"))); };
10
+ exports.ResultsPage = ResultsPage;
11
+ exports.default = exports.ResultsPage;
12
+ //# sourceMappingURL=ResultsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsPage.js","sourceRoot":"","sources":["../../../../src/help-hub/results-page/ResultsPage.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAyB;AAElB,IAAM,WAAW,GAAa,cAAM,OAAA,CACzC;IACE,yDAAqB,CACjB,CACP,EAJ0C,CAI1C,CAAA;AAJY,QAAA,WAAW,eAIvB;AAED,kBAAe,mBAAW,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './ResultsPage';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./ResultsPage"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/help-hub/results-page/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const SearchPage: React.FC;
3
+ export default SearchPage;
@@ -0,0 +1,12 @@
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.SearchPage = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var SearchPage = function () { return (react_1.default.createElement("div", null,
9
+ react_1.default.createElement("h2", null, "How can we help?"))); };
10
+ exports.SearchPage = SearchPage;
11
+ exports.default = exports.SearchPage;
12
+ //# sourceMappingURL=SearchPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchPage.js","sourceRoot":"","sources":["../../../../src/help-hub/search-page/SearchPage.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAyB;AAElB,IAAM,UAAU,GAAa,cAAM,OAAA,CACxC;IACE,6DAAyB,CACrB,CACP,EAJyC,CAIzC,CAAA;AAJY,QAAA,UAAU,cAItB;AAED,kBAAe,kBAAU,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './SearchPage';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./SearchPage"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/help-hub/search-page/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4B"}
@@ -1 +1,2 @@
1
1
  export * from './article-recommendations';
2
+ export * from './help-hub';
package/dist/cjs/index.js CHANGED
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./article-recommendations"), exports);
14
+ __exportStar(require("./help-hub"), exports);
14
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAAyC;AACzC,6CAA0B"}
@@ -0,0 +1,2 @@
1
+ export * from './results-page';
2
+ export * from './search-page';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./results-page"), exports);
14
+ __exportStar(require("./search-page"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/help-hub/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8B;AAC9B,gDAA6B"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const ResultsPage: React.FC;
3
+ export default ResultsPage;
@@ -0,0 +1,12 @@
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.ResultsPage = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var ResultsPage = function () { return (react_1.default.createElement("div", null,
9
+ react_1.default.createElement("h2", null, "Results page"))); };
10
+ exports.ResultsPage = ResultsPage;
11
+ exports.default = exports.ResultsPage;
12
+ //# sourceMappingURL=ResultsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResultsPage.js","sourceRoot":"","sources":["../../../src/help-hub/results-page/ResultsPage.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAyB;AAElB,IAAM,WAAW,GAAa,cAAM,OAAA,CACzC;IACE,yDAAqB,CACjB,CACP,EAJ0C,CAI1C,CAAA;AAJY,QAAA,WAAW,eAIvB;AAED,kBAAe,mBAAW,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './ResultsPage';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./ResultsPage"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/help-hub/results-page/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const SearchPage: React.FC;
3
+ export default SearchPage;
@@ -0,0 +1,12 @@
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.SearchPage = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var SearchPage = function () { return (react_1.default.createElement("div", null,
9
+ react_1.default.createElement("h2", null, "How can we help?"))); };
10
+ exports.SearchPage = SearchPage;
11
+ exports.default = exports.SearchPage;
12
+ //# sourceMappingURL=SearchPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchPage.js","sourceRoot":"","sources":["../../../src/help-hub/search-page/SearchPage.tsx"],"names":[],"mappings":";;;;;;AAAA,gDAAyB;AAElB,IAAM,UAAU,GAAa,cAAM,OAAA,CACxC;IACE,6DAAyB,CACrB,CACP,EAJyC,CAIzC,CAAA;AAJY,QAAA,UAAU,cAItB;AAED,kBAAe,kBAAU,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './SearchPage';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./SearchPage"), exports);
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/help-hub/search-page/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4B"}
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './article-recommendations';
2
+ export * from './help-hub';
package/dist/index.js CHANGED
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./article-recommendations"), exports);
14
+ __exportStar(require("./help-hub"), exports);
14
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4DAAyC;AACzC,6CAA0B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/standalone-components",
3
- "version": "0.5.1",
3
+ "version": "0.6.1",
4
4
  "description": "Newskit Render Standalone Components",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -77,7 +77,7 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@apollo/client": "3.4.16",
80
- "@newskit-render/api": "^0.22.0",
80
+ "@newskit-render/api": "^0.23.0",
81
81
  "graphql": "15.6.0"
82
82
  },
83
83
  "resolutions": {