@bigbinary/neetoui-rn 3.4.0 → 3.5.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 (85) hide show
  1. package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts +2 -1
  2. package/lib/typescript/src/components/ChatInput/AttachmentsView.d.ts.map +1 -1
  3. package/lib/typescript/src/components/ChatInput/ChatInput.d.ts +76 -0
  4. package/lib/typescript/src/components/ChatInput/ChatInput.d.ts.map +1 -1
  5. package/lib/typescript/src/components/ChatInput/MentionSuggestionList.d.ts +9 -0
  6. package/lib/typescript/src/components/ChatInput/MentionSuggestionList.d.ts.map +1 -0
  7. package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts +3 -1
  8. package/lib/typescript/src/components/ChatInput/MentionsInput.d.ts.map +1 -1
  9. package/lib/typescript/src/components/ChatInput/SegmentedOptions.d.ts +10 -0
  10. package/lib/typescript/src/components/ChatInput/SegmentedOptions.d.ts.map +1 -0
  11. package/lib/typescript/src/components/ChatInput/constants.d.ts +3 -0
  12. package/lib/typescript/src/components/ChatInput/constants.d.ts.map +1 -1
  13. package/lib/typescript/src/components/ChatInput/index.d.ts +1 -1
  14. package/lib/typescript/src/components/ChatInput/index.d.ts.map +1 -1
  15. package/lib/typescript/src/components/ChatInput/mentions.d.ts +2 -0
  16. package/lib/typescript/src/components/ChatInput/mentions.d.ts.map +1 -1
  17. package/lib/typescript/src/components/RichTextEditor/LazyRichTextEditor.d.ts +3 -0
  18. package/lib/typescript/src/components/RichTextEditor/LazyRichTextEditor.d.ts.map +1 -0
  19. package/lib/typescript/src/components/RichTextEditor/MentionSuggestionBar.d.ts +8 -0
  20. package/lib/typescript/src/components/RichTextEditor/MentionSuggestionBar.d.ts.map +1 -0
  21. package/lib/typescript/src/components/RichTextEditor/RichTextEditor.d.ts +39 -0
  22. package/lib/typescript/src/components/RichTextEditor/RichTextEditor.d.ts.map +1 -0
  23. package/lib/typescript/src/components/RichTextEditor/RichTextToolbar.d.ts +8 -0
  24. package/lib/typescript/src/components/RichTextEditor/RichTextToolbar.d.ts.map +1 -0
  25. package/lib/typescript/src/components/RichTextEditor/bridges/CodeBlockBridge.d.ts +13 -0
  26. package/lib/typescript/src/components/RichTextEditor/bridges/CodeBlockBridge.d.ts.map +1 -0
  27. package/lib/typescript/src/components/RichTextEditor/bridges/ComposerBridge.d.ts +27 -0
  28. package/lib/typescript/src/components/RichTextEditor/bridges/ComposerBridge.d.ts.map +1 -0
  29. package/lib/typescript/src/components/RichTextEditor/bridges/FigureBridge.d.ts +3 -0
  30. package/lib/typescript/src/components/RichTextEditor/bridges/FigureBridge.d.ts.map +1 -0
  31. package/lib/typescript/src/components/RichTextEditor/bridges/MentionBridge.d.ts +35 -0
  32. package/lib/typescript/src/components/RichTextEditor/bridges/MentionBridge.d.ts.map +1 -0
  33. package/lib/typescript/src/components/RichTextEditor/bridges/VariableBridge.d.ts +3 -0
  34. package/lib/typescript/src/components/RichTextEditor/bridges/VariableBridge.d.ts.map +1 -0
  35. package/lib/typescript/src/components/RichTextEditor/bridges/index.d.ts +8 -0
  36. package/lib/typescript/src/components/RichTextEditor/bridges/index.d.ts.map +1 -0
  37. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Figure.d.ts +3 -0
  38. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Figure.d.ts.map +1 -0
  39. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Mention.d.ts +3 -0
  40. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Mention.d.ts.map +1 -0
  41. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Variable.d.ts +3 -0
  42. package/lib/typescript/src/components/RichTextEditor/bridges/nodes/Variable.d.ts.map +1 -0
  43. package/lib/typescript/src/components/RichTextEditor/bridges/types.d.ts +7 -0
  44. package/lib/typescript/src/components/RichTextEditor/bridges/types.d.ts.map +1 -0
  45. package/lib/typescript/src/components/RichTextEditor/editorCss.d.ts +21 -0
  46. package/lib/typescript/src/components/RichTextEditor/editorCss.d.ts.map +1 -0
  47. package/lib/typescript/src/components/RichTextEditor/icons/index.d.ts +9 -0
  48. package/lib/typescript/src/components/RichTextEditor/icons/index.d.ts.map +1 -0
  49. package/lib/typescript/src/components/RichTextEditor/index.d.ts +3 -0
  50. package/lib/typescript/src/components/RichTextEditor/index.d.ts.map +1 -0
  51. package/lib/typescript/src/components/RichTextEditor/injectableText.d.ts +2 -0
  52. package/lib/typescript/src/components/RichTextEditor/injectableText.d.ts.map +1 -0
  53. package/lib/typescript/src/components/RichTextEditor/web/build/editorHtml.d.ts +2 -0
  54. package/lib/typescript/src/components/RichTextEditor/web/build/editorHtml.d.ts.map +1 -0
  55. package/lib/typescript/src/index.d.ts +2 -1
  56. package/lib/typescript/src/index.d.ts.map +1 -1
  57. package/package.json +30 -7
  58. package/src/components/ChatInput/AttachmentsView.tsx +6 -0
  59. package/src/components/ChatInput/ChatInput.tsx +557 -91
  60. package/src/components/ChatInput/MentionSuggestionList.tsx +71 -0
  61. package/src/components/ChatInput/MentionsInput.tsx +34 -46
  62. package/src/components/ChatInput/SegmentedOptions.tsx +84 -0
  63. package/src/components/ChatInput/constants.ts +10 -0
  64. package/src/components/ChatInput/index.ts +3 -0
  65. package/src/components/ChatInput/mentions.ts +22 -0
  66. package/src/components/RichTextEditor/LazyRichTextEditor.tsx +19 -0
  67. package/src/components/RichTextEditor/MentionSuggestionBar.tsx +79 -0
  68. package/src/components/RichTextEditor/RichTextEditor.tsx +213 -0
  69. package/src/components/RichTextEditor/RichTextToolbar.tsx +452 -0
  70. package/src/components/RichTextEditor/bridges/CodeBlockBridge.ts +29 -0
  71. package/src/components/RichTextEditor/bridges/ComposerBridge.ts +107 -0
  72. package/src/components/RichTextEditor/bridges/FigureBridge.ts +7 -0
  73. package/src/components/RichTextEditor/bridges/MentionBridge.ts +79 -0
  74. package/src/components/RichTextEditor/bridges/VariableBridge.ts +7 -0
  75. package/src/components/RichTextEditor/bridges/index.ts +66 -0
  76. package/src/components/RichTextEditor/bridges/nodes/Figure.ts +127 -0
  77. package/src/components/RichTextEditor/bridges/nodes/Mention.ts +48 -0
  78. package/src/components/RichTextEditor/bridges/nodes/Variable.ts +68 -0
  79. package/src/components/RichTextEditor/bridges/types.ts +24 -0
  80. package/src/components/RichTextEditor/editorCss.ts +69 -0
  81. package/src/components/RichTextEditor/icons/index.tsx +41 -0
  82. package/src/components/RichTextEditor/index.ts +2 -0
  83. package/src/components/RichTextEditor/injectableText.ts +11 -0
  84. package/src/components/RichTextEditor/web/build/editorHtml.ts +3 -0
  85. package/src/index.ts +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neetoui-rn",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
4
  "description": "neeto UI component library for React Native — v3 (Unistyles, TypeScript, New Architecture)",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
@@ -25,6 +25,9 @@
25
25
  "src",
26
26
  "lib",
27
27
  "assets",
28
+ "!src/components/RichTextEditor/web/index.*",
29
+ "!src/components/RichTextEditor/web/vite.config.ts",
30
+ "!src/components/RichTextEditor/web/tsconfig.json",
28
31
  "!**/__tests__",
29
32
  "!**/*.stories.tsx",
30
33
  "!**/.*"
@@ -36,14 +39,15 @@
36
39
  "scripts": {
37
40
  "build": "bob build",
38
41
  "test": "jest",
39
- "typecheck": "tsc --noEmit",
42
+ "typecheck": "tsc --noEmit && tsc --noEmit -p src/components/RichTextEditor/web",
40
43
  "lint": "eslint src --ext .ts,.tsx",
41
44
  "format": "prettier --write .",
42
45
  "generate:tokens": "node scripts/generate-tokens.mjs && prettier --write src/theme/palette.generated.ts",
43
46
  "prepare": "husky install",
44
47
  "storybook": "storybook dev -p 6006",
45
48
  "build-storybook": "storybook build",
46
- "prepack": "bob build"
49
+ "prepack": "bob build",
50
+ "build:editor": "NODE_ENV=production vite build --config src/components/RichTextEditor/web/vite.config.ts && rm src/components/RichTextEditor/web/build/index.html"
47
51
  },
48
52
  "lint-staged": {
49
53
  "*.{ts,tsx}": [
@@ -66,7 +70,8 @@
66
70
  "react-native-safe-area-context": ">=4.0.0",
67
71
  "react-native-svg": ">=15.0.0",
68
72
  "react-native-toast-message": "^2.0.0",
69
- "react-native-unistyles": ">=3.2.0"
73
+ "react-native-unistyles": ">=3.2.0",
74
+ "react-native-webview": ">=13"
70
75
  },
71
76
  "devDependencies": {
72
77
  "@babel/core": "^7.26.0",
@@ -77,10 +82,19 @@
77
82
  "@shopify/flash-list": "^2.3.2",
78
83
  "@storybook/react-native-web-vite": "^10.5.5",
79
84
  "@testing-library/react-native": "^14.0.1",
85
+ "@tiptap/extension-document": "3.32.0",
86
+ "@tiptap/extension-image": "3.32.0",
87
+ "@tiptap/extension-paragraph": "3.32.0",
88
+ "@tiptap/extension-text": "3.32.0",
89
+ "@tiptap/html": "3.32.0",
90
+ "@tiptap/pm": "3.32.0",
91
+ "@tiptap/react": "3.32.0",
80
92
  "@types/jest": "^29.5.14",
81
93
  "@types/react": "^19.1.0",
94
+ "@types/react-dom": "~19.1.0",
82
95
  "@typescript-eslint/eslint-plugin": "^7.18.0",
83
96
  "@typescript-eslint/parser": "^7.18.0",
97
+ "@vitejs/plugin-react": "^4.7.0",
84
98
  "eslint": "^8.57.0",
85
99
  "eslint-config-prettier": "^9.1.0",
86
100
  "eslint-plugin-prettier": "^5.2.1",
@@ -90,6 +104,7 @@
90
104
  "eslint-plugin-unused-imports": "^3.2.0",
91
105
  "husky": "^8.0.1",
92
106
  "jest": "^29.7.0",
107
+ "jest-environment-jsdom": "^29.7.0",
93
108
  "lint-staged": "^15.2.0",
94
109
  "prettier": "^3.3.3",
95
110
  "react": "19.1.0",
@@ -105,10 +120,12 @@
105
120
  "react-native-toast-message": "^2",
106
121
  "react-native-unistyles": "3.2.5",
107
122
  "react-native-web": "^0.21.2",
123
+ "react-native-webview": "^14.0.1",
108
124
  "storybook": "^10.5.5",
109
125
  "test-renderer": "^1.0.0",
110
126
  "typescript": "^5.3.3",
111
- "vite": "^6"
127
+ "vite": "^6",
128
+ "vite-plugin-singlefile": "^2.3.3"
112
129
  },
113
130
  "jest": {
114
131
  "preset": "react-native",
@@ -116,12 +133,15 @@
116
133
  "./jest.setup.js"
117
134
  ],
118
135
  "transformIgnorePatterns": [
119
- "node_modules/(?!(@react-native|@bigbinary|@gorhom|@shopify|react-native|react-native-[^/]+)/)"
136
+ "node_modules/(?!(@react-native|@bigbinary|@10play|@gorhom|@shopify|react-native|react-native-[^/]+)/)"
120
137
  ],
121
138
  "testPathIgnorePatterns": [
122
139
  "/node_modules/",
123
140
  "/lib/"
124
- ]
141
+ ],
142
+ "moduleNameMapper": {
143
+ "^\\.\\./webEditorUtils/focusListener$": "<rootDir>/jest/tentapFocusListener.js"
144
+ }
125
145
  },
126
146
  "react-native-builder-bob": {
127
147
  "source": "src",
@@ -136,7 +156,10 @@
136
156
  ]
137
157
  },
138
158
  "dependencies": {
159
+ "@10play/tentap-editor": "^1.0.1",
139
160
  "@bigbinary/neeto-icons-rn": "^1.21.2",
161
+ "@tiptap/core": "^3.11.0",
162
+ "@tiptap/extension-code-block": "^3.11.0",
140
163
  "react-native-controlled-mentions": "^3.1.0"
141
164
  }
142
165
  }
@@ -24,6 +24,7 @@ type AttachmentsViewProps = {
24
24
  Attachments?: ReactNode;
25
25
  attachmentsCount?: number;
26
26
  isNoteOptionSelected: boolean;
27
+ isAlwaysExpanded?: boolean;
27
28
  };
28
29
 
29
30
  export const AttachmentsView = ({
@@ -32,9 +33,14 @@ export const AttachmentsView = ({
32
33
  Attachments,
33
34
  attachmentsCount = 0,
34
35
  isNoteOptionSelected,
36
+ isAlwaysExpanded = false,
35
37
  }: AttachmentsViewProps) => {
36
38
  if (attachmentsCount === 0) return null;
37
39
 
40
+ if (isAlwaysExpanded) {
41
+ return <View style={styles.expanded}>{Attachments}</View>;
42
+ }
43
+
38
44
  return isAttachmentsVisible ? (
39
45
  // Held at its natural height: the cards inside are fixed-size, so a
40
46
  // squeeze has to come out of the text area, not out of them.