@bbl-digital/snorre 4.2.4 → 4.2.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +2 -12
- package/esm/core/Html/index.js +2 -12
- package/lib/core/Html/index.d.ts +2 -6
- package/lib/core/Html/index.d.ts.map +1 -1
- package/lib/core/Html/index.js +2 -12
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
@@ -25030,22 +25030,12 @@
|
|
25030
25030
|
text,
|
25031
25031
|
sanitize = true,
|
25032
25032
|
sanitizeOptions = {
|
25033
|
-
|
25033
|
+
FORBID_ATTR: ['style']
|
25034
25034
|
},
|
25035
25035
|
whiteSpace,
|
25036
25036
|
defaultListStyles
|
25037
25037
|
}) => {
|
25038
|
-
const
|
25039
|
-
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
25040
|
-
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
25041
|
-
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
25042
|
-
const sanitizeOpts = {
|
25043
|
-
ALLOWED_TAGS: allowedTags || undefined,
|
25044
|
-
ALLOWED_ATTR: allowdAttributes || undefined,
|
25045
|
-
FORBID_TAGS: forbiddenTags || undefined,
|
25046
|
-
FORBID_ATTR: forbiddenAttributes || undefined
|
25047
|
-
};
|
25048
|
-
const safeHtml = sanitize ? DOMPurify__default["default"].sanitize(text, sanitizeOpts) : text;
|
25038
|
+
const safeHtml = sanitize ? DOMPurify__default["default"].sanitize(text, sanitizeOptions) : text;
|
25049
25039
|
return jsxRuntime.jsx("div", {
|
25050
25040
|
css: theme => [styles$l.default(theme), secondary && styles$l.secondary(theme), dark && styles$l.dark(theme), size && styles$l.size(size), styles$l.whiteSpace(whiteSpace ? whiteSpace : 'pre-wrap'), removeMargins && styles$l.removeMargins, defaultListStyles && styles$l.defaultListStyles],
|
25051
25041
|
className: className || '',
|
package/esm/core/Html/index.js
CHANGED
@@ -13,22 +13,12 @@ const Html = ({
|
|
13
13
|
text,
|
14
14
|
sanitize = true,
|
15
15
|
sanitizeOptions = {
|
16
|
-
|
16
|
+
FORBID_ATTR: ['style']
|
17
17
|
},
|
18
18
|
whiteSpace,
|
19
19
|
defaultListStyles
|
20
20
|
}) => {
|
21
|
-
const
|
22
|
-
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
23
|
-
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
24
|
-
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
25
|
-
const sanitizeOpts = {
|
26
|
-
ALLOWED_TAGS: allowedTags || undefined,
|
27
|
-
ALLOWED_ATTR: allowdAttributes || undefined,
|
28
|
-
FORBID_TAGS: forbiddenTags || undefined,
|
29
|
-
FORBID_ATTR: forbiddenAttributes || undefined
|
30
|
-
};
|
31
|
-
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOpts) : text;
|
21
|
+
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOptions) : text;
|
32
22
|
return _jsx("div", {
|
33
23
|
css: theme => [styles.default(theme), secondary && styles.secondary(theme), dark && styles.dark(theme), size && styles.size(size), styles.whiteSpace(whiteSpace ? whiteSpace : 'pre-wrap'), removeMargins && styles.removeMargins, defaultListStyles && styles.defaultListStyles],
|
34
24
|
className: className || '',
|
package/lib/core/Html/index.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import DOMPurify from 'dompurify';
|
1
2
|
import 'quill/dist/quill.snow.css';
|
2
3
|
interface IProps {
|
3
4
|
/** Html to be displayed. */
|
@@ -20,12 +21,7 @@ interface IProps {
|
|
20
21
|
defaultListStyles?: boolean;
|
21
22
|
/** Optionally sanitize before render. E.g. if you want to remove styles */
|
22
23
|
sanitize?: boolean;
|
23
|
-
sanitizeOptions?:
|
24
|
-
allowedTags?: string[];
|
25
|
-
allowedAttributes?: string[];
|
26
|
-
forbiddenTags?: string[];
|
27
|
-
forbiddenAttributes?: string[];
|
28
|
-
};
|
24
|
+
sanitizeOptions?: DOMPurify.Config;
|
29
25
|
}
|
30
26
|
declare const Html: ({ className, dark, externalLinks, removeMargins, secondary, size, text, sanitize, sanitizeOptions, whiteSpace, defaultListStyles, }: IProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
31
27
|
export default Html;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Html/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Html/index.tsx"],"names":[],"mappings":"AAEA,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,2BAA2B,CAAA;AAElC,UAAU,MAAM;IACd,4BAA4B;IAC5B,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,SAAS,CAAC,MAAM,CAAA;CACnC;AAED,QAAA,MAAM,IAAI,wIAcP,MAAM,qDAsBR,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/lib/core/Html/index.js
CHANGED
@@ -13,22 +13,12 @@ const Html = ({
|
|
13
13
|
text,
|
14
14
|
sanitize = true,
|
15
15
|
sanitizeOptions = {
|
16
|
-
|
16
|
+
FORBID_ATTR: ['style']
|
17
17
|
},
|
18
18
|
whiteSpace,
|
19
19
|
defaultListStyles
|
20
20
|
}) => {
|
21
|
-
const
|
22
|
-
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
23
|
-
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
24
|
-
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
25
|
-
const sanitizeOpts = {
|
26
|
-
ALLOWED_TAGS: allowedTags || undefined,
|
27
|
-
ALLOWED_ATTR: allowdAttributes || undefined,
|
28
|
-
FORBID_TAGS: forbiddenTags || undefined,
|
29
|
-
FORBID_ATTR: forbiddenAttributes || undefined
|
30
|
-
};
|
31
|
-
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOpts) : text;
|
21
|
+
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOptions) : text;
|
32
22
|
return _jsx("div", {
|
33
23
|
css: theme => [styles.default(theme), secondary && styles.secondary(theme), dark && styles.dark(theme), size && styles.size(size), styles.whiteSpace(whiteSpace ? whiteSpace : 'pre-wrap'), removeMargins && styles.removeMargins, defaultListStyles && styles.defaultListStyles],
|
34
24
|
className: className || '',
|