rapier-html 1.1.104 → 1.2.5

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.
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
1
+ // SPDX-License-Identifier: MIT
2
2
  // Shared by the writer and the page. Every page Rapier writes (page.mjs's wrap, the editor's Share and HTML export) carries
3
3
  // PAGE_SEED once, after its charset (which must stay in the first 1024 bytes): an HTML comment no person sees that tells an
4
4
  // agent what the file is and how to make one, never part of the carried document.
@@ -16,6 +16,6 @@ export function returnAddress(value) {
16
16
  }
17
17
  export function returnExpiresAt(value) {
18
18
  if (typeof value !== 'string' || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(value) || !Number.isFinite(Date.parse(value)) || new Date(value).toISOString() !== value)
19
- throw new Error('the return expiry must be the ISO timestamp from document.create_return');
19
+ throw new Error('the return expiry must be the ISO timestamp from show {target:"return"}');
20
20
  return value;
21
21
  }
package/dist/wrap.mjs CHANGED
@@ -54,7 +54,7 @@ export function wrap(pageHtml, text, name, options) {
54
54
  if (opts.view != null && !['draw', 'notes'].includes(opts.view)) throw new Error('the view is draw or notes');
55
55
  const address = opts.return == null ? null : returnAddress(opts.return);
56
56
  const expiry = opts.return_expires_at == null ? null : returnExpiresAt(opts.return_expires_at);
57
- if (!!address !== !!expiry) throw new Error('a return needs its URL and return_expires_at from document.create_return');
57
+ if (!!address !== !!expiry) throw new Error('a return needs return_url and return_expires_at from show {target:"return"}');
58
58
  const block = START + ' data-name="' + docName + '"' + (opts.kind ? ' data-kind="' + opts.kind + '"' : '') + (opts.view ? ' data-view="' + opts.view + '"' : '') +
59
59
  (address ? ' data-return="' + address + '" data-return-expires-at="' + expiry + '"' : '') + '>' + encodeCarried(text) + END;
60
60
  let carriedBlocks = '\n' + writeParts(text, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapier-html",
3
- "version": "1.1.104",
3
+ "version": "1.2.5",
4
4
  "description": "One command turns a Markdown file into one offline HTML file: the whole Rapier editor with the document inside. Opens in any browser, phone or desktop, with no install or account. Write, draw and paint watercolor, then Send back the edits to your AI agent.",
5
5
  "keywords": [
6
6
  "markdown",