@miso.ai/client-sdk-ui 1.9.4-beta.0 → 1.9.4-beta.1
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/layout/input/option-list.js +1 -1
- package/dist/cjs/layout/input/search-box.js +2 -1
- package/dist/cjs/layout/templates.js +5 -5
- package/dist/cjs/version.js +1 -1
- package/package.json +2 -2
- package/src/layout/input/option-list.js +2 -2
- package/src/layout/input/search-box.js +2 -1
- package/src/layout/templates.js +6 -5
- package/src/version.js +1 -1
|
@@ -45,7 +45,7 @@ function option(layout, value) {
|
|
|
45
45
|
const {
|
|
46
46
|
className
|
|
47
47
|
} = layout;
|
|
48
|
-
const text = value.text || value;
|
|
48
|
+
const text = (0, _commons.escapeHtml)(value.text || value);
|
|
49
49
|
return `<li class="${className}__option" data-role="option" tabindex="0">${text}</li>`;
|
|
50
50
|
}
|
|
51
51
|
const DEFAULT_TEMPLATES = Object.freeze({
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _commons = require("@miso.ai/commons");
|
|
7
8
|
var _constants = require("../../constants.js");
|
|
8
9
|
var _index = require("../../actor/index.js");
|
|
9
10
|
var _template = _interopRequireDefault(require("../template.js"));
|
|
@@ -59,7 +60,7 @@ function suggestionItem(layout, value) {
|
|
|
59
60
|
const {
|
|
60
61
|
className
|
|
61
62
|
} = layout;
|
|
62
|
-
const text = value.text || value;
|
|
63
|
+
const text = (0, _commons.escapeHtml)(value.text || value);
|
|
63
64
|
return `<li class="${className}__suggestion-item" data-role="suggestion-item" tabindex="0">${text}</li>`;
|
|
64
65
|
}
|
|
65
66
|
const DEFAULT_TEMPLATES = Object.freeze({
|
|
@@ -8,6 +8,7 @@ exports.product = product;
|
|
|
8
8
|
exports.question = question;
|
|
9
9
|
exports.requiresImplementation = requiresImplementation;
|
|
10
10
|
exports.unimplemented = unimplemented;
|
|
11
|
+
var _commons = require("@miso.ai/commons");
|
|
11
12
|
var _constants = require("../constants.js");
|
|
12
13
|
function requiresImplementation() {
|
|
13
14
|
for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -47,17 +48,16 @@ function productInfoBlock(_ref, _ref2) {
|
|
|
47
48
|
} = _ref;
|
|
48
49
|
let {
|
|
49
50
|
title,
|
|
50
|
-
snippet,
|
|
51
51
|
description,
|
|
52
52
|
sale_price,
|
|
53
53
|
original_price
|
|
54
54
|
} = _ref2;
|
|
55
55
|
let content = '';
|
|
56
56
|
if (title) {
|
|
57
|
-
content += `<div class="${className}__item-title">${title}</div>`;
|
|
57
|
+
content += `<div class="${className}__item-title">${(0, _commons.escapeHtml)(title)}</div>`;
|
|
58
58
|
}
|
|
59
59
|
if (description) {
|
|
60
|
-
content += `<div class="${className}__item-desc">${description}</div>`;
|
|
60
|
+
content += `<div class="${className}__item-desc">${(0, _commons.escapeHtml)(description)}</div>`;
|
|
61
61
|
}
|
|
62
62
|
const price = sale_price || original_price;
|
|
63
63
|
if (price) {
|
|
@@ -82,7 +82,7 @@ function articleInfoBlock(_ref3, _ref4) {
|
|
|
82
82
|
const date = published_at || created_at || updated_at;
|
|
83
83
|
let content = '';
|
|
84
84
|
if (title) {
|
|
85
|
-
content += `<div class="${className}__item-title">${title}</div>`;
|
|
85
|
+
content += `<div class="${className}__item-title">${(0, _commons.escapeHtml)(title)}</div>`;
|
|
86
86
|
}
|
|
87
87
|
if (date) {
|
|
88
88
|
content += `<div class="${className}__item-date">${renderDate(date, templates.date)}</div>`;
|
|
@@ -90,7 +90,7 @@ function articleInfoBlock(_ref3, _ref4) {
|
|
|
90
90
|
if (snippet) {
|
|
91
91
|
content += `<div class="${className}__item-snippet">${snippet}</div>`;
|
|
92
92
|
} else if (description) {
|
|
93
|
-
content += `<div class="${className}__item-desc">${description}</div>`;
|
|
93
|
+
content += `<div class="${className}__item-desc">${(0, _commons.escapeHtml)(description)}</div>`;
|
|
94
94
|
}
|
|
95
95
|
return `<div class="${className}__item-info-container">${content}</div>`;
|
|
96
96
|
}
|
package/dist/cjs/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineValues } from '@miso.ai/commons';
|
|
1
|
+
import { defineValues, escapeHtml } from '@miso.ai/commons';
|
|
2
2
|
import { LAYOUT_CATEGORY } from '../../constants.js';
|
|
3
3
|
import { fields } from '../../actor/index.js';
|
|
4
4
|
import TemplateBasedLayout from '../template.js';
|
|
@@ -30,7 +30,7 @@ function options(layout, state) {
|
|
|
30
30
|
|
|
31
31
|
function option(layout, value) {
|
|
32
32
|
const { className } = layout;
|
|
33
|
-
const text = value.text || value;
|
|
33
|
+
const text = escapeHtml(value.text || value);
|
|
34
34
|
return `<li class="${className}__option" data-role="option" tabindex="0">${text}</li>`;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { escapeHtml } from '@miso.ai/commons';
|
|
1
2
|
import { LAYOUT_CATEGORY } from '../../constants.js';
|
|
2
3
|
import { fields } from '../../actor/index.js';
|
|
3
4
|
import TemplateBasedLayout from '../template.js';
|
|
@@ -38,7 +39,7 @@ function suggestionList(layout) {
|
|
|
38
39
|
|
|
39
40
|
function suggestionItem(layout, value) {
|
|
40
41
|
const { className } = layout;
|
|
41
|
-
const text = value.text || value;
|
|
42
|
+
const text = escapeHtml(value.text || value);
|
|
42
43
|
return `<li class="${className}__suggestion-item" data-role="suggestion-item" tabindex="0">${text}</li>`;
|
|
43
44
|
}
|
|
44
45
|
|
package/src/layout/templates.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { escapeHtml } from '@miso.ai/commons';
|
|
1
2
|
import { ATTR_DATA_MISO_PRODUCT_ID } from '../constants.js';
|
|
2
3
|
|
|
3
4
|
export function requiresImplementation(...names) {
|
|
@@ -42,13 +43,13 @@ export function article(layout, state, data, meta) {
|
|
|
42
43
|
].join('');
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
function productInfoBlock({ className }, { title,
|
|
46
|
+
function productInfoBlock({ className }, { title, description, sale_price, original_price }) {
|
|
46
47
|
let content = '';
|
|
47
48
|
if (title) {
|
|
48
|
-
content += `<div class="${className}__item-title">${title}</div>`;
|
|
49
|
+
content += `<div class="${className}__item-title">${escapeHtml(title)}</div>`;
|
|
49
50
|
}
|
|
50
51
|
if (description) {
|
|
51
|
-
content += `<div class="${className}__item-desc">${description}</div>`;
|
|
52
|
+
content += `<div class="${className}__item-desc">${escapeHtml(description)}</div>`;
|
|
52
53
|
}
|
|
53
54
|
const price = sale_price || original_price;
|
|
54
55
|
if (price) {
|
|
@@ -62,7 +63,7 @@ function articleInfoBlock({ className, templates }, { title, snippet, descriptio
|
|
|
62
63
|
const date = published_at || created_at || updated_at;
|
|
63
64
|
let content = '';
|
|
64
65
|
if (title) {
|
|
65
|
-
content += `<div class="${className}__item-title">${title}</div>`;
|
|
66
|
+
content += `<div class="${className}__item-title">${escapeHtml(title)}</div>`;
|
|
66
67
|
}
|
|
67
68
|
if (date) {
|
|
68
69
|
content += `<div class="${className}__item-date">${renderDate(date, templates.date)}</div>`;
|
|
@@ -70,7 +71,7 @@ function articleInfoBlock({ className, templates }, { title, snippet, descriptio
|
|
|
70
71
|
if (snippet) {
|
|
71
72
|
content += `<div class="${className}__item-snippet">${snippet}</div>`;
|
|
72
73
|
} else if (description) {
|
|
73
|
-
content += `<div class="${className}__item-desc">${description}</div>`;
|
|
74
|
+
content += `<div class="${className}__item-desc">${escapeHtml(description)}</div>`;
|
|
74
75
|
}
|
|
75
76
|
return `<div class="${className}__item-info-container">${content}</div>`;
|
|
76
77
|
}
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.9.4-beta.
|
|
1
|
+
export default '1.9.4-beta.1';
|