@8wave/ai-elements 0.125.0-beta.15 → 0.125.0-beta.17

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 (104) hide show
  1. package/README.md +23 -0
  2. package/dist/_chunks/{PkFilePreview-8nVPKv8k.js → PkFilePreview-BIFkMsAC.js} +559 -718
  3. package/dist/_chunks/PkFilePreview-BIFkMsAC.js.map +1 -0
  4. package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js → PkFilePreviewDialog-NLk4gZMd.js} +8 -8
  5. package/dist/_chunks/{PkFilePreviewDialog-BHPcGlnF.js.map → PkFilePreviewDialog-NLk4gZMd.js.map} +1 -1
  6. package/dist/_chunks/PkSelectionActions-CUymhwsG.js +168 -0
  7. package/dist/_chunks/PkSelectionActions-CUymhwsG.js.map +1 -0
  8. package/dist/ai-elements.es.js +4564 -4169
  9. package/dist/ai-elements.es.js.map +1 -1
  10. package/dist-vue/PkChatbot.js +1 -1
  11. package/dist-vue/PkChatbotEmptyState.js +1 -1
  12. package/dist-vue/PkChatbotInput.js +1 -1
  13. package/dist-vue/PkChatbotMessages.js +1 -1
  14. package/dist-vue/PkChatbotStepPayload.js +1 -1
  15. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  16. package/dist-vue/PkChatbotSteps.js +1 -1
  17. package/dist-vue/PkChatbotViewChat.js +1 -1
  18. package/dist-vue/PkChatbotViewConversations.js +1 -1
  19. package/dist-vue/PkChatbotViewFiles.js +1 -1
  20. package/dist-vue/PkChatbotViewProfile.js +1 -1
  21. package/dist-vue/_chunks/{Agent-DmxsItHG.js → Agent-Cm1LrkYm.js} +162 -162
  22. package/dist-vue/_chunks/{Agent-DmxsItHG.js.map → Agent-Cm1LrkYm.js.map} +1 -1
  23. package/dist-vue/_chunks/{Document-CXfJxfu6.js → Document-DHBTrCuO.js} +10 -10
  24. package/dist-vue/_chunks/{Document-CXfJxfu6.js.map → Document-DHBTrCuO.js.map} +1 -1
  25. package/dist-vue/_chunks/{PkChatbot--fyFCXBu.js → PkChatbot-BtUaZ-LR.js} +10 -9
  26. package/dist-vue/_chunks/PkChatbot-BtUaZ-LR.js.map +1 -0
  27. package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js → PkChatbotEmptyState-DJIkAskP.js} +2 -2
  28. package/dist-vue/_chunks/{PkChatbotEmptyState-CQ_Qdkge.js.map → PkChatbotEmptyState-DJIkAskP.js.map} +1 -1
  29. package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js → PkChatbotInput-DzqaW3EE.js} +2 -2
  30. package/dist-vue/_chunks/{PkChatbotInput-BVu1b2Te.js.map → PkChatbotInput-DzqaW3EE.js.map} +1 -1
  31. package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js → PkChatbotMessages-vkbq5p1X.js} +17 -17
  32. package/dist-vue/_chunks/{PkChatbotMessages-DftNL5ZQ.js.map → PkChatbotMessages-vkbq5p1X.js.map} +1 -1
  33. package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js → PkChatbotStepPayload-cuYclK_2.js} +2 -2
  34. package/dist-vue/_chunks/{PkChatbotStepPayload-AiDZPbds.js.map → PkChatbotStepPayload-cuYclK_2.js.map} +1 -1
  35. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js → PkChatbotStepToolDetail-Yd8cUQJP.js} +3 -3
  36. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CALZDpfQ.js.map → PkChatbotStepToolDetail-Yd8cUQJP.js.map} +1 -1
  37. package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js → PkChatbotSteps-D5yz8lut.js} +5 -5
  38. package/dist-vue/_chunks/{PkChatbotSteps-CY7pN2Gl.js.map → PkChatbotSteps-D5yz8lut.js.map} +1 -1
  39. package/dist-vue/_chunks/{PkChatbotViewChat-CgJlfyd0.js → PkChatbotViewChat-DCPRePrE.js} +289 -289
  40. package/dist-vue/_chunks/PkChatbotViewChat-DCPRePrE.js.map +1 -0
  41. package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js → PkChatbotViewConversations-BBd3XMmM.js} +3 -3
  42. package/dist-vue/_chunks/{PkChatbotViewConversations-C0KqM_Wq.js.map → PkChatbotViewConversations-BBd3XMmM.js.map} +1 -1
  43. package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js → PkChatbotViewFiles-BiQzDqJg.js} +3 -3
  44. package/dist-vue/_chunks/{PkChatbotViewFiles-B9mYRoNK.js.map → PkChatbotViewFiles-BiQzDqJg.js.map} +1 -1
  45. package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js → PkChatbotViewProfile-7266UiRM.js} +2 -2
  46. package/dist-vue/_chunks/{PkChatbotViewProfile-BfNE3d7F.js.map → PkChatbotViewProfile-7266UiRM.js.map} +1 -1
  47. package/dist-vue/_chunks/{PkFilePreview-z7JcRtjP.js → PkFilePreview-DLo9nI2g.js} +426 -426
  48. package/dist-vue/_chunks/PkFilePreview-DLo9nI2g.js.map +1 -0
  49. package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js → PkFilePreviewDialog-CgDJQgIJ.js} +2 -2
  50. package/dist-vue/_chunks/{PkFilePreviewDialog-zVon3aPY.js.map → PkFilePreviewDialog-CgDJQgIJ.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js → PkStreamingMarkdown-C3UGCEXm.js} +3 -3
  52. package/dist-vue/_chunks/{PkStreamingMarkdown-bJEDk-kM.js.map → PkStreamingMarkdown-C3UGCEXm.js.map} +1 -1
  53. package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js → PkToolChatFile-Dy0rGC29.js} +3 -3
  54. package/dist-vue/_chunks/{PkToolChatFile-DqLGwJxp.js.map → PkToolChatFile-Dy0rGC29.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js → PkToolRequestGeolocation-p7Ip17F7.js} +2 -2
  56. package/dist-vue/_chunks/{PkToolRequestGeolocation-BnV7A6SW.js.map → PkToolRequestGeolocation-p7Ip17F7.js.map} +1 -1
  57. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js → PkToolRequestOAuthConnection-CtXSzKzM.js} +2 -2
  58. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-QCbQ7bnl.js.map → PkToolRequestOAuthConnection-CtXSzKzM.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js → PkToolShowArtifact-B7udnhpb.js} +2 -2
  60. package/dist-vue/_chunks/{PkToolShowArtifact-DanzULWt.js.map → PkToolShowArtifact-B7udnhpb.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js → PkToolShowContactForm-0SEgxn2S.js} +2 -2
  62. package/dist-vue/_chunks/{PkToolShowContactForm-DzttQBG6.js.map → PkToolShowContactForm-0SEgxn2S.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js → PkToolShowDiagram-BqHBhZgd.js} +2 -2
  64. package/dist-vue/_chunks/{PkToolShowDiagram-BNa89wcw.js.map → PkToolShowDiagram-BqHBhZgd.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js → PkToolShowForm-C4n_3mFL.js} +4 -4
  66. package/dist-vue/_chunks/{PkToolShowForm-BXol1WE3.js.map → PkToolShowForm-C4n_3mFL.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js → PkToolShowImageGallery-DEpdtLns.js} +2 -2
  68. package/dist-vue/_chunks/{PkToolShowImageGallery-Dmr5zXTj.js.map → PkToolShowImageGallery-DEpdtLns.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js → PkToolShowProductList-Bm2NLUGS.js} +2 -2
  70. package/dist-vue/_chunks/{PkToolShowProductList-C_uIUG_G.js.map → PkToolShowProductList-Bm2NLUGS.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js → PkToolShowSources-DwFqlit2.js} +3 -3
  72. package/dist-vue/_chunks/{PkToolShowSources-BHRNGn4s.js.map → PkToolShowSources-DwFqlit2.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js → PkToolShowSuggestedReply-BRIzGNwx.js} +2 -2
  74. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DHCqxA1P.js.map → PkToolShowSuggestedReply-BRIzGNwx.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js → PkToolShowVideo-BLEJ8tng.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolShowVideo-P4H5A7ke.js.map → PkToolShowVideo-BLEJ8tng.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js → PkToolShowWebPages-CeAXllAF.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolShowWebPages-BzNZHR7Q.js.map → PkToolShowWebPages-CeAXllAF.js.map} +1 -1
  79. package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js → createChatbotApiClient-BPN6cLGF.js} +14 -14
  80. package/dist-vue/_chunks/{createChatbotApiClient-CQjxHqLr.js.map → createChatbotApiClient-BPN6cLGF.js.map} +1 -1
  81. package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js → useChatbotStore-C4xhJtrb.js} +1242 -1242
  82. package/dist-vue/_chunks/{useChatbotStore-CyZha9pf.js.map → useChatbotStore-C4xhJtrb.js.map} +1 -1
  83. package/dist-vue/_chunks/{utils-8lO2Gj-m.js → utils-RwaXl9-x.js} +4 -4
  84. package/dist-vue/_chunks/{utils-8lO2Gj-m.js.map → utils-RwaXl9-x.js.map} +1 -1
  85. package/dist-vue/api.js +1 -1
  86. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
  87. package/dist-vue/apps/web-component/src/composables/usePagePointer.d.ts +14 -9
  88. package/dist-vue/apps/web-component/src/composables/usePendingMessage.d.ts +29 -15
  89. package/dist-vue/apps/web-component/src/composables/useSelectionActions.d.ts +77 -0
  90. package/dist-vue/composables.js +34 -8
  91. package/dist-vue/composables.js.map +1 -1
  92. package/dist-vue/index.js +5401 -5321
  93. package/dist-vue/index.js.map +1 -1
  94. package/dist-vue/locales.js +22 -2
  95. package/dist-vue/packages/components/src/chat/PkAgentSelectionActionsSettings.d.ts +25 -0
  96. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +23 -3
  97. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +2 -1
  98. package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +2 -12
  99. package/dist-vue/packages/components/src/chat/PkSelectionAnswerCard.d.ts +41 -0
  100. package/package.json +1 -1
  101. package/dist/_chunks/PkFilePreview-8nVPKv8k.js.map +0 -1
  102. package/dist-vue/_chunks/PkChatbot--fyFCXBu.js.map +0 -1
  103. package/dist-vue/_chunks/PkChatbotViewChat-CgJlfyd0.js.map +0 -1
  104. package/dist-vue/_chunks/PkFilePreview-z7JcRtjP.js.map +0 -1
@@ -0,0 +1,77 @@
1
+ import { Ref } from 'vue';
2
+ import { PagePointer, SelectionGroupCapability } from '../../../../packages/models/src';
3
+ import { SelectionBarAction } from 'components/src/chat/PkSelectionActions';
4
+ import { PageSelection } from '../pageTools/pointing';
5
+ import { PagePointing } from './usePagePointer';
6
+ /** A selection of the page that may go to the agent, and where it is on screen now. */
7
+ export type PageSelectionOnScreen = PageSelection & {
8
+ range: Range;
9
+ /** The box of its first line: the bar goes above the start. */
10
+ start: DOMRect;
11
+ /** Its lowest edge. */
12
+ bottom: number;
13
+ };
14
+ /** Where a selection is, in the window: what the bar and the answer card are placed from. */
15
+ export type SelectionAnchor = {
16
+ start: {
17
+ top: number;
18
+ left: number;
19
+ };
20
+ bottom: number;
21
+ bounds: {
22
+ top: number;
23
+ left: number;
24
+ width: number;
25
+ height: number;
26
+ };
27
+ };
28
+ /** The anchor of a selection, in the window. */
29
+ export declare const anchorOf: (selection: PageSelectionOnScreen) => SelectionAnchor;
30
+ /**
31
+ * The text the user selected on the page, once it stays still (spec
32
+ * `selection-actions.md`, "La barra"), when it may go to the agent: not in
33
+ * the widget, not touching an excluded or sensitive part
34
+ * (`pointing.selection`), never under a modal dialog of the page, which
35
+ * leaves the widget inert. It follows the page as it scrolls. The one reader
36
+ * of the bubble of "point and ask" and of the bar of actions.
37
+ */
38
+ export declare function usePageSelection({ pointing, enabled, }: {
39
+ pointing: Pick<PagePointing, 'selection'>;
40
+ /** Held off while false: while the user points, during an answer, with neither the bubble nor the bar. */
41
+ enabled: () => boolean;
42
+ }): {
43
+ selection: Readonly<Ref<PageSelectionOnScreen | undefined>>;
44
+ /** Hides what is selected now, until the selection changes. */
45
+ clear: () => void;
46
+ };
47
+ /**
48
+ * The bar of actions on a selection of the page (spec `selection-actions.md`,
49
+ * "La barra", "Cosa parte"): the agent's actions for the selection the page
50
+ * reader holds, and what an action sends. The selection stays while the
51
+ * field of "Ask…" is open, where the page's selection moves into the field,
52
+ * follows the page with it, and comes back on the page when the field
53
+ * closes without sending. A press outside the bar, or the bar held off (an
54
+ * answer starting, the user pointing), closes it.
55
+ */
56
+ export declare function useSelectionActions({ selection, clear, available, group, describe, locale, t, onSend, }: {
57
+ selection: Readonly<Ref<PageSelectionOnScreen | undefined>>;
58
+ clear: () => void;
59
+ /** The bar may show: the page reader's own condition. */
60
+ available: () => boolean;
61
+ /** The agent's page group (`capabilities.selectionActions.page`): absent is no bar. */
62
+ group: () => SelectionGroupCapability | undefined;
63
+ describe: PagePointing['describe'];
64
+ locale: () => string;
65
+ t: (key: string) => string;
66
+ /** An action was chosen: its instruction, the selection it is about, the action's id (`ask` for a question). */
67
+ onSend: (text: string, pointer: PagePointer, action: string) => void;
68
+ }): {
69
+ held: Readonly<Ref<PageSelectionOnScreen | undefined>>;
70
+ actions: globalThis.ComputedRef<SelectionBarAction[]>;
71
+ asking: Ref<boolean, boolean>;
72
+ /** An action of the bar, with the word its field asked for if any. */
73
+ run: (id: string) => void;
74
+ /** The user's own question about the selection. */
75
+ ask: (text: string) => void;
76
+ dismiss: () => void;
77
+ };