@keepkit/ui 0.28.17 → 0.28.18
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 +196 -5
- package/dist/chunk-4O5N26YS.js +218 -0
- package/dist/chunk-4O5N26YS.js.map +1 -0
- package/dist/chunk-5ETQGHPV.js +307 -0
- package/dist/chunk-5ETQGHPV.js.map +1 -0
- package/dist/chunk-5SFHCUDA.js +200 -0
- package/dist/chunk-5SFHCUDA.js.map +1 -0
- package/dist/chunk-6753KF4D.js +357 -0
- package/dist/chunk-6753KF4D.js.map +1 -0
- package/dist/chunk-6JKG6SKJ.js +234 -0
- package/dist/chunk-6JKG6SKJ.js.map +1 -0
- package/dist/chunk-7DCSOVGM.js +23 -0
- package/dist/chunk-7DCSOVGM.js.map +1 -0
- package/dist/chunk-7DOB3Z6F.js +565 -0
- package/dist/chunk-7DOB3Z6F.js.map +1 -0
- package/dist/chunk-AQOSZ6AW.js +287 -0
- package/dist/chunk-AQOSZ6AW.js.map +1 -0
- package/dist/chunk-BJCZ7MFN.js +322 -0
- package/dist/chunk-BJCZ7MFN.js.map +1 -0
- package/dist/chunk-BW4SUJIX.js +135 -0
- package/dist/chunk-BW4SUJIX.js.map +1 -0
- package/dist/chunk-BYYWJGSN.js +220 -0
- package/dist/chunk-BYYWJGSN.js.map +1 -0
- package/dist/chunk-CIVXLU4D.js +111 -0
- package/dist/chunk-CIVXLU4D.js.map +1 -0
- package/dist/chunk-DMDBZJPO.js +37 -0
- package/dist/chunk-DMDBZJPO.js.map +1 -0
- package/dist/chunk-DQ5RMIU5.js +112 -0
- package/dist/chunk-DQ5RMIU5.js.map +1 -0
- package/dist/chunk-G2JWJKST.js +95 -0
- package/dist/chunk-G2JWJKST.js.map +1 -0
- package/dist/chunk-G76JVCNJ.js +55 -0
- package/dist/chunk-G76JVCNJ.js.map +1 -0
- package/dist/chunk-GZEFBTVD.js +37 -0
- package/dist/chunk-GZEFBTVD.js.map +1 -0
- package/dist/chunk-HFXB4S72.js +160 -0
- package/dist/chunk-HFXB4S72.js.map +1 -0
- package/dist/chunk-JJ4L5AKR.js +389 -0
- package/dist/chunk-JJ4L5AKR.js.map +1 -0
- package/dist/chunk-K2L44I7D.js +152 -0
- package/dist/chunk-K2L44I7D.js.map +1 -0
- package/dist/chunk-LKNVVPTN.js +210 -0
- package/dist/chunk-LKNVVPTN.js.map +1 -0
- package/dist/chunk-M3UORQXZ.js +2983 -0
- package/dist/chunk-M3UORQXZ.js.map +1 -0
- package/dist/chunk-M46GROWD.js +116 -0
- package/dist/chunk-M46GROWD.js.map +1 -0
- package/dist/chunk-MMGM7JIE.js +141 -0
- package/dist/chunk-MMGM7JIE.js.map +1 -0
- package/dist/chunk-NOPTRHRR.js +26 -0
- package/dist/chunk-NOPTRHRR.js.map +1 -0
- package/dist/chunk-NSYL6RSY.js +20 -0
- package/dist/chunk-NSYL6RSY.js.map +1 -0
- package/dist/chunk-NVFKN4NU.js +94 -0
- package/dist/chunk-NVFKN4NU.js.map +1 -0
- package/dist/chunk-P2WLTFPG.js +46 -0
- package/dist/chunk-P2WLTFPG.js.map +1 -0
- package/dist/chunk-PE57SLZO.js +798 -0
- package/dist/chunk-PE57SLZO.js.map +1 -0
- package/dist/chunk-PHFY6LQT.js +167 -0
- package/dist/chunk-PHFY6LQT.js.map +1 -0
- package/dist/chunk-PZHARNLY.js +208 -0
- package/dist/chunk-PZHARNLY.js.map +1 -0
- package/dist/chunk-Q6AFJL4Y.js +318 -0
- package/dist/chunk-Q6AFJL4Y.js.map +1 -0
- package/dist/chunk-Q7IEJ2YF.js +49 -0
- package/dist/chunk-Q7IEJ2YF.js.map +1 -0
- package/dist/chunk-QOCX37A5.js +69 -0
- package/dist/chunk-QOCX37A5.js.map +1 -0
- package/dist/chunk-RIWL3IPZ.js +46 -0
- package/dist/chunk-RIWL3IPZ.js.map +1 -0
- package/dist/chunk-RKYQGWKB.js +229 -0
- package/dist/chunk-RKYQGWKB.js.map +1 -0
- package/dist/chunk-SYLOO5TX.js +504 -0
- package/dist/chunk-SYLOO5TX.js.map +1 -0
- package/dist/chunk-URE4EGL2.js +206 -0
- package/dist/chunk-URE4EGL2.js.map +1 -0
- package/dist/chunk-VM4ROXYF.js +114 -0
- package/dist/chunk-VM4ROXYF.js.map +1 -0
- package/dist/chunk-VTPSR3LD.js +16 -0
- package/dist/chunk-VTPSR3LD.js.map +1 -0
- package/dist/chunk-WB6NBGC2.js +112 -0
- package/dist/chunk-WB6NBGC2.js.map +1 -0
- package/dist/chunk-XJFMMRQR.js +110 -0
- package/dist/chunk-XJFMMRQR.js.map +1 -0
- package/dist/chunk-XKWDO5VL.js +156 -0
- package/dist/chunk-XKWDO5VL.js.map +1 -0
- package/dist/chunk-XVOLYEUK.js +65 -0
- package/dist/chunk-XVOLYEUK.js.map +1 -0
- package/dist/chunk-YCUQ2YTP.js +169 -0
- package/dist/chunk-YCUQ2YTP.js.map +1 -0
- package/dist/chunk-ZCDLWGQV.js +140 -0
- package/dist/chunk-ZCDLWGQV.js.map +1 -0
- package/dist/collection-select-X6WKM--x.d.ts +25 -0
- package/dist/entries/active-filters-summary.d.ts +58 -0
- package/dist/entries/active-filters-summary.js +10 -0
- package/dist/entries/active-filters-summary.js.map +1 -0
- package/dist/entries/announcements.d.ts +4 -0
- package/dist/entries/announcements.js +11 -0
- package/dist/entries/announcements.js.map +1 -0
- package/dist/entries/announcer.d.ts +4 -0
- package/dist/entries/announcer.js +11 -0
- package/dist/entries/announcer.js.map +1 -0
- package/dist/entries/archive-button.d.ts +4 -0
- package/dist/entries/archive-button.js +9 -0
- package/dist/entries/archive-button.js.map +1 -0
- package/dist/entries/archive-scope-select.d.ts +13 -0
- package/dist/entries/archive-scope-select.js +9 -0
- package/dist/entries/archive-scope-select.js.map +1 -0
- package/dist/entries/archive-undo.d.ts +6 -0
- package/dist/entries/archive-undo.js +10 -0
- package/dist/entries/archive-undo.js.map +1 -0
- package/dist/entries/backup.d.ts +19 -0
- package/dist/entries/backup.js +10 -0
- package/dist/entries/backup.js.map +1 -0
- package/dist/entries/bulk-actions.d.ts +60 -0
- package/dist/entries/bulk-actions.js +12 -0
- package/dist/entries/bulk-actions.js.map +1 -0
- package/dist/entries/button.d.ts +21 -0
- package/dist/entries/button.js +10 -0
- package/dist/entries/button.js.map +1 -0
- package/dist/entries/collection-create.d.ts +19 -0
- package/dist/entries/collection-create.js +10 -0
- package/dist/entries/collection-create.js.map +1 -0
- package/dist/entries/collection-filter.d.ts +3 -0
- package/dist/entries/collection-filter.js +10 -0
- package/dist/entries/collection-filter.js.map +1 -0
- package/dist/entries/collection-manager.d.ts +29 -0
- package/dist/entries/collection-manager.js +12 -0
- package/dist/entries/collection-manager.js.map +1 -0
- package/dist/entries/collection-select.d.ts +3 -0
- package/dist/entries/collection-select.js +10 -0
- package/dist/entries/collection-select.js.map +1 -0
- package/dist/entries/collection.d.ts +11 -0
- package/dist/entries/collection.js +32 -0
- package/dist/entries/collection.js.map +1 -0
- package/dist/entries/empty-state.d.ts +17 -0
- package/dist/entries/empty-state.js +10 -0
- package/dist/entries/empty-state.js.map +1 -0
- package/dist/entries/error-boundary.d.ts +1 -0
- package/dist/entries/error-boundary.js +8 -0
- package/dist/entries/error-boundary.js.map +1 -0
- package/dist/entries/fallback-recovery.d.ts +12 -0
- package/dist/entries/fallback-recovery.js +9 -0
- package/dist/entries/fallback-recovery.js.map +1 -0
- package/dist/entries/floating-tour.d.ts +23 -0
- package/dist/entries/floating-tour.js +14 -0
- package/dist/entries/floating-tour.js.map +1 -0
- package/dist/entries/highlight.d.ts +2 -0
- package/dist/entries/highlight.js +8 -0
- package/dist/entries/highlight.js.map +1 -0
- package/dist/entries/inbox.d.ts +19 -0
- package/dist/entries/inbox.js +33 -0
- package/dist/entries/inbox.js.map +1 -0
- package/dist/entries/item-card-skeleton.d.ts +20 -0
- package/dist/entries/item-card-skeleton.js +8 -0
- package/dist/entries/item-card-skeleton.js.map +1 -0
- package/dist/entries/item-card.d.ts +412 -0
- package/dist/entries/item-card.js +17 -0
- package/dist/entries/item-card.js.map +1 -0
- package/dist/entries/item-checkbox.d.ts +14 -0
- package/dist/entries/item-checkbox.js +8 -0
- package/dist/entries/item-checkbox.js.map +1 -0
- package/dist/entries/item-status-badge.d.ts +13 -0
- package/dist/entries/item-status-badge.js +10 -0
- package/dist/entries/item-status-badge.js.map +1 -0
- package/dist/entries/kit-provider.d.ts +18 -0
- package/dist/entries/kit-provider.js +14 -0
- package/dist/entries/kit-provider.js.map +1 -0
- package/dist/entries/last-activity.d.ts +12 -0
- package/dist/entries/last-activity.js +9 -0
- package/dist/entries/last-activity.js.map +1 -0
- package/dist/entries/layout.d.ts +21 -0
- package/dist/entries/layout.js +9 -0
- package/dist/entries/layout.js.map +1 -0
- package/dist/entries/list.d.ts +11 -0
- package/dist/entries/list.js +23 -0
- package/dist/entries/list.js.map +1 -0
- package/dist/entries/navigator.d.ts +4 -0
- package/dist/entries/navigator.js +11 -0
- package/dist/entries/navigator.js.map +1 -0
- package/dist/entries/note-editor.d.ts +32 -0
- package/dist/entries/note-editor.js +11 -0
- package/dist/entries/note-editor.js.map +1 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +9 -0
- package/dist/entries/pagination.js.map +1 -0
- package/dist/entries/pin-button.d.ts +4 -0
- package/dist/entries/pin-button.js +9 -0
- package/dist/entries/pin-button.js.map +1 -0
- package/dist/entries/provider.d.ts +1 -0
- package/dist/entries/provider.js +8 -0
- package/dist/entries/provider.js.map +1 -0
- package/dist/entries/prune-stale-button.d.ts +3 -0
- package/dist/entries/prune-stale-button.js +12 -0
- package/dist/entries/prune-stale-button.js.map +1 -0
- package/dist/entries/quick-editor.d.ts +3 -0
- package/dist/entries/quick-editor.js +11 -0
- package/dist/entries/quick-editor.js.map +1 -0
- package/dist/entries/rediscovery-panel.d.ts +12 -0
- package/dist/entries/rediscovery-panel.js +24 -0
- package/dist/entries/rediscovery-panel.js.map +1 -0
- package/dist/entries/rediscovery.d.ts +12 -0
- package/dist/entries/rediscovery.js +24 -0
- package/dist/entries/rediscovery.js.map +1 -0
- package/dist/entries/reorderable-list.d.ts +35 -0
- package/dist/entries/reorderable-list.js +10 -0
- package/dist/entries/reorderable-list.js.map +1 -0
- package/dist/entries/save-popover.d.ts +39 -0
- package/dist/entries/save-popover.js +15 -0
- package/dist/entries/save-popover.js.map +1 -0
- package/dist/entries/save-view-button.d.ts +3 -0
- package/dist/entries/save-view-button.js +9 -0
- package/dist/entries/save-view-button.js.map +1 -0
- package/dist/entries/saved-views.d.ts +3 -0
- package/dist/entries/saved-views.js +9 -0
- package/dist/entries/saved-views.js.map +1 -0
- package/dist/entries/search-input.d.ts +3 -0
- package/dist/entries/search-input.js +9 -0
- package/dist/entries/search-input.js.map +1 -0
- package/dist/entries/shortcut-hint.d.ts +11 -0
- package/dist/entries/shortcut-hint.js +8 -0
- package/dist/entries/shortcut-hint.js.map +1 -0
- package/dist/entries/sort-select.d.ts +3 -0
- package/dist/entries/sort-select.js +9 -0
- package/dist/entries/sort-select.js.map +1 -0
- package/dist/entries/stale-notice.d.ts +3 -0
- package/dist/entries/stale-notice.js +12 -0
- package/dist/entries/stale-notice.js.map +1 -0
- package/dist/entries/status.d.ts +4 -0
- package/dist/entries/status.js +11 -0
- package/dist/entries/status.js.map +1 -0
- package/dist/entries/sync-recovery-dialog.d.ts +18 -0
- package/dist/entries/sync-recovery-dialog.js +11 -0
- package/dist/entries/sync-recovery-dialog.js.map +1 -0
- package/dist/entries/sync-status-banner.d.ts +12 -0
- package/dist/entries/sync-status-banner.js +10 -0
- package/dist/entries/sync-status-banner.js.map +1 -0
- package/dist/entries/tag-editor.d.ts +22 -0
- package/dist/entries/tag-editor.js +10 -0
- package/dist/entries/tag-editor.js.map +1 -0
- package/dist/entries/tag-filter.d.ts +33 -0
- package/dist/entries/tag-filter.js +10 -0
- package/dist/entries/tag-filter.js.map +1 -0
- package/dist/entries/theme-provider.d.ts +2 -0
- package/dist/entries/theme-provider.js +9 -0
- package/dist/entries/theme-provider.js.map +1 -0
- package/dist/entries/tour-bar.d.ts +4 -0
- package/dist/entries/tour-bar.js +11 -0
- package/dist/entries/tour-bar.js.map +1 -0
- package/dist/entries/tour-provider.d.ts +3 -0
- package/dist/entries/tour-provider.js +8 -0
- package/dist/entries/tour-provider.js.map +1 -0
- package/dist/entries/ui-provider.d.ts +5 -0
- package/dist/entries/ui-provider.js +8 -0
- package/dist/entries/ui-provider.js.map +1 -0
- package/dist/entries/undo.d.ts +11 -0
- package/dist/entries/undo.js +10 -0
- package/dist/entries/undo.js.map +1 -0
- package/dist/entries/workspace.d.ts +59 -0
- package/dist/entries/workspace.js +37 -0
- package/dist/entries/workspace.js.map +1 -0
- package/dist/highlight-BFeqa6kU.d.ts +40 -0
- package/dist/index.d.ts +63 -1409
- package/dist/index.js +198 -10271
- package/dist/index.js.map +1 -1
- package/dist/list-C350Dche.d.ts +141 -0
- package/dist/pin-button-DK3j0atw.d.ts +27 -0
- package/dist/quick-editor-BpsvwjQS.d.ts +61 -0
- package/dist/rediscovery-F5gTtPUz.d.ts +20 -0
- package/dist/saved-views-BXIyAVBn.d.ts +14 -0
- package/dist/sort-select-DBlR6ubA.d.ts +40 -0
- package/dist/stale-notice-DczSweyn.d.ts +24 -0
- package/dist/status-xiIQ206y.d.ts +31 -0
- package/dist/styles/base.css +87 -55
- package/dist/styles/collection.css +1 -0
- package/dist/tailwind.css +0 -30
- package/dist/theme-provider-DFMkjkmm.d.ts +37 -0
- package/dist/tour-bar-iiXvVYE8.d.ts +51 -0
- package/dist/tour-provider-BqhPK2vS.d.ts +40 -0
- package/dist/ui-context-BE201rLI.d.ts +70 -0
- package/dist/ui-provider-Bqziw03k.d.ts +7 -0
- package/package.json +226 -2
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
// src/foundation/shared.tsx
|
|
2
|
+
import {
|
|
3
|
+
cloneElement,
|
|
4
|
+
createContext,
|
|
5
|
+
Fragment,
|
|
6
|
+
isValidElement,
|
|
7
|
+
useContext,
|
|
8
|
+
useMemo
|
|
9
|
+
} from "react";
|
|
10
|
+
import { Fragment as Fragment2, jsx } from "react/jsx-runtime";
|
|
11
|
+
var KeepSearchQueryContext = createContext(void 0);
|
|
12
|
+
function KeepSearchQueryProvider({ query, children }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(KeepSearchQueryContext.Provider, { value: query, children });
|
|
14
|
+
}
|
|
15
|
+
function useKeepSearchQuery() {
|
|
16
|
+
return useContext(KeepSearchQueryContext);
|
|
17
|
+
}
|
|
18
|
+
function KeepHighlight({ children, query }) {
|
|
19
|
+
const contextQuery = useKeepSearchQuery();
|
|
20
|
+
const resolvedQuery = query ?? contextQuery;
|
|
21
|
+
const normalizedQuery = resolvedQuery?.trim() ?? "";
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
if (typeof children !== "string" || !normalizedQuery) return children ?? null;
|
|
24
|
+
return highlightText(children, normalizedQuery);
|
|
25
|
+
}, [children, normalizedQuery]);
|
|
26
|
+
}
|
|
27
|
+
function highlightText(text, query) {
|
|
28
|
+
const normalizedQuery = query.trim();
|
|
29
|
+
if (!normalizedQuery) return text;
|
|
30
|
+
const matcher = new RegExp(escapeRegExp(normalizedQuery), "gi");
|
|
31
|
+
const parts = [];
|
|
32
|
+
let lastIndex = 0;
|
|
33
|
+
let matchIndex = 0;
|
|
34
|
+
while (true) {
|
|
35
|
+
const match = matcher.exec(text);
|
|
36
|
+
if (match === null) break;
|
|
37
|
+
const index = match.index;
|
|
38
|
+
if (index > lastIndex) parts.push(text.slice(lastIndex, index));
|
|
39
|
+
parts.push(
|
|
40
|
+
/* @__PURE__ */ jsx("mark", { className: "keep-highlight", "data-highlight": "true", children: match[0] }, `highlight-${matchIndex}`)
|
|
41
|
+
);
|
|
42
|
+
lastIndex = index + match[0].length;
|
|
43
|
+
matchIndex += 1;
|
|
44
|
+
}
|
|
45
|
+
if (lastIndex === 0) return text;
|
|
46
|
+
if (lastIndex < text.length) parts.push(text.slice(lastIndex));
|
|
47
|
+
return /* @__PURE__ */ jsx(Fragment2, { children: parts });
|
|
48
|
+
}
|
|
49
|
+
function escapeRegExp(value) {
|
|
50
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
51
|
+
}
|
|
52
|
+
function toKeepButtonItem(item) {
|
|
53
|
+
return {
|
|
54
|
+
id: item.id,
|
|
55
|
+
meta: item.meta,
|
|
56
|
+
targetType: item.targetType,
|
|
57
|
+
note: item.note,
|
|
58
|
+
tags: item.tags,
|
|
59
|
+
archived: item.archived,
|
|
60
|
+
pinned: item.pinned,
|
|
61
|
+
collectionId: item.collectionId
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function getMetaTitle(meta) {
|
|
65
|
+
if (typeof meta !== "object" || meta === null || !("title" in meta)) return void 0;
|
|
66
|
+
const title = meta.title;
|
|
67
|
+
return typeof title === "string" && title.trim() ? title.trim() : void 0;
|
|
68
|
+
}
|
|
69
|
+
function getErrorMessage(error, fallback) {
|
|
70
|
+
return error instanceof Error ? error.message : fallback;
|
|
71
|
+
}
|
|
72
|
+
function normalizeUiTags(tags) {
|
|
73
|
+
return [...new Set(tags.map((tag) => tag.trim()).filter(Boolean))];
|
|
74
|
+
}
|
|
75
|
+
function sortToValue(sort) {
|
|
76
|
+
return `${sort?.by ?? "updatedAt"}:${sort?.direction ?? "desc"}`;
|
|
77
|
+
}
|
|
78
|
+
function resolveContent(content, state) {
|
|
79
|
+
return typeof content === "function" ? content(state) : content;
|
|
80
|
+
}
|
|
81
|
+
function hasRenderableContent(content) {
|
|
82
|
+
if (content === null || content === void 0 || typeof content === "boolean") return false;
|
|
83
|
+
if (typeof content === "string") return content.length > 0;
|
|
84
|
+
if (Array.isArray(content)) return content.some(hasRenderableContent);
|
|
85
|
+
if (isValidElement(content) && content.type === Fragment) {
|
|
86
|
+
return hasRenderableContent(content.props.children);
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
function composeRefs(...refs) {
|
|
91
|
+
return (value) => {
|
|
92
|
+
for (const ref of refs) {
|
|
93
|
+
if (typeof ref === "function") {
|
|
94
|
+
ref(value);
|
|
95
|
+
} else if (ref !== null && ref !== void 0) {
|
|
96
|
+
ref.current = value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function chainedFunction(childHandler, parentHandler) {
|
|
102
|
+
if (!childHandler) return parentHandler;
|
|
103
|
+
if (!parentHandler) return childHandler;
|
|
104
|
+
return ((...args) => {
|
|
105
|
+
childHandler(...args);
|
|
106
|
+
parentHandler(...args);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function mergeProps(childProps, parentProps) {
|
|
110
|
+
const merged = { ...parentProps, ...childProps };
|
|
111
|
+
if ("ref" in childProps || "ref" in parentProps) {
|
|
112
|
+
merged.ref = composeRefs(
|
|
113
|
+
childProps.ref,
|
|
114
|
+
parentProps.ref
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
const className = mergeClassNames(childProps.className, parentProps.className);
|
|
118
|
+
if (className) merged.className = className;
|
|
119
|
+
const style = mergeStyles(childProps.style, parentProps.style);
|
|
120
|
+
if (style) merged.style = style;
|
|
121
|
+
for (const key of Object.keys(parentProps)) {
|
|
122
|
+
if (!isEventProp(key)) continue;
|
|
123
|
+
const chained = chainedFunction(getHandler(childProps[key]), getHandler(parentProps[key]));
|
|
124
|
+
if (chained) merged[key] = chained;
|
|
125
|
+
}
|
|
126
|
+
for (const [key, value] of Object.entries(merged)) {
|
|
127
|
+
if (value === void 0 && key.startsWith("aria-") && childProps[key] !== void 0) {
|
|
128
|
+
merged[key] = childProps[key];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return merged;
|
|
132
|
+
}
|
|
133
|
+
function getHandler(value) {
|
|
134
|
+
return typeof value === "function" ? value : void 0;
|
|
135
|
+
}
|
|
136
|
+
function isEventProp(key) {
|
|
137
|
+
return key.startsWith("on") && key.length > 2 && key[2] === key[2]?.toUpperCase();
|
|
138
|
+
}
|
|
139
|
+
function mergeClassNames(childClassName, parentClassName) {
|
|
140
|
+
const values = [childClassName, parentClassName].filter(
|
|
141
|
+
(value) => typeof value === "string" && Boolean(value)
|
|
142
|
+
);
|
|
143
|
+
return values.length > 0 ? values.join(" ") : void 0;
|
|
144
|
+
}
|
|
145
|
+
function mergeStyles(childStyle, parentStyle) {
|
|
146
|
+
if (!childStyle && !parentStyle) return void 0;
|
|
147
|
+
return {
|
|
148
|
+
...isObject(childStyle) ? childStyle : {},
|
|
149
|
+
...isObject(parentStyle) ? parentStyle : {}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function isObject(value) {
|
|
153
|
+
return typeof value === "object" && value !== null;
|
|
154
|
+
}
|
|
155
|
+
function createSlot(child, props, body) {
|
|
156
|
+
const nextProps = body === void 0 ? props : { ...props, children: body };
|
|
157
|
+
return cloneElement(child, mergeProps(child.props, nextProps));
|
|
158
|
+
}
|
|
159
|
+
function renderRoot(asChild, child, props, body, componentName) {
|
|
160
|
+
if (asChild) {
|
|
161
|
+
if (!isValidElement(child)) throw new Error(`${componentName} with asChild requires a single React element child.`);
|
|
162
|
+
return createSlot(child, props, body);
|
|
163
|
+
}
|
|
164
|
+
return /* @__PURE__ */ jsx("div", { ...props, children: body });
|
|
165
|
+
}
|
|
166
|
+
var UndoUnavailableError = class extends Error {
|
|
167
|
+
};
|
|
168
|
+
function copyQueryValue(value) {
|
|
169
|
+
if (value instanceof Date) return new Date(value.getTime());
|
|
170
|
+
if (Array.isArray(value)) return value.map(copyQueryValue);
|
|
171
|
+
if (value && typeof value === "object") {
|
|
172
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, copyQueryValue(entry)]));
|
|
173
|
+
}
|
|
174
|
+
return value;
|
|
175
|
+
}
|
|
176
|
+
function equalQueryValue(left, right) {
|
|
177
|
+
if (Object.is(left, right)) return true;
|
|
178
|
+
if (left instanceof Date || right instanceof Date) {
|
|
179
|
+
return left instanceof Date && right instanceof Date && Object.is(left.getTime(), right.getTime());
|
|
180
|
+
}
|
|
181
|
+
if (!left || !right || typeof left !== "object" || typeof right !== "object") return false;
|
|
182
|
+
const leftEntries = Object.entries(left);
|
|
183
|
+
const rightEntries = Object.entries(right);
|
|
184
|
+
return leftEntries.length === rightEntries.length && leftEntries.every(
|
|
185
|
+
([key, value]) => Object.getOwnPropertyDescriptor(right, key) !== void 0 && equalQueryValue(value, Reflect.get(right, key))
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export {
|
|
190
|
+
KeepSearchQueryProvider,
|
|
191
|
+
useKeepSearchQuery,
|
|
192
|
+
KeepHighlight,
|
|
193
|
+
highlightText,
|
|
194
|
+
toKeepButtonItem,
|
|
195
|
+
getMetaTitle,
|
|
196
|
+
getErrorMessage,
|
|
197
|
+
normalizeUiTags,
|
|
198
|
+
sortToValue,
|
|
199
|
+
resolveContent,
|
|
200
|
+
hasRenderableContent,
|
|
201
|
+
composeRefs,
|
|
202
|
+
chainedFunction,
|
|
203
|
+
mergeProps,
|
|
204
|
+
createSlot,
|
|
205
|
+
renderRoot,
|
|
206
|
+
UndoUnavailableError,
|
|
207
|
+
copyQueryValue,
|
|
208
|
+
equalQueryValue
|
|
209
|
+
};
|
|
210
|
+
//# sourceMappingURL=chunk-LKNVVPTN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/foundation/shared.tsx"],"sourcesContent":["\"use client\";\n\nimport type { KeepItem, KeepItemInput, KeepListQuery } from \"@keepkit/core/core\";\nimport {\n type ComponentType,\n cloneElement,\n createContext,\n Fragment,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n type RefCallback,\n useContext,\n useMemo,\n} from \"react\";\n\nexport type RenderProp<TState> = (state: TState) => ReactNode;\n\nconst KeepSearchQueryContext = createContext<string | undefined>(undefined);\n\ntype KeepSearchQueryProviderProps = {\n query: string | undefined;\n children: ReactNode;\n};\n\nexport function KeepSearchQueryProvider({ query, children }: KeepSearchQueryProviderProps) {\n return <KeepSearchQueryContext.Provider value={query}>{children}</KeepSearchQueryContext.Provider>;\n}\n\nexport function useKeepSearchQuery(): string | undefined {\n return useContext(KeepSearchQueryContext);\n}\n\nexport type KeepHighlightProps = {\n children?: ReactNode;\n query?: string;\n};\n\n/** Wraps case-insensitive, literal query matches in a style-free mark element. */\nexport function KeepHighlight({ children, query }: KeepHighlightProps): ReactNode {\n const contextQuery = useKeepSearchQuery();\n const resolvedQuery = query ?? contextQuery;\n const normalizedQuery = resolvedQuery?.trim() ?? \"\";\n return useMemo(() => {\n if (typeof children !== \"string\" || !normalizedQuery) return children ?? null;\n return highlightText(children, normalizedQuery);\n }, [children, normalizedQuery]);\n}\n\nexport function highlightText(text: string, query: string): ReactNode {\n const normalizedQuery = query.trim();\n if (!normalizedQuery) return text;\n const matcher = new RegExp(escapeRegExp(normalizedQuery), \"gi\");\n const parts: ReactNode[] = [];\n let lastIndex = 0;\n let matchIndex = 0;\n\n while (true) {\n const match = matcher.exec(text);\n if (match === null) break;\n const index = match.index;\n if (index > lastIndex) parts.push(text.slice(lastIndex, index));\n parts.push(\n <mark key={`highlight-${matchIndex}`} className=\"keep-highlight\" data-highlight=\"true\">\n {match[0]}\n </mark>,\n );\n lastIndex = index + match[0].length;\n matchIndex += 1;\n }\n if (lastIndex === 0) return text;\n if (lastIndex < text.length) parts.push(text.slice(lastIndex));\n return <>{parts}</>;\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nexport type KeepButtonLabels = {\n saved?: ReactNode;\n unsaved?: ReactNode;\n loading?: ReactNode;\n error?: ReactNode;\n savedAriaLabel?: string;\n unsavedAriaLabel?: string;\n};\n\nexport type KeepButtonIconProps = { \"aria-hidden\"?: boolean; className?: string };\nexport type KeepButtonIcon = ReactNode | ComponentType<KeepButtonIconProps>;\nexport type KeepButtonIcons = {\n save?: KeepButtonIcon;\n saved?: KeepButtonIcon;\n remove?: KeepButtonIcon;\n loading?: KeepButtonIcon;\n error?: KeepButtonIcon;\n};\n\nexport type KeepImageProps = ImgHTMLAttributes<HTMLImageElement> & {\n src: string;\n alt: string;\n};\n\nexport function toKeepButtonItem<TMeta>(item: KeepItem<TMeta>): KeepItemInput<TMeta> {\n return {\n id: item.id,\n meta: item.meta,\n targetType: item.targetType,\n note: item.note,\n tags: item.tags,\n archived: item.archived,\n pinned: item.pinned,\n collectionId: item.collectionId,\n };\n}\n\nexport function getMetaTitle<TMeta>(meta: TMeta): string | undefined {\n if (typeof meta !== \"object\" || meta === null || !(\"title\" in meta)) return undefined;\n const title = (meta as { title?: unknown }).title;\n return typeof title === \"string\" && title.trim() ? title.trim() : undefined;\n}\n\nexport function getErrorMessage(error: unknown, fallback: string): string {\n return error instanceof Error ? error.message : fallback;\n}\n\nexport function normalizeUiTags(tags: readonly string[]): string[] {\n return [...new Set(tags.map((tag) => tag.trim()).filter(Boolean))];\n}\n\nexport function sortToValue(\n sort: KeepListQuery[\"sort\"],\n): `${\"savedAt\" | \"updatedAt\" | \"lastOpenedAt\"}:${\"asc\" | \"desc\"}` {\n return `${sort?.by ?? \"updatedAt\"}:${sort?.direction ?? \"desc\"}`;\n}\n\nexport function resolveContent<TState>(content: ReactNode | RenderProp<TState>, state: TState): ReactNode {\n return typeof content === \"function\" ? content(state) : content;\n}\n\nexport function hasRenderableContent(content: ReactNode): boolean {\n if (content === null || content === undefined || typeof content === \"boolean\") return false;\n if (typeof content === \"string\") return content.length > 0;\n if (Array.isArray(content)) return content.some(hasRenderableContent);\n if (isValidElement<{ children?: ReactNode }>(content) && content.type === Fragment) {\n return hasRenderableContent(content.props.children);\n }\n return true;\n}\n\ntype MergeableProps = Record<string, unknown>;\n\n/** Combines callback and object refs while preserving every ref target. */\nexport function composeRefs<T>(...refs: Array<Ref<T> | null | undefined>): RefCallback<T> {\n return (value) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n }\n };\n}\n\n/** Chains child and component event handlers while preserving both handlers' event order. */\nexport function chainedFunction<T extends (...args: never[]) => unknown>(\n childHandler: T | undefined,\n parentHandler: T | undefined,\n): T | undefined {\n if (!childHandler) return parentHandler;\n if (!parentHandler) return childHandler;\n return ((...args: never[]) => {\n childHandler(...args);\n parentHandler(...args);\n }) as T;\n}\n\n/** Merges slot props without dropping child classes, styles, ARIA attributes, or events. */\nexport function mergeProps<T extends MergeableProps>(childProps: T, parentProps: Partial<T> & MergeableProps): T {\n const merged: MergeableProps = { ...parentProps, ...childProps };\n if (\"ref\" in childProps || \"ref\" in parentProps) {\n merged.ref = composeRefs(\n childProps.ref as Ref<never> | null | undefined,\n parentProps.ref as Ref<never> | null | undefined,\n );\n }\n const className = mergeClassNames(childProps.className, parentProps.className);\n if (className) merged.className = className;\n const style = mergeStyles(childProps.style, parentProps.style);\n if (style) merged.style = style;\n\n for (const key of Object.keys(parentProps)) {\n if (!isEventProp(key)) continue;\n const chained = chainedFunction(getHandler(childProps[key]), getHandler(parentProps[key]));\n if (chained) merged[key] = chained;\n }\n\n for (const [key, value] of Object.entries(merged)) {\n if (value === undefined && key.startsWith(\"aria-\") && childProps[key] !== undefined) {\n merged[key] = childProps[key];\n }\n }\n return merged as T;\n}\n\nfunction getHandler(value: unknown): ((...args: never[]) => unknown) | undefined {\n return typeof value === \"function\" ? (value as (...args: never[]) => unknown) : undefined;\n}\n\nfunction isEventProp(key: string): boolean {\n return key.startsWith(\"on\") && key.length > 2 && key[2] === key[2]?.toUpperCase();\n}\n\nfunction mergeClassNames(childClassName: unknown, parentClassName: unknown): string | undefined {\n const values = [childClassName, parentClassName].filter(\n (value): value is string => typeof value === \"string\" && Boolean(value),\n );\n return values.length > 0 ? values.join(\" \") : undefined;\n}\n\nfunction mergeStyles(childStyle: unknown, parentStyle: unknown): Record<string, unknown> | undefined {\n if (!childStyle && !parentStyle) return undefined;\n return {\n ...(isObject(childStyle) ? childStyle : {}),\n ...(isObject(parentStyle) ? parentStyle : {}),\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\nexport function createSlot(\n child: ReactElement<MergeableProps>,\n props: MergeableProps,\n body?: ReactNode,\n): ReactElement<MergeableProps> {\n const nextProps = body === undefined ? props : { ...props, children: body };\n return cloneElement(child, mergeProps(child.props, nextProps));\n}\n\nexport function renderRoot(\n asChild: boolean,\n child: ReactNode,\n props: HTMLAttributes<HTMLElement> & Record<string, unknown>,\n body: ReactNode,\n componentName: string,\n): ReactElement {\n if (asChild) {\n if (!isValidElement(child)) throw new Error(`${componentName} with asChild requires a single React element child.`);\n return createSlot(child as ReactElement<MergeableProps>, props, body);\n }\n return <div {...props}>{body}</div>;\n}\nexport class UndoUnavailableError extends Error {}\n\nexport function copyQueryValue(value: unknown): unknown {\n if (value instanceof Date) return new Date(value.getTime());\n if (Array.isArray(value)) return value.map(copyQueryValue);\n if (value && typeof value === \"object\") {\n return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, copyQueryValue(entry)]));\n }\n return value;\n}\n\nexport function equalQueryValue(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true;\n if (left instanceof Date || right instanceof Date) {\n return left instanceof Date && right instanceof Date && Object.is(left.getTime(), right.getTime());\n }\n if (!left || !right || typeof left !== \"object\" || typeof right !== \"object\") return false;\n const leftEntries = Object.entries(left);\n const rightEntries = Object.entries(right);\n return (\n leftEntries.length === rightEntries.length &&\n leftEntries.every(\n ([key, value]) =>\n Object.getOwnPropertyDescriptor(right, key) !== undefined && equalQueryValue(value, Reflect.get(right, key)),\n )\n );\n}\n"],"mappings":";AAGA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AAYE,SA8CA,YAAAA,WA9CA;AART,IAAM,yBAAyB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