@wervt/cms 0.0.3 → 0.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/README.md CHANGED
@@ -118,6 +118,20 @@ can be reordered, images come from the camera or the gallery, and a page defined
118
118
  `{ label, path }` (`defineCmsPage('home', { … }, { label: 'Home', path: '/' })`) shows its label
119
119
  and a button that opens it on the site. `/_cms?key=<key>` opens one page. It speaks English and German, after the browser's language.
120
120
 
121
+ A menu lists the pages. Pages with a `path` form a tree by their paths, so `/menu/drinks` sits
122
+ under `/menu`; pages without one (a footer, say) are listed apart as content on every page. When
123
+ the editor shows only the form on a wide screen, the menu is a sidebar; next to the preview and on
124
+ phones it opens from the button left of the page's name.
125
+
126
+ Next to the form, the editor shows the site with what's in the form, saved or not. On a wide
127
+ screen the form is a sidebar beside the site; on a phone the site fills the screen and the form is
128
+ a sheet over it, dragged up or down by its handle. A page with a `path` opens there; other pages
129
+ (a footer, say) show on whatever page the site is on, which is the first page with a `path` when
130
+ the editor opens on them. Following a link on the site opens that page's form, unless the current
131
+ one has unsaved changes. The site gets these values through a small client plugin that does
132
+ nothing outside the editor. If the site doesn't answer within a few seconds of loading (it can't
133
+ be shown in a frame, or the frame shows a sign-in), the editor shows only the form.
134
+
121
135
  The API behind it:
122
136
 
123
137
  - `GET /api/_cms/entries/<key>`: the page's values, defaults filled in. Public.
@@ -174,4 +188,5 @@ The editor is a Vite app in `editor/`, built into the package (`vp build editor`
174
188
  `vp run build`). To work on it, run a site with the module, then
175
189
  `CMS_SITE=http://localhost:3000 vp dev editor` in `packages/cms`: the editor comes from Vite at
176
190
  `http://localhost:5173/_cms/`, its API and images from the site. The site's `cms.editor.theme` only
177
- applies where the site serves the editor.
191
+ applies where the site serves the editor, and so does the preview: the site and the editor have
192
+ to share an origin.