piral-cycle 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 +9 -13
- 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/types.js +1 -2
- package/package.json +9 -25
- package/esm/converter.d.ts +0 -14
- package/esm/converter.js +0 -34
- 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 -6
- package/esm/extension.js +0 -19
- 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/types.d.ts +0 -49
- 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 CycleConverter {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function createCycleConverter(...params: Parameters<typeof createConverter>): {
|
|
14
14
|
from: CycleConverter;
|
|
15
|
-
Extension: import("./
|
|
15
|
+
Extension: import("./lib/extension").CycleExtension;
|
|
16
16
|
};
|
|
17
|
-
declare const fromCycle: CycleConverter, CycleExtension: import("./
|
|
17
|
+
declare const fromCycle: CycleConverter, CycleExtension: import("./lib/extension").CycleExtension;
|
|
18
18
|
export { fromCycle, CycleExtension };
|
package/convert.js
CHANGED
package/lib/converter.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const xstream_1 = require("xstream");
|
|
7
|
-
const extension_1 = require("./extension");
|
|
8
|
-
function createConverter(config = {}) {
|
|
1
|
+
import { makeDOMDriver } from '@cycle/dom';
|
|
2
|
+
import run from '@cycle/run';
|
|
3
|
+
import xs from 'xstream';
|
|
4
|
+
import { createExtension } from './extension';
|
|
5
|
+
export function createConverter(config = {}) {
|
|
9
6
|
const { rootName = 'piral-slot' } = config;
|
|
10
|
-
const Extension =
|
|
7
|
+
const Extension = createExtension(rootName);
|
|
11
8
|
const convert = (main) => ({
|
|
12
9
|
mount(el, props, ctx, locals) {
|
|
13
|
-
locals.props$ =
|
|
10
|
+
locals.props$ = xs.create();
|
|
14
11
|
// The Cycle DOM element is not directly rendered into parent, but into a nested container.
|
|
15
12
|
// This is done because Cycle "erases" information on the host element. If parent was used,
|
|
16
13
|
// Piral related properties like data-portal-id could be removed, leading to things not working.
|
|
17
14
|
const host = el.appendChild(document.createElement(rootName));
|
|
18
15
|
const drivers = {
|
|
19
|
-
DOM:
|
|
16
|
+
DOM: makeDOMDriver(host),
|
|
20
17
|
props: () => locals.props$,
|
|
21
18
|
};
|
|
22
|
-
locals.dispose = (
|
|
19
|
+
locals.dispose = run(main, drivers);
|
|
23
20
|
locals.props$.shamefullySendNext(props);
|
|
24
21
|
},
|
|
25
22
|
update(el, props, ctx, locals) {
|
|
@@ -34,5 +31,4 @@ function createConverter(config = {}) {
|
|
|
34
31
|
convert.Extension = Extension;
|
|
35
32
|
return convert;
|
|
36
33
|
}
|
|
37
|
-
exports.createConverter = createConverter;
|
|
38
34
|
//# 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,YAAY,CAAC;AAC3C,OAAO,GAA2B,MAAM,YAAY,CAAC;AACrD,OAAO,EAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgB9C,MAAM,UAAU,eAAe,CAAC,SAAgC,EAAE;IAChE,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC;IAC3C,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAO,EACmB,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YAC9C,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,EAAU,CAAC;YAEpC,2FAA2F;YAC3F,2FAA2F;YAC3F,gGAAgG;YAChG,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAE9D,MAAM,OAAO,GAA4B;gBACvC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM;aAC3B,CAAC;YAEF,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,IAAY,EAAE,OAAO,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YAC/C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,MAA0B;YACpC,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;YACvC,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;QAC5B,CAAC;KACF,CAAC,CAAC;IAEH,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.createCycleApi = void 0;
|
|
4
|
-
const converter_1 = require("./converter");
|
|
1
|
+
import { createConverter } from './converter';
|
|
5
2
|
/**
|
|
6
3
|
* Creates new Pilet API extensions for integration of Cycle.
|
|
7
4
|
*/
|
|
8
|
-
function createCycleApi(config = {}) {
|
|
5
|
+
export function createCycleApi(config = {}) {
|
|
9
6
|
return (context) => {
|
|
10
|
-
const convert =
|
|
7
|
+
const convert = createConverter(config);
|
|
11
8
|
context.converters.cycle = ({ root }) => convert(root);
|
|
12
9
|
return {
|
|
13
10
|
fromCycle(root) {
|
|
@@ -20,5 +17,4 @@ function createCycleApi(config = {}) {
|
|
|
20
17
|
};
|
|
21
18
|
};
|
|
22
19
|
}
|
|
23
|
-
exports.createCycleApi = createCycleApi;
|
|
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,EAAyB,MAAM,aAAa,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAsB,EAAE;IACrD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEvD,OAAO;YACL,SAAS,CAAC,IAAI;gBACZ,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,cAAc,EAAE,OAAO,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/extension.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const dom_1 = require("@cycle/dom");
|
|
5
|
-
function createExtension(rootName) {
|
|
6
|
-
return (props) => (0, dom_1.h)(rootName, {
|
|
1
|
+
import { h } from '@cycle/dom';
|
|
2
|
+
export function createExtension(rootName) {
|
|
3
|
+
return (props) => h(rootName, {
|
|
7
4
|
hook: {
|
|
8
5
|
insert: (vnode) => {
|
|
9
6
|
if (vnode.elm instanceof HTMLElement) {
|
|
@@ -19,5 +16,4 @@ function createExtension(rootName) {
|
|
|
19
16
|
},
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
|
-
exports.createExtension = createExtension;
|
|
23
19
|
//# 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":"AAAA,OAAO,EAAE,CAAC,EAAS,MAAM,YAAY,CAAC;AAOtC,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,CAAC,KAAK,EAAE,EAAE,CACf,CAAC,CAAC,QAAQ,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,KAAK,CAAC,GAAG,YAAY,WAAW,EAAE;oBACpC,KAAK,CAAC,GAAG,CAAC,aAAa,CACrB,IAAI,WAAW,CAAC,aAAa,EAAE;wBAC7B,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE;4BACN,MAAM,EAAE,KAAK,CAAC,GAAG;4BACjB,KAAK;yBACN;qBACF,CAAC,CACH,CAAC;iBACH;YACH,CAAC;SACF;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/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-cycle",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.7243",
|
|
4
4
|
"description": "Plugin for integrating Cycle.js 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,18 +41,17 @@
|
|
|
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-cycle.json src --exclude \"src/**/*.test.*\"",
|
|
64
48
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
65
49
|
},
|
|
66
50
|
"devDependencies": {
|
|
67
51
|
"@cycle/dom": "^22.7.0",
|
|
68
52
|
"@cycle/run": "^5.4.0",
|
|
69
|
-
"piral-core": "1.6.0-beta.
|
|
53
|
+
"piral-core": "1.6.0-beta.7243",
|
|
70
54
|
"xstream": "^11.12.0"
|
|
71
55
|
},
|
|
72
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "bbb6e4f78c61b6ef753099a5b378ad2708565ce3"
|
|
73
57
|
}
|
package/esm/converter.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BaseComponentProps, ForeignComponent } from 'piral-core';
|
|
2
|
-
import { MatchingMain } from '@cycle/run';
|
|
3
|
-
import type { PiralDomDrivers } from './types';
|
|
4
|
-
export interface CycleConverterOptions {
|
|
5
|
-
/**
|
|
6
|
-
* The tag name of the root element into which a CycleExtension is rendered.
|
|
7
|
-
* @default piral-slot
|
|
8
|
-
*/
|
|
9
|
-
rootName?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare function createConverter(config?: CycleConverterOptions): {
|
|
12
|
-
<TProps extends BaseComponentProps, M extends MatchingMain<PiralDomDrivers<TProps>, M>>(main: M): ForeignComponent<TProps>;
|
|
13
|
-
Extension: import("./extension").CycleExtension;
|
|
14
|
-
};
|
package/esm/converter.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { makeDOMDriver } from '@cycle/dom';
|
|
2
|
-
import run from '@cycle/run';
|
|
3
|
-
import xs from 'xstream';
|
|
4
|
-
import { createExtension } from './extension';
|
|
5
|
-
export function createConverter(config = {}) {
|
|
6
|
-
const { rootName = 'piral-slot' } = config;
|
|
7
|
-
const Extension = createExtension(rootName);
|
|
8
|
-
const convert = (main) => ({
|
|
9
|
-
mount(el, props, ctx, locals) {
|
|
10
|
-
locals.props$ = xs.create();
|
|
11
|
-
// The Cycle DOM element is not directly rendered into parent, but into a nested container.
|
|
12
|
-
// This is done because Cycle "erases" information on the host element. If parent was used,
|
|
13
|
-
// Piral related properties like data-portal-id could be removed, leading to things not working.
|
|
14
|
-
const host = el.appendChild(document.createElement(rootName));
|
|
15
|
-
const drivers = {
|
|
16
|
-
DOM: makeDOMDriver(host),
|
|
17
|
-
props: () => locals.props$,
|
|
18
|
-
};
|
|
19
|
-
locals.dispose = run(main, drivers);
|
|
20
|
-
locals.props$.shamefullySendNext(props);
|
|
21
|
-
},
|
|
22
|
-
update(el, props, ctx, locals) {
|
|
23
|
-
locals.props$.shamefullySendNext(props);
|
|
24
|
-
},
|
|
25
|
-
unmount(el, locals) {
|
|
26
|
-
locals.props$.shamefullySendComplete();
|
|
27
|
-
locals.dispose();
|
|
28
|
-
locals.props$ = undefined;
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
convert.Extension = Extension;
|
|
32
|
-
return convert;
|
|
33
|
-
}
|
|
34
|
-
//# 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,YAAY,CAAC;AAC3C,OAAO,GAA2B,MAAM,YAAY,CAAC;AACrD,OAAO,EAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgB9C,MAAM,UAAU,eAAe,CAAC,SAAgC,EAAE;IAChE,MAAM,EAAE,QAAQ,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC;IAC3C,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,CACd,IAAO,EACmB,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YAC9C,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,EAAU,CAAC;YAEpC,2FAA2F;YAC3F,2FAA2F;YAC3F,gGAAgG;YAChG,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;YAE9D,MAAM,OAAO,GAA4B;gBACvC,GAAG,EAAE,aAAa,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM;aAC3B,CAAC;YAEF,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,IAAY,EAAE,OAAO,CAAC,CAAC;YAC5C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAA0B;YAC/C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,MAA0B;YACpC,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;YACvC,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;QAC5B,CAAC;KACF,CAAC,CAAC;IAEH,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 { CycleConverterOptions } from './converter';
|
|
3
|
-
import type { PiletCycleApi } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Available configuration options for the Cycle.js plugin.
|
|
6
|
-
*/
|
|
7
|
-
export interface CycleConfig extends CycleConverterOptions {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Creates new Pilet API extensions for integration of Cycle.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createCycleApi(config?: CycleConfig): PiralPlugin<PiletCycleApi>;
|
package/esm/create.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createConverter } from './converter';
|
|
2
|
-
/**
|
|
3
|
-
* Creates new Pilet API extensions for integration of Cycle.
|
|
4
|
-
*/
|
|
5
|
-
export function createCycleApi(config = {}) {
|
|
6
|
-
return (context) => {
|
|
7
|
-
const convert = createConverter(config);
|
|
8
|
-
context.converters.cycle = ({ root }) => convert(root);
|
|
9
|
-
return {
|
|
10
|
-
fromCycle(root) {
|
|
11
|
-
return {
|
|
12
|
-
type: 'cycle',
|
|
13
|
-
root,
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
CycleExtension: 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,EAAyB,MAAM,aAAa,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,SAAsB,EAAE;IACrD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEvD,OAAO;YACL,SAAS,CAAC,IAAI;gBACZ,OAAO;oBACL,IAAI,EAAE,OAAO;oBACb,IAAI;iBACL,CAAC;YACJ,CAAC;YACD,cAAc,EAAE,OAAO,CAAC,SAAS;SAClC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/esm/extension.d.ts
DELETED
package/esm/extension.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { h } from '@cycle/dom';
|
|
2
|
-
export function createExtension(rootName) {
|
|
3
|
-
return (props) => h(rootName, {
|
|
4
|
-
hook: {
|
|
5
|
-
insert: (vnode) => {
|
|
6
|
-
if (vnode.elm instanceof HTMLElement) {
|
|
7
|
-
vnode.elm.dispatchEvent(new CustomEvent('render-html', {
|
|
8
|
-
bubbles: true,
|
|
9
|
-
detail: {
|
|
10
|
-
target: vnode.elm,
|
|
11
|
-
props,
|
|
12
|
-
},
|
|
13
|
-
}));
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//# 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":"AAAA,OAAO,EAAE,CAAC,EAAS,MAAM,YAAY,CAAC;AAOtC,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,CAAC,KAAK,EAAE,EAAE,CACf,CAAC,CAAC,QAAQ,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,IAAI,KAAK,CAAC,GAAG,YAAY,WAAW,EAAE;oBACpC,KAAK,CAAC,GAAG,CAAC,aAAa,CACrB,IAAI,WAAW,CAAC,aAAa,EAAE;wBAC7B,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE;4BACN,MAAM,EAAE,KAAK,CAAC,GAAG;4BACjB,KAAK;yBACN;qBACF,CAAC,CACH,CAAC;iBACH;YACH,CAAC;SACF;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/types.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Stream } from 'xstream';
|
|
2
|
-
import type { Driver, Drivers, MatchingMain, Main } from '@cycle/run';
|
|
3
|
-
import type { MainDOMSource, VNode } from '@cycle/dom';
|
|
4
|
-
import type { ForeignComponent, ExtensionSlotProps } from 'piral-core';
|
|
5
|
-
declare module 'piral-core/lib/types/custom' {
|
|
6
|
-
interface PiletCustomApi extends PiletCycleApi {
|
|
7
|
-
}
|
|
8
|
-
interface PiralCustomComponentConverters<TProps> {
|
|
9
|
-
cycle(component: CycleComponent<TProps>): ForeignComponent<TProps>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* The drivers which are available to a Cycle.js component hosted via this plugin's converter.
|
|
14
|
-
*/
|
|
15
|
-
export interface PiralDomDrivers<TProps> extends Drivers {
|
|
16
|
-
/**
|
|
17
|
-
* A DOM Driver giving access to the DOM where the component is mounted.
|
|
18
|
-
*/
|
|
19
|
-
DOM: Driver<Stream<VNode>, MainDOMSource>;
|
|
20
|
-
/**
|
|
21
|
-
* A driver giving access to Piral specific properties passed down to the component.
|
|
22
|
-
*/
|
|
23
|
-
props: Driver<void, Stream<TProps>>;
|
|
24
|
-
}
|
|
25
|
-
export interface CycleComponent<TProps> {
|
|
26
|
-
/**
|
|
27
|
-
* The component root.
|
|
28
|
-
*/
|
|
29
|
-
root: MatchingMain<PiralDomDrivers<TProps>, Main>;
|
|
30
|
-
/**
|
|
31
|
-
* The type of the Cycle.js component.
|
|
32
|
-
*/
|
|
33
|
-
type: 'cycle';
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Defines the provided set of Cycle.js Pilet API extensions.
|
|
37
|
-
*/
|
|
38
|
-
export interface PiletCycleApi {
|
|
39
|
-
/**
|
|
40
|
-
* Wraps a Cycle.js component for use in Piral.
|
|
41
|
-
* @param component The Cycle.js component/main function to be wrapped.
|
|
42
|
-
* @returns The Piral Cycle.js component.
|
|
43
|
-
*/
|
|
44
|
-
fromCycle<TProps>(root: MatchingMain<PiralDomDrivers<TProps>, Main>): CycleComponent<TProps>;
|
|
45
|
-
/**
|
|
46
|
-
* Renders a Piral extension into a Cycle component.
|
|
47
|
-
*/
|
|
48
|
-
CycleExtension(props: ExtensionSlotProps<unknown>): VNode;
|
|
49
|
-
}
|
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":""}
|