@columenlabs/lumen-ui 0.1.133 → 0.1.135

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.
@@ -1,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useQuery, useQueryClient } from '@tanstack/react-query';
3
- import { CoinsIcon, GlobeIcon, InboxIcon, KeyRoundIcon, LayersIcon, LogInIcon, ReceiptIcon, SparklesIcon, WrenchIcon, } from 'lucide-react';
3
+ import { CoinsIcon, GlobeIcon, InboxIcon, KeyRoundIcon, LayersIcon, Link2Icon, LogInIcon, ReceiptIcon, SparklesIcon, WrenchIcon, } from 'lucide-react';
4
4
  import { useId, useState } from 'react';
5
5
  import { ConnectionLogo, LumenConnection, } from '../connection.js';
6
6
  import { LumenExpandList, LumenExpandRow } from '../expand-list.js';
@@ -215,6 +215,21 @@ function ScrapeqlBlock({ client, s }) {
215
215
  const state = s.web.scrapeql;
216
216
  if (!state)
217
217
  return null;
218
+ // Reached over the app's service binding: nothing to paste, only a test.
219
+ if (state.bound)
220
+ return (_jsx(LumenExpandList, { children: _jsx(LumenConnection, { id: "scrapeql", name: "ScrapeQL", logo: _jsx(ConnectionLogo, { icon: GlobeIcon }), meta: "Linked to this app, no token needed", ways: [
221
+ {
222
+ id: 'link',
223
+ label: 'App link',
224
+ icon: Link2Icon,
225
+ info: 'This app reaches ScrapeQL over a Cloudflare service binding, so no token is stored.',
226
+ set: true,
227
+ test: wayTest(state),
228
+ note: 'Set by the app',
229
+ readOnly: true,
230
+ ...(s.admin ? { onTest: () => client.testScrapeql().finally(refresh) } : {}),
231
+ },
232
+ ] }) }));
218
233
  return (_jsx(LumenExpandList, { children: _jsx(LumenConnection, { id: "scrapeql", name: "ScrapeQL", logo: _jsx(ConnectionLogo, { icon: GlobeIcon }), meta: state.set ? undefined : 'Search and pages that need a real browser', ways: [
219
234
  {
220
235
  id: 'token',
package/dist/settings.js CHANGED
@@ -150,6 +150,14 @@ export function LumenSettings({ open, section, onOpen, onClose, appLabel, profil
150
150
  .map((el) => el.dataset.settingsSection ?? '');
151
151
  setFound((f) => (f.join() === ids.join() ? f : ids));
152
152
  });
153
+ // A long nav scrolls; keep the open section's row in view (Settings can open at one far down).
154
+ const navList = useRef(null);
155
+ useEffect(() => {
156
+ if (!open)
157
+ return;
158
+ const id = requestAnimationFrame(() => navList.current?.querySelector('[data-active=true]')?.scrollIntoView({ block: 'nearest' }));
159
+ return () => cancelAnimationFrame(id);
160
+ }, [open]);
153
161
  const shown = (s) => !q || found.includes(s.id);
154
162
  const go = (id) => {
155
163
  setQuery('');
@@ -177,7 +185,7 @@ export function LumenSettings({ open, section, onOpen, onClose, appLabel, profil
177
185
  e.preventDefault();
178
186
  setQuery('');
179
187
  }
180
- }, className: "flex h-[min(720px,calc(100svh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl md:flex-row", children: [_jsx(DialogTitle, { className: "sr-only", children: "Settings" }), _jsx(DialogDescription, { className: "sr-only", children: "Your preferences and this desk's settings." }), _jsxs("nav", { "aria-label": "Settings sections", className: "hidden w-56 shrink-0 flex-col border-r bg-sidebar py-2 md:flex", children: [_jsx("div", { className: "px-2 pt-1 pb-1", children: search }), navGroups.map((g) => (_jsxs(SidebarGroup, { className: "py-1", children: [_jsx(SidebarGroupLabel, { children: g.label }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: g.items.map((s) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: !q && s.id === current.id, className: s.sub ? 'pl-7' : undefined, onClick: () => go(s.id), children: [_jsx(s.icon, {}), _jsx("span", { children: s.title })] }) }, s.id))) }) })] }, g.label)))] }), _jsxs("div", { className: "flex flex-col gap-2 border-b p-3 pr-12 md:hidden", children: [search, !q && (_jsx(LumenSelector, { label: "Settings section", className: "w-full", groups: navGroups.map((g) => ({
188
+ }, className: "flex h-[min(720px,calc(100svh-2rem))] flex-col gap-0 overflow-hidden p-0 sm:max-w-4xl md:flex-row", children: [_jsx(DialogTitle, { className: "sr-only", children: "Settings" }), _jsx(DialogDescription, { className: "sr-only", children: "Your preferences and this desk's settings." }), _jsxs("nav", { "aria-label": "Settings sections", className: "hidden min-h-0 w-56 shrink-0 flex-col border-r bg-sidebar pt-2 md:flex", children: [_jsx("div", { className: "shrink-0 px-2 pt-1 pb-1", children: search }), _jsx("div", { ref: navList, "data-slot": "settings-nav-list", className: "flex min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain pb-2 *:shrink-0", children: navGroups.map((g) => (_jsxs(SidebarGroup, { className: "py-1", children: [_jsx(SidebarGroupLabel, { children: g.label }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: g.items.map((s) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: !q && s.id === current.id, className: s.sub ? 'pl-7' : undefined, onClick: () => go(s.id), children: [_jsx(s.icon, {}), _jsx("span", { children: s.title })] }) }, s.id))) }) })] }, g.label))) })] }), _jsxs("div", { className: "flex flex-col gap-2 border-b p-3 pr-12 md:hidden", children: [search, !q && (_jsx(LumenSelector, { label: "Settings section", className: "w-full", groups: navGroups.map((g) => ({
181
189
  label: g.label,
182
190
  options: g.items.map((s) => ({
183
191
  value: s.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@columenlabs/lumen-ui",
3
- "version": "0.1.133",
3
+ "version": "0.1.135",
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.133",
52
+ "@columenlabs/lumen-ui-types": "0.1.135",
53
53
  "@dnd-kit/core": "6.3.1",
54
54
  "@dnd-kit/sortable": "10.0.0",
55
55
  "@dnd-kit/utilities": "3.2.2",