@miso.ai/client-sdk-ui 1.11.5-beta.2 → 1.11.5-beta.3
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/version.js
CHANGED
|
@@ -137,8 +137,7 @@ class Explore extends _base.default {
|
|
|
137
137
|
const related_questions = value.related_questions.map(linkFn ? text => ({
|
|
138
138
|
text,
|
|
139
139
|
url: this._getSubmitUrl({
|
|
140
|
-
q: text
|
|
141
|
-
}, {
|
|
140
|
+
q: text,
|
|
142
141
|
generated: true
|
|
143
142
|
})
|
|
144
143
|
}) : text => ({
|
|
@@ -166,14 +165,13 @@ class Explore extends _base.default {
|
|
|
166
165
|
this._hub.update(_index.fields.query(), args);
|
|
167
166
|
}
|
|
168
167
|
_query(args) {
|
|
169
|
-
this._submitToPage(args
|
|
168
|
+
this._submitToPage(Object.assign({}, args, {
|
|
169
|
+
generated: false
|
|
170
|
+
}));
|
|
170
171
|
}
|
|
171
172
|
_getSubmitUrl(args) {
|
|
172
|
-
let {
|
|
173
|
-
generated = false
|
|
174
|
-
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
175
173
|
let url = _useLink.UseLinkMixin.prototype._getSubmitUrl.call(this, args);
|
|
176
|
-
if (!generated || !this._productId) {
|
|
174
|
+
if (!args.generated || !this._productId) {
|
|
177
175
|
return url;
|
|
178
176
|
}
|
|
179
177
|
return `${url}&qs=${encodeURIComponent(this._productId)}`;
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.UseLinkMixin = void 0;
|
|
7
7
|
exports.enableUseLink = enableUseLink;
|
|
8
8
|
var _commons = require("@miso.ai/commons");
|
|
9
|
+
const _excluded = ["q"];
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
11
|
function enableUseLink(prototype) {
|
|
10
12
|
(0, _commons.mixin)(prototype, UseLinkMixin.prototype);
|
|
11
13
|
}
|
|
@@ -34,11 +36,16 @@ class UseLinkMixin {
|
|
|
34
36
|
window.open(url, target, windowFeatures);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
|
-
_getSubmitUrl(
|
|
39
|
+
_getSubmitUrl() {
|
|
40
|
+
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
41
|
+
let {
|
|
42
|
+
q
|
|
43
|
+
} = _ref,
|
|
44
|
+
args = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
38
45
|
if (!this._linkFn) {
|
|
39
46
|
throw new Error('useLink(fn) must be called before _getSubmitUrl()');
|
|
40
47
|
}
|
|
41
|
-
return this._linkFn[0](args
|
|
48
|
+
return this._linkFn[0](q, args);
|
|
42
49
|
}
|
|
43
50
|
}
|
|
44
51
|
exports.UseLinkMixin = UseLinkMixin;
|
package/package.json
CHANGED
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.11.5-beta.
|
|
1
|
+
export default '1.11.5-beta.3';
|
package/src/workflow/explore.js
CHANGED
|
@@ -121,7 +121,7 @@ export default class Explore extends Workflow {
|
|
|
121
121
|
return data;
|
|
122
122
|
}
|
|
123
123
|
const linkFn = this._linkFn && this._linkFn[0];
|
|
124
|
-
const related_questions = value.related_questions.map(linkFn ? (text => ({ text, url: this._getSubmitUrl({ q: text
|
|
124
|
+
const related_questions = value.related_questions.map(linkFn ? (text => ({ text, url: this._getSubmitUrl({ q: text, generated: true }) })) : (text => ({ text })));
|
|
125
125
|
return {
|
|
126
126
|
...data,
|
|
127
127
|
value: {
|
|
@@ -143,12 +143,12 @@ export default class Explore extends Workflow {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
_query(args) {
|
|
146
|
-
this._submitToPage(args);
|
|
146
|
+
this._submitToPage({ ...args, generated: false });
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
_getSubmitUrl(args
|
|
149
|
+
_getSubmitUrl(args) {
|
|
150
150
|
let url = UseLinkMixin.prototype._getSubmitUrl.call(this, args);
|
|
151
|
-
if (!generated || !this._productId) {
|
|
151
|
+
if (!args.generated || !this._productId) {
|
|
152
152
|
return url;
|
|
153
153
|
}
|
|
154
154
|
return `${url}&qs=${encodeURIComponent(this._productId)}`;
|
package/src/workflow/use-link.js
CHANGED
|
@@ -30,11 +30,11 @@ export class UseLinkMixin {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
_getSubmitUrl(args) {
|
|
33
|
+
_getSubmitUrl({ q, ...args } = {}) {
|
|
34
34
|
if (!this._linkFn) {
|
|
35
35
|
throw new Error('useLink(fn) must be called before _getSubmitUrl()');
|
|
36
36
|
}
|
|
37
|
-
return this._linkFn[0](args
|
|
37
|
+
return this._linkFn[0](q, args);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
}
|