piral-hyperapp 1.6.0-beta.7240 → 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 +3 -3
- package/convert.js +1 -1
- package/lib/converter.js +5 -9
- package/lib/converter.js.map +1 -1
- package/lib/create.js +3 -7
- package/lib/create.js.map +1 -1
- package/lib/extension.js +3 -7
- package/lib/extension.js.map +1 -1
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/mount.js +2 -7
- package/lib/mount.js.map +1 -1
- package/lib/types.js +1 -2
- package/package.json +9 -25
- package/esm/converter.d.ts +0 -13
- package/esm/converter.js +0 -17
- package/esm/converter.js.map +0 -1
- package/esm/create.d.ts +0 -12
- package/esm/create.js +0 -22
- package/esm/create.js.map +0 -1
- package/esm/extension.d.ts +0 -3
- package/esm/extension.js +0 -15
- 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 -3
- package/esm/mount.js +0 -11
- package/esm/mount.js.map +0 -1
- package/esm/types.d.ts +0 -68
- package/esm/types.js +0 -2
- package/esm/types.js.map +0 -1
package/convert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createConverter } from './
|
|
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;
|
|
@@ -12,7 +12,7 @@ export interface HyperappConverter {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function createHyperappConverter(...params: Parameters<typeof createConverter>): {
|
|
14
14
|
from: HyperappConverter;
|
|
15
|
-
Extension: import("./
|
|
15
|
+
Extension: import("./lib/types").Component<any, {}, {}>;
|
|
16
16
|
};
|
|
17
|
-
declare const fromHyperapp: HyperappConverter, HyperExtension: import("./
|
|
17
|
+
declare const fromHyperapp: HyperappConverter, HyperExtension: import("./lib/types").Component<any, {}, {}>;
|
|
18
18
|
export { fromHyperapp, HyperExtension };
|
package/convert.js
CHANGED
package/lib/converter.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const mount_1 = require("./mount");
|
|
5
|
-
const extension_1 = require("./extension");
|
|
6
|
-
function createConverter(config = {}) {
|
|
1
|
+
import { mountHyperapp } 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, state, actions) => ({
|
|
10
7
|
mount(el, props, ctx) {
|
|
11
|
-
|
|
8
|
+
mountHyperapp(el, root, props, ctx, state, actions);
|
|
12
9
|
},
|
|
13
10
|
unmount(el) {
|
|
14
11
|
el.innerHTML = '';
|
|
@@ -17,5 +14,4 @@ function createConverter(config = {}) {
|
|
|
17
14
|
convert.Extension = Extension;
|
|
18
15
|
return convert;
|
|
19
16
|
}
|
|
20
|
-
exports.createConverter = createConverter;
|
|
21
17
|
//# 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":"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,YAAY,EAAE,GAAG,MAAM,CAAC;IAC3C,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/lib/create.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createHyperappApi = void 0;
|
|
4
|
-
const converter_1 = require("./converter");
|
|
1
|
+
import { createConverter } from './converter';
|
|
5
2
|
/**
|
|
6
3
|
* Creates new Pilet API extensions for the Hyperapp integration.
|
|
7
4
|
*/
|
|
8
|
-
function createHyperappApi(config = {}) {
|
|
5
|
+
export function createHyperappApi(config = {}) {
|
|
9
6
|
return (context) => {
|
|
10
|
-
const convert =
|
|
7
|
+
const convert = createConverter(config);
|
|
11
8
|
context.converters.hyperapp = ({ root, state, actions }) => convert(root, state, actions);
|
|
12
9
|
return {
|
|
13
10
|
fromHyperapp(root, state, actions) {
|
|
@@ -22,5 +19,4 @@ function createHyperappApi(config = {}) {
|
|
|
22
19
|
};
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
|
-
exports.createHyperappApi = createHyperappApi;
|
|
26
22
|
//# 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,EAA4B,MAAM,aAAa,CAAC;AAQxE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAyB,EAAE;IAC3D,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAE1F,OAAO;YACL,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;gBAC/B,OAAO;oBACL,IAAI,EAAE,UAAU;oBAChB,IAAI;oBACJ,KAAK;oBACL,OAAO;iBACR,CAAC;YACJ,CAAC;YACD,iBAAiB,EAAE,OAAO,CAAC,SAAS;SACrC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/extension.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const mount_1 = require("./mount");
|
|
5
|
-
function createExtension(rootName) {
|
|
6
|
-
return (props) => (0, mount_1.createHyperappElement)(rootName, {
|
|
1
|
+
import { createHyperappElement } from './mount';
|
|
2
|
+
export function createExtension(rootName) {
|
|
3
|
+
return (props) => createHyperappElement(rootName, {
|
|
7
4
|
oncreate(element) {
|
|
8
5
|
element.dispatchEvent(new CustomEvent('render-html', {
|
|
9
6
|
bubbles: true,
|
|
@@ -15,5 +12,4 @@ function createExtension(rootName) {
|
|
|
15
12
|
},
|
|
16
13
|
});
|
|
17
14
|
}
|
|
18
|
-
exports.createExtension = createExtension;
|
|
19
15
|
//# 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,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,CAAC,KAAK,EAAE,EAAE,CACf,qBAAqB,CAAC,QAAQ,EAAE;QAC9B,QAAQ,CAAC,OAAoB;YAC3B,OAAO,CAAC,aAAa,CACnB,IAAI,WAAW,CAAC,aAAa,EAAE;gBAC7B,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,MAAM,EAAE,OAAO;oBACf,KAAK;iBACN;aACF,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACP,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,16 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createHyperappElement = exports.mountHyperapp = void 0;
|
|
4
1
|
const { h, app } = require('hyperapp');
|
|
5
|
-
function mountHyperapp(el, root, props, ctx, state, actions) {
|
|
2
|
+
export function mountHyperapp(el, root, props, ctx, state, actions) {
|
|
6
3
|
app({
|
|
7
4
|
...ctx,
|
|
8
5
|
...state,
|
|
9
6
|
}, actions, () => h(root, props), el);
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
function createHyperappElement(name, props) {
|
|
8
|
+
export function createHyperappElement(name, props) {
|
|
13
9
|
return h(name, props, []);
|
|
14
10
|
}
|
|
15
|
-
exports.createHyperappElement = createHyperappElement;
|
|
16
11
|
//# 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":"AAEA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvC,MAAM,UAAU,aAAa,CAC3B,EAAe,EACf,IAAkB,EAClB,KAAQ,EACR,GAAQ,EACR,KAAU,EACV,OAAY;IAEZ,GAAG,CACD;QACE,GAAG,GAAG;QACN,GAAG,KAAK;KACT,EACD,OAAO,EACP,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EACpB,EAAE,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,KAAU;IAC5D,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
package/lib/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-hyperapp",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.7243",
|
|
4
4
|
"description": "Plugin for integrating hyperapp 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": "
|
|
19
|
+
"module": "lib/index.js",
|
|
20
20
|
"main": "lib/index.js",
|
|
21
21
|
"typings": "lib/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
|
-
".":
|
|
24
|
-
|
|
25
|
-
|
|
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,16 +41,15 @@
|
|
|
56
41
|
},
|
|
57
42
|
"scripts": {
|
|
58
43
|
"cleanup": "rimraf esm lib convert.d.ts convert.js",
|
|
59
|
-
"build": "yarn build:
|
|
44
|
+
"build": "yarn build:esnext && yarn build:convert",
|
|
60
45
|
"build:convert": "tsc convert.ts --skipLibCheck --declaration --module esnext",
|
|
61
|
-
"build:
|
|
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-hyperapp.json src --exclude \"src/**/*.test.*\"",
|
|
64
48
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
65
49
|
},
|
|
66
50
|
"devDependencies": {
|
|
67
51
|
"hyperapp": "^1.2.10",
|
|
68
|
-
"piral-core": "1.6.0-beta.
|
|
52
|
+
"piral-core": "1.6.0-beta.7243"
|
|
69
53
|
},
|
|
70
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
|
|
71
55
|
}
|
package/esm/converter.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ForeignComponent, BaseComponentProps } from 'piral-core';
|
|
2
|
-
import type { Component } from './types';
|
|
3
|
-
export interface HyperappConverterOptions {
|
|
4
|
-
/**
|
|
5
|
-
* Defines the name of the root element.
|
|
6
|
-
* @default piral-slot
|
|
7
|
-
*/
|
|
8
|
-
rootName?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function createConverter(config?: HyperappConverterOptions): {
|
|
11
|
-
<TProps extends BaseComponentProps>(root: Component<TProps, {}, {}>, state: any, actions: any): ForeignComponent<TProps>;
|
|
12
|
-
Extension: Component<import("piral-core").ExtensionSlotProps, {}, {}>;
|
|
13
|
-
};
|
package/esm/converter.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { mountHyperapp } 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, state, actions) => ({
|
|
7
|
-
mount(el, props, ctx) {
|
|
8
|
-
mountHyperapp(el, root, props, ctx, state, actions);
|
|
9
|
-
},
|
|
10
|
-
unmount(el) {
|
|
11
|
-
el.innerHTML = '';
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
convert.Extension = Extension;
|
|
15
|
-
return convert;
|
|
16
|
-
}
|
|
17
|
-
//# 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":"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,YAAY,EAAE,GAAG,MAAM,CAAC;IAC3C,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/create.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PiralPlugin } from 'piral-core';
|
|
2
|
-
import { HyperappConverterOptions } from './converter';
|
|
3
|
-
import type { PiletHyperappApi } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Available configuration options for the Hyperapp plugin.
|
|
6
|
-
*/
|
|
7
|
-
export interface HyperappConfig extends HyperappConverterOptions {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Creates new Pilet API extensions for the Hyperapp integration.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createHyperappApi(config?: HyperappConfig): PiralPlugin<PiletHyperappApi>;
|
package/esm/create.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createConverter } from './converter';
|
|
2
|
-
/**
|
|
3
|
-
* Creates new Pilet API extensions for the Hyperapp integration.
|
|
4
|
-
*/
|
|
5
|
-
export function createHyperappApi(config = {}) {
|
|
6
|
-
return (context) => {
|
|
7
|
-
const convert = createConverter(config);
|
|
8
|
-
context.converters.hyperapp = ({ root, state, actions }) => convert(root, state, actions);
|
|
9
|
-
return {
|
|
10
|
-
fromHyperapp(root, state, actions) {
|
|
11
|
-
return {
|
|
12
|
-
type: 'hyperapp',
|
|
13
|
-
root,
|
|
14
|
-
state,
|
|
15
|
-
actions,
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
HyperappExtension: convert.Extension,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# 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,EAA4B,MAAM,aAAa,CAAC;AAQxE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAyB,EAAE;IAC3D,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAE1F,OAAO;YACL,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO;gBAC/B,OAAO;oBACL,IAAI,EAAE,UAAU;oBAChB,IAAI;oBACJ,KAAK;oBACL,OAAO;iBACR,CAAC;YACJ,CAAC;YACD,iBAAiB,EAAE,OAAO,CAAC,SAAS;SACrC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/esm/extension.d.ts
DELETED
package/esm/extension.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createHyperappElement } from './mount';
|
|
2
|
-
export function createExtension(rootName) {
|
|
3
|
-
return (props) => createHyperappElement(rootName, {
|
|
4
|
-
oncreate(element) {
|
|
5
|
-
element.dispatchEvent(new CustomEvent('render-html', {
|
|
6
|
-
bubbles: true,
|
|
7
|
-
detail: {
|
|
8
|
-
target: element,
|
|
9
|
-
props,
|
|
10
|
-
},
|
|
11
|
-
}));
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
//# 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,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,CAAC,KAAK,EAAE,EAAE,CACf,qBAAqB,CAAC,QAAQ,EAAE;QAC9B,QAAQ,CAAC,OAAoB;YAC3B,OAAO,CAAC,aAAa,CACnB,IAAI,WAAW,CAAC,aAAa,EAAE;gBAC7B,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACN,MAAM,EAAE,OAAO;oBACf,KAAK;iBACN;aACF,CAAC,CACH,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACP,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
package/esm/mount.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const { h, app } = require('hyperapp');
|
|
2
|
-
export function mountHyperapp(el, root, props, ctx, state, actions) {
|
|
3
|
-
app({
|
|
4
|
-
...ctx,
|
|
5
|
-
...state,
|
|
6
|
-
}, actions, () => h(root, props), el);
|
|
7
|
-
}
|
|
8
|
-
export function createHyperappElement(name, props) {
|
|
9
|
-
return h(name, props, []);
|
|
10
|
-
}
|
|
11
|
-
//# 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":"AAEA,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvC,MAAM,UAAU,aAAa,CAC3B,EAAe,EACf,IAAkB,EAClB,KAAQ,EACR,GAAQ,EACR,KAAU,EACV,OAAY;IAEZ,GAAG,CACD;QACE,GAAG,GAAG;QACN,GAAG,KAAK;KACT,EACD,OAAO,EACP,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EACpB,EAAE,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,KAAU;IAC5D,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC"}
|
package/esm/types.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
2
|
-
declare module 'piral-core/lib/types/custom' {
|
|
3
|
-
interface PiletCustomApi extends PiletHyperappApi {
|
|
4
|
-
}
|
|
5
|
-
interface PiralCustomComponentConverters<TProps> {
|
|
6
|
-
hyperapp(component: HyperappComponent<TProps>): ForeignComponent<TProps>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface HyperappComponent<TProps> {
|
|
10
|
-
/**
|
|
11
|
-
* The component root.
|
|
12
|
-
*/
|
|
13
|
-
root: Component<TProps>;
|
|
14
|
-
/**
|
|
15
|
-
* The local state of the component.
|
|
16
|
-
*/
|
|
17
|
-
state: any;
|
|
18
|
-
/**
|
|
19
|
-
* The actions of the component.
|
|
20
|
-
*/
|
|
21
|
-
actions: any;
|
|
22
|
-
/**
|
|
23
|
-
* The type of the Hyperapp component.
|
|
24
|
-
*/
|
|
25
|
-
type: 'hyperapp';
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* The view function describes the application UI as a tree of VNodes.
|
|
29
|
-
* @returns A VNode tree.
|
|
30
|
-
* @memberOf [App]
|
|
31
|
-
*/
|
|
32
|
-
export interface View<State, Actions> {
|
|
33
|
-
(state: State, actions: Actions): VNode<object> | null;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The VDOM representation of an Element.
|
|
37
|
-
* @memberOf [VDOM]
|
|
38
|
-
*/
|
|
39
|
-
export interface VNode<Attributes = {}> {
|
|
40
|
-
nodeName: string;
|
|
41
|
-
attributes?: Attributes;
|
|
42
|
-
children: Array<VNode | string>;
|
|
43
|
-
key: string | number | null;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* A Component is a function that returns a custom VNode or View.
|
|
47
|
-
* @memberOf [VDOM]
|
|
48
|
-
*/
|
|
49
|
-
export interface Component<Attributes = {}, State = {}, Actions = {}> {
|
|
50
|
-
(attributes: Attributes, children?: Array<VNode | string>): VNode<Attributes> | View<State, Actions>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Defines the provided set of the Hyperapp plugin.
|
|
54
|
-
*/
|
|
55
|
-
export interface PiletHyperappApi {
|
|
56
|
-
/**
|
|
57
|
-
* Wraps a Hyperapp component for use in Piral.
|
|
58
|
-
* @param component The component root.
|
|
59
|
-
* @param state The local state of the component.
|
|
60
|
-
* @param actions The actions available to the component.
|
|
61
|
-
* @returns The Piral Hyperapp component.
|
|
62
|
-
*/
|
|
63
|
-
fromHyperapp<TProps>(component: Component<TProps>, state?: any, actions?: any): HyperappComponent<TProps>;
|
|
64
|
-
/**
|
|
65
|
-
* Hyperapp component for displaying extensions of the given name.
|
|
66
|
-
*/
|
|
67
|
-
HyperappExtension: Component<ExtensionSlotProps>;
|
|
68
|
-
}
|
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":""}
|