piral-vue-3 1.5.4-beta.7014 → 1.5.4-beta.7016
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/convert.d.ts +2 -2
- package/esm/converter.d.ts +1 -1
- package/esm/converter.js +6 -4
- package/esm/converter.js.map +1 -1
- package/lib/converter.d.ts +1 -1
- package/lib/converter.js +6 -4
- package/lib/converter.js.map +1 -1
- package/package.json +3 -3
- package/src/converter.ts +6 -4
package/convert.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface Vue3Converter {
|
|
|
13
13
|
export declare function createVue3Converter(...params: Parameters<typeof createConverter>): {
|
|
14
14
|
from: Vue3Converter;
|
|
15
15
|
Extension: Component<any>;
|
|
16
|
-
defineMiddleware: (
|
|
16
|
+
defineMiddleware: (middleware: import("./esm/types").Vue3MiddlewareHandler) => void;
|
|
17
17
|
};
|
|
18
|
-
declare const fromVue3: Vue3Converter, Vue3Extension: Component<any>, defineVue3Middleware: (
|
|
18
|
+
declare const fromVue3: Vue3Converter, Vue3Extension: Component<any>, defineVue3Middleware: (middleware: import("./esm/types").Vue3MiddlewareHandler) => void;
|
|
19
19
|
export { fromVue3, Vue3Extension, defineVue3Middleware };
|
package/esm/converter.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export interface Vue3ConverterOptions {
|
|
|
16
16
|
export declare function createConverter(config?: Vue3ConverterOptions): {
|
|
17
17
|
<TProps extends BaseComponentProps>(root: Component<TProps>, captured?: Record<string, any>): ForeignComponent<TProps>;
|
|
18
18
|
Extension: Component<import("piral-core").ExtensionSlotProps>;
|
|
19
|
-
defineMiddleware(
|
|
19
|
+
defineMiddleware(middleware: Vue3MiddlewareHandler): void;
|
|
20
20
|
};
|
package/esm/converter.js
CHANGED
|
@@ -3,12 +3,12 @@ import { mountVue } from './mount';
|
|
|
3
3
|
export function createConverter(config = {}) {
|
|
4
4
|
const { rootName = 'piral-slot', selector = 'extension-component' } = config;
|
|
5
5
|
const Extension = createExtension(rootName);
|
|
6
|
-
|
|
6
|
+
const middlewares = [];
|
|
7
7
|
const convert = (root, captured) => ({
|
|
8
8
|
mount(parent, data, ctx, locals) {
|
|
9
9
|
const el = parent.appendChild(document.createElement(rootName));
|
|
10
10
|
const app = mountVue(root, data, ctx, captured);
|
|
11
|
-
middleware(app);
|
|
11
|
+
middlewares.forEach((middleware) => middleware(app));
|
|
12
12
|
app.component(selector, createExtension(rootName));
|
|
13
13
|
app.mount(el);
|
|
14
14
|
!app._props && (app._props = {});
|
|
@@ -26,8 +26,10 @@ export function createConverter(config = {}) {
|
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
convert.Extension = Extension;
|
|
29
|
-
convert.defineMiddleware = (
|
|
30
|
-
middleware
|
|
29
|
+
convert.defineMiddleware = (middleware) => {
|
|
30
|
+
if (!middlewares.includes(middleware)) {
|
|
31
|
+
middlewares.push(middleware);
|
|
32
|
+
}
|
|
31
33
|
};
|
|
32
34
|
return convert;
|
|
33
35
|
}
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoBnC,MAAM,UAAU,eAAe,CAAC,SAA+B,EAAE;IAC/D,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,GAAG,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAC7E,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoBnC,MAAM,UAAU,e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AAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,gBAAgB,GAAG,CAAC,UAAiC,EAAE,EAAE;QAC/D,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACrC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/lib/converter.d.ts
CHANGED
|
@@ -16,5 +16,5 @@ export interface Vue3ConverterOptions {
|
|
|
16
16
|
export declare function createConverter(config?: Vue3ConverterOptions): {
|
|
17
17
|
<TProps extends BaseComponentProps>(root: Component<TProps>, captured?: Record<string, any>): ForeignComponent<TProps>;
|
|
18
18
|
Extension: Component<import("piral-core").ExtensionSlotProps>;
|
|
19
|
-
defineMiddleware(
|
|
19
|
+
defineMiddleware(middleware: Vue3MiddlewareHandler): void;
|
|
20
20
|
};
|
package/lib/converter.js
CHANGED
|
@@ -6,12 +6,12 @@ const mount_1 = require("./mount");
|
|
|
6
6
|
function createConverter(config = {}) {
|
|
7
7
|
const { rootName = 'piral-slot', selector = 'extension-component' } = config;
|
|
8
8
|
const Extension = (0, extension_1.createExtension)(rootName);
|
|
9
|
-
|
|
9
|
+
const middlewares = [];
|
|
10
10
|
const convert = (root, captured) => ({
|
|
11
11
|
mount(parent, data, ctx, locals) {
|
|
12
12
|
const el = parent.appendChild(document.createElement(rootName));
|
|
13
13
|
const app = (0, mount_1.mountVue)(root, data, ctx, captured);
|
|
14
|
-
middleware(app);
|
|
14
|
+
middlewares.forEach((middleware) => middleware(app));
|
|
15
15
|
app.component(selector, (0, extension_1.createExtension)(rootName));
|
|
16
16
|
app.mount(el);
|
|
17
17
|
!app._props && (app._props = {});
|
|
@@ -29,8 +29,10 @@ function createConverter(config = {}) {
|
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
convert.Extension = Extension;
|
|
32
|
-
convert.defineMiddleware = (
|
|
33
|
-
middleware
|
|
32
|
+
convert.defineMiddleware = (middleware) => {
|
|
33
|
+
if (!middlewares.includes(middleware)) {
|
|
34
|
+
middlewares.push(middleware);
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
return convert;
|
|
36
38
|
}
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,2CAA8C;AAC9C,mCAAmC;AAoBnC,SAAgB,eAAe,CAAC,SAA+B,EAAE;IAC/D,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,GAAG,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAC7E,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,2CAA8C;AAC9C,mCAAmC;AAoBnC,SAAgB,eAAe,CAAC,SAA+B,EAAE;IAC/D,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,GAAG,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAC7E,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAiC,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,QAA8B,EACJ,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAiB;YACxC,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAChE,MAAM,GAAG,GAAG,IAAA,gBAAQ,EAAC,IAAI,EAAE,IAAI,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
+
"version": "1.5.4-beta.7016",
|
|
4
4
|
"description": "Plugin for integrating Vue@3 components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"piral-core": "1.5.4-beta.
|
|
72
|
+
"piral-core": "1.5.4-beta.7016",
|
|
73
73
|
"vue": "^3.0.0"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "73ac21bd0f3495c0a706f8dce2f75e925777e12a"
|
|
76
76
|
}
|
package/src/converter.ts
CHANGED
|
@@ -24,7 +24,7 @@ interface Vue3State {
|
|
|
24
24
|
export function createConverter(config: Vue3ConverterOptions = {}) {
|
|
25
25
|
const { rootName = 'piral-slot', selector = 'extension-component' } = config;
|
|
26
26
|
const Extension = createExtension(rootName);
|
|
27
|
-
|
|
27
|
+
const middlewares: Array<Vue3MiddlewareHandler> = [];
|
|
28
28
|
const convert = <TProps extends BaseComponentProps>(
|
|
29
29
|
root: Component<TProps>,
|
|
30
30
|
captured?: Record<string, any>,
|
|
@@ -32,7 +32,7 @@ export function createConverter(config: Vue3ConverterOptions = {}) {
|
|
|
32
32
|
mount(parent, data, ctx, locals: Vue3State) {
|
|
33
33
|
const el = parent.appendChild(document.createElement(rootName));
|
|
34
34
|
const app = mountVue(root, data, ctx, captured);
|
|
35
|
-
middleware(app);
|
|
35
|
+
middlewares.forEach((middleware) => middleware(app));
|
|
36
36
|
app.component(selector, createExtension(rootName));
|
|
37
37
|
app.mount(el);
|
|
38
38
|
!app._props && (app._props = {});
|
|
@@ -50,8 +50,10 @@ export function createConverter(config: Vue3ConverterOptions = {}) {
|
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
52
|
convert.Extension = Extension;
|
|
53
|
-
convert.defineMiddleware = (
|
|
54
|
-
middleware
|
|
53
|
+
convert.defineMiddleware = (middleware: Vue3MiddlewareHandler) => {
|
|
54
|
+
if (!middlewares.includes(middleware)) {
|
|
55
|
+
middlewares.push(middleware);
|
|
56
|
+
}
|
|
55
57
|
};
|
|
56
58
|
return convert;
|
|
57
59
|
}
|