@pwfabric/embed 1.0.0-rc.0 → 1.0.0-rc.1

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.
Files changed (3) hide show
  1. package/README.md +29 -5
  2. package/dist/embed.js +21 -21
  3. package/package.json +26 -29
package/README.md CHANGED
@@ -1,14 +1,38 @@
1
1
  # @pwfabric/embed
2
2
 
3
- Puts a single surface inside a page you already have.
3
+ Renders a PWFabric surface anywhere, with the same renderer as `@pwfabric/runtime`. Two modes:
4
+ **thin** fetches the surface and its render grants from an API; **fat** renders
5
+ an inline surface, its block bundles and appearance fully offline, with no
6
+ backend. A `data-pw-surface` auto-loader is wired on load.
7
+
8
+ ## Install
4
9
 
5
10
  ```bash
6
- pnpm add @pwfabric/embed
11
+ pnpm add @pwfabric/embed@rc react react-dom
7
12
  ```
8
13
 
9
- Part of [PWFabric](https://github.com/pwfabric/pwfabric). Documentation, the
10
- other packages and the licensing model live in that repository.
14
+ ESM only: import it from an ES module (`"type": "module"` or `.mjs`). Node 22+. Peers: `react` and `react-dom` 18 or 19.
15
+
16
+ ## Main exports
17
+
18
+ | Export | What it is |
19
+ |--------|------------|
20
+ | `PWFabric` (also the default export) | `{ render, renderFat, loadThin, autoload }` |
21
+ | `renderFat`, `fatCoreOptions` | Offline (fat) rendering |
22
+ | `loadThin`, `grantsToDescriptors` | API-backed (thin) rendering |
23
+ | `buildFatHtml` | Build a self-contained HTML page for a surface |
24
+ | `autoload` | Mount every `[data-pw-surface]` element |
25
+ | `EmbedMode`, `EmbedSource`, `RenderFatOptions`, `LoadThinOptions`, … | Types |
26
+
27
+ ## Entry points
28
+
29
+ | Import | Contents |
30
+ |--------|----------|
31
+ | `@pwfabric/embed` | Everything above |
32
+ | `@pwfabric/embed/embed.js` | The self-contained browser bundle `dist/embed.js`, for a `<script type="module">` or a host that ships it as a file |
11
33
 
12
34
  ## Licence
13
35
 
14
- Business Source License 1.1 — see `LICENSE`. Use it, change it, host what you build with it; do not offer PWFabric itself as a service. Becomes Apache-2.0 on the Change Date.
36
+ Business Source License 1.1 — see `LICENSE`. Use it, change it, and host what you build with it, for yourself or your own customers; do not offer PWFabric itself as a service. Each version becomes Apache-2.0 on the Change Date in `LICENSE`. See [licensing](https://pwfabric.com/licence).
37
+
38
+ Part of [PWFabric](https://pwfabric.com) — the engine that renders an app. Source: [github.com/pwfabric/pwfabric](https://github.com/pwfabric/pwfabric).