@pentacode/embed 0.1.0 → 1.52.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/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## 1.52.0
4
+
5
+ - Versions follow the pentacode release they ship with. No changes to the API.
6
+
7
+ ## 0.1.0
8
+
9
+ - Types for `<pentacode-app>`: the element, its attributes, `PentacodeRoute`, and the `pentacode-ready`,
10
+ `pentacode-route-change` and `pentacode-error` events. `pentacode-error` says whether the app stopped
11
+ (`fatal`).
12
+ - `loadPentacode(origin)` loads the element from your pentacode origin, once per origin.
13
+ - `createRouteMap` maps your URLs to pentacode routes and back.
14
+ - `ICON_NAMES` and `IconName`, the icon tokens an `icon-sprite` can provide.
15
+ - `@pentacode/embed/react`: JSX typings for React 19 and `usePentacodeApp`.
package/README.md CHANGED
@@ -12,7 +12,11 @@ needs around it: loading the module and mapping your URLs to pentacode routes.
12
12
  pnpm add @pentacode/embed
13
13
  ```
14
14
 
15
- Your build bundles the version you installed, while `pentacode.js` comes from your origin and may be newer.
15
+ Versions follow the pentacode release they ship with. A `~` range takes that release's fixes, and moving to a newer
16
+ release stays a deliberate update. Your build bundles the version you installed, while `pentacode.js` comes from
17
+ your origin and may be newer.
18
+
19
+ TypeScript hosts need `moduleResolution` `bundler`, `node16` or `nodenext`: the package resolves through `exports` only.
16
20
 
17
21
  ## Load pentacode
18
22
 
@@ -26,6 +30,10 @@ await loadPentacode("https://manage.example.pentacode.app");
26
30
  page upgrade when it resolves. A failed load stays failed until the page reloads, so catch the rejection
27
31
  and offer a reload.
28
32
 
33
+ Take the origin from your host's config, one per environment, for example `loadPentacode(import.meta.env.VITE_PENTACODE_ORIGIN)`.
34
+ The origin decides which pentacode server the app talks to. A page holds one origin: `<pentacode-app>` registers once, so
35
+ switching environments takes a reload. List the origin you load in your [Content-Security-Policy](#content-security-policy).
36
+
29
37
  ## Render the element
30
38
 
31
39
  ```html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentacode/embed",
3
- "version": "0.1.0",
3
+ "version": "1.52.0",
4
4
  "description": "Types and helpers for hosts embedding <pentacode-app>",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
- "README.md"
24
+ "README.md",
25
+ "CHANGELOG.md"
25
26
  ],
26
27
  "publishConfig": {
27
28
  "access": "public",
@@ -38,8 +39,8 @@
38
39
  "typescript": "^5.9.3"
39
40
  },
40
41
  "peerDependencies": {
41
- "react": ">=19",
42
- "@types/react": ">=19"
42
+ "@types/react": ">=19",
43
+ "react": ">=19"
43
44
  },
44
45
  "peerDependenciesMeta": {
45
46
  "react": {