@tuturuuu/ui 0.23.0 → 0.24.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.
- package/CHANGELOG.md +29 -0
- package/biome.json +1 -1
- package/package.json +78 -78
- package/src/components/ui/calendar-app/components/require-workspace-timezone-dialog.test.tsx +121 -0
- package/src/components/ui/calendar-app/components/require-workspace-timezone-dialog.tsx +37 -4
- package/src/components/ui/chat/ai-message-markdown.tsx +6 -1
- package/src/components/ui/chat/chat-sidebar-groups.test.ts +33 -0
- package/src/components/ui/chat/chat-sidebar-items.tsx +10 -2
- package/src/components/ui/chat/chat-sidebar-panel.test.tsx +29 -1
- package/src/components/ui/chat/chat-sidebar-panel.tsx +4 -3
- package/src/components/ui/chat/chat-sidebar-sections.ts +24 -10
- package/src/components/ui/chat/chat-utils.test.ts +107 -0
- package/src/components/ui/chat/chat-workspace-header.tsx +11 -5
- package/src/components/ui/chat/chat-workspace.tsx +66 -24
- package/src/components/ui/chat/hooks-conversations.ts +9 -1
- package/src/components/ui/chat/hooks-messages.ts +1 -0
- package/src/components/ui/chat/message-bubble.tsx +49 -4
- package/src/components/ui/chat/message-composer.tsx +29 -23
- package/src/components/ui/chat/message-markdown.tsx +4 -1
- package/src/components/ui/chat/query-keys.ts +7 -1
- package/src/components/ui/chat/utils.ts +85 -3
- package/src/components/ui/custom/__tests__/workspace-select-helpers.test.ts +72 -0
- package/src/components/ui/custom/onboarding-settings-panel.tsx +131 -0
- package/src/components/ui/custom/settings-dialog-shell.tsx +55 -18
- package/src/components/ui/custom/workspace-select-helpers.ts +50 -0
- package/src/components/ui/custom/workspace-select.tsx +37 -38
- package/src/components/ui/finance/analytics/analytics-page.tsx +10 -0
- package/src/components/ui/finance/analytics/inventory-provider-summary.tsx +110 -0
- package/src/components/ui/finance/finance-overview-metrics.tsx +49 -0
- package/src/components/ui/finance/transactions/inventory-reconciliation-entry-row.tsx +122 -0
- package/src/components/ui/finance/transactions/inventory-reconciliation-panel.tsx +407 -0
- package/src/components/ui/finance/transactions/transaction-card.tsx +15 -0
- package/src/components/ui/finance/transactions/transaction-edit-dialog.test.tsx +31 -0
- package/src/components/ui/finance/transactions/transaction-edit-dialog.tsx +26 -4
- package/src/components/ui/finance/transactions/transactionId/transaction-details-client-page.tsx +22 -0
- package/src/components/ui/finance/transactions/transactions-page.tsx +8 -0
- package/src/components/ui/finance/wallets/walletId/inventory-wallet-contribution.tsx +84 -0
- package/src/components/ui/finance/wallets/walletId/wallet-details-page.test.tsx +4 -0
- package/src/components/ui/finance/wallets/walletId/wallet-details-page.tsx +9 -0
- package/src/components/ui/legacy/meet/create-plan-dialog.tsx +27 -10
- package/src/components/ui/legacy/meet/edit-plan-dialog.tsx +90 -26
- package/src/components/ui/legacy/meet/form.tsx +25 -1
- package/src/components/ui/legacy/meet/lib/meet-ics.test.ts +40 -0
- package/src/components/ui/legacy/meet/lib/meet-ics.ts +50 -0
- package/src/components/ui/legacy/meet/lib/meet-insights.test.ts +76 -0
- package/src/components/ui/legacy/meet/lib/meet-insights.ts +219 -0
- package/src/components/ui/legacy/meet/lib/meet-timezone.test.ts +53 -0
- package/src/components/ui/legacy/meet/lib/meet-timezone.ts +45 -0
- package/src/components/ui/legacy/meet/page.tsx +1 -0
- package/src/components/ui/legacy/meet/planId/agenda-details.tsx +46 -23
- package/src/components/ui/legacy/meet/planId/copy-link-button.tsx +24 -197
- package/src/components/ui/legacy/meet/planId/date-planner.tsx +3 -28
- package/src/components/ui/legacy/meet/planId/meet-insights-panel.tsx +135 -0
- package/src/components/ui/legacy/meet/planId/meet-plan-live-root.tsx +41 -0
- package/src/components/ui/legacy/meet/planId/meet-query.ts +26 -0
- package/src/components/ui/legacy/meet/planId/meet-suggestions-panel.tsx +463 -0
- package/src/components/ui/legacy/meet/planId/page.tsx +58 -18
- package/src/components/ui/legacy/meet/planId/plan-details-client.tsx +154 -140
- package/src/components/ui/legacy/meet/planId/selectable-day-time.tsx +88 -56
- package/src/components/ui/legacy/meet/planId/show-qr-button.tsx +3 -5
- package/src/components/ui/legacy/meet/planId/unified-availability.tsx +36 -13
- package/src/components/ui/legacy/meet/planId/utility-buttons.tsx +3 -24
- package/src/components/ui/legacy/meet/plans-grid.tsx +1 -1
- package/src/components/ui/legacy/meet/plans-list-view.tsx +1 -1
- package/src/components/ui/nuqs-adapter.tsx +1 -0
- package/src/hooks/time-blocking-provider.tsx +127 -211
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.24.0](https://github.com/tutur3u/platform/compare/ui-v0.23.0...ui-v0.24.0) (2026-08-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **chat:** add connected site sync bridge ([05c27f5](https://github.com/tutur3u/platform/commit/05c27f5ac4a545af366097ee2a919ec755970b9b))
|
|
9
|
+
* **chat:** add connected site sync bridge ([#5078](https://github.com/tutur3u/platform/issues/5078)) ([3de1a07](https://github.com/tutur3u/platform/commit/3de1a07dfa2fec96982aa0d116e003d0aa3fe47c))
|
|
10
|
+
* **finance:** reconcile inventory provider sales ([56650e0](https://github.com/tutur3u/platform/commit/56650e066c473337700998d8af607380e8ea6202))
|
|
11
|
+
* **inventory:** allocate bundle revenue and add cash checkout ([bd465f9](https://github.com/tutur3u/platform/commit/bd465f9bb35fad16d259378fa49611a8eb5ba95b))
|
|
12
|
+
* **meet:** revamp collaborative scheduling ([9124a5d](https://github.com/tutur3u/platform/commit/9124a5d559e071c7e6c1c713cfbca4d9f5205611))
|
|
13
|
+
* **onboarding:** connect product guidance across apps ([68cf626](https://github.com/tutur3u/platform/commit/68cf626c9650e5044b6c123f9423a6cebf1bba9a))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **chat:** address external bridge review findings ([30533fc](https://github.com/tutur3u/platform/commit/30533fc64093fed4b25279bc0e45d43bdb7a6cde))
|
|
19
|
+
* **chat:** close bridge edge cases ([db585c8](https://github.com/tutur3u/platform/commit/db585c8486064837dcbce615a30f66c38c0a3ec0))
|
|
20
|
+
* **chat:** harden bridge review edge cases ([0ecfad7](https://github.com/tutur3u/platform/commit/0ecfad7c66454fdb3bcd971f1362d3789287f086))
|
|
21
|
+
* **chat:** harden connected site migration ([73cccd0](https://github.com/tutur3u/platform/commit/73cccd04e9bd85a443891f3e52b443ef755570cb))
|
|
22
|
+
* **chat:** harden connected site sync ([70e8785](https://github.com/tutur3u/platform/commit/70e8785967e145a77330272e671ca58dfc38fbee))
|
|
23
|
+
* **chat:** harden external bridge boundaries ([2d25202](https://github.com/tutur3u/platform/commit/2d252023e5cfb1c7414ee2ed2d161e7f5de613f8))
|
|
24
|
+
* **chat:** harden external bridge synchronization ([63ccf91](https://github.com/tutur3u/platform/commit/63ccf9129ff8e7cf255bef8c74a3e096ab45cb7d))
|
|
25
|
+
* **chat:** mount query state adapter ([#5084](https://github.com/tutur3u/platform/issues/5084)) ([60253f8](https://github.com/tutur3u/platform/commit/60253f82477fc54923556706d12e4dc525a7a170))
|
|
26
|
+
* **chat:** preserve native message behavior ([fc09530](https://github.com/tutur3u/platform/commit/fc095301f2d26ca2bc39de02ce17b1f341327de9))
|
|
27
|
+
* **deps:** align Streamdown with Shiki 4 ([0d89f55](https://github.com/tutur3u/platform/commit/0d89f555b3228307e893a5d7723aaf8db8505d63))
|
|
28
|
+
* **platform:** stabilize offline and calendar initialization ([8ef8fbc](https://github.com/tutur3u/platform/commit/8ef8fbc1274e108930adf38bb8e998384551058b))
|
|
29
|
+
* **ui:** preserve hosted workspace logos ([1f8e8b2](https://github.com/tutur3u/platform/commit/1f8e8b28c23f659952ad58f00a2a371acd8fcef9))
|
|
30
|
+
* **workspaces:** route satellite creation through setup ([754bf1b](https://github.com/tutur3u/platform/commit/754bf1b81360e4755a171819f3a8e6a7c102f351))
|
|
31
|
+
|
|
3
32
|
## [0.23.0](https://github.com/tutur3u/platform/compare/ui-v0.22.0...ui-v0.23.0) (2026-07-28)
|
|
4
33
|
|
|
5
34
|
|
package/biome.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuturuuu/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,36 +21,36 @@
|
|
|
21
21
|
"@dnd-kit/sortable": "^10.0.0",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.2",
|
|
23
23
|
"@dqcai/vn-lunar": "^1.0.1",
|
|
24
|
-
"@hookform/resolvers": "^5.
|
|
24
|
+
"@hookform/resolvers": "^5.7.1",
|
|
25
25
|
"@json-render/core": "^0.19.0",
|
|
26
26
|
"@json-render/react": "^0.19.0",
|
|
27
|
-
"@radix-ui/react-accordion": "^1.2.
|
|
28
|
-
"@radix-ui/react-alert-dialog": "^1.1.
|
|
29
|
-
"@radix-ui/react-aspect-ratio": "^1.1.
|
|
30
|
-
"@radix-ui/react-avatar": "^1.2.
|
|
31
|
-
"@radix-ui/react-checkbox": "^1.3.
|
|
32
|
-
"@radix-ui/react-collapsible": "^1.1.
|
|
33
|
-
"@radix-ui/react-context-menu": "^2.3.
|
|
34
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
35
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
36
|
-
"@radix-ui/react-hover-card": "^1.1.
|
|
37
|
-
"@radix-ui/react-label": "^2.1.
|
|
38
|
-
"@radix-ui/react-menubar": "^1.1.
|
|
39
|
-
"@radix-ui/react-navigation-menu": "^1.2.
|
|
40
|
-
"@radix-ui/react-popover": "^1.1.
|
|
41
|
-
"@radix-ui/react-progress": "^1.1.
|
|
42
|
-
"@radix-ui/react-radio-group": "^1.4.
|
|
43
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
44
|
-
"@radix-ui/react-select": "^2.3.
|
|
45
|
-
"@radix-ui/react-separator": "^1.1.
|
|
46
|
-
"@radix-ui/react-slider": "^1.4.
|
|
47
|
-
"@radix-ui/react-slot": "^1.3.
|
|
48
|
-
"@radix-ui/react-switch": "^1.3.
|
|
49
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
50
|
-
"@radix-ui/react-toast": "^1.2.
|
|
51
|
-
"@radix-ui/react-toggle": "^1.1.
|
|
52
|
-
"@radix-ui/react-toggle-group": "^1.1.
|
|
53
|
-
"@radix-ui/react-tooltip": "^1.2.
|
|
27
|
+
"@radix-ui/react-accordion": "^1.2.20",
|
|
28
|
+
"@radix-ui/react-alert-dialog": "^1.1.23",
|
|
29
|
+
"@radix-ui/react-aspect-ratio": "^1.1.15",
|
|
30
|
+
"@radix-ui/react-avatar": "^1.2.6",
|
|
31
|
+
"@radix-ui/react-checkbox": "^1.3.11",
|
|
32
|
+
"@radix-ui/react-collapsible": "^1.1.20",
|
|
33
|
+
"@radix-ui/react-context-menu": "^2.3.7",
|
|
34
|
+
"@radix-ui/react-dialog": "^1.1.23",
|
|
35
|
+
"@radix-ui/react-dropdown-menu": "^2.1.24",
|
|
36
|
+
"@radix-ui/react-hover-card": "^1.1.23",
|
|
37
|
+
"@radix-ui/react-label": "^2.1.15",
|
|
38
|
+
"@radix-ui/react-menubar": "^1.1.24",
|
|
39
|
+
"@radix-ui/react-navigation-menu": "^1.2.22",
|
|
40
|
+
"@radix-ui/react-popover": "^1.1.23",
|
|
41
|
+
"@radix-ui/react-progress": "^1.1.16",
|
|
42
|
+
"@radix-ui/react-radio-group": "^1.4.7",
|
|
43
|
+
"@radix-ui/react-scroll-area": "^1.2.18",
|
|
44
|
+
"@radix-ui/react-select": "^2.3.7",
|
|
45
|
+
"@radix-ui/react-separator": "^1.1.15",
|
|
46
|
+
"@radix-ui/react-slider": "^1.4.7",
|
|
47
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
48
|
+
"@radix-ui/react-switch": "^1.3.7",
|
|
49
|
+
"@radix-ui/react-tabs": "^1.1.21",
|
|
50
|
+
"@radix-ui/react-toast": "^1.2.23",
|
|
51
|
+
"@radix-ui/react-toggle": "^1.1.18",
|
|
52
|
+
"@radix-ui/react-toggle-group": "^1.1.19",
|
|
53
|
+
"@radix-ui/react-tooltip": "^1.2.16",
|
|
54
54
|
"@streamdown/cjk": "^1.0.3",
|
|
55
55
|
"@streamdown/code": "^1.1.1",
|
|
56
56
|
"@streamdown/math": "^1.0.2",
|
|
@@ -59,40 +59,40 @@
|
|
|
59
59
|
"@tanstack/react-pacer": "^0.22.1",
|
|
60
60
|
"@tanstack/react-query": "^5.101.2",
|
|
61
61
|
"@tanstack/react-table": "^8.21.3",
|
|
62
|
-
"@tanstack/react-virtual": "^3.14.
|
|
63
|
-
"@tiptap/core": "3.
|
|
64
|
-
"@tiptap/extension-collaboration": "3.
|
|
65
|
-
"@tiptap/extension-collaboration-caret": "3.
|
|
66
|
-
"@tiptap/extension-color": "3.
|
|
67
|
-
"@tiptap/extension-drag-handle": "3.
|
|
68
|
-
"@tiptap/extension-drag-handle-react": "3.
|
|
69
|
-
"@tiptap/extension-highlight": "3.
|
|
70
|
-
"@tiptap/extension-horizontal-rule": "3.
|
|
71
|
-
"@tiptap/extension-image": "3.
|
|
72
|
-
"@tiptap/extension-link": "3.
|
|
73
|
-
"@tiptap/extension-list": "3.
|
|
74
|
-
"@tiptap/extension-node-range": "3.
|
|
75
|
-
"@tiptap/extension-placeholder": "3.
|
|
76
|
-
"@tiptap/extension-strike": "3.
|
|
77
|
-
"@tiptap/extension-subscript": "3.
|
|
78
|
-
"@tiptap/extension-superscript": "3.
|
|
79
|
-
"@tiptap/extension-table": "3.
|
|
80
|
-
"@tiptap/extension-table-cell": "3.
|
|
81
|
-
"@tiptap/extension-table-header": "3.
|
|
82
|
-
"@tiptap/extension-table-row": "3.
|
|
83
|
-
"@tiptap/extension-text-align": "3.
|
|
84
|
-
"@tiptap/extension-text-style": "3.
|
|
85
|
-
"@tiptap/extension-youtube": "3.
|
|
86
|
-
"@tiptap/pm": "3.
|
|
87
|
-
"@tiptap/react": "3.
|
|
88
|
-
"@tiptap/starter-kit": "3.
|
|
89
|
-
"@tuturuuu/ai": "0.
|
|
90
|
-
"@tuturuuu/apis": "0.
|
|
62
|
+
"@tanstack/react-virtual": "^3.14.9",
|
|
63
|
+
"@tiptap/core": "3.29.2",
|
|
64
|
+
"@tiptap/extension-collaboration": "3.29.2",
|
|
65
|
+
"@tiptap/extension-collaboration-caret": "3.29.2",
|
|
66
|
+
"@tiptap/extension-color": "3.29.2",
|
|
67
|
+
"@tiptap/extension-drag-handle": "3.29.2",
|
|
68
|
+
"@tiptap/extension-drag-handle-react": "3.29.2",
|
|
69
|
+
"@tiptap/extension-highlight": "3.29.2",
|
|
70
|
+
"@tiptap/extension-horizontal-rule": "3.29.2",
|
|
71
|
+
"@tiptap/extension-image": "3.29.2",
|
|
72
|
+
"@tiptap/extension-link": "3.29.2",
|
|
73
|
+
"@tiptap/extension-list": "3.29.2",
|
|
74
|
+
"@tiptap/extension-node-range": "3.29.2",
|
|
75
|
+
"@tiptap/extension-placeholder": "3.29.2",
|
|
76
|
+
"@tiptap/extension-strike": "3.29.2",
|
|
77
|
+
"@tiptap/extension-subscript": "3.29.2",
|
|
78
|
+
"@tiptap/extension-superscript": "3.29.2",
|
|
79
|
+
"@tiptap/extension-table": "3.29.2",
|
|
80
|
+
"@tiptap/extension-table-cell": "3.29.2",
|
|
81
|
+
"@tiptap/extension-table-header": "3.29.2",
|
|
82
|
+
"@tiptap/extension-table-row": "3.29.2",
|
|
83
|
+
"@tiptap/extension-text-align": "3.29.2",
|
|
84
|
+
"@tiptap/extension-text-style": "3.29.2",
|
|
85
|
+
"@tiptap/extension-youtube": "3.29.2",
|
|
86
|
+
"@tiptap/pm": "3.29.2",
|
|
87
|
+
"@tiptap/react": "3.29.2",
|
|
88
|
+
"@tiptap/starter-kit": "3.29.2",
|
|
89
|
+
"@tuturuuu/ai": "0.7.0",
|
|
90
|
+
"@tuturuuu/apis": "0.11.0",
|
|
91
91
|
"@tuturuuu/hooks": "0.1.0",
|
|
92
92
|
"@tuturuuu/icons": "0.1.0",
|
|
93
|
-
"@tuturuuu/internal-api": "0.
|
|
93
|
+
"@tuturuuu/internal-api": "0.27.0",
|
|
94
94
|
"@tuturuuu/supabase": "0.5.0",
|
|
95
|
-
"@tuturuuu/utils": "0.
|
|
95
|
+
"@tuturuuu/utils": "0.22.0",
|
|
96
96
|
"@types/debug": "^4.1.13",
|
|
97
97
|
"browser-image-compression": "^2.0.2",
|
|
98
98
|
"class-variance-authority": "^0.7.1",
|
|
@@ -104,41 +104,41 @@
|
|
|
104
104
|
"debug": "^4.4.3",
|
|
105
105
|
"embla-carousel-react": "^8.6.0",
|
|
106
106
|
"eventemitter3": "^5.0.4",
|
|
107
|
-
"framer-motion": "^12.
|
|
107
|
+
"framer-motion": "^12.43.0",
|
|
108
108
|
"gsap": "^3.15.0",
|
|
109
|
-
"html2canvas-pro": "^2.3.
|
|
109
|
+
"html2canvas-pro": "^2.3.3",
|
|
110
110
|
"input-otp": "^1.4.2",
|
|
111
111
|
"katex": "^0.18.1",
|
|
112
112
|
"lodash": "4.18.1",
|
|
113
113
|
"moment": "^2.30.1",
|
|
114
|
-
"motion": "^12.
|
|
115
|
-
"next": "^16.3.0
|
|
114
|
+
"motion": "^12.43.0",
|
|
115
|
+
"next": "^16.3.0",
|
|
116
116
|
"next-intl": "^4.13.4",
|
|
117
117
|
"next-themes": "^0.4.6",
|
|
118
|
-
"nuqs": "^2.9.
|
|
118
|
+
"nuqs": "^2.9.3",
|
|
119
119
|
"prosemirror-state": "^1.4.4",
|
|
120
|
-
"prosemirror-view": "1.42.
|
|
120
|
+
"prosemirror-view": "1.42.2",
|
|
121
121
|
"qrcode.react": "^4.2.0",
|
|
122
122
|
"react": "^19.2.8",
|
|
123
123
|
"react-colorful": "^5.8.0",
|
|
124
124
|
"react-day-picker": "^10.0.1",
|
|
125
125
|
"react-dom": "^19.2.8",
|
|
126
|
-
"react-dropzone": "^
|
|
127
|
-
"react-hook-form": "^7.
|
|
126
|
+
"react-dropzone": "^20.0.0",
|
|
127
|
+
"react-hook-form": "^7.84.0",
|
|
128
128
|
"react-markdown": "^10.1.0",
|
|
129
129
|
"react-papaparse": "^4.4.0",
|
|
130
130
|
"react-pdf": "^10.4.1",
|
|
131
131
|
"react-resizable": "^4.0.2",
|
|
132
132
|
"react-resizable-panels": "^4.12.2",
|
|
133
133
|
"react-syntax-highlighter": "^16.1.1",
|
|
134
|
-
"recharts": "3.10.
|
|
134
|
+
"recharts": "3.10.1",
|
|
135
135
|
"slot-text": "^0.3.3",
|
|
136
136
|
"sonner": "^2.0.7",
|
|
137
137
|
"streamdown": "^2.5.0",
|
|
138
138
|
"tailwind-scrollbar": "^4.0.2",
|
|
139
139
|
"tailwind-scrollbar-hide": "^4.0.0",
|
|
140
140
|
"tailwindcss-animate": "^1.0.7",
|
|
141
|
-
"tiptap-extension-resize-image": "^1.4.
|
|
141
|
+
"tiptap-extension-resize-image": "^1.4.5",
|
|
142
142
|
"use-debounce": "^10.1.1",
|
|
143
143
|
"vaul": "^1.1.2",
|
|
144
144
|
"y-protocols": "^1.0.7",
|
|
@@ -152,20 +152,20 @@
|
|
|
152
152
|
"@tanstack/react-table": "^8.21.3",
|
|
153
153
|
"@testing-library/jest-dom": "^7.0.0",
|
|
154
154
|
"@testing-library/react": "^16.3.2",
|
|
155
|
-
"@tuturuuu/types": "0.
|
|
155
|
+
"@tuturuuu/types": "0.26.0",
|
|
156
156
|
"@tuturuuu/typescript-config": "0.1.1",
|
|
157
157
|
"@types/html2canvas": "^1.0.0",
|
|
158
|
-
"@types/lodash": "^4.17.
|
|
159
|
-
"@types/node": "^26.1.
|
|
160
|
-
"@types/react": "^19.2.
|
|
161
|
-
"@types/react-dom": "^19.2.
|
|
158
|
+
"@types/lodash": "^4.17.25",
|
|
159
|
+
"@types/node": "^26.1.2",
|
|
160
|
+
"@types/react": "^19.2.18",
|
|
161
|
+
"@types/react-dom": "^19.2.4",
|
|
162
162
|
"@types/react-resizable": "^4.0.0",
|
|
163
163
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
164
164
|
"@types/uuid": "^11.0.0",
|
|
165
|
-
"@vitejs/plugin-react": "^6.0.
|
|
165
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
166
166
|
"autoprefixer": "^10.5.4",
|
|
167
|
-
"jsdom": "^
|
|
168
|
-
"postcss": "^8.5.
|
|
167
|
+
"jsdom": "^30.0.1",
|
|
168
|
+
"postcss": "^8.5.25",
|
|
169
169
|
"postcss-load-config": "^6.0.1",
|
|
170
170
|
"tailwindcss": "^4.3.3",
|
|
171
171
|
"typescript": "7.0.2",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
+
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
5
|
+
import { RequireWorkspaceTimezoneDialog } from './require-workspace-timezone-dialog';
|
|
6
|
+
|
|
7
|
+
vi.mock('next/navigation', () => ({
|
|
8
|
+
useRouter: () => ({ refresh: vi.fn() }),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
vi.mock('next-intl', () => ({
|
|
12
|
+
useTranslations: (namespace: string) => (key: string) =>
|
|
13
|
+
`${namespace}.${key}`,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock('../../dialog', () => ({
|
|
17
|
+
Dialog: ({ children }: { children: ReactNode }) => <div>{children}</div>,
|
|
18
|
+
DialogContent: ({ children }: { children: ReactNode }) => (
|
|
19
|
+
<div>{children}</div>
|
|
20
|
+
),
|
|
21
|
+
DialogDescription: ({ children }: { children: ReactNode }) => (
|
|
22
|
+
<p>{children}</p>
|
|
23
|
+
),
|
|
24
|
+
DialogFooter: ({ children }: { children: ReactNode }) => (
|
|
25
|
+
<div>{children}</div>
|
|
26
|
+
),
|
|
27
|
+
DialogHeader: ({ children }: { children: ReactNode }) => (
|
|
28
|
+
<div>{children}</div>
|
|
29
|
+
),
|
|
30
|
+
DialogTitle: ({ children }: { children: ReactNode }) => <h2>{children}</h2>,
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
vi.mock('../../sonner', () => ({
|
|
34
|
+
toast: { error: vi.fn(), success: vi.fn() },
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
function renderDialog() {
|
|
38
|
+
const queryClient = new QueryClient({
|
|
39
|
+
defaultOptions: {
|
|
40
|
+
mutations: { retry: false },
|
|
41
|
+
queries: { retry: false },
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return render(
|
|
46
|
+
<QueryClientProvider client={queryClient}>
|
|
47
|
+
<RequireWorkspaceTimezoneDialog
|
|
48
|
+
onCompleted={vi.fn()}
|
|
49
|
+
wsId="workspace-1"
|
|
50
|
+
/>
|
|
51
|
+
</QueryClientProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
describe('RequireWorkspaceTimezoneDialog E2EE initialization', () => {
|
|
56
|
+
beforeEach(() => {
|
|
57
|
+
vi.stubGlobal(
|
|
58
|
+
'fetch',
|
|
59
|
+
vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
|
|
60
|
+
const url = String(input);
|
|
61
|
+
|
|
62
|
+
if (url.endsWith('/calendar-settings')) {
|
|
63
|
+
return Response.json({
|
|
64
|
+
first_day_of_week: 'monday',
|
|
65
|
+
timezone: 'UTC',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (url.endsWith('/encryption') && init?.method === 'POST') {
|
|
70
|
+
return Response.json({ error: 'temporary failure' }, { status: 500 });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (url.endsWith('/encryption')) {
|
|
74
|
+
return Response.json({ enabled: true, hasKey: false });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
throw new Error(`Unexpected request: ${url}`);
|
|
78
|
+
})
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
afterEach(() => {
|
|
83
|
+
vi.unstubAllGlobals();
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('attempts once automatically and waits for an explicit retry', async () => {
|
|
87
|
+
const view = renderDialog();
|
|
88
|
+
|
|
89
|
+
await screen.findByRole('button', { name: 'common.retry' });
|
|
90
|
+
|
|
91
|
+
const postCount = () =>
|
|
92
|
+
vi.mocked(fetch).mock.calls.filter(([, init]) => init?.method === 'POST')
|
|
93
|
+
.length;
|
|
94
|
+
|
|
95
|
+
expect(postCount()).toBe(1);
|
|
96
|
+
|
|
97
|
+
view.rerender(
|
|
98
|
+
<QueryClientProvider
|
|
99
|
+
client={
|
|
100
|
+
new QueryClient({
|
|
101
|
+
defaultOptions: {
|
|
102
|
+
mutations: { retry: false },
|
|
103
|
+
queries: { retry: false },
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
<RequireWorkspaceTimezoneDialog
|
|
109
|
+
onCompleted={vi.fn()}
|
|
110
|
+
wsId="workspace-1"
|
|
111
|
+
/>
|
|
112
|
+
</QueryClientProvider>
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
await waitFor(() => expect(postCount()).toBe(1));
|
|
116
|
+
|
|
117
|
+
fireEvent.click(screen.getByRole('button', { name: 'common.retry' }));
|
|
118
|
+
|
|
119
|
+
await waitFor(() => expect(postCount()).toBe(2));
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -4,7 +4,7 @@ import { useMutation, useQuery } from '@tanstack/react-query';
|
|
|
4
4
|
import { Clock, Loader2, ShieldCheck } from '@tuturuuu/icons';
|
|
5
5
|
import { useRouter } from 'next/navigation';
|
|
6
6
|
import { useTranslations } from 'next-intl';
|
|
7
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import { detectLocaleFirstDay } from '../../../../lib/calendar-settings-resolver';
|
|
9
9
|
import { Button } from '../../button';
|
|
10
10
|
import {
|
|
@@ -55,7 +55,9 @@ export function RequireWorkspaceTimezoneDialog({
|
|
|
55
55
|
onCompleted,
|
|
56
56
|
}: RequireWorkspaceTimezoneDialogProps) {
|
|
57
57
|
const t = useTranslations('calendar');
|
|
58
|
+
const tCommon = useTranslations('common');
|
|
58
59
|
const router = useRouter();
|
|
60
|
+
const autoEnableAttemptedWorkspace = useRef<string | null>(null);
|
|
59
61
|
|
|
60
62
|
const browserTimezone = useMemo(() => detectBrowserTimezone(), []);
|
|
61
63
|
const timezones = useMemo(() => getSupportedTimezones(), []);
|
|
@@ -216,11 +218,28 @@ export function RequireWorkspaceTimezoneDialog({
|
|
|
216
218
|
// This happens automatically since E2EE is mandatory for calendar to work
|
|
217
219
|
const isEnablingE2EE = enableE2EE.isPending;
|
|
218
220
|
const isFetchingE2EE = e2eeQuery.isFetching;
|
|
221
|
+
const enableE2EEMutate = enableE2EE.mutate;
|
|
219
222
|
useEffect(() => {
|
|
220
|
-
if (
|
|
221
|
-
|
|
223
|
+
if (
|
|
224
|
+
!needsE2EESetup ||
|
|
225
|
+
isEnablingE2EE ||
|
|
226
|
+
isFetchingE2EE ||
|
|
227
|
+
hasE2EE ||
|
|
228
|
+
autoEnableAttemptedWorkspace.current === wsId
|
|
229
|
+
) {
|
|
230
|
+
return;
|
|
222
231
|
}
|
|
223
|
-
|
|
232
|
+
|
|
233
|
+
autoEnableAttemptedWorkspace.current = wsId;
|
|
234
|
+
enableE2EEMutate();
|
|
235
|
+
}, [
|
|
236
|
+
needsE2EESetup,
|
|
237
|
+
isEnablingE2EE,
|
|
238
|
+
isFetchingE2EE,
|
|
239
|
+
hasE2EE,
|
|
240
|
+
wsId,
|
|
241
|
+
enableE2EEMutate,
|
|
242
|
+
]);
|
|
224
243
|
|
|
225
244
|
// Keep local selects in sync with server values once fetched.
|
|
226
245
|
useEffect(() => {
|
|
@@ -375,6 +394,20 @@ export function RequireWorkspaceTimezoneDialog({
|
|
|
375
394
|
{t('e2ee.already_enabled')}
|
|
376
395
|
</span>
|
|
377
396
|
</div>
|
|
397
|
+
) : enableE2EE.isError ? (
|
|
398
|
+
<div className="flex items-center justify-between gap-3 rounded-lg border border-dynamic-red/50 bg-dynamic-red/10 p-3">
|
|
399
|
+
<span className="font-medium text-dynamic-red text-sm">
|
|
400
|
+
{t('e2ee.key_generation_failed')}
|
|
401
|
+
</span>
|
|
402
|
+
<Button
|
|
403
|
+
onClick={() => enableE2EEMutate()}
|
|
404
|
+
size="sm"
|
|
405
|
+
type="button"
|
|
406
|
+
variant="outline"
|
|
407
|
+
>
|
|
408
|
+
{tCommon('retry')}
|
|
409
|
+
</Button>
|
|
410
|
+
</div>
|
|
378
411
|
) : (
|
|
379
412
|
<div className="flex items-center gap-2 rounded-lg border border-dynamic-blue/50 bg-dynamic-blue/10 p-3">
|
|
380
413
|
<Loader2 className="h-4 w-4 animate-spin text-dynamic-blue" />
|
|
@@ -8,7 +8,12 @@ import { Component, type ErrorInfo, type ReactNode } from 'react';
|
|
|
8
8
|
import { Streamdown } from 'streamdown';
|
|
9
9
|
|
|
10
10
|
const math = createMathPlugin({ singleDollarTextMath: true });
|
|
11
|
-
const markdownPlugins = {
|
|
11
|
+
const markdownPlugins = {
|
|
12
|
+
code,
|
|
13
|
+
mermaid: mermaidPlugin,
|
|
14
|
+
math,
|
|
15
|
+
cjk,
|
|
16
|
+
};
|
|
12
17
|
|
|
13
18
|
class AiMarkdownErrorBoundary extends Component<
|
|
14
19
|
{ children: ReactNode; fallback: ReactNode },
|
|
@@ -115,4 +115,37 @@ describe('chat sidebar conversation sections', () => {
|
|
|
115
115
|
],
|
|
116
116
|
});
|
|
117
117
|
});
|
|
118
|
+
|
|
119
|
+
it('groups connected-site conversations without exposing connector identity', () => {
|
|
120
|
+
const sections = getChatConversationSections({
|
|
121
|
+
conversations: [
|
|
122
|
+
conversation('channel', 'site-thread-1', { externalChat: true }),
|
|
123
|
+
conversation('channel', 'site-thread-2', { externalChat: true }),
|
|
124
|
+
],
|
|
125
|
+
labels: {
|
|
126
|
+
ai: 'AI agents',
|
|
127
|
+
channel: 'Channels',
|
|
128
|
+
direct: 'Direct messages',
|
|
129
|
+
group: 'Groups',
|
|
130
|
+
},
|
|
131
|
+
scope: 'external',
|
|
132
|
+
sourceLabels: {
|
|
133
|
+
external: 'Connected sites',
|
|
134
|
+
zaloPersonal: 'Zalo Personal',
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
expect(sections).toMatchObject([
|
|
139
|
+
{
|
|
140
|
+
conversations: [],
|
|
141
|
+
sourceGroups: [
|
|
142
|
+
{
|
|
143
|
+
conversations: [{ id: 'site-thread-1' }, { id: 'site-thread-2' }],
|
|
144
|
+
id: 'external:connected-sites',
|
|
145
|
+
label: 'Connected sites',
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
]);
|
|
150
|
+
});
|
|
118
151
|
});
|
|
@@ -6,7 +6,11 @@ import { cn } from '@tuturuuu/utils/format';
|
|
|
6
6
|
import { useTranslations } from 'next-intl';
|
|
7
7
|
import { Button } from '../button';
|
|
8
8
|
import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getChatMessageSenderLabel,
|
|
11
|
+
getConversationTitle,
|
|
12
|
+
isChatConversationPinned,
|
|
13
|
+
} from './utils';
|
|
10
14
|
|
|
11
15
|
export function ConversationRow({
|
|
12
16
|
conversation,
|
|
@@ -88,7 +92,11 @@ export function SearchResultList({
|
|
|
88
92
|
type="button"
|
|
89
93
|
>
|
|
90
94
|
<span className="block truncate font-medium text-sm">
|
|
91
|
-
{message
|
|
95
|
+
{getChatMessageSenderLabel(message, {
|
|
96
|
+
assistant: t('assistant_name'),
|
|
97
|
+
external: t('external_sender'),
|
|
98
|
+
unknown: t('unknown_sender'),
|
|
99
|
+
})}
|
|
92
100
|
</span>
|
|
93
101
|
<span className="mt-1 line-clamp-2 text-muted-foreground text-xs">
|
|
94
102
|
{message.content}
|
|
@@ -8,6 +8,7 @@ const mocks = vi.hoisted(() => ({
|
|
|
8
8
|
createDialogProps: null as Record<string, unknown> | null,
|
|
9
9
|
fetchNextPage: vi.fn(),
|
|
10
10
|
routerReplace: vi.fn(),
|
|
11
|
+
searchParams: 'scope=personal',
|
|
11
12
|
useChatMessageSearch: vi.fn(),
|
|
12
13
|
useInfiniteChatConversations: vi.fn(),
|
|
13
14
|
}));
|
|
@@ -21,7 +22,7 @@ vi.mock('next/navigation', () => ({
|
|
|
21
22
|
useRouter: () => ({
|
|
22
23
|
replace: mocks.routerReplace,
|
|
23
24
|
}),
|
|
24
|
-
useSearchParams: () => new URLSearchParams(
|
|
25
|
+
useSearchParams: () => new URLSearchParams(mocks.searchParams),
|
|
25
26
|
}));
|
|
26
27
|
|
|
27
28
|
vi.mock('./chat-sidebar', () => ({
|
|
@@ -80,6 +81,7 @@ describe('ChatSidebarPanel', () => {
|
|
|
80
81
|
vi.clearAllMocks();
|
|
81
82
|
mocks.chatSidebarProps = null;
|
|
82
83
|
mocks.createDialogProps = null;
|
|
84
|
+
mocks.searchParams = 'scope=personal';
|
|
83
85
|
window.localStorage.clear();
|
|
84
86
|
mocks.useChatMessageSearch.mockReturnValue({ data: [] });
|
|
85
87
|
mocks.useInfiniteChatConversations.mockReturnValue({
|
|
@@ -104,6 +106,7 @@ describe('ChatSidebarPanel', () => {
|
|
|
104
106
|
|
|
105
107
|
expect(mocks.useInfiniteChatConversations).toHaveBeenCalledWith({
|
|
106
108
|
archived: 'active',
|
|
109
|
+
scope: undefined,
|
|
107
110
|
wsId: 'personal',
|
|
108
111
|
});
|
|
109
112
|
expect(mocks.chatSidebarProps).toMatchObject({
|
|
@@ -120,6 +123,31 @@ describe('ChatSidebarPanel', () => {
|
|
|
120
123
|
expect(mocks.fetchNextPage).toHaveBeenCalledTimes(1);
|
|
121
124
|
});
|
|
122
125
|
|
|
126
|
+
it('requests server-scoped pages for the external inbox', () => {
|
|
127
|
+
mocks.searchParams = 'scope=external';
|
|
128
|
+
mocks.useInfiniteChatConversations.mockReturnValue({
|
|
129
|
+
data: { pages: [{ conversations: [], nextOffset: null }] },
|
|
130
|
+
fetchNextPage: mocks.fetchNextPage,
|
|
131
|
+
hasNextPage: false,
|
|
132
|
+
isFetchingNextPage: false,
|
|
133
|
+
isLoading: false,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
render(
|
|
137
|
+
<ChatSidebarPanel
|
|
138
|
+
currentUserId="user-1"
|
|
139
|
+
isCollapsed={false}
|
|
140
|
+
wsId="personal"
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
expect(mocks.useInfiniteChatConversations).toHaveBeenCalledWith({
|
|
145
|
+
archived: 'active',
|
|
146
|
+
scope: 'external',
|
|
147
|
+
wsId: 'personal',
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
123
151
|
it('updates Next router state when auto-selecting the first conversation', async () => {
|
|
124
152
|
render(
|
|
125
153
|
<ChatSidebarPanel
|
|
@@ -71,17 +71,18 @@ export function ChatSidebarPanel({
|
|
|
71
71
|
const setCreateOpen = onCreateOpenChange ?? setInternalCreateOpen;
|
|
72
72
|
const archiveFilter = controlledArchiveFilter ?? internalArchiveFilter;
|
|
73
73
|
const selectedTypes = controlledSelectedTypes ?? internalSelectedTypes;
|
|
74
|
+
const conversationScope = normalizeChatConversationScope(
|
|
75
|
+
searchParams.get('scope') ?? defaultConversationScope
|
|
76
|
+
);
|
|
74
77
|
const conversationsQuery = useInfiniteChatConversations({
|
|
75
78
|
archived: archiveFilter,
|
|
79
|
+
scope: conversationScope === 'external' ? 'external' : undefined,
|
|
76
80
|
wsId,
|
|
77
81
|
});
|
|
78
82
|
const searchQuery = useChatMessageSearch({
|
|
79
83
|
query: searchValue,
|
|
80
84
|
wsId,
|
|
81
85
|
});
|
|
82
|
-
const conversationScope = normalizeChatConversationScope(
|
|
83
|
-
searchParams.get('scope') ?? defaultConversationScope
|
|
84
|
-
);
|
|
85
86
|
const conversations = flattenChatConversationPages(conversationsQuery.data);
|
|
86
87
|
const scopeConversations = filterChatConversationsByScope(
|
|
87
88
|
conversations,
|