@miso.ai/client-sdk-ui 1.9.1-beta.3 → 1.9.1-beta.4
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/defaults/ask/templates.js +1 -0
- package/dist/cjs/layout/templates.js +11 -3
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/options.js +3 -2
- package/package.json +2 -2
- package/src/defaults/ask/templates.js +1 -0
- package/src/layout/templates.js +5 -3
- package/src/version.js +1 -1
- package/src/workflow/options.js +1 -0
|
@@ -12,6 +12,7 @@ const _excluded = ["classPrefix", "circledCitationIndex"],
|
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
// TODO: rename classPrefix -> rootClass?
|
|
15
16
|
// TODO: placeholder
|
|
16
17
|
|
|
17
18
|
function root() {
|
|
@@ -79,7 +79,7 @@ function articleInfoBlock(_ref3, _ref4) {
|
|
|
79
79
|
updated_at,
|
|
80
80
|
published_at
|
|
81
81
|
} = _ref4;
|
|
82
|
-
const date =
|
|
82
|
+
const date = published_at || created_at || updated_at;
|
|
83
83
|
let content = '';
|
|
84
84
|
if (title) {
|
|
85
85
|
content += `<div class="${className}__item-title">${title}</div>`;
|
|
@@ -98,14 +98,22 @@ function articleInfoBlock(_ref3, _ref4) {
|
|
|
98
98
|
// helpers //
|
|
99
99
|
function renderTagPair(_ref5, _ref6) {
|
|
100
100
|
let {
|
|
101
|
-
className
|
|
101
|
+
className,
|
|
102
|
+
options = {}
|
|
102
103
|
} = _ref5;
|
|
103
104
|
let {
|
|
104
105
|
product_id,
|
|
105
106
|
url
|
|
106
107
|
} = _ref6;
|
|
108
|
+
const {
|
|
109
|
+
link = {}
|
|
110
|
+
} = options;
|
|
111
|
+
const {
|
|
112
|
+
target = '_blank',
|
|
113
|
+
rel = 'noopener'
|
|
114
|
+
} = link; // TODO: other properties
|
|
107
115
|
const tag = url ? 'a' : 'div';
|
|
108
|
-
const urlAttrs = url ? `href="${url}" target="
|
|
116
|
+
const urlAttrs = url ? `href="${url}" target="${target}" rel="${rel}"` : '';
|
|
109
117
|
const productAttrs = product_id ? `${_constants.ATTR_DATA_MISO_PRODUCT_ID}="${product_id}"` : '';
|
|
110
118
|
return [`<${tag} class="${className}__item-body" data-role="item" ${productAttrs} ${urlAttrs}>`, `</${tag}>`];
|
|
111
119
|
}
|
package/dist/cjs/version.js
CHANGED
|
@@ -17,8 +17,8 @@ exports.normalizeTrackers = normalizeTrackers;
|
|
|
17
17
|
var _commons = require("@miso.ai/commons");
|
|
18
18
|
var _constants = require("../constants.js");
|
|
19
19
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
22
|
// normalize //
|
|
23
23
|
function normalizeApiOptions() {
|
|
24
24
|
let [name, payload] = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -161,6 +161,7 @@ function mergeLayoutOptions(base, overrides) {
|
|
|
161
161
|
}
|
|
162
162
|
function mergeLayoutParameters(base, overrides) {
|
|
163
163
|
return Object.assign({}, base, overrides, {
|
|
164
|
+
link: Object.assign({}, base && base.link, overrides && overrides.link),
|
|
164
165
|
templates: Object.assign({}, base && base.templates, overrides && overrides.templates)
|
|
165
166
|
});
|
|
166
167
|
}
|
package/package.json
CHANGED
package/src/layout/templates.js
CHANGED
|
@@ -59,7 +59,7 @@ function productInfoBlock({ className }, { title, snippet, description, sale_pri
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
function articleInfoBlock({ className, templates }, { title, snippet, description, created_at, updated_at, published_at }) {
|
|
62
|
-
const date =
|
|
62
|
+
const date = published_at || created_at || updated_at;
|
|
63
63
|
let content = '';
|
|
64
64
|
if (title) {
|
|
65
65
|
content += `<div class="${className}__item-title">${title}</div>`;
|
|
@@ -76,9 +76,11 @@ function articleInfoBlock({ className, templates }, { title, snippet, descriptio
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// helpers //
|
|
79
|
-
function renderTagPair({ className }, { product_id, url }) {
|
|
79
|
+
function renderTagPair({ className, options = {} }, { product_id, url }) {
|
|
80
|
+
const { link = {} } = options;
|
|
81
|
+
const { target = '_blank', rel = 'noopener' } = link; // TODO: other properties
|
|
80
82
|
const tag = url ? 'a' : 'div';
|
|
81
|
-
const urlAttrs = url ? `href="${url}" target="
|
|
83
|
+
const urlAttrs = url ? `href="${url}" target="${target}" rel="${rel}"` : '';
|
|
82
84
|
const productAttrs = product_id ? `${ATTR_DATA_MISO_PRODUCT_ID}="${product_id}"` : '';
|
|
83
85
|
return [`<${tag} class="${className}__item-body" data-role="item" ${productAttrs} ${urlAttrs}>`, `</${tag}>`];
|
|
84
86
|
}
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.9.1-beta.
|
|
1
|
+
export default '1.9.1-beta.4';
|
package/src/workflow/options.js
CHANGED
|
@@ -137,6 +137,7 @@ function mergeLayoutParameters(base, overrides) {
|
|
|
137
137
|
return {
|
|
138
138
|
...base,
|
|
139
139
|
...overrides,
|
|
140
|
+
link: { ...(base && base.link), ...(overrides && overrides.link) },
|
|
140
141
|
templates: { ...(base && base.templates), ...(overrides && overrides.templates) },
|
|
141
142
|
};
|
|
142
143
|
}
|