@flytedan/flytebot-design-system 0.75.0 → 0.77.0

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.cjs CHANGED
@@ -930,6 +930,7 @@ __export(index_exports, {
930
930
  CHAT_UNAVAILABLE: () => CHAT_UNAVAILABLE,
931
931
  COPIED_FEEDBACK_MS: () => COPIED_FEEDBACK_MS,
932
932
  CORNER_STACK_INSET_PROPERTY: () => CORNER_STACK_INSET_PROPERTY,
933
+ CORNER_STACK_OFFSET_PROPERTY: () => CORNER_STACK_OFFSET_PROPERTY,
933
934
  Calendar: () => Calendar,
934
935
  Card: () => Card,
935
936
  CardGrid: () => CardGrid,
@@ -1036,6 +1037,7 @@ __export(index_exports, {
1036
1037
  RoadmapTimeline: () => RoadmapTimeline,
1037
1038
  RunActions: () => RunActions,
1038
1039
  RuntimeKit: () => RuntimeKit,
1040
+ SHEET_OPEN_ATTRIBUTE: () => SHEET_OPEN_ATTRIBUTE,
1039
1041
  SaturationDistribution: () => SaturationDistribution,
1040
1042
  ScoreMeter: () => ScoreMeter,
1041
1043
  ScreenHead: () => ScreenHead,
@@ -1140,10 +1142,12 @@ __export(index_exports, {
1140
1142
  useLayerZIndex: () => useLayerZIndex,
1141
1143
  useOverlayLayout: () => useOverlayLayout,
1142
1144
  usePopoverPosition: () => usePopoverPosition,
1145
+ usePublishCornerStackOffset: () => usePublishCornerStackOffset,
1143
1146
  useResponsiveRail: () => useResponsiveRail,
1144
1147
  useRuntimeMode: () => useRuntimeMode,
1145
1148
  useServerTable: () => useServerTable,
1146
1149
  useSessionContext: () => useSessionContext,
1150
+ useSheetOpenMark: () => useSheetOpenMark,
1147
1151
  useStackedLayer: () => useStackedLayer,
1148
1152
  useStagedFiles: () => useStagedFiles,
1149
1153
  useToast: () => useToast,
@@ -2423,6 +2427,30 @@ function CornerStackPortal({ slot, children }) {
2423
2427
  const element = useCornerStackSlot(slot);
2424
2428
  return element ? (0, import_react_dom5.createPortal)(children, element) : null;
2425
2429
  }
2430
+ var CORNER_STACK_OFFSET_PROPERTY = "--fd-corner-stack-offset";
2431
+ var SHEET_OPEN_ATTRIBUTE = "data-fd-sheet-open";
2432
+ function usePublishCornerStackOffset(ref, active) {
2433
+ useSlotEffect(() => {
2434
+ const el = ref.current;
2435
+ if (!active || !el) return;
2436
+ const root = document.documentElement;
2437
+ const publish = () => root.style.setProperty(CORNER_STACK_OFFSET_PROPERTY, `${el.getBoundingClientRect().width}px`);
2438
+ publish();
2439
+ const observer = typeof ResizeObserver === "function" ? new ResizeObserver(publish) : null;
2440
+ observer?.observe(el);
2441
+ return () => {
2442
+ observer?.disconnect();
2443
+ root.style.removeProperty(CORNER_STACK_OFFSET_PROPERTY);
2444
+ };
2445
+ }, [ref, active]);
2446
+ }
2447
+ function useSheetOpenMark(active) {
2448
+ useSlotEffect(() => {
2449
+ if (!active) return;
2450
+ document.documentElement.setAttribute(SHEET_OPEN_ATTRIBUTE, "");
2451
+ return () => document.documentElement.removeAttribute(SHEET_OPEN_ATTRIBUTE);
2452
+ }, [active]);
2453
+ }
2426
2454
 
2427
2455
  // src/components/loading/ProgressBar.tsx
2428
2456
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -2819,6 +2847,8 @@ function DockedSidePanel({ open: open2, children: childrenNow, ...widthOptions }
2819
2847
  const { width, setWidth } = useResizableWidth(widthOptions);
2820
2848
  const drag = React19.useRef(null);
2821
2849
  const [resizing, setResizing] = React19.useState(false);
2850
+ const boxRef = React19.useRef(null);
2851
+ usePublishCornerStackOffset(boxRef, rendered);
2822
2852
  if (!rendered) return null;
2823
2853
  const onPointerDown = (e) => {
2824
2854
  e.preventDefault();
@@ -2842,6 +2872,7 @@ function DockedSidePanel({ open: open2, children: childrenNow, ...widthOptions }
2842
2872
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2843
2873
  "div",
2844
2874
  {
2875
+ ref: boxRef,
2845
2876
  className: ["fd-sidepanel", animateEnter ? "is-entering" : "", closing ? "is-closing" : "", resizing ? "is-resizing" : ""].filter(Boolean).join(" "),
2846
2877
  "data-open": open2 ? "true" : "false",
2847
2878
  style: { width },
@@ -2903,6 +2934,7 @@ function AppShell({
2903
2934
  initialOpen: initialNavOpen,
2904
2935
  onPersist: onNavOpenChange
2905
2936
  });
2937
+ useSheetOpenMark(Boolean(sidePanel?.open) && rail.overlay);
2906
2938
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
2907
2939
  "div",
2908
2940
  {
@@ -14240,6 +14272,14 @@ function useChatEngine(opts) {
14240
14272
  if (!fail(err)) setStatus("ready");
14241
14273
  }
14242
14274
  }, [loadThread]);
14275
+ const refresh2 = React75.useCallback(async () => {
14276
+ if (!threadRef.current) return;
14277
+ try {
14278
+ await mergeThread();
14279
+ } catch (err) {
14280
+ fail(err);
14281
+ }
14282
+ }, [apiAdapter]);
14243
14283
  return {
14244
14284
  status,
14245
14285
  threadId,
@@ -14256,6 +14296,7 @@ function useChatEngine(opts) {
14256
14296
  removeQueued,
14257
14297
  setFeedback,
14258
14298
  reload,
14299
+ refresh: refresh2,
14259
14300
  canSend: status === "ready"
14260
14301
  };
14261
14302
  }
@@ -15072,6 +15113,7 @@ function AgentChatPanel({
15072
15113
  draftOwner,
15073
15114
  apiAdapter,
15074
15115
  threadId,
15116
+ reloadKey,
15075
15117
  /* identity + chrome */
15076
15118
  title = "Assistant",
15077
15119
  subtitle,
@@ -15164,6 +15206,13 @@ function AgentChatPanel({
15164
15206
  onClear,
15165
15207
  onFeedback
15166
15208
  });
15209
+ const { refresh: refresh2 } = engine;
15210
+ const lastReloadKey = React80.useRef(reloadKey);
15211
+ React80.useEffect(() => {
15212
+ if (lastReloadKey.current === reloadKey) return;
15213
+ lastReloadKey.current = reloadKey;
15214
+ refresh2();
15215
+ }, [reloadKey, refresh2]);
15167
15216
  const narrow = surface === "sidebar" ? panelWidth < NARROW_PANEL_WIDTH : surface === "sheet";
15168
15217
  const ctx = {
15169
15218
  assistantName,
@@ -16615,6 +16664,7 @@ function useDocumentTitle(routeTitle, appName) {
16615
16664
  CHAT_UNAVAILABLE,
16616
16665
  COPIED_FEEDBACK_MS,
16617
16666
  CORNER_STACK_INSET_PROPERTY,
16667
+ CORNER_STACK_OFFSET_PROPERTY,
16618
16668
  Calendar,
16619
16669
  Card,
16620
16670
  CardGrid,
@@ -16721,6 +16771,7 @@ function useDocumentTitle(routeTitle, appName) {
16721
16771
  RoadmapTimeline,
16722
16772
  RunActions,
16723
16773
  RuntimeKit,
16774
+ SHEET_OPEN_ATTRIBUTE,
16724
16775
  SaturationDistribution,
16725
16776
  ScoreMeter,
16726
16777
  ScreenHead,
@@ -16825,10 +16876,12 @@ function useDocumentTitle(routeTitle, appName) {
16825
16876
  useLayerZIndex,
16826
16877
  useOverlayLayout,
16827
16878
  usePopoverPosition,
16879
+ usePublishCornerStackOffset,
16828
16880
  useResponsiveRail,
16829
16881
  useRuntimeMode,
16830
16882
  useServerTable,
16831
16883
  useSessionContext,
16884
+ useSheetOpenMark,
16832
16885
  useStackedLayer,
16833
16886
  useStagedFiles,
16834
16887
  useToast,