piral-mithril 0.14.16 → 0.14.18-beta.3923
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/esm/converter.js +16 -18
- package/esm/converter.js.map +1 -1
- package/lib/converter.js +16 -18
- package/lib/converter.js.map +1 -1
- package/package.json +3 -3
- package/src/converter.ts +26 -28
package/esm/converter.js
CHANGED
|
@@ -3,24 +3,22 @@ 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 = (component, captured) => {
|
|
7
|
-
|
|
8
|
-
mount(el,
|
|
9
|
-
mithril.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
mithril.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
};
|
|
6
|
+
const convert = (component, captured) => ({
|
|
7
|
+
mount(el, props, ctx) {
|
|
8
|
+
mithril.mount(el, {
|
|
9
|
+
view: () => mithril.m(component, Object.assign(Object.assign(Object.assign({}, captured), ctx), props)),
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
update(el, props, ctx) {
|
|
13
|
+
mithril.mount(el, {
|
|
14
|
+
view: () => mithril.m(component, Object.assign(Object.assign(Object.assign({}, captured), ctx), props)),
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
unmount(el) {
|
|
18
|
+
// tslint:disable-next-line:no-null-keyword
|
|
19
|
+
mithril.mount(el, null);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
24
22
|
convert.Extension = Extension;
|
|
25
23
|
return convert;
|
|
26
24
|
}
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":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K,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1B,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/lib/converter.js
CHANGED
|
@@ -6,24 +6,22 @@ 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 = (component, captured) => {
|
|
10
|
-
|
|
11
|
-
mount(el,
|
|
12
|
-
mithril.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
mithril.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
};
|
|
9
|
+
const convert = (component, captured) => ({
|
|
10
|
+
mount(el, props, ctx) {
|
|
11
|
+
mithril.mount(el, {
|
|
12
|
+
view: () => mithril.m(component, Object.assign(Object.assign(Object.assign({}, captured), ctx), props)),
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
update(el, props, ctx) {
|
|
16
|
+
mithril.mount(el, {
|
|
17
|
+
view: () => mithril.m(component, Object.assign(Object.assign(Object.assign({}, captured), ctx), props)),
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
unmount(el) {
|
|
21
|
+
// tslint:disable-next-line:no-null-keyword
|
|
22
|
+
mithril.mount(el, null);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
27
25
|
convert.Extension = Extension;
|
|
28
26
|
return convert;
|
|
29
27
|
}
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,2CAA8C;AAW9C,SAAgB,eAAe,CAAC,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|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-mithril",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.18-beta.3923",
|
|
4
4
|
"description": "Plugin for integrating Mithril.js components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"mithril": "2.0.4",
|
|
47
|
-
"piral-core": "
|
|
47
|
+
"piral-core": "0.14.18-beta.3923"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"mithril": "^2.0.0",
|
|
51
51
|
"piral-core": "0.14.x"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "036cb83c1f1797a833edbcc9a7fd698a926aedd2"
|
|
54
54
|
}
|
package/src/converter.ts
CHANGED
|
@@ -17,34 +17,32 @@ export function createConverter(config: MithrilConverterOptions = {}) {
|
|
|
17
17
|
const convert = <TProps extends BaseComponentProps>(
|
|
18
18
|
component: Component<TProps>,
|
|
19
19
|
captured?: Record<string, any>,
|
|
20
|
-
): ForeignComponent<TProps> => {
|
|
21
|
-
|
|
22
|
-
mount(el,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
};
|
|
20
|
+
): ForeignComponent<TProps> => ({
|
|
21
|
+
mount(el, props, ctx) {
|
|
22
|
+
mithril.mount(el, {
|
|
23
|
+
view: () =>
|
|
24
|
+
mithril.m(component, {
|
|
25
|
+
...captured,
|
|
26
|
+
...ctx,
|
|
27
|
+
...props,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
update(el, props, ctx) {
|
|
32
|
+
mithril.mount(el, {
|
|
33
|
+
view: () =>
|
|
34
|
+
mithril.m(component, {
|
|
35
|
+
...captured,
|
|
36
|
+
...ctx,
|
|
37
|
+
...props,
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
unmount(el) {
|
|
42
|
+
// tslint:disable-next-line:no-null-keyword
|
|
43
|
+
mithril.mount(el, null);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
48
46
|
convert.Extension = Extension;
|
|
49
47
|
return convert;
|
|
50
48
|
}
|