@asgard-js/react 0.0.43 → 0.0.44-canary.2

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 (136) hide show
  1. package/dist/components/chatbot/chatbot.d.ts +1 -1
  2. package/dist/components/chatbot/chatbot.d.ts.map +1 -1
  3. package/dist/context/asgard-service-context.d.ts +1 -1
  4. package/dist/context/asgard-service-context.d.ts.map +1 -1
  5. package/dist/hooks/use-channel.d.ts +1 -1
  6. package/dist/hooks/use-channel.d.ts.map +1 -1
  7. package/dist/index.js +20457 -20222
  8. package/package.json +4 -4
  9. package/.babelrc +0 -12
  10. package/eslint.config.cjs +0 -12
  11. package/src/components/.DS_Store +0 -0
  12. package/src/components/chatbot/api-key-input/api-key-input.module.scss +0 -156
  13. package/src/components/chatbot/api-key-input/api-key-input.tsx +0 -111
  14. package/src/components/chatbot/api-key-input/index.ts +0 -1
  15. package/src/components/chatbot/chatbot-body/chatbot-body.module.scss +0 -13
  16. package/src/components/chatbot/chatbot-body/chatbot-body.tsx +0 -45
  17. package/src/components/chatbot/chatbot-body/conversation-message-renderer.tsx +0 -55
  18. package/src/components/chatbot/chatbot-body/index.ts +0 -1
  19. package/src/components/chatbot/chatbot-container/chatbot-container.module.scss +0 -41
  20. package/src/components/chatbot/chatbot-container/chatbot-container.tsx +0 -49
  21. package/src/components/chatbot/chatbot-container/chatbot-full-screen-container.tsx +0 -54
  22. package/src/components/chatbot/chatbot-footer/chatbot-footer.module.scss +0 -67
  23. package/src/components/chatbot/chatbot-footer/chatbot-footer.tsx +0 -140
  24. package/src/components/chatbot/chatbot-footer/index.ts +0 -1
  25. package/src/components/chatbot/chatbot-footer/speech-input-button.tsx +0 -132
  26. package/src/components/chatbot/chatbot-header/chatbot-header.module.scss +0 -48
  27. package/src/components/chatbot/chatbot-header/chatbot-header.tsx +0 -98
  28. package/src/components/chatbot/chatbot-header/index.ts +0 -1
  29. package/src/components/chatbot/chatbot.module.scss +0 -24
  30. package/src/components/chatbot/chatbot.spec.tsx +0 -8
  31. package/src/components/chatbot/chatbot.tsx +0 -227
  32. package/src/components/chatbot/profile-icon.tsx +0 -26
  33. package/src/components/index.ts +0 -2
  34. package/src/components/templates/avatar/avatar.module.scss +0 -6
  35. package/src/components/templates/avatar/avatar.tsx +0 -28
  36. package/src/components/templates/avatar/index.ts +0 -1
  37. package/src/components/templates/button-template/button-template.module.scss +0 -0
  38. package/src/components/templates/button-template/button-template.tsx +0 -45
  39. package/src/components/templates/button-template/card.module.scss +0 -58
  40. package/src/components/templates/button-template/card.spec.tsx +0 -213
  41. package/src/components/templates/button-template/card.tsx +0 -123
  42. package/src/components/templates/button-template/index.ts +0 -1
  43. package/src/components/templates/carousel-template/carousel-template.module.scss +0 -15
  44. package/src/components/templates/carousel-template/carousel-template.tsx +0 -49
  45. package/src/components/templates/carousel-template/index.ts +0 -1
  46. package/src/components/templates/chart-template/chart-template.module.scss +0 -52
  47. package/src/components/templates/chart-template/chart-template.tsx +0 -75
  48. package/src/components/templates/chart-template/index.ts +0 -1
  49. package/src/components/templates/hint-template/hint-template.module.scss +0 -43
  50. package/src/components/templates/hint-template/hint-template.tsx +0 -76
  51. package/src/components/templates/hint-template/index.ts +0 -1
  52. package/src/components/templates/image-template/image-template.module.scss +0 -67
  53. package/src/components/templates/image-template/image-template.tsx +0 -58
  54. package/src/components/templates/image-template/index.ts +0 -1
  55. package/src/components/templates/index.ts +0 -10
  56. package/src/components/templates/quick-replies/index.ts +0 -1
  57. package/src/components/templates/quick-replies/quick-replies.module.scss +0 -16
  58. package/src/components/templates/quick-replies/quick-replies.tsx +0 -47
  59. package/src/components/templates/template-box/index.ts +0 -2
  60. package/src/components/templates/template-box/template-box-content.module.scss +0 -13
  61. package/src/components/templates/template-box/template-box-content.tsx +0 -30
  62. package/src/components/templates/template-box/template-box.module.scss +0 -19
  63. package/src/components/templates/template-box/template-box.tsx +0 -48
  64. package/src/components/templates/text-template/bot-typing-box.tsx +0 -81
  65. package/src/components/templates/text-template/bot-typing-placeholder.tsx +0 -28
  66. package/src/components/templates/text-template/index.ts +0 -3
  67. package/src/components/templates/text-template/text-template.module.scss +0 -131
  68. package/src/components/templates/text-template/text-template.tsx +0 -94
  69. package/src/components/templates/text-template/use-react-markdown-renderer.spec.tsx +0 -758
  70. package/src/components/templates/time/index.ts +0 -1
  71. package/src/components/templates/time/time.module.scss +0 -6
  72. package/src/components/templates/time/time.tsx +0 -34
  73. package/src/context/asgard-app-initialization-context.tsx +0 -154
  74. package/src/context/asgard-service-context.tsx +0 -148
  75. package/src/context/asgard-template-context.tsx +0 -83
  76. package/src/context/asgard-theme-context.tsx +0 -553
  77. package/src/context/index.ts +0 -4
  78. package/src/hooks/index.ts +0 -11
  79. package/src/hooks/use-asgard-service-client.ts +0 -68
  80. package/src/hooks/use-channel.ts +0 -160
  81. package/src/hooks/use-debounce.ts +0 -18
  82. package/src/hooks/use-deep-compare-memo.ts +0 -19
  83. package/src/hooks/use-is-on-screen-keyboard-open.ts +0 -43
  84. package/src/hooks/use-on-screen-keyboard-scroll-fix.ts +0 -17
  85. package/src/hooks/use-prevent-over-scrolling.ts +0 -77
  86. package/src/hooks/use-react-markdown-renderer.tsx +0 -278
  87. package/src/hooks/use-resize-observer.tsx +0 -27
  88. package/src/hooks/use-update-vh.ts +0 -30
  89. package/src/hooks/use-viewport-size.ts +0 -51
  90. package/src/icons/add_a_photo.svg +0 -3
  91. package/src/icons/bot.svg +0 -14
  92. package/src/icons/close.svg +0 -3
  93. package/src/icons/distance.svg +0 -3
  94. package/src/icons/eye-off.svg +0 -4
  95. package/src/icons/eye.svg +0 -4
  96. package/src/icons/mic.svg +0 -3
  97. package/src/icons/photo_library.svg +0 -3
  98. package/src/icons/profile.svg +0 -28
  99. package/src/icons/refresh.svg +0 -3
  100. package/src/icons/send.svg +0 -3
  101. package/src/icons/stop.svg +0 -22
  102. package/src/icons/volume_up.svg +0 -3
  103. package/src/index.ts +0 -4
  104. package/src/models/bot-provider.ts +0 -108
  105. package/src/styles/_index.scss +0 -1
  106. package/src/styles/_styles.scss +0 -11
  107. package/src/styles/colors/_colors.scss +0 -10
  108. package/src/styles/colors/_index.scss +0 -1
  109. package/src/styles/colors/_variables.scss +0 -72
  110. package/src/styles/palette/_index.scss +0 -1
  111. package/src/styles/palette/_palette.scss +0 -42
  112. package/src/styles/palette/_variables.scss +0 -40
  113. package/src/styles/radius/_index.scss +0 -1
  114. package/src/styles/radius/_radius.scss +0 -8
  115. package/src/styles/radius/_variables.scss +0 -12
  116. package/src/styles/spacing/_index.scss +0 -1
  117. package/src/styles/spacing/_spacing.scss +0 -8
  118. package/src/styles/spacing/_variables.scss +0 -13
  119. package/src/styles/utils/_index.scss +0 -1
  120. package/src/styles/utils/_map.scss +0 -22
  121. package/src/test-setup.ts +0 -1
  122. package/src/utils/color-utils.ts +0 -52
  123. package/src/utils/deep-merge.ts +0 -26
  124. package/src/utils/extractors.ts +0 -20
  125. package/src/utils/format-time.ts +0 -8
  126. package/src/utils/index.ts +0 -1
  127. package/src/utils/is.ts +0 -72
  128. package/src/utils/selectors.ts +0 -7
  129. package/src/utils/uri-validation.spec.ts +0 -208
  130. package/src/utils/uri-validation.ts +0 -103
  131. package/tsconfig.json +0 -16
  132. package/tsconfig.lib.json +0 -63
  133. package/tsconfig.spec.json +0 -36
  134. package/tsconfig.tsbuildinfo +0 -1
  135. package/vite.config.ts +0 -63
  136. /package/dist/{style.css → index.css} +0 -0
@@ -1,51 +0,0 @@
1
- import { useCallback, useEffect, useState, useLayoutEffect } from 'react';
2
-
3
- const useBrowserLayoutEffect =
4
- typeof window !== 'undefined' ? useLayoutEffect : null;
5
-
6
- type Width = number;
7
- type Height = number;
8
- type Size = [Width, Height];
9
-
10
- function getViewportSize(): Size {
11
- return window.visualViewport
12
- ? [window.visualViewport.width, window.visualViewport.height]
13
- : [window.innerWidth, window.innerHeight];
14
- }
15
-
16
- export function useViewportSize(): Size | undefined {
17
- const [viewportSize, setViewportSize] = useState<Size | undefined>();
18
-
19
- const updateViewportSize = useCallback(() => {
20
- const viewportSize = getViewportSize();
21
-
22
- setViewportSize((oldViewportSize) =>
23
- oldViewportSize &&
24
- oldViewportSize[0] === viewportSize[0] &&
25
- oldViewportSize[1] === viewportSize[1]
26
- ? oldViewportSize
27
- : viewportSize
28
- );
29
- }, []);
30
-
31
- useBrowserLayoutEffect?.(updateViewportSize, [updateViewportSize]);
32
-
33
- useEffect(() => {
34
- function effectTwice(): void {
35
- updateViewportSize();
36
- setTimeout(updateViewportSize, 1000);
37
- }
38
-
39
- window.addEventListener('resize', effectTwice);
40
- window.addEventListener('orientationchange', effectTwice);
41
- window.visualViewport?.addEventListener('resize', effectTwice);
42
-
43
- return (): void => {
44
- window.removeEventListener('resize', effectTwice);
45
- window.removeEventListener('orientationchange', effectTwice);
46
- window.visualViewport?.removeEventListener('resize', effectTwice);
47
- };
48
- }, [updateViewportSize]);
49
-
50
- return viewportSize;
51
- }
@@ -1,3 +0,0 @@
1
- <svg width="18" height="16" viewBox="0 0 18 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M2.16303 15.5837C1.79762 15.5837 1.48296 15.4517 1.21908 15.1878C0.955187 14.9239 0.823242 14.6093 0.823242 14.2439V5.75678C0.823242 5.39137 0.955187 5.07671 1.21908 4.81283C1.48296 4.54894 1.79762 4.41699 2.16303 4.41699H4.58283L6.08283 2.41699H11.7464V3.50033H6.64866L5.14053 5.50033H2.16303C2.08817 5.50033 2.02671 5.52435 1.97866 5.57241C1.9306 5.62047 1.90658 5.68192 1.90658 5.75678V14.2439C1.90658 14.3187 1.9306 14.3802 1.97866 14.4282C2.02671 14.4763 2.08817 14.5003 2.16303 14.5003H14.6501C14.725 14.5003 14.7864 14.4763 14.8345 14.4282C14.8825 14.3802 14.9066 14.3187 14.9066 14.2439V6.66053H15.9899V14.2439C15.9899 14.6093 15.8604 14.9239 15.6014 15.1878C15.3423 15.4517 15.0253 15.5837 14.6501 15.5837H2.16303ZM14.9066 5.00033V3.50033H13.4066V2.41699H14.9066V0.916992H15.9899V2.41699H17.4899V3.50033H15.9899V5.00033H14.9066ZM8.40658 13.1797C9.32116 13.1797 10.0797 12.8715 10.6822 12.2551C11.2847 11.6387 11.586 10.8871 11.586 10.0003C11.586 9.12741 11.2847 8.37928 10.6822 7.75595C10.0797 7.13262 9.32116 6.82095 8.40658 6.82095C7.49199 6.82095 6.73345 7.13262 6.13095 7.75595C5.52845 8.37928 5.2272 9.13088 5.2272 10.0107C5.2272 10.8906 5.52845 11.6387 6.13095 12.2551C6.73345 12.8715 7.49199 13.1797 8.40658 13.1797ZM8.40658 12.0966C7.79116 12.0966 7.28797 11.8932 6.89699 11.4864C6.50588 11.0797 6.31033 10.5774 6.31033 9.97949C6.31033 9.39324 6.50588 8.90081 6.89699 8.5022C7.28797 8.10345 7.79116 7.90408 8.40658 7.90408C9.02199 7.90408 9.52519 8.10345 9.91616 8.5022C10.3073 8.90081 10.5028 9.39324 10.5028 9.97949C10.5028 10.5774 10.3073 11.0797 9.91616 11.4864C9.52519 11.8932 9.02199 12.0966 8.40658 12.0966Z" fill="currentColor"/>
3
- </svg>
package/src/icons/bot.svg DELETED
@@ -1,14 +0,0 @@
1
- <svg
2
- viewBox="0 0 25 24"
3
- fill="none"
4
- xmlns="http://www.w3.org/2000/svg"
5
- >
6
- <path
7
- d="M0.40625 12C0.40625 5.37258 5.77883 0 12.4062 0C19.0337 0 24.4062 5.37258 24.4062 12C24.4062 18.6274 19.0337 24 12.4062 24C5.77883 24 0.40625 18.6274 0.40625 12Z"
8
- fill="#585858"
9
- />
10
- <path
11
- d="M6.40625 18.75V15C6.40625 14.5875 6.55313 14.2344 6.84688 13.9406C7.14063 13.6469 7.49375 13.5 7.90625 13.5H16.9062C17.3188 13.5 17.6719 13.6469 17.9656 13.9406C18.2594 14.2344 18.4062 14.5875 18.4062 15V18.75H6.40625ZM10.1562 12.75C9.11875 12.75 8.23438 12.3844 7.50312 11.6531C6.77187 10.9219 6.40625 10.0375 6.40625 9C6.40625 7.9625 6.77187 7.07812 7.50312 6.34687C8.23438 5.61562 9.11875 5.25 10.1562 5.25H14.6562C15.6938 5.25 16.5781 5.61562 17.3094 6.34687C18.0406 7.07812 18.4062 7.9625 18.4062 9C18.4062 10.0375 18.0406 10.9219 17.3094 11.6531C16.5781 12.3844 15.6938 12.75 14.6562 12.75H10.1562ZM7.90625 17.25H16.9062V15H7.90625V17.25ZM10.1562 11.25H14.6562C15.2812 11.25 15.8125 11.0312 16.25 10.5938C16.6875 10.1562 16.9062 9.625 16.9062 9C16.9062 8.375 16.6875 7.84375 16.25 7.40625C15.8125 6.96875 15.2812 6.75 14.6562 6.75H10.1562C9.53125 6.75 9 6.96875 8.5625 7.40625C8.125 7.84375 7.90625 8.375 7.90625 9C7.90625 9.625 8.125 10.1562 8.5625 10.5938C9 11.0312 9.53125 11.25 10.1562 11.25ZM10.1562 9.75C10.3688 9.75 10.5469 9.67812 10.6906 9.53438C10.8344 9.39062 10.9062 9.2125 10.9062 9C10.9062 8.7875 10.8344 8.60938 10.6906 8.46562C10.5469 8.32187 10.3688 8.25 10.1562 8.25C9.94375 8.25 9.76562 8.32187 9.62187 8.46562C9.47812 8.60938 9.40625 8.7875 9.40625 9C9.40625 9.2125 9.47812 9.39062 9.62187 9.53438C9.76562 9.67812 9.94375 9.75 10.1562 9.75ZM14.6562 9.75C14.8687 9.75 15.0469 9.67812 15.1906 9.53438C15.3344 9.39062 15.4062 9.2125 15.4062 9C15.4062 8.7875 15.3344 8.60938 15.1906 8.46562C15.0469 8.32187 14.8687 8.25 14.6562 8.25C14.4438 8.25 14.2656 8.32187 14.1219 8.46562C13.9781 8.60938 13.9062 8.7875 13.9062 9C13.9062 9.2125 13.9781 9.39062 14.1219 9.53438C14.2656 9.67812 14.4438 9.75 14.6562 9.75Z"
12
- fill="white"
13
- />
14
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="15" height="14" viewBox="0 0 15 14" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3496 0L7.41062 5.938L1.47162 0L0.411621 1.06L6.34962 6.999L0.411621 12.938L1.47162 13.999L7.41062 8.059L13.3496 13.999L14.4096 12.938L8.47162 6.999L14.4096 1.06L13.3496 0Z" fill="currentColor"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="11" height="16" viewBox="0 0 11 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M5.40658 15.5837C3.97074 15.5837 2.81317 15.3955 1.93387 15.0191C1.05456 14.6427 0.614909 14.1487 0.614909 13.5372C0.614909 13.2135 0.76102 12.9143 1.05324 12.6397C1.34546 12.3651 1.75762 12.1274 2.2897 11.9266L3.16949 12.736C2.90769 12.8214 2.63331 12.9348 2.34637 13.0764C2.05956 13.218 1.83817 13.3759 1.6822 13.5499C1.75053 13.7712 2.17442 13.9848 2.95387 14.191C3.73317 14.3972 4.54942 14.5003 5.40262 14.5003C6.31123 14.5003 7.14831 14.3972 7.91387 14.191C8.67928 13.9848 9.08234 13.7503 9.12303 13.4874C8.96915 13.3464 8.73998 13.2052 8.43553 13.0637C8.13095 12.9221 7.84783 12.8086 7.58616 12.723L8.47387 11.901C9.03901 12.0965 9.46769 12.3385 9.75991 12.627C10.0521 12.9155 10.1982 13.2177 10.1982 13.5337C10.1982 14.1463 9.75859 14.6411 8.87928 15.018C7.99998 15.3951 6.84241 15.5837 5.40658 15.5837ZM5.42741 11.7295C6.75213 10.7252 7.74651 9.70998 8.41053 8.68387C9.07456 7.65762 9.40658 6.65949 9.40658 5.68949C9.40658 4.30713 8.97734 3.26338 8.11887 2.55824C7.2604 1.85296 6.35762 1.50033 5.41053 1.50033C4.46345 1.50033 3.55935 1.85317 2.69824 2.55887C1.83713 3.26442 1.40658 4.30873 1.40658 5.69178C1.40658 6.60901 1.74123 7.57512 2.41053 8.59012C3.07984 9.60512 4.08546 10.6516 5.42741 11.7295ZM5.40658 13.0837C3.69921 11.8074 2.42519 10.546 1.58449 9.29949C0.743659 8.0531 0.323242 6.85019 0.323242 5.69074C0.323242 4.83199 0.476575 4.07463 0.783242 3.41866C1.08991 2.76269 1.48838 2.21324 1.97866 1.77033C2.46908 1.32755 3.01574 0.991297 3.61866 0.761575C4.22144 0.531853 4.81783 0.416992 5.40783 0.416992C5.99783 0.416992 6.5938 0.531853 7.19574 0.761575C7.79783 0.991297 8.34408 1.32755 8.83449 1.77033C9.32477 2.21324 9.72324 2.76289 10.0299 3.41928C10.3366 4.07567 10.4899 4.83241 10.4899 5.68949C10.4899 6.84908 10.0695 8.0522 9.22866 9.29887C8.38797 10.5455 7.11394 11.8071 5.40658 13.0837ZM5.41053 6.9122C5.78178 6.9122 6.0972 6.78373 6.35678 6.52678C6.61651 6.26984 6.74637 5.95303 6.74637 5.57637C6.74637 5.19984 6.61623 4.88178 6.35595 4.6222C6.09567 4.36248 5.77921 4.23262 5.40658 4.23262C5.03796 4.23262 4.72255 4.36623 4.46033 4.63345C4.19796 4.90081 4.06678 5.2138 4.06678 5.57241C4.06678 5.93783 4.19796 6.25248 4.46033 6.51637C4.72255 6.78026 5.03928 6.9122 5.41053 6.9122Z" fill="currentColor"/>
3
- </svg>
@@ -1,4 +0,0 @@
1
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
- <path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>
3
- <line x1="1" y1="1" x2="23" y2="23"/>
4
- </svg>
package/src/icons/eye.svg DELETED
@@ -1,4 +0,0 @@
1
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
- <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
3
- <circle cx="12" cy="12" r="3"/>
4
- </svg>
package/src/icons/mic.svg DELETED
@@ -1,3 +0,0 @@
1
- <svg width="11" height="16" viewBox="0 0 11 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M5.40658 9.90397C4.82435 9.90397 4.33158 9.7023 3.92824 9.29897C3.52491 8.89564 3.32324 8.40286 3.32324 7.82064V2.82064C3.32324 2.23842 3.52491 1.74564 3.92824 1.3423C4.33158 0.938971 4.82435 0.737305 5.40658 0.737305C5.9888 0.737305 6.48158 0.938971 6.88491 1.3423C7.28824 1.74564 7.48991 2.23842 7.48991 2.82064V7.82064C7.48991 8.40286 7.28824 8.89564 6.88491 9.29897C6.48158 9.7023 5.9888 9.90397 5.40658 9.90397ZM4.86491 15.1123V12.8654C3.56213 12.7208 2.47949 12.1724 1.61699 11.2202C0.754492 10.2679 0.323242 9.13467 0.323242 7.82064H1.40658C1.40658 8.92731 1.79706 9.87064 2.57803 10.6506C3.35887 11.4306 4.30331 11.8206 5.41137 11.8206C6.51928 11.8206 7.46213 11.4306 8.23991 10.6506C9.01769 9.87064 9.40658 8.92731 9.40658 7.82064H10.4899C10.4899 9.13467 10.0587 10.2679 9.19616 11.2202C8.33366 12.1724 7.25102 12.7208 5.94824 12.8654V15.1123H4.86491ZM5.40658 8.82064C5.68991 8.82064 5.92741 8.7248 6.11908 8.53314C6.31074 8.34147 6.40658 8.10397 6.40658 7.82064V2.82064C6.40658 2.5373 6.31074 2.2998 6.11908 2.10814C5.92741 1.91647 5.68991 1.82064 5.40658 1.82064C5.12324 1.82064 4.88574 1.91647 4.69408 2.10814C4.50241 2.2998 4.40658 2.5373 4.40658 2.82064V7.82064C4.40658 8.10397 4.50241 8.34147 4.69408 8.53314C4.88574 8.7248 5.12324 8.82064 5.40658 8.82064Z" fill="currentColor"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="15" height="16" viewBox="0 0 15 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M4.97042 10.1925H12.4254L10.089 7.04501L8.14979 9.5771L6.75875 7.79189L4.97042 10.1925ZM3.95438 12.904C3.57924 12.904 3.26215 12.7745 3.00312 12.5154C2.7441 12.2564 2.61458 11.9393 2.61458 11.5642V2.0771C2.61458 1.70196 2.7441 1.38487 3.00312 1.12585C3.26215 0.866819 3.57924 0.737305 3.95438 0.737305H13.4415C13.8166 0.737305 14.1337 0.866819 14.3927 1.12585C14.6517 1.38487 14.7812 1.70196 14.7812 2.0771V11.5642C14.7812 11.9393 14.6517 12.2564 14.3927 12.5154C14.1337 12.7745 13.8166 12.904 13.4415 12.904H3.95438ZM3.95438 11.8206H13.4415C13.5056 11.8206 13.5644 11.7939 13.6177 11.7404C13.6712 11.6871 13.6979 11.6283 13.6979 11.5642V2.0771C13.6979 2.01293 13.6712 1.95418 13.6177 1.90085C13.5644 1.84737 13.5056 1.82064 13.4415 1.82064H3.95438C3.89021 1.82064 3.83146 1.84737 3.77813 1.90085C3.72465 1.95418 3.69792 2.01293 3.69792 2.0771V11.5642C3.69792 11.6283 3.72465 11.6871 3.77813 11.7404C3.83146 11.7939 3.89021 11.8206 3.95438 11.8206ZM1.37104 15.4873C0.995903 15.4873 0.678819 15.3578 0.419792 15.0988C0.160764 14.8397 0.03125 14.5227 0.03125 14.1475V3.5771H1.11458V14.1475C1.11458 14.2117 1.14132 14.2704 1.19479 14.3238C1.24813 14.3772 1.30687 14.404 1.37104 14.404H11.9415V15.4873H1.37104Z" fill="currentColor"/>
3
- </svg>
@@ -1,28 +0,0 @@
1
- <svg
2
- width="33"
3
- height="32"
4
- viewBox="0 0 33 32"
5
- fill="none"
6
- xmlns="http://www.w3.org/2000/svg"
7
- >
8
- <g clip-path="url(#clip0_3084_29383)">
9
- <path
10
- d="M0.410645 16C0.410645 7.16344 7.57409 0 16.4106 0C25.2472 0 32.4106 7.16344 32.4106 16C32.4106 24.8366 25.2472 32 16.4106 32C7.57409 32 0.410645 24.8366 0.410645 16Z"
11
- fill="#333333"
12
- />
13
- <path
14
- fill-rule="evenodd"
15
- clip-rule="evenodd"
16
- d="M16.5788 6.33398C19.8925 6.33398 22.5788 9.02028 22.5788 12.334C22.5788 14.2211 21.7075 15.9048 20.3453 17.0047C23.6487 18.3735 26.0607 21.6974 26.4106 25.6673H24.4569C24.0206 21.6274 20.9742 18.4911 17.2591 18.3397L16.9776 18.334H16.5788H15.8437C12.0019 18.334 8.81164 21.5258 8.36437 25.6673H6.41064C6.76857 21.607 9.28344 18.2225 12.7029 16.9143C11.4036 15.8137 10.5788 14.1701 10.5788 12.334C10.5788 9.02028 13.265 6.33398 16.5788 6.33398ZM16.5788 16.334C18.7879 16.334 20.5788 14.5431 20.5788 12.334C20.5788 10.1248 18.7879 8.33398 16.5788 8.33398C14.3696 8.33398 12.5788 10.1248 12.5788 12.334C12.5788 14.5431 14.3696 16.334 16.5788 16.334Z"
17
- fill="#8C8C8C"
18
- />
19
- </g>
20
- <defs>
21
- <clipPath id="clip0_3084_29383">
22
- <path
23
- d="M0.410645 16C0.410645 7.16344 7.57409 0 16.4106 0C25.2472 0 32.4106 7.16344 32.4106 16C32.4106 24.8366 25.2472 32 16.4106 32C7.57409 32 0.410645 24.8366 0.410645 16Z"
24
- fill="white"
25
- />
26
- </clipPath>
27
- </defs>
28
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd" d="M3.49453 2.3352C6.44049 -0.226723 10.9105 -0.106316 13.7142 2.69633C16.6428 5.62613 16.6428 10.3739 13.7144 13.3035C10.7846 16.2322 6.03581 16.2322 3.1073 13.3036C2.30873 12.505 1.71132 11.5536 1.34188 10.5109L1.78892 10.3525L1.34171 10.5106L1.22791 10.162C1.01752 9.46018 0.910643 8.73159 0.910643 7.9997H2.4542L2.46382 8.33865C2.49584 8.9024 2.60763 9.46037 2.79674 9.99539L2.7968 9.99536L2.90116 10.2683C3.19714 10.9887 3.63414 11.6475 4.19876 12.2121C6.52451 14.5379 10.2961 14.5379 12.6229 12.212C14.9486 9.88539 14.9486 6.11464 12.6227 3.78781C10.3306 1.49653 6.63579 1.46263 4.30292 3.68622L6.68087 3.68698V5.22954H3.49394H1.95141V3.68698V0.5H3.49394L3.49453 2.3352Z" fill="currentColor"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="15" height="12" viewBox="0 0 15 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M0.823242 11.6953V0.945312L14.3328 6.32031L0.823242 11.6953ZM1.90658 10.0911L11.3649 6.32031L1.90658 2.54948V4.98052L5.92574 6.32031L1.90658 7.6601V10.0911Z" fill="currentColor"/>
3
- </svg>
@@ -1,22 +0,0 @@
1
- <svg
2
- width="40"
3
- height="40"
4
- viewBox="0 0 40 40"
5
- xmlns="http://www.w3.org/2000/svg"
6
- >
7
- <circle
8
- cx="20"
9
- cy="20"
10
- r="18"
11
- fill="#D04444"
12
- />
13
- <rect
14
- x="12"
15
- y="12"
16
- width="16"
17
- height="16"
18
- fill="#FFFFFF"
19
- rx="2"
20
- ry="2"
21
- />
22
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M8.93825 13.6412V12.4953C10.0846 12.1546 11.0112 11.5071 11.7178 10.5526C12.4246 9.59817 12.778 8.52255 12.778 7.32574C12.778 6.12908 12.4212 5.0588 11.7074 4.11491C10.9938 3.17088 10.0708 2.50769 8.93825 2.12533V0.979492C10.3784 1.35338 11.559 2.12713 12.4799 3.30074C13.4008 4.47435 13.8612 5.80741 13.8612 7.29991C13.8612 8.79241 13.4042 10.1289 12.4903 11.3095C11.5763 12.49 10.3923 13.2673 8.93825 13.6412ZM0.951172 8.88324V5.71658H3.71076L7.11763 2.3097V12.2901L3.71076 8.88324H0.951172ZM8.93825 10.1572V4.44262C9.47409 4.72595 9.88798 5.1229 10.1799 5.63345C10.4717 6.14401 10.6176 6.70283 10.6176 7.30991C10.6176 7.90894 10.4703 8.46178 10.1758 8.96845C9.88117 9.47512 9.46867 9.87137 8.93825 10.1572ZM6.0343 4.92491L4.1593 6.79991H2.0343V7.79991H4.1593L6.0343 9.67491V4.92491Z" fill="currentColor"/>
3
- </svg>
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- import 'highlight.js/styles/atom-one-dark.css';
2
- export * from './components';
3
- export * from './context';
4
- export * from './hooks';
@@ -1,108 +0,0 @@
1
- import { ClientConfig } from '@asgard-js/core';
2
- import { annotationSelectorFromBotProviderMetadata } from '../utils/selectors';
3
-
4
- export type BotProviderMetadataResponse = {
5
- name: string;
6
- namespace: string;
7
- uid: string;
8
- resourceVersion: string;
9
- generation: number;
10
- creationTimestamp: string;
11
- labels: Record<string, string>;
12
- annotations: Record<string, string>;
13
- managedFields: Array<{
14
- manager: string;
15
- operation: string;
16
- apiVersion: string;
17
- time: string;
18
- fieldsType: string;
19
- fieldsV1: Record<string, unknown>;
20
- subresource: string;
21
- }>;
22
- };
23
-
24
- const stubGetAsgardBotProviderMetadata =
25
- async (): Promise<BotProviderMetadataResponse> => {
26
- return {
27
- name: '',
28
- namespace: '',
29
- uid: '',
30
- resourceVersion: '0',
31
- generation: 0,
32
- creationTimestamp: new Date().toISOString(),
33
- labels: {},
34
- annotations: {
35
- 'asgard-ai.com/additional-annotation': JSON.stringify({
36
- embedConfig: {
37
- theme: {
38
- chatbot: {},
39
- botMessage: {},
40
- userMessage: {},
41
- },
42
- },
43
- }),
44
- },
45
- managedFields: [],
46
- };
47
- };
48
-
49
- const stubGetAnnotations = async (): Promise<Record<string, unknown>> => {
50
- const metadata = await stubGetAsgardBotProviderMetadata();
51
-
52
- return annotationSelectorFromBotProviderMetadata(metadata);
53
- };
54
-
55
- export const getBotProviderModels = (
56
- config: ClientConfig
57
- ): {
58
- getAsgardBotProviderMetadata: () => Promise<BotProviderMetadataResponse>;
59
- getAnnotations: () => Promise<Record<string, unknown>>;
60
- } => {
61
- if (!config.botProviderEndpoint) {
62
- // eslint-disable-next-line no-console
63
- console.warn(
64
- '[getBotProviderModels] botProviderEndpoint is not defined in config. ' +
65
- 'Bot provider features will be disabled. Consider providing botProviderEndpoint for full functionality.'
66
- );
67
-
68
- return {
69
- getAsgardBotProviderMetadata: stubGetAsgardBotProviderMetadata,
70
- getAnnotations: stubGetAnnotations,
71
- };
72
- }
73
-
74
- const headers: Record<string, string> = {};
75
-
76
- if (config.apiKey) {
77
- headers['x-api-key'] = config.apiKey;
78
- }
79
-
80
- async function getAsgardBotProviderMetadata(): Promise<BotProviderMetadataResponse> {
81
- const response = await fetch(`${config.botProviderEndpoint}/metadata`, {
82
- method: 'GET',
83
- headers: {
84
- ...headers,
85
- 'Content-Type': 'application/json',
86
- },
87
- });
88
-
89
- if (!response.ok) {
90
- throw new Error(`Failed to fetch metadata: ${response.statusText}`);
91
- }
92
-
93
- const json: { data: BotProviderMetadataResponse } = await response.json();
94
-
95
- return json.data;
96
- }
97
-
98
- async function getAnnotations(): Promise<Record<string, unknown>> {
99
- const metadata = await getAsgardBotProviderMetadata();
100
-
101
- return annotationSelectorFromBotProviderMetadata(metadata);
102
- }
103
-
104
- return {
105
- getAsgardBotProviderMetadata,
106
- getAnnotations,
107
- };
108
- };
@@ -1 +0,0 @@
1
- @forward './styles';
@@ -1,11 +0,0 @@
1
- @use './colors';
2
- @use './palette';
3
- @use './radius';
4
- @use './spacing';
5
-
6
- @mixin generate() {
7
- @include colors.generate();
8
- @include palette.generate();
9
- @include radius.generate();
10
- @include spacing.generate();
11
- }
@@ -1,10 +0,0 @@
1
- @use './variables';
2
- @use '../utils';
3
-
4
- $prefix: asg-color;
5
-
6
- @mixin generate($map: variables.$colors-map) {
7
- @each $color, $list in $map {
8
- @include utils.generate-vars($prefix + '-' + $color, $list);
9
- }
10
- }
@@ -1 +0,0 @@
1
- @forward './colors';
@@ -1,72 +0,0 @@
1
- $blue-colors: (
2
- #edf0fd,
3
- #d3dbfa,
4
- #b0bef6,
5
- #6882ef,
6
- #8b9ff2,
7
- #4767eb,
8
- #3c58c8,
9
- #3249a7,
10
- #283b86,
11
- #202e6a
12
- );
13
-
14
- $orange-colors: (
15
- #ffeded,
16
- #ffd4d5,
17
- #ffb2b3,
18
- #ff8f90,
19
- #ff6d6f,
20
- #ff4d4f,
21
- #d94143,
22
- #b53738,
23
- #912c2d,
24
- #732324
25
- );
26
-
27
- $green-colors: (
28
- #eef9e8,
29
- #d5f1c8,
30
- #b5e69d,
31
- #92da6f,
32
- #71cf43,
33
- #52c41a,
34
- #46a716,
35
- #3a8b12,
36
- #2f700f,
37
- #25580c,
38
- );
39
-
40
- $yellow-colors: (
41
- #fef7eb,
42
- #fdebcf,
43
- #fcdba9,
44
- #facb82,
45
- #f8bb5c,
46
- #f7ac38,
47
- #d29230,
48
- #af7a28,
49
- #8d6220,
50
- #6f4d19,
51
- );
52
-
53
- $grey-colors: (
54
- #f3f3f3,
55
- #e2e2e2,
56
- #cbcbcb,
57
- #b2b2b2,
58
- #9b9b9b,
59
- #585858,
60
- #717171,
61
- #5e5e5e,
62
- #4c4c4c,
63
- #3c3c3c
64
- );
65
-
66
- $colors-map: (
67
- blue: $blue-colors,
68
- orange: $orange-colors,
69
- green: $green-colors,
70
- yellow: $yellow-colors,
71
- grey: $grey-colors
72
- );
@@ -1 +0,0 @@
1
- @forward './palette';
@@ -1,42 +0,0 @@
1
- @use 'sass:map';
2
- @use './variables';
3
-
4
- $prefix: asg-color;
5
-
6
- @mixin generate-state-colors($map: variables.$state-colors-map) {
7
- @each $state, $colors-map in $map {
8
-
9
- $main-color: map.get($colors-map, main);
10
- $light-color: map.get($colors-map, light);
11
- $dark-color: map.get($colors-map, dark);
12
-
13
- --#{$prefix}-#{$state}: #{$main-color};
14
- --#{$prefix}-#{$state}-light: #{$light-color};
15
- --#{$prefix}-#{$state}-dark: #{$dark-color};
16
- --#{$prefix}-#{$state}-on-#{$state}: #ffffff;
17
- --#{$prefix}-#{$state}-hover-bg: #{rgba($light-color, 0.15)};
18
- --#{$prefix}-#{$state}-selected-bg: #{rgba($main-color, 0.20)};
19
- }
20
- }
21
-
22
- @mixin generate() {
23
- @include generate-state-colors();
24
-
25
- --#{$prefix}-action-active: #ffffff;
26
- --#{$prefix}-action-inactive: #8c8c8c;
27
- --#{$prefix}-action-disabled: #595959;
28
- --#{$prefix}-action-disabled-bg: #393939;
29
-
30
- --#{$prefix}-text-primary: #ffffff;
31
- --#{$prefix}-text-secondary: #8c8c8c;
32
- --#{$prefix}-text-disabled: #595959;
33
- --#{$prefix}-text-placeholder: #8c8c8c;
34
-
35
- --#{$prefix}-bg: #141414;
36
- --#{$prefix}-surface: #1f1f1f;
37
- --#{$prefix}-divider: #333333;
38
- --#{$prefix}-border: #434343;
39
-
40
- --#{$prefix}-overlay-dark: #{rgba(#000000, 0.5)};
41
- --#{$prefix}-overlay-light: #{rgba(#1f1f1f, 0.9)};
42
- }
@@ -1,40 +0,0 @@
1
- @use 'sass:list';
2
- @use '../colors/variables';
3
-
4
- $primary-colors: (
5
- main: list.nth(variables.$blue-colors, 6),
6
- light: list.nth(variables.$blue-colors, 5),
7
- dark: list.nth(variables.$blue-colors, 8),
8
- );
9
-
10
- $secondary-colors: (
11
- main: list.nth(variables.$grey-colors, 6),
12
- light: list.nth(variables.$grey-colors, 4),
13
- dark: list.nth(variables.$grey-colors, 9),
14
- );
15
-
16
- $error-colors: (
17
- main: list.nth(variables.$orange-colors, 6),
18
- light: list.nth(variables.$orange-colors, 5),
19
- dark: list.nth(variables.$orange-colors, 7),
20
- );
21
-
22
- $warning-colors: (
23
- main: list.nth(variables.$yellow-colors, 6),
24
- light: list.nth(variables.$yellow-colors, 5),
25
- dark: list.nth(variables.$yellow-colors, 8),
26
- );
27
-
28
- $success-colors: (
29
- main: list.nth(variables.$green-colors, 6),
30
- light: list.nth(variables.$green-colors, 5),
31
- dark: list.nth(variables.$green-colors, 8),
32
- );
33
-
34
- $state-colors-map: (
35
- primary: $primary-colors,
36
- secondary: $secondary-colors,
37
- error: $error-colors,
38
- warning: $warning-colors,
39
- success: $success-colors,
40
- );
@@ -1 +0,0 @@
1
- @forward './radius';
@@ -1,8 +0,0 @@
1
- @use './variables';
2
- @use '../utils';
3
-
4
- $prefix: asg-radius;
5
-
6
- @mixin generate($map: variables.$radius-map) {
7
- @include utils.generate-vars($prefix, $map);
8
- }
@@ -1,12 +0,0 @@
1
- $radius-map: (
2
- none: 0px,
3
- xxs: 2px,
4
- xs: 4px,
5
- s: 6px,
6
- md: 8px,
7
- lg: 10px,
8
- xl: 12px,
9
- 2xl: 16px,
10
- 3xl: 20px,
11
- 4xl: 24px
12
- );
@@ -1 +0,0 @@
1
- @forward './spacing';
@@ -1,8 +0,0 @@
1
- @use './variables';
2
- @use '../utils';
3
-
4
- $prefix: asg-spacing;
5
-
6
- @mixin generate($list: variables.$spacing-list) {
7
- @include utils.generate-vars($prefix, $list);
8
- }
@@ -1,13 +0,0 @@
1
- $spacing-list: (
2
- 4px,
3
- 8px,
4
- 12px,
5
- 16px,
6
- 24px,
7
- 32px,
8
- 40px,
9
- 48px,
10
- 64px,
11
- 96px,
12
- 160px
13
- );
@@ -1 +0,0 @@
1
- @forward './map';
@@ -1,22 +0,0 @@
1
- @use 'sass:meta';
2
- @use 'sass:list';
3
- @use 'sass:map';
4
-
5
- @mixin generate-vars($prefix, $data) {
6
- $map: null;
7
-
8
- @if meta.type-of($data) == "list" {
9
- $map: ();
10
- @for $i from 1 through list.length($data) {
11
- $map: map.merge($map, ($i: list.nth($data, $i)));
12
- }
13
- } @else if meta.type-of($data) == "map" {
14
- $map: $data;
15
- } @else {
16
- @warn "generate-vars: The provided data is neither a list nor a map. (type: #{meta.type-of($data)})";
17
- }
18
-
19
- @each $index, $item in $map {
20
- --#{$prefix}-#{$index}: #{$item};
21
- }
22
- }
package/src/test-setup.ts DELETED
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom';
@@ -1,52 +0,0 @@
1
- /**
2
- * Darkens a color by a given percentage
3
- * @param color - Hex color string (e.g., "#640000")
4
- * @param percentage - Percentage to darken (e.g., 0.2 for 20%)
5
- * @returns Darkened hex color string
6
- */
7
- export function darkenColor(color: string, percentage: number): string {
8
- // Remove # if present
9
- const hex = color.replace('#', '');
10
-
11
- // Parse RGB values
12
- const r = parseInt(hex.slice(0, 2), 16);
13
- const g = parseInt(hex.slice(2, 4), 16);
14
- const b = parseInt(hex.slice(4, 6), 16);
15
-
16
- // Apply darkening (multiply by 1 - percentage)
17
- const factor = 1 - percentage;
18
- const newR = Math.round(r * factor);
19
- const newG = Math.round(g * factor);
20
- const newB = Math.round(b * factor);
21
-
22
- // Convert back to hex
23
- const toHex = (n: number): string => n.toString(16).padStart(2, '0');
24
-
25
- return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
26
- }
27
-
28
- /**
29
- * Lightens a color by mixing with white
30
- * @param color - Hex color string (e.g., "#640000")
31
- * @param percentage - Percentage to lighten (e.g., 0.8 for 20% original, 80% white)
32
- * @returns Lightened hex color string
33
- */
34
- export function lightenColor(color: string, percentage: number): string {
35
- // Remove # if present
36
- const hex = color.replace('#', '');
37
-
38
- // Parse RGB values
39
- const r = parseInt(hex.slice(0, 2), 16);
40
- const g = parseInt(hex.slice(2, 4), 16);
41
- const b = parseInt(hex.slice(4, 6), 16);
42
-
43
- // Mix with white: original + (255 - original) * percentage
44
- const newR = Math.round(r + (255 - r) * percentage);
45
- const newG = Math.round(g + (255 - g) * percentage);
46
- const newB = Math.round(b + (255 - b) * percentage);
47
-
48
- // Convert back to hex
49
- const toHex = (n: number): string => n.toString(16).padStart(2, '0');
50
-
51
- return `#${toHex(newR)}${toHex(newG)}${toHex(newB)}`;
52
- }
@@ -1,26 +0,0 @@
1
- export function isObject(item: unknown): item is Record<string, unknown> {
2
- return item !== null && typeof item === 'object' && !Array.isArray(item);
3
- }
4
-
5
- export function deepMerge<T extends Record<string, unknown>, U extends Record<string, unknown>>(
6
- target: T,
7
- source: U
8
- ): T & U {
9
- const output = { ...target } as T & U;
10
-
11
- if (!source) return output;
12
-
13
- for (const [key, value] of Object.entries(source)) {
14
- if (!isObject(value)) {
15
- (output as Record<string, unknown>)[key] = value;
16
- continue;
17
- }
18
-
19
- (output as Record<string, unknown>)[key] = deepMerge(
20
- isObject((output as Record<string, unknown>)[key]) ? (output as Record<string, unknown>)[key] as Record<string, unknown> : {},
21
- value as Record<string, unknown>
22
- );
23
- }
24
-
25
- return output;
26
- }