rapier-embed 1.2.51 → 1.2.52

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
@@ -20,7 +20,7 @@ Honor no-upload or no-host instructions. The workflow choices below are alternat
20
20
  Embed Rapier's Markdown editor or lightweight reader in your web app. Each build is one offline HTML file. The helper is an ES module: `import {Rapier} from 'rapier-embed'` or `<script type="module">`; there is no classic script or UMD build. Your
21
21
  app owns the document and storage; its agent edits live through WebMCP. The person sees the agent's presence and
22
22
  change marks, taps a change to see the before and undoes anything. Honor the person's Will/1 regions.
23
- The reader is one file of about 410 kB, `rapier.html` about 4.0 MB, with optional fonts and plug-ins. The helper is MIT with no dependencies. The two builds it frames are AGPL-3.0-only: use them under the AGPL, or
23
+ The reader is one file of about 420 kB, `rapier.html` about 4.0 MB, with optional fonts and plug-ins. The helper is MIT with no dependencies. The two builds it frames are AGPL-3.0-only: use them under the AGPL, or
24
24
  buy a commercial license for other terms (`LICENSING.md` in the Rapier repository).
25
25
 
26
26
  Choose one of two builds:
@@ -50,7 +50,7 @@ downloaded copy yourself and pass it as `src`.
50
50
  document access remain enforced.
51
51
 
52
52
  ```sh
53
- npm install rapier-embed@1.2.51
53
+ npm install rapier-embed@1.2.52
54
54
  ```
55
55
 
56
56
  Or copy the package's `embed.mjs` and `contract.mjs` into one directory of your app; no runtime CDN is needed.
@@ -64,7 +64,7 @@ sends Markdown only when saving; change notifications contain no source.
64
64
  Rapier is a phone-first Markdown editor for notes, diagrams, drawing and watercolor painting. It runs offline
65
65
  as one HTML file on Android, Web, Windows and Linux.
66
66
  Collaborate over MCP and WebMCP, use optional plain-file sync to your own cloud storage, or embed the
67
- editor and lightweight reader (about 410 kB). The agent edits live; the person sees its presence and
67
+ editor and lightweight reader (about 420 kB). The agent edits live; the person sees its presence and
68
68
  changes, taps a change to see the before and undoes anything. Use `show {target:"comparison"}` to show a diff deliberately.
69
69
 
70
70
  1. **Work together live.** Connect to `https://mcp.rapier.website/door/mcp`, then call `open` to share one document with the person.
@@ -138,7 +138,7 @@ The reader on its own page opens a document at an address on its own origin: `ht
138
138
 
139
139
  Keep the helper, page and plug-in manifest on one version. For version 1.2.46:
140
140
 
141
- 1. Install the helper: `npm install rapier-embed@1.2.51`.
141
+ 1. Install the helper: `npm install rapier-embed@1.2.52`.
142
142
  2. Create `public/vendor/rapier/` and save the reader into it from
143
143
  `https://cdn.jsdelivr.net/gh/jackskip22/rapier-plugins@cdn-v1.2.46/embed/rapier-reader.html`.
144
144
  3. Fetch its plug-ins from the same version's manifest:
@@ -160,8 +160,8 @@ length and SHA-384 before it runs it, and keeps on the device. A file that fails
160
160
  <!-- PLUGIN_TABLE_BEGIN (tools/embed-plugin-table.mjs writes this table) -->
161
161
  | Plug-in | Adds | Size | Pages |
162
162
  | --- | --- | --- | --- |
163
- | `flowchart` | Draws Mermaid flowcharts and graphs natively, in the editor's own style. | 0.34 MB | The reader |
164
- | `docx` | Opens a Word document (.docx) as a Markdown document: headings, lists, tables, pictures and comments. | 0.91 MB | The reader |
163
+ | `flowchart` | Draws Mermaid flowcharts and graphs natively, in the editor's own style. | 0.36 MB | The reader |
164
+ | `docx` | Opens a Word document (.docx) as a Markdown document: headings, lists, tables, pictures and comments. | 0.92 MB | The reader |
165
165
  | `math` | Typesets TeX math ($...$ and $$...$$) as SVG. | 0.74 MB | Both |
166
166
  | `diagrams` | Draws every other Mermaid diagram: sequence, class, state, ER, Gantt, pie and more. | 1.14 MB (2 files) | Both |
167
167
  | `pdf` | Opens a PDF as a Markdown document: its text layer, or each page as a picture. Fetches the pdf.js files itself. | 6.16 MB (198 files) | Both |
@@ -172,7 +172,7 @@ length and SHA-384 before it runs it, and keeps on the device. A file that fails
172
172
  | `elements` | The Elements sheet's traced ornaments: 3,155 pieces from the ornament book. | 16.2 MB (51 files) | `rapier.html` |
173
173
  | `lettersets` | The Gallery's letter sets: 31 sets of ornamental capitals. | 2.82 MB (31 files) | `rapier.html` |
174
174
 
175
- Totals: the reader, 9.29 MB (31.0 MB with `ocr`); `rapier.html`, 57.2 MB. Release 1.2.51.
175
+ Totals: the reader, 9.32 MB (31.0 MB with `ocr`); `rapier.html`, 57.2 MB. Release 1.2.52.
176
176
  <!-- PLUGIN_TABLE_END -->
177
177
 
178
178
  The manifest lists every plug-in file and, in `builds`, the pages that use it. `rapier.html` has flowcharts and Word import
package/contract.mjs CHANGED
@@ -264,6 +264,6 @@ export function pictureBase(value) {
264
264
  return Object.assign(src => {
265
265
  const text = String(src || '').trim();
266
266
  if (!text || /^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i.test(text)) return null;
267
- try { const href = new URL(text, base).href; vouched.add(href); return href; } catch (_) { return null; }
267
+ try { const url = new URL(text, base); if (url.origin !== base.origin) return null; vouched.add(url.href); return url.href; } catch (_) { return null; }
268
268
  }, {vouched});
269
269
  }
package/embed.mjs CHANGED
@@ -265,13 +265,13 @@ function pictureBase(value) {
265
265
  return Object.assign(src => {
266
266
  const text = String(src || '').trim();
267
267
  if (!text || /^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i.test(text)) return null;
268
- try { const href = new URL(text, base).href; vouched.add(href); return href; } catch (_) { return null; }
268
+ try { const url = new URL(text, base); if (url.origin !== base.origin) return null; vouched.add(url.href); return url.href; } catch (_) { return null; }
269
269
  }, {vouched});
270
270
  }
271
271
  return {FEATURES, LIMITS, ASSET_TYPES, refusal, coded, normalizeSettings, snapshotSettings, pickDeviceFile, createFilePicker, assetURL, assetBytes, bytesHash, externalImage, createAssetBroker, pictureBase};
272
272
  })();
273
273
  const BUILDS = Object.freeze({full: 'https://rapier.website/embed/rapier.html', reader: 'https://rapier.website/embed/rapier-reader.html'});
274
- const PACKAGE_VERSION = '1.2.51';
274
+ const PACKAGE_VERSION = '1.2.52';
275
275
  const OPTIONS = ['build', 'src', 'plugins', 'approvePlugins', 'sessionId', 'documentId', 'agent', 'agentName', 'theme', 'save', 'assets', 'openFile', 'load',
276
276
  'onState', 'compare', 'onClose', 'settings', 'style', 'title', 'onError', 'timeout'];
277
277
  const READER_FEATURES = ['find', 'readAloud', 'share'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapier-embed",
3
- "version": "1.2.51",
3
+ "version": "1.2.52",
4
4
  "description": "Embed the Rapier Markdown editor or its lightweight reader (about 360 kB) in your web app. Runs offline from your own copy, saves to your storage, and takes your CSS and fonts. Your app's AI agent edits directly over WebMCP under the Will. MIT, no dependencies.",
5
5
  "keywords": [
6
6
  "markdown",