piral-million 0.15.0-beta.4607 → 0.15.0-beta.4630
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/esm/converter.d.ts +1 -6
- package/esm/converter.js +3 -8
- package/esm/converter.js.map +1 -1
- package/esm/extension.d.ts +1 -1
- package/esm/extension.js +2 -10
- package/esm/extension.js.map +1 -1
- package/esm/mount.d.ts +2 -9
- package/esm/mount.js +3 -6
- package/esm/mount.js.map +1 -1
- package/lib/converter.d.ts +1 -6
- package/lib/converter.js +3 -8
- package/lib/converter.js.map +1 -1
- package/lib/extension.d.ts +1 -1
- package/lib/extension.js +4 -12
- package/lib/extension.js.map +1 -1
- package/lib/mount.d.ts +2 -9
- package/lib/mount.js +3 -6
- package/lib/mount.js.map +1 -1
- package/package.json +3 -3
- package/src/converter.ts +4 -15
- package/src/extension.ts +2 -10
- package/src/mount.ts +4 -8
package/esm/converter.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { ForeignComponent, BaseComponentProps } from 'piral-core';
|
|
2
2
|
export interface MillionConverterOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Defines the name of the root element.
|
|
5
|
-
* @default slot
|
|
6
|
-
*/
|
|
7
|
-
rootName?: string;
|
|
8
3
|
}
|
|
9
4
|
export declare function createConverter(config?: MillionConverterOptions): {
|
|
10
5
|
<TProps extends BaseComponentProps>(root: any): ForeignComponent<TProps>;
|
|
11
|
-
Extension: (props: import("piral-core").ExtensionSlotProps<string>) =>
|
|
6
|
+
Extension: (props: import("piral-core").ExtensionSlotProps<string>) => import("million/dist/types-9663cfda").a;
|
|
12
7
|
};
|
package/esm/converter.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { mountMillion, unmountMillion } from './mount';
|
|
2
|
-
import {
|
|
2
|
+
import { Extension } from './extension';
|
|
3
3
|
export function createConverter(config = {}) {
|
|
4
|
-
const { rootName = 'slot' } = config;
|
|
5
|
-
const Extension = createExtension(rootName);
|
|
6
4
|
const convert = (root) => ({
|
|
7
|
-
mount(el, props
|
|
8
|
-
mountMillion(el, root, props
|
|
9
|
-
},
|
|
10
|
-
update(el, props, ctx) {
|
|
11
|
-
mountMillion(el, root, props, ctx);
|
|
5
|
+
mount(el, props) {
|
|
6
|
+
mountMillion(el, root, props);
|
|
12
7
|
},
|
|
13
8
|
unmount(el) {
|
|
14
9
|
unmountMillion(el);
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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/extension.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ExtensionSlotProps } from 'piral-core';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const Extension: (props: ExtensionSlotProps<string>) => import("million/dist/types-9663cfda").a;
|
package/esm/extension.js
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export function createExtension(rootName) {
|
|
4
|
-
return (props) => {
|
|
5
|
-
const { piral } = useContext(piralContext);
|
|
6
|
-
const m = createElement;
|
|
7
|
-
//TODO
|
|
8
|
-
return m(rootName);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
1
|
+
import { m } from 'million';
|
|
2
|
+
export const Extension = (props) => m('piral-extension', props);
|
|
11
3
|
//# sourceMappingURL=extension.js.map
|
package/esm/extension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
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/mount.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { BaseComponentProps
|
|
2
|
-
export declare
|
|
3
|
-
value: any;
|
|
4
|
-
Provider: ({ value }: {
|
|
5
|
-
value: any;
|
|
6
|
-
}) => any;
|
|
7
|
-
Consumer: () => any;
|
|
8
|
-
};
|
|
9
|
-
export declare function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T, ctx: ComponentContext): any;
|
|
1
|
+
import type { BaseComponentProps } from 'piral-core';
|
|
2
|
+
export declare function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T): void;
|
|
10
3
|
export declare function unmountMillion(el: HTMLElement): void;
|
package/esm/mount.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { render, createElement
|
|
2
|
-
export
|
|
3
|
-
export function mountMillion(el, root, props, ctx) {
|
|
4
|
-
const value = Object.assign(Object.assign({}, ctx), { piral: props.piral });
|
|
1
|
+
import { render, createElement } from 'million/react';
|
|
2
|
+
export function mountMillion(el, root, props) {
|
|
5
3
|
const m = createElement;
|
|
6
|
-
const node = m(
|
|
4
|
+
const node = m(root, props);
|
|
7
5
|
render(node, el);
|
|
8
|
-
return node;
|
|
9
6
|
}
|
|
10
7
|
export function unmountMillion(el) {
|
|
11
8
|
render('', el);
|
package/esm/mount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,
|
|
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/converter.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import type { ForeignComponent, BaseComponentProps } from 'piral-core';
|
|
2
2
|
export interface MillionConverterOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Defines the name of the root element.
|
|
5
|
-
* @default slot
|
|
6
|
-
*/
|
|
7
|
-
rootName?: string;
|
|
8
3
|
}
|
|
9
4
|
export declare function createConverter(config?: MillionConverterOptions): {
|
|
10
5
|
<TProps extends BaseComponentProps>(root: any): ForeignComponent<TProps>;
|
|
11
|
-
Extension: (props: import("piral-core").ExtensionSlotProps<string>) =>
|
|
6
|
+
Extension: (props: import("piral-core").ExtensionSlotProps<string>) => import("million/dist/types-9663cfda").a;
|
|
12
7
|
};
|
package/lib/converter.js
CHANGED
|
@@ -4,20 +4,15 @@ exports.createConverter = void 0;
|
|
|
4
4
|
const mount_1 = require("./mount");
|
|
5
5
|
const extension_1 = require("./extension");
|
|
6
6
|
function createConverter(config = {}) {
|
|
7
|
-
const { rootName = 'slot' } = config;
|
|
8
|
-
const Extension = (0, extension_1.createExtension)(rootName);
|
|
9
7
|
const convert = (root) => ({
|
|
10
|
-
mount(el, props
|
|
11
|
-
(0, mount_1.mountMillion)(el, root, props
|
|
12
|
-
},
|
|
13
|
-
update(el, props, ctx) {
|
|
14
|
-
(0, mount_1.mountMillion)(el, root, props, ctx);
|
|
8
|
+
mount(el, props) {
|
|
9
|
+
(0, mount_1.mountMillion)(el, root, props);
|
|
15
10
|
},
|
|
16
11
|
unmount(el) {
|
|
17
12
|
(0, mount_1.unmountMillion)(el);
|
|
18
13
|
},
|
|
19
14
|
});
|
|
20
|
-
convert.Extension = Extension;
|
|
15
|
+
convert.Extension = extension_1.Extension;
|
|
21
16
|
return convert;
|
|
22
17
|
}
|
|
23
18
|
exports.createConverter = createConverter;
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,mCAAuD;AACvD,
|
|
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"}
|
package/lib/extension.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ExtensionSlotProps } from 'piral-core';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const Extension: (props: ExtensionSlotProps<string>) => import("million/dist/types-9663cfda").a;
|
package/lib/extension.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
return (props) => {
|
|
8
|
-
const { piral } = (0, react_1.useContext)(mount_1.piralContext);
|
|
9
|
-
const m = react_1.createElement;
|
|
10
|
-
//TODO
|
|
11
|
-
return m(rootName);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.createExtension = createExtension;
|
|
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;
|
|
15
7
|
//# sourceMappingURL=extension.js.map
|
package/lib/extension.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AACA,
|
|
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"}
|
package/lib/mount.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { BaseComponentProps
|
|
2
|
-
export declare
|
|
3
|
-
value: any;
|
|
4
|
-
Provider: ({ value }: {
|
|
5
|
-
value: any;
|
|
6
|
-
}) => any;
|
|
7
|
-
Consumer: () => any;
|
|
8
|
-
};
|
|
9
|
-
export declare function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T, ctx: ComponentContext): any;
|
|
1
|
+
import type { BaseComponentProps } from 'piral-core';
|
|
2
|
+
export declare function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T): void;
|
|
10
3
|
export declare function unmountMillion(el: HTMLElement): void;
|
package/lib/mount.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.unmountMillion = exports.mountMillion =
|
|
3
|
+
exports.unmountMillion = exports.mountMillion = void 0;
|
|
4
4
|
const react_1 = require("million/react");
|
|
5
|
-
|
|
6
|
-
function mountMillion(el, root, props, ctx) {
|
|
7
|
-
const value = Object.assign(Object.assign({}, ctx), { piral: props.piral });
|
|
5
|
+
function mountMillion(el, root, props) {
|
|
8
6
|
const m = react_1.createElement;
|
|
9
|
-
const node = m(
|
|
7
|
+
const node = m(root, props);
|
|
10
8
|
(0, react_1.render)(node, el);
|
|
11
|
-
return node;
|
|
12
9
|
}
|
|
13
10
|
exports.mountMillion = mountMillion;
|
|
14
11
|
function unmountMillion(el) {
|
package/lib/mount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":";;;AACA,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-million",
|
|
3
|
-
"version": "0.15.0-beta.
|
|
3
|
+
"version": "0.15.0-beta.4630",
|
|
4
4
|
"description": "Plugin for integrating Million components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"million": "^1.12.0",
|
|
68
|
-
"piral-core": "0.15.0-beta.
|
|
68
|
+
"piral-core": "0.15.0-beta.4630"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"million": "^1.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "08aea96af9587e73b1a6c4eb108f94f285186b10"
|
|
74
74
|
}
|
package/src/converter.ts
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import type { ForeignComponent, BaseComponentProps } from 'piral-core';
|
|
2
2
|
import { mountMillion, unmountMillion } from './mount';
|
|
3
|
-
import {
|
|
3
|
+
import { Extension } from './extension';
|
|
4
4
|
|
|
5
|
-
export interface MillionConverterOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Defines the name of the root element.
|
|
8
|
-
* @default slot
|
|
9
|
-
*/
|
|
10
|
-
rootName?: string;
|
|
11
|
-
}
|
|
5
|
+
export interface MillionConverterOptions {}
|
|
12
6
|
|
|
13
7
|
export function createConverter(config: MillionConverterOptions = {}) {
|
|
14
|
-
const { rootName = 'slot' } = config;
|
|
15
|
-
const Extension = createExtension(rootName);
|
|
16
8
|
const convert = <TProps extends BaseComponentProps>(root: any): ForeignComponent<TProps> => ({
|
|
17
|
-
mount(el, props
|
|
18
|
-
mountMillion(el, root, props
|
|
19
|
-
},
|
|
20
|
-
update(el, props, ctx) {
|
|
21
|
-
mountMillion(el, root, props, ctx);
|
|
9
|
+
mount(el, props) {
|
|
10
|
+
mountMillion(el, root, props);
|
|
22
11
|
},
|
|
23
12
|
unmount(el) {
|
|
24
13
|
unmountMillion(el);
|
package/src/extension.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import type { ExtensionSlotProps } from 'piral-core';
|
|
2
|
-
import {
|
|
3
|
-
import { piralContext } from './mount';
|
|
2
|
+
import { m } from 'million';
|
|
4
3
|
|
|
5
|
-
export
|
|
6
|
-
return (props: ExtensionSlotProps) => {
|
|
7
|
-
const { piral } = useContext(piralContext);
|
|
8
|
-
const m = createElement as any;
|
|
9
|
-
//TODO
|
|
10
|
-
return m(rootName);
|
|
11
|
-
};
|
|
12
|
-
}
|
|
4
|
+
export const Extension = (props: ExtensionSlotProps) => m('piral-extension', props);
|
package/src/mount.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import type { BaseComponentProps
|
|
2
|
-
import { render, createElement
|
|
1
|
+
import type { BaseComponentProps } from 'piral-core';
|
|
2
|
+
import { render, createElement } from 'million/react';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
export function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T, ctx: ComponentContext) {
|
|
7
|
-
const value = { ...ctx, piral: props.piral };
|
|
4
|
+
export function mountMillion<T extends BaseComponentProps>(el: HTMLElement, root: any, props: T) {
|
|
8
5
|
const m = createElement as any;
|
|
9
|
-
const node = m(
|
|
6
|
+
const node = m(root, props);
|
|
10
7
|
render(node, el);
|
|
11
|
-
return node;
|
|
12
8
|
}
|
|
13
9
|
|
|
14
10
|
export function unmountMillion(el: HTMLElement) {
|