piral-vue-3 1.6.0-beta.7240 → 1.6.0-beta.7243

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { createConverter } from './esm/converter';
1
+ import { createConverter } from './lib/converter';
2
2
  export interface HtmlComponent<TProps> {
3
3
  component: {
4
4
  mount(element: HTMLElement, props: TProps, ctx: any, locals: any): void;
@@ -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: (middleware: import("./esm/types").Vue3MiddlewareHandler) => void;
16
+ defineMiddleware: (middleware: import("./lib/types").Vue3MiddlewareHandler) => void;
17
17
  };
18
- declare const fromVue3: Vue3Converter, Vue3Extension: Component<any>, defineVue3Middleware: (middleware: import("./esm/types").Vue3MiddlewareHandler) => void;
18
+ declare const fromVue3: Vue3Converter, Vue3Extension: Component<any>, defineVue3Middleware: (middleware: import("./lib/types").Vue3MiddlewareHandler) => void;
19
19
  export { fromVue3, Vue3Extension, defineVue3Middleware };
package/convert.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createConverter } from './esm/converter';
1
+ import { createConverter } from './lib/converter';
2
2
  export function createVue3Converter() {
3
3
  var params = [];
4
4
  for (var _i = 0; _i < arguments.length; _i++) {
package/lib/converter.js CHANGED
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createConverter = void 0;
4
- const extension_1 = require("./extension");
5
- const mount_1 = require("./mount");
6
- function createConverter(config = {}) {
1
+ import { createExtension } from './extension';
2
+ import { mountVue } from './mount';
3
+ export function createConverter(config = {}) {
7
4
  const { rootName = 'piral-slot', selector = 'extension-component' } = config;
8
- const Extension = (0, extension_1.createExtension)(rootName);
5
+ const Extension = createExtension(rootName);
9
6
  const middlewares = [];
10
7
  const convert = (root, captured) => ({
11
8
  mount(parent, data, ctx, locals) {
12
9
  const el = parent.appendChild(document.createElement(rootName));
13
- const app = (0, mount_1.mountVue)(root, data, ctx, captured);
10
+ const app = mountVue(root, data, ctx, captured);
14
11
  middlewares.forEach((middleware) => middleware(app));
15
- app.component(selector, (0, extension_1.createExtension)(rootName));
12
+ app.component(selector, createExtension(rootName));
16
13
  app.mount(el);
17
14
  !app._props && (app._props = {});
18
15
  locals.instance = app;
@@ -36,5 +33,4 @@ function createConverter(config = {}) {
36
33
  };
37
34
  return convert;
38
35
  }
39
- exports.createConverter = createConverter;
40
36
  //# sourceMappingURL=converter.js.map
@@ -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,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,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAA,2BAAe,EAAC,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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/create.js CHANGED
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createVue3Api = void 0;
4
- const converter_1 = require("./converter");
1
+ import { createConverter } from './converter';
5
2
  /**
6
3
  * Creates new Pilet API extensions for integration of Vue@3.
7
4
  */
8
- function createVue3Api(config = {}) {
5
+ export function createVue3Api(config = {}) {
9
6
  return (context) => {
10
- const convert = (0, converter_1.createConverter)(config);
7
+ const convert = createConverter(config);
11
8
  context.converters.vue3 = ({ root, captured }) => convert(root, captured);
12
9
  return {
13
10
  fromVue3(root, captured) {
@@ -22,5 +19,4 @@ function createVue3Api(config = {}) {
22
19
  };
23
20
  };
24
21
  }
25
- exports.createVue3Api = createVue3Api;
26
22
  //# sourceMappingURL=create.js.map
package/lib/create.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":";;;AACA,2CAAoE;AAQpE;;GAEG;AACH,SAAgB,aAAa,CAAC,SAAqB,EAAE;IACnD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,IAAA,2BAAe,EAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE1E,OAAO;YACL,QAAQ,CAAC,IAAI,EAAE,QAAQ;gBACrB,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI;oBACJ,QAAQ;iBACT,CAAC;YACJ,CAAC;YACD,aAAa,EAAE,OAAO,CAAC,SAAS;YAChC,oBAAoB,EAAE,OAAO,CAAC,gBAAgB;SAC/C,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAjBD,sCAiBC"}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAQpE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,SAAqB,EAAE;IACnD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE1E,OAAO;YACL,QAAQ,CAAC,IAAI,EAAE,QAAQ;gBACrB,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI;oBACJ,QAAQ;iBACT,CAAC;YACJ,CAAC;YACD,aAAa,EAAE,OAAO,CAAC,SAAS;YAChC,oBAAoB,EAAE,OAAO,CAAC,gBAAgB;SAC/C,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
package/lib/extension.js CHANGED
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createExtension = void 0;
4
- const vue_1 = require("vue");
5
- function createExtension(rootName) {
1
+ import { h } from 'vue';
2
+ export function createExtension(rootName) {
6
3
  const Vue3Extension = {
7
4
  functional: false,
8
5
  props: ['name', 'empty', 'render', 'params'],
9
6
  inject: ['piral'],
10
7
  render() {
11
- return (0, vue_1.h)(rootName);
8
+ return h(rootName);
12
9
  },
13
10
  watch: {
14
11
  params(newValue, oldValue) {
@@ -50,5 +47,4 @@ function createExtension(rootName) {
50
47
  };
51
48
  return Vue3Extension;
52
49
  }
53
- exports.createExtension = createExtension;
54
50
  //# sourceMappingURL=extension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AACA,6BAAmC;AAEnC,SAAgB,eAAe,CAAC,QAAgB;IAC9C,MAAM,aAAa,GAAkC;QACnD,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;QAC5C,MAAM,EAAE,CAAC,OAAO,CAAC;QACjB,MAAM;YACJ,OAAO,IAAA,OAAC,EAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QACD,KAAK,EAAE;YACL,MAAM,CAAC,QAAQ,EAAE,QAAQ;gBACvB,IAAI,QAAQ,KAAK,QAAQ,EAAE;oBACzB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACtC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAEtC,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;wBACrC,IAAI,OAAO,GAAG,KAAK,CAAC;wBAEpB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;4BACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,EAAE;gCAC7D,OAAO,GAAG,IAAI,CAAC;gCACf,MAAM;6BACP;yBACF;wBAED,IAAI,CAAC,OAAO,EAAE;4BACZ,OAAO;yBACR;qBACF;oBAED,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,yBAAyB,EAAE;wBACpD,MAAM,EAAE;4BACN,KAAK,EAAE,IAAI,CAAC,KAAK;4BACjB,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,IAAI,EAAE,IAAI,CAAC,I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,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,EAAE;gCAC7D,OAAO,GAAG,IAAI,CAAC;gCACf,MAAM;6BACP;yBACF;wBAED,IAAI,CAAC,OAAO,EAAE;4BACZ,OAAO;yBACR;qBACF;oBAED,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,yBAAyB,EAAE;wBACpD,MAAM,EAAE;4BACN,KAAK,EAAE,IAAI,CAAC,KAAK;4BACjB,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,IAAI,EAAE,IAAI,CAAC,IAAI;yBAChB;qBACF,CAAC,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;iBAC5B;YACH,CAAC;SACF;QACD,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC"}
package/lib/index.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./create"), exports);
5
- tslib_1.__exportStar(require("./types"), exports);
1
+ export * from './create';
2
+ export * from './types';
6
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,kDAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/lib/mount.js CHANGED
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mountVue = void 0;
4
- const vue_1 = require("vue");
5
- function mountVue(root, props, ctx, captured) {
6
- return (0, vue_1.createApp)({
1
+ import { createApp, h } from 'vue';
2
+ export function mountVue(root, props, ctx, captured) {
3
+ return createApp({
7
4
  provide: {
8
5
  piral: props.piral,
9
6
  ...ctx,
10
7
  },
11
8
  render() {
12
- return (0, vue_1.h)(root, {
9
+ return h(root, {
13
10
  ...captured,
14
11
  ...props,
15
12
  });
16
13
  },
17
14
  });
18
15
  }
19
- exports.mountVue = mountVue;
20
16
  //# sourceMappingURL=mount.js.map
package/lib/mount.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":";;;AACA,6BAA8C;AAE9C,SAAgB,QAAQ,CACtB,IAAkB,EAClB,KAAQ,EACR,GAAqB,EACrB,QAA8B;IAE9B,OAAO,IAAA,eAAS,EAAC;QACf,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,GAAG;SACP;QACD,MAAM;YACJ,OAAO,IAAA,OAAC,EAAC,IAAW,EAAE;gBACpB,GAAG,QAAQ;gBACX,GAAG,KAAK;aACT,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAlBD,4BAkBC"}
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,CAAC,EAAE,MAAM,KAAK,CAAC;AAE9C,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,KAAQ,EACR,GAAqB,EACrB,QAA8B;IAE9B,OAAO,SAAS,CAAC;QACf,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,GAAG;SACP;QACD,MAAM;YACJ,OAAO,CAAC,CAAC,IAAW,EAAE;gBACpB,GAAG,QAAQ;gBACX,GAAG,KAAK;aACT,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
package/lib/types.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-vue-3",
3
- "version": "1.6.0-beta.7240",
3
+ "version": "1.6.0-beta.7243",
4
4
  "description": "Plugin for integrating Vue@3 components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -17,35 +17,18 @@
17
17
  "author": "smapiot",
18
18
  "homepage": "https://piral.io",
19
19
  "license": "MIT",
20
- "module": "esm/index.js",
20
+ "module": "lib/index.js",
21
21
  "main": "lib/index.js",
22
22
  "typings": "lib/index.d.ts",
23
23
  "exports": {
24
- ".": {
25
- "import": "./esm/index.js",
26
- "require": "./lib/index.js"
27
- },
28
- "./convert": {
29
- "import": "./convert.js"
30
- },
31
- "./extend-webpack": {
32
- "require": "./extend-webpack.js"
33
- },
34
- "./esm/*": {
35
- "import": "./esm/*"
36
- },
37
- "./lib/*": {
38
- "require": "./lib/*"
39
- },
40
- "./_/*": {
41
- "import": "./esm/*.js",
42
- "require": "./lib/*.js"
43
- },
24
+ ".": "./lib/index.js",
25
+ "./lib/*": "./lib/*",
26
+ "./convert": "./convert.js",
27
+ "./extend-webpack": "./extend-webpack.js",
44
28
  "./package.json": "./package.json"
45
29
  },
46
30
  "sideEffects": false,
47
31
  "files": [
48
- "esm",
49
32
  "lib",
50
33
  "src",
51
34
  "convert.d.ts",
@@ -61,16 +44,15 @@
61
44
  },
62
45
  "scripts": {
63
46
  "cleanup": "rimraf esm lib convert.d.ts convert.js",
64
- "build": "yarn build:commonjs && yarn build:esnext && yarn build:convert",
47
+ "build": "yarn build:esnext && yarn build:convert",
65
48
  "build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
66
- "build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
67
- "build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
49
+ "build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
68
50
  "typedoc": "typedoc --json ../../../docs/types/piral-vue-3.json src --exclude \"src/**/*.test.*\"",
69
51
  "test": "echo \"Error: run tests from root\" && exit 1"
70
52
  },
71
53
  "devDependencies": {
72
- "piral-core": "1.6.0-beta.7240",
54
+ "piral-core": "1.6.0-beta.7243",
73
55
  "vue": "^3.0.0"
74
56
  },
75
- "gitHead": "2fd8ff47d9a7e0666e4e6bc1dc5a7ef45e8e9f39"
57
+ "gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
76
58
  }
@@ -1,20 +0,0 @@
1
- import type { ForeignComponent, BaseComponentProps } from 'piral-core';
2
- import { Component } from 'vue';
3
- import { Vue3MiddlewareHandler } from './types';
4
- export interface Vue3ConverterOptions {
5
- /**
6
- * Defines the name of the extension component.
7
- * @default extension-component
8
- */
9
- selector?: string;
10
- /**
11
- * Defines the name of the root element.
12
- * @default piral-slot
13
- */
14
- rootName?: string;
15
- }
16
- export declare function createConverter(config?: Vue3ConverterOptions): {
17
- <TProps extends BaseComponentProps>(root: Component<TProps>, captured?: Record<string, any>): ForeignComponent<TProps>;
18
- Extension: Component<import("piral-core").ExtensionSlotProps>;
19
- defineMiddleware(middleware: Vue3MiddlewareHandler): void;
20
- };
package/esm/converter.js DELETED
@@ -1,36 +0,0 @@
1
- import { createExtension } from './extension';
2
- import { mountVue } from './mount';
3
- export function createConverter(config = {}) {
4
- const { rootName = 'piral-slot', selector = 'extension-component' } = config;
5
- const Extension = createExtension(rootName);
6
- const middlewares = [];
7
- const convert = (root, captured) => ({
8
- mount(parent, data, ctx, locals) {
9
- const el = parent.appendChild(document.createElement(rootName));
10
- const app = mountVue(root, data, ctx, captured);
11
- middlewares.forEach((middleware) => middleware(app));
12
- app.component(selector, createExtension(rootName));
13
- app.mount(el);
14
- !app._props && (app._props = {});
15
- locals.instance = app;
16
- },
17
- update(parent, data, ctx, locals) {
18
- for (const prop in data) {
19
- locals.instance._props[prop] = data[prop];
20
- }
21
- },
22
- unmount(parent, locals) {
23
- locals.instance.unmount();
24
- parent.innerHTML = '';
25
- locals.instance = undefined;
26
- },
27
- });
28
- convert.Extension = Extension;
29
- convert.defineMiddleware = (middleware) => {
30
- if (!middlewares.includes(middleware)) {
31
- middlewares.push(middleware);
32
- }
33
- };
34
- return convert;
35
- }
36
- //# sourceMappingURL=converter.js.map
@@ -1 +0,0 @@
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,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,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;YAChD,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;YACrD,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnD,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACd,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC;QACxB,CAAC;QACD,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAiB;YACzC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;gBACvB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;aAC3C;QACH,CAAC;QACD,OAAO,CAAC,MAAM,EAAE,MAAiB;YAC/B,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YAC1B,MAAM,CAAC,SAAS,GAAG,EAAE,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/esm/create.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { PiralPlugin } from 'piral-core';
2
- import { Vue3ConverterOptions } from './converter';
3
- import type { PiletVue3Api } from './types';
4
- /**
5
- * Available configuration options for the Vue@3 plugin.
6
- */
7
- export interface Vue3Config extends Vue3ConverterOptions {
8
- }
9
- /**
10
- * Creates new Pilet API extensions for integration of Vue@3.
11
- */
12
- export declare function createVue3Api(config?: Vue3Config): PiralPlugin<PiletVue3Api>;
package/esm/create.js DELETED
@@ -1,22 +0,0 @@
1
- import { createConverter } from './converter';
2
- /**
3
- * Creates new Pilet API extensions for integration of Vue@3.
4
- */
5
- export function createVue3Api(config = {}) {
6
- return (context) => {
7
- const convert = createConverter(config);
8
- context.converters.vue3 = ({ root, captured }) => convert(root, captured);
9
- return {
10
- fromVue3(root, captured) {
11
- return {
12
- type: 'vue3',
13
- root,
14
- captured,
15
- };
16
- },
17
- Vue3Extension: convert.Extension,
18
- defineVue3Middleware: convert.defineMiddleware,
19
- };
20
- };
21
- }
22
- //# sourceMappingURL=create.js.map
package/esm/create.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAQpE;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,SAAqB,EAAE;IACnD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAE1E,OAAO;YACL,QAAQ,CAAC,IAAI,EAAE,QAAQ;gBACrB,OAAO;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI;oBACJ,QAAQ;iBACT,CAAC;YACJ,CAAC;YACD,aAAa,EAAE,OAAO,CAAC,SAAS;YAChC,oBAAoB,EAAE,OAAO,CAAC,gBAAgB;SAC/C,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ExtensionSlotProps } from 'piral-core';
2
- import { Component } from 'vue';
3
- export declare function createExtension(rootName: string): Component<ExtensionSlotProps>;
package/esm/extension.js DELETED
@@ -1,50 +0,0 @@
1
- import { h } from 'vue';
2
- export function createExtension(rootName) {
3
- const Vue3Extension = {
4
- functional: false,
5
- props: ['name', 'empty', 'render', 'params'],
6
- inject: ['piral'],
7
- render() {
8
- return h(rootName);
9
- },
10
- watch: {
11
- params(newValue, oldValue) {
12
- if (newValue !== oldValue) {
13
- const newKeys = Object.keys(newValue);
14
- const oldKeys = Object.keys(oldValue);
15
- if (newKeys.length === oldKeys.length) {
16
- let changed = false;
17
- for (const key of newKeys) {
18
- if (!oldKeys.includes(key) || newValue[key] !== oldValue[key]) {
19
- changed = true;
20
- break;
21
- }
22
- }
23
- if (!changed) {
24
- return;
25
- }
26
- }
27
- const ev = new CustomEvent('extension-props-changed', {
28
- detail: {
29
- empty: this.empty,
30
- params: newValue,
31
- render: this.render,
32
- name: this.name,
33
- },
34
- });
35
- this.$el.dispatchEvent(ev);
36
- }
37
- },
38
- },
39
- mounted() {
40
- this.piral.renderHtmlExtension(this.$el, {
41
- empty: this.empty,
42
- params: this.params,
43
- render: this.render,
44
- name: this.name,
45
- });
46
- },
47
- };
48
- return Vue3Extension;
49
- }
50
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,CAAC,EAAE,MAAM,KAAK,CAAC;AAEnC,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,MAAM,aAAa,GAAkC;QACnD,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;QAC5C,MAAM,EAAE,CAAC,OAAO,CAAC;QACjB,MAAM;YACJ,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC;QACrB,CAAC;QACD,KAAK,EAAE;YACL,MAAM,CAAC,QAAQ,EAAE,QAAQ;gBACvB,IAAI,QAAQ,KAAK,QAAQ,EAAE;oBACzB,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACtC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBAEtC,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;wBACrC,IAAI,OAAO,GAAG,KAAK,CAAC;wBAEpB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;4BACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,GAAG,CAAC,EAAE;gCAC7D,OAAO,GAAG,IAAI,CAAC;gCACf,MAAM;6BACP;yBACF;wBAED,IAAI,CAAC,OAAO,EAAE;4BACZ,OAAO;yBACR;qBACF;oBAED,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,yBAAyB,EAAE;wBACpD,MAAM,EAAE;4BACN,KAAK,EAAE,IAAI,CAAC,KAAK;4BACjB,MAAM,EAAE,QAAQ;4BAChB,MAAM,EAAE,IAAI,CAAC,MAAM;4BACnB,IAAI,EAAE,IAAI,CAAC,IAAI;yBAChB;qBACF,CAAC,CAAC;oBACH,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;iBAC5B;YACH,CAAC;SACF;QACD,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC"}
package/esm/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './create';
2
- export * from './types';
package/esm/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from './create';
2
- export * from './types';
3
- //# sourceMappingURL=index.js.map
package/esm/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
package/esm/mount.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { BaseComponentProps, ComponentContext } from 'piral-core';
2
- import { Component } from 'vue';
3
- export declare function mountVue<T extends BaseComponentProps>(root: Component<T>, props: T, ctx: ComponentContext, captured?: Record<string, any>): import("vue").App<Element>;
package/esm/mount.js DELETED
@@ -1,16 +0,0 @@
1
- import { createApp, h } from 'vue';
2
- export function mountVue(root, props, ctx, captured) {
3
- return createApp({
4
- provide: {
5
- piral: props.piral,
6
- ...ctx,
7
- },
8
- render() {
9
- return h(root, {
10
- ...captured,
11
- ...props,
12
- });
13
- },
14
- });
15
- }
16
- //# sourceMappingURL=mount.js.map
package/esm/mount.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,CAAC,EAAE,MAAM,KAAK,CAAC;AAE9C,MAAM,UAAU,QAAQ,CACtB,IAAkB,EAClB,KAAQ,EACR,GAAqB,EACrB,QAA8B;IAE9B,OAAO,SAAS,CAAC;QACf,OAAO,EAAE;YACP,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,GAAG;SACP;QACD,MAAM;YACJ,OAAO,CAAC,CAAC,IAAW,EAAE;gBACpB,GAAG,QAAQ;gBACX,GAAG,KAAK;aACT,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
package/esm/types.d.ts DELETED
@@ -1,52 +0,0 @@
1
- import type { App, Component } from 'vue';
2
- import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
3
- declare module 'piral-core/lib/types/custom' {
4
- interface PiletCustomApi extends PiletVue3Api {
5
- }
6
- interface PiralCustomComponentConverters<TProps> {
7
- vue3(component: Vue3Component<TProps>): ForeignComponent<TProps>;
8
- }
9
- }
10
- /**
11
- * Defines a handler to set up Vue 3 middleware.
12
- */
13
- export interface Vue3MiddlewareHandler {
14
- /**
15
- * Receives the app instance to integrate middleware.
16
- */
17
- (app: App<Element>): void;
18
- }
19
- export interface Vue3Component<TProps> {
20
- /**
21
- * The root component of Vue rendering tree.
22
- */
23
- root: Component<TProps>;
24
- /**
25
- * The type of the Vue component.
26
- */
27
- type: 'vue3';
28
- /**
29
- * Captures props for transport into the Vue component.
30
- */
31
- captured?: Record<string, any>;
32
- }
33
- /**
34
- * Defines the provided set of Vue Pilet API extensions.
35
- */
36
- export interface PiletVue3Api {
37
- /**
38
- * Wraps a Vue component for use in Piral.
39
- * @param component The root component.
40
- * @param captured The optionally captured props.
41
- * @returns The Piral Vue component.
42
- */
43
- fromVue3<TProps>(component: Component<TProps>, captured?: Record<string, any>): Vue3Component<TProps>;
44
- /**
45
- * Vue component for displaying extensions of the given name.
46
- */
47
- Vue3Extension: Component<ExtensionSlotProps>;
48
- /**
49
- * Function to use for declaring a callback to setup additional middleware.
50
- */
51
- defineVue3Middleware(setup: Vue3MiddlewareHandler): void;
52
- }
package/esm/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/esm/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}