piral-hyperapp 0.15.0-alpha.3809 → 0.15.0-alpha.3933
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 +1 -1
- package/esm/converter.js +8 -10
- package/esm/converter.js.map +1 -1
- package/esm/types.d.ts +1 -1
- package/lib/converter.js +8 -10
- package/lib/converter.js.map +1 -1
- package/lib/types.d.ts +1 -1
- package/package.json +4 -5
- package/src/converter.ts +8 -10
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# [Piral Hyperapp](https://piral.io) · [](https://github.com/smapiot/piral/blob/main/LICENSE) [](https://www.npmjs.com/package/piral-hyperapp) [](https://jestjs.io) [](https://gitter.im/piral-io/community)
|
|
4
4
|
|
|
5
|
-
This is a plugin that only has a peer dependency to `
|
|
5
|
+
This is a plugin that only has a peer dependency to `hyperapp`. What `piral-hyperapp` 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 Hyperapp converter for any component registration, as well as a `fromHyperapp` shortcut and a `HyperappExtension` component.
|
|
8
8
|
|
package/esm/converter.js
CHANGED
|
@@ -3,16 +3,14 @@ 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, state, actions) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
};
|
|
6
|
+
const convert = (root, state, actions) => ({
|
|
7
|
+
mount(el, props, ctx) {
|
|
8
|
+
mountHyperapp(el, root, props, ctx, state, actions);
|
|
9
|
+
},
|
|
10
|
+
unmount(el) {
|
|
11
|
+
el.innerHTML = '';
|
|
12
|
+
},
|
|
13
|
+
});
|
|
16
14
|
convert.Extension = Extension;
|
|
17
15
|
return convert;
|
|
18
16
|
}
|
package/esm/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C,MAAM,UAAU,eAAe,CAAC,SAAmC,EAAE;IACnE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,KAAU,EACV,OAAY,EACc,EAAE
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C,MAAM,UAAU,eAAe,CAAC,SAAmC,EAAE;IACnE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,KAAU,EACV,OAAY,EACc,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YAClB,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,EAAE;YACR,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/esm/types.d.ts
CHANGED
package/lib/converter.js
CHANGED
|
@@ -6,16 +6,14 @@ 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, state, actions) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
};
|
|
9
|
+
const convert = (root, state, actions) => ({
|
|
10
|
+
mount(el, props, ctx) {
|
|
11
|
+
(0, mount_1.mountHyperapp)(el, root, props, ctx, state, actions);
|
|
12
|
+
},
|
|
13
|
+
unmount(el) {
|
|
14
|
+
el.innerHTML = '';
|
|
15
|
+
},
|
|
16
|
+
});
|
|
19
17
|
convert.Extension = Extension;
|
|
20
18
|
return convert;
|
|
21
19
|
}
|
package/lib/converter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,mCAAwC;AACxC,2CAA8C;AAW9C,SAAgB,eAAe,CAAC,SAAmC,EAAE;IACnE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,KAAU,EACV,OAAY,EACc,EAAE
|
|
1
|
+
{"version":3,"file":"converter.js","sourceRoot":"","sources":["../src/converter.ts"],"names":[],"mappings":";;;AACA,mCAAwC;AACxC,2CAA8C;AAW9C,SAAgB,eAAe,CAAC,SAAmC,EAAE;IACnE,MAAM,EAAE,QAAQ,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACrC,MAAM,SAAS,GAAG,IAAA,2BAAe,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAuB,EACvB,KAAU,EACV,OAAY,EACc,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG;YAClB,IAAA,qBAAa,EAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,CAAC,EAAE;YACR,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,OAAO,OAAO,CAAC;AACjB,CAAC;AAjBD,0CAiBC"}
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-hyperapp",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.3933",
|
|
4
4
|
"description": "Plugin for integrating hyperapp components in Piral.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral",
|
|
@@ -45,11 +45,10 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"hyperapp": "^1.2.10",
|
|
48
|
-
"piral-core": "0.15.0-alpha.
|
|
48
|
+
"piral-core": "0.15.0-alpha.3933"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"hyperapp": "^1.0.0"
|
|
52
|
-
"piral-core": "0.14.x"
|
|
51
|
+
"hyperapp": "^1.0.0"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "520a272d09f02543153f1d8b2ae23a3ae10acd6f"
|
|
55
54
|
}
|
package/src/converter.ts
CHANGED
|
@@ -18,16 +18,14 @@ export function createConverter(config: HyperappConverterOptions = {}) {
|
|
|
18
18
|
root: Component<TProps>,
|
|
19
19
|
state: any,
|
|
20
20
|
actions: any,
|
|
21
|
-
): ForeignComponent<TProps> => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
};
|
|
21
|
+
): ForeignComponent<TProps> => ({
|
|
22
|
+
mount(el, props, ctx) {
|
|
23
|
+
mountHyperapp(el, root, props, ctx, state, actions);
|
|
24
|
+
},
|
|
25
|
+
unmount(el) {
|
|
26
|
+
el.innerHTML = '';
|
|
27
|
+
},
|
|
28
|
+
});
|
|
31
29
|
convert.Extension = Extension;
|
|
32
30
|
return convert;
|
|
33
31
|
}
|
package/src/types.ts
CHANGED