piral-inferno 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 createInfernoConverter() {
3
3
  var params = [];
4
4
  for (var _i = 0; _i < arguments.length; _i++) {
package/lib/converter.js CHANGED
@@ -1,24 +1,20 @@
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 { mountInferno, unmountInferno } from './mount';
2
+ import { createExtension } from './extension';
3
+ export function createConverter(config = {}) {
7
4
  const { rootName = 'piral-slot' } = config;
8
- const Extension = (0, extension_1.createExtension)(rootName);
5
+ const Extension = createExtension(rootName);
9
6
  const convert = (root) => ({
10
7
  mount(el, props, ctx) {
11
- (0, mount_1.mountInferno)(el, root, props, ctx);
8
+ mountInferno(el, root, props, ctx);
12
9
  },
13
10
  update(el, props, ctx) {
14
- (0, mount_1.mountInferno)(el, root, props, ctx);
11
+ mountInferno(el, root, props, ctx);
15
12
  },
16
13
  unmount(el) {
17
- (0, mount_1.unmountInferno)(el);
14
+ unmountInferno(el);
18
15
  },
19
16
  });
20
17
  convert.Extension = Extension;
21
18
  return convert;
22
19
  }
23
- exports.createConverter = createConverter;
24
20
  //# sourceMappingURL=converter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAEA,mCAAuD;AACvD,2CAA8C;AAU9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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/lib/create.js CHANGED
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createInfernoApi = void 0;
4
- const converter_1 = require("./converter");
1
+ import { createConverter } from './converter';
5
2
  /**
6
3
  * Creates Pilet API extensions for integrating Inferno.
7
4
  */
8
- function createInfernoApi(config = {}) {
5
+ export function createInfernoApi(config = {}) {
9
6
  return (context) => {
10
- const convert = (0, converter_1.createConverter)(config);
7
+ const convert = createConverter(config);
11
8
  context.converters.inferno = ({ root }) => convert(root);
12
9
  return {
13
10
  fromInferno(root) {
@@ -20,5 +17,4 @@ function createInfernoApi(config = {}) {
20
17
  };
21
18
  };
22
19
  }
23
- exports.createInfernoApi = createInfernoApi;
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,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createExtension = void 0;
4
- const tslib_1 = require("tslib");
5
- const inferno_1 = require("inferno");
6
- const inferno_create_element_1 = require("inferno-create-element");
7
- const mount_1 = require("./mount");
1
+ import { __setFunctionName } from "tslib";
2
+ import { Component } from 'inferno';
3
+ import { createElement } from 'inferno-create-element';
4
+ import { anyPropType } from './mount';
8
5
  function compareObjects(a, b) {
9
6
  for (const i in a) {
10
7
  if (!(i in b)) {
@@ -29,9 +26,9 @@ function compare(a, b) {
29
26
  }
30
27
  return true;
31
28
  }
32
- function createExtension(rootName) {
29
+ export function createExtension(rootName) {
33
30
  var _a;
34
- const InfernoExtension = (_a = class extends inferno_1.Component {
31
+ const InfernoExtension = (_a = class extends Component {
35
32
  constructor() {
36
33
  super(...arguments);
37
34
  this.onRefChange = (element) => {
@@ -46,17 +43,16 @@ function createExtension(rootName) {
46
43
  return !compare(this.props, nextProps);
47
44
  }
48
45
  render() {
49
- return (0, inferno_create_element_1.createElement)(rootName, {
46
+ return createElement(rootName, {
50
47
  ref: this.onRefChange,
51
48
  });
52
49
  }
53
50
  },
54
- tslib_1.__setFunctionName(_a, "InfernoExtension"),
51
+ __setFunctionName(_a, "InfernoExtension"),
55
52
  _a.contextTypes = {
56
- piral: mount_1.anyPropType,
53
+ piral: anyPropType,
57
54
  },
58
55
  _a);
59
56
  return InfernoExtension;
60
57
  }
61
- exports.createExtension = createExtension;
62
58
  //# sourceMappingURL=extension.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;;AACA,qCAAoC;AACpC,mEAAuD;AACvD,mCAAsC;AAEtC,SAAS,cAAc,CAAC,CAAM,EAAE,CAAM;IACpC,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACd;KACF;IAED,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACxB,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,OAAO,CAAI,CAAI,EAAE,CAAI;IAC5B,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QACpB,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QAEpB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7B;QA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BAAgB,CAAC;AAC1B,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,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unmountInferno = exports.mountInferno = exports.anyPropType = void 0;
4
- const inferno_1 = require("inferno");
5
- const inferno_create_element_1 = require("inferno-create-element");
1
+ import { render, Component } from 'inferno';
2
+ import { createElement } from 'inferno-create-element';
6
3
  // tslint:disable-next-line:no-null-keyword
7
- const anyPropType = () => null;
8
- exports.anyPropType = anyPropType;
9
- function mountInferno(el, root, props, ctx = {}) {
4
+ export const anyPropType = () => null;
5
+ export function mountInferno(el, root, props, ctx = {}) {
10
6
  const contextTypes = {};
11
7
  ['piral', ...Object.keys(ctx)].forEach((key) => {
12
- contextTypes[key] = exports.anyPropType;
8
+ contextTypes[key] = anyPropType;
13
9
  });
14
- class Provider extends inferno_1.Component {
10
+ class Provider extends Component {
15
11
  getChildContext() {
16
12
  return {
17
13
  piral: props.piral,
@@ -23,12 +19,10 @@ function mountInferno(el, root, props, ctx = {}) {
23
19
  }
24
20
  }
25
21
  Provider.childContextTypes = contextTypes;
26
- (0, inferno_1.render)((0, inferno_create_element_1.createElement)(Provider, {}, (0, inferno_create_element_1.createElement)(root, props)), el);
22
+ render(createElement(Provider, {}, createElement(root, props)), el);
27
23
  }
28
- exports.mountInferno = mountInferno;
29
- function unmountInferno(el) {
24
+ export function unmountInferno(el) {
30
25
  // tslint:disable-next-line:no-null-keyword
31
- (0, inferno_1.render)(null, el);
26
+ render(null, el);
32
27
  }
33
- exports.unmountInferno = unmountInferno;
34
28
  //# 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":";;;AAAA,qCAA2D;AAC3D,mEAAuD;AAGvD,2CAA2C;AACpC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAAzB,QAAA,WAAW,eAAc;AAEtC,SAAgB,YAAY,CAC1B,EAAe,EACf,IAAsB,EACtB,KAAQ,EACR,MAAW,EAAE;IAEb,MAAM,YAAY,GAAG,EAAE,CAAC;IAExB,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7C,YAAY,CAAC,GAAG,CAAC,GAAG,mBAAW,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,QAAS,SAAQ,mBAAS;QAG9B,eAAe;YACb,OAAO;gBACL,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG,GAAG;aACP,CAAC;QACJ,CAAC;QAED,MAAM;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC7B,CAAC;;IAXM,0BAAiB,GAAG,YAAY,CAAC;IAc1C,IAAA,gBAAM,EAAC,IAAA,sCAAa,EAAC,QAAQ,EAAE,EAAE,EAAE,IAAA,sCAAa,EAAC,IAAW,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AA5BD,oCA4BC;AAED,SAAgB,cAAc,CAAC,EAAe;IAC5C,2CAA2C;IAC3C,IAAA,gBAAM,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC;AAHD,wCAGC"}
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../src/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAEtC,MAAM,UAAU,YAAY,CAC1B,EAAe,EACf,IAAsB,EACtB,KAAQ,EACR,MAAW,EAAE;IAEb,MAAM,YAAY,GAAG,EAAE,CAAC;IAExB,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7C,YAAY,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,QAAS,SAAQ,SAAS;QAG9B,eAAe;YACb,OAAO;gBACL,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG,GAAG;aACP,CAAC;QACJ,CAAC;QAED,MAAM;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC7B,CAAC;;IAXM,0BAAiB,GAAG,YAAY,CAAC;IAc1C,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,CAAC,IAAW,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAe;IAC5C,2CAA2C;IAC3C,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,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-inferno",
3
- "version": "1.6.0-beta.7216",
3
+ "version": "1.6.0-beta.7243",
4
4
  "description": "Plugin for integrating Inferno 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,17 +41,16 @@
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-inferno.json src --exclude \"src/**/*.test.*\"",
64
48
  "test": "echo \"Error: run tests from root\" && exit 1"
65
49
  },
66
50
  "devDependencies": {
67
51
  "inferno": "^7.3.2",
68
52
  "inferno-create-element": "^7.3.2",
69
- "piral-core": "1.6.0-beta.7216"
53
+ "piral-core": "1.6.0-beta.7243"
70
54
  },
71
- "gitHead": "bd3742af68fc25af93ed9b37021d2d69a6f40f18"
55
+ "gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
72
56
  }
@@ -1,13 +0,0 @@
1
- import type { ForeignComponent, BaseComponentProps } from 'piral-core';
2
- import type { ComponentType } from 'inferno';
3
- export interface InfernoConverterOptions {
4
- /**
5
- * Defines the name of the root element.
6
- * @default piral-slot
7
- */
8
- rootName?: string;
9
- }
10
- export declare function createConverter(config?: InfernoConverterOptions): {
11
- <TProps extends BaseComponentProps>(root: ComponentType<TProps>): ForeignComponent<TProps>;
12
- Extension: import("inferno").Component<import("piral-core").ExtensionSlotProps, {}>;
13
- };
package/esm/converter.js DELETED
@@ -1,20 +0,0 @@
1
- import { mountInferno, unmountInferno } from './mount';
2
- import { createExtension } from './extension';
3
- export function createConverter(config = {}) {
4
- const { rootName = 'piral-slot' } = config;
5
- const Extension = createExtension(rootName);
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
- });
17
- convert.Extension = Extension;
18
- return convert;
19
- }
20
- //# sourceMappingURL=converter.js.map
@@ -1 +0,0 @@
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,YAAY,EAAE,GAAG,MAAM,CAAC;IAC3C,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/create.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { PiralPlugin } from 'piral-core';
2
- import { InfernoConverterOptions } from './converter';
3
- import type { PiletInfernoApi } from './types';
4
- /**
5
- * Available configuration options for the Inferno plugin.
6
- */
7
- export interface InfernoConfig extends InfernoConverterOptions {
8
- }
9
- /**
10
- * Creates Pilet API extensions for integrating Inferno.
11
- */
12
- export declare function createInfernoApi(config?: InfernoConfig): PiralPlugin<PiletInfernoApi>;
package/esm/create.js DELETED
@@ -1,20 +0,0 @@
1
- import { createConverter } from './converter';
2
- /**
3
- * Creates Pilet API extensions for integrating Inferno.
4
- */
5
- export function createInfernoApi(config = {}) {
6
- return (context) => {
7
- const convert = createConverter(config);
8
- context.converters.inferno = ({ root }) => convert(root);
9
- return {
10
- fromInferno(root) {
11
- return {
12
- type: 'inferno',
13
- root,
14
- };
15
- },
16
- InfernoExtension: 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,3 +0,0 @@
1
- import type { ExtensionSlotProps } from 'piral-core';
2
- import { Component } from 'inferno';
3
- export declare function createExtension(rootName: string): Component<ExtensionSlotProps>;
package/esm/extension.js DELETED
@@ -1,58 +0,0 @@
1
- import { __setFunctionName } from "tslib";
2
- import { Component } from 'inferno';
3
- import { createElement } from 'inferno-create-element';
4
- import { anyPropType } from './mount';
5
- function compareObjects(a, b) {
6
- for (const i in a) {
7
- if (!(i in b)) {
8
- return false;
9
- }
10
- }
11
- for (const i in b) {
12
- if (!compare(a[i], b[i])) {
13
- return false;
14
- }
15
- }
16
- return true;
17
- }
18
- function compare(a, b) {
19
- if (a !== b) {
20
- const ta = typeof a;
21
- const tb = typeof b;
22
- if (ta === tb && ta === 'object' && a && b) {
23
- return compareObjects(a, b);
24
- }
25
- return false;
26
- }
27
- return true;
28
- }
29
- export function createExtension(rootName) {
30
- var _a;
31
- const InfernoExtension = (_a = class extends Component {
32
- constructor() {
33
- super(...arguments);
34
- this.onRefChange = (element) => {
35
- if (element) {
36
- const { piral } = this.context;
37
- element.innerHTML = '';
38
- piral.renderHtmlExtension(element, this.props);
39
- }
40
- };
41
- }
42
- shouldComponentUpdate(nextProps) {
43
- return !compare(this.props, nextProps);
44
- }
45
- render() {
46
- return createElement(rootName, {
47
- ref: this.onRefChange,
48
- });
49
- }
50
- },
51
- __setFunctionName(_a, "InfernoExtension"),
52
- _a.contextTypes = {
53
- piral: anyPropType,
54
- },
55
- _a);
56
- return InfernoExtension;
57
- }
58
- //# sourceMappingURL=extension.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,SAAS,cAAc,CAAC,CAAM,EAAE,CAAM;IACpC,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE;YACb,OAAO,KAAK,CAAC;SACd;KACF;IAED,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACxB,OAAO,KAAK,CAAC;SACd;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,OAAO,CAAI,CAAI,EAAE,CAAI;IAC5B,IAAI,CAAC,KAAK,CAAC,EAAE;QACX,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QACpB,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;QAEpB,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,OAAO,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7B;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAgB;;IAC9C,MAAM,gBAAgB,SAAQ,KAAM,SAAQ,SAA6B;YAA3C;;gBAKpB,gBAAW,GAAG,CAAC,OAAoB,EAAE,EAAE;oBAC7C,IAAI,OAAO,EAAE;wBACX,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;wBAC/B,OAAO,CAAC,SAAS,GAAG,EAAE,CAAC;wBACvB,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;qBAChD;gBACH,CAAC,CAAC;YAWJ,CAAC;YATC,qBAAqB,CAAC,SAA6B;gBACjD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACzC,CAAC;YAED,MAAM;gBACJ,OAAO,aAAa,CAAC,QAAQ,EAAE;oBAC7B,GAAG,EAAE,IAAI,CAAC,WAAW;iBACtB,CAAC,CAAC;YACL,CAAC;SACF;;QArBQ,eAAY,GAAG;YACpB,KAAK,EAAE,WAAW;SAClB;WAmBH,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,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,5 +0,0 @@
1
- import { ComponentType } from 'inferno';
2
- import type { BaseComponentProps } from 'piral-core';
3
- export declare const anyPropType: () => any;
4
- export declare function mountInferno<T extends BaseComponentProps>(el: HTMLElement, root: ComponentType<T>, props: T, ctx?: any): void;
5
- export declare function unmountInferno(el: HTMLElement): void;
package/esm/mount.js DELETED
@@ -1,28 +0,0 @@
1
- import { render, Component } from 'inferno';
2
- import { createElement } from 'inferno-create-element';
3
- // tslint:disable-next-line:no-null-keyword
4
- export const anyPropType = () => null;
5
- export function mountInferno(el, root, props, ctx = {}) {
6
- const contextTypes = {};
7
- ['piral', ...Object.keys(ctx)].forEach((key) => {
8
- contextTypes[key] = anyPropType;
9
- });
10
- class Provider extends Component {
11
- getChildContext() {
12
- return {
13
- piral: props.piral,
14
- ...ctx,
15
- };
16
- }
17
- render() {
18
- return this.props.children;
19
- }
20
- }
21
- Provider.childContextTypes = contextTypes;
22
- render(createElement(Provider, {}, createElement(root, props)), el);
23
- }
24
- export function unmountInferno(el) {
25
- // tslint:disable-next-line:no-null-keyword
26
- render(null, el);
27
- }
28
- //# 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":"AAAA,OAAO,EAAE,MAAM,EAAiB,SAAS,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC;AAEtC,MAAM,UAAU,YAAY,CAC1B,EAAe,EACf,IAAsB,EACtB,KAAQ,EACR,MAAW,EAAE;IAEb,MAAM,YAAY,GAAG,EAAE,CAAC;IAExB,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC7C,YAAY,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,MAAM,QAAS,SAAQ,SAAS;QAG9B,eAAe;YACb,OAAO;gBACL,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG,GAAG;aACP,CAAC;QACJ,CAAC;QAED,MAAM;YACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QAC7B,CAAC;;IAXM,0BAAiB,GAAG,YAAY,CAAC;IAc1C,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,EAAE,aAAa,CAAC,IAAW,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAe;IAC5C,2CAA2C;IAC3C,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnB,CAAC"}
package/esm/types.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
2
- import type { Component, ComponentType } from 'inferno';
3
- declare module 'piral-core/lib/types/custom' {
4
- interface PiletCustomApi extends PiletInfernoApi {
5
- }
6
- interface PiralCustomComponentConverters<TProps> {
7
- inferno(component: InfernoComponent<TProps>): ForeignComponent<TProps>;
8
- }
9
- }
10
- export interface InfernoComponent<TProps> {
11
- /**
12
- * The component root.
13
- */
14
- root: ComponentType<TProps>;
15
- /**
16
- * The type of the Inferno component.
17
- */
18
- type: 'inferno';
19
- }
20
- /**
21
- * Defines the provided set of Pilet API extensions from the Inferno plugin.
22
- */
23
- export interface PiletInfernoApi {
24
- /**
25
- * Wraps an Inferno component for use in Piral.
26
- * @param component The component root.
27
- * @returns The Piral Inferno component.
28
- */
29
- fromInferno<TProps>(component: ComponentType<TProps>): InfernoComponent<TProps>;
30
- /**
31
- * Inferno component for displaying extensions of the given name.
32
- */
33
- InfernoExtension: Component<ExtensionSlotProps>;
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":""}