piral-react-15 0.15.0-alpha.3804 → 0.15.0-alpha.3905
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/README.md +1 -1
- package/esm/converter.js +11 -13
- package/esm/converter.js.map +1 -1
- package/esm/types.d.ts +2 -2
- package/lib/converter.js +11 -13
- package/lib/converter.js.map +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +5 -6
- package/src/converter.ts +11 -13
- package/src/types.ts +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# [Piral React 15](https://piral.io) · [](https://github.com/smapiot/piral/blob/main/LICENSE) [](https://www.npmjs.com/package/piral-react-15) [](https://jestjs.io) [](https://gitter.im/piral-io/community)
|
|
4
4
|
|
|
5
|
-
This is a plugin that only has a peer dependency to `
|
|
5
|
+
This is a plugin that only has a peer dependency to `react@^15` and `react-dom@^15`. What `piral-react-15` brings to the table is a set of Pilet API extensions that can be used with `piral` or `piral-core`.
|
|
6
6
|
|
|
7
7
|
The set includes a React 15.x converter for any component registration, as well as a `fromReact15` shortcut and a `React15Extension` component.
|
|
8
8
|
|
package/esm/converter.js
CHANGED
|
@@ -3,19 +3,17 @@ import { mountReact15, unmountReact15 } from './mount';
|
|
|
3
3
|
export function createConverter(config = {}) {
|
|
4
4
|
const { rootName = 'slot' } = config;
|
|
5
5
|
const Extension = createExtension(rootName);
|
|
6
|
-
const convert = (root) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
};
|
|
6
|
+
const convert = (root) => ({
|
|
7
|
+
mount(el, props, ctx) {
|
|
8
|
+
mountReact15(el, root, props, ctx);
|
|
9
|
+
},
|
|
10
|
+
update(el, props, ctx) {
|
|
11
|
+
mountReact15(el, root, props, ctx);
|
|
12
|
+
},
|
|
13
|
+
unmount(el) {
|
|
14
|
+
unmountReact15(el);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
19
17
|
convert.Extension = Extension;
|
|
20
18
|
return convert;
|
|
21
19
|
}
|
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,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUvD,MAAM,UAAU,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAoC,IAA2B,EAA4B,EAAE
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUvD,MAAM,UAAU,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAoC,IAA2B,EAA4B,EAAE,CAAC,CAAC;QAC7G,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YAClB,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YACnB,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,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/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
3
|
-
import { Component, ComponentType } from 'react-15';
|
|
2
|
+
import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
3
|
+
import type { Component, ComponentType } from 'react-15';
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletReact15Api {
|
|
6
6
|
}
|
package/lib/converter.js
CHANGED
|
@@ -6,19 +6,17 @@ const mount_1 = require("./mount");
|
|
|
6
6
|
function createConverter(config = {}) {
|
|
7
7
|
const { rootName = 'slot' } = config;
|
|
8
8
|
const Extension = (0, extension_1.createExtension)(rootName);
|
|
9
|
-
const convert = (root) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
};
|
|
9
|
+
const convert = (root) => ({
|
|
10
|
+
mount(el, props, ctx) {
|
|
11
|
+
(0, mount_1.mountReact15)(el, root, props, ctx);
|
|
12
|
+
},
|
|
13
|
+
update(el, props, ctx) {
|
|
14
|
+
(0, mount_1.mountReact15)(el, root, props, ctx);
|
|
15
|
+
},
|
|
16
|
+
unmount(el) {
|
|
17
|
+
(0, mount_1.unmountReact15)(el);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
22
20
|
convert.Extension = Extension;
|
|
23
21
|
return convert;
|
|
24
22
|
}
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,2CAA8C;AAC9C,mCAAuD;AAUvD,SAAgB,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAoC,IAA2B,EAA4B,EAAE
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,2CAA8C;AAC9C,mCAAuD;AAUvD,SAAgB,eAAe,CAAC,SAAkC,EAAE;IAClE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CAAoC,IAA2B,EAA4B,EAAE,CAAC,CAAC;QAC7G,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YAClB,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YACnB,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,CAAC,EAAE;YACR,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;QACrB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAhBD,0CAgBC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
3
|
-
import { Component, ComponentType } from 'react-15';
|
|
2
|
+
import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
3
|
+
import type { Component, ComponentType } from 'react-15';
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletReact15Api {
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-react-15",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.3905",
|
|
4
4
|
"description": "Plugin for integrating React v15 components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -44,14 +44,13 @@
|
|
|
44
44
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"piral-core": "0.15.0-alpha.
|
|
47
|
+
"piral-core": "0.15.0-alpha.3905",
|
|
48
48
|
"react-15": "npm:react@15",
|
|
49
49
|
"react-dom-15": "npm:react-dom@15"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"
|
|
53
|
-
"react-15": "
|
|
54
|
-
"react-dom-15": "*"
|
|
52
|
+
"react-15": "npm:react@^15",
|
|
53
|
+
"react-dom-15": "npm:react@^15"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "533d09963cfd8c901df797958ca386dbae0286e1"
|
|
57
56
|
}
|
package/src/converter.ts
CHANGED
|
@@ -14,19 +14,17 @@ export interface React15ConverterOptions {
|
|
|
14
14
|
export function createConverter(config: React15ConverterOptions = {}) {
|
|
15
15
|
const { rootName = 'slot' } = config;
|
|
16
16
|
const Extension = createExtension(rootName);
|
|
17
|
-
const convert = <TProps extends BaseComponentProps>(root: ComponentType<TProps>): ForeignComponent<TProps> => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
};
|
|
17
|
+
const convert = <TProps extends BaseComponentProps>(root: ComponentType<TProps>): ForeignComponent<TProps> => ({
|
|
18
|
+
mount(el, props, ctx) {
|
|
19
|
+
mountReact15(el, root, props, ctx);
|
|
20
|
+
},
|
|
21
|
+
update(el, props, ctx) {
|
|
22
|
+
mountReact15(el, root, props, ctx);
|
|
23
|
+
},
|
|
24
|
+
unmount(el) {
|
|
25
|
+
unmountReact15(el);
|
|
26
|
+
},
|
|
27
|
+
});
|
|
30
28
|
convert.Extension = Extension;
|
|
31
29
|
return convert;
|
|
32
30
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
2
|
-
import { Component, ComponentType } from 'react-15';
|
|
1
|
+
import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
2
|
+
import type { Component, ComponentType } from 'react-15';
|
|
3
3
|
|
|
4
4
|
declare module 'piral-core/lib/types/custom' {
|
|
5
5
|
interface PiletCustomApi extends PiletReact15Api {}
|