piral-inferno 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 Inferno](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-inferno.svg?style=flat)](https://www.npmjs.com/package/piral-inferno) [![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-inferno` 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 `inferno`. What `piral-inferno` 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 an Inferno converter for any component registration, as well as a `fromInferno` shortcut and a `InfernoExtension` 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 InfernoConverter {
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.InfernoExtension = exports.fromInferno = exports.createInfernoConverter = void 0;
4
- var converter_1 = require("./lib/converter");
4
+ var converter_1 = require("./esm/converter");
5
5
  function createInfernoConverter() {
6
6
  var params = [];
7
7
  for (var _i = 0; _i < arguments.length; _i++) {
package/esm/converter.js CHANGED
@@ -3,19 +3,17 @@ import { createExtension } from './extension';
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
- mountInferno(el, root, props, ctx);
10
- },
11
- update(el, props, ctx) {
12
- mountInferno(el, root, props, ctx);
13
- },
14
- unmount(el) {
15
- unmountInferno(el);
16
- },
17
- };
18
- };
6
+ const convert = (root) => ({
7
+ mount(el, props, ctx) {
8
+ mountInferno(el, root, props, ctx);
9
+ },
10
+ update(el, props, ctx) {
11
+ mountInferno(el, root, props, ctx);
12
+ },
13
+ unmount(el) {
14
+ unmountInferno(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,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAU9C,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,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAU9C,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,5 +1,5 @@
1
- import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import { Component, ComponentType } from 'inferno';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component, ComponentType } from 'inferno';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletInfernoApi {
5
5
  }
package/lib/converter.js CHANGED
@@ -6,19 +6,17 @@ const extension_1 = require("./extension");
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.mountInferno)(el, root, props, ctx);
13
- },
14
- update(el, props, ctx) {
15
- (0, mount_1.mountInferno)(el, root, props, ctx);
16
- },
17
- unmount(el) {
18
- (0, mount_1.unmountInferno)(el);
19
- },
20
- };
21
- };
9
+ const convert = (root) => ({
10
+ mount(el, props, ctx) {
11
+ (0, mount_1.mountInferno)(el, root, props, ctx);
12
+ },
13
+ update(el, props, ctx) {
14
+ (0, mount_1.mountInferno)(el, root, props, ctx);
15
+ },
16
+ unmount(el) {
17
+ (0, mount_1.unmountInferno)(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,mCAAuD;AACvD,2CAA8C;AAU9C,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,mCAAuD;AACvD,2CAA8C;AAU9C,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,5 +1,5 @@
1
- import { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import { Component, ComponentType } from 'inferno';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component, ComponentType } from 'inferno';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletInfernoApi {
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-inferno",
3
- "version": "0.15.0-alpha.3816",
3
+ "version": "0.15.0-alpha.3975",
4
4
  "description": "Plugin for integrating Inferno components in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -46,12 +46,11 @@
46
46
  "devDependencies": {
47
47
  "inferno": "^7.3.2",
48
48
  "inferno-create-element": "^7.3.2",
49
- "piral-core": "0.15.0-alpha.3816"
49
+ "piral-core": "0.15.0-alpha.3975"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "inferno": "^7.0.0",
53
- "inferno-create-element": "^7.0.0",
54
- "piral-core": "0.14.x"
53
+ "inferno-create-element": "^7.0.0"
55
54
  },
56
- "gitHead": "cfd7ed44c6b73655be56587aeaf774692e0c94ad"
55
+ "gitHead": "461d63cd1957359472018b32a56778da716d3406"
57
56
  }
package/src/converter.ts CHANGED
@@ -14,19 +14,17 @@ export interface InfernoConverterOptions {
14
14
  export function createConverter(config: InfernoConverterOptions = {}) {
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
- mountInferno(el, root, props, ctx);
21
- },
22
- update(el, props, ctx) {
23
- mountInferno(el, root, props, ctx);
24
- },
25
- unmount(el) {
26
- unmountInferno(el);
27
- },
28
- };
29
- };
17
+ const convert = <TProps extends BaseComponentProps>(root: ComponentType<TProps>): ForeignComponent<TProps> => ({
18
+ mount(el, props, ctx) {
19
+ mountInferno(el, root, props, ctx);
20
+ },
21
+ update(el, props, ctx) {
22
+ mountInferno(el, root, props, ctx);
23
+ },
24
+ unmount(el) {
25
+ unmountInferno(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 'inferno';
1
+ import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
+ import type { Component, ComponentType } from 'inferno';
3
3
 
4
4
  declare module 'piral-core/lib/types/custom' {
5
5
  interface PiletCustomApi extends PiletInfernoApi {}