roamjs-components 0.53.2 → 0.53.5

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 (333) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +154 -154
  3. package/backend/emailCatch.d.ts +4 -4
  4. package/backend/emailCatch.js +11 -11
  5. package/backend/emailError.d.ts +4 -4
  6. package/backend/emailError.js +56 -56
  7. package/backend/getRoamJSUser.d.ts +11 -11
  8. package/backend/getRoamJSUser.js +30 -30
  9. package/backend/headers.d.ts +5 -5
  10. package/backend/headers.js +7 -7
  11. package/backend/index.d.ts +6 -6
  12. package/backend/index.js +20 -20
  13. package/backend/meterRoamJSUser.d.ts +4 -4
  14. package/backend/meterRoamJSUser.js +14 -14
  15. package/backend/putRoamJSUser.d.ts +10 -10
  16. package/backend/putRoamJSUser.js +25 -25
  17. package/components/BlockErrorBoundary.d.ts +15 -15
  18. package/components/BlockErrorBoundary.js +27 -27
  19. package/components/BlockInput.d.ts +12 -12
  20. package/components/BlockInput.js +53 -53
  21. package/components/ComponentContainer.d.ts +9 -9
  22. package/components/ComponentContainer.js +46 -46
  23. package/components/ConfigPage.d.ts +99 -99
  24. package/components/ConfigPage.js +751 -751
  25. package/components/CursorMenu.d.ts +21 -21
  26. package/components/CursorMenu.js +181 -181
  27. package/components/Description.d.ts +5 -5
  28. package/components/Description.js +16 -16
  29. package/components/ExternalLogin.d.ts +18 -18
  30. package/components/ExternalLogin.js +131 -131
  31. package/components/Filter.d.ts +14 -14
  32. package/components/Filter.js +147 -147
  33. package/components/Loading.d.ts +4 -4
  34. package/components/Loading.js +33 -33
  35. package/components/MenuItemSelect.d.ts +10 -10
  36. package/components/MenuItemSelect.js +13 -13
  37. package/components/OauthSelect.d.ts +5 -5
  38. package/components/OauthSelect.js +25 -25
  39. package/components/PageInput.d.ts +10 -10
  40. package/components/PageInput.js +69 -69
  41. package/components/ServiceComponents.d.ts +49 -49
  42. package/components/ServiceComponents.js +277 -277
  43. package/components/SimpleAlert.d.ts +12 -12
  44. package/components/SimpleAlert.js +38 -38
  45. package/components/Toast.d.ts +10 -10
  46. package/components/Toast.js +41 -41
  47. package/components/TokenDialog.d.ts +11 -11
  48. package/components/TokenDialog.js +100 -100
  49. package/components/index.d.ts +15 -15
  50. package/components/index.js +60 -60
  51. package/date/constants.d.ts +2 -2
  52. package/date/constants.js +5 -5
  53. package/date/index.d.ts +5 -5
  54. package/date/index.js +13 -13
  55. package/date/parseRoamDate.d.ts +2 -2
  56. package/date/parseRoamDate.js +6 -6
  57. package/date/parseRoamDateUid.d.ts +2 -2
  58. package/date/parseRoamDateUid.js +6 -6
  59. package/date/toRoamDate.d.ts +2 -2
  60. package/date/toRoamDate.js +6 -6
  61. package/date/toRoamDateUid.d.ts +2 -2
  62. package/date/toRoamDateUid.js +6 -6
  63. package/dom/addBlockCommand.d.ts +5 -5
  64. package/dom/addBlockCommand.js +53 -53
  65. package/dom/addOldRoamJSDependency.d.ts +2 -2
  66. package/dom/addOldRoamJSDependency.js +10 -10
  67. package/dom/addRoamJSDependency.d.ts +2 -2
  68. package/dom/addRoamJSDependency.js +8 -8
  69. package/dom/addScriptAsDependency.d.ts +6 -6
  70. package/dom/addScriptAsDependency.js +16 -16
  71. package/dom/addStyle.d.ts +2 -2
  72. package/dom/addStyle.js +14 -14
  73. package/dom/constants.d.ts +1 -1
  74. package/dom/constants.js +4 -4
  75. package/dom/createBlockObserver.d.ts +7 -7
  76. package/dom/createBlockObserver.js +43 -43
  77. package/dom/createButtonObserver.d.ts +6 -6
  78. package/dom/createButtonObserver.js +21 -21
  79. package/dom/createDivObserver.d.ts +2 -2
  80. package/dom/createDivObserver.js +8 -8
  81. package/dom/createHTMLObserver.d.ts +8 -8
  82. package/dom/createHTMLObserver.js +24 -24
  83. package/dom/createHashtagObserver.d.ts +5 -5
  84. package/dom/createHashtagObserver.js +16 -16
  85. package/dom/createIconButton.d.ts +2 -2
  86. package/dom/createIconButton.js +12 -12
  87. package/dom/createObserver.d.ts +2 -2
  88. package/dom/createObserver.js +6 -6
  89. package/dom/createOverlayObserver.d.ts +2 -2
  90. package/dom/createOverlayObserver.js +6 -6
  91. package/dom/createPageObserver.d.ts +2 -2
  92. package/dom/createPageObserver.js +34 -34
  93. package/dom/createPageTitleObserver.d.ts +6 -6
  94. package/dom/createPageTitleObserver.js +29 -29
  95. package/dom/genericError.d.ts +4 -4
  96. package/dom/genericError.js +16 -16
  97. package/dom/getActiveUids.d.ts +3 -3
  98. package/dom/getActiveUids.js +6 -6
  99. package/dom/getBlockUidFromTarget.d.ts +2 -2
  100. package/dom/getBlockUidFromTarget.js +33 -33
  101. package/dom/getCurrentPageUid.d.ts +2 -2
  102. package/dom/getCurrentPageUid.js +6 -6
  103. package/dom/getDomRefs.d.ts +2 -2
  104. package/dom/getDomRefs.js +12 -12
  105. package/dom/getDropUidOffset.d.ts +5 -5
  106. package/dom/getDropUidOffset.js +27 -27
  107. package/dom/getMutatedNodes.d.ts +7 -7
  108. package/dom/getMutatedNodes.js +11 -11
  109. package/dom/getPageTitleByHtmlElement.d.ts +2 -2
  110. package/dom/getPageTitleByHtmlElement.js +12 -12
  111. package/dom/getPageTitleValueByHtmlElement.d.ts +2 -2
  112. package/dom/getPageTitleValueByHtmlElement.js +27 -27
  113. package/dom/getReferenceBlockUid.d.ts +2 -2
  114. package/dom/getReferenceBlockUid.js +18 -18
  115. package/dom/getRoamUrl.d.ts +2 -2
  116. package/dom/getRoamUrl.js +4 -4
  117. package/dom/getRoamUrlByPage.d.ts +2 -2
  118. package/dom/getRoamUrlByPage.js +10 -10
  119. package/dom/getUids.d.ts +3 -3
  120. package/dom/getUids.js +8 -8
  121. package/dom/getUidsFromButton.d.ts +3 -3
  122. package/dom/getUidsFromButton.js +9 -9
  123. package/dom/getUidsFromId.d.ts +5 -5
  124. package/dom/getUidsFromId.js +15 -15
  125. package/dom/index.d.ts +31 -31
  126. package/dom/index.js +65 -65
  127. package/dom/openBlock.d.ts +2 -2
  128. package/dom/openBlock.js +6 -6
  129. package/dom/openBlockElement.d.ts +2 -2
  130. package/dom/openBlockElement.js +16 -16
  131. package/dom/parseRoamBlocksToHtml.d.ts +9 -9
  132. package/dom/parseRoamBlocksToHtml.js +75 -75
  133. package/dom/resolveRefs.d.ts +2 -2
  134. package/dom/resolveRefs.js +24 -24
  135. package/events/index.d.ts +1 -1
  136. package/events/index.js +8 -8
  137. package/events/watchOnce.d.ts +3 -3
  138. package/events/watchOnce.js +11 -11
  139. package/hooks/index.d.ts +3 -3
  140. package/hooks/index.js +12 -12
  141. package/hooks/useArrowKeyDown.d.ts +8 -8
  142. package/hooks/useArrowKeyDown.js +31 -31
  143. package/hooks/useRoamJSTokenWarning.d.ts +2 -2
  144. package/hooks/useRoamJSTokenWarning.js +11 -11
  145. package/hooks/useSubTree.d.ts +3 -3
  146. package/hooks/useSubTree.js +11 -11
  147. package/index.d.ts +11 -11
  148. package/index.js +14 -14
  149. package/marked/index.d.ts +14 -14
  150. package/marked/index.js +518 -518
  151. package/package.json +86 -86
  152. package/queries/getAllBlockUids.d.ts +2 -2
  153. package/queries/getAllBlockUids.js +6 -6
  154. package/queries/getAllBlockUidsAndTexts.d.ts +5 -5
  155. package/queries/getAllBlockUidsAndTexts.js +6 -6
  156. package/queries/getAllPageNames.d.ts +2 -2
  157. package/queries/getAllPageNames.js +6 -6
  158. package/queries/getAttributeValueByBlockAndName.d.ts +5 -5
  159. package/queries/getAttributeValueByBlockAndName.js +11 -11
  160. package/queries/getBasicTreeByParentUid.d.ts +3 -3
  161. package/queries/getBasicTreeByParentUid.js +13 -13
  162. package/queries/getBlockUidAndTextIncludingText.d.ts +5 -5
  163. package/queries/getBlockUidAndTextIncludingText.js +6 -6
  164. package/queries/getBlockUidByTextOnPage.d.ts +5 -5
  165. package/queries/getBlockUidByTextOnPage.js +7 -7
  166. package/queries/getBlockUidsAndTextsReferencingPage.d.ts +5 -5
  167. package/queries/getBlockUidsAndTextsReferencingPage.js +11 -11
  168. package/queries/getBlockUidsByPageTitle.d.ts +2 -2
  169. package/queries/getBlockUidsByPageTitle.js +8 -8
  170. package/queries/getBlockUidsReferencingBlock.d.ts +2 -2
  171. package/queries/getBlockUidsReferencingBlock.js +6 -6
  172. package/queries/getBlockUidsReferencingPage.d.ts +2 -2
  173. package/queries/getBlockUidsReferencingPage.js +8 -8
  174. package/queries/getBlockUidsWithParentUid.d.ts +2 -2
  175. package/queries/getBlockUidsWithParentUid.js +6 -6
  176. package/queries/getChildrenLengthByPageUid.d.ts +2 -2
  177. package/queries/getChildrenLengthByPageUid.js +4 -4
  178. package/queries/getCreateTimeByBlockUid.d.ts +2 -2
  179. package/queries/getCreateTimeByBlockUid.js +7 -7
  180. package/queries/getCurrentUser.d.ts +2 -2
  181. package/queries/getCurrentUser.js +11 -11
  182. package/queries/getCurrentUserDisplayName.d.ts +2 -2
  183. package/queries/getCurrentUserDisplayName.js +13 -13
  184. package/queries/getCurrentUserEmail.d.ts +2 -2
  185. package/queries/getCurrentUserEmail.js +13 -13
  186. package/queries/getCurrentUserUid.d.ts +2 -2
  187. package/queries/getCurrentUserUid.js +13 -13
  188. package/queries/getDisplayNameByEmail.d.ts +2 -2
  189. package/queries/getDisplayNameByEmail.js +7 -7
  190. package/queries/getDisplayNameByUid.d.ts +2 -2
  191. package/queries/getDisplayNameByUid.js +7 -7
  192. package/queries/getEditTimeByBlockUid.d.ts +2 -2
  193. package/queries/getEditTimeByBlockUid.js +7 -7
  194. package/queries/getEditedUserEmailByBlockUid.d.ts +2 -2
  195. package/queries/getEditedUserEmailByBlockUid.js +7 -7
  196. package/queries/getFirstChildTextByBlockUid.d.ts +2 -2
  197. package/queries/getFirstChildTextByBlockUid.js +7 -7
  198. package/queries/getFirstChildUidByBlockUid.d.ts +2 -2
  199. package/queries/getFirstChildUidByBlockUid.js +5 -5
  200. package/queries/getFullTreeByParentUid.d.ts +3 -3
  201. package/queries/getFullTreeByParentUid.js +26 -26
  202. package/queries/getLinkedPageTitlesUnderUid.d.ts +2 -2
  203. package/queries/getLinkedPageTitlesUnderUid.js +6 -6
  204. package/queries/getNthChildUidByBlockUid.d.ts +5 -5
  205. package/queries/getNthChildUidByBlockUid.js +7 -7
  206. package/queries/getOrderByBlockUid.d.ts +2 -2
  207. package/queries/getOrderByBlockUid.js +7 -7
  208. package/queries/getPageTitleByBlockUid.d.ts +2 -2
  209. package/queries/getPageTitleByBlockUid.js +7 -7
  210. package/queries/getPageTitleByPageUid.d.ts +2 -2
  211. package/queries/getPageTitleByPageUid.js +9 -9
  212. package/queries/getPageTitleReferencesByPageTitle.d.ts +2 -2
  213. package/queries/getPageTitleReferencesByPageTitle.js +8 -8
  214. package/queries/getPageTitlesAndBlockUidsReferencingPage.d.ts +5 -5
  215. package/queries/getPageTitlesAndBlockUidsReferencingPage.js +8 -8
  216. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.d.ts +5 -5
  217. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js +8 -8
  218. package/queries/getPageTitlesReferencingBlockUid.d.ts +2 -2
  219. package/queries/getPageTitlesReferencingBlockUid.js +6 -6
  220. package/queries/getPageTitlesStartingWithPrefix.d.ts +2 -2
  221. package/queries/getPageTitlesStartingWithPrefix.js +6 -6
  222. package/queries/getPageUidByPageTitle.d.ts +2 -2
  223. package/queries/getPageUidByPageTitle.js +9 -9
  224. package/queries/getPageViewType.d.ts +3 -3
  225. package/queries/getPageViewType.js +9 -9
  226. package/queries/getParentTextByBlockUid.d.ts +2 -2
  227. package/queries/getParentTextByBlockUid.js +7 -7
  228. package/queries/getParentTextByBlockUidAndTag.d.ts +5 -5
  229. package/queries/getParentTextByBlockUidAndTag.js +7 -7
  230. package/queries/getParentUidByBlockUid.d.ts +2 -2
  231. package/queries/getParentUidByBlockUid.js +7 -7
  232. package/queries/getParentUidsOfBlockUid.d.ts +2 -2
  233. package/queries/getParentUidsOfBlockUid.js +6 -6
  234. package/queries/getSettingsByEmail.d.ts +3 -3
  235. package/queries/getSettingsByEmail.js +7 -7
  236. package/queries/getShallowTreeByParentUid.d.ts +5 -5
  237. package/queries/getShallowTreeByParentUid.js +10 -10
  238. package/queries/getTextByBlockUid.d.ts +2 -2
  239. package/queries/getTextByBlockUid.js +7 -7
  240. package/queries/index.d.ts +45 -45
  241. package/queries/index.js +96 -96
  242. package/queries/isTagOnPage.d.ts +5 -5
  243. package/queries/isTagOnPage.js +9 -9
  244. package/queries/normalizePageTitle.d.ts +2 -2
  245. package/queries/normalizePageTitle.js +4 -4
  246. package/types/index.d.ts +461 -459
  247. package/types/index.js +2 -2
  248. package/types/query-builder.d.ts +16 -16
  249. package/types/query-builder.js +2 -2
  250. package/util/addInputSetting.d.ts +7 -7
  251. package/util/addInputSetting.js +25 -25
  252. package/util/apiDelete.d.ts +2 -2
  253. package/util/apiDelete.js +9 -9
  254. package/util/apiGet.d.ts +2 -2
  255. package/util/apiGet.js +9 -9
  256. package/util/apiPost.d.ts +2 -2
  257. package/util/apiPost.js +9 -9
  258. package/util/apiPut.d.ts +2 -2
  259. package/util/apiPut.js +9 -9
  260. package/util/createOverlayRender.d.ts +6 -6
  261. package/util/createOverlayRender.js +18 -18
  262. package/util/createTagRegex.d.ts +2 -2
  263. package/util/createTagRegex.js +4 -4
  264. package/util/extractRef.d.ts +2 -2
  265. package/util/extractRef.js +8 -8
  266. package/util/extractTag.d.ts +2 -2
  267. package/util/extractTag.js +12 -12
  268. package/util/getAuthorizationHeader.d.ts +2 -2
  269. package/util/getAuthorizationHeader.js +12 -12
  270. package/util/getGraph.d.ts +2 -2
  271. package/util/getGraph.js +8 -8
  272. package/util/getLocalStorageKey.d.ts +2 -2
  273. package/util/getLocalStorageKey.js +6 -6
  274. package/util/getOauth.d.ts +2 -2
  275. package/util/getOauth.js +50 -50
  276. package/util/getOauthAccounts.d.ts +2 -2
  277. package/util/getOauthAccounts.js +21 -21
  278. package/util/getRenderRoot.d.ts +2 -2
  279. package/util/getRenderRoot.js +11 -11
  280. package/util/getSettingIntFromTree.d.ts +7 -7
  281. package/util/getSettingIntFromTree.js +11 -11
  282. package/util/getSettingValueFromTree.d.ts +7 -7
  283. package/util/getSettingValueFromTree.js +13 -13
  284. package/util/getSettingValuesFromTree.d.ts +7 -7
  285. package/util/getSettingValuesFromTree.js +12 -12
  286. package/util/getSubTree.d.ts +8 -8
  287. package/util/getSubTree.js +19 -19
  288. package/util/getToken.d.ts +2 -2
  289. package/util/getToken.js +9 -9
  290. package/util/getTokenFromTree.d.ts +2 -2
  291. package/util/getTokenFromTree.js +5 -5
  292. package/util/idToTitle.d.ts +2 -2
  293. package/util/idToTitle.js +8 -8
  294. package/util/index.d.ts +23 -23
  295. package/util/index.js +52 -52
  296. package/util/isControl.d.ts +2 -2
  297. package/util/isControl.js +6 -6
  298. package/util/localStorageGet.d.ts +2 -2
  299. package/util/localStorageGet.js +8 -8
  300. package/util/localStorageRemove.d.ts +2 -2
  301. package/util/localStorageRemove.js +6 -6
  302. package/util/localStorageSet.d.ts +2 -2
  303. package/util/localStorageSet.js +8 -8
  304. package/util/registerSmartBlocksCommand.d.ts +8 -8
  305. package/util/registerSmartBlocksCommand.js +24 -24
  306. package/util/runExtension.d.ts +4 -4
  307. package/util/runExtension.js +40 -40
  308. package/util/setInputSetting.d.ts +7 -7
  309. package/util/setInputSetting.js +33 -33
  310. package/util/setInputSettings.d.ts +7 -7
  311. package/util/setInputSettings.js +28 -28
  312. package/util/toConfigPageName.d.ts +2 -2
  313. package/util/toConfigPageName.js +4 -4
  314. package/util/toFlexRegex.d.ts +2 -2
  315. package/util/toFlexRegex.js +4 -4
  316. package/writes/clearBlockById.d.ts +2 -2
  317. package/writes/clearBlockById.js +11 -11
  318. package/writes/clearBlockByUid.d.ts +2 -2
  319. package/writes/clearBlockByUid.js +9 -9
  320. package/writes/createBlock.d.ts +9 -9
  321. package/writes/createBlock.js +61 -61
  322. package/writes/createPage.d.ts +7 -7
  323. package/writes/createPage.js +18 -18
  324. package/writes/deleteBlock.d.ts +2 -2
  325. package/writes/deleteBlock.js +6 -6
  326. package/writes/index.d.ts +8 -8
  327. package/writes/index.js +22 -22
  328. package/writes/openBlockInSidebar.d.ts +2 -2
  329. package/writes/openBlockInSidebar.js +13 -13
  330. package/writes/updateActiveBlock.d.ts +2 -2
  331. package/writes/updateActiveBlock.js +11 -11
  332. package/writes/updateBlock.d.ts +5 -5
  333. package/writes/updateBlock.js +17 -17
package/package.json CHANGED
@@ -1,86 +1,86 @@
1
- {
2
- "name": "roamjs-components",
3
- "description": "Description for roamjs-components",
4
- "version": "0.53.2",
5
- "main": "index.js",
6
- "types": "index.d.ts",
7
- "scripts": {
8
- "prebuild": "npm t",
9
- "build": "tsc",
10
- "format": "prettier --write \"src/**/*.tsx\"",
11
- "lint": "eslint . --ext .ts,.tsx",
12
- "prepublishOnly": "npm run build",
13
- "preversion": "npm run lint",
14
- "version": "npm run format && git add -A src",
15
- "postversion": "git push origin main && git push --tags",
16
- "pretest": "npm run lint",
17
- "jest": "jest --config jestconfig.json",
18
- "test": "npm run jest"
19
- },
20
- "license": "MIT",
21
- "files": [
22
- "/backend",
23
- "/components",
24
- "/date",
25
- "/dom",
26
- "/events",
27
- "/hooks",
28
- "/marked",
29
- "/queries",
30
- "/types",
31
- "/util",
32
- "/writes",
33
- "/index.d.ts",
34
- "/index.js.map"
35
- ],
36
- "peerDependencies": {
37
- "react": "^16.8.0 || ^17",
38
- "react-dom": "^16.8.0 || ^17"
39
- },
40
- "dependencies": {
41
- "@blueprintjs/core": "^3.52.0",
42
- "@blueprintjs/datetime": "^3.23.5",
43
- "@blueprintjs/select": "^3.16.0",
44
- "aws-sdk-plus": "^0.5.3",
45
- "axios": "^0.21.4",
46
- "color": "^4.0.1",
47
- "crypto-js": "^4.1.1",
48
- "date-fns": "^2.27.0",
49
- "fuzzy": "^0.1.3",
50
- "hast-util-to-html": "^7.1.3",
51
- "markdown-to-jsx": "^7.1.3",
52
- "marked": "^2.0.0",
53
- "mobile-device-detect": "^0.4.3",
54
- "randomstring": "^1.2.1",
55
- "react": "^17.0.2",
56
- "react-dom": "^17.0.2",
57
- "refractor": "^3.3.1",
58
- "xregexp": "^5.0.1"
59
- },
60
- "devDependencies": {
61
- "@testing-library/jest-dom": "^5.13.0",
62
- "@testing-library/react": "^11.2.7",
63
- "@testing-library/user-event": "^13.1.9",
64
- "@types/aws-lambda": "^8.10.89",
65
- "@types/color": "^3.0.2",
66
- "@types/crypto-js": "^4.0.2",
67
- "@types/cryptr": "^4.0.1",
68
- "@types/jest": "^26.0.23",
69
- "@types/marked": "^2.0.3",
70
- "@types/randomstring": "^1.1.7",
71
- "@types/react": "^17.0.9",
72
- "@types/react-dom": "^17.0.6",
73
- "@types/refractor": "^3.0.2",
74
- "@typescript-eslint/eslint-plugin": "^5.5.0",
75
- "@typescript-eslint/parser": "^5.5.0",
76
- "@vercel/ncc": "^0.28.6",
77
- "eslint": "^8.4.0",
78
- "jest": "^26.6.3",
79
- "prettier": "^2.3.1",
80
- "ts-jest": "^26.5.6",
81
- "tslib": "^2.2.0",
82
- "tslint-config-prettier": "^1.18.0",
83
- "tslint-react-hooks": "^2.2.2",
84
- "typescript": "^4.5.2"
85
- }
86
- }
1
+ {
2
+ "name": "roamjs-components",
3
+ "description": "Description for roamjs-components",
4
+ "version": "0.53.5",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "scripts": {
8
+ "prebuild": "npm t",
9
+ "build": "tsc",
10
+ "format": "prettier --write \"src/**/*.tsx\"",
11
+ "lint": "eslint . --ext .ts,.tsx",
12
+ "prepublishOnly": "npm run build",
13
+ "preversion": "npm run lint",
14
+ "version": "npm run format && git add -A src",
15
+ "postversion": "git push origin main && git push --tags",
16
+ "pretest": "npm run lint",
17
+ "jest": "jest --config jestconfig.json",
18
+ "test": "npm run jest"
19
+ },
20
+ "license": "MIT",
21
+ "files": [
22
+ "/backend",
23
+ "/components",
24
+ "/date",
25
+ "/dom",
26
+ "/events",
27
+ "/hooks",
28
+ "/marked",
29
+ "/queries",
30
+ "/types",
31
+ "/util",
32
+ "/writes",
33
+ "/index.d.ts",
34
+ "/index.js.map"
35
+ ],
36
+ "peerDependencies": {
37
+ "react": "^16.8.0 || ^17",
38
+ "react-dom": "^16.8.0 || ^17"
39
+ },
40
+ "dependencies": {
41
+ "@blueprintjs/core": "^3.52.0",
42
+ "@blueprintjs/datetime": "^3.23.5",
43
+ "@blueprintjs/select": "^3.16.0",
44
+ "aws-sdk-plus": "^0.5.3",
45
+ "axios": "^0.21.4",
46
+ "color": "^4.0.1",
47
+ "crypto-js": "^4.1.1",
48
+ "date-fns": "^2.27.0",
49
+ "fuzzy": "^0.1.3",
50
+ "hast-util-to-html": "^7.1.3",
51
+ "markdown-to-jsx": "^7.1.3",
52
+ "marked": "^2.0.0",
53
+ "mobile-device-detect": "^0.4.3",
54
+ "randomstring": "^1.2.1",
55
+ "react": "^17.0.2",
56
+ "react-dom": "^17.0.2",
57
+ "refractor": "^3.3.1",
58
+ "xregexp": "^5.0.1"
59
+ },
60
+ "devDependencies": {
61
+ "@testing-library/jest-dom": "^5.13.0",
62
+ "@testing-library/react": "^11.2.7",
63
+ "@testing-library/user-event": "^13.1.9",
64
+ "@types/aws-lambda": "^8.10.89",
65
+ "@types/color": "^3.0.2",
66
+ "@types/crypto-js": "^4.0.2",
67
+ "@types/cryptr": "^4.0.1",
68
+ "@types/jest": "^26.0.23",
69
+ "@types/marked": "^2.0.3",
70
+ "@types/randomstring": "^1.1.7",
71
+ "@types/react": "^17.0.9",
72
+ "@types/react-dom": "^17.0.6",
73
+ "@types/refractor": "^3.0.2",
74
+ "@typescript-eslint/eslint-plugin": "^5.5.0",
75
+ "@typescript-eslint/parser": "^5.5.0",
76
+ "@vercel/ncc": "^0.28.6",
77
+ "eslint": "^8.4.0",
78
+ "jest": "^26.6.3",
79
+ "prettier": "^2.3.1",
80
+ "ts-jest": "^26.5.6",
81
+ "tslib": "^2.2.0",
82
+ "tslint-config-prettier": "^1.18.0",
83
+ "tslint-react-hooks": "^2.2.2",
84
+ "typescript": "^4.5.2"
85
+ }
86
+ }
@@ -1,2 +1,2 @@
1
- declare const getAllBlockUids: () => string[];
2
- export default getAllBlockUids;
1
+ declare const getAllBlockUids: () => string[];
2
+ export default getAllBlockUids;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getAllBlockUids = () => window.roamAlphaAPI
4
- .q(`[:find ?u :where [?e :block/uid ?u] [?e :block/string]]`)
5
- .map((f) => f[0]);
6
- exports.default = getAllBlockUids;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getAllBlockUids = () => window.roamAlphaAPI
4
+ .q(`[:find ?u :where [?e :block/uid ?u] [?e :block/string]]`)
5
+ .map((f) => f[0]);
6
+ exports.default = getAllBlockUids;
7
7
  //# sourceMappingURL=getAllBlockUids.js.map
@@ -1,5 +1,5 @@
1
- declare const getAllBlockUidsAndTexts: () => {
2
- uid: string;
3
- text: string;
4
- }[];
5
- export default getAllBlockUidsAndTexts;
1
+ declare const getAllBlockUidsAndTexts: () => {
2
+ uid: string;
3
+ text: string;
4
+ }[];
5
+ export default getAllBlockUidsAndTexts;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getAllBlockUidsAndTexts = () => window.roamAlphaAPI
4
- .q(`[:find ?u ?s :where [?e :block/uid ?u] [?e :block/string ?s]]`)
5
- .map((f) => ({ uid: f[0], text: f[1] }));
6
- exports.default = getAllBlockUidsAndTexts;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getAllBlockUidsAndTexts = () => window.roamAlphaAPI
4
+ .q(`[:find ?u ?s :where [?e :block/uid ?u] [?e :block/string ?s]]`)
5
+ .map((f) => ({ uid: f[0], text: f[1] }));
6
+ exports.default = getAllBlockUidsAndTexts;
7
7
  //# sourceMappingURL=getAllBlockUidsAndTexts.js.map
@@ -1,2 +1,2 @@
1
- declare const getAllPageNames: () => string[];
2
- export default getAllPageNames;
1
+ declare const getAllPageNames: () => string[];
2
+ export default getAllPageNames;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getAllPageNames = () => window.roamAlphaAPI
4
- .q("[:find ?s :where [?e :node/title ?s]]")
5
- .map((b) => b[0]);
6
- exports.default = getAllPageNames;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getAllPageNames = () => window.roamAlphaAPI
4
+ .q("[:find ?s :where [?e :node/title ?s]]")
5
+ .map((b) => b[0]);
6
+ exports.default = getAllPageNames;
7
7
  //# sourceMappingURL=getAllPageNames.js.map
@@ -1,5 +1,5 @@
1
- declare const getAttributeValueByBlockAndName: ({ name, uid, }: {
2
- name: string;
3
- uid: string;
4
- }) => any;
5
- export default getAttributeValueByBlockAndName;
1
+ declare const getAttributeValueByBlockAndName: ({ name, uid, }: {
2
+ name: string;
3
+ uid: string;
4
+ }) => any;
5
+ export default getAttributeValueByBlockAndName;
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
- const getAttributeValueByBlockAndName = ({ name, uid, }) => {
6
- var _a, _b, _c;
7
- return (((_c = (_b = (_a = window.roamAlphaAPI.q(`[:find (pull ?b [:block/string]) :where [?a :node/title "${(0, normalizePageTitle_1.default)(name)}"] [?p :block/uid "${uid}"] [?b :block/refs ?a] [?b :block/parents ?p]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.string) || "")
8
- .slice(name.length + 2)
9
- .trim();
10
- };
11
- exports.default = getAttributeValueByBlockAndName;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
+ const getAttributeValueByBlockAndName = ({ name, uid, }) => {
6
+ var _a, _b, _c;
7
+ return (((_c = (_b = (_a = window.roamAlphaAPI.q(`[:find (pull ?b [:block/string]) :where [?a :node/title "${(0, normalizePageTitle_1.default)(name)}"] [?p :block/uid "${uid}"] [?b :block/refs ?a] [?b :block/parents ?p]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.string) || "")
8
+ .slice(name.length + 2)
9
+ .trim();
10
+ };
11
+ exports.default = getAttributeValueByBlockAndName;
12
12
  //# sourceMappingURL=getAttributeValueByBlockAndName.js.map
@@ -1,3 +1,3 @@
1
- import { RoamBasicNode } from "../types";
2
- declare const getBasicTreeByParentUid: (uid: string) => RoamBasicNode[];
3
- export default getBasicTreeByParentUid;
1
+ import { RoamBasicNode } from "../types";
2
+ declare const getBasicTreeByParentUid: (uid: string) => RoamBasicNode[];
3
+ export default getBasicTreeByParentUid;
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const sortBasicNodes = (c) => c
5
- .sort(({ order: a }, { order: b }) => a - b)
6
- .map((_a) => {
7
- var { order: _, children = [] } = _a, node = (0, tslib_1.__rest)(_a, ["order", "children"]);
8
- return (Object.assign({ children: sortBasicNodes(children) }, node));
9
- });
10
- const getBasicTreeByParentUid = (uid) => sortBasicNodes(window.roamAlphaAPI
11
- .q(`[:find (pull ?c [[:block/string :as "text"] :block/uid :block/order {:block/children ...}]) :where [?b :block/uid "${uid}"] [?b :block/children ?c]]`)
12
- .map((a) => a[0]));
13
- exports.default = getBasicTreeByParentUid;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const sortBasicNodes = (c) => c
5
+ .sort(({ order: a }, { order: b }) => a - b)
6
+ .map((_a) => {
7
+ var { order: _, children = [] } = _a, node = (0, tslib_1.__rest)(_a, ["order", "children"]);
8
+ return (Object.assign({ children: sortBasicNodes(children) }, node));
9
+ });
10
+ const getBasicTreeByParentUid = (uid) => sortBasicNodes(window.roamAlphaAPI
11
+ .q(`[:find (pull ?c [[:block/string :as "text"] :block/uid :block/order {:block/children ...}]) :where [?b :block/uid "${uid}"] [?b :block/children ?c]]`)
12
+ .map((a) => a[0]));
13
+ exports.default = getBasicTreeByParentUid;
14
14
  //# sourceMappingURL=getBasicTreeByParentUid.js.map
@@ -1,5 +1,5 @@
1
- declare const getBlockUidAndTextIncludingText: (t: string) => {
2
- uid: string;
3
- text: string;
4
- }[];
5
- export default getBlockUidAndTextIncludingText;
1
+ declare const getBlockUidAndTextIncludingText: (t: string) => {
2
+ uid: string;
3
+ text: string;
4
+ }[];
5
+ export default getBlockUidAndTextIncludingText;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getBlockUidAndTextIncludingText = (t) => window.roamAlphaAPI
4
- .q(`[:find ?u ?contents :where [?block :block/uid ?u] [?block :block/string ?contents][(clojure.string/includes? ?contents "${t}")]]`)
5
- .map(([uid, text]) => ({ uid, text }));
6
- exports.default = getBlockUidAndTextIncludingText;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getBlockUidAndTextIncludingText = (t) => window.roamAlphaAPI
4
+ .q(`[:find ?u ?contents :where [?block :block/uid ?u] [?block :block/string ?contents][(clojure.string/includes? ?contents "${t}")]]`)
5
+ .map(([uid, text]) => ({ uid, text }));
6
+ exports.default = getBlockUidAndTextIncludingText;
7
7
  //# sourceMappingURL=getBlockUidAndTextIncludingText.js.map
@@ -1,5 +1,5 @@
1
- declare const getBlockUidByTextOnPage: ({ text, title, }: {
2
- text: string;
3
- title: string;
4
- }) => string;
5
- export default getBlockUidByTextOnPage;
1
+ declare const getBlockUidByTextOnPage: ({ text, title, }: {
2
+ text: string;
3
+ title: string;
4
+ }) => string;
5
+ export default getBlockUidByTextOnPage;
@@ -1,8 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getBlockUidByTextOnPage = ({ text, title, }) => {
4
- var _a, _b;
5
- return ((_b = (_a = window.roamAlphaAPI.q(`[:find ?u :where [?b :block/page ?p] [?b :block/uid ?u] [?b :block/string "${text}"] [?p :node/title "${title}"]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0]) || "";
6
- };
7
- exports.default = getBlockUidByTextOnPage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getBlockUidByTextOnPage = ({ text, title, }) => {
4
+ var _a, _b;
5
+ return ((_b = (_a = window.roamAlphaAPI.q(`[:find ?u :where [?b :block/page ?p] [?b :block/uid ?u] [?b :block/string "${text}"] [?p :node/title "${title}"]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0]) || "";
6
+ };
7
+ exports.default = getBlockUidByTextOnPage;
8
8
  //# sourceMappingURL=getBlockUidByTextOnPage.js.map
@@ -1,5 +1,5 @@
1
- declare const getBlockUidsAndTextsReferencingPage: (title: string) => {
2
- uid: string;
3
- text: string;
4
- }[];
5
- export default getBlockUidsAndTextsReferencingPage;
1
+ declare const getBlockUidsAndTextsReferencingPage: (title: string) => {
2
+ uid: string;
3
+ text: string;
4
+ }[];
5
+ export default getBlockUidsAndTextsReferencingPage;
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
- const getBlockUidsAndTextsReferencingPage = (title) => window.roamAlphaAPI
6
- .q(`[:find (pull ?r [:block/uid :block/string]) :where [?p :node/title "${(0, normalizePageTitle_1.default)(title)}"] [?r :block/refs ?p]]`)
7
- .map(([node]) => ({
8
- uid: node.uid,
9
- text: node.string || '',
10
- }));
11
- exports.default = getBlockUidsAndTextsReferencingPage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
+ const getBlockUidsAndTextsReferencingPage = (title) => window.roamAlphaAPI
6
+ .q(`[:find (pull ?r [:block/uid :block/string]) :where [?p :node/title "${(0, normalizePageTitle_1.default)(title)}"] [?r :block/refs ?p]]`)
7
+ .map(([node]) => ({
8
+ uid: node.uid,
9
+ text: node.string || '',
10
+ }));
11
+ exports.default = getBlockUidsAndTextsReferencingPage;
12
12
  //# sourceMappingURL=getBlockUidsAndTextsReferencingPage.js.map
@@ -1,2 +1,2 @@
1
- declare const getBlockUidsByPageTitle: (title: string) => string[];
2
- export default getBlockUidsByPageTitle;
1
+ declare const getBlockUidsByPageTitle: (title: string) => string[];
2
+ export default getBlockUidsByPageTitle;
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
- const getBlockUidsByPageTitle = (title) => window.roamAlphaAPI
6
- .q(`[:find ?u :where [?b :block/uid ?u] [?b :block/page ?e] [?e :node/title "${(0, normalizePageTitle_1.default)(title)}"]]`)
7
- .map((b) => b[0]);
8
- exports.default = getBlockUidsByPageTitle;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
+ const getBlockUidsByPageTitle = (title) => window.roamAlphaAPI
6
+ .q(`[:find ?u :where [?b :block/uid ?u] [?b :block/page ?e] [?e :node/title "${(0, normalizePageTitle_1.default)(title)}"]]`)
7
+ .map((b) => b[0]);
8
+ exports.default = getBlockUidsByPageTitle;
9
9
  //# sourceMappingURL=getBlockUidsByPageTitle.js.map
@@ -1,2 +1,2 @@
1
- declare const getBlockUidsReferencingBlock: (uid: string) => string[];
2
- export default getBlockUidsReferencingBlock;
1
+ declare const getBlockUidsReferencingBlock: (uid: string) => string[];
2
+ export default getBlockUidsReferencingBlock;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getBlockUidsReferencingBlock = (uid) => window.roamAlphaAPI
4
- .q(`[:find ?u :where [?r :block/uid ?u] [?r :block/refs ?b] [?b :block/uid "${uid}"]]`)
5
- .map((s) => s[0]);
6
- exports.default = getBlockUidsReferencingBlock;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getBlockUidsReferencingBlock = (uid) => window.roamAlphaAPI
4
+ .q(`[:find ?u :where [?r :block/uid ?u] [?r :block/refs ?b] [?b :block/uid "${uid}"]]`)
5
+ .map((s) => s[0]);
6
+ exports.default = getBlockUidsReferencingBlock;
7
7
  //# sourceMappingURL=getBlockUidsReferencingBlock.js.map
@@ -1,2 +1,2 @@
1
- declare const getBlockUidsReferencingPage: (title: string) => string[];
2
- export default getBlockUidsReferencingPage;
1
+ declare const getBlockUidsReferencingPage: (title: string) => string[];
2
+ export default getBlockUidsReferencingPage;
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
- const getBlockUidsReferencingPage = (title) => window.roamAlphaAPI
6
- .q(`[:find ?u :where [?r :block/uid ?u] [?r :block/refs ?p] [?p :node/title "${(0, normalizePageTitle_1.default)(title)}"]]`)
7
- .map((s) => s[0]);
8
- exports.default = getBlockUidsReferencingPage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const normalizePageTitle_1 = (0, tslib_1.__importDefault)(require("./normalizePageTitle"));
5
+ const getBlockUidsReferencingPage = (title) => window.roamAlphaAPI
6
+ .q(`[:find ?u :where [?r :block/uid ?u] [?r :block/refs ?p] [?p :node/title "${(0, normalizePageTitle_1.default)(title)}"]]`)
7
+ .map((s) => s[0]);
8
+ exports.default = getBlockUidsReferencingPage;
9
9
  //# sourceMappingURL=getBlockUidsReferencingPage.js.map
@@ -1,2 +1,2 @@
1
- declare const getBlockUidsWithParentUid: (uid: string) => string[];
2
- export default getBlockUidsWithParentUid;
1
+ declare const getBlockUidsWithParentUid: (uid: string) => string[];
2
+ export default getBlockUidsWithParentUid;
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getBlockUidsWithParentUid = (uid) => window.roamAlphaAPI
4
- .q(`[:find ?u :where [?c :block/uid ?u] [?c :block/parents ?b] [?b :block/uid "${uid}"]]`)
5
- .map((r) => r[0]);
6
- exports.default = getBlockUidsWithParentUid;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getBlockUidsWithParentUid = (uid) => window.roamAlphaAPI
4
+ .q(`[:find ?u :where [?c :block/uid ?u] [?c :block/parents ?b] [?b :block/uid "${uid}"]]`)
5
+ .map((r) => r[0]);
6
+ exports.default = getBlockUidsWithParentUid;
7
7
  //# sourceMappingURL=getBlockUidsWithParentUid.js.map
@@ -1,2 +1,2 @@
1
- declare const getChildrenLengthByPageUid: (uid: string) => number;
2
- export default getChildrenLengthByPageUid;
1
+ declare const getChildrenLengthByPageUid: (uid: string) => number;
2
+ export default getChildrenLengthByPageUid;
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getChildrenLengthByPageUid = (uid) => window.roamAlphaAPI.q(`[:find ?c :where [?e :block/children ?c] [?e :block/uid "${uid}"]]`).length;
4
- exports.default = getChildrenLengthByPageUid;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getChildrenLengthByPageUid = (uid) => window.roamAlphaAPI.q(`[:find ?c :where [?e :block/children ?c] [?e :block/uid "${uid}"]]`).length;
4
+ exports.default = getChildrenLengthByPageUid;
5
5
  //# sourceMappingURL=getChildrenLengthByPageUid.js.map
@@ -1,2 +1,2 @@
1
- declare const getCreateTimeByBlockUid: (uid: string) => number;
2
- export default getCreateTimeByBlockUid;
1
+ declare const getCreateTimeByBlockUid: (uid: string) => number;
2
+ export default getCreateTimeByBlockUid;
@@ -1,8 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getCreateTimeByBlockUid = (uid) => {
4
- var _a, _b;
5
- return (_b = (_a = window.roamAlphaAPI.q(`[:find ?t :where [?e :create/time ?t] [?e :block/uid "${uid}"]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0];
6
- };
7
- exports.default = getCreateTimeByBlockUid;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getCreateTimeByBlockUid = (uid) => {
4
+ var _a, _b;
5
+ return (_b = (_a = window.roamAlphaAPI.q(`[:find ?t :where [?e :create/time ?t] [?e :block/uid "${uid}"]]`)) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b[0];
6
+ };
7
+ exports.default = getCreateTimeByBlockUid;
8
8
  //# sourceMappingURL=getCreateTimeByBlockUid.js.map
@@ -1,2 +1,2 @@
1
- declare const getCurrentUser: () => string[];
2
- export default getCurrentUser;
1
+ declare const getCurrentUser: () => string[];
2
+ export default getCurrentUser;
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getCurrentUser = () => {
4
- const globalAppState = JSON.parse(localStorage.getItem("globalAppState") || '["","",[]]');
5
- const userIndex = globalAppState.findIndex((s) => s === "~:user");
6
- if (userIndex > 0) {
7
- return globalAppState[userIndex + 1];
8
- }
9
- return [];
10
- };
11
- exports.default = getCurrentUser;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getCurrentUser = () => {
4
+ const globalAppState = JSON.parse(localStorage.getItem("globalAppState") || '["","",[]]');
5
+ const userIndex = globalAppState.findIndex((s) => s === "~:user");
6
+ if (userIndex > 0) {
7
+ return globalAppState[userIndex + 1];
8
+ }
9
+ return [];
10
+ };
11
+ exports.default = getCurrentUser;
12
12
  //# sourceMappingURL=getCurrentUser.js.map
@@ -1,2 +1,2 @@
1
- declare const getCurrentUserDisplayName: () => string;
2
- export default getCurrentUserDisplayName;
1
+ declare const getCurrentUserDisplayName: () => string;
2
+ export default getCurrentUserDisplayName;
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const getCurrentUser_1 = (0, tslib_1.__importDefault)(require("./getCurrentUser"));
5
- const getCurrentUserDisplayName = () => {
6
- const userArray = (0, getCurrentUser_1.default)();
7
- const uidIndex = userArray.findIndex((s) => s === "~:display-name");
8
- if (uidIndex > 0) {
9
- return userArray[uidIndex + 1] || "";
10
- }
11
- return "";
12
- };
13
- exports.default = getCurrentUserDisplayName;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const getCurrentUser_1 = (0, tslib_1.__importDefault)(require("./getCurrentUser"));
5
+ const getCurrentUserDisplayName = () => {
6
+ const userArray = (0, getCurrentUser_1.default)();
7
+ const uidIndex = userArray.findIndex((s) => s === "~:display-name");
8
+ if (uidIndex > 0) {
9
+ return userArray[uidIndex + 1] || "";
10
+ }
11
+ return "";
12
+ };
13
+ exports.default = getCurrentUserDisplayName;
14
14
  //# sourceMappingURL=getCurrentUserDisplayName.js.map
@@ -1,2 +1,2 @@
1
- declare const getCurrentUserEmail: () => string;
2
- export default getCurrentUserEmail;
1
+ declare const getCurrentUserEmail: () => string;
2
+ export default getCurrentUserEmail;