roamjs-components 0.85.1 → 0.85.3

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 (557) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +29 -29
  3. package/components/AutocompleteInput.d.ts +28 -28
  4. package/components/AutocompleteInput.js +120 -120
  5. package/components/BlockErrorBoundary.d.ts +15 -15
  6. package/components/BlockErrorBoundary.js +27 -27
  7. package/components/BlockInput.d.ts +13 -13
  8. package/components/BlockInput.js +55 -55
  9. package/components/ComponentContainer.d.ts +10 -10
  10. package/components/ComponentContainer.js +37 -37
  11. package/components/ConfigPage.d.ts +35 -35
  12. package/components/ConfigPage.js +159 -159
  13. package/components/ConfigPanels/BlockPanel.d.ts +3 -3
  14. package/components/ConfigPanels/BlockPanel.js +42 -42
  15. package/components/ConfigPanels/BlocksPanel.d.ts +3 -3
  16. package/components/ConfigPanels/BlocksPanel.js +58 -58
  17. package/components/ConfigPanels/CustomPanel.d.ts +3 -3
  18. package/components/ConfigPanels/CustomPanel.js +24 -24
  19. package/components/ConfigPanels/FlagPanel.d.ts +3 -3
  20. package/components/ConfigPanels/FlagPanel.js +31 -31
  21. package/components/ConfigPanels/MultiChildPanel.d.ts +9 -9
  22. package/components/ConfigPanels/MultiChildPanel.js +58 -58
  23. package/components/ConfigPanels/MultiTextPanel.d.ts +3 -3
  24. package/components/ConfigPanels/MultiTextPanel.js +14 -14
  25. package/components/ConfigPanels/NumberPanel.d.ts +3 -3
  26. package/components/ConfigPanels/NumberPanel.js +25 -25
  27. package/components/ConfigPanels/OauthPanel.d.ts +3 -3
  28. package/components/ConfigPanels/OauthPanel.js +81 -81
  29. package/components/ConfigPanels/PagesPanel.d.ts +3 -3
  30. package/components/ConfigPanels/PagesPanel.js +11 -11
  31. package/components/ConfigPanels/SelectPanel.d.ts +3 -3
  32. package/components/ConfigPanels/SelectPanel.js +27 -27
  33. package/components/ConfigPanels/TextPanel.d.ts +3 -3
  34. package/components/ConfigPanels/TextPanel.js +28 -28
  35. package/components/ConfigPanels/TimePanel.d.ts +3 -3
  36. package/components/ConfigPanels/TimePanel.js +34 -34
  37. package/components/ConfigPanels/getBrandColors.d.ts +7 -7
  38. package/components/ConfigPanels/getBrandColors.js +28 -28
  39. package/components/ConfigPanels/types.d.ts +84 -84
  40. package/components/ConfigPanels/types.js +2 -2
  41. package/components/ConfigPanels/types.js.map +1 -1
  42. package/components/ConfigPanels/useSingleChildValue.d.ts +13 -13
  43. package/components/ConfigPanels/useSingleChildValue.js +43 -43
  44. package/components/CursorMenu.d.ts +21 -21
  45. package/components/CursorMenu.js +181 -181
  46. package/components/Description.d.ts +5 -5
  47. package/components/Description.js +16 -16
  48. package/components/ExtensionApiContext.d.ts +31 -31
  49. package/components/ExtensionApiContext.js +16 -16
  50. package/components/ExternalLogin.d.ts +18 -18
  51. package/components/ExternalLogin.js +141 -141
  52. package/components/Filter.d.ts +15 -15
  53. package/components/Filter.js +142 -142
  54. package/components/FormDialog.d.ts +55 -55
  55. package/components/FormDialog.js +217 -217
  56. package/components/Loading.d.ts +4 -4
  57. package/components/Loading.js +35 -35
  58. package/components/MenuItemSelect.d.ts +17 -17
  59. package/components/MenuItemSelect.js +23 -23
  60. package/components/OauthPanel.d.ts +7 -7
  61. package/components/OauthPanel.js +30 -30
  62. package/components/OauthSelect.d.ts +5 -5
  63. package/components/OauthSelect.js +25 -25
  64. package/components/PageInput.d.ts +6 -6
  65. package/components/PageInput.js +13 -13
  66. package/components/PageLink.d.ts +6 -6
  67. package/components/PageLink.js +31 -31
  68. package/components/ProgressDialog.d.ts +11 -11
  69. package/components/ProgressDialog.js +48 -48
  70. package/components/SimpleAlert.d.ts +15 -15
  71. package/components/SimpleAlert.js +47 -47
  72. package/components/Toast.d.ts +15 -15
  73. package/components/Toast.js +50 -50
  74. package/components/index.js +4 -4
  75. package/components/index.js.map +1 -1
  76. package/components.d.ts +5 -5
  77. package/components.js +170 -170
  78. package/date/constants.d.ts +3 -3
  79. package/date/constants.js +19 -19
  80. package/date/constants.js.map +1 -1
  81. package/date/index.d.ts +3 -3
  82. package/date/index.js +9 -9
  83. package/date/index.js.map +1 -1
  84. package/date/parseNlpDate.d.ts +5 -5
  85. package/date/parseNlpDate.js +226 -226
  86. package/date/parseNlpDate.js.map +1 -1
  87. package/date/parseRoamDateUid.d.ts +2 -2
  88. package/date/parseRoamDateUid.js +7 -7
  89. package/date/parseRoamDateUid.js.map +1 -1
  90. package/dom/addBlockCommand.d.ts +5 -5
  91. package/dom/addBlockCommand.js +53 -53
  92. package/dom/addBlockCommand.js.map +1 -1
  93. package/dom/addKeyboardTriggers.d.ts +11 -11
  94. package/dom/addKeyboardTriggers.js +38 -38
  95. package/dom/addKeyboardTriggers.js.map +1 -1
  96. package/dom/addOldRoamJSDependency.d.ts +2 -2
  97. package/dom/addOldRoamJSDependency.js +10 -10
  98. package/dom/addOldRoamJSDependency.js.map +1 -1
  99. package/dom/addRoamJSDependency.d.ts +2 -2
  100. package/dom/addRoamJSDependency.js +8 -8
  101. package/dom/addRoamJSDependency.js.map +1 -1
  102. package/dom/addScriptAsDependency.d.ts +6 -6
  103. package/dom/addScriptAsDependency.js +16 -16
  104. package/dom/addScriptAsDependency.js.map +1 -1
  105. package/dom/addStyle.d.ts +2 -2
  106. package/dom/addStyle.js +14 -14
  107. package/dom/addStyle.js.map +1 -1
  108. package/dom/constants.d.ts +1 -1
  109. package/dom/constants.js +4 -4
  110. package/dom/constants.js.map +1 -1
  111. package/dom/createBlockObserver.d.ts +7 -7
  112. package/dom/createBlockObserver.js +43 -43
  113. package/dom/createBlockObserver.js.map +1 -1
  114. package/dom/createButtonObserver.d.ts +6 -6
  115. package/dom/createButtonObserver.js +21 -21
  116. package/dom/createButtonObserver.js.map +1 -1
  117. package/dom/createDivObserver.d.ts +2 -2
  118. package/dom/createDivObserver.js +13 -13
  119. package/dom/createDivObserver.js.map +1 -1
  120. package/dom/createHTMLObserver.d.ts +8 -8
  121. package/dom/createHTMLObserver.js +24 -24
  122. package/dom/createHTMLObserver.js.map +1 -1
  123. package/dom/createHashtagObserver.d.ts +5 -5
  124. package/dom/createHashtagObserver.js +16 -16
  125. package/dom/createHashtagObserver.js.map +1 -1
  126. package/dom/createIconButton.d.ts +2 -2
  127. package/dom/createIconButton.js +12 -12
  128. package/dom/createIconButton.js.map +1 -1
  129. package/dom/createObserver.d.ts +2 -2
  130. package/dom/createObserver.js +9 -9
  131. package/dom/createObserver.js.map +1 -1
  132. package/dom/createOverlayObserver.d.ts +2 -2
  133. package/dom/createOverlayObserver.js +6 -6
  134. package/dom/createOverlayObserver.js.map +1 -1
  135. package/dom/createPageObserver.d.ts +2 -2
  136. package/dom/createPageObserver.js +34 -34
  137. package/dom/createPageObserver.js.map +1 -1
  138. package/dom/createPageTitleObserver.d.ts +6 -6
  139. package/dom/createPageTitleObserver.js +31 -31
  140. package/dom/createPageTitleObserver.js.map +1 -1
  141. package/dom/elToTitle.d.ts +2 -2
  142. package/dom/elToTitle.js +22 -22
  143. package/dom/elToTitle.js.map +1 -1
  144. package/dom/genericError.d.ts +3 -3
  145. package/dom/genericError.js +11 -11
  146. package/dom/genericError.js.map +1 -1
  147. package/dom/getActiveUids.d.ts +3 -3
  148. package/dom/getActiveUids.js +6 -6
  149. package/dom/getActiveUids.js.map +1 -1
  150. package/dom/getBlockUidFromTarget.d.ts +2 -2
  151. package/dom/getBlockUidFromTarget.js +33 -33
  152. package/dom/getBlockUidFromTarget.js.map +1 -1
  153. package/dom/getCurrentPageUid.d.ts +2 -2
  154. package/dom/getCurrentPageUid.js +8 -8
  155. package/dom/getCurrentPageUid.js.map +1 -1
  156. package/dom/getDomRefs.d.ts +2 -2
  157. package/dom/getDomRefs.js +12 -12
  158. package/dom/getDomRefs.js.map +1 -1
  159. package/dom/getDropUidOffset.d.ts +5 -5
  160. package/dom/getDropUidOffset.js +27 -27
  161. package/dom/getDropUidOffset.js.map +1 -1
  162. package/dom/getMutatedNodes.d.ts +7 -7
  163. package/dom/getMutatedNodes.js +11 -11
  164. package/dom/getMutatedNodes.js.map +1 -1
  165. package/dom/getPageTitleByHtmlElement.d.ts +2 -2
  166. package/dom/getPageTitleByHtmlElement.js +12 -12
  167. package/dom/getPageTitleByHtmlElement.js.map +1 -1
  168. package/dom/getPageTitleValueByHtmlElement.d.ts +2 -2
  169. package/dom/getPageTitleValueByHtmlElement.js +9 -9
  170. package/dom/getPageTitleValueByHtmlElement.js.map +1 -1
  171. package/dom/getReferenceBlockUid.d.ts +2 -2
  172. package/dom/getReferenceBlockUid.js +18 -18
  173. package/dom/getReferenceBlockUid.js.map +1 -1
  174. package/dom/getRoamUrl.d.ts +2 -2
  175. package/dom/getRoamUrl.js +4 -4
  176. package/dom/getRoamUrl.js.map +1 -1
  177. package/dom/getRoamUrlByPage.d.ts +2 -2
  178. package/dom/getRoamUrlByPage.js +10 -10
  179. package/dom/getRoamUrlByPage.js.map +1 -1
  180. package/dom/getUids.d.ts +3 -3
  181. package/dom/getUids.js +8 -8
  182. package/dom/getUids.js.map +1 -1
  183. package/dom/getUidsFromButton.d.ts +3 -3
  184. package/dom/getUidsFromButton.js +8 -8
  185. package/dom/getUidsFromButton.js.map +1 -1
  186. package/dom/getUidsFromId.d.ts +5 -5
  187. package/dom/getUidsFromId.js +15 -15
  188. package/dom/getUidsFromId.js.map +1 -1
  189. package/dom/index.d.ts +30 -30
  190. package/dom/index.js +63 -63
  191. package/dom/index.js.map +1 -1
  192. package/dom/parseRoamBlocksToHtml.d.ts +11 -11
  193. package/dom/parseRoamBlocksToHtml.js +79 -79
  194. package/dom/parseRoamBlocksToHtml.js.map +1 -1
  195. package/dom/resolveRefs.d.ts +2 -2
  196. package/dom/resolveRefs.js +24 -24
  197. package/dom/resolveRefs.js.map +1 -1
  198. package/events/index.d.ts +1 -1
  199. package/events/index.js +8 -8
  200. package/events/index.js.map +1 -1
  201. package/events/watchOnce.d.ts +3 -3
  202. package/events/watchOnce.js +12 -12
  203. package/events/watchOnce.js.map +1 -1
  204. package/hooks/index.d.ts +2 -2
  205. package/hooks/index.js +10 -10
  206. package/hooks/index.js.map +1 -1
  207. package/hooks/useArrowKeyDown.d.ts +10 -10
  208. package/hooks/useArrowKeyDown.js +54 -54
  209. package/hooks/useArrowKeyDown.js.map +1 -1
  210. package/hooks/useSubTree.d.ts +3 -3
  211. package/hooks/useSubTree.js +11 -11
  212. package/hooks/useSubTree.js.map +1 -1
  213. package/marked/index.d.ts +25 -25
  214. package/marked/index.js +567 -567
  215. package/marked/index.js.map +1 -1
  216. package/package.json +116 -117
  217. package/queries/compileDatalog.d.ts +3 -3
  218. package/queries/compileDatalog.js +63 -63
  219. package/queries/compileDatalog.js.map +1 -1
  220. package/queries/getAllBlockUids.d.ts +2 -2
  221. package/queries/getAllBlockUids.js +6 -6
  222. package/queries/getAllBlockUids.js.map +1 -1
  223. package/queries/getAllBlockUidsAndTexts.d.ts +5 -5
  224. package/queries/getAllBlockUidsAndTexts.js +6 -6
  225. package/queries/getAllBlockUidsAndTexts.js.map +1 -1
  226. package/queries/getAllPageNames.d.ts +2 -2
  227. package/queries/getAllPageNames.js +6 -6
  228. package/queries/getAllPageNames.js.map +1 -1
  229. package/queries/getAttributeValueByBlockAndName.d.ts +5 -5
  230. package/queries/getAttributeValueByBlockAndName.js +11 -11
  231. package/queries/getAttributeValueByBlockAndName.js.map +1 -1
  232. package/queries/getBasicTreeByParentUid.d.ts +3 -3
  233. package/queries/getBasicTreeByParentUid.js +13 -13
  234. package/queries/getBasicTreeByParentUid.js.map +1 -1
  235. package/queries/getBlockUidAndTextIncludingText.d.ts +5 -5
  236. package/queries/getBlockUidAndTextIncludingText.js +7 -7
  237. package/queries/getBlockUidAndTextIncludingText.js.map +1 -1
  238. package/queries/getBlockUidByTextOnPage.d.ts +5 -5
  239. package/queries/getBlockUidByTextOnPage.js +7 -7
  240. package/queries/getBlockUidByTextOnPage.js.map +1 -1
  241. package/queries/getBlockUidsAndTextsReferencingPage.d.ts +5 -5
  242. package/queries/getBlockUidsAndTextsReferencingPage.js +9 -9
  243. package/queries/getBlockUidsAndTextsReferencingPage.js.map +1 -1
  244. package/queries/getBlockUidsByPageTitle.d.ts +2 -2
  245. package/queries/getBlockUidsByPageTitle.js +8 -8
  246. package/queries/getBlockUidsByPageTitle.js.map +1 -1
  247. package/queries/getBlockUidsReferencingBlock.d.ts +2 -2
  248. package/queries/getBlockUidsReferencingBlock.js +4 -4
  249. package/queries/getBlockUidsReferencingBlock.js.map +1 -1
  250. package/queries/getBlockUidsReferencingPage.d.ts +2 -2
  251. package/queries/getBlockUidsReferencingPage.js +6 -6
  252. package/queries/getBlockUidsReferencingPage.js.map +1 -1
  253. package/queries/getBlockUidsWithParentUid.d.ts +2 -2
  254. package/queries/getBlockUidsWithParentUid.js +6 -6
  255. package/queries/getBlockUidsWithParentUid.js.map +1 -1
  256. package/queries/getChildrenLengthByPageUid.d.ts +2 -2
  257. package/queries/getChildrenLengthByPageUid.js +8 -8
  258. package/queries/getChildrenLengthByPageUid.js.map +1 -1
  259. package/queries/getChildrenLengthByParentUid.d.ts +2 -2
  260. package/queries/getChildrenLengthByParentUid.js +7 -7
  261. package/queries/getChildrenLengthByParentUid.js.map +1 -1
  262. package/queries/getCreateTimeByBlockUid.d.ts +2 -2
  263. package/queries/getCreateTimeByBlockUid.js +7 -7
  264. package/queries/getCreateTimeByBlockUid.js.map +1 -1
  265. package/queries/getCurrentUser.d.ts +2 -2
  266. package/queries/getCurrentUser.js +11 -11
  267. package/queries/getCurrentUser.js.map +1 -1
  268. package/queries/getCurrentUserDisplayName.d.ts +2 -2
  269. package/queries/getCurrentUserDisplayName.js +10 -10
  270. package/queries/getCurrentUserDisplayName.js.map +1 -1
  271. package/queries/getCurrentUserEmail.d.ts +2 -2
  272. package/queries/getCurrentUserEmail.js +13 -13
  273. package/queries/getCurrentUserEmail.js.map +1 -1
  274. package/queries/getCurrentUserUid.d.ts +2 -2
  275. package/queries/getCurrentUserUid.js +13 -13
  276. package/queries/getCurrentUserUid.js.map +1 -1
  277. package/queries/getDisplayNameByEmail.d.ts +2 -2
  278. package/queries/getDisplayNameByEmail.js +7 -7
  279. package/queries/getDisplayNameByEmail.js.map +1 -1
  280. package/queries/getDisplayNameByUid.d.ts +2 -2
  281. package/queries/getDisplayNameByUid.js +7 -7
  282. package/queries/getDisplayNameByUid.js.map +1 -1
  283. package/queries/getEditTimeByBlockUid.d.ts +2 -2
  284. package/queries/getEditTimeByBlockUid.js +7 -7
  285. package/queries/getEditTimeByBlockUid.js.map +1 -1
  286. package/queries/getEditedUserEmailByBlockUid.d.ts +2 -2
  287. package/queries/getEditedUserEmailByBlockUid.js +7 -7
  288. package/queries/getEditedUserEmailByBlockUid.js.map +1 -1
  289. package/queries/getFirstChildTextByBlockUid.d.ts +2 -2
  290. package/queries/getFirstChildTextByBlockUid.js +7 -7
  291. package/queries/getFirstChildTextByBlockUid.js.map +1 -1
  292. package/queries/getFirstChildUidByBlockUid.d.ts +2 -2
  293. package/queries/getFirstChildUidByBlockUid.js +6 -6
  294. package/queries/getFirstChildUidByBlockUid.js.map +1 -1
  295. package/queries/getFullTreeByParentUid.d.ts +3 -3
  296. package/queries/getFullTreeByParentUid.js +51 -51
  297. package/queries/getFullTreeByParentUid.js.map +1 -1
  298. package/queries/getLinkedPageTitlesUnderUid.d.ts +2 -2
  299. package/queries/getLinkedPageTitlesUnderUid.js +6 -6
  300. package/queries/getLinkedPageTitlesUnderUid.js.map +1 -1
  301. package/queries/getNthChildUidByBlockUid.d.ts +5 -5
  302. package/queries/getNthChildUidByBlockUid.js +7 -7
  303. package/queries/getNthChildUidByBlockUid.js.map +1 -1
  304. package/queries/getOrderByBlockUid.d.ts +2 -2
  305. package/queries/getOrderByBlockUid.js +7 -7
  306. package/queries/getOrderByBlockUid.js.map +1 -1
  307. package/queries/getPageTitleByBlockUid.d.ts +2 -2
  308. package/queries/getPageTitleByBlockUid.js +7 -7
  309. package/queries/getPageTitleByBlockUid.js.map +1 -1
  310. package/queries/getPageTitleByPageUid.d.ts +2 -2
  311. package/queries/getPageTitleByPageUid.js +12 -12
  312. package/queries/getPageTitleByPageUid.js.map +1 -1
  313. package/queries/getPageTitleReferencesByPageTitle.d.ts +2 -2
  314. package/queries/getPageTitleReferencesByPageTitle.js +6 -6
  315. package/queries/getPageTitleReferencesByPageTitle.js.map +1 -1
  316. package/queries/getPageTitlesAndBlockUidsReferencingPage.d.ts +5 -5
  317. package/queries/getPageTitlesAndBlockUidsReferencingPage.js +9 -9
  318. package/queries/getPageTitlesAndBlockUidsReferencingPage.js.map +1 -1
  319. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.d.ts +5 -5
  320. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js +9 -9
  321. package/queries/getPageTitlesAndUidsDirectlyReferencingPage.js.map +1 -1
  322. package/queries/getPageTitlesReferencingBlockUid.d.ts +2 -2
  323. package/queries/getPageTitlesReferencingBlockUid.js +4 -4
  324. package/queries/getPageTitlesReferencingBlockUid.js.map +1 -1
  325. package/queries/getPageTitlesStartingWithPrefix.d.ts +2 -2
  326. package/queries/getPageTitlesStartingWithPrefix.js +6 -6
  327. package/queries/getPageTitlesStartingWithPrefix.js.map +1 -1
  328. package/queries/getPageUidByBlockUid.d.ts +2 -2
  329. package/queries/getPageUidByBlockUid.js +7 -7
  330. package/queries/getPageUidByBlockUid.js.map +1 -1
  331. package/queries/getPageUidByPageTitle.d.ts +2 -2
  332. package/queries/getPageUidByPageTitle.js +9 -9
  333. package/queries/getPageUidByPageTitle.js.map +1 -1
  334. package/queries/getPageViewType.d.ts +3 -3
  335. package/queries/getPageViewType.js +9 -9
  336. package/queries/getPageViewType.js.map +1 -1
  337. package/queries/getParentTextByBlockUid.d.ts +2 -2
  338. package/queries/getParentTextByBlockUid.js +7 -7
  339. package/queries/getParentTextByBlockUid.js.map +1 -1
  340. package/queries/getParentTextByBlockUidAndTag.d.ts +5 -5
  341. package/queries/getParentTextByBlockUidAndTag.js +7 -7
  342. package/queries/getParentTextByBlockUidAndTag.js.map +1 -1
  343. package/queries/getParentUidByBlockUid.d.ts +2 -2
  344. package/queries/getParentUidByBlockUid.js +7 -7
  345. package/queries/getParentUidByBlockUid.js.map +1 -1
  346. package/queries/getParentUidsOfBlockUid.d.ts +2 -2
  347. package/queries/getParentUidsOfBlockUid.js +4 -4
  348. package/queries/getParentUidsOfBlockUid.js.map +1 -1
  349. package/queries/getSettingsByEmail.d.ts +3 -3
  350. package/queries/getSettingsByEmail.js +7 -7
  351. package/queries/getSettingsByEmail.js.map +1 -1
  352. package/queries/getShallowTreeByParentUid.d.ts +5 -5
  353. package/queries/getShallowTreeByParentUid.js +9 -9
  354. package/queries/getShallowTreeByParentUid.js.map +1 -1
  355. package/queries/getTextByBlockUid.d.ts +2 -2
  356. package/queries/getTextByBlockUid.js +9 -9
  357. package/queries/getTextByBlockUid.js.map +1 -1
  358. package/queries/index.js +4 -4
  359. package/queries/index.js.map +1 -1
  360. package/queries/isLiveBlock.d.ts +2 -2
  361. package/queries/isLiveBlock.js +4 -4
  362. package/queries/isLiveBlock.js.map +1 -1
  363. package/queries/isTagOnPage.d.ts +5 -5
  364. package/queries/isTagOnPage.js +9 -9
  365. package/queries/isTagOnPage.js.map +1 -1
  366. package/queries/normalizePageTitle.d.ts +2 -2
  367. package/queries/normalizePageTitle.js +4 -4
  368. package/queries/normalizePageTitle.js.map +1 -1
  369. package/scripts/index.d.ts +1 -1
  370. package/scripts/index.js +26 -26
  371. package/scripts/index.js.map +1 -1
  372. package/scripts/publishToRoamDepot.d.ts +7 -7
  373. package/scripts/publishToRoamDepot.js +113 -113
  374. package/scripts/publishToRoamDepot.js.map +1 -1
  375. package/testing/mockRoamEnvironment.d.ts +2 -2
  376. package/testing/mockRoamEnvironment.js +1253 -1253
  377. package/testing/mockRoamEnvironment.js.map +1 -1
  378. package/types/index.d.ts +250 -250
  379. package/types/index.js +4 -4
  380. package/types/index.js.map +1 -1
  381. package/types/native.d.ts +402 -402
  382. package/types/native.js +4 -4
  383. package/types/native.js.map +1 -1
  384. package/types/query-builder.d.ts +10 -10
  385. package/types/query-builder.js +2 -2
  386. package/types/query-builder.js.map +1 -1
  387. package/types/smartblocks.d.ts +35 -35
  388. package/types/smartblocks.js +2 -2
  389. package/types/smartblocks.js.map +1 -1
  390. package/util/addInputSetting.d.ts +7 -7
  391. package/util/addInputSetting.js +25 -25
  392. package/util/addInputSetting.js.map +1 -1
  393. package/util/apiDelete.d.ts +2 -2
  394. package/util/apiDelete.js +6 -6
  395. package/util/apiDelete.js.map +1 -1
  396. package/util/apiGet.d.ts +2 -2
  397. package/util/apiGet.js +6 -6
  398. package/util/apiGet.js.map +1 -1
  399. package/util/apiPost.d.ts +2 -2
  400. package/util/apiPost.js +6 -6
  401. package/util/apiPost.js.map +1 -1
  402. package/util/apiPut.d.ts +2 -2
  403. package/util/apiPut.js +6 -6
  404. package/util/apiPut.js.map +1 -1
  405. package/util/createOverlayRender.d.ts +4 -4
  406. package/util/createOverlayRender.js +6 -6
  407. package/util/createOverlayRender.js.map +1 -1
  408. package/util/createTagRegex.d.ts +2 -2
  409. package/util/createTagRegex.js +7 -7
  410. package/util/createTagRegex.js.map +1 -1
  411. package/util/dispatchToRegistry.d.ts +3 -3
  412. package/util/dispatchToRegistry.js +7 -7
  413. package/util/dispatchToRegistry.js.map +1 -1
  414. package/util/env.d.ts +4 -4
  415. package/util/env.js +47 -47
  416. package/util/env.js.map +1 -1
  417. package/util/extensionApiContext.d.ts +29 -29
  418. package/util/extensionApiContext.js +17 -17
  419. package/util/extensionApiContext.js.map +1 -1
  420. package/util/extensionDeprecatedWarning.d.ts +5 -5
  421. package/util/extensionDeprecatedWarning.js +39 -39
  422. package/util/extensionDeprecatedWarning.js.map +1 -1
  423. package/util/extractRef.d.ts +2 -2
  424. package/util/extractRef.js +8 -8
  425. package/util/extractRef.js.map +1 -1
  426. package/util/extractTag.d.ts +2 -2
  427. package/util/extractTag.js +15 -15
  428. package/util/extractTag.js.map +1 -1
  429. package/util/focusMainWindowBlock.d.ts +2 -2
  430. package/util/focusMainWindowBlock.js +12 -12
  431. package/util/focusMainWindowBlock.js.map +1 -1
  432. package/util/getAuthorizationHeader.d.ts +2 -2
  433. package/util/getAuthorizationHeader.js +12 -12
  434. package/util/getAuthorizationHeader.js.map +1 -1
  435. package/util/getLocalStorageKey.d.ts +2 -2
  436. package/util/getLocalStorageKey.js +4 -4
  437. package/util/getLocalStorageKey.js.map +1 -1
  438. package/util/getOauth.d.ts +2 -2
  439. package/util/getOauth.js +52 -52
  440. package/util/getOauth.js.map +1 -1
  441. package/util/getOauthAccounts.d.ts +2 -2
  442. package/util/getOauthAccounts.js +22 -22
  443. package/util/getOauthAccounts.js.map +1 -1
  444. package/util/getRenderRoot.d.ts +2 -2
  445. package/util/getRenderRoot.js +18 -18
  446. package/util/getRenderRoot.js.map +1 -1
  447. package/util/getSettingIntFromTree.d.ts +7 -7
  448. package/util/getSettingIntFromTree.js +11 -11
  449. package/util/getSettingIntFromTree.js.map +1 -1
  450. package/util/getSettingValueFromTree.d.ts +8 -8
  451. package/util/getSettingValueFromTree.js +14 -14
  452. package/util/getSettingValueFromTree.js.map +1 -1
  453. package/util/getSettingValuesFromTree.d.ts +7 -7
  454. package/util/getSettingValuesFromTree.js +12 -12
  455. package/util/getSettingValuesFromTree.js.map +1 -1
  456. package/util/getSubTree.d.ts +8 -8
  457. package/util/getSubTree.js +19 -19
  458. package/util/getSubTree.js.map +1 -1
  459. package/util/getToken.d.ts +2 -2
  460. package/util/getToken.js +10 -10
  461. package/util/getToken.js.map +1 -1
  462. package/util/getTokenFromTree.d.ts +3 -3
  463. package/util/getTokenFromTree.js +4 -4
  464. package/util/getTokenFromTree.js.map +1 -1
  465. package/util/getWorkerClient.d.ts +12 -12
  466. package/util/getWorkerClient.js +41 -41
  467. package/util/getWorkerClient.js.map +1 -1
  468. package/util/handleBodyFetch.d.ts +3 -3
  469. package/util/handleBodyFetch.js +21 -21
  470. package/util/handleBodyFetch.js.map +1 -1
  471. package/util/handleFetch.d.ts +13 -13
  472. package/util/handleFetch.js +40 -40
  473. package/util/handleFetch.js.map +1 -1
  474. package/util/handleUrlFetch.d.ts +3 -3
  475. package/util/handleUrlFetch.js +19 -19
  476. package/util/handleUrlFetch.js.map +1 -1
  477. package/util/idToTitle.d.ts +2 -2
  478. package/util/idToTitle.js +8 -8
  479. package/util/idToTitle.js.map +1 -1
  480. package/util/index.d.ts +24 -24
  481. package/util/index.js +54 -54
  482. package/util/index.js.map +1 -1
  483. package/util/isControl.d.ts +2 -2
  484. package/util/isControl.js +4 -4
  485. package/util/isControl.js.map +1 -1
  486. package/util/localStorageGet.d.ts +2 -2
  487. package/util/localStorageGet.js +8 -8
  488. package/util/localStorageGet.js.map +1 -1
  489. package/util/localStorageRemove.d.ts +2 -2
  490. package/util/localStorageRemove.js +6 -6
  491. package/util/localStorageRemove.js.map +1 -1
  492. package/util/localStorageSet.d.ts +2 -2
  493. package/util/localStorageSet.js +8 -8
  494. package/util/localStorageSet.js.map +1 -1
  495. package/util/registerExperimentalMode.d.ts +6 -6
  496. package/util/registerExperimentalMode.js +65 -65
  497. package/util/registerExperimentalMode.js.map +1 -1
  498. package/util/registerSmartBlocksCommand.d.ts +3 -3
  499. package/util/registerSmartBlocksCommand.js +23 -23
  500. package/util/registerSmartBlocksCommand.js.map +1 -1
  501. package/util/removeFromRegistry.d.ts +3 -3
  502. package/util/removeFromRegistry.js +7 -7
  503. package/util/removeFromRegistry.js.map +1 -1
  504. package/util/renderOverlay.d.ts +12 -12
  505. package/util/renderOverlay.js +48 -48
  506. package/util/renderOverlay.js.map +1 -1
  507. package/util/renderWithUnmount.d.ts +4 -4
  508. package/util/renderWithUnmount.js +44 -44
  509. package/util/renderWithUnmount.js.map +1 -1
  510. package/util/runExtension.d.ts +11 -11
  511. package/util/runExtension.js +174 -174
  512. package/util/runExtension.js.map +1 -1
  513. package/util/setInputSetting.d.ts +7 -7
  514. package/util/setInputSetting.js +37 -37
  515. package/util/setInputSetting.js.map +1 -1
  516. package/util/setInputSettings.d.ts +7 -7
  517. package/util/setInputSettings.js +28 -28
  518. package/util/setInputSettings.js.map +1 -1
  519. package/util/stripUid.d.ts +3 -3
  520. package/util/stripUid.js +10 -10
  521. package/util/stripUid.js.map +1 -1
  522. package/util/toConfigPageName.d.ts +2 -2
  523. package/util/toConfigPageName.js +4 -4
  524. package/util/toConfigPageName.js.map +1 -1
  525. package/util/toFlexRegex.d.ts +2 -2
  526. package/util/toFlexRegex.js +4 -4
  527. package/util/toFlexRegex.js.map +1 -1
  528. package/writes/clearBlockById.d.ts +2 -2
  529. package/writes/clearBlockById.js +17 -17
  530. package/writes/clearBlockById.js.map +1 -1
  531. package/writes/clearBlockByUid.d.ts +2 -2
  532. package/writes/clearBlockByUid.js +16 -16
  533. package/writes/clearBlockByUid.js.map +1 -1
  534. package/writes/createBlock.d.ts +8 -8
  535. package/writes/createBlock.js +28 -28
  536. package/writes/createBlock.js.map +1 -1
  537. package/writes/createPage.d.ts +7 -7
  538. package/writes/createPage.js +20 -20
  539. package/writes/createPage.js.map +1 -1
  540. package/writes/deleteBlock.d.ts +2 -2
  541. package/writes/deleteBlock.js +10 -10
  542. package/writes/deleteBlock.js.map +1 -1
  543. package/writes/index.d.ts +8 -8
  544. package/writes/index.js +22 -22
  545. package/writes/index.js.map +1 -1
  546. package/writes/openBlockInSidebar.d.ts +2 -2
  547. package/writes/openBlockInSidebar.js +13 -13
  548. package/writes/openBlockInSidebar.js.map +1 -1
  549. package/writes/submitActions.d.ts +8 -8
  550. package/writes/submitActions.js +36 -36
  551. package/writes/submitActions.js.map +1 -1
  552. package/writes/updateActiveBlock.d.ts +2 -2
  553. package/writes/updateActiveBlock.js +17 -17
  554. package/writes/updateActiveBlock.js.map +1 -1
  555. package/writes/updateBlock.d.ts +5 -5
  556. package/writes/updateBlock.js +23 -23
  557. package/writes/updateBlock.js.map +1 -1
package/types/index.d.ts CHANGED
@@ -1,250 +1,250 @@
1
- import { AddPullWatch, PullBlock, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
2
- import { RunQuery, ListActiveQueries, RunQuerySync, IsDiscourseNode } from "./query-builder";
3
- import { RegisterCommand, UnregisterCommand } from "./smartblocks";
4
- import type marked from "marked";
5
- import type Markdown from "marked-react";
6
- import type JSZip from "jszip";
7
- import type cytoscape from "cytoscape";
8
- export * from "./native";
9
- export declare type Registry = {
10
- elements: HTMLElement[];
11
- reactRoots: HTMLElement[];
12
- observers: MutationObserver[];
13
- domListeners: ({
14
- el: Window;
15
- type: keyof WindowEventMap;
16
- listener: (this: Window, ev: WindowEventMap[keyof WindowEventMap]) => void;
17
- } | {
18
- el: Document;
19
- type: keyof DocumentEventMap;
20
- listener: (this: Document, ev: DocumentEventMap[keyof DocumentEventMap]) => void;
21
- } | {
22
- el: HTMLElement;
23
- type: keyof HTMLElementEventMap | `roamjs:${string}`;
24
- listener: (this: HTMLElement, ev: HTMLElementEventMap[keyof HTMLElementEventMap]) => void;
25
- })[];
26
- commands: string[];
27
- timeouts: {
28
- timeout: number;
29
- }[];
30
- };
31
- declare global {
32
- interface Window {
33
- RoamLazy?: {
34
- JSZip: () => Promise<typeof JSZip>;
35
- Marked: () => Promise<typeof marked>;
36
- MarkedReact: () => Promise<typeof Markdown>;
37
- Cytoscape: () => Promise<typeof cytoscape>;
38
- Insect: () => Promise<{
39
- commands: string[];
40
- fmtConsole: (M: unknown) => unknown;
41
- fmtJqueryTerminal: (M: unknown) => unknown;
42
- fmtPlain: (M: unknown) => unknown;
43
- functions: (M: unknown) => unknown;
44
- identifiers: (M: unknown) => unknown;
45
- initialEnvironment: {
46
- values: unknown;
47
- functions: unknown;
48
- };
49
- repl: (fmt: (M: unknown) => unknown) => (env: {
50
- values: unknown;
51
- functions: unknown;
52
- }) => (s: string) => {
53
- msg: string;
54
- };
55
- }>;
56
- };
57
- roamAlphaAPI: {
58
- q: (query: string, ...params: unknown[]) => unknown[][];
59
- pull: (selector: string, id: number | string | [string, string]) => PullBlock;
60
- createBlock: WriteAction;
61
- updateBlock: WriteAction;
62
- createPage: WriteAction;
63
- moveBlock: WriteAction;
64
- deleteBlock: WriteAction;
65
- updatePage: WriteAction;
66
- deletePage: WriteAction;
67
- util: {
68
- generateUID: () => string;
69
- dateToPageTitle: (date: Date) => string;
70
- dateToPageUid: (date: Date) => string;
71
- pageTitleToDate: (title: string) => Date | null;
72
- uploadFile: (args: {
73
- file: File;
74
- }) => string;
75
- };
76
- data: {
77
- addPullWatch: AddPullWatch;
78
- block: {
79
- create: WriteAction;
80
- update: WriteAction;
81
- move: WriteAction;
82
- delete: WriteAction;
83
- };
84
- fast: {
85
- q: (query: string, ...params: unknown[]) => unknown[][];
86
- };
87
- page: {
88
- create: WriteAction;
89
- update: WriteAction;
90
- delete: WriteAction;
91
- };
92
- pull: (selector: string, id: number | string | [string, string]) => PullBlock;
93
- pull_many: (pattern: string, eid: string[][]) => PullBlock[];
94
- q: (query: string, ...params: unknown[]) => unknown[][];
95
- removePullWatch: (pullPattern: string, entityId: string, callback?: (before: PullBlock, after: PullBlock) => void) => boolean;
96
- redo: () => void;
97
- undo: () => void;
98
- user: {
99
- upsert: () => void;
100
- };
101
- };
102
- ui: {
103
- leftSidebar: {
104
- open: () => Promise<void>;
105
- close: () => Promise<void>;
106
- };
107
- rightSidebar: {
108
- open: () => Promise<void>;
109
- close: () => Promise<void>;
110
- getWindows: () => SidebarWindow[];
111
- addWindow: SidebarAction;
112
- setWindowOrder: (action: {
113
- window: SidebarWindowInput & {
114
- order: number;
115
- };
116
- }) => Promise<void>;
117
- collapseWindow: SidebarAction;
118
- pinWindow: SidebarAction;
119
- expandWindow: SidebarAction;
120
- removeWindow: SidebarAction;
121
- unpinWindow: SidebarAction;
122
- };
123
- commandPalette: {
124
- addCommand: (action: {
125
- label: string;
126
- callback: () => void;
127
- }) => Promise<void>;
128
- removeCommand: (action: {
129
- label: string;
130
- }) => Promise<void>;
131
- };
132
- blockContextMenu: {
133
- addCommand: (action: {
134
- label: string;
135
- callback: (props: {
136
- "block-string": string;
137
- "block-uid": string;
138
- heading: 0 | 1 | 2 | 3 | null;
139
- "page-uid": string;
140
- "read-only?": boolean;
141
- "window-id": string;
142
- }) => void;
143
- }) => void;
144
- removeCommand: (action: {
145
- label: string;
146
- }) => void;
147
- };
148
- getFocusedBlock: () => null | {
149
- "window-id": string;
150
- "block-uid": string;
151
- };
152
- components: {
153
- renderBlock: (args: {
154
- uid: string;
155
- el: HTMLElement;
156
- zoomPath?: boolean;
157
- }) => null;
158
- renderPage: (args: {
159
- uid: string;
160
- el: HTMLElement;
161
- hideMentions?: boolean;
162
- }) => null;
163
- };
164
- graphView: {
165
- wholeGraph: {
166
- addCallback: (props: {
167
- label: string;
168
- callback: (arg: {
169
- "sigma-renderer": unknown;
170
- }) => void;
171
- }) => any;
172
- removeCallback: (props: {
173
- label: string;
174
- }) => void;
175
- setExplorePages: (pages: string[]) => void;
176
- getExplorePages: () => string[];
177
- setMode: (mode: "Whole Graph" | "Explore") => void;
178
- };
179
- };
180
- mainWindow: {
181
- focusFirstBlock: () => Promise<void>;
182
- openBlock: (p: {
183
- block: {
184
- uid: string;
185
- };
186
- }) => Promise<void>;
187
- openPage: (p: {
188
- page: {
189
- uid: string;
190
- } | {
191
- title: string;
192
- };
193
- }) => Promise<void>;
194
- getOpenPageOrBlockUid: () => Promise<string | null>;
195
- openDailyNotes: () => Promise<void>;
196
- };
197
- setBlockFocusAndSelection: (a: {
198
- location?: {
199
- "block-uid": string;
200
- "window-id": string;
201
- };
202
- selection?: {
203
- start: number;
204
- end?: number;
205
- };
206
- }) => Promise<void>;
207
- };
208
- platform: {
209
- isDesktop: boolean;
210
- isIOS: boolean;
211
- isMobile: boolean;
212
- isMobileApp: boolean;
213
- isPC: boolean;
214
- isTouchDevice: boolean;
215
- };
216
- graph: {
217
- name: string;
218
- type: "hosted" | "offline";
219
- isEncrypted: boolean;
220
- };
221
- };
222
- roamjs: {
223
- loaded: Set<string>;
224
- extension: {
225
- queryBuilder?: {
226
- runQuery: RunQuery;
227
- runQuerySync: RunQuerySync;
228
- listActiveQueries: ListActiveQueries;
229
- isDiscourseNode: IsDiscourseNode;
230
- };
231
- smartblocks?: {
232
- registerCommand: RegisterCommand;
233
- unregisterCommand: UnregisterCommand;
234
- triggerSmartblock: (args: {
235
- srcName?: string;
236
- srcUid?: string;
237
- targetName?: string;
238
- targetUid?: string;
239
- variables?: Record<string, string>;
240
- }) => Promise<unknown>;
241
- };
242
- [id: string]: Record<string, unknown> | undefined;
243
- };
244
- version: {
245
- [id: string]: string;
246
- };
247
- actions: Record<string, number>;
248
- };
249
- }
250
- }
1
+ import { AddPullWatch, PullBlock, SidebarAction, SidebarWindow, SidebarWindowInput, WriteAction } from "./native";
2
+ import { RunQuery, ListActiveQueries, RunQuerySync, IsDiscourseNode } from "./query-builder";
3
+ import { RegisterCommand, UnregisterCommand } from "./smartblocks";
4
+ import type marked from "marked";
5
+ import type Markdown from "marked-react";
6
+ import type JSZip from "jszip";
7
+ import type cytoscape from "cytoscape";
8
+ export * from "./native";
9
+ export declare type Registry = {
10
+ elements: HTMLElement[];
11
+ reactRoots: HTMLElement[];
12
+ observers: MutationObserver[];
13
+ domListeners: ({
14
+ el: Window;
15
+ type: keyof WindowEventMap;
16
+ listener: (this: Window, ev: WindowEventMap[keyof WindowEventMap]) => void;
17
+ } | {
18
+ el: Document;
19
+ type: keyof DocumentEventMap;
20
+ listener: (this: Document, ev: DocumentEventMap[keyof DocumentEventMap]) => void;
21
+ } | {
22
+ el: HTMLElement;
23
+ type: keyof HTMLElementEventMap | `roamjs:${string}`;
24
+ listener: (this: HTMLElement, ev: HTMLElementEventMap[keyof HTMLElementEventMap]) => void;
25
+ })[];
26
+ commands: string[];
27
+ timeouts: {
28
+ timeout: number;
29
+ }[];
30
+ };
31
+ declare global {
32
+ interface Window {
33
+ RoamLazy?: {
34
+ JSZip: () => Promise<typeof JSZip>;
35
+ Marked: () => Promise<typeof marked>;
36
+ MarkedReact: () => Promise<typeof Markdown>;
37
+ Cytoscape: () => Promise<typeof cytoscape>;
38
+ Insect: () => Promise<{
39
+ commands: string[];
40
+ fmtConsole: (M: unknown) => unknown;
41
+ fmtJqueryTerminal: (M: unknown) => unknown;
42
+ fmtPlain: (M: unknown) => unknown;
43
+ functions: (M: unknown) => unknown;
44
+ identifiers: (M: unknown) => unknown;
45
+ initialEnvironment: {
46
+ values: unknown;
47
+ functions: unknown;
48
+ };
49
+ repl: (fmt: (M: unknown) => unknown) => (env: {
50
+ values: unknown;
51
+ functions: unknown;
52
+ }) => (s: string) => {
53
+ msg: string;
54
+ };
55
+ }>;
56
+ };
57
+ roamAlphaAPI: {
58
+ q: (query: string, ...params: unknown[]) => unknown[][];
59
+ pull: (selector: string, id: number | string | [string, string]) => PullBlock;
60
+ createBlock: WriteAction;
61
+ updateBlock: WriteAction;
62
+ createPage: WriteAction;
63
+ moveBlock: WriteAction;
64
+ deleteBlock: WriteAction;
65
+ updatePage: WriteAction;
66
+ deletePage: WriteAction;
67
+ util: {
68
+ generateUID: () => string;
69
+ dateToPageTitle: (date: Date) => string;
70
+ dateToPageUid: (date: Date) => string;
71
+ pageTitleToDate: (title: string) => Date | null;
72
+ uploadFile: (args: {
73
+ file: File;
74
+ }) => string;
75
+ };
76
+ data: {
77
+ addPullWatch: AddPullWatch;
78
+ block: {
79
+ create: WriteAction;
80
+ update: WriteAction;
81
+ move: WriteAction;
82
+ delete: WriteAction;
83
+ };
84
+ fast: {
85
+ q: (query: string, ...params: unknown[]) => unknown[][];
86
+ };
87
+ page: {
88
+ create: WriteAction;
89
+ update: WriteAction;
90
+ delete: WriteAction;
91
+ };
92
+ pull: (selector: string, id: number | string | [string, string]) => PullBlock;
93
+ pull_many: (pattern: string, eid: string[][]) => PullBlock[];
94
+ q: (query: string, ...params: unknown[]) => unknown[][];
95
+ removePullWatch: (pullPattern: string, entityId: string, callback?: (before: PullBlock, after: PullBlock) => void) => boolean;
96
+ redo: () => void;
97
+ undo: () => void;
98
+ user: {
99
+ upsert: () => void;
100
+ };
101
+ };
102
+ ui: {
103
+ leftSidebar: {
104
+ open: () => Promise<void>;
105
+ close: () => Promise<void>;
106
+ };
107
+ rightSidebar: {
108
+ open: () => Promise<void>;
109
+ close: () => Promise<void>;
110
+ getWindows: () => SidebarWindow[];
111
+ addWindow: SidebarAction;
112
+ setWindowOrder: (action: {
113
+ window: SidebarWindowInput & {
114
+ order: number;
115
+ };
116
+ }) => Promise<void>;
117
+ collapseWindow: SidebarAction;
118
+ pinWindow: SidebarAction;
119
+ expandWindow: SidebarAction;
120
+ removeWindow: SidebarAction;
121
+ unpinWindow: SidebarAction;
122
+ };
123
+ commandPalette: {
124
+ addCommand: (action: {
125
+ label: string;
126
+ callback: () => void;
127
+ }) => Promise<void>;
128
+ removeCommand: (action: {
129
+ label: string;
130
+ }) => Promise<void>;
131
+ };
132
+ blockContextMenu: {
133
+ addCommand: (action: {
134
+ label: string;
135
+ callback: (props: {
136
+ "block-string": string;
137
+ "block-uid": string;
138
+ heading: 0 | 1 | 2 | 3 | null;
139
+ "page-uid": string;
140
+ "read-only?": boolean;
141
+ "window-id": string;
142
+ }) => void;
143
+ }) => void;
144
+ removeCommand: (action: {
145
+ label: string;
146
+ }) => void;
147
+ };
148
+ getFocusedBlock: () => null | {
149
+ "window-id": string;
150
+ "block-uid": string;
151
+ };
152
+ components: {
153
+ renderBlock: (args: {
154
+ uid: string;
155
+ el: HTMLElement;
156
+ zoomPath?: boolean;
157
+ }) => null;
158
+ renderPage: (args: {
159
+ uid: string;
160
+ el: HTMLElement;
161
+ hideMentions?: boolean;
162
+ }) => null;
163
+ };
164
+ graphView: {
165
+ wholeGraph: {
166
+ addCallback: (props: {
167
+ label: string;
168
+ callback: (arg: {
169
+ "sigma-renderer": unknown;
170
+ }) => void;
171
+ }) => any;
172
+ removeCallback: (props: {
173
+ label: string;
174
+ }) => void;
175
+ setExplorePages: (pages: string[]) => void;
176
+ getExplorePages: () => string[];
177
+ setMode: (mode: "Whole Graph" | "Explore") => void;
178
+ };
179
+ };
180
+ mainWindow: {
181
+ focusFirstBlock: () => Promise<void>;
182
+ openBlock: (p: {
183
+ block: {
184
+ uid: string;
185
+ };
186
+ }) => Promise<void>;
187
+ openPage: (p: {
188
+ page: {
189
+ uid: string;
190
+ } | {
191
+ title: string;
192
+ };
193
+ }) => Promise<void>;
194
+ getOpenPageOrBlockUid: () => Promise<string | null>;
195
+ openDailyNotes: () => Promise<void>;
196
+ };
197
+ setBlockFocusAndSelection: (a: {
198
+ location?: {
199
+ "block-uid": string;
200
+ "window-id": string;
201
+ };
202
+ selection?: {
203
+ start: number;
204
+ end?: number;
205
+ };
206
+ }) => Promise<void>;
207
+ };
208
+ platform: {
209
+ isDesktop: boolean;
210
+ isIOS: boolean;
211
+ isMobile: boolean;
212
+ isMobileApp: boolean;
213
+ isPC: boolean;
214
+ isTouchDevice: boolean;
215
+ };
216
+ graph: {
217
+ name: string;
218
+ type: "hosted" | "offline";
219
+ isEncrypted: boolean;
220
+ };
221
+ };
222
+ roamjs: {
223
+ loaded: Set<string>;
224
+ extension: {
225
+ queryBuilder?: {
226
+ runQuery: RunQuery;
227
+ runQuerySync: RunQuerySync;
228
+ listActiveQueries: ListActiveQueries;
229
+ isDiscourseNode: IsDiscourseNode;
230
+ };
231
+ smartblocks?: {
232
+ registerCommand: RegisterCommand;
233
+ unregisterCommand: UnregisterCommand;
234
+ triggerSmartblock: (args: {
235
+ srcName?: string;
236
+ srcUid?: string;
237
+ targetName?: string;
238
+ targetUid?: string;
239
+ variables?: Record<string, string>;
240
+ }) => Promise<unknown>;
241
+ };
242
+ [id: string]: Record<string, unknown> | undefined;
243
+ };
244
+ version: {
245
+ [id: string]: string;
246
+ };
247
+ actions: Record<string, number>;
248
+ };
249
+ }
250
+ }
package/types/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./native"), exports);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./native"), exports);
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAmBA,mDAAyB","sourcesContent":["import {\n AddPullWatch,\n PullBlock,\n SidebarAction,\n SidebarWindow,\n SidebarWindowInput,\n WriteAction,\n} from \"./native\";\nimport {\n RunQuery,\n ListActiveQueries,\n RunQuerySync,\n IsDiscourseNode,\n} from \"./query-builder\";\nimport { RegisterCommand, UnregisterCommand } from \"./smartblocks\";\nimport type marked from \"marked\";\nimport type Markdown from \"marked-react\";\nimport type JSZip from \"jszip\";\nimport type cytoscape from \"cytoscape\";\nexport * from \"./native\";\n\nexport type Registry = {\n elements: HTMLElement[];\n reactRoots: HTMLElement[];\n observers: MutationObserver[];\n domListeners: (\n | {\n el: Window;\n type: keyof WindowEventMap;\n listener: (\n this: Window,\n ev: WindowEventMap[keyof WindowEventMap]\n ) => void;\n }\n | {\n el: Document;\n type: keyof DocumentEventMap;\n listener: (\n this: Document,\n ev: DocumentEventMap[keyof DocumentEventMap]\n ) => void;\n }\n | {\n el: HTMLElement;\n type: keyof HTMLElementEventMap | `roamjs:${string}`;\n listener: (\n this: HTMLElement,\n ev: HTMLElementEventMap[keyof HTMLElementEventMap]\n ) => void;\n }\n )[];\n commands: string[];\n timeouts: { timeout: number }[];\n};\n\ndeclare global {\n interface Window {\n // TODO remove\n RoamLazy?: {\n JSZip: () => Promise<typeof JSZip>;\n Marked: () => Promise<typeof marked>;\n MarkedReact: () => Promise<typeof Markdown>;\n Cytoscape: () => Promise<typeof cytoscape>;\n Insect: () => Promise<{\n // insect uses purescript instead of typescript -.-\n commands: string[];\n fmtConsole: (M: unknown) => unknown;\n fmtJqueryTerminal: (M: unknown) => unknown;\n fmtPlain: (M: unknown) => unknown;\n functions: (M: unknown) => unknown;\n identifiers: (M: unknown) => unknown;\n initialEnvironment: { values: unknown; functions: unknown };\n repl: (\n fmt: (M: unknown) => unknown\n ) => (env: {\n values: unknown;\n functions: unknown;\n }) => (s: string) => { msg: string };\n }>;\n };\n // END TODO remove\n\n roamAlphaAPI: {\n q: (query: string, ...params: unknown[]) => unknown[][];\n pull: (\n selector: string,\n id: number | string | [string, string]\n ) => PullBlock;\n createBlock: WriteAction;\n updateBlock: WriteAction;\n createPage: WriteAction;\n moveBlock: WriteAction;\n deleteBlock: WriteAction;\n updatePage: WriteAction;\n deletePage: WriteAction;\n util: {\n generateUID: () => string;\n dateToPageTitle: (date: Date) => string;\n dateToPageUid: (date: Date) => string;\n pageTitleToDate: (title: string) => Date | null;\n uploadFile: (args: { file: File }) => string;\n };\n data: {\n addPullWatch: AddPullWatch;\n block: {\n create: WriteAction;\n update: WriteAction;\n move: WriteAction;\n delete: WriteAction;\n };\n fast: {\n q: (query: string, ...params: unknown[]) => unknown[][];\n };\n page: {\n create: WriteAction;\n update: WriteAction;\n delete: WriteAction;\n };\n pull: (\n selector: string,\n id: number | string | [string, string]\n ) => PullBlock;\n pull_many: (pattern: string, eid: string[][]) => PullBlock[];\n q: (query: string, ...params: unknown[]) => unknown[][];\n removePullWatch: (\n pullPattern: string,\n entityId: string,\n callback?: (before: PullBlock, after: PullBlock) => void\n ) => boolean;\n redo: () => void;\n undo: () => void;\n user: {\n upsert: () => void;\n };\n };\n ui: {\n leftSidebar: {\n open: () => Promise<void>;\n close: () => Promise<void>;\n };\n rightSidebar: {\n open: () => Promise<void>;\n close: () => Promise<void>;\n getWindows: () => SidebarWindow[];\n addWindow: SidebarAction;\n setWindowOrder: (action: {\n window: SidebarWindowInput & { order: number };\n }) => Promise<void>;\n collapseWindow: SidebarAction;\n pinWindow: SidebarAction;\n expandWindow: SidebarAction;\n removeWindow: SidebarAction;\n unpinWindow: SidebarAction;\n };\n commandPalette: {\n addCommand: (action: {\n label: string;\n callback: () => void;\n }) => Promise<void>;\n removeCommand: (action: { label: string }) => Promise<void>;\n };\n blockContextMenu: {\n addCommand: (action: {\n label: string;\n callback: (props: {\n \"block-string\": string;\n \"block-uid\": string;\n heading: 0 | 1 | 2 | 3 | null;\n \"page-uid\": string;\n \"read-only?\": boolean;\n \"window-id\": string;\n }) => void;\n }) => void;\n removeCommand: (action: { label: string }) => void;\n };\n getFocusedBlock: () => null | {\n \"window-id\": string;\n \"block-uid\": string;\n };\n components: {\n renderBlock: (args: {\n uid: string;\n el: HTMLElement;\n zoomPath?: boolean;\n }) => null;\n renderPage: (args: {\n uid: string;\n el: HTMLElement;\n hideMentions?: boolean;\n }) => null;\n };\n graphView: {\n wholeGraph: {\n addCallback: (props: {\n label: string;\n callback: (arg: { \"sigma-renderer\": unknown }) => void;\n }) => any;\n removeCallback: (props: { label: string }) => void;\n setExplorePages: (pages: string[]) => void;\n getExplorePages: () => string[];\n setMode: (mode: \"Whole Graph\" | \"Explore\") => void;\n };\n };\n mainWindow: {\n focusFirstBlock: () => Promise<void>;\n openBlock: (p: { block: { uid: string } }) => Promise<void>;\n openPage: (p: {\n page: { uid: string } | { title: string };\n }) => Promise<void>;\n getOpenPageOrBlockUid: () => Promise<string | null>;\n openDailyNotes: () => Promise<void>;\n };\n setBlockFocusAndSelection: (a: {\n location?: { \"block-uid\": string; \"window-id\": string };\n selection?: { start: number; end?: number };\n }) => Promise<void>;\n };\n platform: {\n isDesktop: boolean;\n isIOS: boolean;\n isMobile: boolean;\n isMobileApp: boolean;\n isPC: boolean;\n isTouchDevice: boolean;\n };\n graph: {\n name: string;\n type: \"hosted\" | \"offline\";\n isEncrypted: boolean;\n };\n };\n\n // roamjs namespace should only be used for methods that must be accessed across extension scripts\n roamjs: {\n loaded: Set<string>;\n extension: {\n queryBuilder?: {\n runQuery: RunQuery;\n runQuerySync: RunQuerySync;\n listActiveQueries: ListActiveQueries;\n isDiscourseNode: IsDiscourseNode;\n };\n smartblocks?: {\n registerCommand: RegisterCommand;\n unregisterCommand: UnregisterCommand;\n triggerSmartblock: (args: {\n srcName?: string;\n srcUid?: string;\n targetName?: string;\n targetUid?: string;\n variables?: Record<string, string>;\n }) => Promise<unknown>;\n };\n [id: string]: Record<string, unknown> | undefined;\n };\n version: { [id: string]: string };\n actions: Record<string, number>;\n };\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAmBA,mDAAyB","sourcesContent":["import {\r\n AddPullWatch,\r\n PullBlock,\r\n SidebarAction,\r\n SidebarWindow,\r\n SidebarWindowInput,\r\n WriteAction,\r\n} from \"./native\";\r\nimport {\r\n RunQuery,\r\n ListActiveQueries,\r\n RunQuerySync,\r\n IsDiscourseNode,\r\n} from \"./query-builder\";\r\nimport { RegisterCommand, UnregisterCommand } from \"./smartblocks\";\r\nimport type marked from \"marked\";\r\nimport type Markdown from \"marked-react\";\r\nimport type JSZip from \"jszip\";\r\nimport type cytoscape from \"cytoscape\";\r\nexport * from \"./native\";\r\n\r\nexport type Registry = {\r\n elements: HTMLElement[];\r\n reactRoots: HTMLElement[];\r\n observers: MutationObserver[];\r\n domListeners: (\r\n | {\r\n el: Window;\r\n type: keyof WindowEventMap;\r\n listener: (\r\n this: Window,\r\n ev: WindowEventMap[keyof WindowEventMap]\r\n ) => void;\r\n }\r\n | {\r\n el: Document;\r\n type: keyof DocumentEventMap;\r\n listener: (\r\n this: Document,\r\n ev: DocumentEventMap[keyof DocumentEventMap]\r\n ) => void;\r\n }\r\n | {\r\n el: HTMLElement;\r\n type: keyof HTMLElementEventMap | `roamjs:${string}`;\r\n listener: (\r\n this: HTMLElement,\r\n ev: HTMLElementEventMap[keyof HTMLElementEventMap]\r\n ) => void;\r\n }\r\n )[];\r\n commands: string[];\r\n timeouts: { timeout: number }[];\r\n};\r\n\r\ndeclare global {\r\n interface Window {\r\n // TODO remove\r\n RoamLazy?: {\r\n JSZip: () => Promise<typeof JSZip>;\r\n Marked: () => Promise<typeof marked>;\r\n MarkedReact: () => Promise<typeof Markdown>;\r\n Cytoscape: () => Promise<typeof cytoscape>;\r\n Insect: () => Promise<{\r\n // insect uses purescript instead of typescript -.-\r\n commands: string[];\r\n fmtConsole: (M: unknown) => unknown;\r\n fmtJqueryTerminal: (M: unknown) => unknown;\r\n fmtPlain: (M: unknown) => unknown;\r\n functions: (M: unknown) => unknown;\r\n identifiers: (M: unknown) => unknown;\r\n initialEnvironment: { values: unknown; functions: unknown };\r\n repl: (\r\n fmt: (M: unknown) => unknown\r\n ) => (env: {\r\n values: unknown;\r\n functions: unknown;\r\n }) => (s: string) => { msg: string };\r\n }>;\r\n };\r\n // END TODO remove\r\n\r\n roamAlphaAPI: {\r\n q: (query: string, ...params: unknown[]) => unknown[][];\r\n pull: (\r\n selector: string,\r\n id: number | string | [string, string]\r\n ) => PullBlock;\r\n createBlock: WriteAction;\r\n updateBlock: WriteAction;\r\n createPage: WriteAction;\r\n moveBlock: WriteAction;\r\n deleteBlock: WriteAction;\r\n updatePage: WriteAction;\r\n deletePage: WriteAction;\r\n util: {\r\n generateUID: () => string;\r\n dateToPageTitle: (date: Date) => string;\r\n dateToPageUid: (date: Date) => string;\r\n pageTitleToDate: (title: string) => Date | null;\r\n uploadFile: (args: { file: File }) => string;\r\n };\r\n data: {\r\n addPullWatch: AddPullWatch;\r\n block: {\r\n create: WriteAction;\r\n update: WriteAction;\r\n move: WriteAction;\r\n delete: WriteAction;\r\n };\r\n fast: {\r\n q: (query: string, ...params: unknown[]) => unknown[][];\r\n };\r\n page: {\r\n create: WriteAction;\r\n update: WriteAction;\r\n delete: WriteAction;\r\n };\r\n pull: (\r\n selector: string,\r\n id: number | string | [string, string]\r\n ) => PullBlock;\r\n pull_many: (pattern: string, eid: string[][]) => PullBlock[];\r\n q: (query: string, ...params: unknown[]) => unknown[][];\r\n removePullWatch: (\r\n pullPattern: string,\r\n entityId: string,\r\n callback?: (before: PullBlock, after: PullBlock) => void\r\n ) => boolean;\r\n redo: () => void;\r\n undo: () => void;\r\n user: {\r\n upsert: () => void;\r\n };\r\n };\r\n ui: {\r\n leftSidebar: {\r\n open: () => Promise<void>;\r\n close: () => Promise<void>;\r\n };\r\n rightSidebar: {\r\n open: () => Promise<void>;\r\n close: () => Promise<void>;\r\n getWindows: () => SidebarWindow[];\r\n addWindow: SidebarAction;\r\n setWindowOrder: (action: {\r\n window: SidebarWindowInput & { order: number };\r\n }) => Promise<void>;\r\n collapseWindow: SidebarAction;\r\n pinWindow: SidebarAction;\r\n expandWindow: SidebarAction;\r\n removeWindow: SidebarAction;\r\n unpinWindow: SidebarAction;\r\n };\r\n commandPalette: {\r\n addCommand: (action: {\r\n label: string;\r\n callback: () => void;\r\n }) => Promise<void>;\r\n removeCommand: (action: { label: string }) => Promise<void>;\r\n };\r\n blockContextMenu: {\r\n addCommand: (action: {\r\n label: string;\r\n callback: (props: {\r\n \"block-string\": string;\r\n \"block-uid\": string;\r\n heading: 0 | 1 | 2 | 3 | null;\r\n \"page-uid\": string;\r\n \"read-only?\": boolean;\r\n \"window-id\": string;\r\n }) => void;\r\n }) => void;\r\n removeCommand: (action: { label: string }) => void;\r\n };\r\n getFocusedBlock: () => null | {\r\n \"window-id\": string;\r\n \"block-uid\": string;\r\n };\r\n components: {\r\n renderBlock: (args: {\r\n uid: string;\r\n el: HTMLElement;\r\n zoomPath?: boolean;\r\n }) => null;\r\n renderPage: (args: {\r\n uid: string;\r\n el: HTMLElement;\r\n hideMentions?: boolean;\r\n }) => null;\r\n };\r\n graphView: {\r\n wholeGraph: {\r\n addCallback: (props: {\r\n label: string;\r\n callback: (arg: { \"sigma-renderer\": unknown }) => void;\r\n }) => any;\r\n removeCallback: (props: { label: string }) => void;\r\n setExplorePages: (pages: string[]) => void;\r\n getExplorePages: () => string[];\r\n setMode: (mode: \"Whole Graph\" | \"Explore\") => void;\r\n };\r\n };\r\n mainWindow: {\r\n focusFirstBlock: () => Promise<void>;\r\n openBlock: (p: { block: { uid: string } }) => Promise<void>;\r\n openPage: (p: {\r\n page: { uid: string } | { title: string };\r\n }) => Promise<void>;\r\n getOpenPageOrBlockUid: () => Promise<string | null>;\r\n openDailyNotes: () => Promise<void>;\r\n };\r\n setBlockFocusAndSelection: (a: {\r\n location?: { \"block-uid\": string; \"window-id\": string };\r\n selection?: { start: number; end?: number };\r\n }) => Promise<void>;\r\n };\r\n platform: {\r\n isDesktop: boolean;\r\n isIOS: boolean;\r\n isMobile: boolean;\r\n isMobileApp: boolean;\r\n isPC: boolean;\r\n isTouchDevice: boolean;\r\n };\r\n graph: {\r\n name: string;\r\n type: \"hosted\" | \"offline\";\r\n isEncrypted: boolean;\r\n };\r\n };\r\n\r\n // roamjs namespace should only be used for methods that must be accessed across extension scripts\r\n roamjs: {\r\n loaded: Set<string>;\r\n extension: {\r\n queryBuilder?: {\r\n runQuery: RunQuery;\r\n runQuerySync: RunQuerySync;\r\n listActiveQueries: ListActiveQueries;\r\n isDiscourseNode: IsDiscourseNode;\r\n };\r\n smartblocks?: {\r\n registerCommand: RegisterCommand;\r\n unregisterCommand: UnregisterCommand;\r\n triggerSmartblock: (args: {\r\n srcName?: string;\r\n srcUid?: string;\r\n targetName?: string;\r\n targetUid?: string;\r\n variables?: Record<string, string>;\r\n }) => Promise<unknown>;\r\n };\r\n [id: string]: Record<string, unknown> | undefined;\r\n };\r\n version: { [id: string]: string };\r\n actions: Record<string, number>;\r\n };\r\n }\r\n}\r\n"]}