@aleph-alpha/chat-kit 1.15.0 → 1.15.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 (36) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-D8In_Dnl.js → CkInput.vue_vue_type_script_setup_true_lang-DedLzDoO.js} +134 -65
  2. package/dist/components/base/CkHistoryItem/CkHistoryItem.stories.d.ts.map +1 -1
  3. package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts.map +1 -1
  4. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.d.ts.map +1 -1
  5. package/dist/components/composed/CkHistory/CkHistory.stories.d.ts +15 -0
  6. package/dist/components/composed/CkHistory/CkHistory.stories.d.ts.map +1 -1
  7. package/dist/components/composed/CkHistory/CkHistory.vue.d.ts +6 -0
  8. package/dist/components/composed/CkHistory/CkHistory.vue.d.ts.map +1 -1
  9. package/dist/components/composed/CkHistory/types.d.ts +33 -0
  10. package/dist/components/composed/CkHistory/types.d.ts.map +1 -1
  11. package/dist/components/index.js +1 -1
  12. package/dist/handlers/index.js +1 -1
  13. package/dist/handlers/useChatKitLabels.d.ts +5 -0
  14. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  15. package/dist/helpers/formatRelativeTime.d.ts +10 -0
  16. package/dist/helpers/formatRelativeTime.d.ts.map +1 -0
  17. package/dist/helpers/index.d.ts +1 -0
  18. package/dist/helpers/index.d.ts.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +3 -2
  22. package/dist/{useChatKitLabels-BxNkTzr2.js → useChatKitLabels-BC6ItJc6.js} +2 -1
  23. package/package.json +1 -1
  24. package/src/components/base/CkHistoryItem/CkHistoryItem.spec.ts +0 -2
  25. package/src/components/base/CkHistoryItem/CkHistoryItem.stories.ts +0 -6
  26. package/src/components/base/CkHistoryItem/CkHistoryItem.vue +2 -3
  27. package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.ts +23 -23
  28. package/src/components/composed/CkHistory/CkHistory.spec.ts +107 -0
  29. package/src/components/composed/CkHistory/CkHistory.stories.ts +91 -3
  30. package/src/components/composed/CkHistory/CkHistory.vue +94 -44
  31. package/src/components/composed/CkHistory/types.ts +33 -0
  32. package/src/handlers/useChatKitLabels.spec.ts +1 -0
  33. package/src/handlers/useChatKitLabels.ts +6 -0
  34. package/src/helpers/formatRelativeTime.ts +49 -0
  35. package/src/helpers/index.ts +1 -0
  36. package/src/index.ts +3 -0
@@ -1,6 +1,41 @@
1
1
  import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, computed, normalizeClass, toRefs, h, useId, createTextVNode, useAttrs, useSlots, withModifiers, resolveDynamicComponent, useTemplateRef, onBeforeUnmount, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
- import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-BxNkTzr2.js";
2
+ import { u as useChatKitLabels, d as defaultChatKitLabels, a as useMarkdownParser } from "./useChatKitLabels-BC6ItJc6.js";
3
3
  import { UiButton, UiTooltip, UiIcon, UiDialog, UiDialogContent, UiDialogDescription, UiFieldLabel, UiToggleGroup, UiToggleGroupItem, UiField, UiTextarea, UiFileItem, UiPopover, UiPopoverTrigger, UiFileType, UiPopoverContent, Primitive, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
4
+ const MINUTE = 60;
5
+ const HOUR = 60 * MINUTE;
6
+ const DAY = 24 * HOUR;
7
+ const WEEK = 7 * DAY;
8
+ const MONTH = 30 * DAY;
9
+ const YEAR = 365 * DAY;
10
+ function formatRelativeTime(unixSeconds, nowSeconds = Math.floor(Date.now() / 1e3)) {
11
+ const delta = Math.max(0, nowSeconds - unixSeconds);
12
+ if (delta < MINUTE) return "Just now";
13
+ if (delta < HOUR) {
14
+ const mins = Math.floor(delta / MINUTE);
15
+ return mins === 1 ? "1 minute ago" : `${mins} minutes ago`;
16
+ }
17
+ if (delta < DAY) {
18
+ const hrs = Math.floor(delta / HOUR);
19
+ return hrs === 1 ? "1 hour ago" : `${hrs} hours ago`;
20
+ }
21
+ if (delta < 2 * DAY) return "Yesterday";
22
+ if (delta < WEEK) {
23
+ const days = Math.floor(delta / DAY);
24
+ return `${days} days ago`;
25
+ }
26
+ if (delta < 2 * WEEK) return "1 week ago";
27
+ if (delta < MONTH) {
28
+ const weeks = Math.floor(delta / WEEK);
29
+ return `${weeks} weeks ago`;
30
+ }
31
+ if (delta < 2 * MONTH) return "1 month ago";
32
+ if (delta < YEAR) {
33
+ const months = Math.floor(delta / MONTH);
34
+ return `${months} months ago`;
35
+ }
36
+ const years = Math.floor(delta / YEAR);
37
+ return years === 1 ? "1 year ago" : `${years} years ago`;
38
+ }
4
39
  const _hoisted_1$b = {
5
40
  xmlns: "http://www.w3.org/2000/svg",
6
41
  width: "16",
@@ -1102,10 +1137,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
1102
1137
  props.showActionOnHover ? "[&_button]:opacity-0 [&_button]:transition-opacity group-hover/ck-history-item:[&_button]:opacity-100 group-focus-within/ck-history-item:[&_button]:opacity-100" : ""
1103
1138
  ]);
1104
1139
  const actionButtonClass = computed(() => [
1105
- "relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-sm border border-transparent text-content-on-surface-primary outline-hidden transition-colors",
1140
+ "relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-sm border-0 text-content-on-surface-primary outline-hidden transition-colors",
1106
1141
  "[&_svg]:size-4 [&_svg]:shrink-0",
1107
1142
  "focus-visible:ring-0 focus-visible:outline-none",
1108
- pointerOnAction.value && "bg-background-surface-muted-subtle border-border-button-outlined"
1143
+ pointerOnAction.value && "bg-background-surface-muted-subtle"
1109
1144
  ]);
1110
1145
  const actionPopoverPanelClass = computed(() => [
1111
1146
  "w-auto min-w-48 max-w-sm p-0 bg-background-surface-secondary",
@@ -1671,13 +1706,27 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1671
1706
  hrefResolver: {},
1672
1707
  activeId: { default: void 0 },
1673
1708
  showAction: { type: Boolean, default: true },
1674
- showActionOnHover: { type: Boolean, default: true }
1709
+ showActionOnHover: { type: Boolean, default: true },
1710
+ timeFormatter: { type: Function, default: formatRelativeTime },
1711
+ collapsedLimit: { default: 5 },
1712
+ maxHeight: { default: void 0 }
1675
1713
  },
1676
1714
  emits: ["select", "edit", "delete"],
1677
1715
  setup(__props, { emit: __emit }) {
1678
1716
  const props = __props;
1679
1717
  const emit = __emit;
1680
1718
  const labels = useChatKitLabels();
1719
+ const isExpanded = ref(false);
1720
+ const canCollapse = computed(
1721
+ () => props.collapsedLimit > 0 && props.conversations.length > props.collapsedLimit
1722
+ );
1723
+ const visibleConversations = computed(() => {
1724
+ if (!canCollapse.value || isExpanded.value) return props.conversations;
1725
+ return props.conversations.slice(0, props.collapsedLimit);
1726
+ });
1727
+ function toggleExpanded() {
1728
+ isExpanded.value = !isExpanded.value;
1729
+ }
1681
1730
  function hrefFor(c) {
1682
1731
  return props.hrefResolver(c.id);
1683
1732
  }
@@ -1685,6 +1734,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1685
1734
  const title = c.title?.trim();
1686
1735
  return title ? title : labels.value.historyItemUntitled;
1687
1736
  }
1737
+ function timeFor(c) {
1738
+ return props.timeFormatter?.(c.updatedAt);
1739
+ }
1688
1740
  function handleRowClick(c, event) {
1689
1741
  if (event.defaultPrevented) return;
1690
1742
  if (event.button !== 0) return;
@@ -1693,68 +1745,84 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1693
1745
  emit("select", c, event);
1694
1746
  }
1695
1747
  return (_ctx, _cache) => {
1696
- return openBlock(), createBlock(_sfc_main$8, null, {
1697
- default: withCtx(() => [
1698
- (openBlock(true), createElementBlock(Fragment, null, renderList(props.conversations, (conversation) => {
1699
- return renderSlot(_ctx.$slots, "item", {
1700
- key: conversation.id,
1701
- conversation,
1702
- href: hrefFor(conversation),
1703
- isActive: conversation.id === props.activeId,
1704
- title: titleFor(conversation),
1705
- select: (event) => handleRowClick(conversation, event),
1706
- edit: () => emit("edit", conversation),
1707
- delete: () => emit("delete", conversation)
1708
- }, () => [
1709
- createVNode(_sfc_main$9, {
1710
- as: "a",
1748
+ return openBlock(), createElementBlock("div", null, [
1749
+ createVNode(_sfc_main$8, {
1750
+ class: normalizeClass(isExpanded.value && props.maxHeight ? "overflow-y-auto" : void 0),
1751
+ style: normalizeStyle(
1752
+ isExpanded.value && props.maxHeight ? { maxHeight: props.maxHeight } : void 0
1753
+ )
1754
+ }, {
1755
+ default: withCtx(() => [
1756
+ (openBlock(true), createElementBlock(Fragment, null, renderList(visibleConversations.value, (conversation) => {
1757
+ return renderSlot(_ctx.$slots, "item", {
1758
+ key: conversation.id,
1759
+ conversation,
1711
1760
  href: hrefFor(conversation),
1712
- "is-active": conversation.id === props.activeId,
1761
+ isActive: conversation.id === props.activeId,
1713
1762
  title: titleFor(conversation),
1714
- "show-action": props.showAction,
1715
- "show-action-on-hover": props.showActionOnHover,
1716
- "action-popover": props.showAction,
1717
- "action-aria-label": unref(labels).historyItemActionAriaLabel,
1718
- onClick: ($event) => handleRowClick(conversation, $event)
1719
- }, {
1720
- "action-popover": withCtx(() => [
1721
- createVNode(unref(UiSidebarPopoverMenu), { "show-footer-separator": false }, {
1722
- default: withCtx(() => [
1723
- createVNode(unref(UiSidebarPopoverMenuItem), {
1724
- label: unref(labels).historyItemEditAction,
1725
- onClick: ($event) => emit("edit", conversation)
1726
- }, {
1727
- icon: withCtx(() => [
1728
- createVNode(unref(UiIcon), {
1729
- name: "pencil",
1730
- size: "s"
1731
- })
1732
- ]),
1733
- _: 1
1734
- }, 8, ["label", "onClick"]),
1735
- createVNode(unref(UiSidebarPopoverMenuItem), {
1736
- label: unref(labels).historyItemDeleteAction,
1737
- onClick: ($event) => emit("delete", conversation)
1738
- }, {
1739
- icon: withCtx(() => [
1740
- createVNode(unref(UiIcon), {
1741
- name: "trash",
1742
- size: "s"
1743
- })
1744
- ]),
1745
- _: 1
1746
- }, 8, ["label", "onClick"])
1747
- ]),
1748
- _: 2
1749
- }, 1024)
1750
- ]),
1751
- _: 2
1752
- }, 1032, ["href", "is-active", "title", "show-action", "show-action-on-hover", "action-popover", "action-aria-label", "onClick"])
1753
- ]);
1754
- }), 128))
1755
- ]),
1756
- _: 3
1757
- });
1763
+ time: timeFor(conversation),
1764
+ select: (event) => handleRowClick(conversation, event),
1765
+ edit: () => emit("edit", conversation),
1766
+ delete: () => emit("delete", conversation)
1767
+ }, () => [
1768
+ createVNode(_sfc_main$9, {
1769
+ as: "a",
1770
+ href: hrefFor(conversation),
1771
+ "is-active": conversation.id === props.activeId,
1772
+ title: titleFor(conversation),
1773
+ "meta-start": timeFor(conversation),
1774
+ "show-action": props.showAction,
1775
+ "show-action-on-hover": props.showActionOnHover,
1776
+ "action-popover": props.showAction,
1777
+ "action-aria-label": unref(labels).historyItemActionAriaLabel,
1778
+ onClick: ($event) => handleRowClick(conversation, $event)
1779
+ }, {
1780
+ "action-popover": withCtx(() => [
1781
+ createVNode(unref(UiSidebarPopoverMenu), { "show-footer-separator": false }, {
1782
+ default: withCtx(() => [
1783
+ createVNode(unref(UiSidebarPopoverMenuItem), {
1784
+ label: unref(labels).historyItemEditAction,
1785
+ onClick: ($event) => emit("edit", conversation)
1786
+ }, {
1787
+ icon: withCtx(() => [
1788
+ createVNode(unref(UiIcon), {
1789
+ name: "pencil",
1790
+ size: "s"
1791
+ })
1792
+ ]),
1793
+ _: 1
1794
+ }, 8, ["label", "onClick"]),
1795
+ createVNode(unref(UiSidebarPopoverMenuItem), {
1796
+ label: unref(labels).historyItemDeleteAction,
1797
+ onClick: ($event) => emit("delete", conversation)
1798
+ }, {
1799
+ icon: withCtx(() => [
1800
+ createVNode(unref(UiIcon), {
1801
+ name: "trash",
1802
+ size: "s"
1803
+ })
1804
+ ]),
1805
+ _: 1
1806
+ }, 8, ["label", "onClick"])
1807
+ ]),
1808
+ _: 2
1809
+ }, 1024)
1810
+ ]),
1811
+ _: 2
1812
+ }, 1032, ["href", "is-active", "title", "meta-start", "show-action", "show-action-on-hover", "action-popover", "action-aria-label", "onClick"])
1813
+ ]);
1814
+ }), 128))
1815
+ ]),
1816
+ _: 3
1817
+ }, 8, ["class", "style"]),
1818
+ canCollapse.value && !isExpanded.value ? (openBlock(), createElementBlock("button", {
1819
+ key: 0,
1820
+ type: "button",
1821
+ "data-testid": "ck-history-show-all",
1822
+ class: "mt-1 w-full rounded-lg px-2 py-2 text-center body-14-medium text-content-on-surface-muted transition-colors hover:bg-background-surface-muted-subtle",
1823
+ onClick: toggleExpanded
1824
+ }, toDisplayString(unref(labels).historyShowAll), 1)) : createCommentVNode("", true)
1825
+ ]);
1758
1826
  };
1759
1827
  }
1760
1828
  });
@@ -1873,5 +1941,6 @@ export {
1873
1941
  _sfc_main$6 as o,
1874
1942
  _sfc_main$k as p,
1875
1943
  _sfc_main$j as q,
1876
- CkUserMessage as r
1944
+ CkUserMessage as r,
1945
+ formatRelativeTime as s
1877
1946
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CkHistoryItem.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAsCpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AAkG5C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAOpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmC/B,CAAC"}
1
+ {"version":3,"file":"CkHistoryItem.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAEhD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,aAAa,CAqCpC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,aAAa,CAAC,CAAC;AA8F5C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAGrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CkHistoryItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.vue"],"names":[],"mappings":"AA0SA,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA0dzE,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKzD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CkHistoryItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryItem/CkHistoryItem.vue"],"names":[],"mappings":"AAySA,OAAO,KAAK,EAAsB,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAydzE,QAAA,IAAI,OAAO,IAAU,EAAE,QAAQ,IAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKzD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CkHistoryWrapper.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkBvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;AA2B/C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAwDrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KA4BxB,CAAC"}
1
+ {"version":3,"file":"CkHistoryWrapper.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AAGtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAkBvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAkC/C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KA8CrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KA+BxB,CAAC"}
@@ -30,4 +30,19 @@ export declare const RouterLinkIntegration: Story;
30
30
  * look while delegating navigation to the router.
31
31
  */
32
32
  export declare const WithCustomItem: Story;
33
+ /**
34
+ * Hides the relative time label by setting `time-formatter` to `undefined`.
35
+ * Rows display only the title (the pre-v1.14 default).
36
+ */
37
+ export declare const WithoutTime: Story;
38
+ /**
39
+ * With 10 conversations and a `collapsedLimit` of 5, only the first 5 rows
40
+ * are shown initially. A "Show all" button at the bottom reveals the rest
41
+ * and makes the list scrollable (capped at `maxHeight`).
42
+ */
43
+ export declare const CollapsedWithShowAll: Story;
44
+ /**
45
+ * All conversations visible without collapse — set `collapsedLimit` to `0`.
46
+ */
47
+ export declare const NoCollapse: Story;
33
48
  //# sourceMappingURL=CkHistory.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CkHistory.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/CkHistory.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,SAAS,MAAM,iBAAiB,CAAC;AA+CxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAoBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AA2KxC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAS5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAUnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,KAyE5B,CAAC"}
1
+ {"version":3,"file":"CkHistory.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/CkHistory.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAuExC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAsBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AA4LxC;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAS5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAUnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,KA0E5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,KASlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAQxB,CAAC"}
@@ -11,6 +11,8 @@ type __VLS_Slots = {
11
11
  * - `href` — URL produced by `hrefResolver(conversation.id)`
12
12
  * - `isActive` — whether this row matches `activeId`
13
13
  * - `title` — resolved title (falls back to `historyItemUntitled` label)
14
+ * - `time` — formatted relative time string from `timeFormatter`, or
15
+ * `undefined` when no formatter is set
14
16
  * - `select(event)` — RouterLink-style click guard: `preventDefault()`
15
17
  * and emit `select` for plain left-clicks; ignores middle/modifier
16
18
  * clicks so native browser affordances still work.
@@ -21,6 +23,7 @@ type __VLS_Slots = {
21
23
  href: string;
22
24
  isActive: boolean;
23
25
  title: string;
26
+ time: string | undefined;
24
27
  select: (event: MouseEvent) => void;
25
28
  edit: () => void;
26
29
  delete: () => void;
@@ -37,7 +40,10 @@ declare const __VLS_base: import("vue").DefineComponent<CkHistoryProps, {}, {},
37
40
  }>, {
38
41
  showAction: boolean;
39
42
  showActionOnHover: boolean;
43
+ maxHeight: string;
40
44
  activeId: string;
45
+ timeFormatter: (updatedAtSeconds: number) => string;
46
+ collapsedLimit: number;
41
47
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
48
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
49
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"CkHistory.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/CkHistory.vue"],"names":[],"mappings":"AAyIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9D,KAAK,WAAW,GAAG;IACjB;;;;;;;;;;;;;;OAcG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE;QACZ,YAAY,EAAE,YAAY,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;QACpC,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK,IAAI,CAAC;CACZ,CAAC;AAmOF,QAAA,MAAM,UAAU;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CkHistory.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/CkHistory.vue"],"names":[],"mappings":"AA6LA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,SAAS,CAAC;AAiB9D,KAAK,WAAW,GAAG;IACjB;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,EAAE,CAAC,KAAK,EAAE;QACZ,YAAY,EAAE,YAAY,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QACzB,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;QACpC,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,MAAM,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK,IAAI,CAAC;CACZ,CAAC;AAmSF,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;6EAId,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -49,6 +49,39 @@ export interface CkHistoryProps {
49
49
  * @default true
50
50
  */
51
51
  showActionOnHover?: boolean;
52
+ /**
53
+ * Formats a conversation's `updatedAt` timestamp (Unix seconds) into a
54
+ * human-readable relative time string displayed under the title.
55
+ *
56
+ * Defaults to the built-in `formatRelativeTime` which produces English
57
+ * labels like "Just now", "Yesterday", "3 days ago". Pass your own
58
+ * function for locale-aware formatting (e.g. via `Intl.RelativeTimeFormat`
59
+ * or your i18n library).
60
+ *
61
+ * To hide the time label entirely, pass `() => ''`.
62
+ *
63
+ * @default formatRelativeTime
64
+ */
65
+ timeFormatter?: (updatedAtSeconds: number) => string;
66
+ /**
67
+ * Maximum number of conversations shown in collapsed mode. When the
68
+ * array has more items than this limit a "Show all" button is rendered
69
+ * below the visible rows. Clicking it expands the list and makes it
70
+ * scrollable (capped at `maxHeight`).
71
+ *
72
+ * Set to `0` or `undefined` to disable collapsing — all conversations
73
+ * are shown and the list is always scrollable.
74
+ *
75
+ * @default 5
76
+ */
77
+ collapsedLimit?: number;
78
+ /**
79
+ * Maximum height (CSS value) of the list when expanded. Allows the list
80
+ * to scroll when conversations exceed the available space.
81
+ *
82
+ * @default undefined — no max-height constraint
83
+ */
84
+ maxHeight?: string;
52
85
  }
53
86
  /**
54
87
  * Emitted events for `CkHistory`.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACxD,0EAA0E;IAC1E,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACnC,4EAA4E;IAC5E,MAAM,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;CACtC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/composed/CkHistory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,cAAc;IAC7B,iEAAiE;IACjE,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACxD,0EAA0E;IAC1E,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACnC,4EAA4E;IAC5E,MAAM,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;CACtC"}
@@ -1,4 +1,4 @@
1
- import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r } from "../CkInput.vue_vue_type_script_setup_true_lang-D8In_Dnl.js";
1
+ import { _, a, b, C, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r } from "../CkInput.vue_vue_type_script_setup_true_lang-DedLzDoO.js";
2
2
  export {
3
3
  _ as CkAgentMessage,
4
4
  a as CkConversation,
@@ -1,5 +1,5 @@
1
1
  import { u } from "../useMessageHandler-CMdy-lm0.js";
2
- import { C, d, p, u as u2, a } from "../useChatKitLabels-BxNkTzr2.js";
2
+ import { C, d, p, u as u2, a } from "../useChatKitLabels-BC6ItJc6.js";
3
3
  export {
4
4
  C as CHAT_KIT_LABELS,
5
5
  d as defaultChatKitLabels,
@@ -75,6 +75,11 @@ export type ChatKitLabels = {
75
75
  historyItemEditAction: string;
76
76
  /** Label for the "Delete" action in the `CkHistory` row popover menu. */
77
77
  historyItemDeleteAction: string;
78
+ /**
79
+ * Label for the "Show all" button that appears when `collapsedLimit` is
80
+ * set and more conversations exist than the limit.
81
+ */
82
+ historyShowAll?: string;
78
83
  };
79
84
  /** English defaults used when no labels are provided by the consumer. */
80
85
  export declare const defaultChatKitLabels: ChatKitLabels;
@@ -1 +1 @@
1
- {"version":3,"file":"useChatKitLabels.d.ts","sourceRoot":"","sources":["../../src/handlers/useChatKitLabels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAG1D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gDAAgD;IAChD,gBAAgB,EAAE,MAAM,CAAC;IACzB,sFAAsF;IACtF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4FAA4F;IAC5F,uBAAuB,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,+DAA+D;IAC/D,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,gEAAgE;IAChE,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,kFAAkF;IAClF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,qEAAqE;IACrE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qEAAqE;IACrE,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,iEAAiE;IACjE,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,iDAAiD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a,CAAC,CAC1C,CAAC;AAE5B,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5C,yFAAyF;AACzF,KAAK,cAAc,GACf,GAAG,CAAC,aAAa,CAAC,GAClB,WAAW,CAAC,aAAa,CAAC,GAC1B,CAAC,MAAM,aAAa,CAAC,CAAC;AAE1B;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,WAAW,CAAC,aAAa,CAAC,CAK7D"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Convert a Unix-seconds timestamp to a human-readable relative time string.
3
+ *
4
+ * Uses simple threshold-based bucketing (not `Intl.RelativeTimeFormat`) so the
5
+ * output is deterministic and easy to snapshot-test. Consumers who need
6
+ * locale-aware formatting can supply their own formatter via the
7
+ * `timeFormatter` prop on `CkHistory`.
8
+ */
9
+ export declare function formatRelativeTime(unixSeconds: number, nowSeconds?: number): string;
10
+ //# sourceMappingURL=formatRelativeTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatRelativeTime.d.ts","sourceRoot":"","sources":["../../src/helpers/formatRelativeTime.ts"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,UAAU,GAAE,MAAsC,GACjD,MAAM,CA8BR"}
@@ -1,4 +1,5 @@
1
1
  export * from './conversationTree';
2
+ export * from './formatRelativeTime';
2
3
  export * from './generateId';
3
4
  export * from './secondsToDate';
4
5
  export * from './toError';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
package/dist/index.d.ts CHANGED
@@ -7,5 +7,6 @@ export { SdkError, createDocumentUploadProvider, defaultDocumentUploadConfig, de
7
7
  export type { DocumentUploadConfig, DocumentUploadProvider, FileEntry, FileStatus, } from './composables/fileUpload';
8
8
  export { CkAgentMessage, CkConversation, CkConversationLayout, CkCopyMessageActionButton, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistory, CkHistoryItem, CkHistoryWrapper, CkInput, CkMarkdownRenderer, CkMessageActionButton, CkPromptActionButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './components';
9
9
  export type { CkConversationLayoutProps, CkConversationProps, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryEmits, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkUserMessageProps, } from './components';
10
+ export { formatRelativeTime } from './helpers';
10
11
  export type { BaseMessage, Conversation, ConversationTree, MessageContent, MessageContentStatus, MessageMetadata, MessageReasoningContent, MessageRole, MessageStatus, MessageTextContent, MessageToolContent, TreeMessage, } from './types';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB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AkB,GACnB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AASpB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EACL,OAAO,EACP,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,4BAA4B,EAC5B,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,SAAS,EACT,UAAU,GACX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAG/C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,GACZ,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { u } from "./useMessageHandler-CMdy-lm0.js";
2
- import { C, d, p, u as u2, a } from "./useChatKitLabels-BxNkTzr2.js";
2
+ import { C, d, p, u as u2, a } from "./useChatKitLabels-BC6ItJc6.js";
3
3
  import { S, c, d as d2, a as a2, u as u3, b, e, f } from "./index-Ct5hD214.js";
4
- import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r } from "./CkInput.vue_vue_type_script_setup_true_lang-D8In_Dnl.js";
4
+ import { _, a as a3, b as b2, C as C2, c as c2, d as d3, e as e2, f as f2, g, h, i, j, k, l, m, n, o, p as p2, q, r, s } from "./CkInput.vue_vue_type_script_setup_true_lang-DedLzDoO.js";
5
5
  export {
6
6
  C as CHAT_KIT_LABELS,
7
7
  _ as CkAgentMessage,
@@ -29,6 +29,7 @@ export {
29
29
  d as defaultChatKitLabels,
30
30
  d2 as defaultDocumentUploadConfig,
31
31
  a2 as defaultEndpoints,
32
+ s as formatRelativeTime,
32
33
  p as provideChatKitLabels,
33
34
  u3 as useChat,
34
35
  u2 as useChatKitLabels,
@@ -12722,7 +12722,8 @@ const defaultChatKitLabels = {
12722
12722
  historyItemUntitled: "Untitled conversation",
12723
12723
  historyItemActionAriaLabel: "Conversation options",
12724
12724
  historyItemEditAction: "Edit",
12725
- historyItemDeleteAction: "Delete"
12725
+ historyItemDeleteAction: "Delete",
12726
+ historyShowAll: "Show all"
12726
12727
  };
12727
12728
  const CHAT_KIT_LABELS = /* @__PURE__ */ Symbol("chat-kit-labels");
12728
12729
  function provideChatKitLabels(labels) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-alpha/chat-kit",
3
- "version": "1.15.0",
3
+ "version": "1.15.1",
4
4
  "description": "Chat kit package for building chat interfaces with Vue",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,13 +9,11 @@ describe('CkHistoryItem', () => {
9
9
  props: {
10
10
  title: 'Thread A',
11
11
  metaStart: 'Mon',
12
- metaEnd: 'Berlin',
13
12
  },
14
13
  });
15
14
 
16
15
  expect(screen.getByText('Thread A')).toBeInTheDocument();
17
16
  expect(screen.getByText('Mon')).toBeInTheDocument();
18
- expect(screen.getByText('Berlin')).toBeInTheDocument();
19
17
  });
20
18
 
21
19
  it('emits action-click when the action button is clicked', async () => {
@@ -18,7 +18,6 @@ const meta: Meta<typeof CkHistoryItem> = {
18
18
  args: {
19
19
  title: 'Project Proposal Overview',
20
20
  metaStart: 'Today',
21
- metaEnd: 'Innsbruck',
22
21
  actionTooltip: 'More actions',
23
22
  },
24
23
  argTypes: {
@@ -58,7 +57,6 @@ function handleActionClick() {
58
57
  <CkHistoryItem
59
58
  title="Project Proposal Overview"
60
59
  meta-start="Today"
61
- meta-end="Innsbruck"
62
60
  action-tooltip="More actions"
63
61
  @action-click="handleActionClick"
64
62
  />
@@ -72,7 +70,6 @@ import { CkHistoryItem } from '@aleph-alpha/chat-kit';
72
70
  <CkHistoryItem
73
71
  title="Project Proposal Overview"
74
72
  meta-start="Today"
75
- meta-end="Innsbruck"
76
73
  action-tooltip="More actions"
77
74
  is-active
78
75
  />
@@ -86,7 +83,6 @@ import { CkHistoryItem } from '@aleph-alpha/chat-kit';
86
83
  <CkHistoryItem
87
84
  title="Project Proposal Overview"
88
85
  meta-start="Today"
89
- meta-end="Innsbruck"
90
86
  action-tooltip="More actions"
91
87
  :show-action-on-hover="false"
92
88
  />
@@ -108,7 +104,6 @@ import { CkHistoryItem } from '@aleph-alpha/chat-kit';
108
104
  <CkHistoryItem
109
105
  title="Project Proposal Overview"
110
106
  meta-start="Today"
111
- meta-end="Innsbruck"
112
107
  action-popover
113
108
  action-aria-label="Chat options"
114
109
  >
@@ -182,7 +177,6 @@ export const AlwaysShowAction: Story = {
182
177
  export const NoMeta: Story = {
183
178
  args: {
184
179
  metaStart: '',
185
- metaEnd: '',
186
180
  },
187
181
  render: renderStory,
188
182
  parameters: { docs: { source: { code: noMetaTemplateSource } } },
@@ -122,11 +122,10 @@ const actionColumnClass = computed(() => [
122
122
  * underneath the icon.
123
123
  */
124
124
  const actionButtonClass = computed(() => [
125
- 'relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-sm border border-transparent text-content-on-surface-primary outline-hidden transition-colors',
125
+ 'relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-sm border-0 text-content-on-surface-primary outline-hidden transition-colors',
126
126
  '[&_svg]:size-4 [&_svg]:shrink-0',
127
127
  'focus-visible:ring-0 focus-visible:outline-none',
128
- pointerOnAction.value &&
129
- 'bg-background-surface-muted-subtle border-border-button-outlined',
128
+ pointerOnAction.value && 'bg-background-surface-muted-subtle',
130
129
  ]);
131
130
 
132
131
  // Popover panel surface is `background/surface/secondary` to match the