@antscorp/antsomi-ui 1.3.7-beta.7 → 1.3.7-beta.71

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 (302) hide show
  1. package/README.md +70 -0
  2. package/es/components/atoms/Input/Input.js +3 -1
  3. package/es/components/atoms/InputDynamic/InputDynamic.js +3 -3
  4. package/es/components/atoms/Tag/Tag.js +1 -1
  5. package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
  6. package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
  7. package/es/components/icons/QRCodeManagementIcon.d.ts +3 -0
  8. package/es/components/icons/QRCodeManagementIcon.js +7 -0
  9. package/es/components/icons/QRSetDashboardIcon.d.ts +3 -0
  10. package/es/components/icons/QRSetDashboardIcon.js +7 -0
  11. package/es/components/icons/index.d.ts +2 -0
  12. package/es/components/icons/index.js +2 -0
  13. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +28 -2
  14. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
  15. package/es/components/molecules/AddDynamicContent/constants.d.ts +2 -0
  16. package/es/components/molecules/AddDynamicContent/constants.js +2 -0
  17. package/es/components/molecules/ColorPicker/index.d.ts +2 -0
  18. package/es/components/molecules/ColorPicker/index.js +8 -3
  19. package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
  20. package/es/components/molecules/EmojiPopover/EmojiPopover.js +2 -2
  21. package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
  22. package/es/components/molecules/EmojiPopover/styled.js +1 -1
  23. package/es/components/molecules/EmptyData/EmptyData.d.ts +1 -1
  24. package/es/components/molecules/EmptyData/EmptyData.js +4 -2
  25. package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -1
  26. package/es/components/molecules/InputSearch/index.d.ts +1 -1
  27. package/es/components/molecules/InputSearch/index.js +2 -1
  28. package/es/components/molecules/Modal/Modal.js +7 -1
  29. package/es/components/molecules/ModalV2/ModalV2.js +2 -1
  30. package/es/components/molecules/SearchPopover/SearchPopover.js +2 -2
  31. package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
  32. package/es/components/molecules/SearchPopover/styled.js +1 -2
  33. package/es/components/molecules/SearchPopover/types.d.ts +4 -3
  34. package/es/components/molecules/Select/Select.js +3 -3
  35. package/es/components/molecules/Select/styled.d.ts +3 -1
  36. package/es/components/molecules/Select/styled.js +50 -6
  37. package/es/components/molecules/ShareAccess/ShareAccess.d.ts +2 -1
  38. package/es/components/molecules/ShareAccess/ShareAccess.js +12 -9
  39. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +5 -5
  40. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +2 -2
  41. package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +2 -1
  42. package/es/components/molecules/ShareAccess/index.d.ts +1 -0
  43. package/es/components/molecules/ShareAccess/reducer.d.ts +1 -1
  44. package/es/components/molecules/ShareAccess/reducer.js +7 -4
  45. package/es/components/molecules/ShareAccess/types.d.ts +22 -0
  46. package/es/components/molecules/ShareAccess/utils.d.ts +3 -1
  47. package/es/components/molecules/ShareAccess/utils.js +35 -2
  48. package/es/components/molecules/TagifyInput/TagifyInput.js +48 -27
  49. package/es/components/molecules/TagifyInput/types.d.ts +14 -8
  50. package/es/components/molecules/TagifyInput/utils.d.ts +6 -1
  51. package/es/components/molecules/TagifyInput/utils.js +19 -0
  52. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
  53. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +3 -7
  54. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
  55. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -327
  56. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
  57. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
  58. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
  59. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
  60. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
  61. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
  62. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
  63. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
  64. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
  65. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
  66. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
  67. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
  68. package/es/components/molecules/VirtualizedMenu/styled.js +14 -3
  69. package/es/components/molecules/VirtualizedMenu/types.d.ts +1 -0
  70. package/es/components/molecules/VirtualizedMenu/utils.d.ts +1 -0
  71. package/es/components/molecules/VirtualizedMenu/utils.js +1 -0
  72. package/es/components/molecules/index.d.ts +1 -0
  73. package/es/components/organism/AccountSharing/AccountSharing.d.ts +1 -0
  74. package/es/components/organism/AccountSharing/AccountSharing.js +17 -33
  75. package/es/components/organism/AccountSharing/styled.js +1 -1
  76. package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
  77. package/es/components/organism/ActivityTimeline/constants.d.ts +9 -9
  78. package/es/components/organism/ActivityTimeline/constants.js +3 -3
  79. package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
  80. package/es/components/organism/ActivityTimeline/index.js +9 -1
  81. package/es/components/organism/ActivityTimeline/utils.js +186 -15
  82. package/es/components/organism/LeftMenu/LeftMenu.js +6 -6
  83. package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
  84. package/es/components/organism/LeftMenu/styled.js +2 -0
  85. package/es/components/organism/LeftMenu/types/index.d.ts +7 -0
  86. package/es/components/organism/LeftMenu/utils/index.js +1 -1
  87. package/es/components/organism/Login/Login.js +19 -36
  88. package/es/components/organism/Login/components/IconInfo/IconInfo.js +1 -1
  89. package/es/components/organism/Login/components/LoginSelectPortal/LoginSelectPortal.js +1 -1
  90. package/es/components/organism/Login/components/SignIn/SignIn.js +2 -2
  91. package/es/components/organism/Login/types/index.d.ts +2 -0
  92. package/es/components/organism/LoginV2/LoginV2.d.ts +3 -0
  93. package/es/components/organism/LoginV2/LoginV2.js +957 -0
  94. package/es/components/organism/LoginV2/components/Avatar/Avatar.d.ts +8 -0
  95. package/es/components/organism/LoginV2/components/Avatar/Avatar.js +11 -0
  96. package/es/components/organism/LoginV2/components/Avatar/index.d.ts +1 -0
  97. package/es/components/organism/LoginV2/components/Avatar/index.js +1 -0
  98. package/es/components/organism/LoginV2/components/ChooseMethod/ChooseMethod.d.ts +9 -0
  99. package/es/components/organism/LoginV2/components/ChooseMethod/ChooseMethod.js +54 -0
  100. package/es/components/organism/LoginV2/components/ChooseMethod/Method.d.ts +10 -0
  101. package/es/components/organism/LoginV2/components/ChooseMethod/Method.js +13 -0
  102. package/es/components/organism/LoginV2/components/ChooseMethod/index.d.ts +1 -0
  103. package/es/components/organism/LoginV2/components/ChooseMethod/index.js +1 -0
  104. package/es/components/organism/LoginV2/components/ChooseMethod/styled.d.ts +10 -0
  105. package/es/components/organism/LoginV2/components/ChooseMethod/styled.js +24 -0
  106. package/es/components/organism/LoginV2/components/ChooseMethod/utils.d.ts +1 -0
  107. package/es/components/organism/LoginV2/components/ChooseMethod/utils.js +1 -0
  108. package/es/components/organism/LoginV2/components/ForgotPassword/ForgotPassword.d.ts +14 -0
  109. package/es/components/organism/LoginV2/components/ForgotPassword/ForgotPassword.js +195 -0
  110. package/es/components/organism/LoginV2/components/ForgotPassword/index.d.ts +2 -0
  111. package/es/components/organism/LoginV2/components/ForgotPassword/index.js +2 -0
  112. package/es/components/organism/LoginV2/components/ForgotPassword/styled.d.ts +1 -0
  113. package/es/components/organism/LoginV2/components/ForgotPassword/styled.js +10 -0
  114. package/es/components/organism/LoginV2/components/IconInfo/IconInfo.d.ts +7 -0
  115. package/es/components/organism/LoginV2/components/IconInfo/IconInfo.js +18 -0
  116. package/es/components/organism/LoginV2/components/IconInfo/index.d.ts +1 -0
  117. package/es/components/organism/LoginV2/components/IconInfo/index.js +1 -0
  118. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/Item.d.ts +10 -0
  119. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/Item.js +12 -0
  120. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/index.d.ts +1 -0
  121. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/index.js +1 -0
  122. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/styled.d.ts +2 -0
  123. package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/styled.js +34 -0
  124. package/es/components/organism/LoginV2/components/LoginSelectPortal/LoginSelectPortal.d.ts +19 -0
  125. package/es/components/organism/LoginV2/components/LoginSelectPortal/LoginSelectPortal.js +194 -0
  126. package/es/components/organism/LoginV2/components/LoginSelectPortal/index.d.ts +1 -0
  127. package/es/components/organism/LoginV2/components/LoginSelectPortal/index.js +1 -0
  128. package/es/components/organism/LoginV2/components/LoginSelectPortal/styled.d.ts +1 -0
  129. package/es/components/organism/LoginV2/components/LoginSelectPortal/styled.js +5 -0
  130. package/es/components/organism/LoginV2/components/LoginWithEmail/LoginWithEmail.d.ts +15 -0
  131. package/es/components/organism/LoginV2/components/LoginWithEmail/LoginWithEmail.js +211 -0
  132. package/es/components/organism/LoginV2/components/LoginWithEmail/index.d.ts +1 -0
  133. package/es/components/organism/LoginV2/components/LoginWithEmail/index.js +1 -0
  134. package/es/components/organism/LoginV2/components/LoginWithEmail/styled.d.ts +3 -0
  135. package/es/components/organism/LoginV2/components/LoginWithEmail/styled.js +5 -0
  136. package/es/components/organism/LoginV2/components/LoginWithGG/LoginWithGG.d.ts +14 -0
  137. package/es/components/organism/LoginV2/components/LoginWithGG/LoginWithGG.js +116 -0
  138. package/es/components/organism/LoginV2/components/LoginWithGG/index.d.ts +1 -0
  139. package/es/components/organism/LoginV2/components/LoginWithGG/index.js +1 -0
  140. package/es/components/organism/LoginV2/components/LoginWithGG/styled.d.ts +3 -0
  141. package/es/components/organism/LoginV2/components/LoginWithGG/styled.js +5 -0
  142. package/es/components/organism/LoginV2/components/Logo/Logo.d.ts +6 -0
  143. package/es/components/organism/LoginV2/components/Logo/Logo.js +9 -0
  144. package/es/components/organism/LoginV2/components/Logo/index.d.ts +1 -0
  145. package/es/components/organism/LoginV2/components/Logo/index.js +1 -0
  146. package/es/components/organism/LoginV2/components/OryConsent/OryAuthLayout.d.ts +9 -0
  147. package/es/components/organism/LoginV2/components/OryConsent/OryAuthLayout.js +4 -0
  148. package/es/components/organism/LoginV2/components/OryConsent/OryConsent.d.ts +17 -0
  149. package/es/components/organism/LoginV2/components/OryConsent/OryConsent.js +204 -0
  150. package/es/components/organism/LoginV2/components/OryConsent/OryThemeProvider.d.ts +8 -0
  151. package/es/components/organism/LoginV2/components/OryConsent/OryThemeProvider.js +10 -0
  152. package/es/components/organism/LoginV2/components/OryConsent/PortalSelect.d.ts +15 -0
  153. package/es/components/organism/LoginV2/components/OryConsent/PortalSelect.js +30 -0
  154. package/es/components/organism/LoginV2/components/OryConsent/ScopeConsent.d.ts +20 -0
  155. package/es/components/organism/LoginV2/components/OryConsent/ScopeConsent.js +29 -0
  156. package/es/components/organism/LoginV2/components/OryConsent/index.d.ts +2 -0
  157. package/es/components/organism/LoginV2/components/OryConsent/index.js +2 -0
  158. package/es/components/organism/LoginV2/components/OryConsent/styled.d.ts +31 -0
  159. package/es/components/organism/LoginV2/components/OryConsent/styled.js +292 -0
  160. package/es/components/organism/LoginV2/components/OrySignIn/OryFormShell.d.ts +9 -0
  161. package/es/components/organism/LoginV2/components/OrySignIn/OryFormShell.js +36 -0
  162. package/es/components/organism/LoginV2/components/OrySignIn/OryMfa.d.ts +11 -0
  163. package/es/components/organism/LoginV2/components/OrySignIn/OryMfa.js +144 -0
  164. package/es/components/organism/LoginV2/components/OrySignIn/OryRecovery.d.ts +9 -0
  165. package/es/components/organism/LoginV2/components/OrySignIn/OryRecovery.js +128 -0
  166. package/es/components/organism/LoginV2/components/OrySignIn/OryStatus.d.ts +17 -0
  167. package/es/components/organism/LoginV2/components/OrySignIn/OryStatus.js +33 -0
  168. package/es/components/organism/LoginV2/components/OrySignIn/index.d.ts +3 -0
  169. package/es/components/organism/LoginV2/components/OrySignIn/index.js +3 -0
  170. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/SetupGGAuthenticator.d.ts +14 -0
  171. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/SetupGGAuthenticator.js +100 -0
  172. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/index.d.ts +2 -0
  173. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/index.js +2 -0
  174. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/styled.d.ts +4 -0
  175. package/es/components/organism/LoginV2/components/SetupGGAuthenticator/styled.js +10 -0
  176. package/es/components/organism/LoginV2/components/SignIn/SignIn.d.ts +22 -0
  177. package/es/components/organism/LoginV2/components/SignIn/SignIn.js +107 -0
  178. package/es/components/organism/LoginV2/components/SignIn/index.d.ts +1 -0
  179. package/es/components/organism/LoginV2/components/SignIn/index.js +1 -0
  180. package/es/components/organism/LoginV2/components/SignIn/styled.d.ts +3 -0
  181. package/es/components/organism/LoginV2/components/SignIn/styled.js +10 -0
  182. package/es/components/organism/LoginV2/components/VerifyAccount/VerifyAccount.d.ts +25 -0
  183. package/es/components/organism/LoginV2/components/VerifyAccount/VerifyAccount.js +42 -0
  184. package/es/components/organism/LoginV2/components/VerifyAccount/index.d.ts +1 -0
  185. package/es/components/organism/LoginV2/components/VerifyAccount/index.js +1 -0
  186. package/es/components/organism/LoginV2/components/VerifyAccount/styled.d.ts +22 -0
  187. package/es/components/organism/LoginV2/components/VerifyAccount/styled.js +17 -0
  188. package/es/components/organism/LoginV2/components/WidgetLayout/WidgetLayout.d.ts +13 -0
  189. package/es/components/organism/LoginV2/components/WidgetLayout/WidgetLayout.js +18 -0
  190. package/es/components/organism/LoginV2/components/WidgetLayout/index.d.ts +1 -0
  191. package/es/components/organism/LoginV2/components/WidgetLayout/index.js +1 -0
  192. package/es/components/organism/LoginV2/components/WidgetLayout/styled.d.ts +5 -0
  193. package/es/components/organism/LoginV2/components/WidgetLayout/styled.js +22 -0
  194. package/es/components/organism/LoginV2/components/index.d.ts +11 -0
  195. package/es/components/organism/LoginV2/components/index.js +11 -0
  196. package/es/components/organism/LoginV2/constants/index.d.ts +48 -0
  197. package/es/components/organism/LoginV2/constants/index.js +48 -0
  198. package/es/components/organism/LoginV2/hooks/index.d.ts +1 -0
  199. package/es/components/organism/LoginV2/hooks/index.js +1 -0
  200. package/es/components/organism/LoginV2/hooks/useResize.d.ts +7 -0
  201. package/es/components/organism/LoginV2/hooks/useResize.js +21 -0
  202. package/es/components/organism/LoginV2/index.d.ts +6 -0
  203. package/es/components/organism/LoginV2/index.js +4 -0
  204. package/es/components/organism/LoginV2/styled.d.ts +51 -0
  205. package/es/components/organism/LoginV2/styled.js +129 -0
  206. package/es/components/organism/LoginV2/types/index.d.ts +79 -0
  207. package/es/components/organism/LoginV2/types/index.js +1 -0
  208. package/es/components/organism/LoginV2/types/ory.d.ts +52 -0
  209. package/es/components/organism/LoginV2/types/ory.js +1 -0
  210. package/es/components/organism/LoginV2/utils/index.d.ts +14 -0
  211. package/es/components/organism/LoginV2/utils/index.js +49 -0
  212. package/es/components/organism/LoginV2/utils/ory.d.ts +138 -0
  213. package/es/components/organism/LoginV2/utils/ory.js +408 -0
  214. package/es/components/organism/LoginV2/utils/oryConsent.d.ts +52 -0
  215. package/es/components/organism/LoginV2/utils/oryConsent.js +174 -0
  216. package/es/components/organism/LoginV2/utils/oryFlows.d.ts +100 -0
  217. package/es/components/organism/LoginV2/utils/oryFlows.js +319 -0
  218. package/es/components/organism/TextEditor/TextEditor.d.ts +9 -2
  219. package/es/components/organism/TextEditor/TextEditor.js +203 -42
  220. package/es/components/organism/TextEditor/constants.d.ts +9 -0
  221. package/es/components/organism/TextEditor/constants.js +66 -0
  222. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +6 -128
  223. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +7 -292
  224. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +1 -1
  225. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +4 -0
  226. package/es/components/organism/TextEditor/extensions/Link.js +33 -14
  227. package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
  228. package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
  229. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +5 -6
  230. package/es/components/organism/TextEditor/extensions/SmartTag.js +96 -4
  231. package/es/components/organism/TextEditor/hooks/useColorSet.js +7 -0
  232. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +2 -1
  233. package/es/components/organism/TextEditor/index.d.ts +7 -5
  234. package/es/components/organism/TextEditor/index.scss +4 -7
  235. package/es/components/organism/TextEditor/provider.d.ts +1 -0
  236. package/es/components/organism/TextEditor/provider.js +6 -3
  237. package/es/components/organism/TextEditor/store.d.ts +11 -4
  238. package/es/components/organism/TextEditor/store.js +22 -2
  239. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
  240. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
  241. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
  242. package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
  243. package/es/components/organism/TextEditor/stories/shared.js +57 -0
  244. package/es/components/organism/TextEditor/styled.d.ts +1 -1
  245. package/es/components/organism/TextEditor/styled.js +1 -0
  246. package/es/components/organism/TextEditor/types.d.ts +161 -11
  247. package/es/components/organism/TextEditor/types.js +1 -0
  248. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +2 -1
  249. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +80 -51
  250. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +1 -1
  251. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +1 -1
  252. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +2 -2
  253. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +12 -2
  254. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
  255. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
  256. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
  257. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
  258. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
  259. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
  260. package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
  261. package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
  262. package/es/components/organism/TextEditor/ui/Popover/Popover.js +1 -1
  263. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +1 -3
  264. package/es/components/organism/TextEditor/ui/Toolbar/{Toolbar.d.ts → FormattingToolbar.d.ts} +3 -4
  265. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +90 -0
  266. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
  267. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
  268. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +4 -3
  269. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +1 -0
  270. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +2 -2
  271. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +6 -1
  272. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -1
  273. package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -1
  274. package/es/components/organism/TextEditor/utils/documentState.d.ts +14 -0
  275. package/es/components/organism/TextEditor/utils/documentState.js +25 -0
  276. package/es/components/organism/TextEditor/utils/htmlProcessing.js +60 -0
  277. package/es/components/organism/TextEditor/utils/link.d.ts +10 -1
  278. package/es/components/organism/TextEditor/utils/link.js +161 -7
  279. package/es/components/organism/TextEditor/utils/menu.js +2 -1
  280. package/es/components/organism/TextEditor/utils/selection.js +3 -2
  281. package/es/components/organism/TextEditor/utils/smartTag.js +2 -1
  282. package/es/components/organism/index.d.ts +3 -1
  283. package/es/components/organism/index.js +1 -0
  284. package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
  285. package/es/hooks/index.d.ts +1 -1
  286. package/es/hooks/index.js +1 -1
  287. package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
  288. package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
  289. package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
  290. package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
  291. package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
  292. package/es/utils/common.d.ts +1 -1
  293. package/es/utils/common.js +3 -3
  294. package/es/utils/cookie.js +2 -1
  295. package/es/utils/crossSubdomainCookieOptions.d.ts +14 -0
  296. package/es/utils/crossSubdomainCookieOptions.js +12 -0
  297. package/package.json +26 -30
  298. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +0 -1
  299. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +0 -1
  300. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
  301. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +0 -1
  302. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -39
@@ -1,9 +1,55 @@
1
1
  // Libraries
2
2
  import styled from 'styled-components';
3
+ import { Select as AntdSelect } from 'antd';
3
4
  // Components
4
5
  import { Tag } from '../../atoms/Tag';
5
6
  // Constants
6
7
  import { THEME } from '../../../constants';
8
+ export const StyledSelect = styled(AntdSelect) `
9
+ &.antsomi-select-single {
10
+ min-height: 34px;
11
+ }
12
+
13
+ &.antsomi-select-multiple .antsomi-select-selector {
14
+ min-height: 34px;
15
+ }
16
+
17
+ &.antsomi-select-multiple:has(.antsomi-select-selection-overflow-item-rest) {
18
+ .antsomi-select-selection-overflow {
19
+ gap: 0;
20
+ flex-wrap: nowrap;
21
+ }
22
+
23
+ .antsomi-select-selection-overflow-item:not(.antsomi-select-selection-overflow-item-suffix) {
24
+ padding-right: 5px;
25
+ }
26
+
27
+ .antsomi-select-selection-overflow-item-rest .antsomi-select-selection-item {
28
+ height: auto;
29
+ margin: 0;
30
+ padding: 3px 10px;
31
+ border: 0;
32
+ border-radius: 15px;
33
+ background: ${THEME.token?.blue2};
34
+ font-size: ${THEME.token?.fontSize}px;
35
+ line-height: 1.8;
36
+ }
37
+
38
+ .antsomi-select-selection-overflow-item-rest .antsomi-select-selection-item-content {
39
+ margin: 0;
40
+ }
41
+
42
+ .antsomi-select-selection-overflow-item-suffix {
43
+ max-width: calc(100% - 80px);
44
+ }
45
+
46
+ .antsomi-select-selection-search,
47
+ .antsomi-select-selection-search-input {
48
+ min-width: 0;
49
+ max-width: 100%;
50
+ }
51
+ }
52
+ `;
7
53
  export const StyledTag = styled(Tag) `
8
54
  position: relative;
9
55
  background-color: ${THEME.token?.blue2} !important;
@@ -14,6 +60,7 @@ export const StyledTag = styled(Tag) `
14
60
  font-size: ${THEME.token?.fontSize}px !important;
15
61
 
16
62
  .antsomi-tag-close-icon {
63
+ right: 6px !important;
17
64
  opacity: 0;
18
65
  transition: all 0.3s;
19
66
  }
@@ -25,16 +72,13 @@ export const StyledTag = styled(Tag) `
25
72
  }
26
73
  `;
27
74
  export const TagCloseBtn = styled.div `
28
- position: absolute;
29
- top: 3px;
30
- right: 3px;
31
75
  display: flex;
32
76
  align-items: center;
33
77
  justify-content: center;
34
- width: 16px;
35
- height: 16px;
78
+ width: 20px;
79
+ height: 20px;
36
80
  border-radius: 100%;
37
- border: 2.5px solid ${p => (p.borderColor ? p.borderColor : '#cae5fe')};
81
+ border: 2px solid ${p => (p.borderColor ? p.borderColor : '#cae5fe')};
38
82
  background-color: #fff;
39
83
  color: ${THEME.token?.colorPrimary};
40
84
  `;
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import { ShareAccessProps } from './types';
2
- export declare const ShareAccess: (props: ShareAccessProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const ShareAccess: React.MemoExoticComponent<(props: ShareAccessProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1,32 +1,35 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /* eslint-disable react/jsx-no-constructed-context-values */
3
- import { useReducer } from 'react';
3
+ import { memo, useReducer } from 'react';
4
+ import isEqual from 'react-fast-compare';
4
5
  import { ShareAccessDispatchContext, ShareAccessStateContext } from './context';
5
6
  import { LayoutContent } from './components';
6
7
  import { shareAccessReducer } from './reducer';
7
8
  import { updateObjAccessInfo } from './actions';
8
9
  import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks/useDeepCompareEffect';
9
- import { safeParseAccessInfo } from './utils';
10
- export const ShareAccess = (props) => {
11
- const { accessInfo, excludeUserAccess, userId, onChange, userPermission } = props;
12
- const [state, dispatch] = useReducer(shareAccessReducer(onChange), {
10
+ import { fromRaw, safeParseAccessInfo } from './utils';
11
+ export const ShareAccess = memo((props) => {
12
+ const { accessInfo, rawAccessInfo, excludeUserAccess, userId, onChange, onRawChange, userPermission, isLoading, } = props;
13
+ const [state, dispatch] = useReducer(shareAccessReducer(onChange, onRawChange), {
13
14
  modalTransferOwnership: {
14
15
  open: false,
15
16
  userToOwnerShipId: -1,
16
17
  },
17
18
  });
18
19
  useDeepCompareEffect(() => {
19
- if (!accessInfo)
20
+ const resolved = rawAccessInfo ? fromRaw(rawAccessInfo) : accessInfo;
21
+ if (!resolved)
20
22
  return;
21
23
  dispatch(updateObjAccessInfo({
22
- updated: safeParseAccessInfo(accessInfo),
24
+ updated: safeParseAccessInfo(resolved),
23
25
  triggerOut: false,
24
26
  }));
25
- }, [accessInfo]);
27
+ }, [accessInfo, rawAccessInfo]);
26
28
  return (_jsx(ShareAccessStateContext.Provider, { value: {
27
29
  ...state,
28
30
  excludeUserAccess,
29
31
  accessUserId: userId,
30
32
  accessUserPermission: userPermission,
33
+ isLoading,
31
34
  }, children: _jsx(ShareAccessDispatchContext.Provider, { value: dispatch, children: _jsx(LayoutContent, { ...props }) }) }));
32
- };
35
+ }, isEqual);
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useShareAccess } from '../../hooks';
2
3
  import { GeneralAccess } from '../GeneralAccess';
3
4
  import { ModalTransferOwnership } from '../ModalTransferOwnerShip/ModalTransferOwnerShip';
4
5
  import { PeopleAccess } from '../PeopleAccess';
5
6
  import { SearchUser } from '../SearchUser';
6
7
  import { StyledLayoutContentRoot } from './styled';
7
8
  export const LayoutContent = (props) => {
8
- const { getUserInfo, generalAccessSettings, excludeUserAccess, placeholder, allowAddUser = true, hideTransferOwnership, } = props;
9
- // const { state } = useShareAccess();
10
- // const { allowEdit, allowView } = state;
11
- // if (!allowEdit && !allowView) return null;
12
- return (_jsxs(StyledLayoutContentRoot, { children: [allowAddUser && _jsx(SearchUser, { getUserInfo: getUserInfo, placeholder: placeholder }), _jsx(PeopleAccess, { excludeUserAccess: excludeUserAccess, hideTransferOwnership: hideTransferOwnership }), _jsx(GeneralAccess, { generalAccessSettings: generalAccessSettings }), _jsx(ModalTransferOwnership, {})] }));
9
+ const { getUserInfo, generalAccessSettings, excludeUserAccess, placeholder, allowAddUser = true, hideTransferOwnership, className, } = props;
10
+ const { state } = useShareAccess();
11
+ const { isLoading } = state;
12
+ return (_jsxs(StyledLayoutContentRoot, { className: className, children: [!isLoading && allowAddUser && (_jsx(SearchUser, { getUserInfo: getUserInfo, placeholder: placeholder })), _jsx(PeopleAccess, { excludeUserAccess: excludeUserAccess, hideTransferOwnership: hideTransferOwnership }), _jsx(GeneralAccess, { generalAccessSettings: generalAccessSettings }), _jsx(ModalTransferOwnership, {})] }));
13
13
  };
@@ -19,7 +19,7 @@ const ROLE_BY_ACTIONS = {
19
19
  export const PeopleAccess = (props) => {
20
20
  const { excludeUserAccess, hideTransferOwnership } = props;
21
21
  const { state, dispatch } = useShareAccess();
22
- const { accessInfo, accessUserId, accessUserPermission } = state;
22
+ const { accessInfo, accessUserId, accessUserPermission, isLoading } = state;
23
23
  const dataSourceSorted = useMemo(() => {
24
24
  if (!Array.isArray(accessInfo?.listAccess))
25
25
  return [];
@@ -86,7 +86,7 @@ export const PeopleAccess = (props) => {
86
86
  };
87
87
  if (!accessInfo)
88
88
  return null;
89
- return (_jsxs(StyledPeopleAccessRoot, { children: [_jsx("div", { className: "title", children: "People with access" }), _jsx(List, { dataSource: dataSourceSorted, loading: { spinning: dataSourceSorted.length === 0, indicator: _jsx(Spin, {}) }, renderItem: access => {
89
+ return (_jsxs(StyledPeopleAccessRoot, { children: [_jsx("div", { className: "title", children: "People with access" }), _jsx(List, { dataSource: dataSourceSorted, loading: { spinning: !!isLoading, indicator: _jsx(Spin, {}) }, renderItem: access => {
90
90
  const actions = getActionsByUser({
91
91
  userId: accessUserId,
92
92
  updatedUserId: access.userId,
@@ -3,7 +3,8 @@ export declare const useShareAccess: () => {
3
3
  state: {
4
4
  allowEdit: boolean;
5
5
  allowView: boolean;
6
- accessInfo?: import("../types").ObjectAccessInfo | undefined;
6
+ accessInfo?: import("..").ObjectAccessInfo | undefined;
7
+ isLoading?: boolean | undefined;
7
8
  accessUserId?: number | undefined;
8
9
  accessUserPermission?: {
9
10
  view: number;
@@ -1,3 +1,4 @@
1
1
  export { ShareAccess } from './ShareAccess';
2
2
  export * as Constants from './constants';
3
3
  export * as Utils from './utils';
4
+ export type { ObjectAccessInfo, ObjectAccessInfoRaw, UserAccessInfo, UserAccessInfoRaw, ShareAccessProps, } from './types';
@@ -1,2 +1,2 @@
1
1
  import { ShareAccessAction, ShareAccessProps, ShareAccessState } from './types';
2
- export declare const shareAccessReducer: (onChange: ShareAccessProps['onChange']) => (state: ShareAccessState, action: ShareAccessAction) => ShareAccessState;
2
+ export declare const shareAccessReducer: (onChange: ShareAccessProps['onChange'], onRawChange: ShareAccessProps['onRawChange']) => (state: ShareAccessState, action: ShareAccessAction) => ShareAccessState;
@@ -1,13 +1,16 @@
1
1
  import produce from 'immer';
2
- import { mappingOutData } from './utils';
3
2
  import { TYPES } from './constants';
4
- export const shareAccessReducer = (onChange) => (state, action) => produce(state, draft => {
3
+ import { mappingOutData, toRaw } from './utils';
4
+ export const shareAccessReducer = (onChange, onRawChange) => (state, action) => produce(state, draft => {
5
5
  switch (action.type) {
6
6
  case TYPES.UPDATE_OBJECT_ACCESS_INFO: {
7
7
  const { updated, triggerOut = true } = action.payload;
8
+ // console.log({ action });
8
9
  draft.accessInfo = updated;
9
- if (onChange && triggerOut) {
10
- onChange(mappingOutData(action.payload.updated));
10
+ if (triggerOut) {
11
+ const mapped = mappingOutData(action.payload.updated);
12
+ onChange?.(mapped);
13
+ onRawChange?.(toRaw(mapped));
11
14
  }
12
15
  break;
13
16
  }
@@ -27,28 +27,50 @@ export type ObjectAccessInfo = {
27
27
  ownerId: number;
28
28
  listAccess: UserAccessInfo[];
29
29
  };
30
+ export type UserAccessInfoRaw = {
31
+ user_id: number;
32
+ role: number;
33
+ allow_view: number;
34
+ allow_edit: number;
35
+ allow_comment: number;
36
+ full_name?: string;
37
+ email?: string;
38
+ avatar?: string;
39
+ [key: string]: any;
40
+ };
41
+ export type ObjectAccessInfoRaw = {
42
+ is_public: number;
43
+ public_role: number | null;
44
+ owner_id?: number;
45
+ list_access: UserAccessInfoRaw[];
46
+ };
30
47
  export type ActionKey = (typeof PEOPLE_ACTION_KEYS)[keyof typeof PEOPLE_ACTION_KEYS];
31
48
  export type ExcludeUserAccess = Array<ActionKey>;
32
49
  export type GeneralAccessSettings = {
33
50
  publicOnlyWith?: boolean;
34
51
  };
35
52
  export type ShareAccessProps = {
53
+ className?: string;
36
54
  userId?: number;
37
55
  userPermission?: {
38
56
  edit: number;
39
57
  view: number;
40
58
  };
41
59
  accessInfo?: ObjectAccessInfo;
60
+ isLoading?: boolean;
42
61
  allowAddUser?: boolean;
43
62
  placeholder?: string;
44
63
  excludeUserAccess?: ExcludeUserAccess;
45
64
  getUserInfo?(search: string, signal: AbortSignal): Promise<UserInfo[]> | UserInfo[];
46
65
  generalAccessSettings?: GeneralAccessSettings;
47
66
  onChange?: (accessInfo: ObjectAccessInfo) => void;
67
+ rawAccessInfo?: ObjectAccessInfoRaw;
68
+ onRawChange?: (raw: ObjectAccessInfoRaw) => void;
48
69
  hideTransferOwnership?: boolean;
49
70
  };
50
71
  export type ShareAccessState = {
51
72
  accessInfo?: ObjectAccessInfo;
73
+ isLoading?: boolean;
52
74
  accessUserId?: number;
53
75
  accessUserPermission?: {
54
76
  view: number;
@@ -1,4 +1,4 @@
1
- import { ActionKey, ObjectAccessInfo, UserAccessInfo, UserInfo } from './types';
1
+ import { ActionKey, ObjectAccessInfo, ObjectAccessInfoRaw, UserAccessInfo, UserInfo } from './types';
2
2
  export declare const mergePermission: (objectPermissionAllow: boolean, menuPermissionValue: number) => boolean;
3
3
  export declare const composeObjectMenuPermissions: (params: {
4
4
  isPublic: boolean;
@@ -54,6 +54,8 @@ export declare const safeParseAccessInfo: (accessInfo: ObjectAccessInfo) => {
54
54
  isPublic: number;
55
55
  publicRole: number | null;
56
56
  };
57
+ export declare const fromRaw: (raw: ObjectAccessInfoRaw) => ObjectAccessInfo;
58
+ export declare const toRaw: (info: ObjectAccessInfo) => ObjectAccessInfoRaw;
57
59
  export declare const mappingOutData: (shareAccess: ObjectAccessInfo) => {
58
60
  isPublic: number;
59
61
  publicRole: number | null;
@@ -1,5 +1,5 @@
1
1
  import { MENU_PERMISSION, PEOPLE_ACTIONS, PEOPLE_ACTION_KEYS, PUBLIC_ROLE, REGEX_REMOVE_NAME, ROLE_ACCESS_LABEL, ROLE_MAPPING, } from './constants';
2
- import { remove } from 'lodash';
2
+ import { remove, mapKeys, camelCase, snakeCase } from 'lodash';
3
3
  import { snakeCaseToCamelCase } from '@antscorp/antsomi-ui/es/utils';
4
4
  export const mergePermission = (objectPermissionAllow, menuPermissionValue) => {
5
5
  const valueMapping = {
@@ -87,9 +87,42 @@ export const safeParseAccessInfo = (accessInfo) => {
87
87
  return {
88
88
  ...accessInfo,
89
89
  ownerId: +(ownerId || -1),
90
- listAccess: accessInfo?.listAccess?.map(user => ({ ...user, userId: +user.userId })),
90
+ listAccess: accessInfo?.listAccess?.map(user => ({
91
+ ...user,
92
+ userId: +user.userId,
93
+ role: +user.role,
94
+ allowView: +user.allowView,
95
+ allowEdit: +user.allowEdit,
96
+ allowComment: +user.allowComment,
97
+ })),
91
98
  };
92
99
  };
100
+ export const fromRaw = (raw) => ({
101
+ isPublic: raw.is_public,
102
+ publicRole: raw.public_role,
103
+ ownerId: raw.owner_id ?? -1,
104
+ listAccess: raw.list_access.map(u => ({
105
+ ...mapKeys(u, (_v, key) => camelCase(key)),
106
+ userId: u.user_id,
107
+ role: u.role,
108
+ allowView: u.allow_view,
109
+ allowEdit: u.allow_edit,
110
+ allowComment: u.allow_comment,
111
+ })),
112
+ });
113
+ export const toRaw = (info) => ({
114
+ is_public: info.isPublic,
115
+ public_role: info.publicRole,
116
+ owner_id: info.ownerId,
117
+ list_access: info.listAccess.map(u => ({
118
+ ...mapKeys(u, (_v, key) => snakeCase(key)),
119
+ user_id: u.userId,
120
+ role: u.role,
121
+ allow_view: u.allowView,
122
+ allow_edit: u.allowEdit,
123
+ allow_comment: u.allowComment,
124
+ })),
125
+ });
93
126
  export const mappingOutData = (shareAccess) => {
94
127
  const result = { ...shareAccess };
95
128
  result.listAccess = result.listAccess.map(accessInfo => {
@@ -17,7 +17,7 @@ import '@yaireo/tagify/dist/tagify.css';
17
17
  // Styled
18
18
  import { TagTextArea, TagifyWrapper, WrapperPlaceHolder } from './styled';
19
19
  // Utils
20
- import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, } from './utils';
20
+ import { parseTagStringToTagify, convertInputStringToOriginal, emojiManufacturer, getEmojiTag, isPersonalizeTagType, generateTagContent, unescapeString, hasLineBreak, selectRange, isTagClickable, findURLInTextNodes, getAttributesString, isAnchorNodeChildOfElement, isShortLinkTagType, isCustomTagType, sanitizeTagAttributes, getTagAttributes, applyTagAttributes, getTagContentAttributes, isCaretAtEndOfTextNodeWithNextTag, getCurrentSelectionAndCloneRange, handleEnterWithNextTag, handleTextNodeBackspace, extractTagValues, preventUndoRedo, } from './utils';
21
21
  import { acceptablePatternChecking, detectURLRegex, getCachedRegex, getCustomTagId, getPersonalizeTagInfo, getShortLinkTagInfo, patternHandlers, } from './patternHandlers';
22
22
  // Constants
23
23
  import { DETECT_LINK, EMOJI, PERSONALIZE_PTN, SHORT_LINK, SHORT_LINK_PTN, SHORT_LINK_V2, TAG_TYPE, UNSUBSCRIBE_WHATSAPP, defaultCssVariables, tagifyDefaultProps, TAG_CUSTOM_ATTRIBUTES, } from './constants';
@@ -25,7 +25,7 @@ const { CUSTOM_TAG } = TAG_TYPE;
25
25
  const { PREPARING_ST, INVALID_TAG, MESSAGE_TAG, FORCE_SHOW_TOOLTIP } = TAG_CUSTOM_ATTRIBUTES;
26
26
  const TagifyInput = forwardRef((props, ref) => {
27
27
  // Props
28
- const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, readonlyWhenNotEmpty, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, onTagClick, onTagRemove, onChange, onRestoreTagProperty, onBlur, } = props;
28
+ const { initialValue, escapeHTML, status, readonly, readonlyTag, readonlyText, realtime, disabled, maxLength, maxHeight, minWidth, placeholder, minWidthPlaceholder, isSingleLineText, acceptableTagPattern, tagProperties, mapAttributes = {}, mapErrorAttributes = {}, maxPersonalizeTags, name, children, cssTagifyVariables, disableEditableIfContainsTags, onTagClick, onAddTag, onTagRemove, onChange, onRestoreTagProperty, onBlur, } = props;
29
29
  // States
30
30
  const [isLineBreak, setIsLineBreak] = useState(hasLineBreak(initialValue));
31
31
  const [tooltipRefresher, setTooltipRefresher] = useState(1);
@@ -456,6 +456,7 @@ const TagifyInput = forwardRef((props, ref) => {
456
456
  }
457
457
  setLabelTagRefreshness(prev => prev + 1);
458
458
  },
459
+ getInputValues: () => extractTagValues(tagifyRef.current),
459
460
  }), [acceptableTagPattern, escapeHTML, onInjectTagAtCaret, placeCaretAfterNode]);
460
461
  const onTagItemClick = useCallback((event) => {
461
462
  event.stopPropagation();
@@ -471,7 +472,7 @@ const TagifyInput = forwardRef((props, ref) => {
471
472
  }, [onTagClick]);
472
473
  const onTagifyRemoveTag = useCallback((event) => {
473
474
  if (event.detail && onTagRemove) {
474
- onTagRemove(event.detail);
475
+ onTagRemove(event.detail, extractTagValues(event.detail.tagify));
475
476
  }
476
477
  }, [onTagRemove]);
477
478
  // Used to trigger replace URL detection and line break
@@ -767,27 +768,6 @@ const TagifyInput = forwardRef((props, ref) => {
767
768
  });
768
769
  }
769
770
  }, [maxLength, customizeTag]);
770
- useEffect(() => {
771
- if (!tagifyRef.current)
772
- return;
773
- // Skip if neither readonlyText nor readonlyWhenNotEmpty is defined
774
- if (typeof readonlyText === 'undefined' && !readonlyWhenNotEmpty)
775
- return;
776
- const inputEl = tagifyRef.current.DOM.input;
777
- // readonlyWhenNotEmpty takes priority if both are set
778
- if (readonlyWhenNotEmpty) {
779
- const cleanValue = tagifyRef.current.getInputValue();
780
- const hasContent = cleanValue.length > 0;
781
- inputEl.setAttribute('contenteditable', hasContent ? 'false' : 'true');
782
- }
783
- else if (typeof readonlyText === 'function') {
784
- const isReadonlyText = readonlyText(tagifyRef.current.getCleanValue());
785
- inputEl.setAttribute('contenteditable', isReadonlyText ? 'false' : 'true');
786
- }
787
- else if (typeof readonlyText !== 'undefined') {
788
- inputEl.setAttribute('contenteditable', readonlyText ? 'false' : 'true');
789
- }
790
- }, [readonlyText, readonlyWhenNotEmpty, tagLength]);
791
771
  const onTagifyWrapperClick = useCallback(event => {
792
772
  event.preventDefault();
793
773
  event.stopPropagation();
@@ -799,6 +779,22 @@ const TagifyInput = forwardRef((props, ref) => {
799
779
  return;
800
780
  const { classList } = DOM?.scope;
801
781
  const { classNames } = settings;
782
+ if (disableEditableIfContainsTags) {
783
+ // Empty input is always editable
784
+ const isEmpty = classList.contains(classNames.empty);
785
+ let shouldBeEditable = isEmpty;
786
+ // If not empty, check if input contains restricted tags
787
+ if (!isEmpty) {
788
+ const { listTags } = extractTagValues(tagifyRef.current);
789
+ const hasRestrictedTag = listTags.some(tag => disableEditableIfContainsTags.includes(tag.type));
790
+ shouldBeEditable = !hasRestrictedTag;
791
+ }
792
+ // Apply contenteditable attribute
793
+ DOM.input.setAttribute('contenteditable', shouldBeEditable ? 'true' : 'false');
794
+ // Exit early if input should not be editable
795
+ if (!shouldBeEditable)
796
+ return;
797
+ }
802
798
  if (!classList.contains(classNames.focus) && DOM?.input) {
803
799
  try {
804
800
  const { lastChild } = DOM?.input;
@@ -834,6 +830,12 @@ const TagifyInput = forwardRef((props, ref) => {
834
830
  }
835
831
  }
836
832
  }
833
+ }, [disableEditableIfContainsTags]);
834
+ const onContentEditable = useCallback((editable) => {
835
+ if (!tagifyRef.current)
836
+ return;
837
+ const inputEl = tagifyRef.current.DOM.input;
838
+ inputEl.setAttribute('contenteditable', editable ? 'true' : 'false');
837
839
  }, []);
838
840
  // Initialization tagify
839
841
  useLayoutEffect(() => {
@@ -845,7 +847,12 @@ const TagifyInput = forwardRef((props, ref) => {
845
847
  };
846
848
  }, [initializeTagify]);
847
849
  useEffect(() => {
848
- if (tagifyRef.current && tagLength && _.isFunction(onTagRemove)) {
850
+ if (typeof readonlyText !== 'boolean')
851
+ return;
852
+ onContentEditable(!readonlyText);
853
+ }, [readonlyText, onContentEditable]);
854
+ useEffect(() => {
855
+ if (tagifyRef.current && typeof tagLength === 'number' && _.isFunction(onTagRemove)) {
849
856
  // Because the remove tag event is not triggered when the tag is removed with Backspace or drag selection tags
850
857
  // we need to listen to the input element to detect when a tag is removed
851
858
  let mutationQueue = [];
@@ -874,8 +881,11 @@ const TagifyInput = forwardRef((props, ref) => {
874
881
  try {
875
882
  node.dataset.__removed_by_mutation = 'true';
876
883
  const tagData = tagifyRef.current?.getSetTagData(node);
877
- if (tagData && tagData.type === CUSTOM_TAG && !tagData?.__removed) {
878
- onTagRemove({ data: tagData });
884
+ if (tagifyRef.current &&
885
+ tagData &&
886
+ tagData.type === CUSTOM_TAG &&
887
+ !tagData?.__removed) {
888
+ onTagRemove({ data: tagData }, extractTagValues(tagifyRef.current));
879
889
  }
880
890
  }
881
891
  catch (error) {
@@ -987,8 +997,13 @@ const TagifyInput = forwardRef((props, ref) => {
987
997
  tagifyInstance.on('change', onTagifyChangedDebounce);
988
998
  tagifyInstance.on('remove', onTagifyRemoveTag);
989
999
  tagifyInstance.on('keydown', onKeyDown);
1000
+ if (onAddTag)
1001
+ tagifyInstance.on('add', onAddTag);
990
1002
  if (onBlur)
991
1003
  tagifyInstance.on('blur', onBlur);
1004
+ if (tagifyInstance.DOM.input) {
1005
+ tagifyInstance.DOM.input.addEventListener('keydown', preventUndoRedo);
1006
+ }
992
1007
  }
993
1008
  // Off listen to Tagify events
994
1009
  return () => {
@@ -998,11 +1013,17 @@ const TagifyInput = forwardRef((props, ref) => {
998
1013
  tagifyInstance.off('change', onTagifyChangedDebounce);
999
1014
  tagifyInstance.off('remove', onTagifyRemoveTag);
1000
1015
  tagifyInstance.off('keydown', onKeyDown);
1016
+ if (onAddTag)
1017
+ tagifyInstance.off('add', onAddTag);
1001
1018
  if (onBlur)
1002
1019
  tagifyInstance.off('blur', onBlur);
1020
+ if (tagifyInstance.DOM.input) {
1021
+ tagifyInstance.DOM.input.removeEventListener('keydown', preventUndoRedo);
1022
+ }
1003
1023
  }
1004
1024
  };
1005
1025
  }, [
1026
+ onAddTag,
1006
1027
  onBlur,
1007
1028
  onTagItemClick,
1008
1029
  onInputTagifyDebounce,
@@ -15,6 +15,10 @@ export type TagStatus = (typeof TAG_STATUS)[keyof typeof TAG_STATUS];
15
15
  export type MapAttributesProps = Record<string, Record<string, any>>;
16
16
  export type StatusType = 'error' | 'success' | 'warning';
17
17
  export type BackgroundColorPersonalizeType = Exclude<keyof typeof TAG_COLOR, 'detect_link' | 'emoji' | 'shortlink'>;
18
+ export interface TagValues {
19
+ listTags: TagDataCustomize[];
20
+ value: string;
21
+ }
18
22
  /**
19
23
  * Interface defining the properties for the Tagify input component.
20
24
  * Provides configuration options and event handlers to manage Tagify's behavior and appearance.
@@ -134,11 +138,16 @@ export interface TagifyInputProps {
134
138
  * Receives the tag detail as parameter, allowing custom actions on tag click.
135
139
  */
136
140
  onTagClick?: (tagDetail: Tagify.ClickEventData<TagDataCustomize>) => void;
141
+ /**
142
+ * Event handler triggered when a tag is added.
143
+ * Receives the tag detail as parameter, allowing custom actions on tag addition.
144
+ */
145
+ onAddTag?: (event: CustomEvent<Tagify.AddEventData<TagDataCustomize>>) => void;
137
146
  /**
138
147
  * Event handler triggered when a tag is removed.
139
148
  * Receives the tag detail as parameter, allowing custom actions on tag removal.
140
149
  */
141
- onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize>) => void;
150
+ onTagRemove?: (tagDetail: Tagify.RemoveEventData<TagDataCustomize>, values: TagValues) => void;
142
151
  /**
143
152
  * Event handler triggered when the input value changes.
144
153
  * Receives the updated input value as a string, allowing for controlled component updates.
@@ -159,21 +168,18 @@ export interface TagifyInputProps {
159
168
  /**
160
169
  * Defines whether the input text is read but not the whole tags.
161
170
  */
162
- readonlyText?: boolean | ((listTags: TagDataCustomize[]) => boolean);
171
+ readonlyText?: boolean;
163
172
  /**
164
- * When true, automatically sets the input text to readonly (contenteditable='false')
165
- * when the input is not empty (has tags or content).
166
- * This is a convenience prop that internally uses readonlyText callback.
167
- *
168
- * @default false
173
+ * Tags that, when present in input, make the entire input non-editable
169
174
  */
170
- readonlyWhenNotEmpty?: boolean;
175
+ disableEditableIfContainsTags?: TagType[];
171
176
  }
172
177
  export interface TagifyInputRef {
173
178
  onAddNewTag: (newTag: TagDataCustomize | string) => void;
174
179
  onReplaceTag: (currentTagEle: HTMLElement, newTag: TagDataCustomize) => void;
175
180
  onReload: (newValue: string) => void;
176
181
  onLabelTagRefreshness: () => void;
182
+ getInputValues: () => TagValues;
177
183
  }
178
184
  export type EmojiCollection = (typeof EMOJI_COLLECTIONS)[keyof typeof EMOJI_COLLECTIONS];
179
185
  export type ShortLinkType = (typeof SHORT_LINK_TYPE)[keyof typeof SHORT_LINK_TYPE];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="yaireo__tagify" />
2
2
  import Tagify from '@yaireo/tagify';
3
- import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType } from './types';
3
+ import { AcceptablePattern, TagAttribute, EmojiCollection, EmojiTag, TagDataCustomize, TagProperty, TagType, TagValues } from './types';
4
4
  /**
5
5
  * Parses the input string and replaces matching patterns with processed tags.
6
6
  * This function iterates over predefined regex patterns and replaces each match
@@ -202,3 +202,8 @@ export declare const getCurrentSelectionAndCloneRange: () => {
202
202
  };
203
203
  export declare const handleTextNodeBackspace: (range: Range) => void;
204
204
  export declare const handleEnterWithNextTag: (range: Range) => void;
205
+ export declare const removeInvisibleChars: (str: string) => string;
206
+ export declare const extractTagValues: (tagify: Tagify<TagDataCustomize>) => TagValues;
207
+ export declare function preventUndoRedo(e: CustomEvent<Tagify.KeydownEventData<TagDataCustomize>>['detail']['event'], { disableRedo }?: {
208
+ disableRedo?: boolean | undefined;
209
+ }): void;
@@ -796,3 +796,22 @@ export const handleEnterWithNextTag = (range) => {
796
796
  return;
797
797
  insertZeroWidthSpaceBeforeTag(currentNode);
798
798
  };
799
+ export const removeInvisibleChars = (str) => str.replace(/[\r\n\u200B-\u200D\uFEFF]/g, '');
800
+ export const extractTagValues = (tagify) => {
801
+ if (!tagify)
802
+ return { listTags: [], value: '' };
803
+ return {
804
+ listTags: tagify.getCleanValue(),
805
+ value: tagify.getInputValue(),
806
+ };
807
+ };
808
+ export function preventUndoRedo(e, { disableRedo = false } = {}) {
809
+ const key = e.key.toLowerCase();
810
+ const isUndo = (e.ctrlKey || e.metaKey) && key === 'z';
811
+ const isRedo = (disableRedo && (e.ctrlKey || e.metaKey) && key === 'y') ||
812
+ ((e.ctrlKey || e.metaKey) && e.shiftKey && key === 'z');
813
+ if (isUndo || isRedo) {
814
+ e.preventDefault();
815
+ e.stopPropagation();
816
+ }
817
+ }
@@ -8,6 +8,7 @@ export declare const VirtualizedMenu: React.ForwardRefExoticComponent<Partial<{
8
8
  className: string;
9
9
  itemSize: number;
10
10
  selected: string | string[];
11
+ focusedKey: string;
11
12
  expanded: string[];
12
13
  onClick: (args: {
13
14
  item: import("./types").ItemType;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo, useMemo, useRef, useEffect, useCallback } from 'react';
2
+ import { memo, useMemo, useRef, useCallback } from 'react';
3
3
  import { Typography } from '../../../../atoms/Typography';
4
4
  import { MenuItemRoot } from '../../styled';
5
5
  import clsx from 'clsx';
@@ -69,11 +69,7 @@ export const Item = memo((props) => {
69
69
  }, [item.id, normalizeTreeItems, selectedKeys]);
70
70
  const className = clsx(itemClassName, {
71
71
  [CLS.Item.selectedDescendant]: isSelectedDescendant,
72
+ [CLS.Item.focused]: isFocused,
72
73
  });
73
- useEffect(() => {
74
- if (isFocused) {
75
- itemRef.current?.focus({ preventScroll: true });
76
- }
77
- }, [isFocused]);
78
- return (_jsxs(MenuItemRoot, { ref: handleItemRef, role: displayOnly ? 'none' : 'treeitem', tabIndex: displayOnly ? -1 : isFocused ? 0 : -1, "aria-selected": displayOnly ? undefined : selected, "aria-disabled": displayOnly ? undefined : disabled, "aria-expanded": displayOnly ? undefined : expanded, "aria-level": displayOnly ? undefined : item.level, "aria-posinset": displayOnly ? undefined : index + 1, "aria-setsize": displayOnly ? undefined : items.length, className: className, style: itemStyle, onClick: e => handleOnClick(e, 'item'), children: [_jsx("div", { className: CLS.ItemLabel.default, children: labelContent }), actionContent] }));
74
+ return (_jsxs(MenuItemRoot, { "data-selected": !!selected, "data-focused": isFocused, ref: handleItemRef, role: displayOnly ? 'none' : 'treeitem', "aria-selected": displayOnly ? undefined : selected, "aria-disabled": displayOnly ? undefined : disabled, "aria-expanded": displayOnly ? undefined : expanded, "aria-level": displayOnly ? undefined : item.level, "aria-posinset": displayOnly ? undefined : index + 1, "aria-setsize": displayOnly ? undefined : items.length, className: className, style: itemStyle, onClick: e => handleOnClick(e, 'item'), children: [_jsx("div", { className: CLS.ItemLabel.default, children: labelContent }), actionContent] }));
79
75
  }, areEqual);