@startside/swa 1.0.2 → 1.0.4

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/LICENSE CHANGED
@@ -1,11 +1,12 @@
1
1
  This package holds two kinds of files, under two licences:
2
2
 
3
- - The runtime, its types and the command (swa/1.0/runtime.js, swa/1.0/swa.d.ts, bin/swa.mjs): the MIT License,
4
- below, which covers them only, not the texts. bin/swa.mjs also holds Acorn and acorn-jsx, under their own MIT
5
- licences, at the end of this file.
6
- - The texts (swa/1.0/spec.md, swa/1.0/quickstart.md, swa/1.0/agents.md): the Startside Widget API (SWA) 1.0
7
- specification, SWA in 60 lines and the guide for agents, © 2026 François Hodierne, under the Creative Commons
8
- Attribution 4.0 International licence (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/
3
+ - The runtimes, their styles, the types and the command (swa/1.0/runtime.js, swa/1.0/frame.js, swa/1.0/frame.css,
4
+ swa/1.0/swa.d.ts, bin/swa.mjs): the MIT License, below, which covers them only, not the texts. bin/swa.mjs also
5
+ holds Acorn and acorn-jsx, under their own MIT licences, at the end of this file.
6
+ - The texts (swa/1.0/spec.md, swa/1.0/quickstart.md, swa/1.0/agents.md, swa/1.0/host.md): the Startside Widget API
7
+ (SWA) 1.0 specification, SWA in 60 lines, the guide for agents and the guide for hosts, © 2026 François Hodierne,
8
+ under the Creative Commons Attribution 4.0 International licence (CC BY 4.0):
9
+ https://creativecommons.org/licenses/by/4.0/
9
10
  Their current versions: https://startside.app/swa/1.0/
10
11
 
11
12
  MIT License
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @startside/swa
2
2
 
3
- The runtime of the **Startside Widget API (SWA) 1.0**, its TypeScript types, its specification in Markdown, and a
4
- command that checks a widget file and inlines its runtime.
3
+ The runtime of the **Startside Widget API (SWA) 1.0**, its TypeScript types, its specification in Markdown, a
4
+ command that checks a widget file and inlines its runtime, and what another host needs to run widgets in its own page.
5
5
 
6
6
  An SWA widget is a single HTML file: its head names it and loads this runtime, a hidden form declares its settings, and
7
7
  its scripts draw it through one object, `widget`. Opened on its own, the file runs on a standalone page with the
@@ -83,13 +83,27 @@ that loads the runtime by its address as the widget's own, and inline again afte
83
83
 
84
84
  Or next to a widget's code, with the file copied beside it: `/// <reference path="./swa.d.ts" />`.
85
85
 
86
+ ## Running widgets in your own page
87
+
88
+ Since 1.0.3, for a page that runs SWA widget files the way Startside's dashboard does, each in a sandboxed frame:
89
+
90
+ - `swa/1.0/frame.js`: the runtime a host writes into a widget's frame (not `runtime.js`, which runs a file on its own
91
+ page);
92
+ - `swa/1.0/frame.css`: its base styles, for the frame's host layer;
93
+ - `swa/1.0/host.md`: how: the frame, its document, the config the runtime reads, and the messages a host must answer;
94
+ - since 1.0.4, `swa/1.0/host.js`: the host's side as code, from the code Startside runs: a widget file read, its
95
+ settings' values, the frame's document written, a message checked. A plain ES module for the browser.
96
+
97
+ RWA files need RWA's runtime: `@startside/rwa`, whose `host.js` reads SWA and RWA files alike.
98
+
86
99
  ## Versions
87
100
 
88
- The package has its own version. A patch is a runtime fix, the texts brought up to date, or the command's changes; a
101
+ The package's version is `@startside/rwa`'s: they are released together, at the same version (since 1.0.4), so a
102
+ host taking both takes one number. A patch is a runtime fix, the texts brought up to date, or the command's changes; a
89
103
  minor release can add a version of the API beside the others (`swa/1.1/` beside `swa/1.0/`); a major release would
90
104
  remove one. The API's version is the one in the path.
91
105
 
92
106
  ## Licence
93
107
 
94
- The runtime, the types and the command: MIT; the command holds Acorn and acorn-jsx, MIT too. The texts (`spec.md`,
95
- `quickstart.md`, `agents.md`): CC BY 4.0, © François Hodierne. `LICENSE` says which is which.
108
+ The runtimes, their styles, the types and the command: MIT; the command holds Acorn and acorn-jsx, MIT too. The texts (`spec.md`,
109
+ `quickstart.md`, `agents.md`, `host.md`): CC BY 4.0, © François Hodierne. `LICENSE` says which is which.