@rpcbase/client 0.227.0 → 0.231.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/package.json +11 -113
  2. package/src/apiClient/getServerApiClient.ts +131 -0
  3. package/src/apiClient/index.ts +86 -0
  4. package/src/index.ts +3 -0
  5. package/src/initClient.ts +32 -0
  6. package/src/types.ts +7 -0
  7. package/AppProvider/AnalyticsContainer.js +0 -56
  8. package/AppProvider/debug.js +0 -4
  9. package/AppProvider/index.tsx +0 -79
  10. package/access-control/ACLForm/components/GrantField/OpSelector.tsx +0 -129
  11. package/access-control/ACLForm/components/GrantField/ResourceSelector.tsx +0 -86
  12. package/access-control/ACLForm/components/GrantField/UsersSelector.tsx +0 -96
  13. package/access-control/ACLForm/components/GrantField/grant-field.scss +0 -26
  14. package/access-control/ACLForm/components/GrantField/icons/CheckMark.tsx +0 -16
  15. package/access-control/ACLForm/components/GrantField/icons/CollapseArrow.tsx +0 -14
  16. package/access-control/ACLForm/components/GrantField/icons/ExpandArrow.tsx +0 -14
  17. package/access-control/ACLForm/components/GrantField/index.tsx +0 -91
  18. package/access-control/ACLForm/components/GrantsList.tsx +0 -48
  19. package/access-control/ACLForm/components/RoleForm.tsx +0 -134
  20. package/access-control/ACLForm/components/RoleView.tsx +0 -115
  21. package/access-control/ACLForm/components/RolesList.tsx +0 -79
  22. package/access-control/ACLForm/components/constants.tsx +0 -1
  23. package/access-control/ACLForm/components/resolver.ts +0 -57
  24. package/access-control/ACLForm/components/role-form.scss +0 -19
  25. package/access-control/ACLForm/index.tsx +0 -48
  26. package/access-control/ACLModal/acl-modal.scss +0 -7
  27. package/access-control/ACLModal/index.tsx +0 -66
  28. package/access-control/PolicyEditor/TargetSelector/QueryBuilder.tsx +0 -48
  29. package/access-control/PolicyEditor/TargetSelector/index.tsx +0 -5
  30. package/access-control/PolicyEditor/TargetSelector/query-builder.scss +0 -9
  31. package/access-control/PolicyEditor/index.tsx +0 -165
  32. package/access-control/index.ts +0 -3
  33. package/apiClient.js +0 -15
  34. package/auth/authProps.js +0 -8
  35. package/auth/components/AccountsList/AccountListItem.js +0 -61
  36. package/auth/components/AccountsList/account-list-item.scss +0 -5
  37. package/auth/components/AccountsList/index.js +0 -17
  38. package/auth/components/Footer/index.js +0 -11
  39. package/auth/components/ForgotPassword/forgot-password.scss +0 -37
  40. package/auth/components/ForgotPassword/index.js +0 -114
  41. package/auth/components/SetNewPassword/index.js +0 -130
  42. package/auth/components/SetNewPassword/set-new-password.scss +0 -47
  43. package/auth/components/SignIn/SignInEmailForm.tsx +0 -115
  44. package/auth/components/SignIn/index.js +0 -69
  45. package/auth/components/SignIn/sign-in.scss +0 -56
  46. package/auth/components/SignOut/index.js +0 -144
  47. package/auth/components/SignOut/sign-out.scss +0 -34
  48. package/auth/components/SignUp/SignUpEmailForm.tsx +0 -98
  49. package/auth/components/SignUp/index.js +0 -66
  50. package/auth/components/SignUp/sign-up.scss +0 -56
  51. package/auth/getTenantId.js +0 -12
  52. package/auth/getUid.js +0 -11
  53. package/auth/helpers/redirectSignIn.native.js +0 -9
  54. package/auth/helpers/redirectSignIn.web.js +0 -7
  55. package/auth/index.js +0 -146
  56. package/auth/signOut.js +0 -20
  57. package/auth/useAuthRouter.js +0 -56
  58. package/env.d.ts +0 -3
  59. package/firebase/index.js +0 -1
  60. package/firebase/sw.js +0 -1
  61. package/form/FileInput/FileUploadContext.tsx +0 -162
  62. package/form/FileInput/FileUploadForm/index.tsx +0 -139
  63. package/form/FileInput/FileUploadForm/usePreventUnload.js +0 -21
  64. package/form/FileInput/UploadButton.tsx +0 -23
  65. package/form/FileInput/constants.ts +0 -16
  66. package/form/FileInput/file-input.scss +0 -1
  67. package/form/FileInput/index.tsx +0 -21
  68. package/form/FileInput/upload-worker/get_file_hash.js +0 -63
  69. package/form/FileInput/upload-worker/index.js +0 -16
  70. package/form/FileInput/upload-worker/no_compress_exts.ts +0 -33
  71. package/form/FileInput/upload-worker/upload_file.js +0 -129
  72. package/form/Form.tsx +0 -23
  73. package/form/Input.tsx +0 -62
  74. package/form/SubmitButton/index.tsx +0 -58
  75. package/form/hook-form.tsx +0 -7
  76. package/form/index.tsx +0 -5
  77. package/getBaseUrl.js +0 -14
  78. package/getObjectId.ts +0 -31
  79. package/hashState.js +0 -158
  80. package/helpers/createBatcher/index.js +0 -36
  81. package/helpers/getInitials.js +0 -39
  82. package/helpers/onReady.js +0 -15
  83. package/helpers/post.js +0 -18
  84. package/helpers/postRPC.js +0 -42
  85. package/helpers/useRPC.js +0 -41
  86. package/helpers/useStoredValue/batchedGetStoredValues.js +0 -30
  87. package/helpers/useStoredValue/index.js +0 -107
  88. package/helpers/useStoredValue/setStoredValues.js +0 -14
  89. package/i18n/en/rb.nav.json +0 -13
  90. package/i18n/en/rb.sign_in.json +0 -11
  91. package/i18n/en/rb.sign_out.json +0 -5
  92. package/i18n/fr/rb.sign_in.json +0 -11
  93. package/i18n/fr/rb.sign_out.json +0 -5
  94. package/i18n/index.js +0 -63
  95. package/index.js +0 -6
  96. package/isEqualValues.js +0 -47
  97. package/jest.config.js +0 -16
  98. package/notifications/Notification/index.js +0 -36
  99. package/notifications/Notification/notification.scss +0 -1
  100. package/notifications/NotificationItem/HeaderStatus.js +0 -93
  101. package/notifications/NotificationItem/index.js +0 -65
  102. package/notifications/NotificationItem/notification-item.scss +0 -25
  103. package/notifications/NotificationsContainer/index.js +0 -37
  104. package/notifications/NotificationsContainer/notifications-container.scss +0 -38
  105. package/notifications/NotificationsContainer/useLLTs.js +0 -28
  106. package/notifications/NotificationsContext/index.js +0 -71
  107. package/notifications/NotificationsContext/useNotificationsList.js +0 -75
  108. package/notifications/NotificationsSettingsModal/SettingsForm.js +0 -52
  109. package/notifications/NotificationsSettingsModal/index.js +0 -48
  110. package/notifications/NotificationsSettingsModal/notifications-settings.scss +0 -1
  111. package/notifications/config.js +0 -1
  112. package/notifications/index.js +0 -4
  113. package/page.js +0 -9
  114. package/publish-output.txt +0 -0
  115. package/rpc.js +0 -32
  116. package/rr-trace/get_fingerprint.js +0 -10
  117. package/rr-trace/get_perf_vitals.js +0 -24
  118. package/rr-trace/get_session_id.js +0 -29
  119. package/rr-trace/index.js +0 -138
  120. package/rr-trace/write_session_data.js +0 -86
  121. package/rts/boot.js +0 -3
  122. package/rts/getUseDocument.js +0 -21
  123. package/rts/getUseQuery/index.js +0 -233
  124. package/rts/getUseQuery/useData.js +0 -55
  125. package/rts/index.js +0 -10
  126. package/rts/rts.js +0 -243
  127. package/rts/signout.ts +0 -8
  128. package/rts/store/constants.js +0 -3
  129. package/rts/store/debug.js +0 -24
  130. package/rts/store/get_collection.js +0 -55
  131. package/rts/store/index.js +0 -100
  132. package/rts/store/replace_query_keys.js +0 -30
  133. package/rts/store/satisfies_projection.js +0 -32
  134. package/rts/store/update_docs.js +0 -47
  135. package/storage/index.jest.js +0 -15
  136. package/storage/index.native.js +0 -38
  137. package/storage/index.web.js +0 -25
  138. package/types.ts +0 -6
  139. package/ui/ActivityIndicator/index.js +0 -113
  140. package/ui/Avatar/index.native.js +0 -31
  141. package/ui/Avatar/index.web.js +0 -37
  142. package/ui/Avatar/styles.js +0 -41
  143. package/ui/ErrorBoundary/index.js +0 -12
  144. package/ui/ExpandableFloatView/exp.scss +0 -15
  145. package/ui/ExpandableFloatView/index.tsx +0 -123
  146. package/ui/ExpandableFloatView/useBackdrop.js +0 -45
  147. package/ui/LottiePlayer/LottiePlayer.js +0 -4
  148. package/ui/LottiePlayer/index.js +0 -8
  149. package/ui/Modal/HashStateModal.js +0 -30
  150. package/ui/Modal/Modal.js +0 -93
  151. package/ui/Modal/ModalForm/AlertBanner.js +0 -82
  152. package/ui/Modal/ModalForm/index.js +0 -188
  153. package/ui/Modal/ModalForm/modal-form.scss +0 -63
  154. package/ui/Modal/index.js +0 -10
  155. package/ui/Modal/modal.scss +0 -101
  156. package/ui/Modal/withHashStateModal.js +0 -24
  157. package/ui/RedboxError/index.js +0 -3
  158. package/ui/Search/SearchHistory/index.js +0 -45
  159. package/ui/Search/SearchHistory/search-history.scss +0 -9
  160. package/ui/Search/SearchHistory/useSearchHistory.tsx +0 -57
  161. package/ui/Search/SearchResults/index.tsx +0 -90
  162. package/ui/Search/index.tsx +0 -298
  163. package/ui/Search/search.scss +0 -0
  164. package/ui/SelectPills/index.tsx +0 -96
  165. package/ui/SelectPills/select-pills.scss +0 -66
  166. package/ui/Tabs/index.tsx +0 -161
  167. package/ui/Tabs/tabs.scss +0 -53
  168. package/ui/Tree/index.js +0 -257
  169. package/ui/Tree/model.js +0 -71
  170. package/ui/Tree/node.js +0 -112
  171. package/ui/Tree/tree.scss +0 -98
  172. package/ui/UserAvatar/default_colors.json +0 -82
  173. package/ui/UserAvatar/index.js +0 -55
  174. package/ui/View/index.tsx +0 -17
  175. package/ui/View/index.web.js +0 -44
  176. package/ui/animations/checkmark.json +0 -1
  177. package/ui/helpers/SizeContext/index.tsx +0 -11
  178. package/ui/helpers/helpers.scss +0 -61
  179. package/ui/helpers/index.ts +0 -6
  180. package/ui/helpers/stopEventPropagation.js +0 -5
  181. package/ui/helpers/useActiveListItemIndex/index.tsx +0 -45
  182. package/ui/helpers/useScrollSelectorIntoView/index.tsx +0 -14
  183. package/ui/helpers/useThrottledMeasure/index.js +0 -47
  184. package/ui/helpers/withSuspense/index.js +0 -37
  185. package/ui/icons/AddAccount.tsx +0 -5
  186. package/ui/icons/Billing.tsx +0 -6
  187. package/ui/icons/Close.tsx +0 -14
  188. package/ui/icons/Organization.tsx +0 -5
  189. package/ui/icons/Signout.tsx +0 -5
  190. package/ui/icons/index.tsx +0 -6
  191. package/ui/nav/AccountsDropdown/SwitchAccounts.tsx +0 -28
  192. package/ui/nav/AccountsDropdown/accounts-dropdown.scss +0 -51
  193. package/ui/nav/AccountsDropdown/index.tsx +0 -90
  194. package/ui/nav/AccountsToggle/index.tsx +0 -24
  195. package/ui/nav/ContentView/ContentViewContext.ts +0 -23
  196. package/ui/nav/ContentView/index.tsx +0 -115
  197. package/ui/nav/HeaderContainer/header.scss +0 -52
  198. package/ui/nav/HeaderContainer/index.tsx +0 -23
  199. package/ui/nav/HeaderContainer/variables.scss +0 -1
  200. package/ui/nav/MorphingDropdown/MorphingDropdownContext.tsx +0 -151
  201. package/ui/nav/MorphingDropdown/MorphingDropdownMenu.tsx +0 -38
  202. package/ui/nav/MorphingDropdown/MorphingDropdownPortal.tsx +0 -166
  203. package/ui/nav/MorphingDropdown/MorphingDropdownToggle.tsx +0 -34
  204. package/ui/nav/MorphingDropdown/index.tsx +0 -16
  205. package/ui/nav/MorphingDropdown/morphing-dropdown.scss +0 -35
  206. package/ui/nav/NotificationsDropdown/index.tsx +0 -52
  207. package/ui/nav/NotificationsDropdown/notifications-dropdown.scss +0 -5
  208. package/ui/nav/NotificationsToggle/NotificationsGlyph.tsx +0 -54
  209. package/ui/nav/NotificationsToggle/index.tsx +0 -12
  210. package/ui/nav/NotificationsToggle/notification-animation.json +0 -1
  211. package/ui/nav/NotificationsToggle/notifications-toggle.scss +0 -26
  212. package/ui/nav/SidebarContainer/index.tsx +0 -48
  213. package/ui/nav/SidebarContainer/sidebar-container.scss +0 -21
  214. package/ui/nav/SlideoutContainer/components/Body.tsx +0 -19
  215. package/ui/nav/SlideoutContainer/components/Header.tsx +0 -23
  216. package/ui/nav/SlideoutContainer/components/Wrapper.tsx +0 -46
  217. package/ui/nav/SlideoutContainer/index.tsx +0 -50
  218. package/ui/nav/SlideoutContainer/slideout-container.scss +0 -40
  219. package/ui/nav/index.ts +0 -13
  220. package/ui/oauth/GitHub.js +0 -38
  221. package/ui/oauth/getGitHubSigninUrl.js +0 -30
  222. package/ui/oauth/index.js +0 -9
  223. package/ui/oauth/oauth.scss +0 -16
  224. package/ui/sortable-hoc/AutoScroller.js +0 -76
  225. package/ui/sortable-hoc/DragHandle.js +0 -31
  226. package/ui/sortable-hoc/Manager.js +0 -54
  227. package/ui/sortable-hoc/README.md +0 -1
  228. package/ui/sortable-hoc/SortableContainer/defaultGetHelperDimensions.js +0 -7
  229. package/ui/sortable-hoc/SortableContainer/defaultShouldCancelStart.js +0 -24
  230. package/ui/sortable-hoc/SortableContainer/index.js +0 -994
  231. package/ui/sortable-hoc/SortableContainer/props.js +0 -81
  232. package/ui/sortable-hoc/SortableElement.js +0 -111
  233. package/ui/sortable-hoc/SortableHandle.js +0 -45
  234. package/ui/sortable-hoc/drag-handle.scss +0 -14
  235. package/ui/sortable-hoc/index.js +0 -9
  236. package/ui/sortable-hoc/utils.js +0 -292
  237. package/ui/springs.ts +0 -17
package/ui/nav/index.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from "./AccountsDropdown"
2
- export * from "./AccountsToggle"
3
- export * from "./ContentView"
4
- export * from "./HeaderContainer"
5
- export * from "./NotificationsDropdown"
6
- export * from "./NotificationsToggle"
7
- export * from "./SidebarContainer"
8
- export * from "./SlideoutContainer"
9
-
10
- import * as MorphingDropdown from "./MorphingDropdown"
11
-
12
-
13
- export {MorphingDropdown}
@@ -1,38 +0,0 @@
1
- /* @flow */
2
- import {useEffect, useState} from "react"
3
- import useLocation from "react-use/lib/useLocation"
4
-
5
- import getGitHubSigninUrl from "./getGitHubSigninUrl"
6
-
7
-
8
- export const GitHub = ({text, className = ""}) => {
9
- const location = useLocation()
10
-
11
- const [url, setUrl] = useState(getGitHubSigninUrl())
12
-
13
- useEffect(() => {
14
- const newUrl = getGitHubSigninUrl()
15
- setUrl(newUrl)
16
- }, [location])
17
-
18
- return (
19
- <a href={url}
20
- className={cx("sign-in-github-btn p-2 btn-lg", className)}
21
- style={{}}>
22
- <div style={{}} className="me-2">
23
- <svg height="28px" width="28px" viewBox="0 0 16 16" style={{fill: "currentColor"}}>
24
- <path fillRule={"evenodd"} d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38
25
- 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01
26
- 1.08.58 1.23.82.72 1.21 1.87.87
27
- 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12
28
- 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08
29
- 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0
30
- .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
31
- </svg>
32
- </div>
33
- <div className="">
34
- {text} with GitHub
35
- </div>
36
- </a>
37
- )
38
- }
@@ -1,30 +0,0 @@
1
- /* @flow */
2
- import {GITHUB_OAUTH_CLIENT_ID} from "env"
3
-
4
- // https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps#available-scopes
5
- const DEFAULT_SCOPES = []
6
-
7
- const getGitHubSigninUrl = () => {
8
- const params = new URLSearchParams(window.location.search)
9
- const scopes = params.get("scopes") || ""
10
- const state = params.get("state")
11
-
12
- let reqScopes = DEFAULT_SCOPES.join("")
13
- if (reqScopes && scopes) {
14
- reqScopes += `%20${scopes}`
15
- } else if (scopes) {
16
- reqScopes = scopes
17
- }
18
-
19
- let authUrl = `https://github.com/login/oauth/authorize?client_id=${GITHUB_OAUTH_CLIENT_ID}`
20
- if (reqScopes) {
21
- authUrl += `&scope=${reqScopes}`
22
- }
23
- if (state) {
24
- authUrl += `&state=${state}`
25
- }
26
-
27
- return authUrl
28
- }
29
-
30
- export default getGitHubSigninUrl
package/ui/oauth/index.js DELETED
@@ -1,9 +0,0 @@
1
- /* @flow */
2
- import {GitHub} from "./GitHub"
3
-
4
- import "./oauth.scss"
5
-
6
-
7
- export const AUTH_BUTTONS = {
8
- github: GitHub,
9
- }
@@ -1,16 +0,0 @@
1
- @import "helpers";
2
-
3
- .sign-in-github-btn {
4
- display: inline-flex;
5
- align-items: center;
6
- background-color: #24292E;
7
- font-size: 1.25rem;
8
- color: $gray-200;
9
- text-decoration: none;
10
-
11
- border-radius: $border-radius;
12
-
13
- &:hover {
14
- color: $white;
15
- }
16
- }
@@ -1,76 +0,0 @@
1
- /* @flow */
2
- export default class AutoScroller {
3
- constructor(container, onScrollCallback) {
4
- this.container = container
5
- this.onScrollCallback = onScrollCallback
6
- }
7
-
8
- clear() {
9
- if (this.interval == null) {
10
- return
11
- }
12
-
13
- clearInterval(this.interval)
14
- this.interval = null
15
- }
16
-
17
- update({translate, minTranslate, maxTranslate, width, height}) {
18
- const direction = {
19
- x: 0,
20
- y: 0,
21
- }
22
- const speed = {
23
- x: 1,
24
- y: 1,
25
- }
26
- const acceleration = {
27
- x: 10,
28
- y: 10,
29
- }
30
-
31
- const {scrollTop, scrollLeft, scrollHeight, scrollWidth, clientHeight, clientWidth} =
32
- this.container
33
-
34
- const isTop = scrollTop === 0
35
- const isBottom = scrollHeight - scrollTop - clientHeight === 0
36
- const isLeft = scrollLeft === 0
37
- const isRight = scrollWidth - scrollLeft - clientWidth === 0
38
-
39
- if (translate.y >= maxTranslate.y - height / 2 && !isBottom) {
40
- // Scroll Down
41
- direction.y = 1
42
- speed.y = acceleration.y * Math.abs((maxTranslate.y - height / 2 - translate.y) / height)
43
- } else if (translate.x >= maxTranslate.x - width / 2 && !isRight) {
44
- // Scroll Right
45
- direction.x = 1
46
- speed.x = acceleration.x * Math.abs((maxTranslate.x - width / 2 - translate.x) / width)
47
- } else if (translate.y <= minTranslate.y + height / 2 && !isTop) {
48
- // Scroll Up
49
- direction.y = -1
50
- speed.y = acceleration.y * Math.abs((translate.y - height / 2 - minTranslate.y) / height)
51
- } else if (translate.x <= minTranslate.x + width / 2 && !isLeft) {
52
- // Scroll Left
53
- direction.x = -1
54
- speed.x = acceleration.x * Math.abs((translate.x - width / 2 - minTranslate.x) / width)
55
- }
56
-
57
- if (this.interval) {
58
- this.clear()
59
- this.isAutoScrolling = false
60
- }
61
-
62
- if (direction.x !== 0 || direction.y !== 0) {
63
- this.interval = setInterval(() => {
64
- this.isAutoScrolling = true
65
- const offset = {
66
- left: speed.x * direction.x,
67
- top: speed.y * direction.y,
68
- }
69
- this.container.scrollTop += offset.top
70
- this.container.scrollLeft += offset.left
71
-
72
- this.onScrollCallback(offset)
73
- }, 5)
74
- }
75
- }
76
- }
@@ -1,31 +0,0 @@
1
- /* @flow */
2
- import SortableHandle from "./SortableHandle"
3
-
4
- import "./drag-handle.scss"
5
-
6
- const DragHandle = SortableHandle(({ref, variant = "bars", className = ""}) => {
7
- let icon
8
- if (variant === "bars") {
9
- icon = (
10
- <svg width={18} height={18} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
11
- <path
12
- fill={"currentColor"}
13
- d="M 25 0 C 24.746094 0 24.476563 0.0859375 24.28125 0.28125 L 17.28125 7.28125 C 16.996094 7.566406 16.90625 8 17.0625 8.375 C 17.21875 8.746094 17.597656 9 18 9 L 32.03125 9 C 32.582031 9 33.03125 8.550781 33.03125 8 C 33.03125 7.664063 32.847656 7.367188 32.59375 7.1875 L 25.71875 0.28125 C 25.523438 0.0859375 25.253906 0 25 0 Z M 2 13 L 2 17 L 48 17 L 48 13 Z M 2 23 L 2 27 L 48 27 L 48 23 Z M 2 33 L 2 37 L 48 37 L 48 33 Z M 18 41 C 17.597656 41 17.21875 41.25 17.0625 41.625 C 16.90625 42 16.996094 42.433594 17.28125 42.71875 L 24.28125 49.71875 C 24.476563 49.914063 24.742188 50 25 50 C 25.257813 50 25.523438 49.914063 25.71875 49.71875 L 32.71875 42.71875 C 33.003906 42.433594 33.09375 42 32.9375 41.625 C 32.785156 41.25 32.402344 41 32 41 Z"
14
- />
15
- </svg>
16
- )
17
- } else if (variant === "dots") {
18
- icon = (
19
- <svg width={18} height={18} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30">
20
- <path
21
- fill={"currentColor"}
22
- d="M 9 2 A 3 3 0 0 0 6 5 A 3 3 0 0 0 9 8 A 3 3 0 0 0 12 5 A 3 3 0 0 0 9 2 z M 21 2 A 3 3 0 0 0 18 5 A 3 3 0 0 0 21 8 A 3 3 0 0 0 24 5 A 3 3 0 0 0 21 2 z M 9 12 A 3 3 0 0 0 6 15 A 3 3 0 0 0 9 18 A 3 3 0 0 0 12 15 A 3 3 0 0 0 9 12 z M 21 12 A 3 3 0 0 0 18 15 A 3 3 0 0 0 21 18 A 3 3 0 0 0 24 15 A 3 3 0 0 0 21 12 z M 9 22 A 3 3 0 0 0 6 25 A 3 3 0 0 0 9 28 A 3 3 0 0 0 12 25 A 3 3 0 0 0 9 22 z M 21 22 A 3 3 0 0 0 18 25 A 3 3 0 0 0 21 28 A 3 3 0 0 0 24 25 A 3 3 0 0 0 21 22 z"
23
- />
24
- </svg>
25
- )
26
- } else throw new Error("DragHandle unknown variant")
27
-
28
- return <div ref={ref} className={cx("sortable-drag-handle", className)}>{icon}</div>
29
- })
30
-
31
- export default DragHandle
@@ -1,54 +0,0 @@
1
- /* @flow */
2
- export default class Manager {
3
- refs = {}
4
-
5
- add(collection, ref) {
6
- if (!this.refs[collection]) {
7
- this.refs[collection] = []
8
- }
9
-
10
- this.refs[collection].push(ref)
11
- }
12
-
13
- remove(collection, ref) {
14
- const index = this.getIndex(collection, ref)
15
-
16
- if (index !== -1) {
17
- this.refs[collection].splice(index, 1)
18
- }
19
- }
20
-
21
- isActive() {
22
- return this.active
23
- }
24
-
25
- getActive() {
26
- return this.refs[this.active.collection].find(
27
- // eslint-disable-next-line eqeqeq
28
- ({node}) => node.sortableInfo.index == this.active.index,
29
- )
30
- }
31
-
32
- getIndex(collection, ref) {
33
- return this.refs[collection].indexOf(ref)
34
- }
35
-
36
- getOrderedRefs(collection = this.active.collection) {
37
- return this.refs[collection].sort(sortByIndex)
38
- }
39
- }
40
-
41
- function sortByIndex(
42
- {
43
- node: {
44
- sortableInfo: {index: index1},
45
- },
46
- },
47
- {
48
- node: {
49
- sortableInfo: {index: index2},
50
- },
51
- },
52
- ) {
53
- return index1 - index2
54
- }
@@ -1 +0,0 @@
1
- forked from https://github.com/clauderic/react-sortable-hoc
@@ -1,7 +0,0 @@
1
- /* @flow */
2
- export default function defaultGetHelperDimensions({node}) {
3
- return {
4
- height: node.offsetHeight,
5
- width: node.offsetWidth,
6
- }
7
- }
@@ -1,24 +0,0 @@
1
- /* @flow */
2
- import {NodeType, closest} from "../utils"
3
-
4
- export default function defaultShouldCancelStart(event) {
5
- // Cancel sorting if the event target is an `input`, `textarea`, `select` or `option`
6
- const interactiveElements = [
7
- NodeType.Input,
8
- NodeType.Textarea,
9
- NodeType.Select,
10
- NodeType.Option,
11
- NodeType.Button,
12
- ]
13
-
14
- if (interactiveElements.indexOf(event.target.tagName) !== -1) {
15
- // Return true to cancel sorting
16
- return true
17
- }
18
-
19
- if (closest(event.target, (el) => el.contentEditable === "true")) {
20
- return true
21
- }
22
-
23
- return false
24
- }