@parallelworks/ui 0.83.3 → 0.84.1

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.
Files changed (56) hide show
  1. package/dist/ai/adapter/openai/createOpenAIStream.js +1 -1
  2. package/dist/ai/adapter/openai/sse.d.ts +3 -2
  3. package/dist/ai/adapter/openai/sse.js +4 -2
  4. package/dist/ai/adapter/types.d.ts +2 -1
  5. package/dist/ai/agent/index.d.ts +1 -1
  6. package/dist/ai/agent/toolfmt.d.ts +1 -0
  7. package/dist/ai/agent/toolfmt.js +6 -2
  8. package/dist/ai/ai.css +14 -0
  9. package/dist/ai/components/ChatActivity.js +6 -4
  10. package/dist/ai/components/ChatMessage.js +42 -30
  11. package/dist/ai/components/ChatMessageList.js +17 -9
  12. package/dist/ai/components/agent/AgentMessageParts.d.ts +1 -1
  13. package/dist/ai/components/agent/AgentMessageParts.js +77 -23
  14. package/dist/ai/core/ChatProvider.d.ts +3 -1
  15. package/dist/ai/core/ChatProvider.js +27 -6
  16. package/dist/ai/core/chatReducer.d.ts +6 -1
  17. package/dist/ai/core/chatReducer.js +18 -1
  18. package/dist/ai/core/config.d.ts +2 -1
  19. package/dist/ai/core/parts.d.ts +7 -4
  20. package/dist/ai/core/parts.js +23 -2
  21. package/dist/ai/core/useSSEStream.d.ts +8 -0
  22. package/dist/ai/core/useSSEStream.js +80 -22
  23. package/dist/ai/index.js +2 -2
  24. package/dist/ai/types.d.ts +14 -0
  25. package/dist/components/Avatar.d.ts +4 -2
  26. package/dist/components/Avatar.js +2 -1
  27. package/dist/components/Kbd.d.ts +5 -2
  28. package/dist/components/Kbd.js +4 -1
  29. package/dist/components/LetterBadge.d.ts +7 -3
  30. package/dist/components/LetterBadge.js +2 -3
  31. package/dist/components/Loader.d.ts +6 -4
  32. package/dist/components/Loader.js +53 -1
  33. package/dist/components/MarkdownImpl.d.ts +3 -0
  34. package/dist/components/MarkdownImpl.js +16 -2
  35. package/dist/components/RefreshButton.d.ts +3 -2
  36. package/dist/components/RefreshButton.js +25 -14
  37. package/dist/components/RunStatusIcon.d.ts +5 -2
  38. package/dist/components/RunStatusIcon.js +2 -1
  39. package/dist/components/StatusBadge.d.ts +17 -11
  40. package/dist/components/StatusBadge.js +10 -5
  41. package/dist/components/Table.d.ts +11 -1
  42. package/dist/components/Table.js +15 -4
  43. package/dist/components/Tabs.js +1 -1
  44. package/dist/components/Tag.d.ts +5 -3
  45. package/dist/components/Tag.js +7 -1
  46. package/dist/components/relativeTime.d.ts +12 -9
  47. package/dist/components/relativeTime.js +4 -2
  48. package/dist/components/stickyTop.d.ts +9 -0
  49. package/dist/components/stickyTop.js +10 -1
  50. package/dist/graph/DependencyGraph.js +1 -1
  51. package/dist/index.d.ts +3 -3
  52. package/dist/list/ActionToolbar.js +1 -1
  53. package/dist/list/ListPage.js +32 -14
  54. package/dist/list/ListTable.js +13 -4
  55. package/dist/styles.css +1 -1
  56. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export { IconButton, type IconButtonProps } from './components/IconButton.js';
32
32
  export { formatInfoTipContent, InfoTip } from './components/InfoTip.js';
33
33
  export { Input, type InputProps, Textarea, type TextareaProps, TitleInput, type TitleInputProps, } from './components/Input.js';
34
34
  export { ariaKeyShortcuts, formatShortcut, isApplePlatform, Kbd, type KbdProps, type KbdSize, type KbdVariant, type KeyPlatform, shortcutText, useShortcutFormat, } from './components/Kbd.js';
35
- export { LetterBadge } from './components/LetterBadge.js';
35
+ export { LetterBadge, type LetterBadgeProps } from './components/LetterBadge.js';
36
36
  export { ListboxGroup, type ListboxNavigation, type ListboxNavigationOptions, ListboxOption, type ListboxOptionProps, ListboxPanel, type ListboxPanelProps, useListboxNavigation, } from './components/Listbox.js';
37
37
  export { Loader, type LoaderProps } from './components/Loader.js';
38
38
  export type { MarkdownProps } from './components/Markdown.js';
@@ -53,7 +53,7 @@ export { Radio, RadioGroup, type RadioProps } from './components/Radio.js';
53
53
  export { RefreshButton, type RefreshButtonProps } from './components/RefreshButton.js';
54
54
  export { RequiredMark } from './components/RequiredMark.js';
55
55
  export { RunStatusIcon, type RunStatusIconProps, type RunStatusIconStatus, runStatusTone, } from './components/RunStatusIcon.js';
56
- export { Elapsed, RelativeTime, type RelativeTimeFormat, type RelativeTimeProps, useClock, useElapsed, useRelativeTime, } from './components/relativeTime.js';
56
+ export { Elapsed, type ElapsedProps, RelativeTime, type RelativeTimeFormat, type RelativeTimeProps, useClock, useElapsed, useRelativeTime, } from './components/relativeTime.js';
57
57
  export { SearchInput, type SearchInputProps } from './components/SearchInput.js';
58
58
  export { Section, type SectionProps, type SectionTone, type SectionVariant, } from './components/Section.js';
59
59
  export { SegmentedControl, type SegmentedControlRootProps, type SegmentedOption, } from './components/SegmentedControl.js';
@@ -63,7 +63,7 @@ export { SettingModeOption } from './components/SettingModeOption.js';
63
63
  export { SettingRow, SettingsCard, type SettingsCardProps, SettingsHeading, } from './components/SettingsCard.js';
64
64
  export { LoadingRegion, Skeleton, type SkeletonProps } from './components/Skeleton.js';
65
65
  export { Slider, type SliderProps } from './components/Slider.js';
66
- export { type BadgeEmphasis, type BadgeShape, type BadgeSize, type BadgeVariant, CountBadge, type CountBadgeProps, StatusBadge, type StatusBadgeProps, StatusDot, statusTextClass, } from './components/StatusBadge.js';
66
+ export { type BadgeEmphasis, type BadgeShape, type BadgeSize, type BadgeVariant, CountBadge, type CountBadgeProps, StatusBadge, type StatusBadgeProps, StatusDot, type StatusDotProps, statusTextClass, } from './components/StatusBadge.js';
67
67
  export { StickyBar, type StickyBarProps } from './components/StickyBar.js';
68
68
  export { Switch, type SwitchProps } from './components/Switch.js';
69
69
  export type { SegmentTone } from './components/segmented.js';
@@ -3,12 +3,12 @@ import { buttonClasses } from "../components/buttonClasses.js";
3
3
  import { MoreIcon } from "../icons.js";
4
4
  import { MenuPopup, MenuSeparator } from "../components/Menu.js";
5
5
  import { isDev } from "../dev.js";
6
+ import { useStickyTop } from "../components/stickyTop.js";
6
7
  import { Loader } from "../components/Loader.js";
7
8
  import { Tooltip } from "../components/Tooltip.js";
8
9
  import { useStrings } from "../components/Provider.js";
9
10
  import { AppLink } from "../components/AppLink.js";
10
11
  import { MenuEntries, useRunAction, warnIfInert } from "../components/MenuEntries.js";
11
- import { useStickyTop } from "../components/stickyTop.js";
12
12
  import { Menu } from "@base-ui/react/menu";
13
13
  import { Fragment, cloneElement, createContext, isValidElement, use, useLayoutEffect, useRef, useState } from "react";
14
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -4,7 +4,7 @@ import { Tooltip } from "../components/Tooltip.js";
4
4
  import { useNavigation } from "../components/Provider.js";
5
5
  import { AppLink, isPlainClick } from "../components/AppLink.js";
6
6
  import { isMenuDivider, isMenuGroup, isMenuSubmenu, useRunAction, warnIfInert } from "../components/MenuEntries.js";
7
- import { Table } from "../components/Table.js";
7
+ import { CellPlacementContext, Table } from "../components/Table.js";
8
8
  import { ListFilterBar } from "./ListFilterBar.js";
9
9
  import { ListActionsHeader, ListError, ListSkeleton, StretchRowLinkContext } from "./ListTable.js";
10
10
  import { MoreButton, rowContextMenuProps, useRowMenuActive } from "./rowMenu.js";
@@ -85,28 +85,46 @@ function ListPage({ bleed = false, toolbar, filterBar, view, loading = false, er
85
85
  ]
86
86
  });
87
87
  }
88
+ var STACKED = { stacked: true };
89
+ var isCellElement = (child) => child.type === Table.Item || child.type === "td";
88
90
  function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selected, selectionActive, onRowSelect, leading, className, children }) {
89
91
  const { active: menuActive, openMenu: openRowMenu } = useRowMenuActive(openMenu);
90
92
  const { show: showActions, always: alwaysShowActions, columnClasses, columnStacks } = useContext(RowActionsContext);
91
93
  const cells = Children.toArray(children);
92
94
  const stacked = cells.flatMap((child, i) => {
93
95
  if (i === 0 || !columnStacks[i] || !isValidElement(child)) return [];
94
- const content = child.props.children;
95
- return Children.toArray(content).length > 0 ? [content] : [];
96
+ if (isCellElement(child)) {
97
+ const content = child.props.children;
98
+ return Children.toArray(content).length > 0 ? [child] : [];
99
+ }
100
+ return [child];
96
101
  });
102
+ const under = stacked.length > 0 ? stacked.map((child, j) => isValidElement(child) && child.type === "td" ? /* @__PURE__ */ jsx("div", {
103
+ className: "mt-1 flex min-w-0 items-center @[36rem]:hidden",
104
+ "data-stacked": true,
105
+ children: child.props.children
106
+ }, j) : /* @__PURE__ */ jsx(CellPlacementContext, {
107
+ value: STACKED,
108
+ children: child
109
+ }, j)) : void 0;
97
110
  const styledCells = cells.map((child, i) => {
98
111
  const cls = cx(columnClasses[i], i > 0 && stacked.length > 0 && !columnStacks[i] && STAYS_BESIDE_STACK);
99
- if (!isValidElement(child) || !cls && !(i === 0 && stacked.length > 0)) return child;
100
- const el = child;
101
- if (i === 0 && stacked.length > 0) return cloneElement(el, {
102
- className: cx(el.props.className, cls),
103
- children: /* @__PURE__ */ jsxs(Fragment$1, { children: [el.props.children, stacked.map((content, j) => /* @__PURE__ */ jsx("div", {
104
- className: "mt-1 flex min-w-0 items-center @[36rem]:hidden",
105
- "data-stacked": true,
106
- children: content
107
- }, j))] })
108
- });
109
- return cloneElement(el, { className: cx(el.props.className, cls) });
112
+ const after = i === 0 ? under : void 0;
113
+ if (!isValidElement(child) || !cls && !after) return child;
114
+ if (child.type === "td") {
115
+ const el = child;
116
+ return cloneElement(el, {
117
+ className: cx(el.props.className, cls),
118
+ ...after ? { children: /* @__PURE__ */ jsxs(Fragment$1, { children: [el.props.children, after] }) } : {}
119
+ });
120
+ }
121
+ return /* @__PURE__ */ jsx(CellPlacementContext, {
122
+ value: {
123
+ className: cls || void 0,
124
+ after
125
+ },
126
+ children: child
127
+ }, child.key);
110
128
  });
111
129
  const floating = !alwaysShowActions && !(pinnedActions && pinnedActions.length > 0);
112
130
  const stretch = !!href && !selectionActive;
@@ -5,7 +5,7 @@ import { AppLink } from "../components/AppLink.js";
5
5
  import { positionKeys } from "../components/keys.js";
6
6
  import { LoadingRegion, Skeleton } from "../components/Skeleton.js";
7
7
  import { Checkbox } from "../components/Checkbox.js";
8
- import { Table } from "../components/Table.js";
8
+ import { CellPlacementContext, Table } from "../components/Table.js";
9
9
  import { createContext, useContext } from "react";
10
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/list/ListTable.tsx
@@ -43,6 +43,8 @@ var STRETCHED_LINK = "after:absolute after:inset-0 after:content-[''] focus-visi
43
43
  var STRETCHED_LINK_ROW = "relative [&_:is(a,button,input,label,[role=checkbox]):not([data-row-link])]:relative [&_:is(a,button,input,label,[role=checkbox]):not([data-row-link])]:z-[1]";
44
44
  function NameCell({ icon, iconTile = false, name, subtitle, href, badge, title, children }) {
45
45
  const stretch = useContext(StretchRowLinkContext);
46
+ const placed = useContext(CellPlacementContext);
47
+ const under = placed?.after;
46
48
  const hasIcon = icon !== null && icon !== void 0 && icon !== false;
47
49
  const columns = hasIcon ? "col-span-2 grid grid-cols-subgrid items-center" : "flex items-center";
48
50
  const inner = /* @__PURE__ */ jsxs(Fragment$1, { children: [hasIcon && (iconTile && subtitle ? /* @__PURE__ */ jsx("span", {
@@ -65,7 +67,7 @@ function NameCell({ icon, iconTile = false, name, subtitle, href, badge, title,
65
67
  children: subtitle
66
68
  })]
67
69
  })] });
68
- return /* @__PURE__ */ jsx(Table.Item, {
70
+ const cell = /* @__PURE__ */ jsx(Table.Item, {
69
71
  className: "py-2.5",
70
72
  children: /* @__PURE__ */ jsxs("div", {
71
73
  className: cx("grid min-w-0", hasIcon ? "grid-cols-[auto_minmax(0,1fr)] gap-x-2.5" : "grid-cols-[minmax(0,1fr)]"),
@@ -77,12 +79,19 @@ function NameCell({ icon, iconTile = false, name, subtitle, href, badge, title,
77
79
  }) : /* @__PURE__ */ jsx("div", {
78
80
  className: cx("min-w-0", columns),
79
81
  children: inner
80
- }), !!children && /* @__PURE__ */ jsx("div", {
82
+ }), (!!children || !!under) && /* @__PURE__ */ jsxs("div", {
81
83
  className: hasIcon ? "col-start-2 min-w-0" : "min-w-0",
82
- children
84
+ children: [children, under]
83
85
  })]
84
86
  })
85
87
  });
88
+ return placed?.after ? /* @__PURE__ */ jsx(CellPlacementContext, {
89
+ value: {
90
+ ...placed,
91
+ after: void 0
92
+ },
93
+ children: cell
94
+ }) : cell;
86
95
  }
87
96
  /** A row's column text: muted 13px, or monospace for an ID, a path or a
88
97
  * hash. The style sits on the text rather than the cell, so it carries over