@thebase/ui 0.0.4 → 0.0.6
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 +5 -0
- package/README.md +49 -8
- package/bin/create-baseui-app.mjs +268 -0
- package/dist/baseui.esm.js +2 -2
- package/dist/baseui.min.css +1 -1
- package/dist/baseui.min.js +2 -2
- package/dist/baseui.registry.json +6 -7
- package/dist/icons/lucide.json +2 -2
- package/dist/runtime/marked/marked.min.js +69 -0
- package/dist/runtime/mermaid/mermaid.esm.min.mjs +3593 -0
- package/dist/runtime/milkdown/apl-2VCEVXBO.js +1 -0
- package/dist/runtime/milkdown/asciiarmor-ND4TKJ2V.js +1 -0
- package/dist/runtime/milkdown/asn1-5NCC72L6.js +1 -0
- package/dist/runtime/milkdown/asterisk-V3QQOGYS.js +1 -0
- package/dist/runtime/milkdown/block-B3H3PJID.js +1 -0
- package/dist/runtime/milkdown/brainfuck-SETQDLAI.js +1 -0
- package/dist/runtime/milkdown/chunk-23NN352E.js +1 -0
- package/dist/runtime/milkdown/chunk-373V6XMI.js +1 -0
- package/dist/runtime/milkdown/chunk-37CATSBM.js +1 -0
- package/dist/runtime/milkdown/chunk-3EORQGKQ.js +1 -0
- package/dist/runtime/milkdown/chunk-6HASM4ZR.js +1 -0
- package/dist/runtime/milkdown/chunk-6RGD2KUU.js +1 -0
- package/dist/runtime/milkdown/chunk-7CVS4AGG.js +3 -0
- package/dist/runtime/milkdown/chunk-BV6CAHIM.js +4 -0
- package/dist/runtime/milkdown/chunk-CS3PHHYU.js +0 -0
- package/dist/runtime/milkdown/chunk-E5R7FPWA.js +5 -0
- package/dist/runtime/milkdown/chunk-E6JE25ZM.js +0 -0
- package/dist/runtime/milkdown/chunk-FGZNEC46.js +1 -0
- package/dist/runtime/milkdown/chunk-FOZORPFE.js +1 -0
- package/dist/runtime/milkdown/chunk-GAWLLGNO.js +5 -0
- package/dist/runtime/milkdown/chunk-GHRUWTEV.js +1 -0
- package/dist/runtime/milkdown/chunk-GVZW4OO4.js +1 -0
- package/dist/runtime/milkdown/chunk-HDKYYBRG.js +0 -0
- package/dist/runtime/milkdown/chunk-KJCZ4UN6.js +1 -0
- package/dist/runtime/milkdown/chunk-KOCVWYBK.js +1 -0
- package/dist/runtime/milkdown/chunk-KXKDEYCC.js +1 -0
- package/dist/runtime/milkdown/chunk-LIY3GISO.js +13 -0
- package/dist/runtime/milkdown/chunk-MSEQNMGN.js +0 -0
- package/dist/runtime/milkdown/chunk-PSGXCQNW.js +1 -0
- package/dist/runtime/milkdown/chunk-Q5FF4VKZ.js +1 -0
- package/dist/runtime/milkdown/chunk-R7FZKCAV.js +1 -0
- package/dist/runtime/milkdown/chunk-SFCQEU26.js +1 -0
- package/dist/runtime/milkdown/chunk-SMRDMV2Q.js +1 -0
- package/dist/runtime/milkdown/chunk-TTCZLSO2.js +1 -0
- package/dist/runtime/milkdown/chunk-UBIXYWAI.js +13 -0
- package/dist/runtime/milkdown/chunk-UPNN5QP4.js +3 -0
- package/dist/runtime/milkdown/chunk-VBVMNS5A.js +3 -0
- package/dist/runtime/milkdown/chunk-VKELS2FZ.js +41 -0
- package/dist/runtime/milkdown/chunk-VPKKXG6L.js +1 -0
- package/dist/runtime/milkdown/chunk-VYL5RGSY.js +0 -0
- package/dist/runtime/milkdown/chunk-WGUKYDQQ.js +1 -0
- package/dist/runtime/milkdown/chunk-XOIKFU3P.js +4 -0
- package/dist/runtime/milkdown/chunk-XOU65PX7.js +1 -0
- package/dist/runtime/milkdown/clike-WKR6QU6G.js +1 -0
- package/dist/runtime/milkdown/clipboard-SGEGWVIL.js +1 -0
- package/dist/runtime/milkdown/clojure-7C5XMSLE.js +1 -0
- package/dist/runtime/milkdown/cmake-VX6UCCMV.js +1 -0
- package/dist/runtime/milkdown/cobol-IUBDOVSU.js +1 -0
- package/dist/runtime/milkdown/coffeescript-OEAM3K5M.js +1 -0
- package/dist/runtime/milkdown/commonlisp-LRFHKBQZ.js +1 -0
- package/dist/runtime/milkdown/commonmark-KYRQSFY7.js +1 -0
- package/dist/runtime/milkdown/core-SZ3VAN2E.js +1 -0
- package/dist/runtime/milkdown/crystal-7XKMI75H.js +1 -0
- package/dist/runtime/milkdown/css-DTJ74K4A.js +1 -0
- package/dist/runtime/milkdown/cursor-4RIJS7XF.js +1 -0
- package/dist/runtime/milkdown/cypher-Y7ZMLKQ4.js +1 -0
- package/dist/runtime/milkdown/d-NSEMXQMQ.js +1 -0
- package/dist/runtime/milkdown/diff-BO3JC62N.js +1 -0
- package/dist/runtime/milkdown/diff-WJOHA5PX.js +1 -0
- package/dist/runtime/milkdown/dist-5HJGMMBO.js +1 -0
- package/dist/runtime/milkdown/dist-63GMFB3D.js +1 -0
- package/dist/runtime/milkdown/dist-6JDVYEX3.js +1 -0
- package/dist/runtime/milkdown/dist-7277C2KF.js +1 -0
- package/dist/runtime/milkdown/dist-EG2OA4VS.js +7 -0
- package/dist/runtime/milkdown/dist-EHUNF6M5.js +1 -0
- package/dist/runtime/milkdown/dist-I3JGQGWS.js +3 -0
- package/dist/runtime/milkdown/dist-I3LMG6JF.js +1 -0
- package/dist/runtime/milkdown/dist-IIRHY5PY.js +6 -0
- package/dist/runtime/milkdown/dist-J2KSREXK.js +1 -0
- package/dist/runtime/milkdown/dist-KY7AL6FL.js +1 -0
- package/dist/runtime/milkdown/dist-QB3U2COU.js +1 -0
- package/dist/runtime/milkdown/dist-QMASZW6X.js +1 -0
- package/dist/runtime/milkdown/dist-RS6ERIZS.js +1 -0
- package/dist/runtime/milkdown/dist-TKSPPVS4.js +1 -0
- package/dist/runtime/milkdown/dist-U6ZG6DV6.js +1 -0
- package/dist/runtime/milkdown/dist-UHXLU77N.js +1 -0
- package/dist/runtime/milkdown/dist-WNQ5J4WR.js +2 -0
- package/dist/runtime/milkdown/dist-WWUPY2DM.js +1 -0
- package/dist/runtime/milkdown/dist-X2CT5LDV.js +1 -0
- package/dist/runtime/milkdown/dist-ZBCFN6O5.js +1 -0
- package/dist/runtime/milkdown/dockerfile-NAEEVAQU.js +1 -0
- package/dist/runtime/milkdown/dtd-3HSCMPBI.js +1 -0
- package/dist/runtime/milkdown/dylan-UCUZF6KU.js +1 -0
- package/dist/runtime/milkdown/ebnf-3LHOCFAJ.js +1 -0
- package/dist/runtime/milkdown/ecl-5R3NXF6N.js +1 -0
- package/dist/runtime/milkdown/eiffel-CQ4L5MSH.js +1 -0
- package/dist/runtime/milkdown/elm-6QYNGBQ3.js +1 -0
- package/dist/runtime/milkdown/erlang-6NH23EDV.js +1 -0
- package/dist/runtime/milkdown/esm-W3C6FIFD.js +997 -0
- package/dist/runtime/milkdown/factor-MYKNDQPQ.js +1 -0
- package/dist/runtime/milkdown/fcl-ACRUXLOI.js +1 -0
- package/dist/runtime/milkdown/forth-MGVKD22I.js +1 -0
- package/dist/runtime/milkdown/fortran-Y2LH5YJY.js +1 -0
- package/dist/runtime/milkdown/gas-DGW2BQT5.js +1 -0
- package/dist/runtime/milkdown/gfm-E3RPWLDM.js +1 -0
- package/dist/runtime/milkdown/gherkin-YE56IVZ5.js +1 -0
- package/dist/runtime/milkdown/groovy-ACMNYCLF.js +1 -0
- package/dist/runtime/milkdown/haskell-MIB6HZSL.js +1 -0
- package/dist/runtime/milkdown/haxe-TANQRBYK.js +1 -0
- package/dist/runtime/milkdown/history-MXXSC4BB.js +1 -0
- package/dist/runtime/milkdown/http-QUK2BL6J.js +1 -0
- package/dist/runtime/milkdown/idl-54U6ONEE.js +1 -0
- package/dist/runtime/milkdown/indent-DPZPSW7O.js +1 -0
- package/dist/runtime/milkdown/javascript-43PROIAY.js +1 -0
- package/dist/runtime/milkdown/julia-7E2ZIO2U.js +1 -0
- package/dist/runtime/milkdown/lib-OHEPSUTR.js +1 -0
- package/dist/runtime/milkdown/lib-ULUU3LBY.js +1 -0
- package/dist/runtime/milkdown/listener-YERMSFXE.js +1 -0
- package/dist/runtime/milkdown/livescript-SUEXR7PK.js +1 -0
- package/dist/runtime/milkdown/lua-QNGITPQK.js +1 -0
- package/dist/runtime/milkdown/mathematica-HJQQXVFC.js +1 -0
- package/dist/runtime/milkdown/mbox-F6SUCJVD.js +1 -0
- package/dist/runtime/milkdown/milkdown-editor.js +1 -0
- package/dist/runtime/milkdown/milkdown-text-editor.js +1 -0
- package/dist/runtime/milkdown/mirc-7S5H76VB.js +1 -0
- package/dist/runtime/milkdown/mllike-TTW7I7W4.js +1 -0
- package/dist/runtime/milkdown/model-YUHBWZ3A.js +1 -0
- package/dist/runtime/milkdown/modelica-3POMKZFY.js +1 -0
- package/dist/runtime/milkdown/mscgen-IKAT43RT.js +1 -0
- package/dist/runtime/milkdown/mumps-XZE3RMGJ.js +1 -0
- package/dist/runtime/milkdown/nginx-QCVWU6DV.js +1 -0
- package/dist/runtime/milkdown/nsis-2G5LLGBI.js +1 -0
- package/dist/runtime/milkdown/ntriples-T6AMEY2C.js +1 -0
- package/dist/runtime/milkdown/octave-64EAJHKR.js +1 -0
- package/dist/runtime/milkdown/oz-7QHCZG72.js +1 -0
- package/dist/runtime/milkdown/pascal-KWNZTZKE.js +1 -0
- package/dist/runtime/milkdown/perl-KX75FRG7.js +1 -0
- package/dist/runtime/milkdown/pig-YA2LFBUW.js +1 -0
- package/dist/runtime/milkdown/powershell-SONNWKJG.js +1 -0
- package/dist/runtime/milkdown/properties-MEUWSNZY.js +1 -0
- package/dist/runtime/milkdown/protobuf-RKCPHWGY.js +1 -0
- package/dist/runtime/milkdown/pug-VWTHDU4H.js +1 -0
- package/dist/runtime/milkdown/puppet-JMZDB2TG.js +1 -0
- package/dist/runtime/milkdown/python-GVEPBHD7.js +1 -0
- package/dist/runtime/milkdown/q-QBK3FAEX.js +1 -0
- package/dist/runtime/milkdown/r-QZYPZHNL.js +1 -0
- package/dist/runtime/milkdown/rpm-DU7TLFAI.js +1 -0
- package/dist/runtime/milkdown/ruby-DMEPZV6P.js +1 -0
- package/dist/runtime/milkdown/sas-UQCOIXSD.js +1 -0
- package/dist/runtime/milkdown/scheme-ABXYL6GU.js +1 -0
- package/dist/runtime/milkdown/shell-M3XELTMZ.js +1 -0
- package/dist/runtime/milkdown/sieve-MUKKCDBZ.js +1 -0
- package/dist/runtime/milkdown/slash-WRZAFLVA.js +1 -0
- package/dist/runtime/milkdown/smalltalk-P4FKOVAU.js +1 -0
- package/dist/runtime/milkdown/solr-HHKG4NNK.js +1 -0
- package/dist/runtime/milkdown/sparql-5YJAIBWN.js +1 -0
- package/dist/runtime/milkdown/spreadsheet-M3SEYOFV.js +1 -0
- package/dist/runtime/milkdown/sql-Z6C3KTS5.js +1 -0
- package/dist/runtime/milkdown/stex-MO67FBMF.js +1 -0
- package/dist/runtime/milkdown/streaming-ODT2C2AX.js +1 -0
- package/dist/runtime/milkdown/stylus-JEMVT3OU.js +1 -0
- package/dist/runtime/milkdown/swift-HP7RYRJA.js +1 -0
- package/dist/runtime/milkdown/tcl-WPHRLNQC.js +1 -0
- package/dist/runtime/milkdown/textile-3LZDM6IW.js +1 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/gapcursor/style/gapcursor.css +25 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/tables/style/tables.css +48 -0
- package/dist/runtime/milkdown/theme/common/@milkdown/kit/prose/view/style/prosemirror.css +54 -0
- package/dist/runtime/milkdown/theme/common/ai.css +446 -0
- package/dist/runtime/milkdown/theme/common/block-edit.css +131 -0
- package/dist/runtime/milkdown/theme/common/code-mirror.css +347 -0
- package/dist/runtime/milkdown/theme/common/cursor.css +22 -0
- package/dist/runtime/milkdown/theme/common/diff.css +177 -0
- package/dist/runtime/milkdown/theme/common/image-block.css +384 -0
- package/dist/runtime/milkdown/theme/common/latex.css +42 -0
- package/dist/runtime/milkdown/theme/common/link-tooltip.css +107 -0
- package/dist/runtime/milkdown/theme/common/list-item.css +50 -0
- package/dist/runtime/milkdown/theme/common/placeholder.css +11 -0
- package/dist/runtime/milkdown/theme/common/prosemirror-virtual-cursor/style/virtual-cursor.css +51 -0
- package/dist/runtime/milkdown/theme/common/prosemirror.css +1 -0
- package/dist/runtime/milkdown/theme/common/reset.css +289 -0
- package/dist/runtime/milkdown/theme/common/style.css +15 -0
- package/dist/runtime/milkdown/theme/common/table.css +219 -0
- package/dist/runtime/milkdown/theme/common/toolbar.css +50 -0
- package/dist/runtime/milkdown/theme/common/top-bar.css +152 -0
- package/dist/runtime/milkdown/tiddlywiki-LMGAXCWG.js +1 -0
- package/dist/runtime/milkdown/tiki-SC7NYLRG.js +1 -0
- package/dist/runtime/milkdown/toml-VBRI3ILD.js +1 -0
- package/dist/runtime/milkdown/tooltip-MQR7E3GN.js +1 -0
- package/dist/runtime/milkdown/troff-MZNIC3MS.js +1 -0
- package/dist/runtime/milkdown/ttcn-ZUOU74GM.js +1 -0
- package/dist/runtime/milkdown/ttcn-cfg-2JJUM5CY.js +1 -0
- package/dist/runtime/milkdown/turtle-SNBPEJHA.js +1 -0
- package/dist/runtime/milkdown/upload-4DLRUKG7.js +1 -0
- package/dist/runtime/milkdown/utils-RGFMAFOI.js +1 -0
- package/dist/runtime/milkdown/vb-U45Y75DV.js +1 -0
- package/dist/runtime/milkdown/vbscript-XTRRB36U.js +1 -0
- package/dist/runtime/milkdown/velocity-Y7TX26SP.js +1 -0
- package/dist/runtime/milkdown/verilog-IFT4S6MZ.js +1 -0
- package/dist/runtime/milkdown/vhdl-CK4X465M.js +1 -0
- package/dist/runtime/milkdown/webidl-N7XOMHHB.js +1 -0
- package/dist/runtime/milkdown/xquery-EPMIEXTW.js +1 -0
- package/dist/runtime/milkdown/y-webrtc-MVXVFPYO.js +2 -0
- package/dist/runtime/milkdown/yacas-A74LVH45.js +1 -0
- package/dist/runtime/milkdown/yjs-L4ZX4CJ5.js +1 -0
- package/dist/runtime/milkdown/z80-NVBCD5FV.js +1 -0
- package/docs/blocks.md +4 -2
- package/docs/components/markdown.md +2 -2
- package/docs/components/text-editor.md +37 -3
- package/docs/icons.md +4 -2
- package/docs/installation.md +36 -28
- package/docs/owl-components.md +7 -5
- package/docs/theming.md +2 -2
- package/docs/usage-guide.md +64 -60
- package/package.json +8 -2
package/docs/usage-guide.md
CHANGED
|
@@ -6,7 +6,7 @@ Audience: engineers and AI coding agents integrating `@thebase/ui` into a projec
|
|
|
6
6
|
|
|
7
7
|
## Quick start (copy-paste, works as-is)
|
|
8
8
|
|
|
9
|
-
Save this as an `.html` file and open it — no build step, no server required. It installs BaseUI from the pinned CDN and renders a button, an input, and a card.
|
|
9
|
+
Save this as an `.html` file and open it — no build step, no server required. It installs BaseUI from the pinned CDN and renders a button, an input, and a card using the static `b-ui` markup API (the zero-build alternative). If you're building an Owl app, skip straight to the [pure Owl install](#2-install-pure-owl-api--recommended) below — it's the recommended way to consume BaseUI.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<!doctype html>
|
|
@@ -14,8 +14,8 @@ Save this as an `.html` file and open it — no build step, no server required.
|
|
|
14
14
|
<head>
|
|
15
15
|
<meta charset="utf-8">
|
|
16
16
|
<title>BaseUI quick start</title>
|
|
17
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@
|
|
17
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.css">
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.js" defer></script>
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div b-ui="card" style="max-width: 24rem; margin: 2rem auto;">
|
|
@@ -32,30 +32,79 @@ 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@
|
|
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. `@0.0.4`) 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
|
-
The static bundle calls `BaseUI.mountAll()` automatically on `DOMContentLoaded`, so initial `[b-ui]` and `[b-icon]` markup mounts without an extra script. Call `BaseUI.mountAll(root)` yourself only after injecting new markup or when mounting a specific fragment. If the consumer is itself an Owl app,
|
|
37
|
+
The static bundle calls `BaseUI.mountAll()` automatically on `DOMContentLoaded`, so initial `[b-ui]` and `[b-icon]` markup mounts without an extra script. Call `BaseUI.mountAll(root)` yourself only after injecting new markup or when mounting a specific fragment. If the consumer is itself an Owl app, use [step 2](#2-install-pure-owl-api--recommended) instead — that's the recommended path.
|
|
38
38
|
|
|
39
39
|
## 1. Decide which API you need
|
|
40
40
|
|
|
41
41
|
| You are building... | Use | Install | Full reference |
|
|
42
42
|
| --- | --- | --- | --- |
|
|
43
|
-
|
|
|
44
|
-
|
|
|
43
|
+
| Your own Owl app that wants `<Button/>`, `<Card/>`, `<Dialog/>` as real component classes | The pure Owl component API (recommended) | CSS + the same `baseui.min.js`/`baseui.esm.js` (via `@base/owl`/`@base/component` import-map keys or a plain npm import) + `dist/baseui.templates.xml` | [Pure Owl Components](owl-components.md) |
|
|
44
|
+
| Static HTML, a server-rendered page, or a Base HUB website page with no Owl runtime | The static `b-ui` markup API (alternative) | One CSS file + one `<script>` tag | [Installation](installation.md) |
|
|
45
45
|
|
|
46
|
-
Both APIs come from the same package and the same CSS file, and can be mixed on one page.
|
|
46
|
+
Both APIs come from the same package and the same CSS file, and can be mixed on one page. Prefer the pure Owl component API by default — real component classes, props, and slots compose more predictably than markup attributes. Reach for the static API only when the target page has no Owl runtime of its own (plain HTML, server-rendered templates, a Base HUB website page) and adding one isn't worthwhile just to use BaseUI.
|
|
47
47
|
|
|
48
|
-
**[VERIFY]** Before choosing, confirm whether the target project already runs Owl (check for `@odoo/owl` or `@base/owl` in its `package.json`)
|
|
48
|
+
**[VERIFY]** Before choosing, confirm whether the target project already runs Owl (check for `@odoo/owl` or `@base/owl` in its `package.json`), or whether it's a plain page you'd rather not add a component-mount step to. Use the static API for the latter.
|
|
49
49
|
|
|
50
|
-
## 2. Install (
|
|
50
|
+
## 2. Install (pure Owl API — recommended)
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.css">
|
|
54
|
+
<script type="importmap">
|
|
55
|
+
{
|
|
56
|
+
"imports": {
|
|
57
|
+
"@base/owl": "https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.esm.js",
|
|
58
|
+
"@base/component": "https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.esm.js",
|
|
59
|
+
"@base/theme": "https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.esm.js",
|
|
60
|
+
"@base/templates": "https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.templates.xml"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
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. `@0.0.4`) instead of `@latest` for production.
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<script type="module">
|
|
70
|
+
import { Component, mount, xml } from "@base/owl";
|
|
71
|
+
import { Button, Card, CardBody, CardHeader, CardTitle } from "@base/component";
|
|
72
|
+
|
|
73
|
+
const templates = await fetch(import.meta.resolve("@base/templates")).then((r) => r.text());
|
|
74
|
+
|
|
75
|
+
class Root extends Component {
|
|
76
|
+
static components = { Button, Card, CardBody, CardHeader, CardTitle };
|
|
77
|
+
static template = xml`
|
|
78
|
+
<Card>
|
|
79
|
+
<CardHeader><CardTitle>Hello</CardTitle></CardHeader>
|
|
80
|
+
<CardBody>
|
|
81
|
+
<Button variant="'default'" label="'Save'" onClick="() => console.log('saved')"/>
|
|
82
|
+
</CardBody>
|
|
83
|
+
</Card>`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
await mount(Root, document.getElementById("app"), { templates });
|
|
87
|
+
</script>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`@base/owl`, `@base/component`, and `@base/theme` all resolve to the exact same `dist/baseui.esm.js` — the one file this whole guide installs for the static API too. For npm/bundler usage, skip the import map entirely and import everything straight from `@thebase/ui` (plus `@thebase/ui/dist/baseui.templates.xml` as a fetch target) — see [Pure Owl Components](owl-components.md#npm--bundler-usage).
|
|
91
|
+
|
|
92
|
+
Two rules that account for most integration failures — see [Pure Owl Components](owl-components.md#common-mistakes) for the worked example:
|
|
93
|
+
|
|
94
|
+
1. `dist/baseui.templates.xml` must be loaded and passed to `mount()` before any BaseUI tag renders.
|
|
95
|
+
2. Import Owl itself from `@base/owl`, never `@odoo/owl` — otherwise the consumer's `Component` class and BaseUI's are different runtime identities and mounting throws.
|
|
96
|
+
|
|
97
|
+
## 3. Install (static `b-ui` API — alternative, no Owl runtime needed)
|
|
51
98
|
|
|
52
99
|
**Option A — CDN (static HTML, no build step):**
|
|
53
100
|
|
|
54
101
|
```html
|
|
55
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@
|
|
56
|
-
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@
|
|
102
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.css">
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/@thebase/ui@latest/dist/baseui.min.js" defer></script>
|
|
57
104
|
```
|
|
58
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. `@0.0.4`) instead of `@latest` for production.
|
|
107
|
+
|
|
59
108
|
**Option B — npm (bundler-based apps: Vite, webpack, etc.):**
|
|
60
109
|
|
|
61
110
|
```sh
|
|
@@ -71,7 +120,7 @@ import "@thebase/ui"; // side-effect import: registers window.BaseUI and auto-mo
|
|
|
71
120
|
|
|
72
121
|
Rule that applies to both options:
|
|
73
122
|
|
|
74
|
-
- Production pages must use a pinned version
|
|
123
|
+
- Production pages must use a pinned version (e.g. `@thebase/ui@0.0.4`), never `@latest`.
|
|
75
124
|
|
|
76
125
|
Mount markup:
|
|
77
126
|
|
|
@@ -113,51 +162,6 @@ Copy-paste starting points for the components you'll reach for first. Every comp
|
|
|
113
162
|
<span b-icon="search"></span>
|
|
114
163
|
```
|
|
115
164
|
|
|
116
|
-
## 3. Install (pure Owl API — only if the consumer is an Owl app)
|
|
117
|
-
|
|
118
|
-
```html
|
|
119
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@thebase/ui@0.0.1/dist/baseui.min.css">
|
|
120
|
-
<script type="importmap">
|
|
121
|
-
{
|
|
122
|
-
"imports": {
|
|
123
|
-
"@base/owl": "https://cdn.jsdelivr.net/npm/@thebase/ui@0.0.1/dist/baseui.esm.js",
|
|
124
|
-
"@base/component": "https://cdn.jsdelivr.net/npm/@thebase/ui@0.0.1/dist/baseui.esm.js",
|
|
125
|
-
"@base/theme": "https://cdn.jsdelivr.net/npm/@thebase/ui@0.0.1/dist/baseui.esm.js",
|
|
126
|
-
"@base/templates": "https://cdn.jsdelivr.net/npm/@thebase/ui@0.0.1/dist/baseui.templates.xml"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
</script>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
```html
|
|
133
|
-
<script type="module">
|
|
134
|
-
import { Component, mount, xml } from "@base/owl";
|
|
135
|
-
import { Button, Card, CardBody, CardHeader, CardTitle } from "@base/component";
|
|
136
|
-
|
|
137
|
-
const templates = await fetch(import.meta.resolve("@base/templates")).then((r) => r.text());
|
|
138
|
-
|
|
139
|
-
class Root extends Component {
|
|
140
|
-
static components = { Button, Card, CardBody, CardHeader, CardTitle };
|
|
141
|
-
static template = xml`
|
|
142
|
-
<Card>
|
|
143
|
-
<CardHeader><CardTitle>Hello</CardTitle></CardHeader>
|
|
144
|
-
<CardBody>
|
|
145
|
-
<Button variant="'default'" label="'Save'" onClick="() => console.log('saved')"/>
|
|
146
|
-
</CardBody>
|
|
147
|
-
</Card>`;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
await mount(Root, document.getElementById("app"), { templates });
|
|
151
|
-
</script>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
`@base/owl`, `@base/component`, and `@base/theme` all resolve to the exact same `dist/baseui.esm.js` — the one file this whole guide installs for the static API too. For npm/bundler usage, skip the import map entirely and import everything straight from `@thebase/ui` (plus `@thebase/ui/dist/baseui.templates.xml` as a fetch target) — see [Pure Owl Components](owl-components.md#npm--bundler-usage).
|
|
155
|
-
|
|
156
|
-
Two rules that account for most integration failures — see [Pure Owl Components](owl-components.md#common-mistakes) for the worked example:
|
|
157
|
-
|
|
158
|
-
1. `dist/baseui.templates.xml` must be loaded and passed to `mount()` before any BaseUI tag renders.
|
|
159
|
-
2. Import Owl itself from `@base/owl`, never `@odoo/owl` — otherwise the consumer's `Component` class and BaseUI's are different runtime identities and mounting throws.
|
|
160
|
-
|
|
161
165
|
## 4. Theme the install
|
|
162
166
|
|
|
163
167
|
```html
|
|
@@ -205,7 +209,7 @@ For common layouts (dashboard shells, sidebars, login/signup forms, charts), cop
|
|
|
205
209
|
- [ ] Only `baseui.min.css` + `baseui.min.js` (or `baseui.esm.js`) are loaded — no separate `baseui.owl.*`/`bootstrap.bundle.min.js`/`baseui.components.esm.js` files needed, for either API.
|
|
206
210
|
- [ ] `BaseUI.version` returns the expected pinned version in the browser console.
|
|
207
211
|
- [ ] Initial static markup mounts without an extra call; injected markup mounts after `BaseUI.mountAll(root)`.
|
|
208
|
-
- [ ] Pure Owl components render with no console errors (a missing-template error means step
|
|
212
|
+
- [ ] Pure Owl components render with no console errors (a missing-template error means step 2's `dist/baseui.templates.xml` load is missing or unawaited).
|
|
209
213
|
- [ ] Toggling `b-theme` actually changes rendered colors (a no-op usually means CSS custom properties are being overridden by the consumer's own stylesheet loaded after `baseui.min.css`).
|
|
210
214
|
- [ ] Look up the specific component in [`docs/components/`](components/) for its attributes, events, and accessibility notes before wiring it up.
|
|
211
215
|
|
|
@@ -227,7 +231,7 @@ For common layouts (dashboard shells, sidebars, login/signup forms, charts), cop
|
|
|
227
231
|
- Using `/latest/` CDN paths in production instead of a pinned version.
|
|
228
232
|
- Assuming auto-mount watches the DOM forever — it does not; call `BaseUI.mountAll(root)` after injecting new `[b-ui]` markup client-side (e.g. from a fetched partial).
|
|
229
233
|
- Mixing `@odoo/owl` imports into a project that also imports `@thebase/ui` — always go through `@base/owl`.
|
|
230
|
-
- Expecting `BaseUI.mountAll()` to pick up Owl component tags (`<Button/>`) — it only mounts static `[b-ui]` markers; pure Owl components are registered and mounted through your own app's `static components` + `mount()`, per step
|
|
234
|
+
- Expecting `BaseUI.mountAll()` to pick up Owl component tags (`<Button/>`) — it only mounts static `[b-ui]` markers; pure Owl components are registered and mounted through your own app's `static components` + `mount()`, per step 2.
|
|
231
235
|
|
|
232
236
|
## Related docs
|
|
233
237
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thebase/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "CDN-installable Owl and Bootstrap 5 UI component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/baseui.min.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-baseui-app": "./bin/create-baseui-app.mjs"
|
|
9
|
+
},
|
|
7
10
|
"module": "./dist/baseui.esm.js",
|
|
8
11
|
"style": "./dist/baseui.min.css",
|
|
9
12
|
"types": "./dist/types/index.d.ts",
|
|
@@ -20,6 +23,7 @@
|
|
|
20
23
|
"./dist/baseui.templates.xml": "./dist/baseui.templates.xml"
|
|
21
24
|
},
|
|
22
25
|
"files": [
|
|
26
|
+
"bin/create-baseui-app.mjs",
|
|
23
27
|
"dist/baseui.min.css",
|
|
24
28
|
"dist/baseui.esm.js",
|
|
25
29
|
"dist/baseui.min.js",
|
|
@@ -27,6 +31,7 @@
|
|
|
27
31
|
"dist/baseui.templates.xml",
|
|
28
32
|
"dist/icons",
|
|
29
33
|
"dist/baseui.registry.json",
|
|
34
|
+
"dist/runtime",
|
|
30
35
|
"dist/themes",
|
|
31
36
|
"dist/types",
|
|
32
37
|
"docs/*.md",
|
|
@@ -57,9 +62,10 @@
|
|
|
57
62
|
"access": "public"
|
|
58
63
|
},
|
|
59
64
|
"dependencies": {
|
|
65
|
+
"@milkdown/crepe": "^7.22.1",
|
|
60
66
|
"@milkdown/kit": "^7.22.1",
|
|
61
67
|
"@milkdown/plugin-collab": "^7.22.1",
|
|
62
|
-
"
|
|
68
|
+
"@milkdown/plugin-emoji": "^7.22.1",
|
|
63
69
|
"y-protocols": "^1.0.7",
|
|
64
70
|
"y-webrtc": "^10.3.0",
|
|
65
71
|
"yjs": "^13.6.32"
|