piral-million 1.6.0-beta.7216 → 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;
package/convert.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createConverter } from './esm/converter';
1
+ import { createConverter } from './lib/converter';
2
2
  export function createMillionConverter() {
3
3
  var params = [];
4
4
  for (var _i = 0; _i < arguments.length; _i++) {
package/lib/converter.js CHANGED
@@ -1,19 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createConverter = void 0;
4
- const mount_1 = require("./mount");
5
- const extension_1 = require("./extension");
6
- function createConverter(config = {}) {
1
+ import { mountMillion, unmountMillion } from './mount';
2
+ import { Extension } from './extension';
3
+ export function createConverter(config = {}) {
7
4
  const convert = (root) => ({
8
5
  mount(el, props) {
9
- (0, mount_1.mountMillion)(el, root, props);
6
+ mountMillion(el, root, props);
10
7
  },
11
8
  unmount(el) {
12
- (0, mount_1.unmountMillion)(el);
9
+ unmountMillion(el);
13
10
  },
14
11
  });
15
- convert.Extension = extension_1.Extension;
12
+ convert.Extension = Extension;
16
13
  return convert;
17
14
  }
18
- exports.createConverter = createConverter;
19
15
  //# sourceMappingURL=converter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,mCAAuD;AACvD,2CAAwC;AAIxC,SAAgB,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,OAAO,GAAG,CAAoC,IAAS,EAA4B,EAAE,CAAC,CAAC;QAC3F,KAAK,CAAC,EAAE,EAAE,KAAK;YACb,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,CAAC,EAAE;YACR,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,qBAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAXD,0CAWC"}
1
+ {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,UAAU,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,OAAO,GAAG,CAAoC,IAAS,EAA4B,EAAE,CAAC,CAAC;QAC3F,KAAK,CAAC,EAAE,EAAE,KAAK;YACb,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,CAAC,EAAE;YACR,cAAc,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,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.createMillionApi = void 0;
4
- const converter_1 = require("./converter");
1
+ import { createConverter } from './converter';
5
2
  /**
6
3
  * Creates new Pilet API extensions for integrating Million.
7
4
  */
8
- function createMillionApi(config = {}) {
5
+ export function createMillionApi(config = {}) {
9
6
  return (context) => {
10
- const convert = (0, converter_1.createConverter)(config);
7
+ const convert = createConverter(config);
11
8
  context.converters.million = ({ root }) => convert(root);
12
9
  return {
13
10
  fromMillion(root) {
@@ -20,5 +17,4 @@ function createMillionApi(config = {}) {
20
17
  };
21
18
  };
22
19
  }
23
- exports.createMillionApi = createMillionApi;
24
20
  //# 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,2CAAuE;AAQvE;;GAEG;AACH,SAAgB,gBAAgB,CAAC,SAAwB,EAAE;IACzD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,IAAA,2BAAe,EAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO;YACL,WAAW,CAAC,IAAI;gBACd,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,gBAAgB,EAAE,OAAO,CAAC,SAAS;SACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAfD,4CAeC"}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAA2B,MAAM,aAAa,CAAC;AAQvE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAwB,EAAE;IACzD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO;YACL,WAAW,CAAC,IAAI;gBACd,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,gBAAgB,EAAE,OAAO,CAAC,SAAS;SACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
package/lib/extension.js CHANGED
@@ -1,7 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Extension = void 0;
4
- const million_1 = require("million");
5
- const Extension = (props) => (0, million_1.m)('piral-extension', props);
6
- exports.Extension = Extension;
1
+ import { m } from 'million';
2
+ export const Extension = (props) => m('piral-extension', props);
7
3
  //# sourceMappingURL=extension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AACA,qCAA4B;AAErB,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,IAAA,WAAC,EAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAAvE,QAAA,SAAS,aAA8D"}
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,KAAK,CAAC,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,15 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unmountMillion = exports.mountMillion = void 0;
4
- const react_1 = require("million/react");
5
- function mountMillion(el, root, props) {
6
- const m = react_1.createElement;
1
+ import { render, createElement } from 'million/react';
2
+ export function mountMillion(el, root, props) {
3
+ const m = createElement;
7
4
  const node = m(root, props);
8
- (0, react_1.render)(node, el);
5
+ render(node, el);
9
6
  }
10
- exports.mountMillion = mountMillion;
11
- function unmountMillion(el) {
12
- (0, react_1.render)('', el);
7
+ export function unmountMillion(el) {
8
+ render('', el);
13
9
  }
14
- exports.unmountMillion = unmountMillion;
15
10
  //# 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,yCAAsD;AAEtD,SAAgB,YAAY,CAA+B,EAAe,EAAE,IAAS,EAAE,KAAQ;IAC7F,MAAM,CAAC,GAAG,qBAAoB,CAAC;IAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,IAAA,cAAM,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC;AAJD,oCAIC;AAED,SAAgB,cAAc,CAAC,EAAe;IAC5C,IAAA,cAAM,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACjB,CAAC;AAFD,wCAEC"}
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,YAAY,CAA+B,EAAe,EAAE,IAAS,EAAE,KAAQ;IAC7F,MAAM,CAAC,GAAG,aAAoB,CAAC;IAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAe;IAC5C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACjB,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-million",
3
- "version": "1.6.0-beta.7216",
3
+ "version": "1.6.0-beta.7243",
4
4
  "description": "Plugin for integrating Million components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -16,32 +16,17 @@
16
16
  "author": "smapiot",
17
17
  "homepage": "https://piral.io",
18
18
  "license": "MIT",
19
- "module": "esm/index.js",
19
+ "module": "lib/index.js",
20
20
  "main": "lib/index.js",
21
21
  "typings": "lib/index.d.ts",
22
22
  "exports": {
23
- ".": {
24
- "import": "./esm/index.js",
25
- "require": "./lib/index.js"
26
- },
27
- "./convert": {
28
- "import": "./convert.js"
29
- },
30
- "./esm/*": {
31
- "import": "./esm/*"
32
- },
33
- "./lib/*": {
34
- "require": "./lib/*"
35
- },
36
- "./_/*": {
37
- "import": "./esm/*.js",
38
- "require": "./lib/*.js"
39
- },
23
+ ".": "./lib/index.js",
24
+ "./convert": "./convert.js",
25
+ "./lib/*": "./lib/*",
40
26
  "./package.json": "./package.json"
41
27
  },
42
28
  "sideEffects": false,
43
29
  "files": [
44
- "esm",
45
30
  "lib",
46
31
  "src",
47
32
  "convert.d.ts",
@@ -56,16 +41,15 @@
56
41
  },
57
42
  "scripts": {
58
43
  "cleanup": "rimraf esm lib convert.d.ts convert.js",
59
- "build": "yarn build:commonjs && yarn build:esnext && yarn build:convert",
44
+ "build": "yarn build:esnext && yarn build:convert",
60
45
  "build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
61
- "build:commonjs": "tsc --project tsconfig.json --outDir lib --module commonjs",
62
- "build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
46
+ "build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
63
47
  "typedoc": "typedoc --json ../../../docs/types/piral-million.json src --exclude \"src/**/*.test.*\"",
64
48
  "test": "echo \"Error: run tests from root\" && exit 1"
65
49
  },
66
50
  "devDependencies": {
67
51
  "million": "^1.12.0",
68
- "piral-core": "1.6.0-beta.7216"
52
+ "piral-core": "1.6.0-beta.7243"
69
53
  },
70
- "gitHead": "bd3742af68fc25af93ed9b37021d2d69a6f40f18"
54
+ "gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
71
55
  }
@@ -1,7 +0,0 @@
1
- import type { ForeignComponent, BaseComponentProps } from 'piral-core';
2
- export interface MillionConverterOptions {
3
- }
4
- export declare function createConverter(config?: MillionConverterOptions): {
5
- <TProps extends BaseComponentProps>(root: any): ForeignComponent<TProps>;
6
- Extension: (props: import("piral-core").ExtensionSlotProps) => import("million/dist/types-9663cfda").a;
7
- };
package/esm/converter.js DELETED
@@ -1,15 +0,0 @@
1
- import { mountMillion, unmountMillion } from './mount';
2
- import { Extension } from './extension';
3
- export function createConverter(config = {}) {
4
- const convert = (root) => ({
5
- mount(el, props) {
6
- mountMillion(el, root, props);
7
- },
8
- unmount(el) {
9
- unmountMillion(el);
10
- },
11
- });
12
- convert.Extension = Extension;
13
- return convert;
14
- }
15
- //# sourceMappingURL=converter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,MAAM,UAAU,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,OAAO,GAAG,CAAoC,IAAS,EAA4B,EAAE,CAAC,CAAC;QAC3F,KAAK,CAAC,EAAE,EAAE,KAAK;YACb,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,CAAC,EAAE;YACR,cAAc,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/esm/create.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { PiralPlugin } from 'piral-core';
2
- import { MillionConverterOptions } from './converter';
3
- import type { PiletMillionApi } from './types';
4
- /**
5
- * Available configuration options for the Million plugin.
6
- */
7
- export interface MillionConfig extends MillionConverterOptions {
8
- }
9
- /**
10
- * Creates new Pilet API extensions for integrating Million.
11
- */
12
- export declare function createMillionApi(config?: MillionConfig): PiralPlugin<PiletMillionApi>;
package/esm/create.js DELETED
@@ -1,20 +0,0 @@
1
- import { createConverter } from './converter';
2
- /**
3
- * Creates new Pilet API extensions for integrating Million.
4
- */
5
- export function createMillionApi(config = {}) {
6
- return (context) => {
7
- const convert = createConverter(config);
8
- context.converters.million = ({ root }) => convert(root);
9
- return {
10
- fromMillion(root) {
11
- return {
12
- type: 'million',
13
- root,
14
- };
15
- },
16
- MillionExtension: convert.Extension,
17
- };
18
- };
19
- }
20
- //# 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,EAA2B,MAAM,aAAa,CAAC;AAQvE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAwB,EAAE;IACzD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO;YACL,WAAW,CAAC,IAAI;gBACd,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,gBAAgB,EAAE,OAAO,CAAC,SAAS;SACpC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { ExtensionSlotProps } from 'piral-core';
2
- export declare const Extension: (props: ExtensionSlotProps) => import("million/dist/types-9663cfda").a;
package/esm/extension.js DELETED
@@ -1,3 +0,0 @@
1
- import { m } from 'million';
2
- export const Extension = (props) => m('piral-extension', props);
3
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,iBAAiB,EAAE,KAAK,CAAC,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 } from 'piral-core';
2
- export declare function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T): void;
3
- export declare function unmountMillion(el: HTMLElement): void;
package/esm/mount.js DELETED
@@ -1,10 +0,0 @@
1
- import { render, createElement } from 'million/react';
2
- export function mountMillion(el, root, props) {
3
- const m = createElement;
4
- const node = m(root, props);
5
- render(node, el);
6
- }
7
- export function unmountMillion(el) {
8
- render('', el);
9
- }
10
- //# 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,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,YAAY,CAA+B,EAAe,EAAE,IAAS,EAAE,KAAQ;IAC7F,MAAM,CAAC,GAAG,aAAoB,CAAC;IAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAe;IAC5C,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AACjB,CAAC"}
package/esm/types.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import type { VNode } from 'million';
2
- import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
3
- declare module 'piral-core/lib/types/custom' {
4
- interface PiletCustomApi extends PiletMillionApi {
5
- }
6
- interface PiralCustomComponentConverters<TProps> {
7
- million(component: MillionComponent<TProps>): ForeignComponent<TProps>;
8
- }
9
- }
10
- export interface MillionComponent<TProps> {
11
- /**
12
- * The component root.
13
- */
14
- root: (props: TProps) => VNode;
15
- /**
16
- * The type of the Million component.
17
- */
18
- type: 'million';
19
- }
20
- /**
21
- * Defines the provided set of Million Pilet API extensions.
22
- */
23
- export interface PiletMillionApi {
24
- /**
25
- * Wraps an Million component for use in Piral.
26
- * @param component The component root.
27
- * @returns The Piral Million component.
28
- */
29
- fromMillion<TProps>(component: (props: TProps) => VNode): MillionComponent<TProps>;
30
- /**
31
- * Million component for displaying extensions of the given name.
32
- */
33
- MillionExtension: (props: ExtensionSlotProps) => VNode;
34
- }
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":""}