@mittwald/flow-remote-core 0.2.0-alpha.166 → 0.2.0-alpha.167

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.
@@ -3,15 +3,19 @@ import '@mittwald/remote-dom-core/elements';
3
3
  import { ThreadNestedIframe } from '@quilted/threads';
4
4
 
5
5
  const incompatibleParentFrameError = () => new RemoteError("Could not find any compatible parent frame");
6
- const connectHostRenderRoot = async (div) => {
6
+ const connectHostRenderRoot = async (options) => {
7
+ const { root, onPathnameChanged } = options;
7
8
  const connection = new ThreadNestedIframe({
8
9
  exports: {
9
10
  render: (connection2) => import('@mittwald/remote-dom-core/elements').then(
10
11
  ({ RemoteMutationObserver }) => {
11
12
  const observer = new RemoteMutationObserver(connection2);
12
- observer.observe(div);
13
+ observer.observe(root);
13
14
  }
14
- )
15
+ ),
16
+ setPathname: async (pathname) => {
17
+ onPathnameChanged?.(pathname);
18
+ }
15
19
  }
16
20
  });
17
21
  if (connection.parent === window) {
@@ -31,14 +35,17 @@ const connectHostRenderRoot = async (div) => {
31
35
  throw error;
32
36
  }
33
37
  };
34
- const connectHostRenderRootRef = (ref) => {
38
+ const connectHostRenderRootRef = (opts) => (ref) => {
35
39
  if (ref === null) {
36
40
  return;
37
41
  }
38
42
  if ("__remoteConnection" in ref) {
39
43
  return ref["__remoteConnection"];
40
44
  }
41
- const connection = connectHostRenderRoot(ref);
45
+ const connection = connectHostRenderRoot({
46
+ root: ref,
47
+ ...opts
48
+ });
42
49
  Object.assign(ref, { __remoteConnection: connection });
43
50
  return connection;
44
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"connectHostRenderRoot.mjs","sources":["../../../src/connection/connectHostRenderRoot.ts"],"sourcesContent":["import type {\n HostExports,\n RemoteExports,\n RemoteToHostConnection,\n} from \"@/connection/types\";\nimport { RemoteError } from \"@/error\";\nimport { type RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadNestedIframe } from \"@quilted/threads\";\n\nconst incompatibleParentFrameError = () =>\n new RemoteError(\"Could not find any compatible parent frame\");\n\nexport const connectHostRenderRoot = async (\n div: HTMLDivElement,\n): Promise<RemoteToHostConnection> => {\n const connection = new ThreadNestedIframe<HostExports, RemoteExports>({\n exports: {\n render: (connection: RemoteConnection) =>\n import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(connection);\n observer.observe(div);\n },\n ),\n },\n });\n\n if (connection.parent === window) {\n throw incompatibleParentFrameError();\n }\n\n try {\n await connection.imports.setIsReady();\n\n if (typeof mwExtBridge !== \"undefined\") {\n mwExtBridge.connection = connection.imports;\n await mwExtBridge.readiness.setIsReady();\n }\n\n return connection;\n } catch (error) {\n if (\n error instanceof Error &&\n /No '.*' method is exported from this thread/.test(error.message)\n ) {\n throw incompatibleParentFrameError();\n }\n throw error;\n }\n};\n\nexport const connectHostRenderRootRef = (ref: HTMLDivElement | null) => {\n if (ref === null) {\n return;\n }\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as Promise<RemoteToHostConnection>;\n }\n\n const connection = connectHostRenderRoot(ref);\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n};\n"],"names":["connection"],"mappings":";;;;AASA,MAAM,4BAA+B,GAAA,MACnC,IAAI,WAAA,CAAY,4CAA4C,CAAA;AAEjD,MAAA,qBAAA,GAAwB,OACnC,GACoC,KAAA;AACpC,EAAM,MAAA,UAAA,GAAa,IAAI,kBAA+C,CAAA;AAAA,IACpE,OAAS,EAAA;AAAA,MACP,MAAQ,EAAA,CAACA,WACP,KAAA,OAAO,oCAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,CAAC,EAAE,sBAAA,EAA6B,KAAA;AAC9B,UAAM,MAAA,QAAA,GAAW,IAAI,sBAAA,CAAuBA,WAAU,CAAA;AACtD,UAAA,QAAA,CAAS,QAAQ,GAAG,CAAA;AAAA;AACtB;AACF;AACJ,GACD,CAAA;AAED,EAAI,IAAA,UAAA,CAAW,WAAW,MAAQ,EAAA;AAChC,IAAA,MAAM,4BAA6B,EAAA;AAAA;AAGrC,EAAI,IAAA;AACF,IAAM,MAAA,UAAA,CAAW,QAAQ,UAAW,EAAA;AAEpC,IAAI,IAAA,OAAO,gBAAgB,WAAa,EAAA;AACtC,MAAA,WAAA,CAAY,aAAa,UAAW,CAAA,OAAA;AACpC,MAAM,MAAA,WAAA,CAAY,UAAU,UAAW,EAAA;AAAA;AAGzC,IAAO,OAAA,UAAA;AAAA,WACA,KAAO,EAAA;AACd,IAAA,IACE,iBAAiB,KACjB,IAAA,6CAAA,CAA8C,IAAK,CAAA,KAAA,CAAM,OAAO,CAChE,EAAA;AACA,MAAA,MAAM,4BAA6B,EAAA;AAAA;AAErC,IAAM,MAAA,KAAA;AAAA;AAEV;AAEa,MAAA,wBAAA,GAA2B,CAAC,GAA+B,KAAA;AACtE,EAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,IAAA;AAAA;AAEF,EAAA,IAAI,wBAAwB,GAAK,EAAA;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA;AAGjC,EAAM,MAAA,UAAA,GAAa,sBAAsB,GAAG,CAAA;AAC5C,EAAA,MAAA,CAAO,MAAO,CAAA,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAO,OAAA,UAAA;AACT;;;;"}
1
+ {"version":3,"file":"connectHostRenderRoot.mjs","sources":["../../../src/connection/connectHostRenderRoot.ts"],"sourcesContent":["import type {\n HostExports,\n RemoteExports,\n RemoteToHostConnection,\n} from \"@/connection/types\";\nimport { RemoteError } from \"@/error\";\nimport { type RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadNestedIframe } from \"@quilted/threads\";\n\ninterface Options {\n root: HTMLDivElement;\n onPathnameChanged?: (pathname: string) => void;\n}\n\nconst incompatibleParentFrameError = () =>\n new RemoteError(\"Could not find any compatible parent frame\");\n\nexport const connectHostRenderRoot = async (\n options: Options,\n): Promise<RemoteToHostConnection> => {\n const { root, onPathnameChanged } = options;\n\n const connection = new ThreadNestedIframe<HostExports, RemoteExports>({\n exports: {\n render: (connection: RemoteConnection) =>\n import(\"@mittwald/remote-dom-core/elements\").then(\n ({ RemoteMutationObserver }) => {\n const observer = new RemoteMutationObserver(connection);\n observer.observe(root);\n },\n ),\n setPathname: async (pathname) => {\n onPathnameChanged?.(pathname);\n },\n },\n });\n\n if (connection.parent === window) {\n throw incompatibleParentFrameError();\n }\n\n try {\n await connection.imports.setIsReady();\n\n if (typeof mwExtBridge !== \"undefined\") {\n mwExtBridge.connection = connection.imports;\n await mwExtBridge.readiness.setIsReady();\n }\n\n return connection;\n } catch (error) {\n if (\n error instanceof Error &&\n /No '.*' method is exported from this thread/.test(error.message)\n ) {\n throw incompatibleParentFrameError();\n }\n throw error;\n }\n};\n\nexport const connectHostRenderRootRef =\n (opts: Omit<Options, \"root\">) => (ref: HTMLDivElement | null) => {\n if (ref === null) {\n return;\n }\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as Promise<RemoteToHostConnection>;\n }\n\n const connection = connectHostRenderRoot({\n root: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"names":["connection"],"mappings":";;;;AAcA,MAAM,4BAA+B,GAAA,MACnC,IAAI,WAAA,CAAY,4CAA4C,CAAA;AAEjD,MAAA,qBAAA,GAAwB,OACnC,OACoC,KAAA;AACpC,EAAM,MAAA,EAAE,IAAM,EAAA,iBAAA,EAAsB,GAAA,OAAA;AAEpC,EAAM,MAAA,UAAA,GAAa,IAAI,kBAA+C,CAAA;AAAA,IACpE,OAAS,EAAA;AAAA,MACP,MAAQ,EAAA,CAACA,WACP,KAAA,OAAO,oCAAoC,CAAE,CAAA,IAAA;AAAA,QAC3C,CAAC,EAAE,sBAAA,EAA6B,KAAA;AAC9B,UAAM,MAAA,QAAA,GAAW,IAAI,sBAAA,CAAuBA,WAAU,CAAA;AACtD,UAAA,QAAA,CAAS,QAAQ,IAAI,CAAA;AAAA;AACvB,OACF;AAAA,MACF,WAAA,EAAa,OAAO,QAAa,KAAA;AAC/B,QAAA,iBAAA,GAAoB,QAAQ,CAAA;AAAA;AAC9B;AACF,GACD,CAAA;AAED,EAAI,IAAA,UAAA,CAAW,WAAW,MAAQ,EAAA;AAChC,IAAA,MAAM,4BAA6B,EAAA;AAAA;AAGrC,EAAI,IAAA;AACF,IAAM,MAAA,UAAA,CAAW,QAAQ,UAAW,EAAA;AAEpC,IAAI,IAAA,OAAO,gBAAgB,WAAa,EAAA;AACtC,MAAA,WAAA,CAAY,aAAa,UAAW,CAAA,OAAA;AACpC,MAAM,MAAA,WAAA,CAAY,UAAU,UAAW,EAAA;AAAA;AAGzC,IAAO,OAAA,UAAA;AAAA,WACA,KAAO,EAAA;AACd,IAAA,IACE,iBAAiB,KACjB,IAAA,6CAAA,CAA8C,IAAK,CAAA,KAAA,CAAM,OAAO,CAChE,EAAA;AACA,MAAA,MAAM,4BAA6B,EAAA;AAAA;AAErC,IAAM,MAAA,KAAA;AAAA;AAEV;AAEO,MAAM,wBACX,GAAA,CAAC,IAAgC,KAAA,CAAC,GAA+B,KAAA;AAC/D,EAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,IAAA;AAAA;AAEF,EAAA,IAAI,wBAAwB,GAAK,EAAA;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA;AAGjC,EAAA,MAAM,aAAa,qBAAsB,CAAA;AAAA,IACvC,IAAM,EAAA,GAAA;AAAA,IACN,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAA,CAAO,MAAO,CAAA,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAO,OAAA,UAAA;AACT;;;;"}
@@ -7,6 +7,7 @@ const connectRemoteIframe = (opts) => {
7
7
  iframe,
8
8
  onReady,
9
9
  onError,
10
+ onNavigationStateChanged,
10
11
  extBridgeImplementation = emptyImplementation
11
12
  } = opts;
12
13
  const thread = new ThreadIframe(iframe, {
@@ -17,6 +18,9 @@ const connectRemoteIframe = (opts) => {
17
18
  },
18
19
  setError: async (error) => {
19
20
  onError?.(error);
21
+ },
22
+ setNavigationState: async (state) => {
23
+ onNavigationStateChanged?.(state);
20
24
  }
21
25
  }
22
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"connectRemoteIframe.mjs","sources":["../../../src/connection/connectRemoteIframe.ts"],"sourcesContent":["import type {\n HostExports,\n HostToRemoteConnection,\n RemoteExports,\n} from \"@/connection/types\";\nimport { emptyImplementation } from \"@/ext-bridge/implementation\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadIframe } from \"@quilted/threads\";\n\ninterface Opts {\n connection: RemoteConnection;\n iframe: HTMLIFrameElement;\n onReady?: () => void;\n onError?: (error: string) => void;\n extBridgeImplementation?: ExtBridgeConnectionApi;\n}\n\nexport const connectRemoteIframe = (opts: Opts): HostToRemoteConnection => {\n const {\n connection,\n iframe,\n onReady,\n onError,\n extBridgeImplementation = emptyImplementation,\n } = opts;\n\n const thread = new ThreadIframe<RemoteExports, HostExports>(iframe, {\n exports: {\n ...extBridgeImplementation,\n setIsReady: async () => {\n onReady?.();\n },\n setError: async (error: string) => {\n onError?.(error);\n },\n },\n });\n\n thread.imports.render(connection);\n return thread;\n};\n\nexport const connectRemoteIframeRef =\n (opts: Omit<Opts, \"iframe\">) => (ref: HTMLIFrameElement | null) => {\n if (!ref) {\n return;\n }\n\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as HostToRemoteConnection;\n }\n\n const connection = connectRemoteIframe({\n iframe: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"names":[],"mappings":";;;AAkBa,MAAA,mBAAA,GAAsB,CAAC,IAAuC,KAAA;AACzE,EAAM,MAAA;AAAA,IACJ,UAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,uBAA0B,GAAA;AAAA,GACxB,GAAA,IAAA;AAEJ,EAAM,MAAA,MAAA,GAAS,IAAI,YAAA,CAAyC,MAAQ,EAAA;AAAA,IAClE,OAAS,EAAA;AAAA,MACP,GAAG,uBAAA;AAAA,MACH,YAAY,YAAY;AACtB,QAAU,OAAA,IAAA;AAAA,OACZ;AAAA,MACA,QAAA,EAAU,OAAO,KAAkB,KAAA;AACjC,QAAA,OAAA,GAAU,KAAK,CAAA;AAAA;AACjB;AACF,GACD,CAAA;AAED,EAAO,MAAA,CAAA,OAAA,CAAQ,OAAO,UAAU,CAAA;AAChC,EAAO,OAAA,MAAA;AACT;AAEO,MAAM,sBACX,GAAA,CAAC,IAA+B,KAAA,CAAC,GAAkC,KAAA;AACjE,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAA;AAAA;AAGF,EAAA,IAAI,wBAAwB,GAAK,EAAA;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA;AAGjC,EAAA,MAAM,aAAa,mBAAoB,CAAA;AAAA,IACrC,MAAQ,EAAA,GAAA;AAAA,IACR,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAA,CAAO,MAAO,CAAA,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAO,OAAA,UAAA;AACT;;;;"}
1
+ {"version":3,"file":"connectRemoteIframe.mjs","sources":["../../../src/connection/connectRemoteIframe.ts"],"sourcesContent":["import type {\n HostExports,\n HostToRemoteConnection,\n NavigationState,\n RemoteExports,\n} from \"@/connection/types\";\nimport { emptyImplementation } from \"@/ext-bridge/implementation\";\nimport type { ExtBridgeConnectionApi } from \"@mittwald/ext-bridge\";\nimport type { RemoteConnection } from \"@mittwald/remote-dom-core/elements\";\nimport { ThreadIframe } from \"@quilted/threads\";\n\ninterface Options {\n connection: RemoteConnection;\n iframe: HTMLIFrameElement;\n onReady?: () => void;\n onError?: (error: string) => void;\n onNavigationStateChanged?: (state: NavigationState) => void;\n extBridgeImplementation?: ExtBridgeConnectionApi;\n}\n\nexport const connectRemoteIframe = (opts: Options): HostToRemoteConnection => {\n const {\n connection,\n iframe,\n onReady,\n onError,\n onNavigationStateChanged,\n extBridgeImplementation = emptyImplementation,\n } = opts;\n\n const thread = new ThreadIframe<RemoteExports, HostExports>(iframe, {\n exports: {\n ...extBridgeImplementation,\n setIsReady: async () => {\n onReady?.();\n },\n setError: async (error: string) => {\n onError?.(error);\n },\n setNavigationState: async (state) => {\n onNavigationStateChanged?.(state);\n },\n },\n });\n\n thread.imports.render(connection);\n return thread;\n};\n\nexport const connectRemoteIframeRef =\n (opts: Omit<Options, \"iframe\">) => (ref: HTMLIFrameElement | null) => {\n if (!ref) {\n return;\n }\n\n if (\"__remoteConnection\" in ref) {\n return ref[\"__remoteConnection\"] as HostToRemoteConnection;\n }\n\n const connection = connectRemoteIframe({\n iframe: ref,\n ...opts,\n });\n Object.assign(ref, { __remoteConnection: connection });\n return connection;\n };\n"],"names":[],"mappings":";;;AAoBa,MAAA,mBAAA,GAAsB,CAAC,IAA0C,KAAA;AAC5E,EAAM,MAAA;AAAA,IACJ,UAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,wBAAA;AAAA,IACA,uBAA0B,GAAA;AAAA,GACxB,GAAA,IAAA;AAEJ,EAAM,MAAA,MAAA,GAAS,IAAI,YAAA,CAAyC,MAAQ,EAAA;AAAA,IAClE,OAAS,EAAA;AAAA,MACP,GAAG,uBAAA;AAAA,MACH,YAAY,YAAY;AACtB,QAAU,OAAA,IAAA;AAAA,OACZ;AAAA,MACA,QAAA,EAAU,OAAO,KAAkB,KAAA;AACjC,QAAA,OAAA,GAAU,KAAK,CAAA;AAAA,OACjB;AAAA,MACA,kBAAA,EAAoB,OAAO,KAAU,KAAA;AACnC,QAAA,wBAAA,GAA2B,KAAK,CAAA;AAAA;AAClC;AACF,GACD,CAAA;AAED,EAAO,MAAA,CAAA,OAAA,CAAQ,OAAO,UAAU,CAAA;AAChC,EAAO,OAAA,MAAA;AACT;AAEO,MAAM,sBACX,GAAA,CAAC,IAAkC,KAAA,CAAC,GAAkC,KAAA;AACpE,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAA;AAAA;AAGF,EAAA,IAAI,wBAAwB,GAAK,EAAA;AAC/B,IAAA,OAAO,IAAI,oBAAoB,CAAA;AAAA;AAGjC,EAAA,MAAM,aAAa,mBAAoB,CAAA;AAAA,IACrC,MAAQ,EAAA,GAAA;AAAA,IACR,GAAG;AAAA,GACJ,CAAA;AACD,EAAA,MAAA,CAAO,MAAO,CAAA,GAAA,EAAK,EAAE,kBAAA,EAAoB,YAAY,CAAA;AACrD,EAAO,OAAA,UAAA;AACT;;;;"}
@@ -1,4 +1,9 @@
1
1
  import { RemoteToHostConnection } from './types';
2
- export declare const connectHostRenderRoot: (div: HTMLDivElement) => Promise<RemoteToHostConnection>;
3
- export declare const connectHostRenderRootRef: (ref: HTMLDivElement | null) => Promise<RemoteToHostConnection> | undefined;
2
+ interface Options {
3
+ root: HTMLDivElement;
4
+ onPathnameChanged?: (pathname: string) => void;
5
+ }
6
+ export declare const connectHostRenderRoot: (options: Options) => Promise<RemoteToHostConnection>;
7
+ export declare const connectHostRenderRootRef: (opts: Omit<Options, "root">) => (ref: HTMLDivElement | null) => Promise<RemoteToHostConnection> | undefined;
8
+ export {};
4
9
  //# sourceMappingURL=connectHostRenderRoot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectHostRenderRoot.d.ts","sourceRoot":"","sources":["../../../src/connection/connectHostRenderRoot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAQ5B,eAAO,MAAM,qBAAqB,GAChC,KAAK,cAAc,KAClB,OAAO,CAAC,sBAAsB,CAmChC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,KAAK,cAAc,GAAG,IAAI,gDAWlE,CAAC"}
1
+ {"version":3,"file":"connectHostRenderRoot.d.ts","sourceRoot":"","sources":["../../../src/connection/connectHostRenderRoot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAK5B,UAAU,OAAO;IACf,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAKD,eAAO,MAAM,qBAAqB,GAChC,SAAS,OAAO,KACf,OAAO,CAAC,sBAAsB,CAwChC,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAClC,MAAM,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,cAAc,GAAG,IAAI,gDAc3D,CAAC"}
@@ -1,14 +1,15 @@
1
- import { HostToRemoteConnection } from './types';
1
+ import { HostToRemoteConnection, NavigationState } from './types';
2
2
  import { ExtBridgeConnectionApi } from '@mittwald/ext-bridge';
3
3
  import { RemoteConnection } from '@mittwald/remote-dom-core/elements';
4
- interface Opts {
4
+ interface Options {
5
5
  connection: RemoteConnection;
6
6
  iframe: HTMLIFrameElement;
7
7
  onReady?: () => void;
8
8
  onError?: (error: string) => void;
9
+ onNavigationStateChanged?: (state: NavigationState) => void;
9
10
  extBridgeImplementation?: ExtBridgeConnectionApi;
10
11
  }
11
- export declare const connectRemoteIframe: (opts: Opts) => HostToRemoteConnection;
12
- export declare const connectRemoteIframeRef: (opts: Omit<Opts, "iframe">) => (ref: HTMLIFrameElement | null) => HostToRemoteConnection | undefined;
12
+ export declare const connectRemoteIframe: (opts: Options) => HostToRemoteConnection;
13
+ export declare const connectRemoteIframeRef: (opts: Omit<Options, "iframe">) => (ref: HTMLIFrameElement | null) => HostToRemoteConnection | undefined;
13
14
  export {};
14
15
  //# sourceMappingURL=connectRemoteIframe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectRemoteIframe.d.ts","sourceRoot":"","sources":["../../../src/connection/connectRemoteIframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,UAAU,IAAI;IACZ,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uBAAuB,CAAC,EAAE,sBAAsB,CAAC;CAClD;AAED,eAAO,MAAM,mBAAmB,GAAI,MAAM,IAAI,KAAG,sBAuBhD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAChC,MAAM,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,iBAAiB,GAAG,IAAI,uCAe7D,CAAC"}
1
+ {"version":3,"file":"connectRemoteIframe.d.ts","sourceRoot":"","sources":["../../../src/connection/connectRemoteIframe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,UAAU,OAAO;IACf,UAAU,EAAE,gBAAgB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,uBAAuB,CAAC,EAAE,sBAAsB,CAAC;CAClD;AAED,eAAO,MAAM,mBAAmB,GAAI,MAAM,OAAO,KAAG,sBA2BnD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAChC,MAAM,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,KAAK,iBAAiB,GAAG,IAAI,uCAehE,CAAC"}
@@ -1,12 +1,18 @@
1
1
  import { ExtBridgeConnectionApi } from '@mittwald/ext-bridge';
2
2
  import { RemoteConnection } from '@mittwald/remote-dom-core';
3
3
  import { ThreadIframe, ThreadNestedIframe } from '@quilted/threads';
4
+ export interface NavigationState {
5
+ pathname: string;
6
+ isPending: boolean;
7
+ }
4
8
  export interface HostExports extends ExtBridgeConnectionApi {
5
9
  setIsReady: () => Promise<void>;
6
10
  setError: (error: string) => Promise<void>;
11
+ setNavigationState: (state: NavigationState) => Promise<void>;
7
12
  }
8
13
  export interface RemoteExports {
9
14
  render: (connection: RemoteConnection) => Promise<void>;
15
+ setPathname: (pathname: string) => Promise<void>;
10
16
  }
11
17
  export type RemoteToHostConnection = ThreadNestedIframe<HostExports, RemoteExports>;
12
18
  export type HostToRemoteConnection = ThreadIframe<RemoteExports, HostExports>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/connection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,WAAY,SAAQ,sBAAsB;IACzD,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CACrD,WAAW,EACX,aAAa,CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/connection/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEzE,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,sBAAsB;IACzD,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,kBAAkB,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAED,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CACrD,WAAW,EACX,aAAa,CACd,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-remote-core",
3
- "version": "0.2.0-alpha.166",
3
+ "version": "0.2.0-alpha.167",
4
4
  "type": "module",
5
5
  "description": "Core functionality to setup a remote/host environment",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -31,7 +31,7 @@
31
31
  "remeda": "^2.21.1"
32
32
  },
33
33
  "devDependencies": {
34
- "@mittwald/ext-bridge": "0.2.0-alpha.166",
34
+ "@mittwald/ext-bridge": "0.2.0-alpha.167",
35
35
  "@mittwald/typescript-config": "",
36
36
  "@types/node": "^22.13.10",
37
37
  "nx": "^20.5.0",
@@ -52,5 +52,5 @@
52
52
  "optional": true
53
53
  }
54
54
  },
55
- "gitHead": "f33379b5bd0a0f40818820c926264e2136ebbea5"
55
+ "gitHead": "1927f615a0de12f79fd3b7062161c91f6efa4d7c"
56
56
  }