@thebase/ui 1.1.7 → 1.2.0

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/README.md +8 -4
  3. package/bin/create-baseui-app.mjs +28 -2
  4. package/dist/baseui.apidoc.esm.js +64 -64
  5. package/dist/baseui.apidoc.min.js +64 -64
  6. package/dist/baseui.esm.js +42 -61
  7. package/dist/baseui.icons.esm.js +1 -1
  8. package/dist/baseui.min.css +2 -2
  9. package/dist/baseui.min.js +61 -61
  10. package/dist/baseui.pwa.esm.js +71 -9
  11. package/dist/baseui.registry.json +13 -9
  12. package/dist/baseui.templates.xml +311 -311
  13. package/dist/baseui.vite.esm.js +116 -0
  14. package/dist/runtime/lazy/apidoc.logic.js +20 -0
  15. package/dist/runtime/milkdown/milkdown-editor.js +1 -1
  16. package/dist/runtime/milkdown/milkdown-text-editor.js +1 -1
  17. package/dist/themes/baseui-dark.css +80 -1
  18. package/dist/themes/baseui-dark.min.css +1 -0
  19. package/dist/themes/baseui-light.css +81 -1
  20. package/dist/themes/baseui-light.min.css +1 -0
  21. package/dist/types/pwa.d.ts +1 -45
  22. package/dist/types/vite.d.ts +4 -0
  23. package/docs/analytics.md +3 -3
  24. package/docs/base-ui-skill.md +54 -0
  25. package/docs/blocks.md +1 -1
  26. package/docs/components/accordion.md +4 -4
  27. package/docs/components/apidoc.md +1 -1
  28. package/docs/components/block-viewer.md +1 -1
  29. package/docs/components/breadcrumb.md +1 -1
  30. package/docs/components/button.md +1 -1
  31. package/docs/components/code-editor.md +1 -1
  32. package/docs/components/data-table.md +2 -2
  33. package/docs/components/dialog.md +5 -5
  34. package/docs/components/form.md +29 -29
  35. package/docs/components/input.md +1 -1
  36. package/docs/components/markdown.md +1 -1
  37. package/docs/components/pwa.md +1 -1
  38. package/docs/components/shell.md +2 -2
  39. package/docs/components/sidebar.md +16 -16
  40. package/docs/components/text-editor.md +1 -1
  41. package/docs/components/theme-button.md +1 -1
  42. package/docs/components/toast.md +10 -10
  43. package/docs/components/typography.md +21 -2
  44. package/docs/icons.md +1 -1
  45. package/docs/installation.md +2 -2
  46. package/docs/owl-components.md +1 -1
  47. package/docs/runtime-api.md +2 -2
  48. package/docs/theming.md +33 -3
  49. package/docs/usage-guide.md +23 -6
  50. package/package.json +6 -1
@@ -32,7 +32,7 @@ Save this as an `.html` file and open it — no build step, no server required.
32
32
  </html>
33
33
  ```
34
34
 
35
- `https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/...` is the real jsDelivr URL for the published `@thebase/ui` npm package's `latest` tag, used here for a copy-paste-and-go quick start. Pin an exact version instead (e.g. `@1.1.7`, or `@1` to take only non-breaking updates) for production, so a new release can't change what your page loads. See [Installation](installation.md) for jsDelivr/unpkg/npm/self-hosted paths.
35
+ `https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/...` is the real jsDelivr URL for the published `@thebase/ui` npm package's `latest` tag, used here for a copy-paste-and-go quick start. Pin an exact version instead (e.g. `@1.2.0`, or `@1` to take only non-breaking updates) for production, so a new release can't change what your page loads. See [Installation](installation.md) for jsDelivr/unpkg/npm/self-hosted paths.
36
36
 
37
37
  The static bundle calls `thebase.mountAll()` automatically on `DOMContentLoaded`, so initial `[b-ui]` and `[b-icon]` markup mounts without an extra script. Call `thebase.mountAll(root)` yourself only after injecting new markup or when mounting a specific fragment. If the consumer is itself an application, use [step 2](#2-install-pure-owl-api--recommended) instead — that's the recommended path.
38
38
 
@@ -63,7 +63,7 @@ Both APIs come from the same package and the same CSS file, and can be mixed on
63
63
  </script>
64
64
  ```
65
65
 
66
- `https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable — swap the host in each URL above. Pin an exact version (e.g. `@1.1.7`, or `@1` to take only non-breaking updates) instead of `@latest` for production.
66
+ `https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable — swap the host in each URL above. Pin an exact version (e.g. `@1.2.0`, or `@1` to take only non-breaking updates) instead of `@latest` for production.
67
67
 
68
68
  ```html
69
69
  <script type="module">
@@ -103,7 +103,7 @@ Two rules that account for most integration failures — see [Base Components](o
103
103
  <script src="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.js" defer></script>
104
104
  ```
105
105
 
106
- `https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable. Pin an exact version (e.g. `@1.1.7`, or `@1` to take only non-breaking updates) instead of `@latest` for production.
106
+ `https://unpkg.com/@thebase/ui@latest/dist/...` mirrors the same files as an alternative CDN if jsDelivr is unreachable. Pin an exact version (e.g. `@1.2.0`, or `@1` to take only non-breaking updates) instead of `@latest` for production.
107
107
 
108
108
  **Option B — npm (bundler-based apps: Vite, webpack, etc.):**
109
109
 
@@ -120,7 +120,7 @@ import "@thebase/ui"; // side-effect import: registers window.thebase and auto-m
120
120
 
121
121
  Rule that applies to both options:
122
122
 
123
- - Production pages must use a pinned version (e.g. `@thebase/ui@1.1.7` or `@thebase/ui@1`), never `@latest`.
123
+ - Production pages must use a pinned version (e.g. `@thebase/ui@1.2.0` or `@thebase/ui@1`), never `@latest`.
124
124
 
125
125
  Mount markup:
126
126
 
@@ -219,7 +219,7 @@ export default {
219
219
  },
220
220
  serviceWorker: {
221
221
  cacheName: "my-app-cache-v1",
222
- cdnVersion: "1.1.7", // pin to match the importmap in index.html
222
+ cdnVersion: "1.2.0", // pin to match the importmap in index.html
223
223
  appFiles: ["/app.css", "/app.js", "/app.xml", "/favicon.svg", "/icons/icon-192.png", "/icons/icon-512.png"],
224
224
  },
225
225
  };
@@ -227,9 +227,17 @@ export default {
227
227
 
228
228
  ```sh
229
229
  npx create-baseui-app pwa . --config baseui.pwa.config.js
230
- # writes ./manifest.webmanifest and ./sw.js
230
+ # writes ./manifest.webmanifest, ./sw.js, ./sw-register.js and ./version.json
231
231
  ```
232
232
 
233
+ **Auto-reload on a new deploy.** The generated `sw.js` fetches `version.json` (never cached) on activate, on
234
+ every page navigation and when the page posts `"check-version"`. When the value differs from the last one it
235
+ saw, it wipes the caches, re-precaches the app shell and posts `"version-changed"` to every open page.
236
+ `sw-register.js` (load it with `<script type="module" src="/sw-register.js">`, replacing your own
237
+ `serviceWorker.register`) registers the worker, reloads on that message and re-checks when the tab becomes
238
+ visible. `version.json` is a content hash of `sw.js`, the manifest and every `appFiles` entry found under
239
+ `<path>`, so re-run the `pwa` command as the last step of every deploy.
240
+
233
241
  Re-run the command whenever `appFiles`, the CDN pin, or manifest fields change — both output files are
234
242
  fully regenerated, never hand-patched. Only `manifest.name`, `serviceWorker.cacheName`, and
235
243
  `serviceWorker.cdnVersion` are required; everything else (icons, theme/background color, display
@@ -239,6 +247,15 @@ files are kept, so your own icons win). Serving icons from another folder? Set `
239
247
  service worker) and `manifestUrl` (service worker) in the config. See
240
248
  `dist/types/pwa.d.ts` for the full config shape.
241
249
 
250
+ **Default in every scaffolded project.** `create-baseui-app create|init` projects ship
251
+ `plugins: [baseuiPwa({ name })]` (from `@thebase/ui/vite`) in `vite.config.js`. Each `vite build` then emits
252
+ `manifest.webmanifest`, `sw.js`, `sw-register.js`, `version.json` (hash of the built bundle) and the default
253
+ icons into `dist/`, and injects the manifest link, theme color and register script into every page — no
254
+ config file, no extra command. Every deploy with changed code therefore reloads open pages automatically.
255
+ `vite dev` is untouched. Options: `name`, `description`, `themeColor` and the other manifest fields, plus
256
+ `cdnVersion` (only for apps that load BaseUI from the CDN). For an existing project, add the plugin to
257
+ `vite.config.js` (`convert` prints this hint). Remove the plugin to opt out.
258
+
242
259
  ## 6. Copy a block instead of assembling from primitives
243
260
 
244
261
  For common layouts (dashboard shells, sidebars, login/signup forms, charts), copy a ready-made block from the gallery instead of composing primitives by hand: [Blocks](blocks.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thebase/ui",
3
- "version": "1.1.7",
3
+ "version": "1.2.0",
4
4
  "description": "CDN-installable Bootstrap 5 UI component library.",
5
5
  "type": "module",
6
6
  "main": "./dist/baseui.min.js",
@@ -34,6 +34,10 @@
34
34
  "types": "./dist/types/pwa.d.ts",
35
35
  "import": "./dist/baseui.pwa.esm.js"
36
36
  },
37
+ "./vite": {
38
+ "types": "./dist/types/vite.d.ts",
39
+ "import": "./dist/baseui.vite.esm.js"
40
+ },
37
41
  "./dist/baseui.templates.xml": "./dist/baseui.templates.xml"
38
42
  },
39
43
  "files": [
@@ -47,6 +51,7 @@
47
51
  "dist/baseui.apidoc.esm.js",
48
52
  "dist/baseui.apidoc.min.js",
49
53
  "dist/baseui.pwa.esm.js",
54
+ "dist/baseui.vite.esm.js",
50
55
  "dist/baseui.templates.xml",
51
56
  "dist/icons",
52
57
  "dist/pwa-icons",