@mittwald/flow-remote-core 0.2.0-alpha.7 → 0.2.0-alpha.70
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/dist/index.js +37 -33
- package/dist/types/connection/connectHostRenderRoot.d.ts +7 -0
- package/dist/types/connection/connectHostRenderRoot.d.ts.map +1 -0
- package/dist/types/connection/connectRemoteIframe.d.ts +2 -0
- package/dist/types/connection/connectRemoteIframe.d.ts.map +1 -0
- package/dist/types/events/FlowRemoteEvent.d.ts +1 -0
- package/dist/types/events/FlowRemoteEvent.d.ts.map +1 -0
- package/dist/types/events/index.d.ts +1 -0
- package/dist/types/events/index.d.ts.map +1 -0
- package/dist/types/events/serializers.d.ts +1 -0
- package/dist/types/events/serializers.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +18 -22
- package/dist/polyfill.js +0 -1
- package/dist/types/connection/connectHostIframe.d.ts +0 -2
- package/dist/types/polyfill.d.ts +0 -0
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RemoteElement as j, RemoteEvent as k } from "@remote-dom/core/elements";
|
|
2
|
+
import { ThreadNestedIframe as a, ThreadIframe as m } from "@quilted/threads";
|
|
3
3
|
import * as n from "remeda";
|
|
4
|
-
import { isObjectType as
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
import { isObjectType as d, isString as p, isNumber as u, isBoolean as l } from "remeda";
|
|
5
|
+
const b = (e) => new a({
|
|
6
|
+
exports: {
|
|
7
|
+
render: (t) => {
|
|
8
|
+
import("@remote-dom/core/elements").then(
|
|
9
|
+
({ RemoteMutationObserver: r }) => {
|
|
10
|
+
new r(t).observe(e);
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}), v = (e) => {
|
|
16
|
+
e === null || "__remoteConnectionEstablished" in e || (b(e), Object.assign(e, { __remoteConnectionEstablished: !0 }));
|
|
17
|
+
}, R = (e) => {
|
|
18
|
+
const t = new m(e.iframe);
|
|
7
19
|
return t.imports.render(e.connection), t;
|
|
8
|
-
},
|
|
9
|
-
t &&
|
|
20
|
+
}, y = (e) => (t) => {
|
|
21
|
+
t && ("__remoteConnectionEstablished" in t || (R({
|
|
10
22
|
iframe: t,
|
|
11
23
|
connection: e
|
|
12
|
-
}));
|
|
13
|
-
}, l = (e) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
render: (t) => {
|
|
17
|
-
new m(t).observe(e);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}, C = (e) => {
|
|
22
|
-
e && !("__remoteConnectionEstablished" in e) && (Object.assign(e, { __remoteConnectionEstablished: !0 }), l(e));
|
|
23
|
-
}, u = (e) => d(e) || p(e) || b(e), _ = (e) => a(e) ? n.pickBy(e, u) : e, w = (...e) => (t) => n.pick(t, e), v = _, O = (e, t, o = {}) => (r) => {
|
|
24
|
-
const s = o[t] ?? v;
|
|
25
|
-
return e(s(r));
|
|
24
|
+
}), Object.assign(t, { __remoteConnectionEstablished: !0 })));
|
|
25
|
+
}, s = (e) => p(e) || u(e) || l(e) || n.isArray(e) && e.every(s), i = (e) => n.isArray(e) ? e.map(i) : d(e) ? n.pickBy(e, s) : e, C = (...e) => (t) => n.pick(t, e), f = i, h = (e, t, r = {}) => (o) => {
|
|
26
|
+
const c = r[t] ?? f;
|
|
27
|
+
return e(c(o));
|
|
26
28
|
};
|
|
27
|
-
class
|
|
28
|
-
constructor(t,
|
|
29
|
+
class w extends CustomEvent {
|
|
30
|
+
constructor(t, r) {
|
|
29
31
|
super(t, {
|
|
30
|
-
detail:
|
|
32
|
+
detail: r
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
w as FlowRemoteEvent,
|
|
38
|
+
j as RemoteElement,
|
|
39
|
+
k as RemoteEvent,
|
|
40
|
+
b as connectHostRenderRoot,
|
|
41
|
+
v as connectHostRenderRootRef,
|
|
42
|
+
R as connectRemoteIframe,
|
|
43
|
+
y as connectRemoteIframeRef,
|
|
44
|
+
h as mapEventHandler,
|
|
45
|
+
C as pick,
|
|
46
|
+
i as primitiveFlat,
|
|
47
|
+
f as standard
|
|
44
48
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ThreadNestedIframe } from '@quilted/threads';
|
|
2
|
+
import { RemoteConnection } from '@remote-dom/core/elements';
|
|
3
|
+
export declare const connectHostRenderRoot: (div: HTMLDivElement) => ThreadNestedIframe<Record<string, never>, {
|
|
4
|
+
render: (connection: RemoteConnection) => void;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const connectHostRenderRootRef: (ref: HTMLDivElement | null) => void;
|
|
7
|
+
//# sourceMappingURL=connectHostRenderRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectHostRenderRoot.d.ts","sourceRoot":"","sources":["../../../src/connection/connectHostRenderRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,eAAO,MAAM,qBAAqB,QAAS,cAAc;yBAG9B,gBAAgB;EAU1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,cAAc,GAAG,IAAI,SAMlE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ThreadIframe } from '@quilted/threads';
|
|
2
2
|
import { RemoteConnection } from '@remote-dom/core/elements';
|
|
3
|
+
export type HostData = Record<string, unknown>;
|
|
3
4
|
interface Opts {
|
|
4
5
|
connection: RemoteConnection;
|
|
5
6
|
iframe: HTMLIFrameElement;
|
|
@@ -10,3 +11,4 @@ interface ThreadIframeTarget {
|
|
|
10
11
|
export declare const connectRemoteIframe: (opts: Opts) => ThreadIframe<ThreadIframeTarget, Record<string, never>>;
|
|
11
12
|
export declare const connectRemoteIframeRef: (connection: RemoteConnection) => (ref: HTMLIFrameElement | null) => void;
|
|
12
13
|
export {};
|
|
14
|
+
//# sourceMappingURL=connectRemoteIframe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectRemoteIframe.d.ts","sourceRoot":"","sources":["../../../src/connection/connectRemoteIframe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,aAAa,CAAC,OAAO,CAAC,CAAC;CAClE;AAED,eAAO,MAAM,mBAAmB,SAAU,IAAI,4DAI7C,CAAC;AAEF,eAAO,MAAM,sBAAsB,eACpB,gBAAgB,WAAW,iBAAiB,GAAG,IAAI,SAc/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowRemoteEvent.d.ts","sourceRoot":"","sources":["../../../src/events/FlowRemoteEvent.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAe,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;gBACjC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;CAK3C"}
|
|
@@ -2,3 +2,4 @@ export type EventHandler = (event: unknown) => void;
|
|
|
2
2
|
export declare const mapEventHandler: (eventHandler: EventHandler, eventName: string, eventSerialization?: EventSerializationMap) => (event: unknown) => void;
|
|
3
3
|
export type EventSerialization = (event: unknown) => unknown;
|
|
4
4
|
export type EventSerializationMap = Record<string, EventSerialization>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/events/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpD,eAAO,MAAM,eAAe,iBAEV,YAAY,aACf,MAAM,uBACG,qBAAqB,aAEnC,OAAO,SAGd,CAAC;AAEJ,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;AAC7D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializers.d.ts","sourceRoot":"","sources":["../../../src/events/serializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAUzD,eAAO,MAAM,aAAa,EAAE,kBAKf,CAAC;AAEd,eAAO,MAAM,IAAI,aACJ,MAAM,EAAE,KAAG,kBAGrB,CAAC;AAEJ,eAAO,MAAM,QAAQ,oBAAgB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export { RemoteElement, RemoteEvent, type RemoteElementConstructor, } from '@remote-dom/core/elements';
|
|
2
|
+
export * from './connection/connectHostRenderRoot';
|
|
1
3
|
export * from './connection/connectRemoteIframe';
|
|
2
|
-
export * from './connection/connectHostIframe';
|
|
3
4
|
export * from './events';
|
|
4
5
|
export * from './events/FlowRemoteEvent';
|
|
5
6
|
export * from './events/serializers';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-core",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.70",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core functionality to setup a remote/host environment",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/types/index.d.ts",
|
|
11
11
|
"default": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./polyfill": {
|
|
14
|
-
"types": "./dist/types/polyfill.d.ts",
|
|
15
|
-
"default": "./dist/polyfill.js"
|
|
16
12
|
}
|
|
17
13
|
},
|
|
18
14
|
"files": [
|
|
@@ -22,28 +18,28 @@
|
|
|
22
18
|
"node": ">=20.11"
|
|
23
19
|
},
|
|
24
20
|
"scripts": {
|
|
25
|
-
"build": "
|
|
26
|
-
"
|
|
27
|
-
"test": "",
|
|
28
|
-
"test:compile": "
|
|
21
|
+
"build": "vite build --config vite.build.config.ts",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"test": "exit 0",
|
|
24
|
+
"test:compile": "tsc --noEmit"
|
|
29
25
|
},
|
|
30
26
|
"dependencies": {
|
|
31
|
-
"@quilted/threads": "^3.1.
|
|
32
|
-
"
|
|
27
|
+
"@quilted/threads": "^3.1.3",
|
|
28
|
+
"@remote-dom/core": "1.7.0",
|
|
29
|
+
"remeda": "^2.20.2"
|
|
33
30
|
},
|
|
34
31
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@types/node": "^22.
|
|
37
|
-
"nx": "^20.
|
|
38
|
-
"prettier": "^3.
|
|
32
|
+
"@mittwald/typescript-config": "workspace:*",
|
|
33
|
+
"@types/node": "^22.13.4",
|
|
34
|
+
"nx": "^20.4.5",
|
|
35
|
+
"prettier": "^3.5.1",
|
|
36
|
+
"rimraf": "^6.0.1",
|
|
37
|
+
"rollup-preserve-directives": "^1.1.3",
|
|
39
38
|
"typescript": "^5.7.3",
|
|
40
|
-
"vite": "^
|
|
39
|
+
"vite": "^6.1.1",
|
|
41
40
|
"vite-plugin-checker": "^0.8.0",
|
|
42
|
-
"vite-plugin-dts": "^4.
|
|
43
|
-
"vite-plugin-externalize-deps": "^0.
|
|
41
|
+
"vite-plugin-dts": "^4.5.0",
|
|
42
|
+
"vite-plugin-externalize-deps": "^0.9.0"
|
|
44
43
|
},
|
|
45
|
-
"
|
|
46
|
-
"@remote-dom/core": "^1.5.2"
|
|
47
|
-
},
|
|
48
|
-
"gitHead": "050fa81621ad4296e032878f27f24e2ac9885854"
|
|
44
|
+
"gitHead": "7f3dcecf0820391fb4da2d126a02bca00bff0784"
|
|
49
45
|
}
|
package/dist/polyfill.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@remote-dom/core/polyfill";
|
package/dist/types/polyfill.d.ts
DELETED
|
File without changes
|