@copilotkit/react-core 2.0.0-rc.14 → 2.0.0-rc.15

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
  "use client";
2
2
 
3
- import { F as toJsonSchema, K as IconSvg, O as isRecord, P as createGenerativeUI, _ as GenerativeUINodeContext, b as useRequiredGenerativeUIRuntime, c as SurfaceView, d as namedRole, f as useGenerativeUIAccessibility, g as useManagerVersion, h as useGenerativeUIState, j as GenerativeUIError, l as DARK_THEME_CSS, m as useGenerativeUIFunction, n as ProviderMarkdown, p as wrapperAria, r as DefaultGenerativeUIChatCard, t as MarkdownSurfaces, u as controlAria, y as useGenerativeUIRuntime } from "./MarkdownSurfaces-DKC9Eg_a.mjs";
3
+ import { F as toJsonSchema, K as IconSvg, O as isRecord, P as createGenerativeUI, _ as GenerativeUINodeContext, b as useRequiredGenerativeUIRuntime, c as SurfaceView, d as namedRole, f as useGenerativeUIAccessibility, g as useManagerVersion, h as useGenerativeUIState, j as GenerativeUIError, l as DARK_THEME_CSS, m as useGenerativeUIFunction, n as ProviderMarkdown, p as wrapperAria, r as DefaultGenerativeUIChatCard, t as MarkdownSurfaces, u as controlAria, y as useGenerativeUIRuntime } from "./MarkdownSurfaces-DAEqIF5v.mjs";
4
4
  import React, { Suspense, createContext, isValidElement, memo, useCallback, useContext, useEffect, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { A2UI_CHILD_LIST_MARK, A2UI_CHILD_LIST_REF, A2UI_COMPONENT_ID_MARK, A2UI_COMPONENT_ID_REF, GENERATIVE_UI_FUNCTIONS, GENERATIVE_UI_MAX_TARGET_COMPONENTS, childRefKind, functionCallers } from "@copilotkit/shared";
@@ -6348,7 +6348,7 @@ function dateTimeMode(props) {
6348
6348
  /** The date and the time of an ISO 8601 value: a date, a time, or both. */
6349
6349
  function splitDateTime(value) {
6350
6350
  const [head, tail] = value.split("T");
6351
- if (tail !== void 0) return {
6351
+ if (head !== void 0 && tail !== void 0) return {
6352
6352
  date: head,
6353
6353
  time: tail
6354
6354
  };
@@ -6409,7 +6409,7 @@ function fullTime(time) {
6409
6409
  }
6410
6410
  /** The minute of the day of a time, rounded up to a whole minute. */
6411
6411
  function timeToMinute(time) {
6412
- const [hours, minutes, seconds] = fullTime(time).split(":").map(Number);
6412
+ const [hours = NaN, minutes = NaN, seconds = NaN] = fullTime(time).split(":").map(Number);
6413
6413
  return hours * 60 + minutes + (seconds > 0 ? 1 : 0);
6414
6414
  }
6415
6415
  /**
@@ -7035,8 +7035,10 @@ function SegmentedControl(props) {
7035
7035
  const onKeyDown = (event, index) => {
7036
7036
  const next = nextOptionIndex(event.key, index, options.length);
7037
7037
  if (next === void 0) return;
7038
+ const option = options[next];
7039
+ if (option === void 0) return;
7038
7040
  event.preventDefault();
7039
- props.setValue(options[next].value);
7041
+ props.setValue(option.value);
7040
7042
  segments.current[next]?.focus();
7041
7043
  };
7042
7044
  return /* @__PURE__ */ jsx(Field, {