@jungherz-de/notionkit-elements 1.5.0 → 1.5.2
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/README.md +5 -5
- package/dist/components/nk-ai-input-row.js +1 -1
- package/dist/components/nk-ai-msg.js +1 -1
- package/dist/components/nk-ai-thread.js +1 -1
- package/dist/components/nk-app.js +1 -1
- package/dist/components/nk-avatar-group.js +1 -1
- package/dist/components/nk-banner.js +1 -1
- package/dist/components/nk-block-host.js +1 -1
- package/dist/components/nk-board-view.js +1 -1
- package/dist/components/nk-breadcrumb.js +1 -1
- package/dist/components/nk-btn.js +1 -1
- package/dist/components/nk-callout.js +1 -1
- package/dist/components/nk-check.js +1 -1
- package/dist/components/nk-cmdk.js +1 -1
- package/dist/components/nk-code.js +1 -1
- package/dist/components/nk-comment.js +1 -1
- package/dist/components/nk-comments.js +1 -1
- package/dist/components/nk-danger-zone.js +16 -7
- package/dist/components/nk-database.js +1 -1
- package/dist/components/nk-divider.js +1 -1
- package/dist/components/nk-emoji-picker.js +1 -1
- package/dist/components/nk-empty.js +16 -5
- package/dist/components/nk-field.js +1 -1
- package/dist/components/nk-fields.js +1 -1
- package/dist/components/nk-filter-bar.js +1 -1
- package/dist/components/nk-heading.js +1 -1
- package/dist/components/nk-input.js +1 -1
- package/dist/components/nk-kbd.js +1 -1
- package/dist/components/nk-member-list.js +1 -1
- package/dist/components/nk-member-row.js +1 -1
- package/dist/components/nk-mention.js +1 -1
- package/dist/components/nk-menu-item.js +1 -1
- package/dist/components/nk-menu.js +1 -1
- package/dist/components/nk-modal.js +1 -1
- package/dist/components/nk-model-card.js +10 -5
- package/dist/components/nk-page-actions.js +1 -1
- package/dist/components/nk-page-cover.js +1 -1
- package/dist/components/nk-page-title.js +1 -1
- package/dist/components/nk-page.js +1 -1
- package/dist/components/nk-pop.js +1 -1
- package/dist/components/nk-profile-row.js +1 -1
- package/dist/components/nk-progress.js +1 -1
- package/dist/components/nk-quote.js +1 -1
- package/dist/components/nk-radio.js +1 -1
- package/dist/components/nk-section-label.js +1 -1
- package/dist/components/nk-segmented.js +1 -1
- package/dist/components/nk-select.js +1 -1
- package/dist/components/nk-settings-pane.js +8 -3
- package/dist/components/nk-settings-user.js +1 -1
- package/dist/components/nk-sidebar.js +27 -4
- package/dist/components/nk-skeleton.js +1 -1
- package/dist/components/nk-slider.js +1 -1
- package/dist/components/nk-stat.js +1 -1
- package/dist/components/nk-stats.js +1 -1
- package/dist/components/nk-switch.js +1 -1
- package/dist/components/nk-synced.js +1 -1
- package/dist/components/nk-tab-bar-item.js +1 -1
- package/dist/components/nk-tab-bar.js +1 -1
- package/dist/components/nk-tab.js +1 -1
- package/dist/components/nk-table-view.js +1 -1
- package/dist/components/nk-tabs.js +1 -1
- package/dist/components/nk-tag.js +1 -1
- package/dist/components/nk-template-btn.js +1 -1
- package/dist/components/nk-textarea.js +1 -1
- package/dist/components/nk-theme-toggle.js +1 -1
- package/dist/components/nk-toast.js +19 -1
- package/dist/components/nk-todo.js +1 -1
- package/dist/components/nk-toggle.js +1 -1
- package/dist/components/nk-topbar.js +1 -1
- package/dist/components/nk-tree-item.js +1 -1
- package/dist/components/nk-tree.js +1 -1
- package/dist/components/nk-workspace-switcher.js +1 -1
- package/dist/components/shared/base-AWFyTskN.js +366 -0
- package/dist/notionkit-elements.esm.js +112 -22
- package/dist/notionkit-elements.js +112 -22
- package/dist/notionkit-elements.min.js +1 -1
- package/package.json +3 -3
- package/src/base.js +19 -0
- package/src/components/overlays/nk-settings-pane.js +7 -2
- package/src/components/overlays/nk-toast.js +18 -0
- package/src/components/page/nk-danger-zone.js +15 -6
- package/src/components/page/nk-empty.js +15 -4
- package/src/components/page/nk-model-card.js +9 -4
- package/src/components/shell/nk-sidebar.js +26 -3
- package/dist/components/shared/base-FHMDMonZ.js +0 -347
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-stat label="Active pages" value="128" delta="▲ 12 this week" trend="up"></nk-stat>
|
|
4
4
|
// → <div class="nk-stat"><div class="s-label">…</div><div class="s-value">…</div><div class="s-delta up">…</div></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
import { c as compareBy, r as renderPropertyCell } from './shared/property-cell-CtXQpUjQ.js';
|
|
3
3
|
|
|
4
4
|
// <nk-table-view name="table" label="▦ Table" count new-row sortable wrap></nk-table-view>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-tag color="blue">Text</nk-tag> — modifier class .blue becomes color="blue".
|
|
4
4
|
// Notion's nine select colours; without `color` the stylesheet draws the grey tag.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-template-btn icon="📅" value="week-plan">Insert week plan</nk-template-btn>
|
|
4
4
|
// → <button class="nk-template-btn">📅 Insert week plan</button>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-textarea name="bio" rows="3" wide>Text</nk-textarea> → <textarea class="nk-textarea wide">
|
|
4
4
|
// The initial value is the `value` attribute, or the element's text content.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement, g as getCurrentTheme } from './shared/base-
|
|
1
|
+
import { N as NkElement, g as getCurrentTheme } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-theme-toggle slot="actions"></nk-theme-toggle>
|
|
4
4
|
// → <button class="nk-topbar-btn nk-theme-toggle">🌙</button>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-toast id="toast"></nk-toast> … toast.show('Saved');
|
|
4
4
|
// → <div class="nk-toast show">✓ Saved</div>
|
|
5
5
|
// One node, bottom-centred, auto-hides after `duration` ms (default 2200).
|
|
6
|
+
// Above a tab bar at the bottom of the screen it rises 12px over the bar:
|
|
7
|
+
// notionkit.css does that for class markup with :has(), which cannot see
|
|
8
|
+
// into shadow roots, so the element measures the bar when it opens.
|
|
6
9
|
class NkToast extends NkElement {
|
|
7
10
|
static get observedAttributes() { return ['open', 'duration', 'icon']; }
|
|
8
11
|
|
|
@@ -16,12 +19,27 @@ class NkToast extends NkElement {
|
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
_sync() {
|
|
22
|
+
if (this.getBoolAttr('open')) this._lift();
|
|
19
23
|
this._box.classList.toggle('show', this.getBoolAttr('open'));
|
|
20
24
|
const icon = this.getAttribute('icon') ?? '✓';
|
|
21
25
|
this._icon.textContent = icon;
|
|
22
26
|
this._icon.style.display = icon ? '' : 'none';
|
|
23
27
|
}
|
|
24
28
|
|
|
29
|
+
// A bar counts when it is rendered and ends near the bottom of the viewport –
|
|
30
|
+
// the app's own bar, fixed, sticky or floating. A tab bar shown as a preview
|
|
31
|
+
// somewhere in a page does not lift the toast.
|
|
32
|
+
_lift() {
|
|
33
|
+
const bars = [...document.querySelectorAll('.nk-tab-bar')];
|
|
34
|
+
for (const host of document.querySelectorAll('nk-tab-bar')) {
|
|
35
|
+
const bar = host.shadowRoot?.querySelector('.nk-tab-bar');
|
|
36
|
+
if (bar) bars.push(bar);
|
|
37
|
+
}
|
|
38
|
+
const rect = bars.map(b => b.getBoundingClientRect())
|
|
39
|
+
.find(r => r.height > 0 && r.top < innerHeight && r.bottom > innerHeight - 60);
|
|
40
|
+
this._box.style.bottom = rect ? `${Math.round(innerHeight - rect.top + 12)}px` : '';
|
|
41
|
+
}
|
|
42
|
+
|
|
25
43
|
/** Shows `message` (or the slotted content when omitted) and hides it again after `duration`. */
|
|
26
44
|
show(message, { duration } = {}) {
|
|
27
45
|
if (message !== undefined) this._msg.textContent = message;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as NkFormElement } from './shared/base-
|
|
1
|
+
import { a as NkFormElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-todo name="task" value="1" checked>Write the docs</nk-todo>
|
|
4
4
|
// → <label class="nk-todo"><input type="checkbox"><span>Write the docs</span></label>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N as NkElement } from './shared/base-
|
|
1
|
+
import { N as NkElement } from './shared/base-AWFyTskN.js';
|
|
2
2
|
|
|
3
3
|
// <nk-toggle label="Details" open>Body…</nk-toggle>
|
|
4
4
|
// → <details class="nk-toggle" open><summary>Details</summary><div class="toggle-body">…</div></details>
|