@copilotkit/react-core 1.79.1-canary.1792091124 → 1.79.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.
@@ -1655,7 +1655,7 @@ function useRenderToolCall() {
1655
1655
 
1656
1656
  //#endregion
1657
1657
  //#region package.json
1658
- var version = "1.79.1-canary.1792091124";
1658
+ var version = "1.79.1";
1659
1659
 
1660
1660
  //#endregion
1661
1661
  //#region src/v2/components/CopilotKitInspector.tsx
@@ -7795,8 +7795,6 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7795
7795
  (0, _copilotkit_shared.commitRowKeyStore)(rowKeyStore, renderedMessages);
7796
7796
  }, [rowKeyStore, renderedMessages]);
7797
7797
  const stableGroupKey = (key) => rowRenderKeys.get(key) ?? key;
7798
- const rowKey = (row) => row.type === "group" ? `${GROUP_ROW_KEY_PREFIX}${stableGroupKey(row.key)}` : rowRenderKeys.get(row.message.id) ?? row.message.id;
7799
- const rowKeys = (0, react.useMemo)(() => rows.map(rowKey), [rows, rowRenderKeys]);
7800
7798
  const groupStateRef = (0, react.useRef)(/* @__PURE__ */ new Map());
7801
7799
  const groupSettersRef = (0, react.useRef)(/* @__PURE__ */ new Map());
7802
7800
  const groupStateThreadRef = (0, react.useRef)(config?.threadId);
@@ -7870,8 +7868,6 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7870
7868
  total: 0,
7871
7869
  sizes: /* @__PURE__ */ new Map()
7872
7870
  });
7873
- const rowKeysRef = react.default.useRef(rowKeys);
7874
- rowKeysRef.current = rowKeys;
7875
7871
  const firstMessageId = deduplicatedMessages[0]?.id;
7876
7872
  const measuredThreadRef = react.default.useRef(firstMessageId);
7877
7873
  if (measuredThreadRef.current !== firstMessageId) {
@@ -7881,16 +7877,6 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7881
7877
  sizes: /* @__PURE__ */ new Map()
7882
7878
  };
7883
7879
  }
7884
- const measuredKeysRef = react.default.useRef(rowKeys);
7885
- if (measuredKeysRef.current !== rowKeys) {
7886
- measuredKeysRef.current = rowKeys;
7887
- const live = new Set(rowKeys);
7888
- const measured = measuredRef.current;
7889
- for (const [key, height] of measured.sizes) if (!live.has(key)) {
7890
- measured.sizes.delete(key);
7891
- measured.total -= height;
7892
- }
7893
- }
7894
7880
  const estimateRowSize = react.default.useCallback(() => {
7895
7881
  const { total, sizes } = measuredRef.current;
7896
7882
  return sizes.size > 0 ? Math.max(1, Math.round(total / sizes.size)) : 100;
@@ -7898,15 +7884,13 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7898
7884
  const measureRowElement = react.default.useCallback((el) => {
7899
7885
  const height = el?.getBoundingClientRect().height ?? 0;
7900
7886
  const index = Number(el?.dataset?.index);
7901
- const key = Number.isInteger(index) ? rowKeysRef.current[index] : void 0;
7902
- if (height > 0 && key !== void 0) {
7887
+ if (height > 0 && Number.isInteger(index)) {
7903
7888
  const { total, sizes } = measuredRef.current;
7904
- measuredRef.current.total = total - (sizes.get(key) ?? 0) + height;
7905
- sizes.set(key, height);
7889
+ measuredRef.current.total = total - (sizes.get(index) ?? 0) + height;
7890
+ sizes.set(index, height);
7906
7891
  }
7907
7892
  return height;
7908
7893
  }, []);
7909
- const getRowKey = react.default.useCallback((index) => rowKeys[index] ?? index, [rowKeys]);
7910
7894
  const isPinnedToBottomRef = react.default.useRef(isPinnedToBottom);
7911
7895
  const shouldAdjustScrollOnResize = react.default.useCallback((item, _delta, instance) => {
7912
7896
  if (isPinnedToBottomRef.current) return false;
@@ -7917,7 +7901,6 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7917
7901
  count: shouldVirtualize ? rows.length : 0,
7918
7902
  getScrollElement: () => scrollElement,
7919
7903
  estimateSize: estimateRowSize,
7920
- getItemKey: getRowKey,
7921
7904
  overscan: 5,
7922
7905
  measureElement: measureRowElement,
7923
7906
  initialRect: {
@@ -7981,6 +7964,7 @@ function CopilotChatMessageView({ messages = [], assistantMessage, userMessage,
7981
7964
  }, `intelligence-${intelligenceTurnId}`));
7982
7965
  return elements.filter(Boolean);
7983
7966
  };
7967
+ const rowKey = (row) => row.type === "group" ? `${GROUP_ROW_KEY_PREFIX}${stableGroupKey(row.key)}` : rowRenderKeys.get(row.message.id) ?? row.message.id;
7984
7968
  const renderRow = (row) => {
7985
7969
  if (row.type === "message") return renderMessageBlock(row.message);
7986
7970
  const Wrapper = row.wrapper;
@@ -13410,4 +13394,4 @@ Object.defineProperty(exports, 'useToast', {
13410
13394
  return useToast;
13411
13395
  }
13412
13396
  });
13413
- //# sourceMappingURL=copilotkit-jYAQvLTA.cjs.map
13397
+ //# sourceMappingURL=copilotkit-DEaA0Cat.cjs.map