@web-widget/vue2 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/vite.cjs +29 -15
- package/dist/vite.js +32 -15
- package/dist/vue2.server.cjs +9 -10
- package/dist/vue2.server.js +9 -10
- package/package.json +1 -1
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 });
|
|
@@ -25,22 +39,22 @@ __export(vite_exports, {
|
|
|
25
39
|
module.exports = __toCommonJS(vite_exports);
|
|
26
40
|
var import_vite = require("@web-widget/vite");
|
|
27
41
|
function vue2WebWidgetPlugin({
|
|
28
|
-
provide
|
|
29
|
-
toWebWidgets = {
|
|
30
|
-
|
|
31
|
-
/\b(routes|widgets).*\.vue(\?.*\.(ts|js))?$/,
|
|
32
|
-
/(\.route|widget).*\.vue(\?.*\.(ts|js))?$/
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
toComponents = {
|
|
36
|
-
include: ["widgets/**/*", "**/*.widget.*"],
|
|
37
|
-
exclude: /.vue\?.*$/,
|
|
38
|
-
includeImporter: /.*\.vue(\?.*\.(ts|js))?$/
|
|
39
|
-
}
|
|
42
|
+
provide,
|
|
43
|
+
toWebWidgets = {},
|
|
44
|
+
toComponents = {}
|
|
40
45
|
} = {}) {
|
|
41
46
|
return (0, import_vite.webWidgetPlugin)({
|
|
42
|
-
provide,
|
|
43
|
-
toWebWidgets
|
|
44
|
-
|
|
47
|
+
provide: provide != null ? provide : "@web-widget/vue2",
|
|
48
|
+
toWebWidgets: __spreadValues({
|
|
49
|
+
include: [
|
|
50
|
+
/\b(routes|widgets).*\.vue(\?.*\.(ts|js))?$/,
|
|
51
|
+
/(\.route|widget).*\.vue(\?.*\.(ts|js))?$/
|
|
52
|
+
]
|
|
53
|
+
}, toWebWidgets),
|
|
54
|
+
toComponents: __spreadValues({
|
|
55
|
+
include: ["widgets/**/*", "**/*.widget.*"],
|
|
56
|
+
exclude: /.vue\?.*$/,
|
|
57
|
+
includeImporter: /.*\.vue(\?.*\.(ts|js))?$/
|
|
58
|
+
}, toComponents)
|
|
45
59
|
});
|
|
46
60
|
}
|
package/dist/vite.js
CHANGED
|
@@ -1,23 +1,40 @@
|
|
|
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 vue2WebWidgetPlugin({
|
|
4
|
-
provide
|
|
5
|
-
toWebWidgets = {
|
|
6
|
-
|
|
7
|
-
/\b(routes|widgets).*\.vue(\?.*\.(ts|js))?$/,
|
|
8
|
-
/(\.route|widget).*\.vue(\?.*\.(ts|js))?$/
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
toComponents = {
|
|
12
|
-
include: ["widgets/**/*", "**/*.widget.*"],
|
|
13
|
-
exclude: /.vue\?.*$/,
|
|
14
|
-
includeImporter: /.*\.vue(\?.*\.(ts|js))?$/
|
|
15
|
-
}
|
|
21
|
+
provide,
|
|
22
|
+
toWebWidgets = {},
|
|
23
|
+
toComponents = {}
|
|
16
24
|
} = {}) {
|
|
17
25
|
return webWidgetPlugin({
|
|
18
|
-
provide,
|
|
19
|
-
toWebWidgets
|
|
20
|
-
|
|
26
|
+
provide: provide != null ? provide : "@web-widget/vue2",
|
|
27
|
+
toWebWidgets: __spreadValues({
|
|
28
|
+
include: [
|
|
29
|
+
/\b(routes|widgets).*\.vue(\?.*\.(ts|js))?$/,
|
|
30
|
+
/(\.route|widget).*\.vue(\?.*\.(ts|js))?$/
|
|
31
|
+
]
|
|
32
|
+
}, toWebWidgets),
|
|
33
|
+
toComponents: __spreadValues({
|
|
34
|
+
include: ["widgets/**/*", "**/*.widget.*"],
|
|
35
|
+
exclude: /.vue\?.*$/,
|
|
36
|
+
includeImporter: /.*\.vue(\?.*\.(ts|js))?$/
|
|
37
|
+
}, toComponents)
|
|
21
38
|
});
|
|
22
39
|
}
|
|
23
40
|
export {
|
package/dist/vue2.server.cjs
CHANGED
|
@@ -214,7 +214,7 @@ var defineVueRender = ({
|
|
|
214
214
|
return (0, import_server_helpers.defineRender)(async (context, component, props) => {
|
|
215
215
|
const shellTag = "web-widget.shell";
|
|
216
216
|
const state = onPrefetchData ? await onPrefetchData(context, component, props) : void 0;
|
|
217
|
-
const mergedProps = state ? Object.assign(state, props) : props;
|
|
217
|
+
const mergedProps = state ? Object.assign({}, state, props) : props;
|
|
218
218
|
const renderer = (0, import_vue_server_renderer.createRenderer)();
|
|
219
219
|
const vNodeData = {
|
|
220
220
|
attrs: {
|
|
@@ -228,16 +228,15 @@ var defineVueRender = ({
|
|
|
228
228
|
const stateStringify = htmlEscapeJsonString(JSON.stringify(state));
|
|
229
229
|
render2 = (h2) => h2(shellTag, shellTagVNodeData, [
|
|
230
230
|
h2(component, vNodeData),
|
|
231
|
-
h2(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
as: "state",
|
|
236
|
-
type: "application/json"
|
|
237
|
-
}
|
|
231
|
+
h2("script", {
|
|
232
|
+
attrs: {
|
|
233
|
+
as: "state",
|
|
234
|
+
type: "application/json"
|
|
238
235
|
},
|
|
239
|
-
|
|
240
|
-
|
|
236
|
+
domProps: {
|
|
237
|
+
innerHTML: stateStringify
|
|
238
|
+
}
|
|
239
|
+
})
|
|
241
240
|
]);
|
|
242
241
|
} else {
|
|
243
242
|
render2 = (h2) => h2(shellTag, shellTagVNodeData, [h2(component, vNodeData)]);
|
package/dist/vue2.server.js
CHANGED
|
@@ -178,7 +178,7 @@ var defineVueRender = ({
|
|
|
178
178
|
return defineRender(async (context, component, props) => {
|
|
179
179
|
const shellTag = "web-widget.shell";
|
|
180
180
|
const state = onPrefetchData ? await onPrefetchData(context, component, props) : void 0;
|
|
181
|
-
const mergedProps = state ? Object.assign(state, props) : props;
|
|
181
|
+
const mergedProps = state ? Object.assign({}, state, props) : props;
|
|
182
182
|
const renderer = createRenderer();
|
|
183
183
|
const vNodeData = {
|
|
184
184
|
attrs: {
|
|
@@ -192,16 +192,15 @@ var defineVueRender = ({
|
|
|
192
192
|
const stateStringify = htmlEscapeJsonString(JSON.stringify(state));
|
|
193
193
|
render2 = (h2) => h2(shellTag, shellTagVNodeData, [
|
|
194
194
|
h2(component, vNodeData),
|
|
195
|
-
h2(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
as: "state",
|
|
200
|
-
type: "application/json"
|
|
201
|
-
}
|
|
195
|
+
h2("script", {
|
|
196
|
+
attrs: {
|
|
197
|
+
as: "state",
|
|
198
|
+
type: "application/json"
|
|
202
199
|
},
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
domProps: {
|
|
201
|
+
innerHTML: stateStringify
|
|
202
|
+
}
|
|
203
|
+
})
|
|
205
204
|
]);
|
|
206
205
|
} else {
|
|
207
206
|
render2 = (h2) => h2(shellTag, shellTagVNodeData, [h2(component, vNodeData)]);
|