@jungherz-de/notionkit-elements 1.13.0 → 1.15.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 +33 -0
- package/README.md +11 -11
- package/SKILL.md +110 -51
- package/dist/components/nk-board-view.js +4 -3
- package/dist/components/nk-calendar-view.js +3 -1
- package/dist/components/nk-filter-bar.js +3 -2
- package/dist/components/nk-gallery-view.js +115 -0
- package/dist/components/nk-list-view.js +4 -3
- package/dist/components/nk-table-view.js +2 -1
- package/dist/components/shared/property-cell-BSVcETss.js +204 -0
- package/dist/notionkit-elements.esm.js +208 -22
- package/dist/notionkit-elements.js +211 -21
- package/dist/notionkit-elements.min.js +1 -1
- package/package.json +3 -3
- package/src/components/data/nk-board-view.js +3 -3
- package/src/components/data/nk-calendar-view.js +2 -1
- package/src/components/data/nk-filter-bar.js +3 -2
- package/src/components/data/nk-gallery-view.js +111 -0
- package/src/components/data/nk-list-view.js +3 -3
- package/src/index.js +2 -1
- package/src/util/property-cell.js +90 -12
- package/dist/components/shared/property-cell-DKvv6TIG.js +0 -126
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@ All notable changes to NotionKit Elements are documented here. The format follow
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [1.15.0] – 2026-09-25
|
|
8
|
+
|
|
9
|
+
Built against NotionKit CSS 1.15.0 (peer `>= 1.15.0`). Auxdesk's findings 22 and 23 from its jobs, messages and tickets in `<nk-table-view>`.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **`sortable` sorts by the value, not by the text shown.** Every column but number, progress and checkbox compared its text: dates as text, so 13.09.2026 came before 24.08.2026, and a select by its key – `failed`, `ignored`, `posted` – instead of the order of its options. Dates now sort by their time (D.M.YYYY, ISO dates and date-times, ranges by their start), selects by their options as Notion does, and empty cells come last in both directions. `compareBy()` does the same for tables of one's own.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- **A value to sort by.** `sortKey` on a column sorts by another field of the row – a “Time” column that shows “4 min ago” sorts by the ISO time next to it – and a `sort` in a cell's object sorts that cell by its own value.
|
|
16
|
+
- **Date formats.** A `date` column with `format` – `'short'` (day and month, the year when it is not this one), `'relative'` (minutes or hours ago or ahead within a day, else the short date) or the options of Intl.DateTimeFormat – shows ISO dates and date-times formatted in its `locale`, and sorts by their time. Without `format` a date stands as given, as before. Board, list and gallery show the same format; a range reads start → end.
|
|
17
|
+
- **Text cells with a tone, a second line and a tooltip.** A text value may be `{ text, desc, color, tooltip }`: `color` one of Notion's nine text colours – orange for an error –, `desc` a quiet second line under it – the next run under an error, the sender under a subject –, `tooltip` the whole text, which `<nk-tooltip>` shows. A title cell takes `desc` and `tooltip` too. The other views and the filter bar's search read the text of such an object.
|
|
18
|
+
- Exported next to `renderPropertyCell()`: `formatDate()`, `timeOf()` and `textOf()`.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- The docs example of `<nk-table-view>` shows a quiet line under the first title.
|
|
22
|
+
- Peer `@jungherz-de/notionkit >= 1.15.0`.
|
|
23
|
+
|
|
24
|
+
## [1.14.0] – 2026-09-25
|
|
25
|
+
|
|
26
|
+
Built against NotionKit CSS 1.14.0 (peer `>= 1.14.0`). The gallery view – 88 elements now – for LearnHub's course catalog.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- **`<nk-gallery-view>`**, the fifth view of `<nk-database>`: the rows as cards with a picture on top, in a grid that fills the row – Notion's gallery. `cover-key` names the row field with the picture's URL (default: `cover`); a row without one shows the cover gradient, and `no-cover` leaves the pictures out. The picture stands in 2:1, cropped to fill; `fit` shows it whole, for logos. `size` small, medium or large sets the card size – columns from 180, 260 or 340px, one card per row on a phone. Cards show the title and the `meta-keys` (default: the select and date columns); a click, Enter or Space fires `nk-select { row, id, value }` like a row of the table, and `new-row` adds a dashed card that fires `nk-action { action: 'new-row' }`. Standalone it takes `columns` and `rows`, inside `<nk-database>` the database pushes the data.
|
|
30
|
+
- Demo: the project database has a Gallery tab, each project with one of the four covers; `#gallery` opens it, a card opens in the side peek, and the app still matches the class demo at 0.00 %.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- **A `<button slot="action">` of `<nk-banner>` stands at the banner's right edge again** (NotionKit 1.14.0). On a page with `class="nk-body"`, NotionKit's scoped button reset won over the `::slotted()` margin – the outer tree wins – so after a short text the action sat right behind it. Since 1.11.0 the docs write the action as a button; a span was never affected. A test now checks it on an `nk-body` page.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- Peer `@jungherz-de/notionkit >= 1.14.0`.
|
|
37
|
+
|
|
7
38
|
## [1.13.0] – 2026-09-25
|
|
8
39
|
|
|
9
40
|
Built against NotionKit CSS 1.13.0 (peer `>= 1.13.0`). LearnHub moved from 1.5.1 to 1.11 and sent back three findings about fixed sizes; this release answers them.
|
|
@@ -653,6 +684,8 @@ built and tested against NotionKit CSS 1.1.1 (peer range `>= 1.0.0`).
|
|
|
653
684
|
import, never in the core bundle – shadow-less, adding `nk-block-host` to
|
|
654
685
|
itself so the foundation's editor adapter rules apply.
|
|
655
686
|
|
|
687
|
+
[1.15.0]: https://github.com/JUNGHERZ/NotionKit-Elements/releases/tag/v1.15.0
|
|
688
|
+
[1.14.0]: https://github.com/JUNGHERZ/NotionKit-Elements/releases/tag/v1.14.0
|
|
656
689
|
[1.13.0]: https://github.com/JUNGHERZ/NotionKit-Elements/releases/tag/v1.13.0
|
|
657
690
|
[1.12.0]: https://github.com/JUNGHERZ/NotionKit-Elements/releases/tag/v1.12.0
|
|
658
691
|
[1.11.1]: https://github.com/JUNGHERZ/NotionKit-Elements/releases/tag/v1.11.1
|
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<h1 align="center">🧩 NotionKit Elements</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/version-1.
|
|
4
|
+
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/version-1.15.0-2383e2?style=flat-square" alt="Version"></a>
|
|
5
5
|
<a href="#"><img src="https://img.shields.io/badge/vanilla_JS-no_dependencies-448361?style=flat-square" alt="Vanilla JS"></a>
|
|
6
|
-
<a href="#"><img src="https://img.shields.io/badge/elements-
|
|
6
|
+
<a href="#"><img src="https://img.shields.io/badge/elements-88-529cca?style=flat-square" alt="88 Elements"></a>
|
|
7
7
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-9065b0?style=flat-square" alt="MIT License"></a>
|
|
8
|
-
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.
|
|
8
|
+
<a href="CHANGELOG.md"><img src="https://img.shields.io/badge/changelog-v1.15.0-lightgrey?style=flat-square" alt="Changelog"></a>
|
|
9
9
|
<a href="https://www.npmjs.com/package/@jungherz-de/notionkit-elements"><img src="https://img.shields.io/badge/npm-%40jungherz--de%2Fnotionkit--elements-cb3837?style=flat-square&logo=npm" alt="npm"></a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<strong>Drop-in Web Components for <a href="https://github.com/JUNGHERZ/NotionKit">NotionKit CSS</a></strong><br>
|
|
14
|
-
|
|
14
|
+
88 vanilla JavaScript custom elements wrapping NotionKit's calm, document-centric workspace look.<br>
|
|
15
15
|
Shadow DOM · Native form participation · Pixel parity with the class markup · Zero dependencies.
|
|
16
16
|
</p>
|
|
17
17
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
## ✨ What is NotionKit Elements?
|
|
30
30
|
|
|
31
|
-
NotionKit Elements is the companion library to [NotionKit CSS](https://github.com/JUNGHERZ/NotionKit). It provides **
|
|
31
|
+
NotionKit Elements is the companion library to [NotionKit CSS](https://github.com/JUNGHERZ/NotionKit). It provides **88 Web Components** – from buttons, form controls and the date picker over the sidebar, page tree and page shell with its properties to the settings modal, the bottom sheet, the side peek, dialogs, tooltips, ⌘K palette, database views – a calendar and a gallery among them – with Notion’s toolbar and AI thread – that encapsulate the class markup of the foundation into simple, declarative custom elements.
|
|
32
32
|
|
|
33
33
|
It is the **app layer** of the NotionKit family – three layers, one design language: [NotionKit](https://notionkit.jungherz.com) is the pure-CSS foundation, NotionKit Elements wraps it into web components for application UIs, and [NotionKit Web](https://notionkit-web.jungherz.com) is the Astro template for complete websites on top of the same foundation. The word stem stays the same across the layers: `.nk-callout` becomes `<nk-callout>`, a modifier class becomes an attribute, a state class becomes a boolean attribute.
|
|
34
34
|
|
|
@@ -56,10 +56,10 @@ It is the **app layer** of the NotionKit family – three layers, one design lan
|
|
|
56
56
|
|---|---|
|
|
57
57
|
| 🎯 **Pixel parity** | Every element renders identically to its class markup – verified by a Playwright pixel test in light and dark; the reference app differs by 0.00 % from the class version |
|
|
58
58
|
| 🔌 **Shadow DOM** | Each root adopts the NotionKit *components* sheet via `adoptedStyleSheets`; tokens are inherited from the document, so one `:root { --nk-accent: … }` re-brands everything |
|
|
59
|
-
| 🧩 **
|
|
59
|
+
| 🧩 **88 Elements** | Forms with copy field, image picker and date picker, content blocks with bookmarks, app shell & tree with the ☰ drawer and the collapsing sidebar, page shell with properties, panels, avatars and steps, overlays (modal, sheet, dialog, resizable side peek, tooltip, ⌘K palette, menus that float in and become sheets on a phone, popover, emoji picker, toast), database table, board, list, calendar & gallery with toolbar and filter pills, comments, AI thread |
|
|
60
60
|
| 🎛️ **Form participation** | Input, textarea, select, switch, check, radio, slider, segmented and model card work natively with `<form>` via `ElementInternals`; radios group across shadow roots |
|
|
61
61
|
| 🌗 **Theme sync** | One observer mirrors `data-theme` on `<html>` into every element |
|
|
62
|
-
| 🪶 **Lightweight** |
|
|
62
|
+
| 🪶 **Lightweight** | 280 KB minified / 56 KB gzipped (IIFE, foundation sheet included), no external dependencies |
|
|
63
63
|
| 📦 **Four bundle shapes** | IIFE, minified IIFE, ESM, and per-component ESM entries on a stable `base.js`, which import NotionKit's sheet instead of carrying a copy |
|
|
64
64
|
| 🤖 **AI-ready** | `SKILL.md` with copy-paste markup, six app skeletons and the rules – an agent given only that file built a working app in the release test |
|
|
65
65
|
|
|
@@ -71,8 +71,8 @@ It is the **app layer** of the NotionKit family – three layers, one design lan
|
|
|
71
71
|
<!DOCTYPE html>
|
|
72
72
|
<html lang="en" data-theme="light">
|
|
73
73
|
<head>
|
|
74
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
75
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
74
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
76
76
|
</head>
|
|
77
77
|
<body class="nk-body">
|
|
78
78
|
<nk-field label="Display name" desc="Shown next to your comments">
|
|
@@ -102,7 +102,7 @@ The per-component files import NotionKit's sheet as `@jungherz-de/notionkit/noti
|
|
|
102
102
|
|
|
103
103
|
Do not mix the full bundle with the per-component files: each brings its own `NkElement`. With the bundle, take `componentsSheet` and `NkElement` from the bundle (`NotionKitElements.componentsSheet` from the `<script>` build).
|
|
104
104
|
|
|
105
|
-
Two prerequisites, always: `notionkit.css` on the document (the peer dependency, `>= 1.
|
|
105
|
+
Two prerequisites, always: `notionkit.css` on the document (the peer dependency, `>= 1.15.0`; 1.15.0 brings table text with a tone and a second line, 1.14.0 brings the gallery view and a banner action that stands at the right edge again, 1.13.0 keeps fields inside narrow panels, leaves a page without icon its padding under the cover and makes cover heights tokens, 1.12.0 brings a tag or button beside a panel's title, lists and grids without outer margin, text values, steps with states in any order and in a row, scrolling tabs, a cap for full pages and buttons per table row, 1.11.0 keeps a floating menu inside an open modal or dialog in place and inside the window and brings the banner's action as a button, fields that share a row and tooltips of several lines, 1.10.1 lets a disabled button show its tooltip, 1.10.0 brings the collapsing sidebar, the resizable side peek, the dialog and the tooltip, 1.9.0 the date picker and the calendar view, 1.8.0 the side peek, the bookmark, the copy field and pictures on the profile row, 1.7.0 the sheet, menus that float in and become sheets on a phone, the sidebar drawer, the database toolbar with filter pills and the steps, 1.7.1 minified files that carry all of it, 1.6.0 page properties, page options, list view, panels, prose and the avatar, 1.5.1 the safe areas, 1.5.0 the Notion-2025 tokens, the nine tag colours and the filled inputs; from 1.5.0 on, Elements and the foundation share one version number – the elements are built and tested against the same release) and `class="nk-body"` on `<body>`. The elements ship no visual CSS of their own – every rule comes from the foundation. The bundle injects the design tokens once as `@layer notionkit-defaults`, so any plain `:root { --nk-accent: … }` of yours re-brands every element in both themes.
|
|
106
106
|
|
|
107
107
|
## Elements
|
|
108
108
|
|
|
@@ -113,7 +113,7 @@ Two prerequisites, always: `notionkit.css` on the document (the peer dependency,
|
|
|
113
113
|
| App shell & navigation | `nk-app` `nk-sidebar` `nk-workspace-switcher` `nk-section-label` `nk-tree` `nk-tree-item` `nk-topbar` `nk-breadcrumb` `nk-theme-toggle` `nk-tab-bar` `nk-tab-bar-item` |
|
|
114
114
|
| Page shell & blocks | `nk-page` `nk-page-cover` `nk-page-title` `nk-page-actions` `nk-props` `nk-prop` `nk-panels` `nk-panel` `nk-avatar` `nk-block-host` `nk-banner` `nk-empty` `nk-skeleton` `nk-synced` `nk-tabs` `nk-tab` `nk-segmented` `nk-steps` `nk-stats` `nk-stat` `nk-avatar-group` `nk-mention` `nk-template-btn` `nk-model-card` `nk-profile-row` `nk-danger-zone` `nk-member-list` `nk-member-row` |
|
|
115
115
|
| Overlays | `nk-modal` `nk-sheet` `nk-dialog` `nk-peek` `nk-tooltip` `nk-settings-pane` `nk-settings-user` `nk-cmdk` `nk-menu` `nk-menu-item` `nk-pop` `nk-emoji-picker` `nk-toast` |
|
|
116
|
-
| Data & collaboration | `nk-database` `nk-table-view` `nk-board-view` `nk-list-view` `nk-calendar-view` `nk-filter-bar` `nk-comments` `nk-comment` `nk-ai-thread` `nk-ai-msg` `nk-ai-input-row` (+ the exported `renderPropertyCell()`) |
|
|
116
|
+
| Data & collaboration | `nk-database` `nk-table-view` `nk-board-view` `nk-list-view` `nk-calendar-view` `nk-gallery-view` `nk-filter-bar` `nk-comments` `nk-comment` `nk-ai-thread` `nk-ai-msg` `nk-ai-input-row` (+ the exported `renderPropertyCell()`) |
|
|
117
117
|
|
|
118
118
|
Static content goes in through attributes and slots, dynamic data through properties (`tree.data`, `database.rows`, `palette.commands`). Interactions fire custom events with fixed names: `nk-select`, `nk-change`, `nk-view-change`, `nk-command`, `nk-toggle`, `nk-submit`, `nk-action`. No fetching, no two-way binding – the elements render what they get.
|
|
119
119
|
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: notionkit-elements
|
|
3
|
-
description: NotionKit Elements is a vanilla-JS Web Components library (v1.
|
|
3
|
+
description: NotionKit Elements is a vanilla-JS Web Components library (v1.15.0) wrapping NotionKit CSS v1.15.0 – the calm, document-centric design system in the Notion idiom. 88 custom elements with the `nk-` prefix, Shadow DOM, automatic light/dark sync via data-theme on <html>, and form-associated controls. Use this reference whenever generating HTML that uses <nk-*> tags to get attributes, slots, events and composition right.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# NotionKit Elements – AI Component Reference
|
|
@@ -21,8 +21,8 @@ description: NotionKit Elements is a vanilla-JS Web Components library (v1.13.0)
|
|
|
21
21
|
<head>
|
|
22
22
|
<meta charset="UTF-8">
|
|
23
23
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
24
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
25
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
24
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
26
26
|
</head>
|
|
27
27
|
<body class="nk-body">
|
|
28
28
|
<nk-btn variant="primary">Save</nk-btn>
|
|
@@ -74,7 +74,7 @@ Never mix the full bundle with the per-component files – each brings its own `
|
|
|
74
74
|
| Attributes are live | Every documented attribute re-renders when changed after connect (`stat.setAttribute('value', '129')`, `el.open = true`); properties reflect to attributes where a setter is listed. |
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
# 3. Element Catalog (
|
|
77
|
+
# 3. Element Catalog (88 elements)
|
|
78
78
|
|
|
79
79
|
## Forms & controls (wave 1)
|
|
80
80
|
|
|
@@ -2606,10 +2606,10 @@ The view switcher with Notion’s toolbar: child views (`nk-table-view`, `nk-boa
|
|
|
2606
2606
|
{ key: 'effort', label: 'Effort (h)', type: 'number', icon: '#', locale: 'en', format: { minimumFractionDigits: 1 } },
|
|
2607
2607
|
];
|
|
2608
2608
|
db.rows = [
|
|
2609
|
-
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6 },
|
|
2610
|
-
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5 },
|
|
2611
|
-
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5 },
|
|
2612
|
-
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8 },
|
|
2609
|
+
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2610
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2611
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2612
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, cover: '/covers/tide.svg' },
|
|
2613
2613
|
];
|
|
2614
2614
|
}</script>
|
|
2615
2615
|
```
|
|
@@ -2650,7 +2650,7 @@ The view switcher with Notion’s toolbar: child views (`nk-table-view`, `nk-boa
|
|
|
2650
2650
|
|
|
2651
2651
|
### 3.78 `<nk-table-view>` – Table view
|
|
2652
2652
|
|
|
2653
|
-
Renders `columns` × `rows` as the NotionKit table. Cells are polymorphic (`text`, `select`, `multi-select`, `date`, `person`, `checkbox`, `url`, `number`, `progress`) and rendered as plain markup by the exported `renderPropertyCell()` – every cell rule starts with `.nk-table`, so a cell element of its own would never be styled. Header clicks sort with `sortable`. A `number` column stands right-aligned in figures of equal width, formatted by its `locale` and `format` (Intl.NumberFormat options); a person’s `color` takes one of the nine names. A column of type `actions` (NotionKit 1.12.0) sets buttons in each row from `column.actions` – `[{ action, label, icon, danger, disabled, tooltip }]` –, and a row’s value – a list of action names – picks which of them it shows; a click fires `nk-action { action, row, id, anchor }` instead of selecting the row. A `url` value may be `{ href, label, target }`: a link of your own, to another page of the app, with its own text.
|
|
2653
|
+
Renders `columns` × `rows` as the NotionKit table. Cells are polymorphic (`text`, `select`, `multi-select`, `date`, `person`, `checkbox`, `url`, `number`, `progress`) and rendered as plain markup by the exported `renderPropertyCell()` – every cell rule starts with `.nk-table`, so a cell element of its own would never be styled. Header clicks sort with `sortable`. A `number` column stands right-aligned in figures of equal width, formatted by its `locale` and `format` (Intl.NumberFormat options); a person’s `color` takes one of the nine names. A column of type `actions` (NotionKit 1.12.0) sets buttons in each row from `column.actions` – `[{ action, label, icon, danger, disabled, tooltip }]` –, and a row’s value – a list of action names – picks which of them it shows; a click fires `nk-action { action, row, id, anchor }` instead of selecting the row. A `url` value may be `{ href, label, target }`: a link of your own, to another page of the app, with its own text. A text value may be `{ text, desc, color, tooltip }` (NotionKit 1.15.0): a quiet second line, one of Notion’s nine text colours – `orange` for an error –, the whole text in a tooltip. Sorting goes by the value, not the text shown: dates by their time, selects by the order of their options, empty cells last; `sortKey` on a column sorts by another field of the row, a `sort` in a cell’s object by that value. A `date` column with `format` – `'short'`, `'relative'` or the options of Intl.DateTimeFormat – shows ISO dates and date-times formatted in its `locale`.
|
|
2654
2654
|
|
|
2655
2655
|
```html
|
|
2656
2656
|
<nk-table-view new-row sortable></nk-table-view>
|
|
@@ -2667,10 +2667,10 @@ Renders `columns` × `rows` as the NotionKit table. Cells are polymorphic (`text
|
|
|
2667
2667
|
{ key: 'actions', type: 'actions', actions: [{ action: 'open', label: 'Open' }, { action: 'archive', label: 'Archive', danger: true }] },
|
|
2668
2668
|
];
|
|
2669
2669
|
db.rows = [
|
|
2670
|
-
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6 },
|
|
2671
|
-
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5 },
|
|
2672
|
-
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5 },
|
|
2673
|
-
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, actions: ['open'] },
|
|
2670
|
+
{ id: 1, icon: '🧭', name: { text: 'App shell & sidebar', desc: 'Three open questions' }, status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2671
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2672
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2673
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, actions: ['open'], cover: '/covers/tide.svg' },
|
|
2674
2674
|
];
|
|
2675
2675
|
}</script>
|
|
2676
2676
|
```
|
|
@@ -2692,14 +2692,14 @@ Renders `columns` × `rows` as the NotionKit table. Cells are polymorphic (`text
|
|
|
2692
2692
|
|
|
2693
2693
|
**Properties:** `columns`, `rows`, `data` · **Methods:** `refresh()`
|
|
2694
2694
|
|
|
2695
|
-
**Replaces:** `.nk-table-wrap`, `.nk-table`, `.wrap`, `.th-icon`, `.row-title`, `.date-cell`, `.person-cell`, `.nk-avatar`, `.num`, `.row-actions`, `.actions`, `.nk-new-row`
|
|
2695
|
+
**Replaces:** `.nk-table-wrap`, `.nk-table`, `.wrap`, `.th-icon`, `.row-title`, `.date-cell`, `.person-cell`, `.nk-avatar`, `.num`, `.row-actions`, `.actions`, `.td-text`, `.td-desc`, `.nk-new-row`
|
|
2696
2696
|
|
|
2697
2697
|
```html
|
|
2698
2698
|
<!-- equivalent class markup -->
|
|
2699
2699
|
<div class="nk-table-wrap"><table class="nk-table">
|
|
2700
2700
|
<thead><tr><th><span class="th-icon">📄</span>Name</th><th><span class="th-icon">◉</span>Status</th><th><span class="th-icon">👤</span>Owner</th><th><span class="th-icon">📅</span>Due</th><th><span class="th-icon">▰</span>Progress</th><th><span class="th-icon">#</span>Effort (h)</th><th class="actions"></th></tr></thead>
|
|
2701
2701
|
<tbody>
|
|
2702
|
-
<tr><td><span class="row-title">🧭 App shell & sidebar</span></td><td><span class="nk-tag green">Done</span></td><td><span class="person-cell"><span class="nk-avatar small purple">MK</span> Marcel</span></td><td><span class="date-cell">08.05.2026</span></td><td><span class="nk-progress"><i style="width:100%"></i></span><span class="nk-progress-label">100%</span></td><td class="num"><span>6.0</span></td><td><span class="row-actions"><button class="nk-btn secondary small">Open</button><button class="nk-btn danger small">Archive</button></span></td></tr>
|
|
2702
|
+
<tr><td><span class="row-title">🧭 App shell & sidebar</span><span class="td-desc">Three open questions</span></td><td><span class="nk-tag green">Done</span></td><td><span class="person-cell"><span class="nk-avatar small purple">MK</span> Marcel</span></td><td><span class="date-cell">08.05.2026</span></td><td><span class="nk-progress"><i style="width:100%"></i></span><span class="nk-progress-label">100%</span></td><td class="num"><span>6.0</span></td><td><span class="row-actions"><button class="nk-btn secondary small">Open</button><button class="nk-btn danger small">Archive</button></span></td></tr>
|
|
2703
2703
|
<tr><td><span class="row-title">📄 Page shell & typography</span></td><td><span class="nk-tag green">Done</span></td><td><span class="person-cell"><span class="nk-avatar small purple">MK</span> Marcel</span></td><td><span class="date-cell">10.05.2026</span></td><td><span class="nk-progress"><i style="width:100%"></i></span><span class="nk-progress-label">100%</span></td><td class="num"><span>4.5</span></td><td><span class="row-actions"><button class="nk-btn secondary small">Open</button><button class="nk-btn danger small">Archive</button></span></td></tr>
|
|
2704
2704
|
<tr><td><span class="row-title">🗃️ Database table view</span></td><td><span class="nk-tag blue">In progress</span></td><td><span class="person-cell"><span class="nk-avatar small purple">MK</span> Marcel</span></td><td><span class="date-cell">20.05.2026</span></td><td><span class="nk-progress"><i style="width:65%"></i></span><span class="nk-progress-label">65%</span></td><td class="num"><span>12.5</span></td><td><span class="row-actions"><button class="nk-btn secondary small">Open</button><button class="nk-btn danger small">Archive</button></span></td></tr>
|
|
2705
2705
|
<tr><td><span class="row-title">▤ Board view & drag-and-drop</span></td><td><span class="nk-tag orange">Planned</span></td><td><span class="person-cell">—</span></td><td><span class="date-cell">02.06.2026</span></td><td><span class="nk-progress"><i style="width:0%"></i></span><span class="nk-progress-label">0%</span></td><td class="num"><span>8.0</span></td><td><span class="row-actions"><button class="nk-btn secondary small">Open</button></span></td></tr>
|
|
@@ -2727,10 +2727,10 @@ Groups rows by a select column (`group-by`, default: the first select column) in
|
|
|
2727
2727
|
{ key: 'effort', label: 'Effort (h)', type: 'number', icon: '#', locale: 'en', format: { minimumFractionDigits: 1 } },
|
|
2728
2728
|
];
|
|
2729
2729
|
db.rows = [
|
|
2730
|
-
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6 },
|
|
2731
|
-
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5 },
|
|
2732
|
-
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5 },
|
|
2733
|
-
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8 },
|
|
2730
|
+
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2731
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2732
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2733
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, cover: '/covers/tide.svg' },
|
|
2734
2734
|
];
|
|
2735
2735
|
}</script>
|
|
2736
2736
|
```
|
|
@@ -2779,10 +2779,10 @@ The third database view: one line per row – icon and title, the `meta-keys` on
|
|
|
2779
2779
|
{ key: 'effort', label: 'Effort (h)', type: 'number', icon: '#', locale: 'en', format: { minimumFractionDigits: 1 } },
|
|
2780
2780
|
];
|
|
2781
2781
|
db.rows = [
|
|
2782
|
-
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6 },
|
|
2783
|
-
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5 },
|
|
2784
|
-
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5 },
|
|
2785
|
-
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8 },
|
|
2782
|
+
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2783
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2784
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2785
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, cover: '/covers/tide.svg' },
|
|
2786
2786
|
];
|
|
2787
2787
|
}</script>
|
|
2788
2788
|
```
|
|
@@ -2832,10 +2832,10 @@ The fourth database view (NotionKit 1.9.0): a month, the rows as cards on their
|
|
|
2832
2832
|
{ key: 'effort', label: 'Effort (h)', type: 'number', icon: '#', locale: 'en', format: { minimumFractionDigits: 1 } },
|
|
2833
2833
|
];
|
|
2834
2834
|
db.rows = [
|
|
2835
|
-
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6 },
|
|
2836
|
-
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5 },
|
|
2837
|
-
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5 },
|
|
2838
|
-
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8 },
|
|
2835
|
+
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2836
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2837
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2838
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, cover: '/covers/tide.svg' },
|
|
2839
2839
|
];
|
|
2840
2840
|
}</script>
|
|
2841
2841
|
```
|
|
@@ -2880,7 +2880,65 @@ The fourth database view (NotionKit 1.9.0): a month, the rows as cards on their
|
|
|
2880
2880
|
|
|
2881
2881
|
**Small screens:** Keeps seven columns; the days get lower (64px) and the cards smaller.
|
|
2882
2882
|
|
|
2883
|
-
### 3.82 `<nk-
|
|
2883
|
+
### 3.82 `<nk-gallery-view>` – Gallery view
|
|
2884
|
+
|
|
2885
|
+
The fifth database view: the rows as cards with a picture on top, in a grid that fills the row – Notion’s gallery, for a course catalog or a reading list. `cover-key` names the row field with the picture’s URL (default: `cover`); a row without one shows the cover gradient, `no-cover` leaves the pictures out. The picture stands in 2:1, cropped to fill; `fit` shows it whole, for logos. `size` small, medium or large sets the card size – columns from 180, 260 or 340px. Cards show the title and the `meta-keys` (default: the select and date columns) and fire `nk-select` on a click, Enter or Space; `new-row` adds the add card.
|
|
2886
|
+
|
|
2887
|
+
```html
|
|
2888
|
+
<nk-gallery-view meta-keys="status,due" new-row></nk-gallery-view>
|
|
2889
|
+
<script>{
|
|
2890
|
+
const db = document.currentScript.previousElementSibling;
|
|
2891
|
+
db.columns = [
|
|
2892
|
+
{ key: 'name', label: 'Name', type: 'text', icon: '📄', title: true },
|
|
2893
|
+
{ key: 'status', label: 'Status', type: 'select', icon: '◉', options: [
|
|
2894
|
+
{ value: 'planned', label: 'Planned', color: 'orange' }, { value: 'progress', label: 'In progress', color: 'blue' }, { value: 'done', label: 'Done', color: 'green' } ] },
|
|
2895
|
+
{ key: 'owner', label: 'Owner', type: 'person', icon: '👤' },
|
|
2896
|
+
{ key: 'due', label: 'Due', type: 'date', icon: '📅' },
|
|
2897
|
+
{ key: 'progress', label: 'Progress', type: 'progress', icon: '▰' },
|
|
2898
|
+
{ key: 'effort', label: 'Effort (h)', type: 'number', icon: '#', locale: 'en', format: { minimumFractionDigits: 1 } },
|
|
2899
|
+
];
|
|
2900
|
+
db.rows = [
|
|
2901
|
+
{ id: 1, icon: '🧭', name: 'App shell & sidebar', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '08.05.2026', progress: 100, effort: 6, cover: '/covers/aurora.svg' },
|
|
2902
|
+
{ id: 2, icon: '📄', name: 'Page shell & typography', status: 'done', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '10.05.2026', progress: 100, effort: 4.5, cover: '/covers/dunes.svg' },
|
|
2903
|
+
{ id: 3, icon: '🗃️', name: 'Database table view', status: 'progress', owner: { name: 'Marcel', initials: 'MK', color: 'purple' }, due: '20.05.2026', progress: 65, effort: 12.5, cover: '/covers/meadow.svg' },
|
|
2904
|
+
{ id: 4, icon: '▤', name: 'Board view & drag-and-drop', status: 'planned', due: '02.06.2026', progress: 0, effort: 8, cover: '/covers/tide.svg' },
|
|
2905
|
+
];
|
|
2906
|
+
}</script>
|
|
2907
|
+
```
|
|
2908
|
+
|
|
2909
|
+
| Attribute | Type | Default | Description |
|
|
2910
|
+
|---|---|---|---|
|
|
2911
|
+
| `name` | string | – | View name. |
|
|
2912
|
+
| `label` | string | – | Tab label. |
|
|
2913
|
+
| `cover-key` | string | `cover` | Row field with the picture’s URL. |
|
|
2914
|
+
| `no-cover` | boolean | – | Cards without pictures. |
|
|
2915
|
+
| `size` | small | medium | large | `medium` | Card size. |
|
|
2916
|
+
| `fit` | boolean | – | Show a picture whole instead of cropped. |
|
|
2917
|
+
| `title-key` | string | – | Title column. |
|
|
2918
|
+
| `meta-keys` | list | – | Comma-separated columns under the title. |
|
|
2919
|
+
| `new-row` | boolean | – | Show the add card. |
|
|
2920
|
+
| `new-row-label` | string | `+ New page` | Its text. |
|
|
2921
|
+
|
|
2922
|
+
**Events:** `nk-select` `{ row, id, value }` – Card clicked, Enter or Space. · `nk-action` `{ action: 'new-row' }` – Add card clicked.
|
|
2923
|
+
|
|
2924
|
+
**Properties:** `columns`, `rows`, `data` · **Methods:** `refresh()`
|
|
2925
|
+
|
|
2926
|
+
**Replaces:** `.nk-gallery`, `.small`, `.large`, `.fit`, `.nk-card`, `.nk-cover`, `.card-title`, `.card-meta`, `.nk-new-row`
|
|
2927
|
+
|
|
2928
|
+
```html
|
|
2929
|
+
<!-- equivalent class markup -->
|
|
2930
|
+
<div class="nk-gallery" role="list">
|
|
2931
|
+
<div class="nk-card" role="listitem" tabindex="0"><div class="nk-cover"><img src="/covers/aurora.svg" alt=""></div><div class="card-title">🧭 App shell & sidebar</div><div class="card-meta"><span><span class="nk-tag green">Done</span></span><span>📅 08.05.2026</span></div></div>
|
|
2932
|
+
<div class="nk-card" role="listitem" tabindex="0"><div class="nk-cover"><img src="/covers/dunes.svg" alt=""></div><div class="card-title">📄 Page shell & typography</div><div class="card-meta"><span><span class="nk-tag green">Done</span></span><span>📅 10.05.2026</span></div></div>
|
|
2933
|
+
<div class="nk-card" role="listitem" tabindex="0"><div class="nk-cover"><img src="/covers/meadow.svg" alt=""></div><div class="card-title">🗃️ Database table view</div><div class="card-meta"><span><span class="nk-tag blue">In progress</span></span><span>📅 20.05.2026</span></div></div>
|
|
2934
|
+
<div class="nk-card" role="listitem" tabindex="0"><div class="nk-cover"><img src="/covers/tide.svg" alt=""></div><div class="card-title">▤ Board view & drag-and-drop</div><div class="card-meta"><span><span class="nk-tag orange">Planned</span></span><span>📅 02.06.2026</span></div></div>
|
|
2935
|
+
<div class="nk-new-row" role="button" tabindex="0">+ New page</div>
|
|
2936
|
+
</div>
|
|
2937
|
+
```
|
|
2938
|
+
|
|
2939
|
+
**Small screens:** The grid drops columns by itself – one card per row on a phone, no breakpoint involved.
|
|
2940
|
+
|
|
2941
|
+
### 3.83 `<nk-filter-bar>` – Filter bar
|
|
2884
2942
|
|
|
2885
2943
|
The filters in effect as NotionKit’s filter pills – `.active` with an accent tint, a × to remove each, a quiet `add` pill at the end – with no inline style. In `slot="filters"` of `nk-database` the row sits under the toolbar. A pill’s label fires `nk-action { action: "edit" }`, the add pill `{ action: "add" }`, each with the clicked button as `anchor` for `menu.show(anchor)`. `bar.apply(rows)` keeps rows where every filter matches by strict equality (`row[key] === value`, so use the option value) – or differs with `op: "is-not"` – and the search text appears in any string field (a person’s `name`); the data logic stays yours. Its own Filter and Sort tools and the search field are there for a bar without a database toolbar. It keeps its own copy of `filters`: the array you pass is never changed, a removed pill is reported in `nk-change`.
|
|
2886
2944
|
|
|
@@ -2916,7 +2974,7 @@ The filters in effect as NotionKit’s filter pills – `.active` with an accent
|
|
|
2916
2974
|
|
|
2917
2975
|
**Small screens:** The pills wrap onto further rows.
|
|
2918
2976
|
|
|
2919
|
-
### 3.
|
|
2977
|
+
### 3.84 `<nk-comments>` – Comment thread
|
|
2920
2978
|
|
|
2921
2979
|
A left-ruled thread of `nk-comment`s with an input row. Enter or the button fires `nk-submit { text }`; appending the new comment is yours.
|
|
2922
2980
|
|
|
@@ -2953,7 +3011,7 @@ A left-ruled thread of `nk-comment`s with an input row. Enter or the button fire
|
|
|
2953
3011
|
|
|
2954
3012
|
**Small screens:** Unchanged.
|
|
2955
3013
|
|
|
2956
|
-
### 3.
|
|
3014
|
+
### 3.85 `<nk-comment>` – Comment
|
|
2957
3015
|
|
|
2958
3016
|
One comment: avatar (initials + `color`), bold author, time, body. `slot="head"` adds content after the name.
|
|
2959
3017
|
|
|
@@ -2979,7 +3037,7 @@ One comment: avatar (initials + `color`), bold author, time, body. `slot="head"`
|
|
|
2979
3037
|
|
|
2980
3038
|
**Small screens:** Unchanged.
|
|
2981
3039
|
|
|
2982
|
-
### 3.
|
|
3040
|
+
### 3.86 `<nk-ai-thread>` – AI thread
|
|
2983
3041
|
|
|
2984
3042
|
The conversation column: `nk-ai-msg` children (`role="user"` gets the gradient avatar), followed by an `nk-ai-input-row`. Action buttons in `slot="actions"` fire `nk-action { action, value }` – both carry the button’s `value` (or its text).
|
|
2985
3043
|
|
|
@@ -3012,7 +3070,7 @@ _No attributes._
|
|
|
3012
3070
|
|
|
3013
3071
|
**Small screens:** Unchanged.
|
|
3014
3072
|
|
|
3015
|
-
### 3.
|
|
3073
|
+
### 3.87 `<nk-ai-msg>` – AI message
|
|
3016
3074
|
|
|
3017
3075
|
One message. `role="user"` flips the avatar to the gradient; `badge` is the grey suffix after the name (“· AI”); plain `<button slot="actions">`s form the action row.
|
|
3018
3076
|
|
|
@@ -3042,7 +3100,7 @@ One message. `role="user"` flips the avatar to the gradient; `badge` is the grey
|
|
|
3042
3100
|
|
|
3043
3101
|
**Small screens:** Unchanged.
|
|
3044
3102
|
|
|
3045
|
-
### 3.
|
|
3103
|
+
### 3.88 `<nk-ai-input-row>` – AI input row
|
|
3046
3104
|
|
|
3047
3105
|
The prompt field with ✨ and a send button. Enter or the button fires `nk-submit { text }` and clears the field.
|
|
3048
3106
|
|
|
@@ -3084,8 +3142,8 @@ Eight skeletons, one per app shape, mirroring the NotionKit CSS SKILL.md. Copy o
|
|
|
3084
3142
|
<html lang="en" data-theme="light">
|
|
3085
3143
|
<head>
|
|
3086
3144
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3087
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3088
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3145
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3146
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3089
3147
|
</head>
|
|
3090
3148
|
<body class="nk-body">
|
|
3091
3149
|
<nk-app>
|
|
@@ -3166,8 +3224,8 @@ Rules of the shell: `nk-sidebar`, `nk-topbar` and `nk-page` are `display: conten
|
|
|
3166
3224
|
<html lang="en" data-theme="light">
|
|
3167
3225
|
<head>
|
|
3168
3226
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3169
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3170
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3227
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3228
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3171
3229
|
</head>
|
|
3172
3230
|
<body class="nk-body">
|
|
3173
3231
|
<nk-app>
|
|
@@ -3274,8 +3332,8 @@ Data contract: `columns` describe the properties (`type`: text | select | multi-
|
|
|
3274
3332
|
<html lang="en" data-theme="light">
|
|
3275
3333
|
<head>
|
|
3276
3334
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3277
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3278
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3335
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3336
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3279
3337
|
</head>
|
|
3280
3338
|
<body class="nk-body">
|
|
3281
3339
|
<nk-app>
|
|
@@ -3334,8 +3392,8 @@ Data contract: `columns` describe the properties (`type`: text | select | multi-
|
|
|
3334
3392
|
<html lang="en" data-theme="light">
|
|
3335
3393
|
<head>
|
|
3336
3394
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3337
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3338
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3395
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3396
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3339
3397
|
</head>
|
|
3340
3398
|
<body class="nk-body">
|
|
3341
3399
|
<!-- your app -->
|
|
@@ -3412,8 +3470,8 @@ The open/close contract is one attribute: `settings.open = true`, `settings.show
|
|
|
3412
3470
|
<html lang="en" data-theme="light">
|
|
3413
3471
|
<head>
|
|
3414
3472
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3415
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3416
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3473
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3474
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3417
3475
|
</head>
|
|
3418
3476
|
<body class="nk-body">
|
|
3419
3477
|
<div class="nk-page" style="padding-top:48px">
|
|
@@ -3459,8 +3517,8 @@ The open/close contract is one attribute: `settings.open = true`, `settings.show
|
|
|
3459
3517
|
<html lang="en" data-theme="light">
|
|
3460
3518
|
<head>
|
|
3461
3519
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3462
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3463
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3520
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3521
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3464
3522
|
</head>
|
|
3465
3523
|
<body class="nk-body">
|
|
3466
3524
|
<nk-page narrow icon="📘" cover>
|
|
@@ -3504,8 +3562,8 @@ Note `narrow`: the page is the document, so there is no inner scroll wrapper –
|
|
|
3504
3562
|
<html lang="en" data-theme="light">
|
|
3505
3563
|
<head>
|
|
3506
3564
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3507
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3508
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3565
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3566
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3509
3567
|
</head>
|
|
3510
3568
|
<body class="nk-body">
|
|
3511
3569
|
<nk-app>
|
|
@@ -3559,8 +3617,8 @@ Note `narrow`: the page is the document, so there is no inner scroll wrapper –
|
|
|
3559
3617
|
<html lang="en" data-theme="light">
|
|
3560
3618
|
<head>
|
|
3561
3619
|
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
3562
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.
|
|
3563
|
-
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.
|
|
3620
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit@1.15.0/notionkit.min.css">
|
|
3621
|
+
<script src="https://cdn.jsdelivr.net/npm/@jungherz-de/notionkit-elements@1.15.0/dist/notionkit-elements.min.js"></script>
|
|
3564
3622
|
</head>
|
|
3565
3623
|
<body class="nk-body">
|
|
3566
3624
|
<!-- A narrow column, centred: layout is yours, so it is inline. -->
|
|
@@ -3734,6 +3792,7 @@ Form controls additionally re-dispatch a native, bubbling `change` event, so `fo
|
|
|
3734
3792
|
| `<nk-board-view>` | data | `name`, `label`, `group-by`, `title-key` | – | `nk-select`, `nk-change`, `nk-action` |
|
|
3735
3793
|
| `<nk-list-view>` | data | `name`, `label`, `title-key`, `meta-keys` | – | `nk-select`, `nk-action` |
|
|
3736
3794
|
| `<nk-calendar-view>` | data | `name`, `label`, `date-key`, `title-key` | – | `nk-select`, `nk-month` |
|
|
3795
|
+
| `<nk-gallery-view>` | data | `name`, `label`, `cover-key`, `no-cover` | – | `nk-select`, `nk-action` |
|
|
3737
3796
|
| `<nk-filter-bar>` | data | `add`, `add-label`, `no-filter`, `no-sort` | `(default)` | `nk-change`, `nk-action` |
|
|
3738
3797
|
| `<nk-comments>` | data | `placeholder`, `send-label`, `no-input`, `disabled` | `(default)` | `nk-submit` |
|
|
3739
3798
|
| `<nk-comment>` | data | `author`, `time`, `avatar`, `color` | `(default)`, `head`, `avatar` | – |
|
|
@@ -3759,10 +3818,10 @@ Form controls additionally re-dispatch a native, bubbling `change` event, so `fo
|
|
|
3759
3818
|
| Theme sync | one `MutationObserver` on `<html>[data-theme]`, a `Set` of instances, `.nk-wrapper[data-theme]` inside each root |
|
|
3760
3819
|
| Components | `src/components/{forms,content,shell,page,overlays,data}/nk-*.js`, one tag per file, `customElements.define` at the bottom |
|
|
3761
3820
|
| Build | Rollup: IIFE, minified IIFE, ESM, and per-component ESM entries on a stable `dist/components/base.js` that import NotionKit's sheet (`@jungherz-de/notionkit/notionkit-styles.js`) instead of inlining it; the full bundles inline it and export `componentsSheet` |
|
|
3762
|
-
| Peer | `@jungherz-de/notionkit >= 1.
|
|
3821
|
+
| Peer | `@jungherz-de/notionkit >= 1.15.0` – from 1.5.0 on the elements and the foundation share one version number; the bundle embeds that release's stylesheet, so keep them in step |
|
|
3763
3822
|
|
|
3764
3823
|
Lifecycle: construct (attach shadow, adopt sheets) → first connect (wrapper + `render()`) → every connect (`setupEvents()`, theme registration, light-DOM observer) → `attributeChangedCallback` → `onAttributeChanged` → disconnect (`teardownEvents()`, unregister).
|
|
3765
3824
|
|
|
3766
3825
|
|
|
3767
3826
|
---
|
|
3768
|
-
*NotionKit Elements v1.
|
|
3827
|
+
*NotionKit Elements v1.15.0 · wrapping NotionKit CSS v1.15.0 · MIT · Jungherz GmbH*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NkElement } from './base.js';
|
|
2
|
-
import { t as tagFor, r as renderPropertyCell } from './shared/property-cell-
|
|
2
|
+
import { t as tagFor, a as textOf, f as formatDate, r as renderPropertyCell } from './shared/property-cell-BSVcETss.js';
|
|
3
3
|
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
4
4
|
import './shared/avatar-CzPZN3uP.js';
|
|
5
|
+
import './shared/dates-a32DcW1l.js';
|
|
5
6
|
|
|
6
7
|
// <nk-board-view name="board" label="▤ Board" group-by="status" new-row></nk-board-view>
|
|
7
8
|
// Groups rows by a select column (default: the first select column); one
|
|
@@ -51,14 +52,14 @@ class NkBoardView extends NkElement {
|
|
|
51
52
|
for (const row of cards) {
|
|
52
53
|
const card = this.createElement('div', ['nk-card'], { draggable: 'true', 'data-id': row.id ?? '', tabindex: '0' });
|
|
53
54
|
const t = this.createElement('div', ['card-title']);
|
|
54
|
-
t.textContent = `${row.icon ? row.icon + ' ' : ''}${title ? row[title.key]
|
|
55
|
+
t.textContent = `${row.icon ? row.icon + ' ' : ''}${title ? textOf(row[title.key]) : ''}`;
|
|
55
56
|
const meta = this.createElement('div', ['card-meta']);
|
|
56
57
|
for (const c of this._metaColumns()) {
|
|
57
58
|
const v = row[c.key];
|
|
58
59
|
if (v === undefined || v === null || v === '') continue;
|
|
59
60
|
const s = document.createElement('span');
|
|
60
61
|
if (c.type === 'progress') s.textContent = `▰ ${v}%`;
|
|
61
|
-
else if (c.type === 'date') s.textContent = `📅 ${v}`;
|
|
62
|
+
else if (c.type === 'date') s.textContent = `📅 ${formatDate(c, v)}`;
|
|
62
63
|
else s.appendChild(renderPropertyCell(c, v, row));
|
|
63
64
|
meta.appendChild(s);
|
|
64
65
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NkElement } from './base.js';
|
|
2
|
+
import { a as textOf } from './shared/property-cell-BSVcETss.js';
|
|
2
3
|
import { C as CHEVRONS, i as isoOf, r as resolveLocale, f as firstWeekday, m as monthGrid, p as parseDay, w as weekLabel, a as weekdayNames, b as isoWeek, s as stepMonth } from './shared/dates-a32DcW1l.js';
|
|
3
4
|
import '@jungherz-de/notionkit/notionkit-styles.js';
|
|
5
|
+
import './shared/avatar-CzPZN3uP.js';
|
|
4
6
|
|
|
5
7
|
// <nk-calendar-view name="calendar" label="📅 Calendar" date-key="due" weeks></nk-calendar-view>
|
|
6
8
|
// The fourth database view (NotionKit 1.9.0): a month, the rows as cards on
|
|
@@ -83,7 +85,7 @@ class NkCalendarView extends NkElement {
|
|
|
83
85
|
day.appendChild(num);
|
|
84
86
|
for (const row of byDay[iso] || []) {
|
|
85
87
|
const item = this.createElement('button', ['cv-item'], { type: 'button', 'data-id': row.id ?? '' });
|
|
86
|
-
const title = titleCol ?
|
|
88
|
+
const title = titleCol ? textOf(row[titleCol.key]) : '';
|
|
87
89
|
item.textContent = row.icon ? `${row.icon} ${title}` : title;
|
|
88
90
|
day.appendChild(item);
|
|
89
91
|
}
|
|
@@ -88,12 +88,13 @@ class NkFilterBar extends NkElement {
|
|
|
88
88
|
/**
|
|
89
89
|
* Applies filters and search to rows: a filter keeps rows where row[key]
|
|
90
90
|
* equals value – or differs from it with op: 'is-not'; the search looks
|
|
91
|
-
* for the text in every string field (a person's name
|
|
91
|
+
* for the text in every string field (a person's name, a text or link
|
|
92
|
+
* object's text).
|
|
92
93
|
*/
|
|
93
94
|
apply(rows) {
|
|
94
95
|
const q = this.value.trim().toLowerCase();
|
|
95
96
|
return rows.filter(r => this._filters.every(f => (f.op === 'is-not' ? r[f.key] !== f.value : r[f.key] === f.value))
|
|
96
|
-
&& (!q || Object.values(r).some(v => String(typeof v === 'object' && v ? v.name ?? '' : v ?? '').toLowerCase().includes(q))));
|
|
97
|
+
&& (!q || Object.values(r).some(v => String(typeof v === 'object' && v ? v.name ?? v.text ?? v.label ?? '' : v ?? '').toLowerCase().includes(q))));
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
|