@vezham/react 26.0.3 → 26.3.1

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 (143) hide show
  1. package/dist/index.css +2 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -1
  5. package/dist/lib/components/command/command-dialog.js +1 -1
  6. package/dist/lib/components/command/command-provider.js +1 -1
  7. package/dist/lib/components/command/index.d.ts +0 -1
  8. package/dist/lib/components/command/index.d.ts.map +1 -1
  9. package/dist/lib/components/panel/footer/control-center/control-center.js +1 -1
  10. package/dist/lib/components/panel/footer/control-center/editor.d.ts.map +1 -1
  11. package/dist/lib/components/panel/footer/control-center/editor.js +19 -24
  12. package/dist/lib/components/panel/footer/control-center/theme.d.ts.map +1 -1
  13. package/dist/lib/components/panel/footer/control-center/theme.js +2 -15
  14. package/dist/lib/components/panel/footer/control-center/variant.d.ts +3 -3
  15. package/dist/lib/components/panel/footer/control-center/variant.js +1 -1
  16. package/dist/lib/components/panel/footer/data.d.ts +1 -1
  17. package/dist/lib/components/panel/footer/data.js +1 -1
  18. package/dist/lib/components/panel/footer/index.d.ts +1 -1
  19. package/dist/lib/components/panel/footer/index.d.ts.map +1 -1
  20. package/dist/lib/components/panel/footer/index.js +11 -9
  21. package/dist/lib/components/panel/footer/notification-center/index.js +1 -1
  22. package/dist/lib/components/panel/footer/tamizhi/index.d.ts +3 -0
  23. package/dist/lib/components/panel/footer/tamizhi/index.d.ts.map +1 -0
  24. package/dist/lib/components/panel/footer/tamizhi/index.js +20 -0
  25. package/dist/lib/components/panel/footer/types.d.ts +2 -3
  26. package/dist/lib/components/panel/footer/types.d.ts.map +1 -1
  27. package/dist/lib/components/panel/footer/user-menu.d.ts +2 -2
  28. package/dist/lib/components/panel/footer/user-menu.d.ts.map +1 -1
  29. package/dist/lib/components/panel/footer/user-menu.js +127 -59
  30. package/dist/lib/components/panel/header/bookmarks/favorites/variant.js +2 -2
  31. package/dist/lib/components/panel/header/bookmarks/folder-modal/index.js +6 -6
  32. package/dist/lib/components/panel/header/bookmarks/index.js +1 -1
  33. package/dist/lib/components/panel/header/bookmarks/quick-access/index.js +9 -9
  34. package/dist/lib/components/panel/header/bookmarks/variant.js +22 -22
  35. package/dist/lib/components/panel/header/index.js +3 -3
  36. package/dist/lib/components/panel/info-panel/provider.d.ts.map +1 -1
  37. package/dist/lib/components/panel/info-panel/provider.js +20 -34
  38. package/dist/lib/components/panel/info-panel/types.d.ts +1 -1
  39. package/dist/lib/components/panel/info-panel/types.d.ts.map +1 -1
  40. package/dist/lib/components/panel/menu/index.js +4 -4
  41. package/dist/lib/components/panel/menu/variant.js +4 -4
  42. package/dist/lib/components/workspace-navigation/index.d.ts.map +1 -1
  43. package/dist/lib/components/workspace-navigation/index.js +1 -1
  44. package/dist/lib/layouts/app/frame.d.ts +2 -1
  45. package/dist/lib/layouts/app/frame.d.ts.map +1 -1
  46. package/dist/lib/layouts/app/frame.js +2 -2
  47. package/dist/lib/layouts/app/index.d.ts +7 -4
  48. package/dist/lib/layouts/app/index.d.ts.map +1 -1
  49. package/dist/lib/layouts/app/index.js +37 -6
  50. package/dist/lib/layouts/menu-layout/home-navigation-bubble.js +3 -3
  51. package/dist/lib/layouts/menu-layout/index-md.d.ts.map +1 -1
  52. package/dist/lib/layouts/menu-layout/index-md.js +19 -28
  53. package/dist/lib/layouts/menu-layout/index-sm.d.ts.map +1 -1
  54. package/dist/lib/layouts/menu-layout/index-sm.js +8 -20
  55. package/dist/lib/layouts/section/toolbar.js +1 -1
  56. package/dist/lib/pages/settings/settings-content.d.ts.map +1 -1
  57. package/dist/lib/pages/settings/settings-content.js +14 -26
  58. package/dist/lib/workspace/action-dialog.d.ts +9 -0
  59. package/dist/lib/workspace/action-dialog.d.ts.map +1 -0
  60. package/dist/lib/workspace/action-dialog.js +86 -0
  61. package/dist/lib/workspace/actions-menu.d.ts +8 -0
  62. package/dist/lib/workspace/actions-menu.d.ts.map +1 -0
  63. package/dist/lib/workspace/actions-menu.js +47 -0
  64. package/dist/lib/workspace/create-dialog.d.ts +5 -0
  65. package/dist/lib/workspace/create-dialog.d.ts.map +1 -0
  66. package/dist/lib/workspace/create-dialog.js +108 -0
  67. package/dist/lib/workspace/index.d.ts +34 -0
  68. package/dist/lib/workspace/index.d.ts.map +1 -0
  69. package/dist/lib/workspace/index.js +128 -0
  70. package/dist/lib/workspace/menu.d.ts +18 -0
  71. package/dist/lib/workspace/menu.d.ts.map +1 -0
  72. package/dist/lib/workspace/menu.js +148 -0
  73. package/dist/lib/workspace/model.d.ts +17 -0
  74. package/dist/lib/workspace/model.d.ts.map +1 -0
  75. package/dist/lib/workspace/model.js +35 -0
  76. package/package.json +3 -2
  77. package/dist/lib/components/command/index.js +0 -3
  78. package/dist/lib/components/panel/footer/ai/chat-header.d.ts +0 -9
  79. package/dist/lib/components/panel/footer/ai/chat-header.d.ts.map +0 -1
  80. package/dist/lib/components/panel/footer/ai/chat-header.js +0 -63
  81. package/dist/lib/components/panel/footer/ai/composer.d.ts +0 -7
  82. package/dist/lib/components/panel/footer/ai/composer.d.ts.map +0 -1
  83. package/dist/lib/components/panel/footer/ai/composer.js +0 -77
  84. package/dist/lib/components/panel/footer/ai/content.d.ts +0 -13
  85. package/dist/lib/components/panel/footer/ai/content.d.ts.map +0 -1
  86. package/dist/lib/components/panel/footer/ai/content.js +0 -148
  87. package/dist/lib/components/panel/footer/ai/conversation.d.ts +0 -47
  88. package/dist/lib/components/panel/footer/ai/conversation.d.ts.map +0 -1
  89. package/dist/lib/components/panel/footer/ai/conversation.js +0 -222
  90. package/dist/lib/components/panel/footer/ai/index.d.ts +0 -3
  91. package/dist/lib/components/panel/footer/ai/index.d.ts.map +0 -1
  92. package/dist/lib/components/panel/footer/ai/index.js +0 -41
  93. package/dist/lib/components/panel/footer/ai/message-actions.d.ts +0 -8
  94. package/dist/lib/components/panel/footer/ai/message-actions.d.ts.map +0 -1
  95. package/dist/lib/components/panel/footer/ai/message-actions.js +0 -63
  96. package/dist/lib/components/panel/footer/ai/mock-result.d.ts +0 -6
  97. package/dist/lib/components/panel/footer/ai/mock-result.d.ts.map +0 -1
  98. package/dist/lib/components/panel/footer/ai/mock-result.js +0 -121
  99. package/dist/lib/components/panel/footer/ai/model-logo.d.ts +0 -5
  100. package/dist/lib/components/panel/footer/ai/model-logo.d.ts.map +0 -1
  101. package/dist/lib/components/panel/footer/ai/model-logo.js +0 -13
  102. package/dist/lib/components/panel/footer/ai/model-logos.d.ts +0 -2
  103. package/dist/lib/components/panel/footer/ai/model-logos.d.ts.map +0 -1
  104. package/dist/lib/components/panel/footer/ai/model-logos.js +0 -10
  105. package/dist/lib/components/panel/footer/ai/model-picker.d.ts +0 -8
  106. package/dist/lib/components/panel/footer/ai/model-picker.d.ts.map +0 -1
  107. package/dist/lib/components/panel/footer/ai/model-picker.js +0 -166
  108. package/dist/lib/components/panel/footer/ai/models.d.ts +0 -9
  109. package/dist/lib/components/panel/footer/ai/models.d.ts.map +0 -1
  110. package/dist/lib/components/panel/footer/ai/models.js +0 -72
  111. package/dist/lib/components/panel/footer/ai/permission-picker.d.ts +0 -5
  112. package/dist/lib/components/panel/footer/ai/permission-picker.d.ts.map +0 -1
  113. package/dist/lib/components/panel/footer/ai/permission-picker.js +0 -63
  114. package/dist/lib/components/panel/footer/ai/use-chat-scroll.d.ts +0 -9
  115. package/dist/lib/components/panel/footer/ai/use-chat-scroll.d.ts.map +0 -1
  116. package/dist/lib/components/panel/footer/ai/use-chat-scroll.js +0 -57
  117. package/dist/lib/components/panel/footer/preferences/data.d.ts +0 -14
  118. package/dist/lib/components/panel/footer/preferences/data.d.ts.map +0 -1
  119. package/dist/lib/components/panel/footer/preferences/data.js +0 -304
  120. package/dist/lib/components/panel/footer/preferences/modal.d.ts +0 -8
  121. package/dist/lib/components/panel/footer/preferences/modal.d.ts.map +0 -1
  122. package/dist/lib/components/panel/footer/preferences/modal.js +0 -75
  123. package/dist/lib/components/panel/footer/preferences/sidebar.d.ts +0 -9
  124. package/dist/lib/components/panel/footer/preferences/sidebar.d.ts.map +0 -1
  125. package/dist/lib/components/panel/footer/preferences/sidebar.js +0 -105
  126. package/dist/lib/components/panel/footer/preferences/user-settings/account/index.d.ts +0 -3
  127. package/dist/lib/components/panel/footer/preferences/user-settings/account/index.d.ts.map +0 -1
  128. package/dist/lib/components/panel/footer/preferences/user-settings/account/index.js +0 -16
  129. package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.d.ts +0 -3
  130. package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.d.ts.map +0 -1
  131. package/dist/lib/components/panel/footer/preferences/user-settings/content-social/index.js +0 -16
  132. package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.d.ts +0 -3
  133. package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.d.ts.map +0 -1
  134. package/dist/lib/components/panel/footer/preferences/user-settings/data-privacy/index.js +0 -101
  135. package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.d.ts +0 -3
  136. package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.d.ts.map +0 -1
  137. package/dist/lib/components/panel/footer/preferences/user-settings/family-center/index.js +0 -24
  138. package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.d.ts +0 -3
  139. package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.d.ts.map +0 -1
  140. package/dist/lib/components/panel/footer/preferences/user-settings/profiles/index.js +0 -103
  141. package/dist/lib/components/panel/footer/tabs.d.ts +0 -12
  142. package/dist/lib/components/panel/footer/tabs.d.ts.map +0 -1
  143. package/dist/lib/components/panel/footer/tabs.js +0 -23
@@ -0,0 +1,148 @@
1
+ import { WorkspaceActionsMenu } from "./actions-menu.js";
2
+ import { Button, Dropdown, Header, Label } from "@vezham/react-v3";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Add, AltArrowLeft, AltArrowRight, CheckRead, Laptop } from "@vezham/icons-react";
5
+ //#region src/lib/workspace/menu.tsx
6
+ var renderWorkspaceItems = ({ workspace, select, create, onAction }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Dropdown.Section, { children: [/* @__PURE__ */ jsx(Header, { children: "Local storage" }), workspace.workspaces.map((item) => /* @__PURE__ */ jsxs(Dropdown.Item, {
7
+ id: `workspace:${item.id}`,
8
+ isDisabled: !workspace.isReady || Boolean(workspace.error),
9
+ "aria-label": item.name,
10
+ "aria-current": item.id === workspace.active.id ? true : void 0,
11
+ textValue: item.name,
12
+ onAction: () => select(item.id),
13
+ children: [
14
+ /* @__PURE__ */ jsx(Laptop, {
15
+ size: 18,
16
+ "aria-hidden": "true"
17
+ }),
18
+ /* @__PURE__ */ jsx(Label, {
19
+ className: "min-w-0 flex-1 truncate",
20
+ children: item.name
21
+ }),
22
+ /* @__PURE__ */ jsx(WorkspaceActionsMenu, {
23
+ workspace: item,
24
+ canDelete: workspace.workspaces.length > 1,
25
+ onAction
26
+ }),
27
+ item.id === workspace.active.id && /* @__PURE__ */ jsx(CheckRead, {
28
+ size: 18,
29
+ "aria-hidden": "true"
30
+ })
31
+ ]
32
+ }, item.id))] }), /* @__PURE__ */ jsxs(Dropdown.Item, {
33
+ id: "create-workspace",
34
+ isDisabled: !workspace.isReady || Boolean(workspace.error),
35
+ textValue: "Create workspace",
36
+ onAction: create,
37
+ children: [/* @__PURE__ */ jsx(Add, {
38
+ size: 18,
39
+ "aria-hidden": "true"
40
+ }), /* @__PURE__ */ jsx(Label, { children: "Create workspace" })]
41
+ })] });
42
+ var renderWorkspaceMenuSection = (props) => /* @__PURE__ */ jsxs(Dropdown.SubmenuTrigger, { children: [/* @__PURE__ */ jsxs(Dropdown.Item, {
43
+ id: "workspaces",
44
+ isDisabled: !props.workspace.isReady || Boolean(props.workspace.error),
45
+ "aria-label": "Choose workspace",
46
+ textValue: props.workspace.active.name,
47
+ children: [
48
+ /* @__PURE__ */ jsx(Laptop, {
49
+ size: 18,
50
+ "aria-hidden": "true"
51
+ }),
52
+ /* @__PURE__ */ jsx(Label, {
53
+ className: "min-w-0 flex-1 truncate",
54
+ children: props.workspace.active.name
55
+ }),
56
+ /* @__PURE__ */ jsx(Dropdown.SubmenuIndicator, {})
57
+ ]
58
+ }), /* @__PURE__ */ jsx(Dropdown.Popover, {
59
+ className: "z-90 w-72 max-w-[calc(100vw-2rem)]",
60
+ children: /* @__PURE__ */ jsx(Dropdown.Menu, {
61
+ "aria-label": "Workspaces",
62
+ className: "max-h-80 overflow-y-auto",
63
+ children: renderWorkspaceItems(props)
64
+ })
65
+ })] });
66
+ var WorkspaceSheetTrigger = ({ name, onPress }) => /* @__PURE__ */ jsxs(Button, {
67
+ variant: "ghost",
68
+ "aria-label": "Choose workspace",
69
+ className: "h-auto min-h-11 w-full justify-start gap-3 px-3 py-2 text-start",
70
+ onPress,
71
+ children: [
72
+ /* @__PURE__ */ jsx(Laptop, {
73
+ size: 18,
74
+ "aria-hidden": "true"
75
+ }),
76
+ /* @__PURE__ */ jsx("span", {
77
+ className: "min-w-0 flex-1 truncate text-start",
78
+ children: name
79
+ }),
80
+ /* @__PURE__ */ jsx(AltArrowRight, {
81
+ size: 16,
82
+ "aria-hidden": "true"
83
+ })
84
+ ]
85
+ });
86
+ var WorkspaceSheetItems = ({ workspace, select, create, onAction, onBack }) => /* @__PURE__ */ jsxs("div", {
87
+ className: "w-full",
88
+ children: [
89
+ /* @__PURE__ */ jsxs(Button, {
90
+ variant: "ghost",
91
+ className: "mb-3 w-full justify-start gap-3",
92
+ "aria-label": "Back to account menu",
93
+ onPress: onBack,
94
+ children: [/* @__PURE__ */ jsx(AltArrowLeft, {
95
+ size: 18,
96
+ "aria-hidden": "true"
97
+ }), "Workspaces"]
98
+ }),
99
+ /* @__PURE__ */ jsx("p", {
100
+ className: "text-muted px-3 pb-2 text-xs",
101
+ children: "Local storage"
102
+ }),
103
+ /* @__PURE__ */ jsxs("div", {
104
+ className: "flex flex-col gap-1",
105
+ children: [workspace.workspaces.map((item) => /* @__PURE__ */ jsxs("div", {
106
+ className: "flex items-center gap-1",
107
+ children: [/* @__PURE__ */ jsxs(Button, {
108
+ variant: item.id === workspace.active.id ? "secondary" : "ghost",
109
+ className: "h-auto min-h-11 w-full justify-start gap-3 whitespace-normal",
110
+ isDisabled: !workspace.isReady || Boolean(workspace.error),
111
+ "aria-pressed": item.id === workspace.active.id,
112
+ onPress: () => select(item.id),
113
+ children: [
114
+ /* @__PURE__ */ jsx(Laptop, {
115
+ size: 18,
116
+ className: "shrink-0",
117
+ "aria-hidden": "true"
118
+ }),
119
+ /* @__PURE__ */ jsx("span", {
120
+ className: "min-w-0 flex-1 text-start wrap-anywhere",
121
+ children: item.name
122
+ }),
123
+ item.id === workspace.active.id && /* @__PURE__ */ jsx(CheckRead, {
124
+ size: 18,
125
+ className: "shrink-0",
126
+ "aria-hidden": "true"
127
+ })
128
+ ]
129
+ }), /* @__PURE__ */ jsx(WorkspaceActionsMenu, {
130
+ workspace: item,
131
+ canDelete: workspace.workspaces.length > 1,
132
+ onAction
133
+ })]
134
+ }, item.id)), /* @__PURE__ */ jsxs(Button, {
135
+ variant: "ghost",
136
+ className: "mt-2 w-full justify-start gap-3",
137
+ isDisabled: !workspace.isReady || Boolean(workspace.error),
138
+ onPress: create,
139
+ children: [/* @__PURE__ */ jsx(Add, {
140
+ size: 18,
141
+ "aria-hidden": "true"
142
+ }), "Create workspace"]
143
+ })]
144
+ })
145
+ ]
146
+ });
147
+ //#endregion
148
+ export { WorkspaceSheetItems, WorkspaceSheetTrigger, renderWorkspaceMenuSection };
@@ -0,0 +1,17 @@
1
+ export interface LocalWorkspace {
2
+ id: string;
3
+ name: string;
4
+ storage: 'local';
5
+ createdAt: number;
6
+ }
7
+ export interface WorkspaceCatalog {
8
+ workspaces: LocalWorkspace[];
9
+ }
10
+ export declare const workspaceSelectionKey: (appId: string) => string;
11
+ export declare const workspaceCatalogKey: (appId: string) => string;
12
+ export declare const workspaceDataKey: (appId: string, workspaceId: string, key: string) => string;
13
+ export declare const normalizeWorkspaceName: (name: string) => string;
14
+ export declare const createInitialWorkspaceCatalog: (name: string) => WorkspaceCatalog;
15
+ export declare const parseWorkspaceCatalog: (input: unknown) => WorkspaceCatalog;
16
+ export declare const createLocalWorkspace: (name: string) => LocalWorkspace;
17
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/lib/workspace/model.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,cAAc,EAAE,CAAA;CAC7B;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,WACM,CAAA;AAEzD,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,WACC,CAAA;AAElD,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EACb,aAAa,MAAM,EACnB,KAAK,MAAM,WAEkG,CAAA;AAE/G,eAAO,MAAM,sBAAsB,GAAI,MAAM,MAAM,WAKlD,CAAA;AAED,eAAO,MAAM,6BAA6B,GACxC,MAAM,MAAM,KACX,gBASD,CAAA;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,gBA2BtD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,KAAG,cAUnD,CAAA"}
@@ -0,0 +1,35 @@
1
+ //#region src/lib/workspace/model.ts
2
+ var workspaceSelectionKey = (appId) => `vezham:${encodeURIComponent(appId)}:current-workspace`;
3
+ var workspaceCatalogKey = (appId) => `vezham:${encodeURIComponent(appId)}:workspaces`;
4
+ var workspaceDataKey = (appId, workspaceId, key) => `vezham:${encodeURIComponent(appId)}:workspace:${encodeURIComponent(workspaceId)}:${encodeURIComponent(key)}`;
5
+ var normalizeWorkspaceName = (name) => {
6
+ const trimmed = name.trim();
7
+ if (!trimmed || trimmed.length > 64) throw new Error("Use a workspace name between 1 and 64 characters.");
8
+ return trimmed;
9
+ };
10
+ var createInitialWorkspaceCatalog = (name) => ({ workspaces: [{
11
+ id: "default",
12
+ name: normalizeWorkspaceName(name),
13
+ storage: "local",
14
+ createdAt: 0
15
+ }] });
16
+ var parseWorkspaceCatalog = (input) => {
17
+ if (!input || typeof input !== "object") throw new Error("Invalid workspace catalog");
18
+ const value = input;
19
+ if (!Array.isArray(value.workspaces) || value.workspaces.length === 0) throw new Error("Invalid workspace catalog");
20
+ if (!value.workspaces.every((item) => item && typeof item.id === "string" && item.id.length > 0 && item.id.length <= 128 && typeof item.name === "string" && item.name.trim().length > 0 && item.name.length <= 64 && item.storage === "local" && typeof item.createdAt === "number" && Number.isFinite(item.createdAt) && item.createdAt >= 0) || new Set(value.workspaces.map((item) => item.id)).size !== value.workspaces.length) throw new Error("Invalid workspace catalog");
21
+ return { workspaces: value.workspaces };
22
+ };
23
+ var createLocalWorkspace = (name) => {
24
+ const trimmed = normalizeWorkspaceName(name);
25
+ const bytes = /* @__PURE__ */ new Uint32Array(4);
26
+ globalThis.crypto.getRandomValues(bytes);
27
+ return {
28
+ id: `local-${Array.from(bytes, (part) => part.toString(16).padStart(8, "0")).join("")}`,
29
+ name: trimmed,
30
+ storage: "local",
31
+ createdAt: Date.now()
32
+ };
33
+ };
34
+ //#endregion
35
+ export { createInitialWorkspaceCatalog, createLocalWorkspace, normalizeWorkspaceName, parseWorkspaceCatalog, workspaceCatalogKey, workspaceDataKey, workspaceSelectionKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vezham/react",
3
- "version": "26.0.3",
3
+ "version": "26.3.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vezham/vx-fe-pkgs.git",
@@ -109,7 +109,8 @@
109
109
  ],
110
110
  "dependencies": {
111
111
  "@tanstack/react-hotkeys": "^0.10.0",
112
- "@vezham/hooks": "26.0.3",
112
+ "@vezham/hooks": "26.3.1",
113
+ "@vezham/tamizhi-ui": "26.3.1",
113
114
  "react-aria-components": "1.21.1"
114
115
  }
115
116
  }
@@ -1,3 +0,0 @@
1
- import { CommandProvider } from "./command-provider.js";
2
- import { useCommand } from "@vezham/hooks";
3
- export { CommandProvider, useCommand };
@@ -1,9 +0,0 @@
1
- import type { Conversation } from './conversation';
2
- type Props = {
3
- conversation: Conversation;
4
- expanded?: boolean;
5
- onExpand?: () => void;
6
- };
7
- export declare const ChatHeader: ({ conversation, expanded, onExpand }: Props) => import("react").JSX.Element;
8
- export {};
9
- //# sourceMappingURL=chat-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat-header.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/footer/ai/chat-header.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,KAAK,KAAK,GAAG;IACX,YAAY,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AACD,eAAO,MAAM,UAAU,GAAI,sCAAsC,KAAK,gCAmDrE,CAAA"}
@@ -1,63 +0,0 @@
1
- import { Button, Dropdown } from "@vezham/react-v3";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { AddCircle, AltArrowDown, Maximize, Minimize } from "@vezham/icons-react";
4
- //#region src/lib/components/panel/footer/ai/chat-header.tsx
5
- var ChatHeader = ({ conversation, expanded, onExpand }) => /* @__PURE__ */ jsxs("nav", {
6
- "aria-label": "Chat navigation",
7
- className: "flex min-w-0 shrink-0 items-center gap-1",
8
- children: [
9
- /* @__PURE__ */ jsxs(Dropdown, { children: [/* @__PURE__ */ jsxs(Dropdown.Trigger, {
10
- "aria-label": "Choose a chat",
11
- className: "button button--ghost button--sm flex w-auto min-w-0 shrink flex-row flex-nowrap items-center justify-start gap-2",
12
- children: [/* @__PURE__ */ jsx("span", {
13
- className: "min-w-0 truncate text-start",
14
- children: conversation.title
15
- }), /* @__PURE__ */ jsx(AltArrowDown, {
16
- className: "shrink-0",
17
- size: 14,
18
- "aria-hidden": "true"
19
- })]
20
- }), /* @__PURE__ */ jsx(Dropdown.Popover, {
21
- className: "w-72",
22
- children: /* @__PURE__ */ jsx(Dropdown.Menu, {
23
- "aria-label": "Recent chats",
24
- onAction: (key) => conversation.openChat(String(key)),
25
- children: conversation.threads.map((thread) => /* @__PURE__ */ jsx(Dropdown.Item, {
26
- id: thread.id,
27
- textValue: thread.title,
28
- children: /* @__PURE__ */ jsx("span", {
29
- className: "min-w-0 truncate",
30
- children: thread.title
31
- })
32
- }, thread.id))
33
- })
34
- })] }),
35
- /* @__PURE__ */ jsx(Button, {
36
- size: "sm",
37
- variant: "ghost",
38
- className: "shrink-0",
39
- "aria-label": "New chat",
40
- onPress: conversation.newChat,
41
- children: /* @__PURE__ */ jsx(AddCircle, {
42
- size: 18,
43
- "aria-hidden": "true"
44
- })
45
- }),
46
- onExpand && /* @__PURE__ */ jsx(Button, {
47
- size: "sm",
48
- variant: "ghost",
49
- className: "ml-auto shrink-0",
50
- "aria-label": expanded ? "Collapse assistant" : "Expand assistant",
51
- onPress: onExpand,
52
- children: expanded ? /* @__PURE__ */ jsx(Minimize, {
53
- size: 18,
54
- "aria-hidden": "true"
55
- }) : /* @__PURE__ */ jsx(Maximize, {
56
- size: 18,
57
- "aria-hidden": "true"
58
- })
59
- })
60
- ]
61
- });
62
- //#endregion
63
- export { ChatHeader };
@@ -1,7 +0,0 @@
1
- import type { Conversation } from './conversation';
2
- type Props = {
3
- conversation: Conversation;
4
- };
5
- export declare const Composer: ({ conversation: c }: Props) => import("react").JSX.Element;
6
- export {};
7
- //# sourceMappingURL=composer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/footer/ai/composer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAIlD,KAAK,KAAK,GAAG;IAAE,YAAY,EAAE,YAAY,CAAA;CAAE,CAAA;AAC3C,eAAO,MAAM,QAAQ,GAAI,qBAAqB,KAAK,gCAuFlD,CAAA"}
@@ -1,77 +0,0 @@
1
- import { FastModeToggle, ModelPicker } from "./model-picker.js";
2
- import { PermissionPicker } from "./permission-picker.js";
3
- import { useRef } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import { AddCircle, Microphone } from "@vezham/icons-react";
6
- import { ChatAttachment, PromptInput } from "@vezham/react-pro-v3";
7
- //#region src/lib/components/panel/footer/ai/composer.tsx
8
- var Composer = ({ conversation: c }) => {
9
- const fileInput = useRef(null);
10
- return /* @__PURE__ */ jsxs(PromptInput, {
11
- value: c.value,
12
- onValueChange: c.setValue,
13
- onSubmit: () => c.submit(),
14
- status: c.phase === "ready" ? "ready" : c.phase === "streaming" ? "streaming" : "submitted",
15
- onStop: c.stop,
16
- children: [
17
- /* @__PURE__ */ jsx("input", {
18
- ref: fileInput,
19
- type: "file",
20
- multiple: true,
21
- className: "hidden",
22
- "aria-label": "Attach files",
23
- accept: "image/*,.pdf,.txt,.md,.csv,.json",
24
- onChange: (event) => {
25
- c.addFiles(Array.from(event.target.files ?? []));
26
- event.target.value = "";
27
- }
28
- }),
29
- /* @__PURE__ */ jsxs(PromptInput.Shell, { children: [
30
- c.attachments.length > 0 && /* @__PURE__ */ jsx(PromptInput.Attachments, {
31
- className: "flex max-h-28 flex-wrap gap-2 overflow-y-auto",
32
- children: c.attachments.map((file) => /* @__PURE__ */ jsxs(ChatAttachment, {
33
- name: file.name,
34
- mimeType: file.mimeType,
35
- size: file.size,
36
- children: [/* @__PURE__ */ jsx(ChatAttachment.Preview, {}), /* @__PURE__ */ jsx(ChatAttachment.Remove, {
37
- "aria-label": `Remove ${file.name}`,
38
- onPress: () => c.removeAttachment(file.id)
39
- })]
40
- }, file.id))
41
- }),
42
- /* @__PURE__ */ jsx(PromptInput.Content, { children: /* @__PURE__ */ jsx(PromptInput.TextArea, {
43
- "aria-label": "Ask Tamizhi",
44
- placeholder: "Ask Tamizhi…"
45
- }) }),
46
- /* @__PURE__ */ jsxs(PromptInput.Toolbar, { children: [/* @__PURE__ */ jsxs(PromptInput.ToolbarStart, { children: [/* @__PURE__ */ jsx(PromptInput.Action, {
47
- "aria-label": "Attach files",
48
- tooltip: "Attach files",
49
- onPress: () => fileInput.current?.click(),
50
- isDisabled: c.phase !== "ready",
51
- children: /* @__PURE__ */ jsx(AddCircle, {
52
- size: 18,
53
- "aria-hidden": "true"
54
- })
55
- }), /* @__PURE__ */ jsx(PromptInput.Action, {
56
- "aria-label": "Try voice preview",
57
- tooltip: "Dictate · simulated",
58
- isDisabled: c.phase !== "ready",
59
- onPress: c.listen,
60
- children: /* @__PURE__ */ jsx(Microphone, {
61
- size: 18,
62
- "aria-hidden": "true"
63
- })
64
- })] }), /* @__PURE__ */ jsxs(PromptInput.ToolbarEnd, { children: [/* @__PURE__ */ jsx(ModelPicker, { conversation: c }), /* @__PURE__ */ jsx(PromptInput.Send, {
65
- "aria-label": c.phase === "ready" ? "Send message" : "Stop answering",
66
- isDisabled: c.phase === "ready" && !c.value.trim() && !c.attachments.length
67
- })] })] })
68
- ] }),
69
- /* @__PURE__ */ jsxs("div", {
70
- className: "mt-2 flex flex-wrap gap-1",
71
- children: [/* @__PURE__ */ jsx(FastModeToggle, { conversation: c }), /* @__PURE__ */ jsx(PermissionPicker, { conversation: c })]
72
- })
73
- ]
74
- });
75
- };
76
- //#endregion
77
- export { Composer };
@@ -1,13 +0,0 @@
1
- import type { Conversation } from './conversation';
2
- type Props = {
3
- conversation: Conversation;
4
- compact?: boolean;
5
- panel?: boolean;
6
- expanded?: boolean;
7
- onExpand?: () => void;
8
- greeting?: string;
9
- suggestions?: readonly string[];
10
- };
11
- export declare const AIContent: ({ conversation: c, compact, panel, expanded, onExpand, greeting, suggestions }: Props) => import("react").JSX.Element;
12
- export {};
13
- //# sourceMappingURL=content.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/footer/ai/content.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAKlD,KAAK,KAAK,GAAG;IACX,YAAY,EAAE,YAAY,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC,CAAA;AACD,eAAO,MAAM,SAAS,GAAI,gFAavB,KAAK,gCA6JP,CAAA"}
@@ -1,148 +0,0 @@
1
- import { ChatHeader } from "./chat-header.js";
2
- import { Composer } from "./composer.js";
3
- import { MessageActions } from "./message-actions.js";
4
- import { MockResult } from "./mock-result.js";
5
- import { useChatScroll } from "./use-chat-scroll.js";
6
- import { Button } from "@vezham/react-v3";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { AltArrowDown, VezhamTamizhi } from "@vezham/icons-react";
9
- import { ChainOfThought, ChatAttachment, ChatConversation, ChatLoader, ChatMessage, PromptSuggestion, TextShimmer } from "@vezham/react-pro-v3";
10
- //#region src/lib/components/panel/footer/ai/content.tsx
11
- var AIContent = ({ conversation: c, compact = false, panel = false, expanded, onExpand, greeting = "How can Tamizhi help?", suggestions = [
12
- "Plan my day",
13
- "Explore my workspace",
14
- "Show a workspace summary",
15
- "Set my preferences"
16
- ] }) => {
17
- const { viewportRef, contentRef, showJump, onScroll, scrollToBottom } = useChatScroll(c);
18
- return /* @__PURE__ */ jsxs("div", {
19
- className: `flex min-h-0 flex-col gap-3 ${compact ? "max-h-[calc(100dvh-10rem)] overflow-hidden" : panel ? "h-full overflow-hidden" : "h-[min(65dvh,32rem)]"}`,
20
- children: [
21
- /* @__PURE__ */ jsx(ChatHeader, {
22
- conversation: c,
23
- expanded,
24
- onExpand
25
- }),
26
- /* @__PURE__ */ jsx("p", {
27
- className: "text-muted shrink-0 px-1 text-xs",
28
- children: "Preview · Replies, files, voice and permissions are simulated."
29
- }),
30
- /* @__PURE__ */ jsxs("div", {
31
- className: `relative min-h-0 flex-1 ${compact ? "max-h-[35dvh]" : ""}`,
32
- children: [/* @__PURE__ */ jsx(ChatConversation, {
33
- ref: viewportRef,
34
- "aria-label": "Conversation with Tamizhi",
35
- initial: "instant",
36
- resize: "instant",
37
- onScroll,
38
- className: "h-full min-h-0",
39
- children: /* @__PURE__ */ jsxs(ChatConversation.Content, {
40
- ref: contentRef,
41
- className: "min-w-0 shrink-0 grow flex-col justify-end gap-4 px-1 py-2 text-sm [&>*]:shrink-0",
42
- children: [
43
- c.messages.length === 0 && /* @__PURE__ */ jsxs("div", {
44
- className: "py-4",
45
- children: [/* @__PURE__ */ jsx("h2", {
46
- className: "font-semibold",
47
- children: greeting
48
- }), /* @__PURE__ */ jsx("p", {
49
- className: "text-muted mt-2",
50
- children: "Find your way around, plan your day, or explore a sample result."
51
- })]
52
- }),
53
- c.messages.length === 0 && /* @__PURE__ */ jsx(PromptSuggestion, { children: /* @__PURE__ */ jsx(PromptSuggestion.Items, {
54
- className: "flex flex-col gap-2",
55
- children: (compact ? suggestions.slice(0, 2) : suggestions).map((prompt) => /* @__PURE__ */ jsx(PromptSuggestion.Item, {
56
- isDisabled: c.phase !== "ready",
57
- onPress: () => c.submit(prompt),
58
- className: "text-xs",
59
- children: prompt
60
- }, prompt))
61
- }) }),
62
- (compact ? c.messages.slice(-2) : c.messages).map((message) => message.role === "user" ? /* @__PURE__ */ jsxs(ChatMessage.User, { children: [/* @__PURE__ */ jsx(ChatMessage.Bubble, { children: /* @__PURE__ */ jsx(ChatMessage.Content, {
63
- className: "wrap-anywhere",
64
- children: message.text
65
- }) }), message.attachments?.map((file) => /* @__PURE__ */ jsx(ChatAttachment, {
66
- name: file.name,
67
- mimeType: file.mimeType,
68
- size: file.size,
69
- children: /* @__PURE__ */ jsx(ChatAttachment.Preview, {})
70
- }, file.id))] }, message.id) : /* @__PURE__ */ jsx(ChatMessage.Assistant, { children: /* @__PURE__ */ jsxs(ChatMessage.Body, {
71
- className: "min-w-0",
72
- children: [/* @__PURE__ */ jsx(ChatMessage.Content, {
73
- className: `wrap-anywhere ${compact ? "line-clamp-3" : ""}`,
74
- children: message.text
75
- }), c.phase === "ready" && /* @__PURE__ */ jsxs(Fragment, { children: [!compact && /* @__PURE__ */ jsx(MockResult, { prompt: c.messages.slice(0, c.messages.indexOf(message)).reverse().find((item) => item.role === "user")?.text ?? "" }), /* @__PURE__ */ jsx(MessageActions, {
76
- message,
77
- conversation: c
78
- })] })]
79
- }) }, message.id)),
80
- c.phase !== "ready" && /* @__PURE__ */ jsxs("div", {
81
- role: "status",
82
- children: [/* @__PURE__ */ jsxs("div", {
83
- className: "flex items-center gap-3 py-2",
84
- children: [/* @__PURE__ */ jsx(ChatLoader.Pulse, { "aria-hidden": "true" }), /* @__PURE__ */ jsx(TextShimmer, { children: c.phase === "listening" ? "Listening to a sample prompt…" : c.phase === "streaming" ? "Writing response…" : "Working on your request…" })]
85
- }), /* @__PURE__ */ jsxs(ChainOfThought, {
86
- isStreaming: true,
87
- children: [/* @__PURE__ */ jsx(ChainOfThought.Trigger, { children: "Preview progress" }), /* @__PURE__ */ jsx(ChainOfThought.Content, { children: /* @__PURE__ */ jsxs(ChainOfThought.Steps, { children: [/* @__PURE__ */ jsx(ChainOfThought.Step, {
88
- label: "Read the prompt",
89
- children: "Using this mock conversation and attached file names."
90
- }), /* @__PURE__ */ jsxs(ChainOfThought.Step, {
91
- label: "Prepare a sample result",
92
- children: [
93
- "Generating a simulated response with the ",
94
- c.model,
95
- " ",
96
- "preset."
97
- ]
98
- })] }) })]
99
- })]
100
- })
101
- ]
102
- })
103
- }, c.activeId), showJump && /* @__PURE__ */ jsx("div", {
104
- className: "pointer-events-none absolute inset-x-0 bottom-4 flex justify-center",
105
- children: /* @__PURE__ */ jsx(Button, {
106
- "aria-label": "Latest messages",
107
- isIconOnly: true,
108
- size: "sm",
109
- variant: "secondary",
110
- className: "pointer-events-auto shadow-sm",
111
- onPress: scrollToBottom,
112
- children: /* @__PURE__ */ jsx(AltArrowDown, {
113
- size: 18,
114
- "aria-hidden": "true"
115
- })
116
- })
117
- })]
118
- }),
119
- /* @__PURE__ */ jsxs("footer", {
120
- "aria-label": "Chat composer",
121
- className: "flex shrink-0 flex-col gap-3",
122
- children: [/* @__PURE__ */ jsx(Composer, { conversation: c }), /* @__PURE__ */ jsxs("div", {
123
- className: "text-muted flex flex-col items-center gap-1 text-center text-xs",
124
- children: [/* @__PURE__ */ jsx("p", { children: "AI may make mistakes. Verify all outputs." }), /* @__PURE__ */ jsxs("a", {
125
- href: "https://vezham.com/tamizhi",
126
- target: "_blank",
127
- rel: "noopener noreferrer",
128
- className: "hover:text-foreground inline-flex items-center gap-1",
129
- children: [
130
- "Powered by ",
131
- /* @__PURE__ */ jsx(VezhamTamizhi, {
132
- size: 16,
133
- "aria-hidden": "true"
134
- }),
135
- " ",
136
- /* @__PURE__ */ jsx("span", {
137
- className: "font-medium",
138
- children: "Tamizhi"
139
- })
140
- ]
141
- })]
142
- })]
143
- })
144
- ]
145
- });
146
- };
147
- //#endregion
148
- export { AIContent };
@@ -1,47 +0,0 @@
1
- type Attachment = {
2
- id: number;
3
- name: string;
4
- mimeType: string;
5
- size: number;
6
- };
7
- type Message = {
8
- id: number;
9
- role: 'user' | 'assistant';
10
- text: string;
11
- attachments?: Attachment[];
12
- rating?: 'up' | 'down';
13
- };
14
- type Phase = 'ready' | 'listening' | 'thinking' | 'streaming';
15
- export declare const useMockConversation: () => {
16
- attachments: Attachment[];
17
- addFiles: (files: File[]) => void;
18
- removeAttachment: (id: number) => void;
19
- model: string;
20
- setModel: import("react").Dispatch<import("react").SetStateAction<string>>;
21
- fastMode: boolean;
22
- setFastMode: import("react").Dispatch<import("react").SetStateAction<boolean>>;
23
- permissions: string;
24
- setPermissions: import("react").Dispatch<import("react").SetStateAction<string>>;
25
- regenerate: (id: number) => void;
26
- branchChat: (id: number) => void;
27
- rate: (id: number, rating: "up" | "down") => void;
28
- messages: Message[];
29
- value: string;
30
- setValue: import("react").Dispatch<import("react").SetStateAction<string>>;
31
- phase: Phase;
32
- submit: (prompt?: string) => void;
33
- listen: () => void;
34
- stop: () => void;
35
- newChat: () => void;
36
- openChat: (id: string) => void;
37
- activeId: string;
38
- title: string;
39
- threads: {
40
- id: string;
41
- title: string;
42
- preview: string;
43
- }[];
44
- };
45
- export type Conversation = ReturnType<typeof useMockConversation>;
46
- export {};
47
- //# sourceMappingURL=conversation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/components/panel/footer/ai/conversation.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AACD,KAAK,OAAO,GAAG;IACb,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,UAAU,EAAE,CAAA;IAC1B,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CACvB,CAAA;AAED,KAAK,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAA;AAqB7D,eAAO,MAAM,mBAAmB;;sBAiML,IAAI,EAAE;2BAaN,MAAM;;;;;;;qBAjCP,MAAM;qBAnBN,MAAM;eA4BZ,MAAM,UAAU,IAAI,GAAG,MAAM;;;;;;;;;mBApCzB,MAAM;;;;;;;;CAwF7B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}