@bbl-digital/snorre 4.2.2 → 4.2.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/bundle.js +10 -4
- package/esm/core/Html/index.js +10 -4
- package/lib/core/Html/index.d.ts +2 -0
- package/lib/core/Html/index.d.ts.map +1 -1
- package/lib/core/Html/index.js +10 -4
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -25028,16 +25028,22 @@
|
|
|
25028
25028
|
secondary,
|
|
25029
25029
|
size,
|
|
25030
25030
|
text,
|
|
25031
|
-
sanitize,
|
|
25032
|
-
sanitizeOptions
|
|
25031
|
+
sanitize = true,
|
|
25032
|
+
sanitizeOptions = {
|
|
25033
|
+
forbiddenAttributes: ['style']
|
|
25034
|
+
},
|
|
25033
25035
|
whiteSpace,
|
|
25034
25036
|
defaultListStyles
|
|
25035
25037
|
}) => {
|
|
25036
25038
|
const allowedTags = sanitizeOptions?.allowedTags || [];
|
|
25037
25039
|
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
|
25040
|
+
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
|
25041
|
+
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
|
25038
25042
|
const sanitizeOpts = {
|
|
25039
|
-
ALLOWED_TAGS: allowedTags,
|
|
25040
|
-
ALLOWED_ATTR: allowdAttributes
|
|
25043
|
+
ALLOWED_TAGS: allowedTags || undefined,
|
|
25044
|
+
ALLOWED_ATTR: allowdAttributes || undefined,
|
|
25045
|
+
FORBID_TAGS: forbiddenTags || undefined,
|
|
25046
|
+
FORBID_ATTR: forbiddenAttributes || undefined
|
|
25041
25047
|
};
|
|
25042
25048
|
const safeHtml = sanitize ? DOMPurify__default["default"].sanitize(text, sanitizeOpts) : text;
|
|
25043
25049
|
return jsxRuntime.jsx("div", {
|
package/esm/core/Html/index.js
CHANGED
|
@@ -11,16 +11,22 @@ const Html = ({
|
|
|
11
11
|
secondary,
|
|
12
12
|
size,
|
|
13
13
|
text,
|
|
14
|
-
sanitize,
|
|
15
|
-
sanitizeOptions
|
|
14
|
+
sanitize = true,
|
|
15
|
+
sanitizeOptions = {
|
|
16
|
+
forbiddenAttributes: ['style']
|
|
17
|
+
},
|
|
16
18
|
whiteSpace,
|
|
17
19
|
defaultListStyles
|
|
18
20
|
}) => {
|
|
19
21
|
const allowedTags = sanitizeOptions?.allowedTags || [];
|
|
20
22
|
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
|
23
|
+
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
|
24
|
+
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
|
21
25
|
const sanitizeOpts = {
|
|
22
|
-
ALLOWED_TAGS: allowedTags,
|
|
23
|
-
ALLOWED_ATTR: allowdAttributes
|
|
26
|
+
ALLOWED_TAGS: allowedTags || undefined,
|
|
27
|
+
ALLOWED_ATTR: allowdAttributes || undefined,
|
|
28
|
+
FORBID_TAGS: forbiddenTags || undefined,
|
|
29
|
+
FORBID_ATTR: forbiddenAttributes || undefined
|
|
24
30
|
};
|
|
25
31
|
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOpts) : text;
|
|
26
32
|
return _jsx("div", {
|
package/lib/core/Html/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ interface IProps {
|
|
|
23
23
|
sanitizeOptions?: {
|
|
24
24
|
allowedTags?: string[];
|
|
25
25
|
allowedAttributes?: string[];
|
|
26
|
+
forbiddenTags?: string[];
|
|
27
|
+
forbiddenAttributes?: string[];
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
declare const Html: ({ className, dark, externalLinks, removeMargins, secondary, size, text, sanitize, sanitizeOptions, whiteSpace, defaultListStyles, }: IProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Html/index.tsx"],"names":[],"mappings":"AAGA,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;QAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;QACtB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Html/index.tsx"],"names":[],"mappings":"AAGA,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;QAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;QACtB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;QAC5B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;QACxB,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;KAC/B,CAAA;CACF;AAED,QAAA,MAAM,IAAI,wIAcP,MAAM,qDAgCR,CAAA;AAED,eAAe,IAAI,CAAA"}
|
package/lib/core/Html/index.js
CHANGED
|
@@ -11,16 +11,22 @@ const Html = ({
|
|
|
11
11
|
secondary,
|
|
12
12
|
size,
|
|
13
13
|
text,
|
|
14
|
-
sanitize,
|
|
15
|
-
sanitizeOptions
|
|
14
|
+
sanitize = true,
|
|
15
|
+
sanitizeOptions = {
|
|
16
|
+
forbiddenAttributes: ['style']
|
|
17
|
+
},
|
|
16
18
|
whiteSpace,
|
|
17
19
|
defaultListStyles
|
|
18
20
|
}) => {
|
|
19
21
|
const allowedTags = sanitizeOptions?.allowedTags || [];
|
|
20
22
|
const allowdAttributes = sanitizeOptions?.allowedAttributes || [];
|
|
23
|
+
const forbiddenTags = sanitizeOptions?.forbiddenTags || [];
|
|
24
|
+
const forbiddenAttributes = sanitizeOptions?.forbiddenAttributes || [];
|
|
21
25
|
const sanitizeOpts = {
|
|
22
|
-
ALLOWED_TAGS: allowedTags,
|
|
23
|
-
ALLOWED_ATTR: allowdAttributes
|
|
26
|
+
ALLOWED_TAGS: allowedTags || undefined,
|
|
27
|
+
ALLOWED_ATTR: allowdAttributes || undefined,
|
|
28
|
+
FORBID_TAGS: forbiddenTags || undefined,
|
|
29
|
+
FORBID_ATTR: forbiddenAttributes || undefined
|
|
24
30
|
};
|
|
25
31
|
const safeHtml = sanitize ? DOMPurify.sanitize(text, sanitizeOpts) : text;
|
|
26
32
|
return _jsx("div", {
|