@wervt/cms 0.0.3 → 0.0.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.
- package/README.md +16 -1
- package/dist/editor/assets/Button-Dai6Ph2c.js +6 -0
- package/dist/editor/assets/{RichTextInput-DHmilx6T.js → RichTextInput-CdL9ZFoP.js} +120 -120
- package/dist/editor/assets/Toast-BaUcosq6.js +13 -0
- package/dist/editor/assets/index-CP6dGIyl.css +2 -0
- package/dist/editor/assets/index-Du-lvx2V.js +16 -0
- package/dist/editor/index.html +3 -3
- package/dist/module.js +5 -1
- package/dist/runtime/app/drafts.d.ts +5 -0
- package/dist/runtime/app/drafts.js +8 -0
- package/dist/runtime/app/preview.client.d.ts +2 -0
- package/dist/runtime/app/preview.client.js +28 -0
- package/dist/runtime/app/useCms.js +2 -1
- package/dist/runtime/preview.d.ts +34 -0
- package/dist/runtime/preview.js +35 -0
- package/package.json +2 -2
- package/dist/editor/assets/Button-BHCKwuIs.js +0 -6
- package/dist/editor/assets/Toast-pKrAdYOo.js +0 -13
- package/dist/editor/assets/index-JJD_O40W.js +0 -16
- package/dist/editor/assets/index-kXxO7vu1.css +0 -2
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.
|