@oneblink/apps-react 7.2.0 → 7.3.0-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.
@@ -11,7 +11,7 @@ const OptionButton = ({ element, option, isSelected, onClick, className, onBlur,
|
|
11
11
|
}
|
12
12
|
: { height: 'auto' }, disabled: element.readOnly, onClick: onClick, "aria-describedby": props['aria-describedby'], onBlur: onBlur },
|
13
13
|
React.createElement(Box, { display: "flex", flexDirection: "column", className: "ob-options__box", maxWidth: 256 },
|
14
|
-
option.imageUrl && (React.createElement("img", { className: "ob-options__image", src: option.imageUrl,
|
14
|
+
option.imageUrl && (React.createElement("img", { className: "ob-options__image", src: option.imageUrl, "aria-hidden": "true" })),
|
15
15
|
option.label)));
|
16
16
|
};
|
17
17
|
export default React.memo(OptionButton);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"OptionButton.js","sourceRoot":"","sources":["../../src/form-elements/OptionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,gBAAgB,MAAM,2BAA2B,CAAA;AAExD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAcnC,MAAM,YAAY,GAAG,CAAC,EACpB,OAAO,EACP,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACF,EAAE,EAAE;IACV,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAE3D,OAAO,CACL,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,KAAK,EACH,MAAM,CAAC,MAAM,IAAI,UAAU;YACzB,CAAC,CAAC;gBACE,eAAe,EAAE,MAAM,CAAC,MAAM;gBAC9B,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE,MAAM;aACf;YACH,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,E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AS,EAAC,iBAAiB,EAC3B,QAAQ,EAAE,GAAG;YAEZ,MAAM,CAAC,QAAQ,IAAI,CAClB,6BACE,SAAS,EAAC,mBAAmB,EAC7B,GAAG,EAAE,MAAM,CAAC,QAAQ,iBACR,MAAM,GAClB,CACH;YACA,MAAM,CAAC,KAAK,CACT,CACC,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAQ,YAAY,CAAC,CAAA","sourcesContent":["import * as React from 'react'\nimport useContrastColor from '../hooks/useContrastColor'\nimport { FormTypes } from '@oneblink/types'\nimport { Box } from '@mui/material'\n\ntype Props = {\n element:\n | FormTypes.RadioButtonElement\n | FormTypes.CheckboxElement\n | FormTypes.ComplianceElement\n option: FormTypes.ChoiceElementOption\n isSelected: boolean\n onClick: () => void\n className: string\n onBlur?: () => void\n 'aria-describedby'?: string\n}\nconst OptionButton = ({\n element,\n option,\n isSelected,\n onClick,\n className,\n onBlur,\n ...props\n}: Props) => {\n const buttonContrastColor = useContrastColor(option.colour)\n\n return (\n <button\n type=\"button\"\n className={className}\n style={\n option.colour && isSelected\n ? {\n backgroundColor: option.colour,\n color: buttonContrastColor,\n height: 'auto',\n }\n : { height: 'auto' }\n }\n disabled={element.readOnly}\n onClick={onClick}\n aria-describedby={props['aria-describedby']}\n onBlur={onBlur}\n >\n <Box\n display=\"flex\"\n flexDirection=\"column\"\n className=\"ob-options__box\"\n maxWidth={256}\n >\n {option.imageUrl && (\n <img\n className=\"ob-options__image\"\n src={option.imageUrl}\n aria-hidden=\"true\"\n />\n )}\n {option.label}\n </Box>\n </button>\n )\n}\n\nexport default React.memo<Props>(OptionButton)\n"]}
|
@@ -17,5 +17,11 @@ const sanitizeHtmlStandard = (html) => {
|
|
17
17
|
allowedAttributes,
|
18
18
|
});
|
19
19
|
};
|
20
|
+
export const sanitizeCustomCSS = (customCss) => {
|
21
|
+
return sanitizeHtml(customCss, {
|
22
|
+
allowedTags: [],
|
23
|
+
allowedAttributes: {},
|
24
|
+
});
|
25
|
+
};
|
20
26
|
export default sanitizeHtmlStandard;
|
21
27
|
//# sourceMappingURL=sanitize-html.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sanitize-html.js","sourceRoot":"","sources":["../../src/services/sanitize-html.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC,MAAM,WAAW,GAAG;IAClB,GAAG,YAAY,CAAC,QAAQ,CAAC,WAAW;IACpC,GAAG;IACH,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;CACN,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,GAAG,YAAY,CAAC,QAAQ,CAAC,iBAAiB;IAC1C,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,YAAY,CAAC,IAAI,EAAE;QACxB,WAAW;QACX,iBAAiB;KAClB,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA","sourcesContent":["import sanitizeHtml from 'sanitize-html'\n\nconst allowedTags = [\n ...sanitizeHtml.defaults.allowedTags,\n 'u',\n 'span',\n 'h1',\n 'h2',\n 'img',\n]\n\nconst allowedAttributes = {\n ...sanitizeHtml.defaults.allowedAttributes,\n '*': ['style', 'class'],\n}\n\nconst sanitizeHtmlStandard = (html: string) => {\n return sanitizeHtml(html, {\n allowedTags,\n allowedAttributes,\n })\n}\n\nexport default sanitizeHtmlStandard\n"]}
|
1
|
+
{"version":3,"file":"sanitize-html.js","sourceRoot":"","sources":["../../src/services/sanitize-html.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC,MAAM,WAAW,GAAG;IAClB,GAAG,YAAY,CAAC,QAAQ,CAAC,WAAW;IACpC,GAAG;IACH,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;CACN,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,GAAG,YAAY,CAAC,QAAQ,CAAC,iBAAiB;IAC1C,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC;CACxB,CAAA;AAED,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,YAAY,CAAC,IAAI,EAAE;QACxB,WAAW;QACX,iBAAiB;KAClB,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACrD,OAAO,YAAY,CAAC,SAAS,EAAE;QAC7B,WAAW,EAAE,EAAE;QACf,iBAAiB,EAAE,EAAE;KACtB,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA","sourcesContent":["import sanitizeHtml from 'sanitize-html'\n\nconst allowedTags = [\n ...sanitizeHtml.defaults.allowedTags,\n 'u',\n 'span',\n 'h1',\n 'h2',\n 'img',\n]\n\nconst allowedAttributes = {\n ...sanitizeHtml.defaults.allowedAttributes,\n '*': ['style', 'class'],\n}\n\nconst sanitizeHtmlStandard = (html: string) => {\n return sanitizeHtml(html, {\n allowedTags,\n allowedAttributes,\n })\n}\n\nexport const sanitizeCustomCSS = (customCss: string) => {\n return sanitizeHtml(customCss, {\n allowedTags: [],\n allowedAttributes: {},\n })\n}\n\nexport default sanitizeHtmlStandard\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oneblink/apps-react",
|
3
3
|
"description": "Helper functions for OneBlink apps in ReactJS.",
|
4
|
-
"version": "7.
|
4
|
+
"version": "7.3.0-beta.1",
|
5
5
|
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/oneblink/apps-react/issues"
|