@tangle-network/ui 11.10.0 → 11.11.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 (130) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/active-sessions-store-Gt1R0rFG.js +262 -0
  3. package/dist/{active-sessions-store-CeOmXgv5.d.ts → active-sessions-store-nl70ZnMC.d.ts} +40 -41
  4. package/dist/artifact-pane-BL_DFWNl.d.ts +32 -0
  5. package/dist/artifact-pane-DMXT9a8U.js +70 -0
  6. package/dist/auth-DixfCMCk.js +154 -0
  7. package/dist/auth.d.ts +2 -74
  8. package/dist/auth.js +2 -16
  9. package/dist/branding-26d5ARIr.d.ts +14 -0
  10. package/dist/button-uhNnwdsD.js +78 -0
  11. package/dist/button-yoIv77e2.d.ts +16 -0
  12. package/dist/chat-CPLL0Fd9.js +667 -0
  13. package/dist/chat.d.ts +2 -201
  14. package/dist/chat.js +2 -31
  15. package/dist/code-block-B9miUPht.d.ts +23 -0
  16. package/dist/code-block-CngSn37j.js +165 -0
  17. package/dist/diff-preview-cySuqowW.js +533 -0
  18. package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
  19. package/dist/document-editor-pane-Cz6oEF1o.js +1287 -0
  20. package/dist/dropdown-menu-BpcLa5vF.js +101 -0
  21. package/dist/editor.d.ts +76 -78
  22. package/dist/editor.js +2 -34
  23. package/dist/file-format-BgXbr-Ib.js +160 -0
  24. package/dist/files-CYlOo0mE.js +743 -0
  25. package/dist/files.d.ts +2 -243
  26. package/dist/files.js +3 -41
  27. package/dist/focus-Cw02pNSr.js +56 -0
  28. package/dist/format-DfcLWqMa.js +54 -0
  29. package/dist/hooks.d.ts +30 -37
  30. package/dist/hooks.js +111 -46
  31. package/dist/index-2UntyjBb.d.ts +52 -0
  32. package/dist/index-COgqsFAQ.d.ts +42 -0
  33. package/dist/index-CPDET_s1.d.ts +549 -0
  34. package/dist/index-CUhfHT_V.d.ts +204 -0
  35. package/dist/index-Cg6gYAqh.d.ts +73 -0
  36. package/dist/index-Cq-EJzqW.d.ts +16 -0
  37. package/dist/index-DhYmSaLF.d.ts +245 -0
  38. package/dist/index-DjKxO357.d.ts +128 -0
  39. package/dist/index-b56ew9aF.d.ts +107 -0
  40. package/dist/index.d.ts +26 -43
  41. package/dist/index.js +35 -472
  42. package/dist/markdown-BprL96Gl.js +45 -0
  43. package/dist/markdown.d.ts +3 -18
  44. package/dist/markdown.js +3 -15
  45. package/dist/message-vhUI0c5G.d.ts +16 -0
  46. package/dist/nav.d.ts +6 -8
  47. package/dist/nav.js +29 -11
  48. package/dist/openui-artifact-renderer-D3E5bIAI.d.ts +114 -0
  49. package/dist/openui-artifact-renderer-DT4xbvWt.js +266 -0
  50. package/dist/openui.d.ts +2 -115
  51. package/dist/openui.js +2 -13
  52. package/dist/parts-5mhy9yJ3.d.ts +37 -0
  53. package/dist/primitives-DE-blUz-.js +1239 -0
  54. package/dist/primitives.d.ts +5 -525
  55. package/dist/primitives.js +9 -212
  56. package/dist/redaction-CGGB2ENG.js +74 -0
  57. package/dist/redaction.d.ts +2 -42
  58. package/dist/redaction.js +2 -7
  59. package/dist/run-OyWmIDqu.d.ts +41 -0
  60. package/dist/run-ZsIKPA6J.js +17 -0
  61. package/dist/run-group-D1InSdQu.js +410 -0
  62. package/dist/run.d.ts +3 -126
  63. package/dist/run.js +5 -40
  64. package/dist/sdk-hooks.d.ts +2 -285
  65. package/dist/sdk-hooks.js +3 -36
  66. package/dist/stores.d.ts +13 -14
  67. package/dist/stores.js +34 -76
  68. package/dist/table-DHyqDPbU.js +146 -0
  69. package/dist/tabs-ujuqAdtb.js +40 -0
  70. package/dist/text-shimmer-BUUo6I-g.js +64 -0
  71. package/dist/tool-call-feed-BeB1_4pX.d.ts +47 -0
  72. package/dist/tool-call-feed-C1W1N54c.js +109 -0
  73. package/dist/tool-call-step-Bi3_YJRV.js +434 -0
  74. package/dist/tool-display-BAuAVa43.js +158 -0
  75. package/dist/{tool-display-z4JcDmMQ.d.ts → tool-display-DgmL5rIU.d.ts} +16 -16
  76. package/dist/tool-previews.d.ts +2 -48
  77. package/dist/tool-previews.js +2 -23
  78. package/dist/types.d.ts +6 -19
  79. package/dist/types.js +0 -1
  80. package/dist/use-auto-scroll-C5Pjeqon.js +153 -0
  81. package/dist/use-sse-stream-BjVBDbxK.js +884 -0
  82. package/dist/use-sse-stream-Dm6R5YWz.d.ts +282 -0
  83. package/dist/utils-Bl_CZ0Qp.js +37 -0
  84. package/dist/{chunk-RQHJBTEU.js → utils-C_uf36nf.js} +4 -6
  85. package/dist/utils.d.ts +2 -104
  86. package/dist/utils.js +6 -44
  87. package/package.json +39 -41
  88. package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
  89. package/dist/button-CMQuQEW_.d.ts +0 -17
  90. package/dist/chunk-34A66VBG.js +0 -214
  91. package/dist/chunk-3OI2QKFD.js +0 -0
  92. package/dist/chunk-3XXBZL53.js +0 -174
  93. package/dist/chunk-42PAH5D2.js +0 -112
  94. package/dist/chunk-4CLN43XT.js +0 -45
  95. package/dist/chunk-55WHV7SS.js +0 -1604
  96. package/dist/chunk-565EATZZ.js +0 -156
  97. package/dist/chunk-5Z5ZYMOJ.js +0 -0
  98. package/dist/chunk-6BGQA4BQ.js +0 -0
  99. package/dist/chunk-BEBXZPHW.js +0 -299
  100. package/dist/chunk-C5WF4WMV.js +0 -734
  101. package/dist/chunk-HFL6R6IF.js +0 -37
  102. package/dist/chunk-HGML45QH.js +0 -104
  103. package/dist/chunk-HMAPIH7L.js +0 -595
  104. package/dist/chunk-K5XFRUS4.js +0 -1401
  105. package/dist/chunk-KFQGHD73.js +0 -198
  106. package/dist/chunk-L57WRIND.js +0 -59
  107. package/dist/chunk-LTEKI7YJ.js +0 -59
  108. package/dist/chunk-M3QZK62R.js +0 -233
  109. package/dist/chunk-ND3ZFXQK.js +0 -179
  110. package/dist/chunk-OEX7NZE3.js +0 -321
  111. package/dist/chunk-OL5GYLHV.js +0 -60
  112. package/dist/chunk-QGFYBNSO.js +0 -133
  113. package/dist/chunk-R7B3UWPF.js +0 -550
  114. package/dist/chunk-R7SUY4E3.js +0 -65
  115. package/dist/chunk-REJESC5U.js +0 -117
  116. package/dist/chunk-RQGKSCEZ.js +0 -0
  117. package/dist/chunk-SNLR2AEA.js +0 -40
  118. package/dist/chunk-WKWBTL2V.js +0 -15
  119. package/dist/chunk-X7CU776B.js +0 -1048
  120. package/dist/chunk-XU3HB5QL.js +0 -127
  121. package/dist/chunk-YTO5V6QS.js +0 -19
  122. package/dist/chunk-YU4E5J2N.js +0 -437
  123. package/dist/chunk-YZ6AK25N.js +0 -886
  124. package/dist/code-block-0kSpWMnf.d.ts +0 -25
  125. package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
  126. package/dist/document-editor-pane-QHDOBA43.js +0 -13
  127. package/dist/message-BHWbxBtT.d.ts +0 -15
  128. package/dist/parts-dj7AcUg0.d.ts +0 -36
  129. package/dist/run-PfLmDAox.d.ts +0 -41
  130. package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
@@ -1,117 +0,0 @@
1
- // src/hooks/use-live-time.ts
2
- import * as React from "react";
3
- function useLiveTime(intervalMs = 1e3) {
4
- const [now, setNow] = React.useState(() => Date.now());
5
- React.useEffect(() => {
6
- const requested = Number.isFinite(intervalMs) && intervalMs > 0 ? intervalMs : 1e3;
7
- const delay = Math.max(requested, 100);
8
- const id = window.setInterval(() => {
9
- setNow(Date.now());
10
- }, delay);
11
- return () => {
12
- window.clearInterval(id);
13
- };
14
- }, [intervalMs]);
15
- return now;
16
- }
17
-
18
- // src/hooks/use-auth.ts
19
- import * as React2 from "react";
20
- function useAuth({
21
- apiBaseUrl,
22
- revalidateOnFocus = false,
23
- shouldRetryOnError = false
24
- }) {
25
- const [user, setUser] = React2.useState(null);
26
- const [isLoading, setIsLoading] = React2.useState(true);
27
- const [error, setError] = React2.useState(null);
28
- const retryTimerRef = React2.useRef(null);
29
- const abortRef = React2.useRef(null);
30
- const fetchSession = React2.useCallback(async () => {
31
- abortRef.current?.abort();
32
- const controller = new AbortController();
33
- abortRef.current = controller;
34
- setIsLoading(true);
35
- setError(null);
36
- try {
37
- const res = await fetch(`${apiBaseUrl}/auth/session`, {
38
- credentials: "include",
39
- signal: controller.signal
40
- });
41
- if (!res.ok) {
42
- throw new Error("Not authenticated");
43
- }
44
- const data = await res.json();
45
- if (data.success && data.data) {
46
- setUser(data.data);
47
- } else {
48
- setUser(null);
49
- }
50
- } catch (err) {
51
- if (err.name === "AbortError") return;
52
- setError(err instanceof Error ? err : new Error("Unknown error"));
53
- setUser(null);
54
- if (shouldRetryOnError) {
55
- if (retryTimerRef.current) clearTimeout(retryTimerRef.current);
56
- retryTimerRef.current = setTimeout(fetchSession, 5e3);
57
- }
58
- } finally {
59
- if (!controller.signal.aborted) {
60
- setIsLoading(false);
61
- }
62
- }
63
- }, [apiBaseUrl, shouldRetryOnError]);
64
- React2.useEffect(() => {
65
- fetchSession();
66
- return () => {
67
- abortRef.current?.abort();
68
- if (retryTimerRef.current) clearTimeout(retryTimerRef.current);
69
- };
70
- }, [fetchSession]);
71
- React2.useEffect(() => {
72
- if (!revalidateOnFocus) return;
73
- const handleFocus = () => {
74
- fetchSession();
75
- };
76
- window.addEventListener("focus", handleFocus);
77
- return () => window.removeEventListener("focus", handleFocus);
78
- }, [revalidateOnFocus, fetchSession]);
79
- return {
80
- user,
81
- isLoading,
82
- isError: !!error,
83
- error,
84
- mutate: fetchSession
85
- };
86
- }
87
- function createAuthFetcher(_apiBaseUrl) {
88
- return async function authFetcher(url, options) {
89
- const res = await fetch(url, {
90
- ...options,
91
- credentials: "include",
92
- headers: {
93
- ...options?.headers
94
- }
95
- });
96
- if (!res.ok) {
97
- throw new Error(`Request failed with status ${res.status}`);
98
- }
99
- return res.json();
100
- };
101
- }
102
- function useApiKey() {
103
- const [apiKey, setApiKey] = React2.useState(null);
104
- React2.useEffect(() => {
105
- if (typeof window !== "undefined") {
106
- setApiKey(localStorage.getItem("apiKey"));
107
- }
108
- }, []);
109
- return apiKey;
110
- }
111
-
112
- export {
113
- useLiveTime,
114
- useAuth,
115
- createAuthFetcher,
116
- useApiKey
117
- };
File without changes
@@ -1,40 +0,0 @@
1
- // src/utils/copy-text.ts
2
- async function copyText(text) {
3
- if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
4
- try {
5
- await navigator.clipboard.writeText(text);
6
- return true;
7
- } catch {
8
- }
9
- }
10
- if (typeof document === "undefined") return false;
11
- try {
12
- const textarea = document.createElement("textarea");
13
- textarea.value = text;
14
- textarea.style.position = "fixed";
15
- textarea.style.opacity = "0";
16
- document.body.appendChild(textarea);
17
- textarea.select();
18
- const copied = document.execCommand("copy");
19
- document.body.removeChild(textarea);
20
- return copied;
21
- } catch {
22
- return false;
23
- }
24
- }
25
-
26
- // src/utils/time-ago.ts
27
- function timeAgo(ts) {
28
- const secs = Math.floor((Date.now() - ts) / 1e3);
29
- if (secs < 5) return "just now";
30
- if (secs < 60) return `${secs}s ago`;
31
- const mins = Math.floor(secs / 60);
32
- if (mins < 60) return `${mins}m ago`;
33
- const hrs = Math.floor(mins / 60);
34
- return `${hrs}h ago`;
35
- }
36
-
37
- export {
38
- copyText,
39
- timeAgo
40
- };
@@ -1,15 +0,0 @@
1
- // src/lib/focus.ts
2
- var focusField = "border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] focus:outline-hidden focus:border-[var(--focus-border)] focus:ring-3 focus:ring-[var(--focus-halo)]";
3
- var focusFieldWithin = "border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:border-[var(--focus-border)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-3 has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-[var(--focus-halo)]";
4
- var focusFieldInvalid = "border-[var(--surface-danger-border)] hover:border-[var(--surface-danger-border)] focus:border-[var(--focus-border-danger)] focus:ring-[var(--focus-halo-danger)]";
5
- var focusRingBase = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)]";
6
- var focusRing = `${focusRingBase} focus-visible:outline-offset-0`;
7
- var focusRingInset = `${focusRingBase} focus-visible:-outline-offset-1 focus-visible:ring-inset`;
8
-
9
- export {
10
- focusField,
11
- focusFieldWithin,
12
- focusFieldInvalid,
13
- focusRing,
14
- focusRingInset
15
- };