piral-blazor 1.3.0-beta.6062 → 1.3.0-beta.6065
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/esm/interop.js +5 -5
- package/lib/interop.js +5 -5
- package/package.json +3 -3
- package/src/interop.ts +5 -5
package/esm/interop.js
CHANGED
|
@@ -108,7 +108,7 @@ function addScript(url) {
|
|
|
108
108
|
document.body.appendChild(script);
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function sanitize(props) {
|
|
112
112
|
// children is a complex thing and will (in general) not be serializable
|
|
113
113
|
// hence we need to make the JSObjectReference
|
|
114
114
|
if ('children' in props && typeof props.children === 'object') {
|
|
@@ -124,19 +124,19 @@ export function setLogLevel(logLevel) {
|
|
|
124
124
|
return window.DotNet.invokeMethodAsync(coreLib, 'SetLogLevel', logLevel);
|
|
125
125
|
}
|
|
126
126
|
export function createElement(moduleName, props) {
|
|
127
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName,
|
|
127
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName, sanitize(props));
|
|
128
128
|
}
|
|
129
129
|
export function updateElement(referenceId, props) {
|
|
130
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId,
|
|
130
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId, sanitize(props));
|
|
131
131
|
}
|
|
132
132
|
export function destroyElement(referenceId) {
|
|
133
133
|
return window.DotNet.invokeMethodAsync(coreLib, 'DestroyElement', referenceId);
|
|
134
134
|
}
|
|
135
135
|
export function activate(moduleName, props) {
|
|
136
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName,
|
|
136
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName, sanitize(props));
|
|
137
137
|
}
|
|
138
138
|
export function reactivate(moduleName, referenceId, props) {
|
|
139
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId,
|
|
139
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId, sanitize(props)).catch(() => {
|
|
140
140
|
// Apparently an older version of Piral.Blazor, which does not support this
|
|
141
141
|
// discard this error silently (in the future we may print warnings here)
|
|
142
142
|
});
|
package/lib/interop.js
CHANGED
|
@@ -111,7 +111,7 @@ function addScript(url) {
|
|
|
111
111
|
document.body.appendChild(script);
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function sanitize(props) {
|
|
115
115
|
// children is a complex thing and will (in general) not be serializable
|
|
116
116
|
// hence we need to make the JSObjectReference
|
|
117
117
|
if ('children' in props && typeof props.children === 'object') {
|
|
@@ -129,11 +129,11 @@ function setLogLevel(logLevel) {
|
|
|
129
129
|
}
|
|
130
130
|
exports.setLogLevel = setLogLevel;
|
|
131
131
|
function createElement(moduleName, props) {
|
|
132
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName,
|
|
132
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName, sanitize(props));
|
|
133
133
|
}
|
|
134
134
|
exports.createElement = createElement;
|
|
135
135
|
function updateElement(referenceId, props) {
|
|
136
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId,
|
|
136
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId, sanitize(props));
|
|
137
137
|
}
|
|
138
138
|
exports.updateElement = updateElement;
|
|
139
139
|
function destroyElement(referenceId) {
|
|
@@ -141,11 +141,11 @@ function destroyElement(referenceId) {
|
|
|
141
141
|
}
|
|
142
142
|
exports.destroyElement = destroyElement;
|
|
143
143
|
function activate(moduleName, props) {
|
|
144
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName,
|
|
144
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName, sanitize(props));
|
|
145
145
|
}
|
|
146
146
|
exports.activate = activate;
|
|
147
147
|
function reactivate(moduleName, referenceId, props) {
|
|
148
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId,
|
|
148
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId, sanitize(props)).catch(() => {
|
|
149
149
|
// Apparently an older version of Piral.Blazor, which does not support this
|
|
150
150
|
// discard this error silently (in the future we may print warnings here)
|
|
151
151
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-blazor",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.6065",
|
|
4
4
|
"description": "Plugin for integrating Blazor components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"piral-core": "1.3.0-beta.
|
|
70
|
+
"piral-core": "1.3.0-beta.6065"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "ea6dd40ac290211f17e7b615e02714bceff2a02b"
|
|
73
73
|
}
|
package/src/interop.ts
CHANGED
|
@@ -138,7 +138,7 @@ function addScript(url: string) {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function
|
|
141
|
+
function sanitize(props: any) {
|
|
142
142
|
// children is a complex thing and will (in general) not be serializable
|
|
143
143
|
// hence we need to make the JSObjectReference
|
|
144
144
|
if ('children' in props && typeof props.children === 'object') {
|
|
@@ -161,11 +161,11 @@ export function setLogLevel(logLevel: BlazorLogLevel) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export function createElement(moduleName: string, props: any): Promise<string> {
|
|
164
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName,
|
|
164
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'CreateElement', moduleName, sanitize(props));
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export function updateElement(referenceId: string, props: any): Promise<string> {
|
|
168
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId,
|
|
168
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'UpdateElement', referenceId, sanitize(props));
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
export function destroyElement(referenceId: string): Promise<string> {
|
|
@@ -173,11 +173,11 @@ export function destroyElement(referenceId: string): Promise<string> {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export function activate(moduleName: string, props: any): Promise<string> {
|
|
176
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName,
|
|
176
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Activate', moduleName, sanitize(props));
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
export function reactivate(moduleName: string, referenceId: string, props: any): Promise<void> {
|
|
180
|
-
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId,
|
|
180
|
+
return window.DotNet.invokeMethodAsync(coreLib, 'Reactivate', moduleName, referenceId, sanitize(props)).catch(() => {
|
|
181
181
|
// Apparently an older version of Piral.Blazor, which does not support this
|
|
182
182
|
// discard this error silently (in the future we may print warnings here)
|
|
183
183
|
});
|