@financial-times/qanda-ui 0.0.1-beta.11 → 0.0.1-beta.13
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/dist/cjs/components/Author/index.js +2 -2
- package/dist/cjs/components/Calendar/CalendarListItem.js +2 -0
- package/dist/cjs/components/Calendar/index.js +3 -0
- package/dist/cjs/components/CountdownTimer/index.js +3 -0
- package/dist/cjs/components/EmbedFormField/index.js +0 -4
- package/dist/cjs/components/QandaBlock/index.js +3 -2
- package/dist/cjs/components/QandaContainer.js +2 -1
- package/dist/cjs/store/updateComments.js +3 -1
- package/dist/esm/components/Author/index.js +1 -1
- package/dist/esm/components/Calendar/CalendarListItem.js +2 -0
- package/dist/esm/components/Calendar/index.js +3 -0
- package/dist/esm/components/CountdownTimer/index.js +3 -0
- package/dist/esm/components/EmbedFormField/index.js +1 -5
- package/dist/esm/components/QandaBlock/index.js +2 -1
- package/dist/esm/components/QandaContainer.js +2 -1
- package/dist/esm/store/updateComments.js +3 -1
- package/dist/types/components/Author/index.d.ts +1 -1
- package/dist/types/components/Calendar/CalendarList.d.ts +1 -1
- package/dist/types/components/EmbedFormField/index.d.ts +1 -1
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/Overlay/index.d.ts +1 -1
- package/dist/types/components/Qanda.d.ts +1 -1
- package/dist/types/components/QuestionForm/messagesByUserType.d.ts +1 -1
- package/dist/types/services/comments-api.d.ts +8 -9
- package/dist/types/store/index.d.ts +4 -4
- package/package.json +1 -1
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("preact/jsx-runtime");
|
|
7
7
|
const Headshot_1 = __importDefault(require("@financial-times/cp-content-pipeline-ui/lib/components/Headshot"));
|
|
8
|
-
const
|
|
8
|
+
const Byline_1 = __importDefault(require("@financial-times/cp-content-pipeline-ui/lib/components/Byline"));
|
|
9
9
|
function Author({ byline, headshot, prefLabel, role, streamPage, }) {
|
|
10
10
|
const hasHeadshot = headshot && prefLabel;
|
|
11
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__answer__author", "data-testid": "qanda-block__answer__author", children: [hasHeadshot ? ((0, jsx_runtime_1.jsx)("div", { className: "qanda-block__answer__author-headshot", children: (0, jsx_runtime_1.jsx)(Headshot_1.default, { headshot: headshot, prefLabel: prefLabel, streamPage: streamPage, className: "qanda-block__answer__author-headshot" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "qanda-block__answer__author-opinion-icon" })), (0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__answer__author-info", children: [(0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-highlight qanda-block__answer__author-name", children: (0, jsx_runtime_1.jsx)(
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__answer__author", "data-testid": "qanda-block__answer__author", children: [hasHeadshot ? ((0, jsx_runtime_1.jsx)("div", { className: "qanda-block__answer__author-headshot", children: (0, jsx_runtime_1.jsx)(Headshot_1.default, { headshot: headshot, prefLabel: prefLabel, streamPage: streamPage, className: "qanda-block__answer__author-headshot" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "qanda-block__answer__author-opinion-icon" })), (0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__answer__author-info", children: [(0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-highlight qanda-block__answer__author-name", children: (0, jsx_runtime_1.jsx)(Byline_1.default, { structuredContent: byline, showEditedBy: false }) }), (0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-base", children: role })] })] }));
|
|
12
12
|
}
|
|
13
13
|
Author.defaultProps = {
|
|
14
14
|
byline: '',
|
|
@@ -10,6 +10,8 @@ function CalendarListItem({ name, link }) {
|
|
|
10
10
|
storyId,
|
|
11
11
|
useStaging,
|
|
12
12
|
commentsAPIUrl,
|
|
13
|
+
// Calendar is only relevant for pre-live Q&A
|
|
14
|
+
status: 'pre-live',
|
|
13
15
|
});
|
|
14
16
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: data?.startDateTime && data?.endDateTime && ((0, jsx_runtime_1.jsx)("li", { className: 'live-qa-calendar-list__item', role: "presentation", "data-testid": "live-qa-calendar-list-item", children: link({
|
|
15
17
|
title,
|
|
@@ -17,6 +17,9 @@ function Calendar() {
|
|
|
17
17
|
storyId,
|
|
18
18
|
useStaging,
|
|
19
19
|
commentsAPIUrl,
|
|
20
|
+
// Calendar is only relevant for pre-live Q&A
|
|
21
|
+
// so we can hardcode the status here
|
|
22
|
+
status: 'pre-live',
|
|
20
23
|
});
|
|
21
24
|
(0, react_1.useEffect)(() => {
|
|
22
25
|
const handleClickOutside = (event) => {
|
|
@@ -29,6 +29,9 @@ function CountdownTimer({ container }) {
|
|
|
29
29
|
storyId,
|
|
30
30
|
useStaging,
|
|
31
31
|
commentsAPIUrl,
|
|
32
|
+
// Countdown is only relevant for pre-live Q&A
|
|
33
|
+
// so we can hardcode the status here
|
|
34
|
+
status: 'pre-live',
|
|
32
35
|
});
|
|
33
36
|
const updatedQA = (0, comments_api_1.useUpdatedQA)({
|
|
34
37
|
storyId,
|
|
@@ -8,10 +8,6 @@ const react_dom_1 = require("react-dom");
|
|
|
8
8
|
function EmbedFormField({ container }) {
|
|
9
9
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
10
10
|
const [portalTarget, setPortalTarget] = (0, react_1.useState)();
|
|
11
|
-
const expertView = (0, react_redux_1.useSelector)((state) => state.expert.expertView);
|
|
12
|
-
if (expertView) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
11
|
(0, react_1.useEffect)(() => {
|
|
16
12
|
if (container) {
|
|
17
13
|
const portalContainer = document.createElement('div');
|
|
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("preact/jsx-runtime");
|
|
7
|
-
const
|
|
7
|
+
const Byline_1 = __importDefault(require("@financial-times/cp-content-pipeline-ui/lib/components/Byline"));
|
|
8
|
+
const RichText_1 = __importDefault(require("@financial-times/cp-content-pipeline-ui/lib/components/RichText"));
|
|
8
9
|
require("../Expander/index");
|
|
9
10
|
const index_1 = __importDefault(require("../Expander/index"));
|
|
10
11
|
const Author_1 = __importDefault(require("../Author"));
|
|
@@ -71,6 +72,6 @@ function QandaBlock({ id, body, children, byline, subtitle, showAnswerTime = fal
|
|
|
71
72
|
observer.disconnect();
|
|
72
73
|
};
|
|
73
74
|
}, []);
|
|
74
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-block", children: [(0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__comment qanda-block__question", id: id, "data-testid": `qanda-block__question-${id}`, "data-trackable": "liveqa_question", children: [subtitle && ((0, jsx_runtime_1.jsx)("div", { className: "o3-type-headline-sm qanda-block__question-subtitle", children: subtitle })), (0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-highlight qanda-block__comment-byline", children: (0, jsx_runtime_1.jsx)(
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-block", children: [(0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__comment qanda-block__question", id: id, "data-testid": `qanda-block__question-${id}`, "data-trackable": "liveqa_question", children: [subtitle && ((0, jsx_runtime_1.jsx)("div", { className: "o3-type-headline-sm qanda-block__question-subtitle", children: subtitle })), (0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-highlight qanda-block__comment-byline", children: (0, jsx_runtime_1.jsx)(Byline_1.default, { structuredContent: byline, showEditedBy: false }) }), (0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-base qanda-block__comment-text", children: (0, jsx_runtime_1.jsx)(index_1.default, { className: "qanda-block__text", expandLabel: "Expand question", collapseLabel: "Collapse question", id: id, children: (0, jsx_runtime_1.jsx)(RichText_1.default, { structuredContent: body.structured }) }) })] }, id), children?.map((child) => child.body && ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__comment qanda-block__answer", "data-testid": `qanda-block__answer-${child.id}`, "data-trackable": "liveqa_answer", children: [(0, jsx_runtime_1.jsxs)("div", { className: "qanda-block__answer-header", children: [(0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-highlight qanda-block__comment-byline", children: child.author ? ((0, jsx_runtime_1.jsx)(Author_1.default, { byline: child.byline, headshot: child.author.headshot, prefLabel: child.author.prefLabel, role: child.author.role, streamPage: child.author.streamPage })) : ((0, jsx_runtime_1.jsx)(Byline_1.default, { structuredContent: child.byline, showEditedBy: false })) }), showAnswerTime && ((0, jsx_runtime_1.jsx)("span", { className: "o3-type-detail", children: renderTime(child.publishedDate) }))] }), (0, jsx_runtime_1.jsx)("div", { className: "o3-type-body-base qanda-block__comment-text", children: (0, jsx_runtime_1.jsx)(index_1.default, { className: "qanda-block__text", expandLabel: "Expand answer", collapseLabel: "Collapse answer", id: id, children: (0, jsx_runtime_1.jsx)(RichText_1.default, { structuredContent: child.body.structured }) }) })] }, child.id)))] }));
|
|
75
76
|
}
|
|
76
77
|
exports.default = QandaBlock;
|
|
@@ -25,6 +25,7 @@ function QandaContainer({ embedFormFieldContainer, countdownTimerContainer, }) {
|
|
|
25
25
|
storyId,
|
|
26
26
|
useStaging,
|
|
27
27
|
commentsAPIUrl,
|
|
28
|
+
status: 'pre-live',
|
|
28
29
|
});
|
|
29
30
|
const updatedQA = (0, comments_api_1.useUpdatedQA)({
|
|
30
31
|
storyId,
|
|
@@ -53,6 +54,6 @@ function QandaContainer({ embedFormFieldContainer, countdownTimerContainer, }) {
|
|
|
53
54
|
dispatch(comments_api_1.nextCommentsApi.util.resetApiState());
|
|
54
55
|
};
|
|
55
56
|
}, [dispatch, storyId]);
|
|
56
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-container", "data-trackable": "liveqa", children: [error && ((0, jsx_runtime_1.jsxs)("p", { children: ["We are not able to load the Q&A at the moment. Please try again later. Error:", error] })), !isLoading && !error && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [status !== 'close' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showExpertView ? (0, jsx_runtime_1.jsx)(ExpertDrawer_1.default, {}) : (0, jsx_runtime_1.jsx)(QuestionForm_1.default, {}), (0, jsx_runtime_1.jsx)(CountdownTimer_1.default, { container: countdownTimerContainer })] })), status === 'pre-live' && (0, jsx_runtime_1.jsx)(Calendar_1.default, {}), (0, jsx_runtime_1.jsx)(Stream_1.default, { status: status }), status !== 'close' && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(UserInfo_1.default, {}) })), status === 'live' && (0, jsx_runtime_1.jsx)(FloatingActionBar_1.default, {}), (0, jsx_runtime_1.jsx)(EmbedFormField_1.default, { container: embedFormFieldContainer })] }))] }));
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "qanda-container", "data-trackable": "liveqa", children: [error && ((0, jsx_runtime_1.jsxs)("p", { children: ["We are not able to load the Q&A at the moment. Please try again later. Error:", error] })), !isLoading && !error && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [status !== 'close' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [showExpertView ? (0, jsx_runtime_1.jsx)(ExpertDrawer_1.default, {}) : (0, jsx_runtime_1.jsx)(QuestionForm_1.default, {}), (0, jsx_runtime_1.jsx)(CountdownTimer_1.default, { container: countdownTimerContainer })] })), status === 'pre-live' && (0, jsx_runtime_1.jsx)(Calendar_1.default, {}), (0, jsx_runtime_1.jsx)(Stream_1.default, { status: status }), status !== 'close' && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(UserInfo_1.default, {}) })), status === 'live' && (0, jsx_runtime_1.jsx)(FloatingActionBar_1.default, {}), status !== 'close' && !showExpertView && ((0, jsx_runtime_1.jsx)(EmbedFormField_1.default, { container: embedFormFieldContainer }))] }))] }));
|
|
57
58
|
}
|
|
58
59
|
exports.default = QandaContainer;
|
|
@@ -12,7 +12,9 @@ const updateComments = (dispatch, updatedComments, storyId, useStaging, comments
|
|
|
12
12
|
const latestAnsweredQuestionId = (0, qandas_1.getLatestAnsweredQuestion)(updatedComments);
|
|
13
13
|
try {
|
|
14
14
|
// Update the cache with the new comments
|
|
15
|
-
dispatch(comments_api_1.nextCommentsApi.util.updateQueryData('getQandAStream',
|
|
15
|
+
dispatch(comments_api_1.nextCommentsApi.util.updateQueryData('getQandAStream',
|
|
16
|
+
// Updates happen only for the live stream, so we pass the status as 'live' hardcoded
|
|
17
|
+
{ storyId, useStaging, commentsAPIUrl, status: 'live' }, (draft) => {
|
|
16
18
|
// NB - if the same comment is updated more than once, the most recent thing added to the array will be the one that is shown
|
|
17
19
|
for (let c = 0; c < updatedComments.length; c++) {
|
|
18
20
|
const commentId = updatedComments[c].id;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
2
|
import Headshot from '@financial-times/cp-content-pipeline-ui/lib/components/Headshot';
|
|
3
|
-
import
|
|
3
|
+
import Byline from '@financial-times/cp-content-pipeline-ui/lib/components/Byline';
|
|
4
4
|
function Author({ byline, headshot, prefLabel, role, streamPage, }) {
|
|
5
5
|
const hasHeadshot = headshot && prefLabel;
|
|
6
6
|
return (_jsxs("div", { className: "qanda-block__answer__author", "data-testid": "qanda-block__answer__author", children: [hasHeadshot ? (_jsx("div", { className: "qanda-block__answer__author-headshot", children: _jsx(Headshot, { headshot: headshot, prefLabel: prefLabel, streamPage: streamPage, className: "qanda-block__answer__author-headshot" }) })) : (_jsx("div", { className: "qanda-block__answer__author-opinion-icon" })), _jsxs("div", { className: "qanda-block__answer__author-info", children: [_jsx("div", { className: "o3-type-body-highlight qanda-block__answer__author-name", children: _jsx(Byline, { structuredContent: byline, showEditedBy: false }) }), _jsx("div", { className: "o3-type-body-base", children: role })] })] }));
|
|
@@ -8,6 +8,8 @@ function CalendarListItem({ name, link }) {
|
|
|
8
8
|
storyId,
|
|
9
9
|
useStaging,
|
|
10
10
|
commentsAPIUrl,
|
|
11
|
+
// Calendar is only relevant for pre-live Q&A
|
|
12
|
+
status: 'pre-live',
|
|
11
13
|
});
|
|
12
14
|
return (_jsx(_Fragment, { children: data?.startDateTime && data?.endDateTime && (_jsx("li", { className: 'live-qa-calendar-list__item', role: "presentation", "data-testid": "live-qa-calendar-list-item", children: link({
|
|
13
15
|
title,
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "preact/jsx-runtime";
|
|
2
|
-
import { useDispatch
|
|
2
|
+
import { useDispatch } from 'react-redux';
|
|
3
3
|
import { openForm } from '../../store/questionSlice';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
function EmbedFormField({ container }) {
|
|
7
7
|
const dispatch = useDispatch();
|
|
8
8
|
const [portalTarget, setPortalTarget] = useState();
|
|
9
|
-
const expertView = useSelector((state) => state.expert.expertView);
|
|
10
|
-
if (expertView) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
9
|
useEffect(() => {
|
|
14
10
|
if (container) {
|
|
15
11
|
const portalContainer = document.createElement('div');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import Byline from '@financial-times/cp-content-pipeline-ui/lib/components/Byline';
|
|
3
|
+
import RichText from '@financial-times/cp-content-pipeline-ui/lib/components/RichText';
|
|
3
4
|
import '../Expander/index';
|
|
4
5
|
import Expander from '../Expander/index';
|
|
5
6
|
import Author from '../Author';
|
|
@@ -20,6 +20,7 @@ function QandaContainer({ embedFormFieldContainer, countdownTimerContainer, }) {
|
|
|
20
20
|
storyId,
|
|
21
21
|
useStaging,
|
|
22
22
|
commentsAPIUrl,
|
|
23
|
+
status: 'pre-live',
|
|
23
24
|
});
|
|
24
25
|
const updatedQA = useUpdatedQA({
|
|
25
26
|
storyId,
|
|
@@ -48,6 +49,6 @@ function QandaContainer({ embedFormFieldContainer, countdownTimerContainer, }) {
|
|
|
48
49
|
dispatch(nextCommentsApi.util.resetApiState());
|
|
49
50
|
};
|
|
50
51
|
}, [dispatch, storyId]);
|
|
51
|
-
return (_jsxs("div", { className: "qanda-container", "data-trackable": "liveqa", children: [error && (_jsxs("p", { children: ["We are not able to load the Q&A at the moment. Please try again later. Error:", error] })), !isLoading && !error && (_jsxs(_Fragment, { children: [status !== 'close' && (_jsxs(_Fragment, { children: [showExpertView ? _jsx(ExpertDrawer, {}) : _jsx(QuestionForm, {}), _jsx(CountdownTimer, { container: countdownTimerContainer })] })), status === 'pre-live' && _jsx(Calendar, {}), _jsx(Stream, { status: status }), status !== 'close' && (_jsx(_Fragment, { children: _jsx(UserInfo, {}) })), status === 'live' && _jsx(FloatingActionBar, {}), _jsx(EmbedFormField, { container: embedFormFieldContainer })] }))] }));
|
|
52
|
+
return (_jsxs("div", { className: "qanda-container", "data-trackable": "liveqa", children: [error && (_jsxs("p", { children: ["We are not able to load the Q&A at the moment. Please try again later. Error:", error] })), !isLoading && !error && (_jsxs(_Fragment, { children: [status !== 'close' && (_jsxs(_Fragment, { children: [showExpertView ? _jsx(ExpertDrawer, {}) : _jsx(QuestionForm, {}), _jsx(CountdownTimer, { container: countdownTimerContainer })] })), status === 'pre-live' && _jsx(Calendar, {}), _jsx(Stream, { status: status }), status !== 'close' && (_jsx(_Fragment, { children: _jsx(UserInfo, {}) })), status === 'live' && _jsx(FloatingActionBar, {}), status !== 'close' && !showExpertView && (_jsx(EmbedFormField, { container: embedFormFieldContainer }))] }))] }));
|
|
52
53
|
}
|
|
53
54
|
export default QandaContainer;
|
|
@@ -9,7 +9,9 @@ export const updateComments = (dispatch, updatedComments, storyId, useStaging, c
|
|
|
9
9
|
const latestAnsweredQuestionId = getLatestAnsweredQuestion(updatedComments);
|
|
10
10
|
try {
|
|
11
11
|
// Update the cache with the new comments
|
|
12
|
-
dispatch(nextCommentsApi.util.updateQueryData('getQandAStream',
|
|
12
|
+
dispatch(nextCommentsApi.util.updateQueryData('getQandAStream',
|
|
13
|
+
// Updates happen only for the live stream, so we pass the status as 'live' hardcoded
|
|
14
|
+
{ storyId, useStaging, commentsAPIUrl, status: 'live' }, (draft) => {
|
|
13
15
|
// NB - if the same comment is updated more than once, the most recent thing added to the array will be the one that is shown
|
|
14
16
|
for (let c = 0; c < updatedComments.length; c++) {
|
|
15
17
|
const commentId = updatedComments[c].id;
|
|
@@ -6,7 +6,7 @@ type AuthorProps = {
|
|
|
6
6
|
role: string;
|
|
7
7
|
streamPage?: string;
|
|
8
8
|
};
|
|
9
|
-
declare function Author({ byline, headshot, prefLabel, role, streamPage, }: AuthorProps): import("
|
|
9
|
+
declare function Author({ byline, headshot, prefLabel, role, streamPage, }: AuthorProps): import("preact").JSX.Element;
|
|
10
10
|
declare namespace Author {
|
|
11
11
|
var defaultProps: {
|
|
12
12
|
byline: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function CalendarList(): import("
|
|
1
|
+
declare function CalendarList(): import("preact").JSX.Element;
|
|
2
2
|
export default CalendarList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type EmbedFormFieldProps = {
|
|
2
2
|
container?: HTMLElement;
|
|
3
3
|
};
|
|
4
|
-
declare function EmbedFormField({ container }: EmbedFormFieldProps): import("react").JSX.Element
|
|
4
|
+
declare function EmbedFormField({ container }: EmbedFormFieldProps): import("react").JSX.Element;
|
|
5
5
|
export default EmbedFormField;
|
|
@@ -11,4 +11,4 @@ export type LoaderProps = {
|
|
|
11
11
|
theme?: 'dark' | 'light';
|
|
12
12
|
extraClassNames?: string;
|
|
13
13
|
};
|
|
14
|
-
export default function Loader({ size, theme, extraClassNames, }: LoaderProps): import("
|
|
14
|
+
export default function Loader({ size, theme, extraClassNames, }: LoaderProps): import("preact").JSX.Element;
|
|
@@ -8,5 +8,5 @@ type OverlayProps = {
|
|
|
8
8
|
closeCallback: () => void;
|
|
9
9
|
options?: OverlayOptions;
|
|
10
10
|
};
|
|
11
|
-
declare function Overlay({ title, children, closeCallback, options, }: OverlayProps): import("
|
|
11
|
+
declare function Overlay({ title, children, closeCallback, options, }: OverlayProps): import("preact").JSX.Element;
|
|
12
12
|
export default Overlay;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { QandaProps } from '../types/qanda';
|
|
2
|
-
declare function Qanda({ storyId, useStaging, title, commentsAPIHost, commentsAPIVersion, maxQuestionLength, embedFormFieldContainer, countdownTimerContainer, }: QandaProps): import("
|
|
2
|
+
declare function Qanda({ storyId, useStaging, title, commentsAPIHost, commentsAPIVersion, maxQuestionLength, embedFormFieldContainer, countdownTimerContainer, }: QandaProps): import("preact").JSX.Element | null;
|
|
3
3
|
export default Qanda;
|
|
@@ -4,4 +4,4 @@ export declare const SUBSCRIBE_URL = "https://subs.ft.com/products";
|
|
|
4
4
|
export declare const COMMUNITY_GUIDELINES_URL = "https://help.ft.com/help/article-queries/commenting-on-an-article/commenting-guidelines";
|
|
5
5
|
export declare const TERMS_AND_CONDITIONS_URL = "https://help.ft.com/help/legal-privacy/terms-conditions";
|
|
6
6
|
export declare function getTitleByUser(profile: UserDetails): "Q&A guidelines" | "You are still on a trial period" | "Asking a question is only available to readers with an FT subscription";
|
|
7
|
-
export declare function getTextByUser(profile: UserDetails): import("
|
|
7
|
+
export declare function getTextByUser(profile: UserDetails): import("preact").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FetchBaseQueryError } from '@reduxjs/toolkit/query/react';
|
|
2
1
|
import type { Comment } from '../types/comment';
|
|
3
2
|
import type { QA } from '../types/qa';
|
|
4
3
|
import type { Status } from '../types/qa';
|
|
@@ -33,17 +32,17 @@ type CachedData = {
|
|
|
33
32
|
type UserRolesTransformed = {
|
|
34
33
|
expertView: boolean;
|
|
35
34
|
};
|
|
36
|
-
export declare const nextCommentsApi: import("@reduxjs/toolkit/query/react").Api<import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, {
|
|
35
|
+
export declare const nextCommentsApi: import("@reduxjs/toolkit/query/react").Api<import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, {
|
|
37
36
|
getQandAStream: import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams & {
|
|
38
|
-
status
|
|
39
|
-
}, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CommentsStreamTransformed, "nextCommentsApi">;
|
|
40
|
-
getQandAUpdates: import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CachedData, "nextCommentsApi">;
|
|
41
|
-
getUserRoles: import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlTokenParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, UserRolesTransformed, "nextCommentsApi">;
|
|
42
|
-
postQuestion: import("@reduxjs/toolkit/query/react").MutationDefinition<CommentsAPIUrlQuestionParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, any, "nextCommentsApi">;
|
|
37
|
+
status: Status;
|
|
38
|
+
}, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CommentsStreamTransformed, "nextCommentsApi">;
|
|
39
|
+
getQandAUpdates: import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CachedData, "nextCommentsApi">;
|
|
40
|
+
getUserRoles: import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlTokenParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, UserRolesTransformed, "nextCommentsApi">;
|
|
41
|
+
postQuestion: import("@reduxjs/toolkit/query/react").MutationDefinition<CommentsAPIUrlQuestionParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, any, "nextCommentsApi">;
|
|
43
42
|
}, "nextCommentsApi", never, typeof import("@reduxjs/toolkit/query/react").coreModuleName | typeof import("@reduxjs/toolkit/query/react").reactHooksModuleName>;
|
|
44
43
|
export declare const useGetQandAStreamQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams & {
|
|
45
|
-
status
|
|
46
|
-
}, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CommentsStreamTransformed, "nextCommentsApi">>, useGetQandAUpdatesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CachedData, "nextCommentsApi">>, useGetUserRolesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlTokenParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, UserRolesTransformed, "nextCommentsApi">>, usePostQuestionMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<CommentsAPIUrlQuestionParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, any, "nextCommentsApi">>;
|
|
44
|
+
status: Status;
|
|
45
|
+
}, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CommentsStreamTransformed, "nextCommentsApi">>, useGetQandAUpdatesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, CachedData, "nextCommentsApi">>, useGetUserRolesQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query/react").QueryDefinition<CommentsAPIUrlTokenParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, UserRolesTransformed, "nextCommentsApi">>, usePostQuestionMutation: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseMutation<import("@reduxjs/toolkit/query/react").MutationDefinition<CommentsAPIUrlQuestionParams, import("@reduxjs/toolkit/query/react").BaseQueryFn<string | import("@reduxjs/toolkit/query/react").FetchArgs, unknown, import("@reduxjs/toolkit/query/react").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query/react").FetchBaseQueryMeta>, never, any, "nextCommentsApi">>;
|
|
47
46
|
export declare const useUpdatedComments: ({ storyId, useStaging, commentsAPIUrl, }: CommentsAPIUrlParams) => Comment[];
|
|
48
47
|
export declare const useUpdatedQA: ({ storyId, useStaging, commentsAPIUrl, }: CommentsAPIUrlParams) => any;
|
|
49
48
|
export {};
|
|
@@ -14,7 +14,7 @@ export declare const rootReducer: import("@reduxjs/toolkit").Reducer<import("@re
|
|
|
14
14
|
useStaging: boolean;
|
|
15
15
|
commentsAPIUrl: string;
|
|
16
16
|
} & {
|
|
17
|
-
status
|
|
17
|
+
status: import("../types/qa").Status;
|
|
18
18
|
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, Omit<{
|
|
19
19
|
type: string;
|
|
20
20
|
children?: import("../types/comment").Comment[];
|
|
@@ -71,7 +71,7 @@ export declare const store: import("@reduxjs/toolkit/dist/configureStore").Toolk
|
|
|
71
71
|
useStaging: boolean;
|
|
72
72
|
commentsAPIUrl: string;
|
|
73
73
|
} & {
|
|
74
|
-
status
|
|
74
|
+
status: import("../types/qa").Status;
|
|
75
75
|
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, Omit<{
|
|
76
76
|
type: string;
|
|
77
77
|
children?: import("../types/comment").Comment[];
|
|
@@ -121,7 +121,7 @@ export declare const store: import("@reduxjs/toolkit/dist/configureStore").Toolk
|
|
|
121
121
|
useStaging: boolean;
|
|
122
122
|
commentsAPIUrl: string;
|
|
123
123
|
} & {
|
|
124
|
-
status
|
|
124
|
+
status: import("../types/qa").Status;
|
|
125
125
|
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, Omit<{
|
|
126
126
|
type: string;
|
|
127
127
|
children?: import("../types/comment").Comment[];
|
|
@@ -166,7 +166,7 @@ export declare const store: import("@reduxjs/toolkit/dist/configureStore").Toolk
|
|
|
166
166
|
useStaging: boolean;
|
|
167
167
|
commentsAPIUrl: string;
|
|
168
168
|
} & {
|
|
169
|
-
status
|
|
169
|
+
status: import("../types/qa").Status;
|
|
170
170
|
}, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {}, import("@reduxjs/toolkit/query").FetchBaseQueryMeta>, never, Omit<{
|
|
171
171
|
type: string;
|
|
172
172
|
children?: import("../types/comment").Comment[];
|