@miso.ai/client-sdk-ui 1.9.0-beta.9 → 1.9.1-beta.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.
@@ -1,86 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.sources = exports.root = exports.followUp = exports.answer = void 0;
7
- var _constants = require("./constants.js");
8
- // TODO: make ids constants
9
- // TODO: placeholder
10
-
11
- const root = options => `
12
- <section id="${_constants.PREFIX}__question" class="${_constants.PREFIX}__section ${_constants.PREFIX}__question">
13
- <miso-ask class="${_constants.PREFIX}__query-container">
14
- <miso-query></miso-query>
15
- </miso-ask>
16
- </section>
17
- <section class="${_constants.PREFIX}__section ${_constants.PREFIX}__answer">
18
- ${options.templates.answer(options)}
19
- ${options.templates.sources(options)}
20
- </section>
21
- <div id="${_constants.PREFIX}__follow-ups" class="${_constants.PREFIX}__follow-ups"></div>
22
- <section id="${_constants.PREFIX}__related-resources" class="${_constants.PREFIX}__section ${_constants.PREFIX}__related-resources">
23
- <miso-ask visible-when="nonempty" logo="true">
24
- <h2 class="${_constants.PREFIX}__phrase ${_constants.PREFIX}__related-resources-phrase"></h2>
25
- <miso-related-resources></miso-related-resources>
26
- </miso-ask>
27
- </section>
28
- `.trim();
29
- exports.root = root;
30
- const followUp = (options, _ref) => {
31
- let {
32
- parentQuestionId
33
- } = _ref;
34
- return `
35
- <section class="${_constants.PREFIX}__section ${_constants.PREFIX}__follow-up">
36
- <miso-ask class="${_constants.PREFIX}__query-suggestions-container" visible-when="initial+nonempty" parent-question-id="${parentQuestionId}">
37
- <h3 class="${_constants.PREFIX}__phrase ${_constants.PREFIX}__related-questions-phrase"></h3>
38
- <miso-query-suggestions></miso-query-suggestions>
39
- </miso-ask>
40
- <miso-ask class="${_constants.PREFIX}__query-container" visible-when="initial loading" parent-question-id="${parentQuestionId}">
41
- <miso-query></miso-query>
42
- </miso-ask>
43
- ${options.templates.answer(options, {
44
- parentQuestionId
45
- })}
46
- ${options.templates.sources(options, {
47
- parentQuestionId
48
- })}
49
- </section>
50
- `.trim();
51
- };
52
- exports.followUp = followUp;
53
- const answer = function (options) {
54
- let {
55
- parentQuestionId
56
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
57
- // TODO: include/omit miso-circled-citation-index by options
58
- const openTag = `<miso-ask class="${_constants.PREFIX}__answer-container miso-circled-citation-index" visible-when="ready" logo="false"${parentQuestionId ? ` parent-question-id="${parentQuestionId}"` : ''}>`;
59
- const closeTag = '</miso-ask>';
60
- return `
61
- ${openTag}
62
- ${parentQuestionId ? '<hr>' : ''}
63
- <div class="${_constants.PREFIX}__phrase ${_constants.PREFIX}__question-phrase"></div>
64
- <miso-question></miso-question>
65
- <miso-answer></miso-answer>
66
- <miso-feedback></miso-feedback>
67
- ${closeTag}
68
- `.trim();
69
- };
70
- exports.answer = answer;
71
- const sources = function (options) {
72
- let {
73
- parentQuestionId
74
- } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
75
- // TODO: include/omit miso-circled-citation-index by options
76
- const openTag = `<miso-ask class="${_constants.PREFIX}__sources-container miso-circled-citation-index" visible-when="nonempty" logo="false"${parentQuestionId ? ` parent-question-id="${parentQuestionId}"` : ''}>`;
77
- const closeTag = '</miso-ask>';
78
- return `
79
- ${openTag}
80
- <hr>
81
- <h3 class="${_constants.PREFIX}__phrase ${_constants.PREFIX}__sources-phrase"></h3>
82
- <miso-sources></miso-sources>
83
- ${closeTag}
84
- `.trim();
85
- };
86
- exports.sources = sources;
@@ -1,65 +0,0 @@
1
- import { PREFIX } from './constants.js';
2
-
3
- // TODO: make ids constants
4
- // TODO: placeholder
5
-
6
- export const root = (options) => `
7
- <section id="${PREFIX}__question" class="${PREFIX}__section ${PREFIX}__question">
8
- <miso-ask class="${PREFIX}__query-container">
9
- <miso-query></miso-query>
10
- </miso-ask>
11
- </section>
12
- <section class="${PREFIX}__section ${PREFIX}__answer">
13
- ${options.templates.answer(options)}
14
- ${options.templates.sources(options)}
15
- </section>
16
- <div id="${PREFIX}__follow-ups" class="${PREFIX}__follow-ups"></div>
17
- <section id="${PREFIX}__related-resources" class="${PREFIX}__section ${PREFIX}__related-resources">
18
- <miso-ask visible-when="nonempty" logo="true">
19
- <h2 class="${PREFIX}__phrase ${PREFIX}__related-resources-phrase"></h2>
20
- <miso-related-resources></miso-related-resources>
21
- </miso-ask>
22
- </section>
23
- `.trim();
24
-
25
- export const followUp = (options, { parentQuestionId }) => `
26
- <section class="${PREFIX}__section ${PREFIX}__follow-up">
27
- <miso-ask class="${PREFIX}__query-suggestions-container" visible-when="initial+nonempty" parent-question-id="${parentQuestionId}">
28
- <h3 class="${PREFIX}__phrase ${PREFIX}__related-questions-phrase"></h3>
29
- <miso-query-suggestions></miso-query-suggestions>
30
- </miso-ask>
31
- <miso-ask class="${PREFIX}__query-container" visible-when="initial loading" parent-question-id="${parentQuestionId}">
32
- <miso-query></miso-query>
33
- </miso-ask>
34
- ${options.templates.answer(options, { parentQuestionId })}
35
- ${options.templates.sources(options, { parentQuestionId })}
36
- </section>
37
- `.trim();
38
-
39
- export const answer = (options, { parentQuestionId } = {}) => {
40
- // TODO: include/omit miso-circled-citation-index by options
41
- const openTag = `<miso-ask class="${PREFIX}__answer-container miso-circled-citation-index" visible-when="ready" logo="false"${parentQuestionId ? ` parent-question-id="${parentQuestionId}"` : ''}>`;
42
- const closeTag = '</miso-ask>';
43
- return `
44
- ${openTag}
45
- ${ parentQuestionId ? '<hr>' : '' }
46
- <div class="${PREFIX}__phrase ${PREFIX}__question-phrase"></div>
47
- <miso-question></miso-question>
48
- <miso-answer></miso-answer>
49
- <miso-feedback></miso-feedback>
50
- ${closeTag}
51
- `.trim();
52
- };
53
-
54
- export const sources = (options, { parentQuestionId } = {}) => {
55
- // TODO: include/omit miso-circled-citation-index by options
56
- const openTag = `<miso-ask class="${PREFIX}__sources-container miso-circled-citation-index" visible-when="nonempty" logo="false"${parentQuestionId ? ` parent-question-id="${parentQuestionId}"` : ''}>`;
57
- const closeTag = '</miso-ask>';
58
- return `
59
- ${openTag}
60
- <hr>
61
- <h3 class="${PREFIX}__phrase ${PREFIX}__sources-phrase"></h3>
62
- <miso-sources></miso-sources>
63
- ${closeTag}
64
- `.trim();
65
- };