@newskit-render/standalone-components 0.5.2 → 0.6.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/README.md +23 -0
- package/dist/cjs/help-hub/index.d.ts +2 -0
- package/dist/cjs/help-hub/index.js +15 -0
- package/dist/cjs/help-hub/index.js.map +1 -0
- package/dist/cjs/help-hub/results-page/ResultsPage.d.ts +3 -0
- package/dist/cjs/help-hub/results-page/ResultsPage.js +12 -0
- package/dist/cjs/help-hub/results-page/ResultsPage.js.map +1 -0
- package/dist/cjs/help-hub/results-page/index.d.ts +1 -0
- package/dist/cjs/help-hub/results-page/index.js +14 -0
- package/dist/cjs/help-hub/results-page/index.js.map +1 -0
- package/dist/cjs/help-hub/search-page/SearchPage.d.ts +3 -0
- package/dist/cjs/help-hub/search-page/SearchPage.js +12 -0
- package/dist/cjs/help-hub/search-page/SearchPage.js.map +1 -0
- package/dist/cjs/help-hub/search-page/index.d.ts +1 -0
- package/dist/cjs/help-hub/search-page/index.js +14 -0
- package/dist/cjs/help-hub/search-page/index.js.map +1 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/help-hub/index.d.ts +2 -0
- package/dist/help-hub/index.js +15 -0
- package/dist/help-hub/index.js.map +1 -0
- package/dist/help-hub/results-page/ResultsPage.d.ts +3 -0
- package/dist/help-hub/results-page/ResultsPage.js +12 -0
- package/dist/help-hub/results-page/ResultsPage.js.map +1 -0
- package/dist/help-hub/results-page/index.d.ts +1 -0
- package/dist/help-hub/results-page/index.js +14 -0
- package/dist/help-hub/results-page/index.js.map +1 -0
- package/dist/help-hub/search-page/SearchPage.d.ts +3 -0
- package/dist/help-hub/search-page/SearchPage.js +12 -0
- package/dist/help-hub/search-page/SearchPage.js.map +1 -0
- package/dist/help-hub/search-page/index.d.ts +1 -0
- package/dist/help-hub/search-page/index.js +14 -0
- package/dist/help-hub/search-page/index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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,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,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,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/cjs/index.d.ts
CHANGED
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
|
package/dist/cjs/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"}
|
|
@@ -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,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,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
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"}
|