react-os-shell 0.6.5 → 0.6.7

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/dist/index.d.ts CHANGED
@@ -343,6 +343,12 @@ interface HelpCenterProps {
343
343
  */
344
344
  declare function HelpCenter({ docs, loading, categoryOrder, canEdit, onNew, onEdit, renderBody, emptyMessage, }: HelpCenterProps): react_jsx_runtime.JSX.Element;
345
345
 
346
+ interface MarkdownProps {
347
+ children: string;
348
+ className?: string;
349
+ }
350
+ declare function Markdown({ children, className }: MarkdownProps): react_jsx_runtime.JSX.Element;
351
+
346
352
  declare const isMac: boolean;
347
353
  /** Platform-aware modifier symbols */
348
354
  declare const MOD: string;
@@ -1262,4 +1268,4 @@ declare function useNewHotkey(callback: () => void): void;
1262
1268
  */
1263
1269
  declare function useEditHotkey(callback: (() => void) | null): void;
1264
1270
 
1265
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, HelpCenter, type HelpCenterDoc, type HelpCenterProps, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
1271
+ export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, type BugReport, type BugReportConfig, BugReportConfigProvider, BugReportDetail, type BugReportExtraField, type BugReportExtraSelectField, BugReportProvider, type BugReportSubmission, type BugReportSubmitPayload, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, CancelButton, type CellStyle, type ChangelogEntry, type ColumnDef, ConfirmProvider, CopyButton, Customization, type CustomizationOmitSection, type CustomizationProps, Desktop, type DesktopHostConfig, DesktopHostProvider, DocFavStar, ENTER, EditableGrid, type EditableGridProps, type EntityFetcher, EntityList, type EntityListColumn, type EntityListProps, GLASS_DIVIDER, GLASS_INPUT_BG, GlobalSearch, type GridColumn, HelpCenter, type HelpCenterDoc, type HelpCenterProps, Layout, type LayoutProps, ListFooter, type LoginPayload, MOD, type MailCapabilities, MailConnectModal, type MailUser, Markdown, type MarkdownProps, Modal, ModalActions, NotificationBell, type NotificationsConfig, type PaginatedResponse, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, type ReportType, ResizableTable, SHIFT, type SearchConfig, type SearchProvider, type SearchResult, type SemanticGroup, type ShellAuth, ShellAuthProvider, ShellEntityFetcherProvider, type ShellNotification, type ShellPrefsAdapter, ShellPrefsProvider, ShortcutHelp, type SortState, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, type StickyEntityRef, type StickyResolver, SystemPreferences, type SystemPreferencesProps, type SystemPreferencesSection, VERSION, WindowManagerProvider, WindowRegistry, WindowTitle, commitExposeHighlight, confirm, confirmDestructive, createWindowRegistry, exitExposeMode, formatDate, getActiveWindowRoute, getExposeHighlight, glassStyle, isMac, openBugReportDialog, prompt, reportBug, setExposeHighlight, setShellApiClient, setShellAuthBridge, setShellMailServer, setShellNavIcons, setWindowDefaultPosition, subscribeExposeHighlight, toast, toggleExposeMode, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useLocalStoragePrefs, useMailAuth, useModalActive, useNewHotkey, useShellAuth, useShellEntityFetcher, useShellPrefs, useSort, useTableNav, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle };
package/dist/index.js CHANGED
@@ -256,6 +256,164 @@ function ShortcutHelp() {
256
256
  ] }) })
257
257
  ] });
258
258
  }
259
+ var INLINE_RE = /!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;
260
+ function renderInline(text) {
261
+ const out = [];
262
+ let last = 0;
263
+ let key = 0;
264
+ let m;
265
+ INLINE_RE.lastIndex = 0;
266
+ while ((m = INLINE_RE.exec(text)) !== null) {
267
+ if (m.index > last) out.push(text.slice(last, m.index));
268
+ if (m[1] !== void 0) {
269
+ out.push(
270
+ /* @__PURE__ */ jsxs("span", { className: "text-gray-400", children: [
271
+ "[",
272
+ m[1],
273
+ "]"
274
+ ] }, key++)
275
+ );
276
+ } else if (m[3] !== void 0) {
277
+ out.push(
278
+ /* @__PURE__ */ jsx(
279
+ "a",
280
+ {
281
+ href: m[4],
282
+ target: "_blank",
283
+ rel: "noreferrer",
284
+ className: "text-blue-600 hover:underline",
285
+ children: m[3]
286
+ },
287
+ key++
288
+ )
289
+ );
290
+ } else if (m[5] !== void 0) {
291
+ out.push(
292
+ /* @__PURE__ */ jsx("strong", { className: "font-semibold text-gray-900", children: m[5] }, key++)
293
+ );
294
+ } else if (m[6] !== void 0) {
295
+ out.push(
296
+ /* @__PURE__ */ jsx(
297
+ "code",
298
+ {
299
+ className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",
300
+ children: m[6]
301
+ },
302
+ key++
303
+ )
304
+ );
305
+ } else if (m[7] !== void 0) {
306
+ out.push(/* @__PURE__ */ jsx("em", { children: m[7] }, key++));
307
+ }
308
+ last = INLINE_RE.lastIndex;
309
+ }
310
+ if (last < text.length) out.push(text.slice(last));
311
+ return out;
312
+ }
313
+ function ScreenshotPlaceholder({ alt }) {
314
+ const label = alt.replace(/^screenshot:\s*/i, "");
315
+ return /* @__PURE__ */ jsxs("div", { className: "my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-2.5", children: [
316
+ /* @__PURE__ */ jsx(
317
+ "svg",
318
+ {
319
+ className: "mt-0.5 h-4 w-4 shrink-0 text-gray-400",
320
+ viewBox: "0 0 20 20",
321
+ fill: "currentColor",
322
+ "aria-hidden": "true",
323
+ children: /* @__PURE__ */ jsx("path", { d: "M3 6a1.5 1.5 0 0 1 1.5-1.5h1.1l.4-.9a1 1 0 0 1 .9-.6h6.2a1 1 0 0 1 .9.6l.4.9h1.1A1.5 1.5 0 0 1 18 6v8.5A1.5 1.5 0 0 1 16.5 16h-13A1.5 1.5 0 0 1 2 14.5V6Zm7.5 1.5a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5Z" })
324
+ }
325
+ ),
326
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-500", children: [
327
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-gray-600", children: "Screenshot \u2014 " }),
328
+ label
329
+ ] })
330
+ ] });
331
+ }
332
+ function collectItems(lines, itemRe) {
333
+ const items = [];
334
+ for (const line of lines) {
335
+ const m = itemRe.exec(line);
336
+ if (m) {
337
+ items.push(m[1]);
338
+ } else if (items.length) {
339
+ items[items.length - 1] += " " + line.trim();
340
+ }
341
+ }
342
+ return items;
343
+ }
344
+ var splitCells = (line) => line.replace(/^\s*\|/, "").replace(/\|\s*$/, "").split("|").map((c) => c.trim());
345
+ function isTable(lines) {
346
+ return lines.length >= 2 && lines[0].includes("|") && /^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(lines[1]) && lines[1].includes("-");
347
+ }
348
+ function renderTable(lines, key) {
349
+ const header = splitCells(lines[0]);
350
+ const rows = lines.slice(2).map(splitCells);
351
+ return /* @__PURE__ */ jsx("div", { className: "my-1 overflow-x-auto rounded-lg border border-gray-200", children: /* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-sm", children: [
352
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { className: "bg-gray-50", children: header.map((h, i) => /* @__PURE__ */ jsx(
353
+ "th",
354
+ {
355
+ className: "border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",
356
+ children: renderInline(h)
357
+ },
358
+ i
359
+ )) }) }),
360
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((row, r) => /* @__PURE__ */ jsx("tr", { className: "even:bg-gray-50/50", children: row.map((c, i) => /* @__PURE__ */ jsx("td", { className: "border-t border-gray-100 px-3 py-1.5 align-top text-gray-700", children: renderInline(c) }, i)) }, r)) })
361
+ ] }) }, key);
362
+ }
363
+ function renderBlock(block, key) {
364
+ const lines = block.split("\n");
365
+ const first = lines[0];
366
+ const heading = /^(#{2,4})\s+(.*)$/.exec(first);
367
+ if (heading && lines.length === 1) {
368
+ const level = heading[1].length;
369
+ const Tag = `h${level}`;
370
+ const cls = level === 2 ? "mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500" : level === 3 ? "mt-1 text-base font-semibold text-gray-900" : "mt-1 text-sm font-semibold text-gray-900";
371
+ return /* @__PURE__ */ jsx(Tag, { className: cls, children: renderInline(heading[2]) }, key);
372
+ }
373
+ if (lines.length === 1 && /^---+$/.test(first)) {
374
+ return /* @__PURE__ */ jsx("hr", { className: "border-gray-200" }, key);
375
+ }
376
+ if (isTable(lines)) {
377
+ return renderTable(lines, key);
378
+ }
379
+ if (/^>\s?/.test(first)) {
380
+ const text = lines.map((l) => l.replace(/^>\s?/, "")).join(" ");
381
+ return /* @__PURE__ */ jsx(
382
+ "div",
383
+ {
384
+ className: "my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",
385
+ children: renderInline(text)
386
+ },
387
+ key
388
+ );
389
+ }
390
+ const img = /^!\[([^\]]*)\]\(([^)]+)\)$/.exec(first);
391
+ if (img && lines.length === 1) {
392
+ return /* @__PURE__ */ jsx(ScreenshotPlaceholder, { alt: img[1] }, key);
393
+ }
394
+ if (/^[-*]\s+/.test(first)) {
395
+ const items = collectItems(lines, /^[-*]\s+(.*)$/);
396
+ return /* @__PURE__ */ jsx("ul", { className: "list-disc space-y-1 pl-5 marker:text-gray-400", children: items.map((it, j) => /* @__PURE__ */ jsx("li", { children: renderInline(it) }, j)) }, key);
397
+ }
398
+ const ordered = /^(\d+)\.\s+/.exec(first);
399
+ if (ordered) {
400
+ const items = collectItems(lines, /^\d+\.\s+(.*)$/);
401
+ return /* @__PURE__ */ jsx(
402
+ "ol",
403
+ {
404
+ start: Number(ordered[1]),
405
+ className: "list-decimal space-y-1 pl-5 marker:text-gray-400",
406
+ children: items.map((it, j) => /* @__PURE__ */ jsx("li", { className: "pl-1", children: renderInline(it) }, j))
407
+ },
408
+ key
409
+ );
410
+ }
411
+ return /* @__PURE__ */ jsx("p", { children: renderInline(lines.join(" ")) }, key);
412
+ }
413
+ function Markdown({ children, className }) {
414
+ const blocks = (children ?? "").replace(/\r\n/g, "\n").split(/\n{2,}/).map((b) => b.replace(/\s+$/, "")).filter((b) => b.trim() !== "");
415
+ return /* @__PURE__ */ jsx("div", { className: `space-y-3 text-sm leading-relaxed text-gray-700 ${className ?? ""}`.trim(), children: blocks.map((block, i) => renderBlock(block, i)) });
416
+ }
259
417
  var Chevron = ({ open }) => /* @__PURE__ */ jsx(
260
418
  "svg",
261
419
  {
@@ -400,7 +558,7 @@ function HelpCenter({
400
558
  }
401
559
  )
402
560
  ] }),
403
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto px-5 py-4", children: renderBody ? renderBody(selected) : selected.body ? /* @__PURE__ */ jsx("pre", { className: "whitespace-pre-wrap text-sm text-gray-800 font-sans leading-relaxed", children: selected.body }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 italic", children: "This article has no body yet." }) })
561
+ /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto px-5 py-4", children: renderBody ? renderBody(selected) : selected.body ? /* @__PURE__ */ jsx(Markdown, { children: selected.body }) : /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 italic", children: "This article has no body yet." }) })
404
562
  ] }) : /* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center px-6 text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: loading ? "Loading\u2026" : "Pick a help article from the left." }) }) })
405
563
  ] });
406
564
  }
@@ -1063,7 +1221,7 @@ function StatusBadge({ status }) {
1063
1221
  }
1064
1222
 
1065
1223
  // src/version.ts
1066
- var VERSION = "0.6.5" ;
1224
+ var VERSION = "0.6.7" ;
1067
1225
  var APP_VERSION = VERSION;
1068
1226
 
1069
1227
  // src/changelog.ts
@@ -6271,6 +6429,6 @@ function useEditHotkey(callback) {
6271
6429
  }, [callback, isActive]);
6272
6430
  }
6273
6431
 
6274
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, BugReportConfigProvider, BugReportDetail, BugReportProvider, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Customization, Desktop, DesktopHostProvider, ENTER, EntityList, GlobalSearch, HelpCenter, Layout, ListFooter, MOD, MailConnectModal, NotificationBell, ResizableTable, SHIFT, ShellEntityFetcherProvider, ShortcutHelp, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, SystemPreferences, VERSION, createWindowRegistry, isMac, openBugReportDialog, reportBug, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
6432
+ export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, BugReportConfigProvider, BugReportDetail, BugReportProvider, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Customization, Desktop, DesktopHostProvider, ENTER, EntityList, GlobalSearch, HelpCenter, Layout, ListFooter, MOD, MailConnectModal, Markdown, NotificationBell, ResizableTable, SHIFT, ShellEntityFetcherProvider, ShortcutHelp, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, SystemPreferences, VERSION, createWindowRegistry, isMac, openBugReportDialog, reportBug, useBugReport, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
6275
6433
  //# sourceMappingURL=index.js.map
6276
6434
  //# sourceMappingURL=index.js.map