@gjsify/iframe 0.1.13 → 0.2.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gjsify/iframe
2
2
 
3
- GJS implementation of HTMLIFrameElement using WebKit 6.0. Provides IFrameWidget extending WebKit.WebView with postMessage bridge.
3
+ GJS implementation of HTMLIFrameElement using WebKit 6.0. Provides IFrameBridge extending WebKit.WebView with postMessage bridge.
4
4
 
5
5
  Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
6
 
@@ -15,9 +15,9 @@ yarn add @gjsify/iframe
15
15
  ## Usage
16
16
 
17
17
  ```typescript
18
- import { IFrameWidget } from '@gjsify/iframe';
18
+ import { IFrameBridge } from '@gjsify/iframe';
19
19
 
20
- const widget = new IFrameWidget();
20
+ const widget = new IFrameBridge();
21
21
 
22
22
  widget.onReady((iframe) => {
23
23
  iframe.contentWindow?.addEventListener('message', (event) => {
@@ -6,7 +6,7 @@ const { tagName, localName, namespaceURI } = PropertySymbol;
6
6
  class HTMLIFrameElement extends HTMLElement {
7
7
  constructor() {
8
8
  super();
9
- /** @internal The backing IFrameWidget (set by IFrameWidget when it creates this element) */
9
+ /** @internal The backing IFrameBridge (set by IFrameBridge when it creates this element) */
10
10
  this[_c] = null;
11
11
  /** @internal The contentWindow proxy */
12
12
  this[_b] = null;
@@ -85,7 +85,7 @@ class HTMLIFrameElement extends HTMLElement {
85
85
  // -- Content access --
86
86
  /**
87
87
  * Returns the window proxy for the iframe's content.
88
- * Available after the IFrameWidget has loaded content.
88
+ * Available after the IFrameBridge has loaded content.
89
89
  */
90
90
  get contentWindow() {
91
91
  return this[PS.windowProxy];
@@ -115,7 +115,7 @@ class HTMLIFrameElement extends HTMLElement {
115
115
  get [(_c = PS.iframeWidget, _b = PS.windowProxy, _a = PS.loaded, Symbol.toStringTag)]() {
116
116
  return "HTMLIFrameElement";
117
117
  }
118
- // -- Internal: called by IFrameWidget --
118
+ // -- Internal: called by IFrameBridge --
119
119
  /** @internal Fire load event */
120
120
  _onLoad() {
121
121
  this[PS.loaded] = true;
@@ -4,9 +4,9 @@ import { HTMLIFrameElement } from "./html-iframe-element.js";
4
4
  import { IFrameWindowProxy } from "./iframe-window-proxy.js";
5
5
  import { MessageBridge } from "./message-bridge.js";
6
6
  import * as PS from "./property-symbol.js";
7
- const IFrameWidget = GObject.registerClass(
8
- { GTypeName: "GjsifyIFrameWidget" },
9
- class IFrameWidget2 extends WebKit.WebView {
7
+ const IFrameBridge = GObject.registerClass(
8
+ { GTypeName: "GjsifyIFrameBridge" },
9
+ class IFrameBridge2 extends WebKit.WebView {
10
10
  constructor(options) {
11
11
  const { enableDeveloperExtras, enableJavascript, ...webViewProps } = options ?? {};
12
12
  const userContentManager = new WebKit.UserContentManager();
@@ -103,5 +103,5 @@ const IFrameWidget = GObject.registerClass(
103
103
  }
104
104
  );
105
105
  export {
106
- IFrameWidget
106
+ IFrameBridge
107
107
  };
package/lib/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { HTMLIFrameElement } from "./html-iframe-element.js";
2
- import { IFrameWidget } from "./iframe-widget.js";
2
+ import { IFrameBridge } from "./iframe-bridge.js";
3
3
  import { IFrameWindowProxy } from "./iframe-window-proxy.js";
4
4
  import { MessageBridge } from "./message-bridge.js";
5
5
  import { Document } from "@gjsify/dom-elements";
@@ -12,7 +12,7 @@ Object.defineProperty(globalThis, "HTMLIFrameElement", {
12
12
  });
13
13
  export {
14
14
  HTMLIFrameElement,
15
- IFrameWidget,
15
+ IFrameBridge,
16
16
  IFrameWindowProxy,
17
17
  MessageBridge
18
18
  };
@@ -38,7 +38,7 @@ class MessageBridge {
38
38
  setWindowProxy(proxy) {
39
39
  this._windowProxy = proxy;
40
40
  }
41
- /** Update current URI (called by IFrameWidget on load-changed) */
41
+ /** Update current URI (called by IFrameBridge on load-changed) */
42
42
  updateUri(uri) {
43
43
  this._currentUri = uri;
44
44
  }
@@ -4,14 +4,14 @@ import type { IFrameWindowProxy } from './iframe-window-proxy.js';
4
4
  /**
5
5
  * HTML IFrame Element.
6
6
  *
7
- * Backed by WebKit.WebView when connected to an IFrameWidget.
7
+ * Backed by WebKit.WebView when connected to an IFrameBridge.
8
8
  * Without a backing widget, behaves as a pure DOM element with attribute storage.
9
9
  *
10
10
  * Reference: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement
11
11
  */
12
12
  export declare class HTMLIFrameElement extends HTMLElement {
13
- /** @internal The backing IFrameWidget (set by IFrameWidget when it creates this element) */
14
- [PS.iframeWidget]: import('./iframe-widget.js').IFrameWidget | null;
13
+ /** @internal The backing IFrameBridge (set by IFrameBridge when it creates this element) */
14
+ [PS.iframeWidget]: import('./iframe-bridge.js').IFrameBridge | null;
15
15
  /** @internal The contentWindow proxy */
16
16
  [PS.windowProxy]: IFrameWindowProxy | null;
17
17
  /** @internal Whether content has been loaded */
@@ -37,7 +37,7 @@ export declare class HTMLIFrameElement extends HTMLElement {
37
37
  set height(value: string);
38
38
  /**
39
39
  * Returns the window proxy for the iframe's content.
40
- * Available after the IFrameWidget has loaded content.
40
+ * Available after the IFrameBridge has loaded content.
41
41
  */
42
42
  get contentWindow(): IFrameWindowProxy | null;
43
43
  /**