@miso.ai/client-sdk-ui 1.13.0 → 1.13.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.
- package/dist/cjs/actor/view.js +2 -0
- package/dist/cjs/actor/views.js +8 -3
- package/dist/cjs/layout/input/facets.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/options/auto-query.js +2 -0
- package/dist/cjs/workflow/use-link.js +2 -0
- package/package.json +2 -2
- package/src/actor/view.js +2 -0
- package/src/actor/views.js +9 -4
- package/src/layout/input/facets.js +1 -1
- package/src/version.js +1 -1
- package/src/workflow/options/auto-query.js +2 -0
- package/src/workflow/use-link.js +2 -0
package/dist/cjs/actor/view.js
CHANGED
|
@@ -12,6 +12,8 @@ const _excluded = ["value", "error", "status", "meta"];
|
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
14
|
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; }
|
|
15
|
+
// TODO: browser dependency on syncSize
|
|
16
|
+
|
|
15
17
|
function statesEqual(a, b) {
|
|
16
18
|
return a === b || a && b && a.status === b.status && a.error === b.error && a.value === b.value &&
|
|
17
19
|
// skip deep equals
|
package/dist/cjs/actor/views.js
CHANGED
|
@@ -33,9 +33,7 @@ class ViewsActor {
|
|
|
33
33
|
(0, _commons.defineValues)(this, {
|
|
34
34
|
interface: new Views(this)
|
|
35
35
|
});
|
|
36
|
-
|
|
37
|
-
window.addEventListener('resize', syncSize);
|
|
38
|
-
this._unsubscribes = [() => window.removeEventListener('resize', syncSize), hub.on(fields.data(), data => this.refresh({
|
|
36
|
+
this._unsubscribes = [onResize(this.syncSize.bind(this)), hub.on(fields.data(), data => this.refresh({
|
|
39
37
|
data
|
|
40
38
|
})), options.on('layouts', () => this._syncLayouts())];
|
|
41
39
|
this._syncLayouts();
|
|
@@ -201,4 +199,11 @@ class Views {
|
|
|
201
199
|
get all() {
|
|
202
200
|
return this._actor.views.map(view => view.interface);
|
|
203
201
|
}
|
|
202
|
+
}
|
|
203
|
+
function onResize(callback) {
|
|
204
|
+
if (typeof window === 'undefined') {
|
|
205
|
+
return () => {};
|
|
206
|
+
}
|
|
207
|
+
window.addEventListener('resize', callback);
|
|
208
|
+
return () => window.removeEventListener('resize', callback);
|
|
204
209
|
}
|
package/dist/cjs/version.js
CHANGED
|
@@ -11,6 +11,8 @@ var _commons = require("@miso.ai/commons");
|
|
|
11
11
|
var _constants = require("../../constants.js");
|
|
12
12
|
const _excluded = ["setValue", "focus", "updateUrl", "param", "sourceParam"];
|
|
13
13
|
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; }
|
|
14
|
+
// TODO: eliminate browser dependency?
|
|
15
|
+
|
|
14
16
|
const DEFAULT_AUTO_QUERY_PARAM = exports.DEFAULT_AUTO_QUERY_PARAM = 'q';
|
|
15
17
|
const DEFAULT_AUTO_QUERY_SOURCE_PARAM = exports.DEFAULT_AUTO_QUERY_SOURCE_PARAM = 'qs';
|
|
16
18
|
function normalizeAutoQueryOptions(_ref = {}) {
|
|
@@ -8,6 +8,8 @@ exports.enableUseLink = enableUseLink;
|
|
|
8
8
|
var _commons = require("@miso.ai/commons");
|
|
9
9
|
const _excluded = ["q"];
|
|
10
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; }
|
|
11
|
+
// TODO: eliminate browser dependency
|
|
12
|
+
|
|
11
13
|
function enableUseLink(prototype) {
|
|
12
14
|
(0, _commons.mixin)(prototype, UseLinkMixin.prototype);
|
|
13
15
|
}
|
package/package.json
CHANGED
package/src/actor/view.js
CHANGED
|
@@ -3,6 +3,8 @@ import { STATUS, ROLE, isDataRole } from '../constants.js';
|
|
|
3
3
|
import * as fields from './fields.js';
|
|
4
4
|
import ProxyElement from '../util/proxy.js';
|
|
5
5
|
|
|
6
|
+
// TODO: browser dependency on syncSize
|
|
7
|
+
|
|
6
8
|
function statesEqual(a, b) {
|
|
7
9
|
return a === b || (a && b &&
|
|
8
10
|
a.status === b.status &&
|
package/src/actor/views.js
CHANGED
|
@@ -29,11 +29,8 @@ export default class ViewsActor {
|
|
|
29
29
|
interface: new Views(this),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
const syncSize = () => this.syncSize();
|
|
33
|
-
window.addEventListener('resize', syncSize);
|
|
34
|
-
|
|
35
32
|
this._unsubscribes = [
|
|
36
|
-
(
|
|
33
|
+
onResize(this.syncSize.bind(this)),
|
|
37
34
|
hub.on(fields.data(), data => this.refresh({ data })),
|
|
38
35
|
options.on('layouts', () => this._syncLayouts()),
|
|
39
36
|
];
|
|
@@ -217,3 +214,11 @@ class Views {
|
|
|
217
214
|
}
|
|
218
215
|
|
|
219
216
|
}
|
|
217
|
+
|
|
218
|
+
function onResize(callback) {
|
|
219
|
+
if (typeof window === 'undefined') {
|
|
220
|
+
return () => {};
|
|
221
|
+
}
|
|
222
|
+
window.addEventListener('resize', callback);
|
|
223
|
+
return () => window.removeEventListener('resize', callback);
|
|
224
|
+
}
|
|
@@ -17,7 +17,7 @@ function root(layout, state) {
|
|
|
17
17
|
function facets(layout, state) {
|
|
18
18
|
const { templates } = layout;
|
|
19
19
|
const { facet_fields = {} } = state.value || {};
|
|
20
|
-
return Object.keys(facet_fields).map(field => templates.facet(layout, { field, entries: facet_fields[field] }, state));
|
|
20
|
+
return Object.keys(facet_fields).map(field => templates.facet(layout, { field, entries: facet_fields[field] }, state)).join('');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function facet(layout, facet, state) {
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.13.0';
|
|
1
|
+
export default '1.13.1-beta.0';
|