piral-inferno 1.6.0-beta.7240 → 1.6.0-beta.7244
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 +1 -1
- package/convert.js +1 -1
- package/lib/converter.js +7 -11
- package/lib/converter.js.map +1 -1
- package/lib/create.js +3 -7
- package/lib/create.js.map +1 -1
- package/lib/extension.js +9 -13
- package/lib/extension.js.map +1 -1
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/mount.js +9 -15
- package/lib/mount.js.map +1 -1
- package/lib/types.js +1 -2
- package/package.json +10 -23
- package/esm/converter.d.ts +0 -13
- package/esm/converter.js +0 -20
- package/esm/converter.js.map +0 -1
- package/esm/create.d.ts +0 -12
- package/esm/create.js +0 -20
- package/esm/create.js.map +0 -1
- package/esm/extension.d.ts +0 -3
- package/esm/extension.js +0 -58
- package/esm/extension.js.map +0 -1
- package/esm/index.d.ts +0 -2
- package/esm/index.js +0 -3
- package/esm/index.js.map +0 -1
- package/esm/mount.d.ts +0 -5
- package/esm/mount.js +0 -28
- package/esm/mount.js.map +0 -1
- package/esm/types.d.ts +0 -34
- package/esm/types.js +0 -2
- package/esm/types.js.map +0 -1
package/convert.d.ts
CHANGED
package/convert.js
CHANGED
package/lib/converter.js
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 =
|
|
5
|
+
const Extension = createExtension(rootName);
|
|
9
6
|
const convert = (root) => ({
|
|
10
7
|
mount(el, props, ctx) {
|
|
11
|
-
|
|
8
|
+
mountInferno(el, root, props, ctx);
|
|
12
9
|
},
|
|
13
10
|
update(el, props, ctx) {
|
|
14
|
-
|
|
11
|
+
mountInferno(el, root, props, ctx);
|
|
15
12
|
},
|
|
16
13
|
unmount(el) {
|
|
17
|
-
|
|
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
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"
|
|
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/lib/create.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
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 =
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
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
|
|
46
|
+
return createElement(rootName, {
|
|
50
47
|
ref: this.onRefChange,
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
50
|
},
|
|
54
|
-
|
|
51
|
+
__setFunctionName(_a, "InfernoExtension"),
|
|
55
52
|
_a.contextTypes = {
|
|
56
|
-
piral:
|
|
53
|
+
piral: anyPropType,
|
|
57
54
|
},
|
|
58
55
|
_a);
|
|
59
56
|
return InfernoExtension;
|
|
60
57
|
}
|
|
61
|
-
exports.createExtension = createExtension;
|
|
62
58
|
//# 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":"
|
|
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/lib/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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":"
|
|
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
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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] =
|
|
8
|
+
contextTypes[key] = anyPropType;
|
|
13
9
|
});
|
|
14
|
-
class Provider extends
|
|
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
|
-
|
|
22
|
+
render(createElement(Provider, {}, createElement(root, props)), el);
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
function unmountInferno(el) {
|
|
24
|
+
export function unmountInferno(el) {
|
|
30
25
|
// tslint:disable-next-line:no-null-keyword
|
|
31
|
-
|
|
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":"
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-inferno",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.7244",
|
|
4
4
|
"description": "Plugin for integrating Inferno components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -16,32 +16,20 @@
|
|
|
16
16
|
"author": "smapiot",
|
|
17
17
|
"homepage": "https://piral.io",
|
|
18
18
|
"license": "MIT",
|
|
19
|
-
"module": "
|
|
19
|
+
"module": "lib/index.js",
|
|
20
20
|
"main": "lib/index.js",
|
|
21
21
|
"typings": "lib/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
25
|
-
"require": "./lib/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./convert": {
|
|
28
|
-
"import": "./convert.js"
|
|
29
|
-
},
|
|
30
|
-
"./esm/*": {
|
|
31
|
-
"import": "./esm/*"
|
|
32
|
-
},
|
|
23
|
+
".": "./lib/index.js",
|
|
24
|
+
"./convert": "./convert.js",
|
|
33
25
|
"./lib/*": {
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"./_/*": {
|
|
37
|
-
"import": "./esm/*.js",
|
|
38
|
-
"require": "./lib/*.js"
|
|
26
|
+
"import": "./lib/*",
|
|
27
|
+
"types": "./lib/*.d.ts"
|
|
39
28
|
},
|
|
40
29
|
"./package.json": "./package.json"
|
|
41
30
|
},
|
|
42
31
|
"sideEffects": false,
|
|
43
32
|
"files": [
|
|
44
|
-
"esm",
|
|
45
33
|
"lib",
|
|
46
34
|
"src",
|
|
47
35
|
"convert.d.ts",
|
|
@@ -56,17 +44,16 @@
|
|
|
56
44
|
},
|
|
57
45
|
"scripts": {
|
|
58
46
|
"cleanup": "rimraf esm lib convert.d.ts convert.js",
|
|
59
|
-
"build": "yarn build:
|
|
47
|
+
"build": "yarn build:esnext && yarn build:convert",
|
|
60
48
|
"build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
|
|
61
|
-
"build:
|
|
62
|
-
"build:esnext": "tsc --project tsconfig.json --outDir esm --module esnext",
|
|
49
|
+
"build:esnext": "tsc --project tsconfig.json --outDir lib --module esnext",
|
|
63
50
|
"typedoc": "typedoc --json ../../../docs/types/piral-inferno.json src --exclude \"src/**/*.test.*\"",
|
|
64
51
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
65
52
|
},
|
|
66
53
|
"devDependencies": {
|
|
67
54
|
"inferno": "^7.3.2",
|
|
68
55
|
"inferno-create-element": "^7.3.2",
|
|
69
|
-
"piral-core": "1.6.0-beta.
|
|
56
|
+
"piral-core": "1.6.0-beta.7244"
|
|
70
57
|
},
|
|
71
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "65ac1291c3429dbf16079b4deb6138b24c5719f7"
|
|
72
59
|
}
|
package/esm/converter.d.ts
DELETED
|
@@ -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
|
package/esm/converter.js.map
DELETED
|
@@ -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"}
|
package/esm/extension.d.ts
DELETED
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
|
package/esm/extension.js.map
DELETED
|
@@ -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
package/esm/index.js
DELETED
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
package/esm/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|