@ukic/canary-react 3.0.0-canary.47 → 3.0.0-canary.49
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.
|
@@ -6,5 +6,5 @@ interface StencilReactInternalProps<ElementType> extends React.HTMLAttributes<El
|
|
|
6
6
|
forwardedRef: React.RefObject<ElementType>;
|
|
7
7
|
ref?: React.Ref<any>;
|
|
8
8
|
}
|
|
9
|
-
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType =
|
|
9
|
+
export declare const createReactComponent: <PropType, ElementType extends HTMLStencilElement, ContextStateType = object, ExpandedPropsTypes = object>(tagName: string, ReactComponentContext?: React.Context<ContextStateType>, manipulatePropsFunction?: (originalProps: StencilReactInternalProps<ElementType>, propsToPass: any) => ExpandedPropsTypes, defineCustomElement?: () => void) => React.ForwardRefExoticComponent<React.PropsWithoutRef<PropType & Omit<React.HTMLAttributes<ElementType>, "style"> & import("./interfaces").StyleReactProps> & React.RefAttributes<ElementType>>;
|
|
10
10
|
export {};
|
|
@@ -36,7 +36,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
36
36
|
return t;
|
|
37
37
|
};
|
|
38
38
|
import React, { createElement } from 'react';
|
|
39
|
-
import { attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
39
|
+
import { UNSAFE_PROPS, attachProps, camelToDashCase, createForwardRef, dashToPascalCase, isCoveredByReact, mergeRefs } from './utils';
|
|
40
40
|
export var createReactComponent = function (tagName, ReactComponentContext, manipulatePropsFunction, defineCustomElement) {
|
|
41
41
|
if (defineCustomElement !== undefined) {
|
|
42
42
|
defineCustomElement();
|
|
@@ -67,7 +67,7 @@ export var createReactComponent = function (tagName, ReactComponentContext, mani
|
|
|
67
67
|
acc[name] = value;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
else {
|
|
70
|
+
else if (!UNSAFE_PROPS.has(name) && !/^on/i.test(name)) {
|
|
71
71
|
// we should only render strings, booleans, and numbers as attrs in html.
|
|
72
72
|
// objects, functions, arrays etc get synced via properties on mount.
|
|
73
73
|
var type = typeof value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { camelToDashCase } from './case';
|
|
2
|
+
export var UNSAFE_PROPS = new Set(['innerHTML', 'outerHTML', 'innerText', 'outerText', 'srcdoc', 'srcDoc']);
|
|
2
3
|
export var attachProps = function (node, newProps, oldProps) {
|
|
3
4
|
if (oldProps === void 0) { oldProps = {}; }
|
|
4
5
|
// some test frameworks don't render DOM elements, so we test here to make sure we are dealing with DOM first
|
|
@@ -25,6 +26,10 @@ export var attachProps = function (node, newProps, oldProps) {
|
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
29
|
+
// Block HTML sinks and inline-handler attributes that bypass React's guards
|
|
30
|
+
if (UNSAFE_PROPS.has(name) || /^on/i.test(name)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
28
33
|
node[name] = newProps[name];
|
|
29
34
|
var propType = typeof newProps[name];
|
|
30
35
|
if (propType === 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukic/canary-react",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.49",
|
|
4
4
|
"description": "React-wrapped web components compiled using StencilJS",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/mi6/ic-ui-kit/issues",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"tsc": "tsc -p ."
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@ukic/canary-web-components": "^3.0.0-canary.
|
|
43
|
-
"@ukic/react": "^3.31.
|
|
44
|
-
"@ukic/web-components": "^3.31.
|
|
42
|
+
"@ukic/canary-web-components": "^3.0.0-canary.49",
|
|
43
|
+
"@ukic/react": "^3.31.2",
|
|
44
|
+
"@ukic/web-components": "^3.31.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@babel/core": "^7.16.0",
|
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
"tmp": "0.2.7",
|
|
89
89
|
"esbuild": "0.28.1",
|
|
90
90
|
"qs": "6.16.0",
|
|
91
|
-
"fast-uri": "3.1.
|
|
91
|
+
"fast-uri": "3.1.8",
|
|
92
|
+
"source-map-js": "1.2.2"
|
|
92
93
|
},
|
|
93
94
|
"packageManager": "^npm@10.9.2"
|
|
94
95
|
}
|