@aleph-alpha/chat-kit 3.1.3 → 3.3.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.
Files changed (99) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-LPrW7CSQ.js → CkInput.vue_vue_type_script_setup_true_lang-BAcBFs6I.js} +302 -71
  2. package/dist/adapters/responses-api.d.ts.map +1 -1
  3. package/dist/adapters/responses-api.js +63 -37
  4. package/dist/chat-kit.css +6 -0
  5. package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts +7 -0
  6. package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts.map +1 -1
  7. package/dist/components/base/CkCitation/CkCitation.stories.d.ts +47 -0
  8. package/dist/components/base/CkCitation/CkCitation.stories.d.ts.map +1 -0
  9. package/dist/components/base/CkCitation/CkCitation.vue.d.ts +15 -0
  10. package/dist/components/base/CkCitation/CkCitation.vue.d.ts.map +1 -0
  11. package/dist/components/base/CkCitation/index.d.ts +3 -0
  12. package/dist/components/base/CkCitation/index.d.ts.map +1 -0
  13. package/dist/components/base/CkCitation/types.d.ts +79 -0
  14. package/dist/components/base/CkCitation/types.d.ts.map +1 -0
  15. package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts +51 -0
  16. package/dist/components/base/CkCitationCard/CkCitationCard.stories.d.ts.map +1 -0
  17. package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts +13 -0
  18. package/dist/components/base/CkCitationCard/CkCitationCard.vue.d.ts.map +1 -0
  19. package/dist/components/base/CkCitationCard/index.d.ts +3 -0
  20. package/dist/components/base/CkCitationCard/index.d.ts.map +1 -0
  21. package/dist/components/base/CkCitationCard/types.d.ts +51 -0
  22. package/dist/components/base/CkCitationCard/types.d.ts.map +1 -0
  23. package/dist/components/base/CkDropZoneOverlay/CkDropZoneOverlay.vue.d.ts +1 -1
  24. package/dist/components/base/CkFeedbackDialog/CkFeedbackDialog.vue.d.ts +2 -2
  25. package/dist/components/base/CkFileItemsList/CkFileItemsList.vue.d.ts +1 -1
  26. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts +15 -0
  27. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
  28. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts +16 -2
  29. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts.map +1 -1
  30. package/dist/components/base/CkMarkdownRenderer/index.d.ts +1 -1
  31. package/dist/components/base/CkMarkdownRenderer/index.d.ts.map +1 -1
  32. package/dist/components/base/CkMarkdownRenderer/types.d.ts +25 -0
  33. package/dist/components/base/CkMarkdownRenderer/types.d.ts.map +1 -1
  34. package/dist/components/base/CkMarkdownRenderer/useCitationRendering.d.ts +17 -0
  35. package/dist/components/base/CkMarkdownRenderer/useCitationRendering.d.ts.map +1 -0
  36. package/dist/components/base/CkPromptSendButton/CkPromptSendButton.vue.d.ts +1 -1
  37. package/dist/components/base/index.d.ts +5 -1
  38. package/dist/components/base/index.d.ts.map +1 -1
  39. package/dist/components/composed/CkInput/CkInput.vue.d.ts +1 -1
  40. package/dist/components/index.d.ts +2 -2
  41. package/dist/components/index.d.ts.map +1 -1
  42. package/dist/components/index.js +25 -23
  43. package/dist/composables/fileUpload/types.d.ts +3 -0
  44. package/dist/composables/fileUpload/types.d.ts.map +1 -1
  45. package/dist/composables/fileUpload/useFileUpload.d.ts.map +1 -1
  46. package/dist/composables/fileUpload/useFileUploadWrapper.d.ts.map +1 -1
  47. package/dist/composables/index.js +1 -1
  48. package/dist/handlers/index.d.ts +3 -0
  49. package/dist/handlers/index.d.ts.map +1 -1
  50. package/dist/handlers/index.js +4 -1
  51. package/dist/handlers/useChatKitLabels.d.ts +11 -0
  52. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  53. package/dist/handlers/useMarkdownParser.d.ts.map +1 -1
  54. package/dist/helpers/unified/remarkCitations.d.ts +17 -0
  55. package/dist/helpers/unified/remarkCitations.d.ts.map +1 -0
  56. package/dist/helpers/unified/remarkNormalizeMath.d.ts +24 -0
  57. package/dist/helpers/unified/remarkNormalizeMath.d.ts.map +1 -0
  58. package/dist/{index-DVxCNAs3.js → index-C6njJ8EB.js} +96 -49
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +28 -26
  62. package/dist/{useChatKitLabels-Ctz1dHpx.js → useChatKitLabels-BM2I7-9o.js} +126 -3
  63. package/package.json +6 -3
  64. package/src/adapters/responses-api.spec.ts +156 -0
  65. package/src/adapters/responses-api.ts +125 -58
  66. package/src/components/base/CkAgentMessage/CkAgentMessage.stories.ts +112 -0
  67. package/src/components/base/CkCitation/CkCitation.spec.ts +79 -0
  68. package/src/components/base/CkCitation/CkCitation.stories.ts +136 -0
  69. package/src/components/base/CkCitation/CkCitation.vue +145 -0
  70. package/src/components/base/CkCitation/index.ts +2 -0
  71. package/src/components/base/CkCitation/types.ts +80 -0
  72. package/src/components/base/CkCitationCard/CkCitationCard.spec.ts +77 -0
  73. package/src/components/base/CkCitationCard/CkCitationCard.stories.ts +144 -0
  74. package/src/components/base/CkCitationCard/CkCitationCard.vue +76 -0
  75. package/src/components/base/CkCitationCard/index.ts +2 -0
  76. package/src/components/base/CkCitationCard/types.ts +51 -0
  77. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.spec.ts +124 -0
  78. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +118 -0
  79. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +70 -28
  80. package/src/components/base/CkMarkdownRenderer/index.ts +1 -0
  81. package/src/components/base/CkMarkdownRenderer/types.ts +26 -0
  82. package/src/components/base/CkMarkdownRenderer/useCitationRendering.spec.ts +94 -0
  83. package/src/components/base/CkMarkdownRenderer/useCitationRendering.ts +52 -0
  84. package/src/components/base/index.ts +12 -0
  85. package/src/components/index.ts +8 -0
  86. package/src/composables/fileUpload/types.ts +6 -0
  87. package/src/composables/fileUpload/useFileUpload.spec.ts +2 -61
  88. package/src/composables/fileUpload/useFileUpload.ts +9 -10
  89. package/src/composables/fileUpload/useFileUploadWrapper.spec.ts +241 -10
  90. package/src/composables/fileUpload/useFileUploadWrapper.ts +126 -53
  91. package/src/handlers/index.ts +6 -0
  92. package/src/handlers/useChatKitLabels.ts +13 -0
  93. package/src/handlers/useMarkdownParser.spec.ts +34 -0
  94. package/src/handlers/useMarkdownParser.ts +15 -3
  95. package/src/helpers/unified/remarkCitations.spec.ts +112 -0
  96. package/src/helpers/unified/remarkCitations.ts +55 -0
  97. package/src/helpers/unified/remarkNormalizeMath.spec.ts +84 -0
  98. package/src/helpers/unified/remarkNormalizeMath.ts +134 -0
  99. package/src/index.ts +8 -0
@@ -28,4 +28,11 @@ export declare const WithCustomHeader: Story;
28
28
  * the assistant identity is conveyed elsewhere.
29
29
  */
30
30
  export declare const WithoutIcon: Story;
31
+ /**
32
+ * An assistant reply whose body is markdown containing inline `[n]` citations,
33
+ * rendered through `CkMarkdownRenderer` inside the message. Each `[n]` becomes
34
+ * an interactive `CkCitation` — hover a marker to preview its source. This is
35
+ * the end-to-end shape of a cited answer in a conversation.
36
+ */
37
+ export declare const WithCitations: Story;
31
38
  //# sourceMappingURL=CkAgentMessage.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CkAgentMessage.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkAgentMessage/CkAgentMessage.stories.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAIrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAyFnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwB7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAmB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC"}
1
+ {"version":3,"file":"CkAgentMessage.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkAgentMessage/CkAgentMessage.stories.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAGlD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAIrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAyFnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAerB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAmB/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwB7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAmB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAUzB,CAAC;AA+EF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,KAyB3B,CAAC"}
@@ -0,0 +1,47 @@
1
+ import CkCitation from './CkCitation.vue';
2
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
3
+ /**
4
+ * CkCitation is the inline marker rendered in place of a `[n]` reference in an
5
+ * assistant answer — a numbered chip that reveals a `CkCitationCard` describing
6
+ * the source on hover or keyboard activation (Enter/Space). Drive it through `CkMarkdownRenderer`'s
7
+ * `citations` prop to render cited answers; use `CkCitationCard` on its own for
8
+ * a standalone source preview.
9
+ */
10
+ declare const meta: Meta<typeof CkCitation>;
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ /**
14
+ * A single marker in its default (amber) state. Hover the chip (or focus it and
15
+ * press Enter) to reveal the source card.
16
+ */
17
+ export declare const Default: Story;
18
+ /**
19
+ * The selected (teal) state — set `selected` when the citation's source is the
20
+ * one currently open/highlighted, so the active marker stands out.
21
+ */
22
+ export declare const Selected: Story;
23
+ /**
24
+ * How markers read inside a sentence — two sources cited next to each other,
25
+ * the way they appear in an assistant answer.
26
+ */
27
+ export declare const InlineInText: Story;
28
+ /**
29
+ * Multi-digit indices keep the chip legible — the marker grows with its
30
+ * number while staying aligned to the surrounding text.
31
+ */
32
+ export declare const MultiDigitIndex: Story;
33
+ /**
34
+ * No `url` — the card still appears on hover but without the external-link
35
+ * action (e.g. an internal chunk with no servable file).
36
+ */
37
+ export declare const WithoutLink: Story;
38
+ /**
39
+ * Non-paginated source — the card omits the page footer.
40
+ */
41
+ export declare const WithoutLocation: Story;
42
+ /**
43
+ * A row of markers with different file types — the card's badge tone follows
44
+ * each source's extension.
45
+ */
46
+ export declare const SourceTypes: Story;
47
+ //# sourceMappingURL=CkCitation.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkCitation.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/CkCitation.stories.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;GAMG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA2BjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { CkCitationProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<CkCitationProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ "open-source": (url: string) => any;
4
+ }, string, import("vue").PublicProps, Readonly<CkCitationProps> & Readonly<{
5
+ "onOpen-source"?: ((url: string) => any) | undefined;
6
+ }>, {
7
+ ariaLabel: string;
8
+ locationLabel: string;
9
+ url: string;
10
+ openSourceLabel: string;
11
+ selected: boolean;
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ //# sourceMappingURL=CkCitation.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkCitation.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/CkCitation.vue"],"names":[],"mappings":"AA+JA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AA0Q/C,QAAA,MAAM,YAAY;;;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,3 @@
1
+ export { default as CkCitation } from './CkCitation.vue';
2
+ export type * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * A single citation source: the data needed to render a marker and its card.
3
+ * This is the per-source shape the host maps each backend citation into (the
4
+ * `index` matches the `[n]` reference in the answer text) and the element type
5
+ * of `CkMarkdownRenderer`'s `citations` prop.
6
+ *
7
+ * @category Data Display
8
+ * @useCases describe a cited source, build the citations map for an assistant reply
9
+ * @keywords citation, source, reference, file, page, snippet
10
+ * @related CkCitation, CkCitationCard, CkMarkdownRenderer
11
+ */
12
+ export interface CkCitationSource {
13
+ /**
14
+ * 1-based source number rendered in the marker. Matches the `[n]`
15
+ * reference it replaces in the answer text.
16
+ */
17
+ index: number;
18
+ /**
19
+ * Source file name. Title of the card and basis for the file-type badge
20
+ * (pass the original name with its extension).
21
+ */
22
+ fileName: string;
23
+ /** The cited chunk text, shown in the card body. */
24
+ snippet: string;
25
+ /**
26
+ * Location label for the card footer, e.g. `"Page 3"`. Omit for
27
+ * non-paginated sources.
28
+ */
29
+ locationLabel?: string;
30
+ /**
31
+ * Source URL for the card's external-link action. Activating it emits
32
+ * `open-source`. Omit to hide the action.
33
+ */
34
+ url?: string;
35
+ }
36
+ /**
37
+ * An inline citation marker — the numbered chip rendered in place of a `[n]`
38
+ * reference inside an assistant answer. On hover, or when activated by
39
+ * keyboard (Enter/Space) or click, it reveals a `CkCitationCard` describing
40
+ * the source.
41
+ *
42
+ * The marker shows the bare source number (no brackets). Activating the
43
+ * card's external-link action re-emits `open-source` so the host can open
44
+ * the (possibly auth-proxied) source URL.
45
+ *
46
+ * @category Data Display
47
+ * @useCases inline citation in assistant reply, numbered source reference, hover to preview the cited file/page
48
+ * @keywords citation, source, reference, inline, marker, footnote, number, hover, popover
49
+ * @related CkCitationCard, CkMarkdownRenderer, CkAgentMessage
50
+ */
51
+ export interface CkCitationProps extends CkCitationSource {
52
+ /**
53
+ * Marks the citation as selected/active (e.g. the source it points to is
54
+ * currently open or highlighted). Renders the marker in its selected (teal)
55
+ * state instead of the default amber.
56
+ * @default false
57
+ */
58
+ selected?: boolean;
59
+ /**
60
+ * Accessible label for the marker trigger. When omitted, resolves to
61
+ * `"{citationSourceLabel} {index}"` from `useChatKitLabels` (English default
62
+ * `"Source {index}"`). Set this to override per instance.
63
+ */
64
+ ariaLabel?: string;
65
+ /**
66
+ * Accessible label for the card's external-link action. When omitted,
67
+ * resolves from `useChatKitLabels().citationOpenSource` (English default
68
+ * `"Open source"`).
69
+ */
70
+ openSourceLabel?: string;
71
+ }
72
+ export interface CkCitationEmits {
73
+ /**
74
+ * Re-emitted from the card when the user opens the source. The payload is
75
+ * `url`.
76
+ */
77
+ (e: 'open-source', url: string): void;
78
+ }
79
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACvD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
@@ -0,0 +1,51 @@
1
+ import CkCitationCard from './CkCitationCard.vue';
2
+ import type { Meta, StoryObj } from '@storybook/vue3-vite';
3
+ /**
4
+ * CkCitationCard is the floating card that describes a single citation source:
5
+ * the file, the cited excerpt, an optional location (e.g. page), and an
6
+ * optional external-link action. It is the hover/focus content of `CkCitation`,
7
+ * but can be used on its own wherever a source preview is needed. The
8
+ * external-link action is exposed as an `open-source` event rather than a plain
9
+ * link, because the source URL is often auth-proxied.
10
+ */
11
+ declare const meta: Meta<typeof CkCitationCard>;
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+ /**
15
+ * Full card: file-type badge, title, external-link action, excerpt, and a
16
+ * page footer. Matches the Figma `citation card` frame.
17
+ */
18
+ export declare const Default: Story;
19
+ /**
20
+ * No `url` — the external-link action is hidden. Use for sources that can't
21
+ * be opened (e.g. an internal chunk with no servable file).
22
+ */
23
+ export declare const WithoutLink: Story;
24
+ /**
25
+ * No `locationLabel` — the footer is hidden. Use for non-paginated sources
26
+ * such as a plain web page or a whole-document citation.
27
+ */
28
+ export declare const WithoutLocation: Story;
29
+ /**
30
+ * Minimal: title + excerpt only (no link, no location). The leanest source a
31
+ * card can describe.
32
+ */
33
+ export declare const MinimalSnippetOnly: Story;
34
+ /**
35
+ * A long file name truncates with an ellipsis (the badge and external-link
36
+ * action stay pinned, the card keeps its width); the full name stays available
37
+ * on hover via the `title` attribute. The `truncate` behaviour holds for any
38
+ * length, including a single unbroken token with no separators.
39
+ */
40
+ export declare const LongFileName: Story;
41
+ /**
42
+ * A long excerpt wraps freely — the card grows vertically while keeping its
43
+ * fixed width.
44
+ */
45
+ export declare const LongSnippet: Story;
46
+ /**
47
+ * The file-type badge derives its icon and tone from the file extension:
48
+ * `.pdf`/`.docx` → pink, `.md`/`.html` → soft, `.csv`/`.xlsx` → yellow.
49
+ */
50
+ export declare const FileTypeVariants: Story;
51
+ //# sourceMappingURL=CkCitationCard.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkCitationCard.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.stories.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAK3D;;;;;;;GAOG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAuBrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqBnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAEhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAuB9B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { CkCitationCardProps } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<CkCitationCardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ "open-source": (url: string) => any;
4
+ }, string, import("vue").PublicProps, Readonly<CkCitationCardProps> & Readonly<{
5
+ "onOpen-source"?: ((url: string) => any) | undefined;
6
+ }>, {
7
+ locationLabel: string;
8
+ url: string;
9
+ openSourceLabel: string;
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ //# sourceMappingURL=CkCitationCard.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CkCitationCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/CkCitationCard.vue"],"names":[],"mappings":"AAqFA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA4KnD,QAAA,MAAM,YAAY;;;;;;;;6EAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,3 @@
1
+ export { default as CkCitationCard } from './CkCitationCard.vue';
2
+ export type * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,mBAAmB,SAAS,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * The floating card that describes a single citation source: the source file,
3
+ * the cited excerpt, an optional location (e.g. page), and an optional
4
+ * external-link action. Rendered as the hover/focus content of `CkCitation`,
5
+ * but usable on its own wherever a source preview is needed.
6
+ *
7
+ * Purely presentational and prop-driven. The external-link action is exposed
8
+ * as an `open-source` event rather than a plain link, because the source URL
9
+ * is often auth-proxied and cannot be navigated to directly.
10
+ *
11
+ * @category Data Display
12
+ * @useCases citation source preview, hover card for an inline reference, show the cited file/page/excerpt
13
+ * @keywords citation, source, card, popover, reference, file, page, excerpt, preview
14
+ * @related CkCitation, CkMarkdownRenderer, CkAgentMessage
15
+ */
16
+ export interface CkCitationCardProps {
17
+ /**
18
+ * Source file name. Rendered as the card title and used to derive the
19
+ * file-type badge icon/tone (pass the original name with its extension,
20
+ * e.g. `q3-report.pdf`).
21
+ */
22
+ fileName: string;
23
+ /** The cited chunk text, shown in the card body. */
24
+ snippet: string;
25
+ /**
26
+ * Location label shown in the footer, e.g. `"Page 3"`. Pass a fully
27
+ * formatted, localized string — the component does no number formatting.
28
+ * Omit for non-paginated sources to hide the footer.
29
+ */
30
+ locationLabel?: string;
31
+ /**
32
+ * When set, the external-link action is shown in the header. Activating it
33
+ * emits `open-source` with this value; the host opens it (it may be an
34
+ * auth-proxied URL that can't be a plain link). Omit to hide the action.
35
+ */
36
+ url?: string;
37
+ /**
38
+ * Accessible label for the external-link action. When omitted, resolves from
39
+ * `useChatKitLabels().citationOpenSource` (English default `"Open source"`).
40
+ * Set this to override per instance.
41
+ */
42
+ openSourceLabel?: string;
43
+ }
44
+ export interface CkCitationCardEmits {
45
+ /**
46
+ * Emitted when the user activates the header external-link action. The
47
+ * payload is `url`. Only emitted when `url` is set.
48
+ */
49
+ (e: 'open-source', url: string): void;
50
+ }
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkCitationCard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
@@ -10,12 +10,12 @@ declare const __VLS_base: import("vue").DefineComponent<CkDropZoneOverlayProps,
10
10
  onFiles?: ((files: File[]) => any) | undefined;
11
11
  onRejected?: ((rejections: CkDropZoneRejection[]) => any) | undefined;
12
12
  }>, {
13
+ heading: string;
13
14
  ariaLabel: string;
14
15
  disabled: boolean;
15
16
  accept: string;
16
17
  maxFileSizeBytes: number;
17
18
  maxFiles: number;
18
- heading: string;
19
19
  hint: string;
20
20
  showErrors: boolean;
21
21
  errorTimeoutMs: number;
@@ -1,11 +1,11 @@
1
1
  import type { CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload } from './types';
2
2
  declare const __VLS_export: import("vue").DefineComponent<CkFeedbackDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
- cancel: () => any;
4
3
  submit: (payload: CkFeedbackDialogSubmitPayload) => any;
4
+ cancel: () => any;
5
5
  "update:open": (open: boolean) => any;
6
6
  }, string, import("vue").PublicProps, Readonly<CkFeedbackDialogProps> & Readonly<{
7
- onCancel?: (() => any) | undefined;
8
7
  onSubmit?: ((payload: CkFeedbackDialogSubmitPayload) => any) | undefined;
8
+ onCancel?: (() => any) | undefined;
9
9
  "onUpdate:open"?: ((open: boolean) => any) | undefined;
10
10
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: typeof __VLS_export;
@@ -19,11 +19,11 @@ declare const __VLS_base: import("vue").DefineComponent<CkFileItemsListProps, {}
19
19
  }>, {
20
20
  size: UiFileItemSize;
21
21
  disabled: boolean;
22
+ triggerLabel: string;
22
23
  isRemovable: boolean;
23
24
  removeLabel: string;
24
25
  maxInline: number;
25
26
  showStatus: boolean;
26
- triggerLabel: string;
27
27
  triggerAriaLabel: string;
28
28
  listLabel: string;
29
29
  popoverClass: string;
@@ -44,4 +44,19 @@ export declare const MathExpressions: Story;
44
44
  * transform the AST before rendering (e.g. math, directive, custom nodes).
45
45
  */
46
46
  export declare const WithCustomPlugin: Story;
47
+ /**
48
+ * The headline integration: an assistant reply is **markdown that contains
49
+ * inline `[n]` references**, and the `citations` prop turns each one into an
50
+ * interactive `CkCitation` (numbered marker + hover card) — handled as a
51
+ * dedicated case, distinct from ordinary markdown. Hover a marker to preview
52
+ * its source; the external-link action emits `open-source`.
53
+ */
54
+ export declare const WithCitations: Story;
55
+ /**
56
+ * Unsupported markers degrade gracefully: a `[n]` with no matching source
57
+ * (here `[9]`) is left as plain text rather than rendered as a citation, while
58
+ * the markers that do have sources still render. Citation handling never
59
+ * touches code spans — the `[3]` inside `` `arr[3]` `` stays literal.
60
+ */
61
+ export declare const WithUnsupportedAndCodeMarkers: Story;
47
62
  //# sourceMappingURL=CkMarkdownRenderer.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CkMarkdownRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAkBzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqHnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KA+BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA0C/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAeF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAkB9B,CAAC"}
1
+ {"version":3,"file":"CkMarkdownRenderer.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE3D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CAkBzC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqHnC;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAsB5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KA+BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAwC7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KA0C/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAC;AAsBF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,KAuB7B,CAAC;AAeF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAkB9B,CAAC;AAiEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,KAwB3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,KAc3C,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { type PropType, type VNode } from 'vue';
2
2
  import type { PluggableList } from 'unified';
3
+ import type { CkCitationSource } from '../CkCitation';
3
4
  import type { CkMarkdownElementClasses } from './types';
4
5
  declare const _default: typeof __VLS_export;
5
6
  export default _default;
@@ -16,9 +17,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
16
17
  type: PropType<PluggableList>;
17
18
  default: undefined;
18
19
  };
20
+ citations: {
21
+ type: PropType<CkCitationSource[]>;
22
+ default: undefined;
23
+ };
19
24
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
20
25
  [key: string]: any;
21
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ 'open-source': (url: string) => boolean;
28
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
29
  content: {
23
30
  type: StringConstructor;
24
31
  required: true;
@@ -31,8 +38,15 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
31
38
  type: PropType<PluggableList>;
32
39
  default: undefined;
33
40
  };
34
- }>> & Readonly<{}>, {
41
+ citations: {
42
+ type: PropType<CkCitationSource[]>;
43
+ default: undefined;
44
+ };
45
+ }>> & Readonly<{
46
+ "onOpen-source"?: ((url: string) => any) | undefined;
47
+ }>, {
35
48
  classes: CkMarkdownElementClasses;
36
49
  plugins: PluggableList;
50
+ citations: CkCitationSource[];
37
51
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
52
  //# sourceMappingURL=CkMarkdownRenderer.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CkMarkdownRenderer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue"],"names":[],"mappings":"AA4HA,OAAO,EAKL,KAAK,QAAQ,EAEb,KAAK,KAAK,EACX,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;wBA6DnC,OAAO,YAAY;AAAxC,wBAAyC;AAQzC,QAAA,MAAM,YAAY;;;;;;cAKI,QAAQ,CAAC,wBAAwB,CAAC;;;;cAG1B,QAAQ,CAAC,aAAa,CAAC;;;;;;;;;;;cAH/B,QAAQ,CAAC,wBAAwB,CAAC;;;;cAG1B,QAAQ,CAAC,aAAa,CAAC;;;;;;4EAkCnD,CAAC"}
1
+ {"version":3,"file":"CkMarkdownRenderer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue"],"names":[],"mappings":"AAsKA,OAAO,EAKL,KAAK,QAAQ,EAEb,KAAK,KAAK,EACX,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAO7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;wBA2EnC,OAAO,YAAY;AAAxC,wBAAyC;AAQzC,QAAA,MAAM,YAAY;;;;;;cAKI,QAAQ,CAAC,wBAAwB,CAAC;;;;cAG1B,QAAQ,CAAC,aAAa,CAAC;;;;cAEhC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;;;yBAKxB,MAAM;;;;;;;cAVT,QAAQ,CAAC,wBAAwB,CAAC;;;;cAG1B,QAAQ,CAAC,aAAa,CAAC;;;;cAEhC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;;;;;;;;;4EA0D/C,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { default as CkMarkdownRenderer } from './CkMarkdownRenderer.vue';
2
- export type { CkMarkdownRendererProps, CkMarkdownElementClasses, } from './types';
2
+ export type { CkMarkdownRendererProps, CkMarkdownRendererEmits, CkMarkdownElementClasses, } from './types';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EACV,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACzE,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,SAAS,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { PluggableList } from 'unified';
2
+ import type { CkCitationSource } from '../CkCitation';
2
3
  export interface CkMarkdownElementClasses {
3
4
  h1?: string;
4
5
  h2?: string;
@@ -48,5 +49,29 @@ export interface CkMarkdownRendererProps {
48
49
  classes?: CkMarkdownElementClasses;
49
50
  /** Extra [unified](https://unifiedjs.com/) plugins to extend parsing. */
50
51
  plugins?: PluggableList;
52
+ /**
53
+ * Citation sources for inline `[n]` references in `content`. When provided,
54
+ * each `[n]` whose number matches a source's `index` is rendered as an
55
+ * interactive `CkCitation` (numbered marker + hover card); unmatched markers
56
+ * stay as plain text. Fully opt-in — omit it and markdown renders unchanged.
57
+ *
58
+ * Notes for callers:
59
+ * - Any numeric `[n]` in prose is turned into a citation when source `n`
60
+ * exists — including incidental ones like array indexing (`arr[1]`). Wrap
61
+ * such text in a code span (`` `arr[1]` ``) to keep it literal. `[n]` inside
62
+ * code spans/blocks is never converted.
63
+ * - `index` must be unique across sources; on a collision the last wins.
64
+ * - Pass a stable/memoized array reference. A new array identity on every
65
+ * render forces the markdown processor to rebuild.
66
+ */
67
+ citations?: CkCitationSource[];
68
+ }
69
+ export interface CkMarkdownRendererEmits {
70
+ /**
71
+ * Emitted when the user opens a citation's source from its card. The
72
+ * payload is the source `url`. Forward it to a handler that performs the
73
+ * (often auth-proxied) navigation.
74
+ */
75
+ (e: 'open-source', url: string): void;
51
76
  }
52
77
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMar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M,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IACnC,yEAAyE;IACzE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC"}
@@ -0,0 +1,17 @@
1
+ import { type MaybeRefOrGetter, type VNode } from 'vue';
2
+ import type { PluggableList } from 'unified';
3
+ import type { CkCitationSource } from '../CkCitation';
4
+ /** Scope passed to the `citation` slot when overriding how a source renders. */
5
+ export type CkCitationSlot = (props: {
6
+ source: CkCitationSource;
7
+ openSource: (url: string) => void;
8
+ }) => VNode[];
9
+ /**
10
+ * The citation concern of `CkMarkdownRenderer`, extracted so the renderer stays
11
+ * markdown-focused and this logic is testable on its own.
12
+ */
13
+ export declare function useCitationRendering(citations: MaybeRefOrGetter<CkCitationSource[] | undefined>, onOpenSource: (url: string) => void): {
14
+ citationPlugins: import("vue").ComputedRef<PluggableList>;
15
+ renderCitationNode: (el: Element, slot?: CkCitationSlot) => VNode | VNode[] | null;
16
+ };
17
+ //# sourceMappingURL=useCitationRendering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCitationRendering.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkMarkdownRenderer/useCitationRendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,gBAAgB,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,gFAAgF;AAChF,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,KAAK,KAAK,EAAE,CAAC;AAEd;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,GAAG,SAAS,CAAC,EAC3D,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI;;6BAkB7B,OAAO,SACJ,cAAc,KACpB,KAAK,GAAG,KAAK,EAAE,GAAG,IAAI;EAa1B"}
@@ -5,8 +5,8 @@ type __VLS_Slots = {} & {
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<CkPromptSendButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CkPromptSendButtonProps> & Readonly<{}>, {
7
7
  type: "button" | "submit";
8
- disabled: boolean;
9
8
  loading: boolean;
9
+ disabled: boolean;
10
10
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
12
  declare const _default: typeof __VLS_export;
@@ -1,5 +1,9 @@
1
1
  export { CkSendIcon, CkStopIcon } from './icons';
2
2
  export { CkAgentMessage } from './CkAgentMessage';
3
+ export { CkCitation } from './CkCitation';
4
+ export type { CkCitationProps, CkCitationEmits, CkCitationSource, } from './CkCitation';
5
+ export { CkCitationCard } from './CkCitationCard';
6
+ export type { CkCitationCardProps, CkCitationCardEmits, } from './CkCitationCard';
3
7
  export { CkConversationLayout } from './CkConversationLayout';
4
8
  export type { CkConversationLayoutProps } from './CkConversationLayout';
5
9
  export { CkCopyMessageActionButton } from './CkCopyMessageActionButton';
@@ -16,7 +20,7 @@ export type { CkHistoryItemProps, CkHistoryItemEmits } from './CkHistoryItem';
16
20
  export { CkHistoryWrapper } from './CkHistoryWrapper';
17
21
  export type { CkHistoryWrapperProps } from './CkHistoryWrapper';
18
22
  export { CkMarkdownRenderer } from './CkMarkdownRenderer';
19
- export type { CkMarkdownRendererProps, CkMarkdownElementClasses, } from './CkMarkdownRenderer';
23
+ export type { CkMarkdownRendererProps, CkMarkdownRendererEmits, CkMarkdownElementClasses, } from './CkMarkdownRenderer';
20
24
  export { CkMessageActionButton } from './CkMessageActionButton';
21
25
  export { CkModelSelector } from './CkModelSelector';
22
26
  export type { CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, } from './CkModelSelector';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,mBA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AC1D,YAAY,EACV,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -32,8 +32,8 @@ declare const __VLS_base: import("vue").DefineComponent<CkInputProps, {
32
32
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
33
33
  }>, {
34
34
  ariaLabel: string;
35
- disabled: boolean;
36
35
  loading: boolean;
36
+ disabled: boolean;
37
37
  modelValue: string;
38
38
  placeholder: string;
39
39
  stopAriaLabel: string;
@@ -1,5 +1,5 @@
1
- export { CkAgentMessage, CkConversationLayout, CkCopyMessageActionButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptSendButton, CkPromptMenuButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
2
- export type { CkConversationLayoutProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkPromptMenuButtonProps, CkUserMessageProps, } from './base';
1
+ export { CkAgentMessage, CkCitation, CkCitationCard, CkConversationLayout, CkCopyMessageActionButton, CkDropZoneOverlay, CkFeedbackButton, CkFeedbackDialog, CkFileItemsList, CkHistoryItem, CkHistoryWrapper, CkMarkdownRenderer, CkMessageActionButton, CkModelSelector, CkPromptSendButton, CkPromptMenuButton, CkPromptStopButton, CkPromptInput, CkPromptInputDisclaimer, CkSendIcon, CkStopIcon, CkUserMessage, } from './base';
2
+ export type { CkCitationProps, CkCitationEmits, CkCitationSource, CkCitationCardProps, CkCitationCardEmits, CkConversationLayoutProps, CkDropZoneOverlayProps, CkDropZoneOverlayEmits, CkDropZoneRejection, CkDropZoneRejectionReason, CkFeedbackButtonProps, CkFeedbackDialogEmits, CkFeedbackDialogProps, CkFeedbackDialogSubmitPayload, CkFeedbackReason, CkFeedbackSentiment, CkFeedbackValue, CkFileEntry, CkFileItemsListEmits, CkFileItemsListProps, CkHistoryItemEmits, CkHistoryItemProps, CkHistoryWrapperProps, CkMarkdownElementClasses, CkMarkdownRendererProps, CkMarkdownRendererEmits, CkModelOption, CkModelSelectorProps, CkModelSelectorEmits, CkPromptMenuButtonProps, CkUserMessageProps, } from './base';
3
3
  export { CkConversation, CkHistory, CkInput } from './composed';
4
4
  export type { CkConversationProps, CkHistoryEmits, CkHistoryProps, } from './composed';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC"}