@k2b/ui 0.24.0 → 0.26.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/README.md +2 -2
- package/dist/browser/actions/Dropdown.js +67 -52
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +5 -5
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/SpotlightSearch.js +13 -6
- package/dist/browser/actions/SpotlightSearch.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +75 -1
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/content/Calendar.js +1539 -911
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/CalendarDayView.js +5 -4
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/CalendarWeekView.js +5 -4
- package/dist/browser/content/CalendarWeekView.js.map +1 -1
- package/dist/browser/content/Kbd.js +51 -0
- package/dist/browser/content/Kbd.js.map +1 -0
- package/dist/browser/content/LabelChip.js +38 -0
- package/dist/browser/content/LabelChip.js.map +1 -0
- package/dist/browser/content/MarkdownView.js +2 -1
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/Steps.js +34 -0
- package/dist/browser/content/Steps.js.map +1 -0
- package/dist/browser/content/Timeline.js +3 -3
- package/dist/browser/content/Timeline.js.map +1 -1
- package/dist/browser/content/VirtualFeed.js +33 -1
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/content/calendar-dialogs.js +32 -60
- package/dist/browser/content/calendar-dialogs.js.map +1 -1
- package/dist/browser/content/calendar-month-scroll.js +80 -0
- package/dist/browser/content/calendar-month-scroll.js.map +1 -0
- package/dist/browser/content/calendar-time-view.js +0 -1
- package/dist/browser/content/calendar-time-view.js.map +1 -1
- package/dist/browser/content/index.js +4 -1
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/markdown-info-blocks.js +33 -5
- package/dist/browser/content/markdown-info-blocks.js.map +1 -1
- package/dist/browser/feedback/prompts.js +17 -3
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +22 -3
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/QrScanner.js +2 -1
- package/dist/browser/inputs/QrScanner.js.map +1 -1
- package/dist/browser/intl/index.js +1 -0
- package/dist/browser/intl/index.js.map +1 -1
- package/dist/browser/intl/shortcut-messages.js +77 -0
- package/dist/browser/intl/shortcut-messages.js.map +1 -0
- package/dist/browser/intl/shortcut.js +123 -0
- package/dist/browser/intl/shortcut.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +355 -338
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/TableOfContents.js +115 -0
- package/dist/browser/layout/TableOfContents.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +7 -50
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/index.js +1 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/scroll-fade.js +14 -9
- package/dist/browser/layout/scroll-fade.js.map +1 -1
- package/dist/browser/layout/sidebar-scroll-memory.js +38 -0
- package/dist/browser/layout/sidebar-scroll-memory.js.map +1 -0
- package/dist/browser/layout/table-of-contents-messages.js +19 -0
- package/dist/browser/layout/table-of-contents-messages.js.map +1 -0
- package/dist/browser/motion.js +7 -0
- package/dist/browser/motion.js.map +1 -0
- package/dist/browser/surfaces/LinkCard.js +40 -24
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +11 -5
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +5 -5
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/SpotlightSearch.js +9 -3
- package/dist/ssr/actions/SpotlightSearch.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +67 -1
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/content/Calendar.js +864 -312
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/CalendarDayView.js +5 -4
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/CalendarWeekView.js +5 -4
- package/dist/ssr/content/CalendarWeekView.js.map +1 -1
- package/dist/ssr/content/Kbd.js +38 -0
- package/dist/ssr/content/Kbd.js.map +1 -0
- package/dist/ssr/content/LabelChip.js +21 -0
- package/dist/ssr/content/LabelChip.js.map +1 -0
- package/dist/ssr/content/MarkdownView.js +2 -1
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/Steps.js +14 -0
- package/dist/ssr/content/Steps.js.map +1 -0
- package/dist/ssr/content/Timeline.js +3 -3
- package/dist/ssr/content/Timeline.js.map +1 -1
- package/dist/ssr/content/VirtualFeed.js +33 -1
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/content/calendar-dialogs.js +12 -32
- package/dist/ssr/content/calendar-dialogs.js.map +1 -1
- package/dist/ssr/content/calendar-month-scroll.js +80 -0
- package/dist/ssr/content/calendar-month-scroll.js.map +1 -0
- package/dist/ssr/content/calendar-time-view.js +0 -1
- package/dist/ssr/content/calendar-time-view.js.map +1 -1
- package/dist/ssr/content/index.js +4 -1
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/markdown-info-blocks.js +33 -5
- package/dist/ssr/content/markdown-info-blocks.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +17 -3
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/index.js +1 -0
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +18 -3
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/QrScanner.js +2 -1
- package/dist/ssr/inputs/QrScanner.js.map +1 -1
- package/dist/ssr/intl/index.js +1 -0
- package/dist/ssr/intl/index.js.map +1 -1
- package/dist/ssr/intl/shortcut-messages.js +77 -0
- package/dist/ssr/intl/shortcut-messages.js.map +1 -0
- package/dist/ssr/intl/shortcut.js +123 -0
- package/dist/ssr/intl/shortcut.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +77 -72
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/TableOfContents.js +79 -0
- package/dist/ssr/layout/TableOfContents.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +7 -50
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/index.js +1 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/scroll-fade.js +14 -9
- package/dist/ssr/layout/scroll-fade.js.map +1 -1
- package/dist/ssr/layout/sidebar-scroll-memory.js +38 -0
- package/dist/ssr/layout/sidebar-scroll-memory.js.map +1 -0
- package/dist/ssr/layout/table-of-contents-messages.js +19 -0
- package/dist/ssr/layout/table-of-contents-messages.js.map +1 -0
- package/dist/ssr/motion.js +7 -0
- package/dist/ssr/motion.js.map +1 -0
- package/dist/ssr/surfaces/LinkCard.js +26 -10
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +12 -0
- package/dist/types/actions/SpotlightSearch.d.ts +2 -0
- package/dist/types/content/Calendar.d.ts +16 -6
- package/dist/types/content/Kbd.d.ts +16 -0
- package/dist/types/content/LabelChip.d.ts +12 -0
- package/dist/types/content/MarkdownView.d.ts +2 -1
- package/dist/types/content/Steps.d.ts +12 -0
- package/dist/types/content/VirtualFeed.d.ts +8 -0
- package/dist/types/content/calendar-dialogs.d.ts +0 -2
- package/dist/types/content/calendar-month-scroll.d.ts +25 -0
- package/dist/types/content/calendar-time-view.d.ts +0 -1
- package/dist/types/content/index.d.ts +7 -1
- package/dist/types/content/markdown-info-blocks.d.ts +21 -4
- package/dist/types/feedback/prompts.d.ts +8 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/inputs/Combobox.d.ts +1 -0
- package/dist/types/intl/index.d.ts +2 -0
- package/dist/types/intl/shortcut-messages.d.ts +35 -0
- package/dist/types/intl/shortcut.d.ts +29 -0
- package/dist/types/layout/AppWorkspace.d.ts +3 -1
- package/dist/types/layout/TableOfContents.d.ts +24 -0
- package/dist/types/layout/index.d.ts +2 -0
- package/dist/types/layout/scroll-fade.d.ts +2 -0
- package/dist/types/layout/sidebar-scroll-memory.d.ts +6 -0
- package/dist/types/layout/table-of-contents-messages.d.ts +4 -0
- package/dist/types/motion.d.ts +6 -0
- package/dist/types/surfaces/LinkCard.d.ts +3 -0
- package/package.json +3 -3
|
@@ -27,31 +27,33 @@ var _tmpl$ = ["<button type=\"button\" class=\"k2b-app-workspace__resize\" role=
|
|
|
27
27
|
_tmpl$16 = "<span class=\"k2b-app-workspace__sidebar-status-mention\" aria-hidden=\"true\">@</span>",
|
|
28
28
|
_tmpl$17 = "<span class=\"k2b-app-workspace__sidebar-status-muted\" aria-hidden=\"true\"><i class=\"ti ti-bell-off\"></i></span>",
|
|
29
29
|
_tmpl$18 = ["<span class=\"k2b-app-workspace__sidebar-status-count\"", ">", "</span>"],
|
|
30
|
-
_tmpl$19 = ["<span class=\"k2b-app-workspace__sidebar-status
|
|
31
|
-
_tmpl$20 = "<span class=\"k2b-
|
|
32
|
-
_tmpl$21 = ["<span class=\"k2b-app-workspace__sidebar-
|
|
33
|
-
_tmpl$22 =
|
|
34
|
-
_tmpl$23 = ["<span class=\"k2b-app-workspace__sidebar-item-
|
|
35
|
-
_tmpl$24 = ["<span class=\"k2b-app-workspace__sidebar-item-
|
|
36
|
-
_tmpl$25 = ["<span class=\"k2b-app-workspace__sidebar-item-
|
|
37
|
-
_tmpl$26 = ["<span class=\"k2b-app-workspace__sidebar-item-
|
|
38
|
-
_tmpl$27 = ["<
|
|
39
|
-
_tmpl$28 = ["<
|
|
40
|
-
_tmpl$29 = ["<
|
|
41
|
-
_tmpl$30 = ["<
|
|
42
|
-
_tmpl$31 = ["<
|
|
43
|
-
_tmpl$32 = ["<span class=\"k2b-app-
|
|
44
|
-
_tmpl$33 = ["<span class=\"
|
|
45
|
-
_tmpl$34 = ["<
|
|
46
|
-
_tmpl$35 = ["<
|
|
47
|
-
_tmpl$36 = ["<div class=\"
|
|
48
|
-
_tmpl$37 = ["<div class=\"k2b-app-
|
|
49
|
-
_tmpl$38 = ["<
|
|
50
|
-
_tmpl$39 = "<
|
|
51
|
-
_tmpl$40 = ["<
|
|
52
|
-
_tmpl$41 =
|
|
53
|
-
_tmpl$42 = ["<div class=\"
|
|
54
|
-
_tmpl$43 = ["<
|
|
30
|
+
_tmpl$19 = ["<span class=\"k2b-app-workspace__sidebar-status-unread\" aria-hidden=\"true\">", "</span>"],
|
|
31
|
+
_tmpl$20 = ["<span class=\"k2b-sr-only\">, ", "</span>"],
|
|
32
|
+
_tmpl$21 = ["<span class=\"k2b-app-workspace__sidebar-status\"", ">", "</span>"],
|
|
33
|
+
_tmpl$22 = "<span class=\"k2b-app-workspace__sidebar-status-dot\"></span>",
|
|
34
|
+
_tmpl$23 = ["<span class=\"k2b-app-workspace__sidebar-item-icon\" aria-hidden=\"true\">", "</span>"],
|
|
35
|
+
_tmpl$24 = ["<span class=\"k2b-app-workspace__sidebar-item-context-meta\">", "</span>"],
|
|
36
|
+
_tmpl$25 = ["<span class=\"k2b-app-workspace__sidebar-item-context\"><span class=\"k2b-app-workspace__sidebar-item-context-label\">", "</span>", "</span>"],
|
|
37
|
+
_tmpl$26 = ["<span class=\"k2b-app-workspace__sidebar-item-description\">", "</span>"],
|
|
38
|
+
_tmpl$27 = ["<span class=\"k2b-app-workspace__sidebar-item-copy\">", "<span class=\"k2b-app-workspace__sidebar-item-label\"", "><span class=\"k2b-app-workspace__sidebar-item-label-text\">", "</span></span>", "</span>"],
|
|
39
|
+
_tmpl$28 = ["<span class=\"k2b-app-workspace__sidebar-item-meta\"", ">", "</span>"],
|
|
40
|
+
_tmpl$29 = ["<i", "></i>"],
|
|
41
|
+
_tmpl$30 = ["<a", " class=\"k2b-app-workspace__sidebar-item-action\"", ">", "</a>"],
|
|
42
|
+
_tmpl$31 = ["<button type=\"button\" class=\"k2b-app-workspace__sidebar-item-action\"", ">", "</button>"],
|
|
43
|
+
_tmpl$32 = ["<span class=\"k2b-app-workspace__sidebar-item-copy\"><span class=\"k2b-app-workspace__sidebar-item-label\"", "><span class=\"k2b-app-workspace__sidebar-item-label-text\">", "</span></span><span class=\"k2b-app-workspace__sidebar-item-description\">", "</span></span>"],
|
|
44
|
+
_tmpl$33 = ["<span class=\"", "\"", ">", "</span>"],
|
|
45
|
+
_tmpl$34 = ["<span class=\"k2b-app-workspace__nav-tree-toggle\" data-k2b-nav-tree-toggle aria-hidden=\"true\"><i class=\"", "\"></i></span>"],
|
|
46
|
+
_tmpl$35 = ["<span class=\"k2b-app-workspace__sidebar-item-label\"", "><span class=\"k2b-app-workspace__sidebar-item-label-text\">", "</span></span>"],
|
|
47
|
+
_tmpl$36 = ["<div class=\"k2b-app-workspace__nav-tree-group\" role=\"group\">", "</div>"],
|
|
48
|
+
_tmpl$37 = ["<div class=\"k2b-app-workspace__nav-tree-node\" role=\"treeitem\"", " style=\"", "\">", "", "</div>"],
|
|
49
|
+
_tmpl$38 = ["<div class=\"", "\" role=\"tree\"", ">", "</div>"],
|
|
50
|
+
_tmpl$39 = ["<div class=\"k2b-app-workspace__sidebar-icon-grid\"", ">", "</div>"],
|
|
51
|
+
_tmpl$40 = ["<i", " aria-hidden=\"true\"></i>"],
|
|
52
|
+
_tmpl$41 = "<i class=\"ti ti-layout-sidebar\" aria-hidden=\"true\"></i>",
|
|
53
|
+
_tmpl$42 = ["<div class=\"k2b-app-workspace__head\"", ">", "", "</div>"],
|
|
54
|
+
_tmpl$43 = ["<h1 class=\"k2b-app-workspace__head-heading\" data-k2b-page-trail-title", ">", "</h1>"],
|
|
55
|
+
_tmpl$44 = ["<div class=\"", "\" data-k2b-app-workspace", " style=\"", "\">", "", "</div>"],
|
|
56
|
+
_tmpl$45 = ["<div class=\"", "\">", "</div>"];
|
|
55
57
|
import { Link } from "@k2b/ssr/nav";
|
|
56
58
|
import { children, createContext, createEffect, createMemo, createSignal, createUniqueId, For, mergeProps, onCleanup, onMount, Show, useContext } from "solid-js";
|
|
57
59
|
import { isServer } from "solid-js/web";
|
|
@@ -61,7 +63,8 @@ import { APP_WORKSPACE_DETAIL_DEFAULT, APP_WORKSPACE_DETAIL_MAX, APP_WORKSPACE_D
|
|
|
61
63
|
import { PageTitle, usePageTrail } from "./PageTitle";
|
|
62
64
|
import { SidebarItemPreview } from "./SidebarItemPreview";
|
|
63
65
|
import { AppWorkspaceSidebarSwitcher } from "./SidebarSwitcher";
|
|
64
|
-
import { createScrollFade } from "./scroll-fade";
|
|
66
|
+
import { createScrollFade, scrollFadeEdges } from "./scroll-fade";
|
|
67
|
+
import { rememberSidebarScroll } from "./sidebar-scroll-memory";
|
|
65
68
|
import { assertStableUiId, assertUniqueStableUiIds } from "./stable-id";
|
|
66
69
|
import { useWorkspaceMessages } from "./workspace-messages";
|
|
67
70
|
const ResizeContext = createContext(true);
|
|
@@ -454,20 +457,18 @@ const AppWorkspaceSidebarDesktop = props => ({
|
|
|
454
457
|
kind: SIDEBAR_DESKTOP,
|
|
455
458
|
children: props.children
|
|
456
459
|
});
|
|
457
|
-
//
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
//
|
|
465
|
-
|
|
466
|
-
// repeats the restore once the whole document is parsed, because content that
|
|
467
|
-
// follows the sidebar can still change its height before the first paint.
|
|
468
|
-
const SIDEBAR_SCROLL_MEMORY_SCRIPT = ["(function(){", "var body=document.currentScript&&document.currentScript.previousElementSibling;if(!body)return;", "var storage;try{storage=window.sessionStorage}catch(_){return}", 'var key="k2b-sidebar-scroll:"+location.pathname.split("/")[1]+":"+document.querySelectorAll(".k2b-app-workspace__sidebar-body").length;', "var restore=function(){", "var stored=storage.getItem(key);if(stored!==null)body.scrollTop=Number(stored);", 'var current=body.querySelector(\'[aria-current="page"]\')||body.querySelector(\'[aria-current="true"]\');if(current)current.scrollIntoView({block:"nearest"});', "};", "restore();requestAnimationFrame(restore);", "var frame=0;", 'body.addEventListener("scroll",function(){if(frame)return;frame=requestAnimationFrame(function(){frame=0;try{storage.setItem(key,String(body.scrollTop))}catch(_){}})},{passive:true});', "})();"].join("");
|
|
460
|
+
// The inline script restores server markup while parsing; onMount restores a
|
|
461
|
+
// client-rendered sidebar when an island replaces it. Both paths keep the
|
|
462
|
+
// current item in view and set the fade before paint, repeating the restore
|
|
463
|
+
// in the first frame when the whole document has its final layout. Only
|
|
464
|
+
// pagehide stores the offset: restores before final layout can be clamped,
|
|
465
|
+
// and remembering those programmatic scrolls would shrink the stored offset.
|
|
466
|
+
// Memory is per scroll-preserve key (or page path) and sidebar position and
|
|
467
|
+
// ends with the tab.
|
|
468
|
+
const SIDEBAR_SCROLL_MEMORY_SCRIPT = `(${rememberSidebarScroll})(document.currentScript&&document.currentScript.previousElementSibling,${scrollFadeEdges})`;
|
|
469
469
|
const AppWorkspaceSidebarBody = props => {
|
|
470
470
|
let body;
|
|
471
|
+
onMount(() => onCleanup(rememberSidebarScroll(body, scrollFadeEdges)));
|
|
471
472
|
createScrollFade(() => body, () => props.scrollFade !== false);
|
|
472
473
|
return [_$ssrElement("div", _$mergeProps({
|
|
473
474
|
get ["class"]() {
|
|
@@ -567,26 +568,29 @@ const AppWorkspaceSidebarItemStatus = props => {
|
|
|
567
568
|
}) : dot() ? workspaceMessages().sidebarNewActivity : "", props.mention ? workspaceMessages().sidebarMentioned : "", props.muted ? workspaceMessages().sidebarMuted : ""].filter(Boolean).join(", ");
|
|
568
569
|
// The unread slot stays reserved at the end, and the marks that change most
|
|
569
570
|
// often sit outermost, so new activity or a mention never moves another mark.
|
|
570
|
-
|
|
571
|
+
// The element itself stays when there is nothing to show: empty, it takes no
|
|
572
|
+
// space, and it still keeps the row's label on one line, so the first count
|
|
573
|
+
// never re-wraps the label and moves the rows below.
|
|
574
|
+
return _$ssr(_tmpl$21, _$ssrAttribute("data-unread", waiting() !== null ? _$escape(undefined, true) : count() ? "count" : dot() ? "dot" : _$escape(undefined, true), false) + _$ssrAttribute("data-waiting", waiting() === null ? _$escape(undefined, true) : waiting() ? "count" : "zero", false), _$escape(_$createComponent(Show, {
|
|
571
575
|
get when() {
|
|
572
576
|
return description();
|
|
573
577
|
},
|
|
574
578
|
get children() {
|
|
575
|
-
return _$
|
|
579
|
+
return [_$createComponent(Show, {
|
|
576
580
|
get when() {
|
|
577
581
|
return props.mention;
|
|
578
582
|
},
|
|
579
583
|
get children() {
|
|
580
584
|
return _$ssr(_tmpl$16);
|
|
581
585
|
}
|
|
582
|
-
})
|
|
586
|
+
}), _$createComponent(Show, {
|
|
583
587
|
get when() {
|
|
584
588
|
return props.muted;
|
|
585
589
|
},
|
|
586
590
|
get children() {
|
|
587
591
|
return _$ssr(_tmpl$17);
|
|
588
592
|
}
|
|
589
|
-
})
|
|
593
|
+
}), _$ssr(_tmpl$19, _$escape(_$createComponent(Show, {
|
|
590
594
|
get when() {
|
|
591
595
|
return count() || waiting() === 0;
|
|
592
596
|
},
|
|
@@ -596,16 +600,16 @@ const AppWorkspaceSidebarItemStatus = props => {
|
|
|
596
600
|
return dot();
|
|
597
601
|
},
|
|
598
602
|
get children() {
|
|
599
|
-
return _$ssr(_tmpl$
|
|
603
|
+
return _$ssr(_tmpl$22);
|
|
600
604
|
}
|
|
601
605
|
});
|
|
602
606
|
},
|
|
603
607
|
get children() {
|
|
604
608
|
return _$ssr(_tmpl$18, _$ssrAttribute("data-mention", props.mention ? "true" : _$escape(undefined, true), false), count() > 99 ? "99+" : _$escape(count()));
|
|
605
609
|
}
|
|
606
|
-
})), _$escape(description()));
|
|
610
|
+
}))), _$ssr(_tmpl$20, _$escape(description()))];
|
|
607
611
|
}
|
|
608
|
-
});
|
|
612
|
+
})));
|
|
609
613
|
};
|
|
610
614
|
/** Shared visual and semantic row frame for flat sidebar items and tree items. */
|
|
611
615
|
function AppWorkspaceSidebarRow(props) {
|
|
@@ -726,10 +730,11 @@ function AppWorkspaceSidebarItem(props) {
|
|
|
726
730
|
const actionSlot = createMemo(() => slots().find(slot => slot.kind === SIDEBAR_ITEM_ACTION));
|
|
727
731
|
const legacy = createMemo(() => values().filter(value => !sidebarItemSlot(value)));
|
|
728
732
|
const label = () => labelSlot()?.children ?? (legacy().length === 1 ? legacy()[0] : legacy());
|
|
733
|
+
const oneLine = () => !(labelSlot()?.marquee ?? (props.variant ?? "row") === "row");
|
|
729
734
|
const icon = () => iconSlot()?.icon ?? props.icon;
|
|
730
735
|
const iconContent = () => iconSlot()?.children;
|
|
731
|
-
// Resolved first, so
|
|
732
|
-
//
|
|
736
|
+
// Resolved first, so metadata that renders nothing leaves no empty slot. An
|
|
737
|
+
// empty status still renders its element; the stylesheet hides that slot.
|
|
733
738
|
const meta = children(() => metaSlot()?.children ?? props.meta);
|
|
734
739
|
const hasMeta = () => meta.toArray().some(Boolean);
|
|
735
740
|
const metaId = createUniqueId();
|
|
@@ -742,35 +747,35 @@ function AppWorkspaceSidebarItem(props) {
|
|
|
742
747
|
return iconContent() || icon();
|
|
743
748
|
},
|
|
744
749
|
get children() {
|
|
745
|
-
return _$ssr(_tmpl$
|
|
750
|
+
return _$ssr(_tmpl$23, _$escape(iconContent() ?? _$ssr(_tmpl$29, _$ssrAttribute("class", _$escape(iconClass(icon()), true), false))));
|
|
746
751
|
}
|
|
747
|
-
}), _$ssr(_tmpl$
|
|
752
|
+
}), _$ssr(_tmpl$27, _$escape(_$createComponent(Show, {
|
|
748
753
|
get when() {
|
|
749
754
|
return props.context || props.contextMeta;
|
|
750
755
|
},
|
|
751
756
|
get children() {
|
|
752
|
-
return _$ssr(_tmpl$
|
|
757
|
+
return _$ssr(_tmpl$25, _$escape(props.context), _$escape(_$createComponent(Show, {
|
|
753
758
|
get when() {
|
|
754
759
|
return props.contextMeta;
|
|
755
760
|
},
|
|
756
761
|
get children() {
|
|
757
|
-
return _$ssr(_tmpl$
|
|
762
|
+
return _$ssr(_tmpl$24, _$escape(props.contextMeta));
|
|
758
763
|
}
|
|
759
764
|
})));
|
|
760
765
|
}
|
|
761
|
-
})), _$ssrAttribute("data-
|
|
766
|
+
})), _$ssrAttribute("data-lines", oneLine() ? "1" : _$escape(undefined, true), false) + _$ssrAttribute("data-label", !oneLine() && typeof label() === "string" ? _$escape(label(), true) : _$escape(undefined, true), false), _$escape(label()), _$escape(_$createComponent(Show, {
|
|
762
767
|
get when() {
|
|
763
768
|
return props.description;
|
|
764
769
|
},
|
|
765
770
|
get children() {
|
|
766
|
-
return _$ssr(_tmpl$
|
|
771
|
+
return _$ssr(_tmpl$26, _$escape(props.description));
|
|
767
772
|
}
|
|
768
773
|
}))), _$createComponent(Show, {
|
|
769
774
|
get when() {
|
|
770
775
|
return hasMeta();
|
|
771
776
|
},
|
|
772
777
|
get children() {
|
|
773
|
-
return _$ssr(_tmpl$
|
|
778
|
+
return _$ssr(_tmpl$28, _$ssrAttribute("id", props.preview?.trigger === "row" ? _$escape(metaId, true) : _$escape(undefined, true), false) + _$ssrAttribute("data-visibility", metaVisibility() === "hover" ? "hover" : _$escape(undefined, true), false), _$escape(meta()));
|
|
774
779
|
}
|
|
775
780
|
})];
|
|
776
781
|
const singleAction = () => {
|
|
@@ -785,7 +790,7 @@ function AppWorkspaceSidebarItem(props) {
|
|
|
785
790
|
actionSlot()?.onSelect?.(event);
|
|
786
791
|
props.onActionClick?.(event);
|
|
787
792
|
};
|
|
788
|
-
const content = () => actionSlot()?.children ?? _$ssr(_tmpl$
|
|
793
|
+
const content = () => actionSlot()?.children ?? _$ssr(_tmpl$29, _$ssrAttribute("class", _$escape(iconClass(actionSlot()?.icon ?? props.actionIcon, "ti-dots"), true), false));
|
|
789
794
|
return _$createComponent(Show, {
|
|
790
795
|
get when() {
|
|
791
796
|
return Boolean(actionSlot() || props.actionIcon);
|
|
@@ -796,10 +801,10 @@ function AppWorkspaceSidebarItem(props) {
|
|
|
796
801
|
return _$memo(() => !!actionSlot()?.href)() && !actionSlot()?.disabled;
|
|
797
802
|
},
|
|
798
803
|
get fallback() {
|
|
799
|
-
return _$ssr(_tmpl$
|
|
804
|
+
return _$ssr(_tmpl$31, _$ssrAttribute("disabled", actionSlot()?.disabled, true) + _$ssrAttribute("data-visibility", actionSlot()?.visibility === "hover" ? "hover" : _$escape(undefined, true), false) + _$ssrAttribute("aria-label", _$escape(label(), true), false), _$escape(content()));
|
|
800
805
|
},
|
|
801
806
|
get children() {
|
|
802
|
-
return _$ssr(_tmpl$
|
|
807
|
+
return _$ssr(_tmpl$30, _$ssrAttribute("href", _$escape(actionSlot()?.href, true), false), _$ssrAttribute("data-visibility", actionSlot()?.visibility === "hover" ? "hover" : _$escape(undefined, true), false) + _$ssrAttribute("aria-label", _$escape(label(), true), false), _$escape(content()));
|
|
803
808
|
}
|
|
804
809
|
});
|
|
805
810
|
}
|
|
@@ -1105,31 +1110,31 @@ const AppWorkspaceNavTree = props => {
|
|
|
1105
1110
|
get ["data-k2b-nav-tree-toggle"]() {
|
|
1106
1111
|
return usesIconDisclosure() ? "" : undefined;
|
|
1107
1112
|
}
|
|
1108
|
-
}, () => iconAccessibility(item.iconLabel)), _$ssr(_tmpl$
|
|
1113
|
+
}, () => iconAccessibility(item.iconLabel)), _$ssr(_tmpl$29, _$ssrAttribute("class", _$escape(iconClass(rowIcon()), true), false)), false);
|
|
1109
1114
|
}
|
|
1110
1115
|
}), _$createComponent(Show, {
|
|
1111
1116
|
get when() {
|
|
1112
1117
|
return item.description !== undefined;
|
|
1113
1118
|
},
|
|
1114
1119
|
get fallback() {
|
|
1115
|
-
return _$ssr(_tmpl$
|
|
1120
|
+
return _$ssr(_tmpl$35, _$ssrAttribute("data-label", typeof item.label === "string" ? _$escape(item.label, true) : _$escape(undefined, true), false), _$escape(item.label));
|
|
1116
1121
|
},
|
|
1117
1122
|
get children() {
|
|
1118
|
-
return _$ssr(_tmpl$
|
|
1123
|
+
return _$ssr(_tmpl$32, _$ssrAttribute("data-label", typeof item.label === "string" ? _$escape(item.label, true) : _$escape(undefined, true), false), _$escape(item.label), _$escape(item.description));
|
|
1119
1124
|
}
|
|
1120
1125
|
}), _$createComponent(Show, {
|
|
1121
1126
|
get when() {
|
|
1122
1127
|
return item.meta !== undefined;
|
|
1123
1128
|
},
|
|
1124
1129
|
get children() {
|
|
1125
|
-
return _$ssr(_tmpl$
|
|
1130
|
+
return _$ssr(_tmpl$33, `k2b-app-workspace__sidebar-item-meta ${hasChildren() ? "" : "k2b-app-workspace__nav-tree-leaf-meta"}`, _$ssrAttribute("data-visibility", item.metaVisibility === "hover" ? "hover" : _$escape(undefined, true), false), _$escape(item.meta));
|
|
1126
1131
|
}
|
|
1127
1132
|
}), _$createComponent(Show, {
|
|
1128
1133
|
get when() {
|
|
1129
1134
|
return _$memo(() => !!hasChildren())() && !usesIconDisclosure();
|
|
1130
1135
|
},
|
|
1131
1136
|
get children() {
|
|
1132
|
-
return _$ssr(_tmpl$
|
|
1137
|
+
return _$ssr(_tmpl$34, `ti ${isExpanded(item.id) ? "ti-chevron-down" : "ti-chevron-right"}`);
|
|
1133
1138
|
}
|
|
1134
1139
|
})];
|
|
1135
1140
|
const row = () => _$createComponent(AppWorkspaceSidebarRow, {
|
|
@@ -1236,12 +1241,12 @@ const AppWorkspaceNavTree = props => {
|
|
|
1236
1241
|
endDrag();
|
|
1237
1242
|
requestMove(target.move, false);
|
|
1238
1243
|
};
|
|
1239
|
-
return _$ssr(_tmpl$
|
|
1244
|
+
return _$ssr(_tmpl$37, _$ssrAttribute("aria-level", _$escape(depth, true) + 1, false) + _$ssrAttribute("aria-setsize", _$escape(siblings().length, true), false) + _$ssrAttribute("aria-posinset", _$escape(place(), true) + 1, false) + _$ssrAttribute("aria-selected", _$escape(selected(), true), false) + _$ssrAttribute("aria-expanded", hasChildren() ? _$escape(isExpanded(item.id), true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-disabled", item.disabled ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("tabindex", item.disabled ? -1 : tabStopId() === item.id ? 0 : -1, false) + _$ssrAttribute("draggable", movable() ? _$escape(true, true) : _$escape(undefined, true), false) + _$ssrAttribute("data-k2b-nav-tree-id", _$escape(item.id, true), false) + _$ssrAttribute("data-k2b-nav-tree-parent-id", _$escape(parentId, true), false) + _$ssrAttribute("data-k2b-nav-tree-dragging", dragged()?.id === item.id ? "" : _$escape(undefined, true), false) + _$ssrAttribute("data-k2b-nav-tree-drop", dropTarget()?.id === item.id ? _$escape(dropTarget().side, true) : _$escape(undefined, true), false), _$ssrStyleProperty("--k2b-nav-tree-depth:", _$escape(String(props.indented === false ? 0 : depth), true)), _$escape(row()), _$escape(_$createComponent(Show, {
|
|
1240
1245
|
get when() {
|
|
1241
1246
|
return _$memo(() => !!hasChildren())() && isExpanded(item.id);
|
|
1242
1247
|
},
|
|
1243
1248
|
get children() {
|
|
1244
|
-
return _$ssr(_tmpl$
|
|
1249
|
+
return _$ssr(_tmpl$36, _$escape(renderItems(nested, depth + 1, item.id)));
|
|
1245
1250
|
}
|
|
1246
1251
|
})));
|
|
1247
1252
|
}
|
|
@@ -1266,7 +1271,7 @@ const AppWorkspaceNavTree = props => {
|
|
|
1266
1271
|
doc?.removeEventListener("pointermove", forgetDrag, true);
|
|
1267
1272
|
});
|
|
1268
1273
|
});
|
|
1269
|
-
return _$ssr(_tmpl$
|
|
1274
|
+
return _$ssr(_tmpl$38, `k2b-app-workspace__nav-tree ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("aria-label", _$escape(props.ariaLabel, true), false), _$escape(renderItems(roots, 0)));
|
|
1270
1275
|
};
|
|
1271
1276
|
AppWorkspaceNavTree.Item = AppWorkspaceNavTreeItem;
|
|
1272
1277
|
const AppWorkspaceSidebarIconGrid = props => _$ssrElement("section", _$mergeProps({
|
|
@@ -1278,9 +1283,9 @@ const AppWorkspaceSidebarIconGrid = props => _$ssrElement("section", _$mergeProp
|
|
|
1278
1283
|
return props.title;
|
|
1279
1284
|
},
|
|
1280
1285
|
children: title => _$ssr(_tmpl$14, _$escape(title()))
|
|
1281
|
-
})), _$ssr(_tmpl$
|
|
1286
|
+
})), _$ssr(_tmpl$39, _$ssrAttribute("data-columns", _$escape(props.columns ?? 2, true), false), _$escape(props.children))], false);
|
|
1282
1287
|
const AppWorkspaceSidebarIconAction = props => {
|
|
1283
|
-
const content = _$ssr(_tmpl$
|
|
1288
|
+
const content = _$ssr(_tmpl$40, _$ssrAttribute("class", _$escape(iconClass(props.icon), true), false));
|
|
1284
1289
|
const attrs = () => ({
|
|
1285
1290
|
class: `k2b-app-workspace__sidebar-icon-action ${props.active ? "is-active" : ""}`,
|
|
1286
1291
|
title: props.label,
|
|
@@ -1338,7 +1343,7 @@ function AppWorkspaceHead(props) {
|
|
|
1338
1343
|
const messages = useWorkspaceMessages();
|
|
1339
1344
|
// A nested workspace is part of a page that already shows its title.
|
|
1340
1345
|
const trail = props.nested ? () => undefined : usePageTrail();
|
|
1341
|
-
return _$ssr(_tmpl$
|
|
1346
|
+
return _$ssr(_tmpl$42, _$ssrAttribute("data-trail", trail()?.ancestors.length ? "up" : trail() ? "title" : _$escape(undefined, true), false), _$escape(_$createComponent(IconButton, {
|
|
1342
1347
|
"class": "k2b-app-workspace__head-toggle",
|
|
1343
1348
|
get label() {
|
|
1344
1349
|
return messages().showNavigation;
|
|
@@ -1349,7 +1354,7 @@ function AppWorkspaceHead(props) {
|
|
|
1349
1354
|
"aria-expanded": "false",
|
|
1350
1355
|
"data-app-workspace-sidebar-toggle": "",
|
|
1351
1356
|
get children() {
|
|
1352
|
-
return _$ssr(_tmpl$
|
|
1357
|
+
return _$ssr(_tmpl$41);
|
|
1353
1358
|
}
|
|
1354
1359
|
})), _$escape(_$createComponent(Show, {
|
|
1355
1360
|
get when() {
|
|
@@ -1361,7 +1366,7 @@ function AppWorkspaceHead(props) {
|
|
|
1361
1366
|
},
|
|
1362
1367
|
as: "p",
|
|
1363
1368
|
fallback: true
|
|
1364
|
-
}), _$ssr(_tmpl$
|
|
1369
|
+
}), _$ssr(_tmpl$43, _$ssrAttribute("data-k2b-server", isServer ? "" : _$escape(undefined, true), false), _$escape(current().title))]
|
|
1365
1370
|
})));
|
|
1366
1371
|
}
|
|
1367
1372
|
const AppWorkspace = props => {
|
|
@@ -1396,7 +1401,7 @@ const AppWorkspace = props => {
|
|
|
1396
1401
|
return _$createComponent(WorkspaceContext.Provider, {
|
|
1397
1402
|
value: workspace,
|
|
1398
1403
|
get children() {
|
|
1399
|
-
return _$ssr(_tmpl$
|
|
1404
|
+
return _$ssr(_tmpl$44, `k2b-app-workspace ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-mobile-surface", _$escape(props.mobileSurface, true), false) + _$ssrAttribute("data-flat", props.flat ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-sidebar-collapsed", initialLayoutState()?.sidebarCollapsed === undefined ? _$escape(undefined, true) : _$escape(String(initialLayoutState()?.sidebarCollapsed), true), false) + _$ssrAttribute("data-workspace-resizable", props.resizable === false ? "false" : "true", false), _$ssrStyle(appWorkspaceLayoutStyle(initialLayoutState())), _$escape(_$createComponent(AppWorkspaceHead, {
|
|
1400
1405
|
sidebarId: sidebarId,
|
|
1401
1406
|
nested: nested
|
|
1402
1407
|
})), _$escape(props.children));
|
|
@@ -1413,7 +1418,7 @@ AppWorkspace.LayoutStateProvider = props => _$createComponent(LayoutStateContext
|
|
|
1413
1418
|
return props.children;
|
|
1414
1419
|
}
|
|
1415
1420
|
});
|
|
1416
|
-
AppWorkspace.Content = props => _$ssr(_tmpl$
|
|
1421
|
+
AppWorkspace.Content = props => _$ssr(_tmpl$45, `k2b-app-workspace__content ${_$escape(props.class ?? "", true)}`, _$escape(props.children));
|
|
1417
1422
|
AppWorkspace.Main = AppWorkspaceMain;
|
|
1418
1423
|
AppWorkspace.MainPane = AppWorkspaceMainPane;
|
|
1419
1424
|
AppWorkspace.Detail = AppWorkspaceDetail;
|