@columenlabs/lumen-ui 0.1.243 → 0.1.245

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 CHANGED
@@ -59,7 +59,7 @@ Use `createDeskQueryClient()` for the app's TanStack Query client: data stays fr
59
59
 
60
60
  ## What's inside
61
61
 
62
- **Frame.** `LumenShell` (sidebar with icons-only collapse and a drawer on phone, header, status bar, Settings, profile menu, ⌘K Find), `LumenAppSwitcher` and `LumenSuiteSwitcher` (groups, apps on other sites, a list read from an address), `WhatsNew` (release notes in a drawer), `TasksButton` and `TasksProvider` (background work in the header), `NotificationsSettings`, `McpSettings`, sign-in screens (`LumenAuthStage`, `LumenSecondStep`, `LumenSignInMethods`, `LumenBackupCodes`, `LumenBotCheck` for Cloudflare Turnstile, `authErrorText` for errors in plain words), `StatusHealth`, `LumenBoundary` (keeps a crash inside its card), `LumenPageState` (loading, empty and error), `lumenToast`.
62
+ **Frame.** `LumenShell` (sidebar with icons-only collapse and a drawer on phone, header, status bar, Settings, profile menu, ⌘K Find; `LumenFinder` mounts Find on its own for an app that draws its own frame, with commands from `useLumenFinderRows`), `LumenAppSwitcher` and `LumenSuiteSwitcher` (groups, apps on other sites, a list read from an address), `WhatsNew` (release notes in a drawer), `TasksButton` and `TasksProvider` (background work in the header), `NotificationsSettings`, `McpSettings`, sign-in screens (`LumenAuthStage`, `LumenSecondStep`, `LumenSignInMethods`, `LumenBackupCodes`, `LumenBotCheck` for Cloudflare Turnstile, `authErrorText` for errors in plain words), `StatusHealth`, `LumenBoundary` (keeps a crash inside its card), `LumenPageState` (loading, empty and error), `lumenToast`.
63
63
 
64
64
  **Pages and views.** `LumenLayout` (a page of cards from one view config: filter, tiles, widgets; Edit layout and Edit widget when you pass `onConfigChange`; a card with `header: false` is its body alone), `LumenGrid` (the 6-column grid under it), `LumenView` and `LumenViewCard` (a table that filters, groups, pivots and totals the rows you load), `LumenTable`, `LumenTokenizedFilter`, `LumenWidget` and `LumenSavedWidget` (the frame every card sits in, with its link square and controls), `LumenCard` (one number and its lines), `LumenPager`, `DetailsTable`, `LumenTree`, `LumenCalendar` (events by month, week or agenda, in a time zone), `LumenBoard` (items in columns by stage), `useAppView` (a page whose layout each person can change and reset).
65
65
 
@@ -114,7 +114,6 @@ const wayTest = (k, plan = false) => k?.test
114
114
  }
115
115
  : null;
116
116
  /** A provider's mark: its initial on a tile. */
117
- const mark = (label) => _jsx(ConnectionLogo, { text: label.charAt(0) });
118
117
  /**
119
118
  * Whether the app lets this person use `w` of their own on `p` (the app's `ownWays`, the same
120
119
  * rule the server pays by). A way it does not allow never shows, even when one is still stored:
@@ -161,7 +160,7 @@ function OwnProviderKey({ client, p }) {
161
160
  onRemove: () => apply(`own:${p.id}`, () => client.ownKey(p.id, null), 'Key removed'),
162
161
  removeTitle: `Remove your ${p.label} key?`,
163
162
  });
164
- return (_jsx(LumenConnection, { id: p.id, name: p.label, logo: mark(p.label), ways: ways, use: p.use, onUse: (use) => apply(`use:${p.id}`, () => client.settings({ own_use: { [p.id]: use } })) }));
163
+ return (_jsx(LumenConnection, { id: p.id, name: p.label, ways: ways, use: p.use, onUse: (use) => apply(`use:${p.id}`, () => client.settings({ own_use: { [p.id]: use } })) }));
165
164
  }
166
165
  /** A person's own keys, one row a provider, and what they may spend on them. */
167
166
  function Providers({ client }) {
@@ -171,10 +170,7 @@ function Providers({ client }) {
171
170
  // is exactly what the server may pay with.
172
171
  const rows = s.providers.filter((p) => !p.own_ways || p.own_ways.length > 0);
173
172
  const ownSet = rows.some(ownUsable);
174
- return (_jsxs("div", { className: "flex flex-col", children: [_jsx(LumenExpandList, { children: rows.map((p) => (_jsx(OwnProviderKey, { client: client, p: p }, p.id))) }), ownSet && (_jsx(SettingField, { label: "Answers run on", info: "Your own key or plan first, with the shared credits behind it; or the shared credits first.", children: _jsx(LumenSelector, { label: "Answers run on", size: "sm", className: "w-44", value: s.pay, options: [
175
- { value: 'own', label: 'Your own first' },
176
- { value: 'app', label: 'Shared credits first' },
177
- ], onChange: (pay) => void apply('pay', () => client.settings({ pay: pay })) }) })), ownSet && (_jsx(SettingField, { label: "Your keys may spend", info: "On your keys, every provider together.", children: _jsx(CapInput, { label: "Your monthly cap", value: s.caps.own, onSave: (n) => void apply('own', () => client.ownCap(n)) }) })), ownSet && _jsx(OwnCapUse, { s: s }), _jsx(OwnKeyUsage, { client: client, always: ownSet })] }));
173
+ return (_jsxs("div", { className: "flex flex-col", children: [_jsx(LumenExpandList, { children: rows.map((p) => (_jsx(OwnProviderKey, { client: client, p: p }, p.id))) }), ownSet && (_jsx(SettingField, { label: "Answers run on", info: "Your own key or plan first, with the shared credits behind it; or the shared credits first.", children: _jsxs(ToggleGroup, { type: "single", variant: "outline", size: "sm", spacing: 0, value: s.pay, "aria-label": "Answers run on", onValueChange: (pay) => pay && void apply('pay', () => client.settings({ pay: pay })), children: [_jsx(ToggleGroupItem, { value: "own", children: "Your own first" }), _jsx(ToggleGroupItem, { value: "app", children: "Credits first" })] }) })), ownSet && (_jsx(SettingField, { label: "Your keys may spend", info: "On your keys, every provider together.", children: _jsx(CapInput, { label: "Your monthly cap", value: s.caps.own, onSave: (n) => void apply('own', () => client.ownCap(n)) }) })), ownSet && _jsx(OwnCapUse, { s: s }), _jsx(OwnKeyUsage, { client: client, always: ownSet })] }));
178
174
  } }));
179
175
  }
180
176
  /**
@@ -195,7 +191,7 @@ function OwnCapUse({ s }) {
195
191
  function SharedProviderKey({ client, p }) {
196
192
  const { apply, refresh } = useApply(client);
197
193
  const env = !p.app.set && !!p.app.from_env;
198
- return (_jsx(LumenConnection, { id: p.id, name: p.label, logo: mark(p.label), ways: [
194
+ return (_jsx(LumenConnection, { id: p.id, name: p.label, ways: [
199
195
  {
200
196
  id: 'key',
201
197
  label: 'Shared key',
package/dist/index.d.ts CHANGED
@@ -117,6 +117,6 @@ export { LumenChart, type LumenChartOptions, type MineIndicators, SymbolChartPro
117
117
  export { SymbolSheetProvider } from './symbol-sheet.js';
118
118
  export { useSymbolSheet } from './symbol-sheet-context.js';
119
119
  export { NoteLine, type NoteLineProps } from './note-line.js';
120
- export { type LumenFinderConfig, type LumenFinderPageType, type LumenFinderRow, type LumenFinderScope, LumenFinderButton, useLumenFinder, useLumenFinderRows, useOpenLumenFinder, } from './lumen-finder.js';
120
+ export { type LumenFinderConfig, type LumenFinderPageType, type LumenFinderRow, type LumenFinderScope, LumenFinder, LumenFinderButton, useLumenFinder, useLumenFinderRows, useOpenLumenFinder, } from './lumen-finder.js';
121
121
  export { type AssistantChat, LumenAssistantButton, LumenAssistantChats, LumenAssistantPanel, assistantOpen, tabState, useAssistantHotkey, } from './assistant-panel.js';
122
122
  export { LumenTree, LumenTreeItem, type LumenTreeItemProps, type LumenTreeProps, useLumenTree, } from './lumen-tree.js';
package/dist/index.js CHANGED
@@ -124,6 +124,6 @@ export { LumenChart, SymbolChartProvider, useLumenChart, useSymbolChart, } from
124
124
  export { SymbolSheetProvider } from './symbol-sheet.js';
125
125
  export { useSymbolSheet } from './symbol-sheet-context.js';
126
126
  export { NoteLine } from './note-line.js';
127
- export { LumenFinderButton, useLumenFinder, useLumenFinderRows, useOpenLumenFinder, } from './lumen-finder.js';
127
+ export { LumenFinder, LumenFinderButton, useLumenFinder, useLumenFinderRows, useOpenLumenFinder, } from './lumen-finder.js';
128
128
  export { LumenAssistantButton, LumenAssistantChats, LumenAssistantPanel, assistantOpen, tabState, useAssistantHotkey, } from './assistant-panel.js';
129
129
  export { LumenTree, LumenTreeItem, useLumenTree, } from './lumen-tree.js';
@@ -46,7 +46,11 @@ export declare function useLumenFinderRows(rows: LumenFinderRow[] | null): void;
46
46
  type Icon = ComponentType<{
47
47
  className?: string;
48
48
  }>;
49
- /** Find for the shell: ⌘K, the rows apps add and the dialog. LumenShell mounts it. */
49
+ /**
50
+ * Find: ⌘K, the rows apps add and the dialog. LumenShell mounts it; an app that draws its own frame
51
+ * (a full-screen editor) mounts it around its screen instead and adds its commands with
52
+ * `useLumenFinderRows`. No router is needed there: rows run, or follow plain links.
53
+ */
50
54
  export declare function LumenFinder({ app, settings, openSettings, config, children, }: {
51
55
  app: string;
52
56
  settings: {
@@ -162,7 +162,11 @@ function useShellRows(open, query, settings, openSettings, app, pageTypes, setti
162
162
  ]
163
163
  : base, [base, assistant, q]);
164
164
  }
165
- /** Find for the shell: ⌘K, the rows apps add and the dialog. LumenShell mounts it. */
165
+ /**
166
+ * Find: ⌘K, the rows apps add and the dialog. LumenShell mounts it; an app that draws its own frame
167
+ * (a full-screen editor) mounts it around its screen instead and adds its commands with
168
+ * `useLumenFinderRows`. No router is needed there: rows run, or follow plain links.
169
+ */
166
170
  export function LumenFinder({ app, settings, openSettings, config, children, }) {
167
171
  const pageTypes = config?.pageTypes ?? NO_TYPES;
168
172
  const settingsScope = config?.settingsScope ?? 'Settings';
@@ -218,7 +222,9 @@ export function LumenFinder({ app, settings, openSettings, config, children, })
218
222
  }
219
223
  function FinderDialog({ app, open, onOpenChange, query, onQuery, scope, onScope, scopes, placeholder, groups, }) {
220
224
  const mobile = useIsMobile();
221
- const router = useRouter();
225
+ // Optional: an app without TanStack Router (a single-screen tool) still gets Find; its rows run or
226
+ // go by plain links.
227
+ const router = useRouter({ warn: false });
222
228
  const list = useRef(null);
223
229
  const input = useRef(null);
224
230
  // Focus without scrolling: on a phone iOS pans the page to a focused field as the keyboard opens,
@@ -241,8 +247,8 @@ function FinderDialog({ app, open, onOpenChange, query, onQuery, scope, onScope,
241
247
  return;
242
248
  const outside = /^https?:/.test(r.href);
243
249
  if (tab)
244
- window.open(outside ? r.href : router.history.createHref(r.href), '_blank');
245
- else if (outside)
250
+ window.open(outside || !router ? r.href : router.history.createHref(r.href), '_blank');
251
+ else if (outside || !router)
246
252
  window.location.assign(r.href);
247
253
  else
248
254
  void router.navigate({ href: r.href });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.243",
3
+ "version": "0.1.245",
4
4
  "description": "Lumen: shared React components (frame, views, widgets, charts, drawers).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -49,7 +49,7 @@
49
49
  "@codemirror/lang-javascript": "6.2.5",
50
50
  "@codemirror/lang-json": "6.0.2",
51
51
  "@codemirror/lang-sql": "6.10.0",
52
- "@columenlabs/lumen-ui-types": "0.1.243",
52
+ "@columenlabs/lumen-ui-types": "0.1.245",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",