@panphora/hyper-cms 0.6.0 → 0.6.2

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
@@ -23,14 +23,28 @@ Add hypercms and a trigger:
23
23
 
24
24
  ```html
25
25
  <script type="module" src="https://cdn.jsdelivr.net/npm/hyperclayjs@latest/src/utilities/mutation.js"></script>
26
- <script type="module">
27
- import { cms } from 'https://cdn.jsdelivr.net/npm/hypercms@latest/src/hypercms.js'
28
- document.getElementById('edit-btn').addEventListener('click', () => cms.open())
26
+ <script src="https://cdn.jsdelivr.net/npm/@panphora/hyper-cms@latest/dist/hypercms.min.js"></script>
27
+ <script>
28
+ document.getElementById('edit-btn').addEventListener('click', () => hypercms.cms.open())
29
29
  </script>
30
30
  <button id="edit-btn">Edit</button>
31
31
  ```
32
32
 
33
- That's the whole integration.
33
+ That's the whole integration. The bundle exposes a global `hypercms` and
34
+ installs its own styles, so nothing else is needed.
35
+
36
+ Loading from a bundler instead:
37
+
38
+ ```js
39
+ import { cms } from '@panphora/hyper-cms'
40
+ import '@panphora/hyper-cms/styles.css'
41
+ ```
42
+
43
+ Note the package's `.` export (`src/hypercms.js`) imports `hyper-html-api`
44
+ by bare specifier, so it only resolves through a bundler or an import map.
45
+ Loading that path straight from a CDN will fail. Use `dist/hypercms.min.js`
46
+ in the browser, or jsDelivr's `+esm` route, which rewrites the bare imports
47
+ for you but leaves you to call `installStyles()` yourself.
34
48
 
35
49
  `cms.open()` also accepts an explicit rules source:
36
50
 
@@ -252,7 +266,7 @@ Inside a template, the engine looks for these slots:
252
266
  ## API
253
267
 
254
268
  ```js
255
- import { cms } from 'hypercms'
269
+ import { cms } from '@panphora/hyper-cms'
256
270
 
257
271
  cms.open(opts?)
258
272
  cms.close()