@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.
- package/CHANGELOG.md +61 -1
- package/README.md +8 -4
- package/bin/create-baseui-app.mjs +28 -2
- package/dist/baseui.apidoc.esm.js +64 -64
- package/dist/baseui.apidoc.min.js +64 -64
- package/dist/baseui.esm.js +42 -61
- package/dist/baseui.icons.esm.js +1 -1
- package/dist/baseui.min.css +2 -2
- package/dist/baseui.min.js +61 -61
- package/dist/baseui.pwa.esm.js +71 -9
- package/dist/baseui.registry.json +13 -9
- package/dist/baseui.templates.xml +311 -311
- package/dist/baseui.vite.esm.js +116 -0
- package/dist/runtime/lazy/apidoc.logic.js +20 -0
- package/dist/runtime/milkdown/milkdown-editor.js +1 -1
- package/dist/runtime/milkdown/milkdown-text-editor.js +1 -1
- package/dist/themes/baseui-dark.css +80 -1
- package/dist/themes/baseui-dark.min.css +1 -0
- package/dist/themes/baseui-light.css +81 -1
- package/dist/themes/baseui-light.min.css +1 -0
- package/dist/types/pwa.d.ts +1 -45
- package/dist/types/vite.d.ts +4 -0
- package/docs/analytics.md +3 -3
- package/docs/base-ui-skill.md +54 -0
- package/docs/blocks.md +1 -1
- package/docs/components/accordion.md +4 -4
- package/docs/components/apidoc.md +1 -1
- package/docs/components/block-viewer.md +1 -1
- package/docs/components/breadcrumb.md +1 -1
- package/docs/components/button.md +1 -1
- package/docs/components/code-editor.md +1 -1
- package/docs/components/data-table.md +2 -2
- package/docs/components/dialog.md +5 -5
- package/docs/components/form.md +29 -29
- package/docs/components/input.md +1 -1
- package/docs/components/markdown.md +1 -1
- package/docs/components/pwa.md +1 -1
- package/docs/components/shell.md +2 -2
- package/docs/components/sidebar.md +16 -16
- package/docs/components/text-editor.md +1 -1
- package/docs/components/theme-button.md +1 -1
- package/docs/components/toast.md +10 -10
- package/docs/components/typography.md +21 -2
- package/docs/icons.md +1 -1
- package/docs/installation.md +2 -2
- package/docs/owl-components.md +1 -1
- package/docs/runtime-api.md +2 -2
- package/docs/theming.md +33 -3
- package/docs/usage-guide.md +23 -6
- package/package.json +6 -1
package/docs/usage-guide.md
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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",
|