@notis_ai/cli 0.2.6 → 0.2.8
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 +17 -0
- package/dist/scaffolds/notis-database/app/page.tsx +38 -41
- package/dist/scaffolds/notis-database/lib/types.ts +5 -7
- package/dist/scaffolds/notis-database/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-4.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-5.png +0 -0
- package/dist/scaffolds/notis-database/metadata/screenshot-fixtures.json +1839 -0
- package/dist/scaffolds/notis-database/notis.config.ts +48 -1
- package/dist/scaffolds/notis-database/package-lock.json +3935 -0
- package/dist/scaffolds/notis-database/package.json +2 -1
- package/dist/scaffolds/notis-database/packages/sdk/package.json +36 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/components/DocumentEditor.tsx +93 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/components/Markdown.tsx +60 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/components/MultiSelectActionBar.tsx +278 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/components/MultiSelectCheckbox.tsx +91 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/config.ts +196 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/documents.ts +229 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useBackend.ts +41 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useDatabaseSchema.ts +85 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useDocument.ts +78 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useDocuments.ts +121 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useMultiSelect.ts +539 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useNotis.ts +34 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useNotisNavigation.ts +49 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useTool.ts +64 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useTools.ts +56 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useTopBarSearch.ts +73 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/index.ts +83 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/provider.tsx +43 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/runtime.ts +220 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/styles.css +186 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/ui.ts +15 -0
- package/dist/scaffolds/notis-database/packages/sdk/src/vite.ts +56 -0
- package/dist/scaffolds/notis-database/packages/sdk/tsconfig.json +15 -0
- package/dist/scaffolds/notis-database/src/mock-runtime.ts +4 -1
- package/dist/scaffolds/notis-journal/CHANGELOG.md +4 -0
- package/dist/scaffolds/notis-journal/app/page.tsx +1 -0
- package/dist/scaffolds/notis-journal/package-lock.json +4615 -0
- package/dist/scaffolds/notis-journal/package.json +2 -2
- package/dist/scaffolds/notis-journal/packages/sdk/src/config.ts +52 -1
- package/dist/scaffolds/notis-notes/app/page.tsx +39 -46
- package/dist/scaffolds/notis-notes/app/phosphor-icons.ts +596 -0
- package/dist/scaffolds/notis-notes/lib/visible-properties.ts +144 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-4.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-5.png +0 -0
- package/dist/scaffolds/notis-notes/metadata/screenshot-fixtures.json +752 -0
- package/dist/scaffolds/notis-notes/notis.config.ts +48 -3
- package/dist/scaffolds/notis-notes/package-lock.json +4636 -0
- package/dist/scaffolds/notis-notes/package.json +7 -3
- package/dist/scaffolds/notis-notes/packages/sdk/package.json +36 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/components/DocumentEditor.tsx +93 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/components/Markdown.tsx +60 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/components/MultiSelectActionBar.tsx +278 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/components/MultiSelectCheckbox.tsx +91 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/config.ts +196 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/documents.ts +229 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useBackend.ts +41 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useDatabaseSchema.ts +85 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useDocument.ts +78 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useDocuments.ts +121 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useMultiSelect.ts +539 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useNotis.ts +34 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useNotisNavigation.ts +49 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useTool.ts +64 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useTools.ts +56 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useTopBarSearch.ts +73 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/index.ts +83 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/provider.tsx +43 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/runtime.ts +220 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/styles.css +186 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/ui.ts +15 -0
- package/dist/scaffolds/notis-notes/packages/sdk/src/vite.ts +56 -0
- package/dist/scaffolds/notis-notes/packages/sdk/tsconfig.json +15 -0
- package/dist/scaffolds/notis-random/CHANGELOG.md +12 -2
- package/dist/scaffolds/notis-random/app/history/page.tsx +5 -4
- package/dist/scaffolds/notis-random/app/page.tsx +141 -74
- package/dist/scaffolds/notis-random/components/ui/button.tsx +50 -0
- package/dist/scaffolds/notis-random/components/ui/card.tsx +16 -0
- package/dist/scaffolds/notis-random/components/ui/input.tsx +23 -0
- package/dist/scaffolds/notis-random/components.json +20 -0
- package/dist/scaffolds/notis-random/lib/notis-tools.ts +26 -7
- package/dist/scaffolds/notis-random/lib/rng.ts +179 -19
- package/dist/scaffolds/notis-random/lib/roll-record.ts +103 -16
- package/dist/scaffolds/notis-random/metadata/screenshot-1.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-2.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-3.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-4.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-5.png +0 -0
- package/dist/scaffolds/notis-random/metadata/screenshot-fixtures.json +753 -0
- package/dist/scaffolds/notis-random/notis.config.ts +47 -3
- package/dist/scaffolds/notis-random/package-lock.json +4513 -0
- package/dist/scaffolds/notis-random/package.json +6 -2
- package/dist/scaffolds/notis-random/packages/sdk/package.json +36 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/components/DocumentEditor.tsx +93 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/components/Markdown.tsx +60 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/components/MultiSelectActionBar.tsx +278 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/components/MultiSelectCheckbox.tsx +91 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/components/MultiSelectDragOverlay.tsx +39 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/config.ts +196 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/documents.ts +229 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useBackend.ts +41 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useDatabaseSchema.ts +85 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useDocument.ts +78 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useDocuments.ts +121 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useMultiSelect.ts +539 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useNotis.ts +34 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useNotisNavigation.ts +49 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useTool.ts +64 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useTools.ts +56 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useTopBarSearch.ts +73 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/hooks/useUpsertDocument.ts +95 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/index.ts +83 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/provider.tsx +43 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/runtime.ts +220 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/styles.css +186 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/ui.ts +15 -0
- package/dist/scaffolds/notis-random/packages/sdk/src/vite.ts +56 -0
- package/dist/scaffolds/notis-random/packages/sdk/tsconfig.json +15 -0
- package/dist/scaffolds/notis-random/tailwind.config.ts +8 -1
- package/dist/scaffolds.json +8 -6
- package/package.json +2 -1
- package/skills/notis-apps/SKILL.md +449 -144
- package/skills/notis-apps/cli.md +15 -0
- package/skills/notis-cli/SKILL.md +8 -4
- package/skills/notis-onboarding/BRIEF.md +93 -0
- package/src/cli.js +52 -7
- package/src/command-specs/apps.js +154 -21
- package/src/command-specs/diagnostics.js +674 -0
- package/src/command-specs/helpers.js +4 -1
- package/src/command-specs/index.js +8 -0
- package/src/command-specs/onboarding.js +216 -0
- package/src/command-specs/smoke.js +386 -0
- package/src/command-specs/tools.js +189 -5
- package/src/runtime/app-platform.js +65 -4
- package/src/runtime/desktop-auth.js +66 -17
- package/src/runtime/errors.js +1 -0
- package/src/runtime/output.js +21 -3
- package/src/runtime/profiles.js +214 -18
- package/src/runtime/telemetry.js +92 -0
- package/src/runtime/transport.js +29 -1
- package/template/.harness/index.html.tmpl +30 -2
- package/template/packages/sdk/src/config.ts +38 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notis-journal",
|
|
3
3
|
"version": "0.1.0",
|
|
4
|
-
"notisAppVersion": "0.1.
|
|
4
|
+
"notisAppVersion": "0.1.7",
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@types/react": "^19.0.0",
|
|
26
26
|
"@types/react-dom": "^19.0.0",
|
|
27
27
|
"@vitejs/plugin-react": "^4.0.0",
|
|
28
|
-
"postcss": "^8.
|
|
28
|
+
"postcss": "^8.5.25",
|
|
29
29
|
"tailwindcss": "^3.4.0",
|
|
30
30
|
"tsx": "^4.21.0",
|
|
31
31
|
"typescript": "^5.0.0",
|
|
@@ -62,6 +62,20 @@ export const NOTIS_APP_CATEGORIES = [
|
|
|
62
62
|
|
|
63
63
|
export type NotisAppCategory = typeof NOTIS_APP_CATEGORIES[number];
|
|
64
64
|
|
|
65
|
+
export interface NotisAppDatabaseConfig {
|
|
66
|
+
/** Database slug, as declared by the app. */
|
|
67
|
+
slug: string;
|
|
68
|
+
/**
|
|
69
|
+
* Ship this database's rows to everyone who installs the app.
|
|
70
|
+
*
|
|
71
|
+
* Off by default: declaring a database publishes its STRUCTURE, never its
|
|
72
|
+
* content. Turn it on only for starter content that every installer should
|
|
73
|
+
* receive - a default folder tree, a set of templates - and never for a
|
|
74
|
+
* database that accumulates the author's own data.
|
|
75
|
+
*/
|
|
76
|
+
seedDocuments?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
65
79
|
export interface NotisAppAuthor {
|
|
66
80
|
name: string;
|
|
67
81
|
handle?: string;
|
|
@@ -69,23 +83,34 @@ export interface NotisAppAuthor {
|
|
|
69
83
|
}
|
|
70
84
|
|
|
71
85
|
export interface NotisAppSkillConfig {
|
|
86
|
+
/** Stable source-owned key used by other app declarations. */
|
|
72
87
|
key: string;
|
|
88
|
+
/** Path to the skill entrypoint, relative to notis.config.ts. */
|
|
73
89
|
path: string;
|
|
90
|
+
/** User-facing name used for the installed skill. */
|
|
74
91
|
name: string;
|
|
75
92
|
description?: string;
|
|
76
93
|
}
|
|
77
94
|
|
|
78
95
|
export interface NotisAppOnboardingConfig {
|
|
96
|
+
/** Key of a skill declared in `skills`. */
|
|
79
97
|
skill: string;
|
|
98
|
+
/** Editable message placed in Notis when onboarding is opened. */
|
|
80
99
|
prompt: string;
|
|
81
100
|
}
|
|
82
101
|
|
|
83
102
|
export interface NotisAppScreenshotConfig {
|
|
103
|
+
/** Conventional metadata/screenshot-N.png source path. */
|
|
84
104
|
path: string;
|
|
105
|
+
/** Meaningful description used by the Store gallery and assistive technology. */
|
|
85
106
|
alt: string;
|
|
107
|
+
/** Route slug captured by `notis apps screenshot`. */
|
|
86
108
|
route?: string;
|
|
109
|
+
/** Optional fixture scenario from metadata/screenshot-fixtures.json. */
|
|
87
110
|
scenario?: string;
|
|
111
|
+
/** Optional CSS selector captured as the truthful focal region for this Store image. */
|
|
88
112
|
focus?: string;
|
|
113
|
+
/** Portal color scheme used while rendering this screenshot. Defaults to light. */
|
|
89
114
|
theme?: 'light' | 'dark';
|
|
90
115
|
}
|
|
91
116
|
|
|
@@ -106,6 +131,19 @@ export const NOTIS_APP_ACCENTS = [
|
|
|
106
131
|
|
|
107
132
|
export type NotisAppAccent = typeof NOTIS_APP_ACCENTS[number];
|
|
108
133
|
|
|
134
|
+
export interface NotisAppCapabilities {
|
|
135
|
+
/**
|
|
136
|
+
* Read every database in the workspace, not only the ones this app declares
|
|
137
|
+
* in `databases` or created itself.
|
|
138
|
+
*
|
|
139
|
+
* An app runtime is otherwise sandboxed to its own databases, so a catalog or
|
|
140
|
+
* explorer app sees an empty list without this. `'read'` is the only accepted
|
|
141
|
+
* value and it never grants writes: `LOCAL_NOTIS_DATABASE_UPSERT_*` stays
|
|
142
|
+
* bound to the app's own databases.
|
|
143
|
+
*/
|
|
144
|
+
workspaceDatabases?: 'read';
|
|
145
|
+
}
|
|
146
|
+
|
|
109
147
|
export interface NotisAppConfig {
|
|
110
148
|
/** URL-safe app slug. Existing apps may still use a display name here. */
|
|
111
149
|
name: string;
|
|
@@ -127,11 +165,24 @@ export interface NotisAppConfig {
|
|
|
127
165
|
tagline?: string;
|
|
128
166
|
/** @deprecated Add release entries to the root CHANGELOG.md instead. */
|
|
129
167
|
versionNotes?: string;
|
|
168
|
+
/** Editorial screenshot order and capture scenarios for the Store listing. */
|
|
130
169
|
screenshots?: NotisAppScreenshotConfig[];
|
|
131
|
-
|
|
170
|
+
/**
|
|
171
|
+
* Databases this app owns. A bare string publishes structure only; use the
|
|
172
|
+
* object form to opt a database into shipping its rows to installers.
|
|
173
|
+
*/
|
|
174
|
+
databases?: (string | NotisAppDatabaseConfig)[];
|
|
175
|
+
/**
|
|
176
|
+
* Extra permissions the app asks for at install time. Everything here widens
|
|
177
|
+
* what the app can reach beyond its own data, so each one is surfaced to the
|
|
178
|
+
* user before they install.
|
|
179
|
+
*/
|
|
180
|
+
capabilities?: NotisAppCapabilities;
|
|
132
181
|
routes?: NotisRouteConfig[];
|
|
133
182
|
tools?: string[];
|
|
183
|
+
/** Skills shipped from this app's source tree. */
|
|
134
184
|
skills?: NotisAppSkillConfig[];
|
|
185
|
+
/** Optional onboarding entrypoint exposed from the app sidebar. */
|
|
135
186
|
onboarding?: NotisAppOnboardingConfig;
|
|
136
187
|
}
|
|
137
188
|
|
|
@@ -24,10 +24,18 @@ import {
|
|
|
24
24
|
type UpsertDocumentArgs,
|
|
25
25
|
} from '@notis/sdk';
|
|
26
26
|
import { ArrowUpRightIcon as ArrowUpRight, CubeIcon as Boxes, BookOpenIcon as BookOpen, BookOpenTextIcon as BookOpenText, CalendarIcon as CalendarDays, CaretDownIcon as ChevronDown, CaretLeftIcon as ChevronLeft, CaretRightIcon as ChevronRight, FileTextIcon as FileText, FolderIcon as Folder, FolderMinusIcon as FolderMinus, FolderOpenIcon as FolderOpen, FolderPlusIcon as FolderPlus, FoldersIcon as Folders, SquaresFourIcon as LayoutGrid, CircleNotchIcon as Loader2, MagnifyingGlassIcon as Search, NotePencilIcon as NotebookPen, PencilIcon as Pencil, PlusIcon as Plus, NoteIcon as StickyNote, TableIcon as Table2, TrashIcon as Trash, XIcon as X, type Icon } from '@phosphor-icons/react';
|
|
27
|
-
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
28
27
|
|
|
28
|
+
import {
|
|
29
|
+
PHOSPHOR_ICONS,
|
|
30
|
+
PHOSPHOR_ICON_ALIASES,
|
|
31
|
+
PHOSPHOR_ICON_NAMES,
|
|
32
|
+
} from './phosphor-icons';
|
|
29
33
|
import { Button } from '@/components/ui/button';
|
|
30
34
|
import { cn } from '@/lib/utils';
|
|
35
|
+
import {
|
|
36
|
+
VISIBLE_PROPERTIES_PROPERTY,
|
|
37
|
+
resolveVisibleColumns,
|
|
38
|
+
} from '@/lib/visible-properties';
|
|
31
39
|
|
|
32
40
|
type TabKey = 'gallery' | 'table' | 'calendar';
|
|
33
41
|
|
|
@@ -76,23 +84,6 @@ type IconName = string;
|
|
|
76
84
|
|
|
77
85
|
const PHOSPHOR_ICON_PREFIX = 'phosphor:';
|
|
78
86
|
|
|
79
|
-
const PHOSPHOR_ICON_OVERRIDES: Record<string, string> = {
|
|
80
|
-
boxes: 'Cube',
|
|
81
|
-
'calendar-days': 'Calendar',
|
|
82
|
-
'layout-grid': 'SquaresFour',
|
|
83
|
-
'layout-dashboard': 'SquaresFour',
|
|
84
|
-
'link-2': 'Link',
|
|
85
|
-
'notebook-pen': 'NotePencil',
|
|
86
|
-
'rows-3': 'Rows',
|
|
87
|
-
search: 'MagnifyingGlass',
|
|
88
|
-
'settings-2': 'SlidersHorizontal',
|
|
89
|
-
sparkles: 'Sparkle',
|
|
90
|
-
'sticky-note': 'Note',
|
|
91
|
-
'table-2': 'Table',
|
|
92
|
-
home: 'House',
|
|
93
|
-
'folder-kanban': 'Kanban',
|
|
94
|
-
};
|
|
95
|
-
|
|
96
87
|
const SUGGESTED_FOLDER_ICON_NAMES: IconName[] = [
|
|
97
88
|
'folder',
|
|
98
89
|
'folder-open',
|
|
@@ -114,21 +105,6 @@ const SUGGESTED_FOLDER_ICON_NAMES: IconName[] = [
|
|
|
114
105
|
'tag',
|
|
115
106
|
];
|
|
116
107
|
|
|
117
|
-
function toPascalCase(value: string): string {
|
|
118
|
-
return value
|
|
119
|
-
.split(/[-_\s]+/)
|
|
120
|
-
.filter(Boolean)
|
|
121
|
-
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
|
122
|
-
.join('');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function toKebabCase(value: string): string {
|
|
126
|
-
return value
|
|
127
|
-
.replace(/Icon$/, '')
|
|
128
|
-
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
129
|
-
.toLowerCase();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
108
|
function parsePhosphorIconName(icon: string | null | undefined): IconName | null {
|
|
133
109
|
if (typeof icon !== 'string' || !icon.startsWith(PHOSPHOR_ICON_PREFIX)) {
|
|
134
110
|
return null;
|
|
@@ -139,20 +115,14 @@ function parsePhosphorIconName(icon: string | null | undefined): IconName | null
|
|
|
139
115
|
|
|
140
116
|
function getPhosphorIconComponent(icon: string | null | undefined): Icon | null {
|
|
141
117
|
const name = parsePhosphorIconName(icon);
|
|
142
|
-
|
|
143
|
-
const exportBaseName = PHOSPHOR_ICON_OVERRIDES[name] ?? toPascalCase(name);
|
|
144
|
-
const component = (PhosphorIcons as Record<string, unknown>)[`${exportBaseName}Icon`];
|
|
145
|
-
return typeof component === 'function' ? (component as Icon) : null;
|
|
118
|
+
return name ? getPhosphorIconComponentByName(name) : null;
|
|
146
119
|
}
|
|
147
120
|
|
|
148
121
|
function getPhosphorIconComponentByName(name: string): Icon | null {
|
|
149
|
-
return
|
|
122
|
+
return PHOSPHOR_ICONS[name] ?? PHOSPHOR_ICONS[PHOSPHOR_ICON_ALIASES[name] ?? ''] ?? null;
|
|
150
123
|
}
|
|
151
124
|
|
|
152
|
-
const ALL_PHOSPHOR_ICON_NAMES =
|
|
153
|
-
.filter((key) => key.endsWith('Icon') && key !== 'Icon')
|
|
154
|
-
.map(toKebabCase)
|
|
155
|
-
.sort((a, b) => a.localeCompare(b));
|
|
125
|
+
const ALL_PHOSPHOR_ICON_NAMES = [...PHOSPHOR_ICON_NAMES].sort((a, b) => a.localeCompare(b));
|
|
156
126
|
|
|
157
127
|
function normalizeCollectionItem(value: unknown): CollectionItemContext | null {
|
|
158
128
|
const record = asRecord(value);
|
|
@@ -570,6 +540,7 @@ function ViewPill({
|
|
|
570
540
|
return (
|
|
571
541
|
<button
|
|
572
542
|
type="button"
|
|
543
|
+
data-view={config.key}
|
|
573
544
|
onClick={onSelect}
|
|
574
545
|
className={cn(
|
|
575
546
|
'inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12.5px] font-medium transition-colors',
|
|
@@ -767,8 +738,15 @@ export default function NotesPage() {
|
|
|
767
738
|
}
|
|
768
739
|
: undefined;
|
|
769
740
|
|
|
770
|
-
const notesQuery = useDocuments(NOTE_DATABASE_SLUG, {
|
|
771
|
-
|
|
741
|
+
const notesQuery = useDocuments(NOTE_DATABASE_SLUG, {
|
|
742
|
+
filter: notesFilter,
|
|
743
|
+
pageSize: 250,
|
|
744
|
+
fetchAll: true,
|
|
745
|
+
});
|
|
746
|
+
const foldersQuery = useDocuments(FOLDER_DATABASE_SLUG, {
|
|
747
|
+
pageSize: 500,
|
|
748
|
+
fetchAll: true,
|
|
749
|
+
});
|
|
772
750
|
|
|
773
751
|
const { setLoading: setSearchLoading } = useTopBarSearch({
|
|
774
752
|
value: searchQuery,
|
|
@@ -795,6 +773,18 @@ export default function NotesPage() {
|
|
|
795
773
|
const folderOptions = buildFolderOptions(folders);
|
|
796
774
|
const folderNameById = new Map(folderOptions.map((f) => [f.id, f.title]));
|
|
797
775
|
|
|
776
|
+
// Which columns the table shows is per-folder VIEW config: it never hides a
|
|
777
|
+
// property from query and never changes what a note is. The active folder's
|
|
778
|
+
// choice wins; with no folder selected the union across folders is shown.
|
|
779
|
+
const { columns: visibleColumns } = resolveVisibleColumns({
|
|
780
|
+
metadataProperties,
|
|
781
|
+
activeFolderSelection: collectionItem?.properties?.[VISIBLE_PROPERTIES_PROPERTY],
|
|
782
|
+
activeFolderSelected: Boolean(collectionItem),
|
|
783
|
+
allFolderSelections: folders.map(
|
|
784
|
+
(folder) => (folder.properties as Record<string, unknown> | undefined)?.[VISIBLE_PROPERTIES_PROPERTY],
|
|
785
|
+
),
|
|
786
|
+
});
|
|
787
|
+
|
|
798
788
|
// The calendar always offers a built-in "Created" field (sourced from each
|
|
799
789
|
// note's created_at) plus any user-defined date properties on the database.
|
|
800
790
|
const calendarDateFields: CalendarDateField[] = [
|
|
@@ -1061,7 +1051,7 @@ export default function NotesPage() {
|
|
|
1061
1051
|
}
|
|
1062
1052
|
|
|
1063
1053
|
return (
|
|
1064
|
-
<main className="flex min-h-screen flex-col bg-background">
|
|
1054
|
+
<main data-store-screenshot="notes" className="flex min-h-screen flex-col bg-background">
|
|
1065
1055
|
<PageHeader
|
|
1066
1056
|
title={pageTitle}
|
|
1067
1057
|
icon={pageIcon}
|
|
@@ -1110,6 +1100,7 @@ export default function NotesPage() {
|
|
|
1110
1100
|
<TableBody
|
|
1111
1101
|
notes={notes}
|
|
1112
1102
|
metadataProperties={metadataProperties}
|
|
1103
|
+
visibleColumns={visibleColumns}
|
|
1113
1104
|
folderOptions={folderOptions}
|
|
1114
1105
|
folderNameById={folderNameById}
|
|
1115
1106
|
folderPropertyName={folderPropertyName}
|
|
@@ -1445,6 +1436,7 @@ function BulkFolderPicker({
|
|
|
1445
1436
|
function TableBody({
|
|
1446
1437
|
notes,
|
|
1447
1438
|
metadataProperties,
|
|
1439
|
+
visibleColumns,
|
|
1448
1440
|
folderOptions,
|
|
1449
1441
|
folderNameById,
|
|
1450
1442
|
folderPropertyName,
|
|
@@ -1459,6 +1451,7 @@ function TableBody({
|
|
|
1459
1451
|
}: {
|
|
1460
1452
|
notes: DocumentRecord[];
|
|
1461
1453
|
metadataProperties: DatabaseProperty[];
|
|
1454
|
+
visibleColumns?: DatabaseProperty[];
|
|
1462
1455
|
folderOptions: FolderOption[];
|
|
1463
1456
|
folderNameById: Map<string, string>;
|
|
1464
1457
|
folderPropertyName: string;
|
|
@@ -1471,7 +1464,7 @@ function TableBody({
|
|
|
1471
1464
|
multiSelect: MultiSelectController<DocumentRecord>;
|
|
1472
1465
|
rowRefs: Map<string, HTMLElement>;
|
|
1473
1466
|
}) {
|
|
1474
|
-
const columns = metadataProperties.slice(0, 6);
|
|
1467
|
+
const columns = visibleColumns ?? metadataProperties.slice(0, 6);
|
|
1475
1468
|
const allSelected =
|
|
1476
1469
|
notes.length > 0 && notes.every((note) => multiSelect.isSelected(note.id));
|
|
1477
1470
|
const handleSelectAllToggle = () => {
|