@mittwald/flow-remote-core 0.2.0-alpha.46 → 0.2.0-alpha.47

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/dist/index.js CHANGED
@@ -2,15 +2,8 @@ import { RemoteElement as j, RemoteEvent as k } from "@remote-dom/core/elements"
2
2
  import { ThreadNestedIframe as a, ThreadIframe as m } from "@quilted/threads";
3
3
  import * as n from "remeda";
4
4
  import { isObjectType as d, isString as p, isNumber as u, isBoolean as l } from "remeda";
5
- const R = (e) => new a({
5
+ const b = (e) => new a({
6
6
  exports: {
7
- receiveData: (t) => {
8
- window.dispatchEvent(
9
- new CustomEvent("flr-data-received", {
10
- detail: t
11
- })
12
- );
13
- },
14
7
  render: (t) => {
15
8
  import("@remote-dom/core/elements").then(
16
9
  ({ RemoteMutationObserver: r }) => {
@@ -19,24 +12,21 @@ const R = (e) => new a({
19
12
  );
20
13
  }
21
14
  }
22
- }), E = (e) => {
23
- e === null || "__remoteConnectionEstablished" in e || (R(e), Object.assign(e, { __remoteConnectionEstablished: !0 }));
24
- }, v = (e) => {
15
+ }), v = (e) => {
16
+ e === null || "__remoteConnectionEstablished" in e || (b(e), Object.assign(e, { __remoteConnectionEstablished: !0 }));
17
+ }, R = (e) => {
25
18
  const t = new m(e.iframe);
26
19
  return t.imports.render(e.connection), t;
27
- }, w = (e) => (t) => {
28
- if ("__remoteConnection" in t)
29
- return t.__remoteConnection;
30
- const r = v({
20
+ }, y = (e) => (t) => {
21
+ t && ("__remoteConnectionEstablished" in t || (R({
31
22
  iframe: t,
32
23
  connection: e
33
- });
34
- return Object.assign(t, { __remoteConnection: r.imports }), r.imports;
35
- }, 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), _ = i, y = (e, t, r = {}) => (o) => {
36
- const c = r[t] ?? _;
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;
37
27
  return e(c(o));
38
28
  };
39
- class h extends CustomEvent {
29
+ class w extends CustomEvent {
40
30
  constructor(t, r) {
41
31
  super(t, {
42
32
  detail: r
@@ -44,15 +34,15 @@ class h extends CustomEvent {
44
34
  }
45
35
  }
46
36
  export {
47
- h as FlowRemoteEvent,
37
+ w as FlowRemoteEvent,
48
38
  j as RemoteElement,
49
39
  k as RemoteEvent,
50
- R as connectHostRenderRoot,
51
- E as connectHostRenderRootRef,
52
- v as connectRemoteIframe,
53
- w as connectRemoteIframeRef,
54
- y as mapEventHandler,
40
+ b as connectHostRenderRoot,
41
+ v as connectHostRenderRootRef,
42
+ R as connectRemoteIframe,
43
+ y as connectRemoteIframeRef,
44
+ h as mapEventHandler,
55
45
  C as pick,
56
46
  i as primitiveFlat,
57
- _ as standard
47
+ f as standard
58
48
  };
@@ -1,7 +1,6 @@
1
1
  import { ThreadNestedIframe } from '@quilted/threads';
2
2
  import { RemoteConnection } from '@remote-dom/core/elements';
3
3
  export declare const connectHostRenderRoot: (div: HTMLDivElement) => ThreadNestedIframe<Record<string, never>, {
4
- receiveData: (data: unknown) => void;
5
4
  render: (connection: RemoteConnection) => void;
6
5
  }>;
7
6
  export declare const connectHostRenderRootRef: (ref: HTMLDivElement | null) => void;
@@ -1 +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;wBAG/B,OAAO;yBAON,gBAAgB;EAU1C,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,cAAc,GAAG,IAAI,SAMlE,CAAC"}
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,14 +1,14 @@
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;
6
7
  }
7
8
  interface ThreadIframeTarget {
8
9
  render: (connection: RemoteConnection) => AsyncIterator<unknown>;
9
- receiveData: (data: unknown) => void;
10
10
  }
11
11
  export declare const connectRemoteIframe: (opts: Opts) => ThreadIframe<ThreadIframeTarget, Record<string, never>>;
12
- export declare const connectRemoteIframeRef: (connection: RemoteConnection) => (ref: HTMLIFrameElement) => ThreadIframeTarget;
12
+ export declare const connectRemoteIframeRef: (connection: RemoteConnection) => (ref: HTMLIFrameElement | null) => void;
13
13
  export {};
14
14
  //# sourceMappingURL=connectRemoteIframe.d.ts.map
@@ -1 +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,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;IACjE,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,mBAAmB,SAAU,IAAI,4DAI7C,CAAC;AAEF,eAAO,MAAM,sBAAsB,eACpB,gBAAgB,WACvB,iBAAiB,KAAG,kBAYzB,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-remote-core",
3
- "version": "0.2.0-alpha.46",
3
+ "version": "0.2.0-alpha.47",
4
4
  "type": "module",
5
5
  "description": "Core functionality to setup a remote/host environment",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -41,5 +41,5 @@
41
41
  "vite-plugin-dts": "^4.5.0",
42
42
  "vite-plugin-externalize-deps": "^0.9.0"
43
43
  },
44
- "gitHead": "ef82ec9b2b1c6a47574ef2e1ec0ecc76a39aad54"
44
+ "gitHead": "dfd43a192d6b3755906d3632a93a2725ed898ea0"
45
45
  }