piral-react-15 0.15.0-alpha.3816 → 0.15.0-alpha.3975

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # [Piral React 15](https://piral.io) · [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/smapiot/piral/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/piral-react-15.svg?style=flat)](https://www.npmjs.com/package/piral-react-15) [![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://jestjs.io) [![Gitter Chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/piral-io/community)
4
4
 
5
- This is a plugin that only has a peer dependency to `piral-core`. What `piral-react-15` brings to the table is a set of Pilet API extensions that can be used with `piral` or `piral-core`.
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/convert.d.ts CHANGED
@@ -1,5 +1,12 @@
1
- import type { HtmlComponent } from 'piral-core';
2
- import { createConverter } from './lib/converter';
1
+ import { createConverter } from './esm/converter';
2
+ export interface HtmlComponent<TProps> {
3
+ component: {
4
+ mount(element: HTMLElement, props: TProps, ctx: any, locals: any): void;
5
+ update?(element: HTMLElement, props: TProps, ctx: any, locals: any): void;
6
+ unmount?(element: HTMLElement, locals: any): void;
7
+ };
8
+ type: 'html';
9
+ }
3
10
  export interface React15Converter {
4
11
  (...params: Parameters<ReturnType<typeof createConverter>>): HtmlComponent<any>;
5
12
  }
package/convert.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
3
  exports.React15Extension = exports.fromReact15 = exports.createReact15Converter = void 0;
4
- var converter_1 = require("./lib/converter");
4
+ var converter_1 = require("./esm/converter");
5
5
  function createReact15Converter() {
6
6
  var params = [];
7
7
  for (var _i = 0; _i < arguments.length; _i++) {
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
- return {
8
- mount(el, props, ctx) {
9
- mountReact15(el, root, props, ctx);
10
- },
11
- update(el, props, ctx) {
12
- mountReact15(el, root, props, ctx);
13
- },
14
- unmount(el) {
15
- unmountReact15(el);
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
  }
@@ -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;QAC3G,OAAO;YACL,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;gBAClB,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACrC,CAAC;YACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;gBACnB,YAAY,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,EAAE;gBACR,cAAc,CAAC,EAAE,CAAC,CAAC;YACrB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
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
- return {
11
- mount(el, props, ctx) {
12
- (0, mount_1.mountReact15)(el, root, props, ctx);
13
- },
14
- update(el, props, ctx) {
15
- (0, mount_1.mountReact15)(el, root, props, ctx);
16
- },
17
- unmount(el) {
18
- (0, mount_1.unmountReact15)(el);
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
  }
@@ -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;QAC3G,OAAO;YACL,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;gBAClB,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACrC,CAAC;YACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;gBACnB,IAAA,oBAAY,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,EAAE;gBACR,IAAA,sBAAc,EAAC,EAAE,CAAC,CAAC;YACrB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IACF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAlBD,0CAkBC"}
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.3816",
3
+ "version": "0.15.0-alpha.3975",
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.3816",
47
+ "piral-core": "0.15.0-alpha.3975",
48
48
  "react-15": "npm:react@15",
49
49
  "react-dom-15": "npm:react-dom@15"
50
50
  },
51
51
  "peerDependencies": {
52
- "piral-core": "0.14.x",
53
- "react-15": "*",
54
- "react-dom-15": "*"
52
+ "react-15": "npm:react@^15",
53
+ "react-dom-15": "npm:react@^15"
55
54
  },
56
- "gitHead": "cfd7ed44c6b73655be56587aeaf774692e0c94ad"
55
+ "gitHead": "461d63cd1957359472018b32a56778da716d3406"
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
- return {
19
- mount(el, props, ctx) {
20
- mountReact15(el, root, props, ctx);
21
- },
22
- update(el, props, ctx) {
23
- mountReact15(el, root, props, ctx);
24
- },
25
- unmount(el) {
26
- unmountReact15(el);
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 {}