UNPKG

@thebase/ui

Version:

CDN-installable Owl and Bootstrap 5 UI component library.

94 lines (68 loc) • 11.7 kB
# Changelog All notable changes to this project are documented in this file. ## [v0.0.12] - 2026-09-13 ### Changed - **Breaking**: `Tabs` restyled to match [shadcn/base's Tabs](https://ui.shadcn.com/docs/components/base/tabs) — `TabsList` is now a segmented pill control on a muted background by default (new `variant="'line'"`/`b-att-variant="line"` opts into a transparent underline list instead), and `TabContent`/`b-panel` render as bare panels with no default `Card` border/background (that chrome is now opt-in via `className` on `TabsContainer` or the consumer's own wrapper). New `orientation` prop (`"horizontal"`/`"vertical"`) on the pure Owl `Tabs` puts `TabsList` beside `TabsContainer` instead of above it. - Internal: every pure-Owl component's raw `<button>` (dialog, sheet, pwa, attachment, carousel, collapsible, calendar, dropdown-menu, popover, data-table, accordion, tabs, alert, input-group, sidebar, clipboard-button, theme-button, shell, questionnaire, alert-dialog, drawer, select, toggle, toggle-group) now renders through the shared `Button` component instead of hand-written markup. `Button` gained `unstyled` (opt out of forced `btn`/variant classes for components with their own bespoke styling), `attrs` (pass-through object for one-off attributes with no first-class prop), and `getRef` (reports the mounted root element for callers that need direct DOM access) to support this. No public prop-level API changes for any consuming component. ### Added - `Toast`: new optional `action` slot (`<t t-set-slot="action">...</t>`, e.g. an "Undo" `<Button/>`) renders grouped tight against the close button on the trailing edge, matching the shadcn/ui toast layout. The toast root and static `[b-ui="toast"]` markup are now a flex row: wrap message content in `.bu-toast-content` (grows to fill available width) and the action/close controls in `.bu-toast-actions` (grouped on the trailing edge) — see `docs/components/toast.md` for the updated static markup. `Shell`'s `toast.actionLabel` now renders through the new `action` slot instead of inline in the default slot. ## [v0.0.11] - 2026-09-03 ### Added - `Toast`/`b-ui="toast"`: new `position` option (`top-left`/`top-right`/`bottom-left`/`bottom-right`) fixes a toast to a screen corner; omit it for the previous inline-placement behavior. - Public `cn(...classNames)` and `mergeStyle(...)` helpers, exported from `@thebase/ui` (and `BaseUIBundle.cn`/`BaseUIBundle.mergeStyle`) for consumers building their own class lists or inline styles. Documented in `docs/runtime-api.md`. ### Changed - **Breaking**: every CSS custom property has been renamed from the `--baseui-*` prefix to `--b-*` (e.g. `--baseui-primary` → `--b-primary`). Aligns the token prefix with the existing `--b1`/`--b2_5` spacing scale and `[b-ui]`/`b-att-*` attribute convention. `BaseUI.theme.set()` now writes/reads `--b-*` tokens; any consumer CSS that directly referenced `--baseui-*` must update to `--b-*`. - **Breaking**: every component CSS class has been renamed from the `baseui-*` prefix to `bu-*` (e.g. `.baseui-alert` → `.bu-alert`), to shorten it and avoid colliding with third-party `b-*`-prefixed conventions (e.g. Buefy) while staying distinct from the `b-ui`/`b-att-*` attribute and `--b-*` token conventions. Any consumer markup, CSS, or pure-Owl `className` override referencing `.baseui-*` must update to `.bu-*`. The bare `.baseui` root/theme-scope class, file names, the `BaseUI` global, the `@thebase/ui` package name, and `storageKey="'baseui-theme'"` are untouched. - Every component's class-name string-building now goes through the shared `cn()` helper instead of ad hoc `classes.push()/join(" ")` logic; the pure-Owl `Toast`'s close control now composes the real `Button` component instead of a raw `<button>`. ## [v0.0.10] - 2026-09-02 ### Fixed - `TextEditor`/`b-ui="text-editor"`: found the actual root cause of the `MilkdownError: Context "editorState" not found, do you forget to inject it?` crash in collaborative mode (`collaborative="true"`), which the v0.0.9 fix below reduced the odds of but did not eliminate. `@milkdown/plugin-collab`'s own teardown only removes its Milkdown ctx slice — it never calls `CollabService.disconnect()` — so the y-prosemirror sync/cursor/undo plugins `.connect()` installs into the ProseMirror view were never uninstalled when a collaborative `TextEditor` was destroyed. Left connected, they kept reacting to further Yjs doc updates (from any peer sharing the doc/room) and kept dispatching transactions into the already-destroyed view, throwing `Context "..." not found` for whichever internal ctx slice the stale plugin happened to touch (`editorState`, `placeholderConfigCtx`, etc). Fixed by capturing the bound `CollabService` and explicitly calling `.disconnect()` on it before `crepe.destroy()` runs. Added a real (unmocked) regression test — `test/milkdown-collab-teardown.test.js` — exercising the actual Milkdown/Yjs teardown sequence with two synced docs standing in for two peers; it reproduces the exact reported crash when run against the pre-fix code. ## [v0.0.9] - 2026-09-02 ### Fixed - `TextEditor`/`b-ui="text-editor"`: collaborative mode (`collaborative="true"`) could crash with `MilkdownError: Context "editorState" not found, do you forget to inject it?` — the `y-webrtc`/`y-websocket` provider began syncing over the network the moment it was constructed, before the editor was created and the Yjs doc bound to Milkdown's collab plugin (`bindDoc().connect()`). A remote peer's sync update landing in that window could dispatch a ProseMirror transaction against an editor whose Milkdown context wasn't (yet, or any longer) fully wired. Both provider types are now created paused (`WebsocketProvider`'s `connect: false` option; an explicit `provider.disconnect()` right after construction for `WebrtcProvider`, which has no such option) and only resumed via `provider.connect()` after `bindDoc().setAwareness().applyTemplate().connect()` has fully wired the collab plugin against a live ctx. ## [v0.0.8] - 2026-09-02 ### Fixed - `TextEditor`/`b-ui="text-editor"`: a prop-driven restart (`provider`/`room`/`url`/`password`/`signaling` change) landing while the previous editor mount was still in flight could discard the stale editor but never remount a fresh one, leaving the editor permanently unmounted with no error. Affected both collaborative and non-collaborative modes. ## [v0.0.7] - 2026-09-02 ### Added - Optional Yjs collaboration on `TextEditor`/`b-ui="text-editor"` can now connect to an external `y-websocket`-compatible backend as an alternative to the existing peer-to-peer `y-webrtc` transport. New `provider`/`b-att-provider` (`"webrtc"` default or `"websocket"`) and `url`/`b-att-url` (the websocket server URL, joining `room`/`b-att-room` as the document name). - Collaboration now auto-enables when `provider` and `url` are both supplied, even without also setting `collaborative="true"` — `collaborative` explicitly `false`/unset with an incomplete provider/url pair still leaves the editor single-user. ### Changed - `y-websocket` added as a runtime dependency, lazy-loaded only when `provider="websocket"` is actually selected, so `y-webrtc`-only consumers see no bundle-size change. ## [v0.0.6] - 2026-09-02 ### Fixed - Removed the unused `y-prosemirror` runtime dependency, which `scripts/check-release-guards.mjs`'s allowlist rejected and broke `npm run build`. - `TextEditor`'s shell now fills its viewport (added `width`/`max-width` alongside the existing height rules in `text-editor.css`). ## [v0.0.5] - 2026-09-02 ### Fixed - `package.json` `files` was missing `dist/runtime`, so the vendored runtime chunks (marked, mermaid, milkdown-editor, prosemirror-text-editor, and their split chunk files) never shipped to npm/CDN. Dynamic imports of `dist/runtime/prosemirror-text-editor.js` (and the other lazy runtime assets) 404'd for CDN consumers. Added `dist/runtime` to `files`. ## [v0.0.4] - 2026-09-01 Initial documented release. BaseUI is a self-contained component library (Owl v2 + Bootstrap 5 + GrapesJS page-builder tooling) with a shadcn-aligned component set, a live docs/examples app, and vendored runtime assets. ### Added - Full BaseUI component set aligned with shadcn/ui coverage (Accordion, Alert, AlertDialog, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Carousel, Chart, Checkbox, Collapsible, Combobox, Command, ContextMenu, DataTable, DatePicker, Dialog, Drawer, DropdownMenu, Empty, Field, Form, HoverCard, Input, InputGroup, InputOTP, Item, Kbd, Label, Marker, Menubar, NativeSelect, NavigationMenu, Pagination, Popover, Progress, RadioGroup, Resizable, ScrollArea, Select, Separator, Sheet, Shell, Sidebar, Skeleton, Slider, Spinner, Switch, Tabs, and more), plus Lucide icons and `b-*` component attributes. - Markdown component with live BaseUI/Mermaid previews, a copyable code pane with copy-to-clipboard toast, and a Template/Pure Owl Component code toggle for every block demo. - Collaborative Milkdown Markdown editor and a TextEditor component. - Hash-routed examples/docs app unifying all component demos under one navigation shell, with a chart gallery and component previews embedded in docs. - Mobile support: sidecar CSS/XML for Sidebar, Shell, DataTable, and Markdown, plus per-component demo blocks. - QR page generator demo. - `style` prop support across all pure Owl components. - PWA support and ClipboardButton component. - Published `docs/*.md` and `docs/components/` inside the npm package (`package.json` `files`), plus `CHANGELOG.md`, so integration docs and per-component reference pages are reachable straight from unpkg/jsDelivr without cloning the repo. `docs/v2/` (vendored general Owl framework reference) and `docs/component-authoring.md` stay repo-only and are excluded. ### Changed - Consolidated BaseUI into a single self-contained bundle: vendored Bootstrap 5 and Owl under `src/runtime`, externalized Owl into `dist/owl.js` for lean CDN bundles, and deduped disclosure/modal logic. - Rewrote the Markdown live-preview to mount real Owl components instead of static templates. - Renamed Tabs sub-components and reworked the example shell (unified sidebar/shell collapse trigger, `baseui-text-xs` utility). - Merged shell collapse trigger into the sidebar trigger. - Renamed the published npm package from `@the-base/baseui` to `@thebase/ui`. - Vendored Lucide icon sources into `src/icons/` (flat, git-tracked) instead of generating them only into the gitignored `dist/icons/lucide/` build output; the lucide loader module moved to `src/runtime/`. - `dist/` and `package-lock.json` are now gitignored, since `dist/` is purely a build artifact. - Consolidated duplicated class-name string-building logic (`DropdownMenu`, `Sidebar`, `Form`, `Field`) into a single shared `classNames()` helper in `prop-aliases.js`. - Switched the QR page consumer demo to load BaseUI directly from `/dist/` instead of a vendored copy; bumped its service worker cache to `v4`. - Rewrote `README.md`'s release notes to point at `CHANGELOG.md` instead of embedded version narrative; corrected the published component count; documented the CDN doc-access URLs and which docs are excluded from the package. ### Fixed - Block-viewer mount race across all block demos. - Dialog close-button and input auto-mount bugs. - Mobile sidebar/shell layout bugs. - Docs-preview code-fence rendering; added MarkdownTree and frontmatter support. - Tabs panel border/alignment and sidebar/toast styling. - Removed an orphaned, unused `bootstrap.bundle.min.js.map` source map and its dangling `sourceMappingURL` reference.