forgeframe 0.0.6 → 0.0.10

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.
@@ -79,7 +79,7 @@ export declare const PROP_SERIALIZATION: {
79
79
  readonly JSON: "json";
80
80
  /** Base64 encoding for binary or large data */
81
81
  readonly BASE64: "base64";
82
- /** Dot notation for nested objects (e.g., "a.b.c=value") */
82
+ /** Explicit framed-path encoding for nested objects */
83
83
  readonly DOTIFY: "dotify";
84
84
  };
85
85
  /**
@@ -14,6 +14,14 @@ export interface ConsumerPropsUpdateHooks<P extends Record<string, unknown>> {
14
14
  sendPropsUpdateToHost: (nextProps: P) => Promise<void>;
15
15
  emitPropsUpdated: (nextProps: P) => void;
16
16
  }
17
+ /**
18
+ * Hooks required to queue a host sync for the current props snapshot.
19
+ * @internal
20
+ */
21
+ export interface ConsumerPropsSyncHooks<P extends Record<string, unknown>> {
22
+ shouldSendPropsToHost: () => boolean;
23
+ sendPropsUpdateToHost: (nextProps: P) => Promise<void>;
24
+ }
17
25
  /**
18
26
  * Owns consumer prop normalization, validation, and update queueing.
19
27
  * @internal
@@ -39,6 +47,14 @@ export declare class ConsumerPropsPipeline<P extends Record<string, unknown>> {
39
47
  * Applies a props update and synchronizes it to the host when connected.
40
48
  */
41
49
  updateProps(newProps: Partial<P>, hooks: ConsumerPropsUpdateHooks<P>): Promise<void>;
50
+ /**
51
+ * Queues a host synchronization for the current props snapshot.
52
+ *
53
+ * @remarks
54
+ * This shares the same serialization queue as updateProps so function bridge
55
+ * batches cannot overlap with user-initiated prop updates.
56
+ */
57
+ syncCurrentPropsToHost(hooks: ConsumerPropsSyncHooks<P>): Promise<void>;
42
58
  /**
43
59
  * Queues prop updates when a previous host sync is in flight.
44
60
  */
@@ -32,6 +32,8 @@ export declare class ConsumerRenderer<P extends Record<string, unknown>> {
32
32
  container: HTMLElement | null;
33
33
  /** Prerender element currently displayed while host initializes. */
34
34
  prerenderElement: HTMLElement | null;
35
+ /** Wrapper element created and owned by the renderer. */
36
+ private ownedContainer;
35
37
  constructor(options: NormalizedOptions<P>, uid: string, getProps: () => P, resolveDimensions: () => Dimensions, callbacks: {
36
38
  close: () => Promise<void>;
37
39
  focus: () => Promise<void>;
@@ -14,6 +14,7 @@ interface PeerRequest {
14
14
  * @internal
15
15
  */
16
16
  export interface ConsumerTransportHandlers<X> {
17
+ onInit?: () => void | Promise<void>;
17
18
  onClose: () => Promise<void>;
18
19
  onResize: (dimensions: Dimensions) => Promise<void>;
19
20
  onFocus: () => Promise<void>;
@@ -59,6 +59,8 @@ export declare class ConsumerComponent<P extends Record<string, unknown>, X = un
59
59
  /** @internal */
60
60
  private destroyed;
61
61
  /** @internal */
62
+ private closing;
63
+ /** @internal */
62
64
  private get props();
63
65
  /** @internal */
64
66
  private set props(value);
@@ -325,6 +327,16 @@ export declare class ConsumerComponent<P extends Record<string, unknown>, X = un
325
327
  * @internal
326
328
  */
327
329
  private setupMessageHandlers;
330
+ /**
331
+ * Synchronizes sameDomain props after the host proves its loaded origin via INIT.
332
+ * @internal
333
+ */
334
+ private syncSameDomainPropsAfterInit;
335
+ /**
336
+ * Returns true when any prop definition is restricted to same-origin hosts.
337
+ * @internal
338
+ */
339
+ private hasSameDomainPropDefinition;
328
340
  /**
329
341
  * Gets sibling component instances for a request.
330
342
  * @internal
@@ -47,6 +47,8 @@ export declare class HostComponent<P extends Record<string, unknown>> {
47
47
  /** @internal */
48
48
  private consumerDomain;
49
49
  /** @internal */
50
+ private consumerDomainVerified;
51
+ /** @internal */
50
52
  private messenger;
51
53
  /** @internal */
52
54
  private bridge;
@@ -93,6 +95,42 @@ export declare class HostComponent<P extends Record<string, unknown>> {
93
95
  * @internal
94
96
  */
95
97
  private validateConsumerDomain;
98
+ /**
99
+ * Reads a browser-verifiable consumer origin when available.
100
+ * @internal
101
+ */
102
+ private getVerifiedConsumerOrigin;
103
+ /**
104
+ * Updates the tracked consumer origin and keeps trusted messaging origins in sync.
105
+ * @internal
106
+ */
107
+ private setConsumerDomain;
108
+ /**
109
+ * Applies host configuration that may arrive after deferred pre-initialization.
110
+ * @internal
111
+ */
112
+ applyHostConfiguration(propDefinitions?: PropsDefinition<P>, allowedConsumerDomains?: DomainMatcher): void;
113
+ /**
114
+ * Resolves the consumer origin from browser-provided context and falls back to the
115
+ * claimed bootstrap origin only when no explicit allowlist is configured.
116
+ * @internal
117
+ */
118
+ private resolveConsumerDomain;
119
+ /**
120
+ * Rechecks allowlist constraints against a browser-verified consumer origin.
121
+ * @internal
122
+ */
123
+ assertAllowedConsumerDomain(allowedConsumerDomains: DomainMatcher): void;
124
+ /**
125
+ * Reads the consumer origin from the browser-provided referrer when available.
126
+ * @internal
127
+ */
128
+ private getReferrerOrigin;
129
+ /**
130
+ * Reads the consumer origin directly when same-origin access is available.
131
+ * @internal
132
+ */
133
+ private getAccessibleConsumerOrigin;
96
134
  /**
97
135
  * Returns the hostProps object.
98
136
  *
@@ -109,6 +147,12 @@ export declare class HostComponent<P extends Record<string, unknown>> {
109
147
  * @internal
110
148
  */
111
149
  private buildHostProps;
150
+ /**
151
+ * Relaxes required sameDomain props during bootstrap for verified same-origin hosts.
152
+ * Those props are synchronized after INIT through the live messaging channel.
153
+ * @internal
154
+ */
155
+ private getBootstrapValidationDefinitions;
112
156
  /**
113
157
  * Sends initialization message to the consumer.
114
158
  * @internal
@@ -17,7 +17,7 @@ interface ReactLike {
17
17
  };
18
18
  useEffect: (effect: () => void | (() => void), deps?: unknown[]) => void;
19
19
  useState: <T>(initial: T) => [T, (v: T) => void];
20
- forwardRef: <T, P>(render: (props: P, ref: {
20
+ forwardRef: <T, P>(render: (props: P, ref: ((value: T | null) => void) | {
21
21
  current: T | null;
22
22
  } | null) => unknown) => unknown;
23
23
  }