@searchstax-inc/searchstudio-ux-js 1.0.17 → 1.0.26
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 +28 -5
- package/README.mustache +6 -1
- package/dist/@searchstax-inc/searchstudio-ux-js.cjs +40 -18
- package/dist/@searchstax-inc/searchstudio-ux-js.d.mts +37 -10
- package/dist/@searchstax-inc/searchstudio-ux-js.d.ts +37 -10
- package/dist/@searchstax-inc/searchstudio-ux-js.iife.js +40 -18
- package/dist/@searchstax-inc/searchstudio-ux-js.mjs +1050 -604
- package/dist/styles/mainTheme.css +65 -0
- package/dist/styles/scss/widgets/answer/style.scss +73 -1
- package/dist/templates.js +22 -4
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ interface ISearchstaxConfig {
|
|
|
27
27
|
autoCorrect?: boolean; // if set to true it will autoCorrect misspelled words. Default is false
|
|
28
28
|
router?: IRouterConfig; // optional object containing router settings
|
|
29
29
|
analyticsBaseUrl?: string; // url for analytics calls
|
|
30
|
+
questionURL?: string; // url for AI answer widget
|
|
30
31
|
hooks?: {
|
|
31
32
|
// optional object that provides various hook options
|
|
32
33
|
beforeSearch?: (props: ISearchObject) => ISearchObject | null; // this function gets called before firing search. searchProps are being passed as a property and can be modified, if passed along further search will execute with modified properties, if null is returned then event gets canceled and search never fires.
|
|
@@ -45,6 +46,7 @@ searchstax.initialize({
|
|
|
45
46
|
searchAuth: "",
|
|
46
47
|
sessionId: "yourSessionId",
|
|
47
48
|
authType: "basic",
|
|
49
|
+
questionURL: "",
|
|
48
50
|
router: {
|
|
49
51
|
enabled: true,
|
|
50
52
|
routeName: "searchstax",
|
|
@@ -128,7 +130,9 @@ b. Answer widget config object of type: [ISearchstaxAnswerConfig](https://www.se
|
|
|
128
130
|
|
|
129
131
|
example of answer widget initialization with minimum options
|
|
130
132
|
```
|
|
131
|
-
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
133
|
+
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
134
|
+
showShowMoreAfterWordCount: 100
|
|
135
|
+
});
|
|
132
136
|
```
|
|
133
137
|
|
|
134
138
|
|
|
@@ -136,15 +140,34 @@ example of answer widget initialization with various options
|
|
|
136
140
|
```
|
|
137
141
|
|
|
138
142
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
143
|
+
showShowMoreAfterWordCount: 100,
|
|
139
144
|
templates: {
|
|
140
145
|
main: {
|
|
141
146
|
template: `
|
|
142
147
|
{{#shouldShowAnswer}}
|
|
143
|
-
<div
|
|
144
|
-
<div class="searchstax-answer-
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
<div>
|
|
149
|
+
<div class="searchstax-answer-container {{#showMoreButtonVisible}}searchstax-answer-show-more{{/showMoreButtonVisible}}">
|
|
150
|
+
<div class="searchstax-answer-title">Answer</div>
|
|
151
|
+
<div class="searchstax-answer-description">
|
|
152
|
+
{{#showMoreButtonVisible}}
|
|
153
|
+
{{answerTruncated}}
|
|
154
|
+
{{/showMoreButtonVisible}}
|
|
155
|
+
{{^showMoreButtonVisible}}
|
|
156
|
+
{{answer}}
|
|
157
|
+
{{/showMoreButtonVisible}}
|
|
158
|
+
|
|
159
|
+
{{#answerLoading}}
|
|
160
|
+
<div class="searchstax-answer-loading"></div>
|
|
161
|
+
{{/answerLoading}}
|
|
162
|
+
</div>
|
|
147
163
|
</div>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
{{#showMoreButtonVisible}}
|
|
167
|
+
<div class="searchstax-answer-load-more-button-container">
|
|
168
|
+
<button class="searchstax-answer-load-more-button">Show More...</button>
|
|
169
|
+
</div>
|
|
170
|
+
{{/showMoreButtonVisible}}
|
|
148
171
|
</div>
|
|
149
172
|
{{/shouldShowAnswer}}
|
|
150
173
|
`,
|
package/README.mustache
CHANGED
|
@@ -27,6 +27,7 @@ interface ISearchstaxConfig {
|
|
|
27
27
|
autoCorrect?: boolean; // if set to true it will autoCorrect misspelled words. Default is false
|
|
28
28
|
router?: IRouterConfig; // optional object containing router settings
|
|
29
29
|
analyticsBaseUrl?: string; // url for analytics calls
|
|
30
|
+
questionURL?: string; // url for AI answer widget
|
|
30
31
|
hooks?: {
|
|
31
32
|
// optional object that provides various hook options
|
|
32
33
|
beforeSearch?: (props: ISearchObject) => ISearchObject | null; // this function gets called before firing search. searchProps are being passed as a property and can be modified, if passed along further search will execute with modified properties, if null is returned then event gets canceled and search never fires.
|
|
@@ -45,6 +46,7 @@ searchstax.initialize({
|
|
|
45
46
|
searchAuth: "",
|
|
46
47
|
sessionId: "yourSessionId",
|
|
47
48
|
authType: "basic",
|
|
49
|
+
questionURL: "",
|
|
48
50
|
router: {
|
|
49
51
|
enabled: true,
|
|
50
52
|
routeName: "searchstax",
|
|
@@ -128,7 +130,9 @@ b. Answer widget config object of type: [ISearchstaxAnswerConfig](https://www.se
|
|
|
128
130
|
|
|
129
131
|
example of answer widget initialization with minimum options
|
|
130
132
|
```
|
|
131
|
-
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
133
|
+
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
134
|
+
showShowMoreAfterWordCount: 100
|
|
135
|
+
});
|
|
132
136
|
```
|
|
133
137
|
|
|
134
138
|
|
|
@@ -136,6 +140,7 @@ example of answer widget initialization with various options
|
|
|
136
140
|
```
|
|
137
141
|
|
|
138
142
|
searchstax.addAnswerWidget("searchstax-answer-container", {
|
|
143
|
+
showShowMoreAfterWordCount: 100,
|
|
139
144
|
templates: {
|
|
140
145
|
main: {
|
|
141
146
|
template: `{{&answer.main.template}}`,
|