@web-widget/react 0.1.0 → 0.2.0
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/react.server.js +1 -1
- package/dist/vite.cjs +29 -15
- package/dist/vite.js +32 -15
- package/package.json +1 -1
package/dist/react.server.js
CHANGED
|
@@ -123,7 +123,7 @@ var defineReactRender = ({
|
|
|
123
123
|
} = {}) => {
|
|
124
124
|
return defineRender(async (context, component, props) => {
|
|
125
125
|
const state = onPrefetchData ? await onPrefetchData(context, component, props) : void 0;
|
|
126
|
-
const mergedProps = state ? Object.assign(state, props) : props;
|
|
126
|
+
const mergedProps = state ? Object.assign({}, state, props) : props;
|
|
127
127
|
let vNode;
|
|
128
128
|
if (typeof component === "function" && component.constructor.name === "AsyncFunction") {
|
|
129
129
|
vNode = await component(mergedProps);
|
package/dist/vite.cjs
CHANGED
|
@@ -2,7 +2,21 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
6
20
|
var __export = (target, all) => {
|
|
7
21
|
for (var name in all)
|
|
8
22
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -26,22 +40,22 @@ module.exports = __toCommonJS(vite_exports);
|
|
|
26
40
|
var import_vite = require("@web-widget/vite");
|
|
27
41
|
function reactWebWidgetPlugin({
|
|
28
42
|
provide = "@web-widget/react",
|
|
29
|
-
toWebWidgets = {
|
|
30
|
-
|
|
31
|
-
"routes/**/*.tsx",
|
|
32
|
-
"widgets/**/*.tsx",
|
|
33
|
-
"**/*.route.tsx",
|
|
34
|
-
"**/*.widget.tsx"
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
toComponents = {
|
|
38
|
-
include: ["widgets/**/*", "*.widget.*"],
|
|
39
|
-
includeImporter: ["**/*.tsx"]
|
|
40
|
-
}
|
|
43
|
+
toWebWidgets = {},
|
|
44
|
+
toComponents = {}
|
|
41
45
|
} = {}) {
|
|
42
46
|
return (0, import_vite.webWidgetPlugin)({
|
|
43
|
-
provide,
|
|
44
|
-
toWebWidgets
|
|
45
|
-
|
|
47
|
+
provide: provide != null ? provide : provide,
|
|
48
|
+
toWebWidgets: __spreadValues({
|
|
49
|
+
include: [
|
|
50
|
+
"routes/**/*.tsx",
|
|
51
|
+
"widgets/**/*.tsx",
|
|
52
|
+
"**/*.route.tsx",
|
|
53
|
+
"**/*.widget.tsx"
|
|
54
|
+
]
|
|
55
|
+
}, toWebWidgets),
|
|
56
|
+
toComponents: __spreadValues({
|
|
57
|
+
include: ["widgets/**/*", "*.widget.*"],
|
|
58
|
+
includeImporter: ["**/*.tsx"]
|
|
59
|
+
}, toComponents)
|
|
46
60
|
});
|
|
47
61
|
}
|
package/dist/vite.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
1
18
|
// src/vite.ts
|
|
2
19
|
import { webWidgetPlugin } from "@web-widget/vite";
|
|
3
20
|
function reactWebWidgetPlugin({
|
|
4
21
|
provide = "@web-widget/react",
|
|
5
|
-
toWebWidgets = {
|
|
6
|
-
|
|
7
|
-
"routes/**/*.tsx",
|
|
8
|
-
"widgets/**/*.tsx",
|
|
9
|
-
"**/*.route.tsx",
|
|
10
|
-
"**/*.widget.tsx"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
toComponents = {
|
|
14
|
-
include: ["widgets/**/*", "*.widget.*"],
|
|
15
|
-
includeImporter: ["**/*.tsx"]
|
|
16
|
-
}
|
|
22
|
+
toWebWidgets = {},
|
|
23
|
+
toComponents = {}
|
|
17
24
|
} = {}) {
|
|
18
25
|
return webWidgetPlugin({
|
|
19
|
-
provide,
|
|
20
|
-
toWebWidgets
|
|
21
|
-
|
|
26
|
+
provide: provide != null ? provide : provide,
|
|
27
|
+
toWebWidgets: __spreadValues({
|
|
28
|
+
include: [
|
|
29
|
+
"routes/**/*.tsx",
|
|
30
|
+
"widgets/**/*.tsx",
|
|
31
|
+
"**/*.route.tsx",
|
|
32
|
+
"**/*.widget.tsx"
|
|
33
|
+
]
|
|
34
|
+
}, toWebWidgets),
|
|
35
|
+
toComponents: __spreadValues({
|
|
36
|
+
include: ["widgets/**/*", "*.widget.*"],
|
|
37
|
+
includeImporter: ["**/*.tsx"]
|
|
38
|
+
}, toComponents)
|
|
22
39
|
});
|
|
23
40
|
}
|
|
24
41
|
export {
|