forgeframe 0.0.10 → 0.0.13

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Internal domain-pattern helpers shared by ForgeFrame trust and origin checks.
4
+ *
5
+ * @remarks
6
+ * Centralizes wildcard compilation and stateless `RegExp` evaluation so
7
+ * window helpers and the messenger preserve identical domain-matching behavior.
8
+ */
9
+ /**
10
+ * Compiles a wildcard domain pattern into an anchored `RegExp`.
11
+ *
12
+ * @param pattern - Domain pattern that may contain `*` wildcards.
13
+ * @returns Compiled `RegExp`, or `null` when the pattern has no wildcards.
14
+ *
15
+ * @remarks
16
+ * Compiled patterns are cached with a bounded, oldest-entry eviction policy to
17
+ * preserve the prior helper-level wildcard cache behavior.
18
+ *
19
+ * @internal
20
+ */
21
+ export declare function compileWildcardDomainPattern(pattern: string): RegExp | null;
22
+ /**
23
+ * Tests a domain `RegExp` without mutating `lastIndex` on global or sticky patterns.
24
+ *
25
+ * @param pattern - Pattern to test.
26
+ * @param value - Domain string to match.
27
+ * @returns `true` when the pattern matches the provided value.
28
+ *
29
+ * @remarks
30
+ * Global and sticky flags are stripped from a cloned `RegExp` before testing so
31
+ * repeated trust checks behave consistently regardless of prior matches.
32
+ *
33
+ * @internal
34
+ */
35
+ export declare function testDomainRegExpStateless(pattern: RegExp, value: string): boolean;
@@ -56,7 +56,7 @@ export declare function isSameDomain(win: Window, reference?: Window): boolean;
56
56
  * - `"*"` matches any domain
57
57
  * - String patterns without wildcards require exact match
58
58
  * - String patterns with `*` use wildcard matching (for example, `'https://*.example.com'`)
59
- * - RegExp patterns use `.test()` method
59
+ * - RegExp patterns are evaluated statelessly so global/sticky flags do not leak `lastIndex` across calls
60
60
  * - Array patterns return `true` if any element matches (OR logic)
61
61
  *
62
62
  * @example
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Window utilities for ForgeFrame cross-window communication.
2
+ * @packageDocumentation
3
+ * Internal source barrel for ForgeFrame window utilities.
3
4
  *
4
5
  * @remarks
5
- * This module provides utilities for working with browser windows in cross-origin
6
- * contexts. It includes helpers for domain matching, window hierarchy navigation,
7
- * window name payload encoding/decoding, and window reference management.
8
- *
9
- * @packageDocumentation
6
+ * This file groups cross-window helpers, payload parsing, and window reference
7
+ * helpers for internal source organization. The published package does not
8
+ * expose a `forgeframe/window` subpath, so consumers should treat this barrel
9
+ * as internal implementation structure.
10
10
  */
11
11
  export { getDomain, isSameDomain, matchDomain, isWindowClosed, getOpener, getConsumer, getTop, isIframe, isPopup, getAncestor, getDistanceToConsumer, focusWindow, closeWindow, getFrames, } from './helpers';
12
12
  export { buildWindowName, parseWindowName, isForgeFrameWindow, isHostOfComponent, createWindowPayload, updateWindowName, getInitialPayload, } from './name-payload';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgeframe",
3
- "version": "0.0.10",
3
+ "version": "0.0.13",
4
4
  "description": "Modern cross-domain iframe component framework - a TypeScript alternative to zoid",
5
5
  "type": "module",
6
6
  "module": "./dist/forgeframe.js",